hexRef8Data.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2015-2016 OpenFOAM Foundation
9  Copyright (C) 2017-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::hexRef8Data
29 
30 Description
31  Various for reading/decomposing/reconstructing/distributing refinement
32  data.
33 
34 SourceFiles
35  hexRef8Data.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef hexRef8Data_H
40 #define hexRef8Data_H
41 
42 #include "labelIOList.H"
44 #include "UPtrList.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // Forward Declarations
52 class mapPolyMesh;
53 class mapDistributePolyMesh;
54 class refinementHistory;
55 class fvMesh;
56 
57 /*---------------------------------------------------------------------------*\
58  Class hexRef8Data Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 class hexRef8Data
62 {
63  // Private Data
64 
65  autoPtr<labelIOList> cellLevelPtr_;
66 
67  autoPtr<labelIOList> pointLevelPtr_;
68 
70 
71  autoPtr<refinementHistory> refHistoryPtr_;
72 
73 
74  // Private Member Functions
75 
76  //- No copy construct
77  hexRef8Data(const hexRef8Data&) = delete;
78 
79  //- No copy assignment
80  void operator=(const hexRef8Data&) = delete;
81 
82 
83 public:
84 
85  // Constructors
86 
87  //- Construct read. Has special provision for only some processors
88  //- having the files so can be used in redistribution.
89  explicit hexRef8Data(const IOobject& io);
90 
91  //- Construct as subset
93  (
94  const IOobject& io,
95  const hexRef8Data&,
96  const labelList& cellMap,
97  const labelList& pointMap
98  );
99 
100  //- Construct from multiple hexRef8Data
102  (
103  const IOobject& io,
104  const UPtrList<const labelList>& cellMaps,
105  const UPtrList<const labelList>& pointMaps,
107  );
108 
109 
110  //- Destructor
111  ~hexRef8Data();
112 
113 
114  // Member Functions
115 
116  //- Parallel synchronise. This enforces valid objects on all processors
117  // (even if they don't have a mesh). Used by redistributePar.
118  void sync(const IOobject& io);
119 
120  //- Update local numbering for changed mesh.
121  void updateMesh(const mapPolyMesh&);
122 
123  //- In-place distribute
124  void distribute(const mapDistributePolyMesh&);
125 
126  //- Write
127  bool write() const;
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
UPtrList.H
Foam::hexRef8Data::updateMesh
void updateMesh(const mapPolyMesh &)
Update local numbering for changed mesh.
Definition: hexRef8Data.C:293
Foam::UPtrList
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: UPtrList.H:62
Foam::hexRef8Data::distribute
void distribute(const mapDistributePolyMesh &)
In-place distribute.
Definition: hexRef8Data.C:364
Foam::hexRef8Data
Various for reading/decomposing/reconstructing/distributing refinement data.
Definition: hexRef8Data.H:60
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::hexRef8Data::sync
void sync(const IOobject &io)
Parallel synchronise. This enforces valid objects on all processors.
Definition: hexRef8Data.C:236
uniformDimensionedFields.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::hexRef8Data::write
bool write() const
Write.
Definition: hexRef8Data.C:384
Foam::List< label >
labelIOList.H
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
Foam::hexRef8Data::~hexRef8Data
~hexRef8Data()
Destructor.
Definition: hexRef8Data.C:230
Foam::mapDistributePolyMesh
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Definition: mapDistributePolyMesh.H:66