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 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 declaration of classes
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 
64 private:
65 
66  // Private data
67 
68  autoPtr<labelIOList> cellLevelPtr_;
69 
70  autoPtr<labelIOList> pointLevelPtr_;
71 
73 
74  autoPtr<refinementHistory> refHistoryPtr_;
75 
76 
77  // Private Member Functions
78 
79  //- No copy construct
80  hexRef8Data(const hexRef8Data&) = delete;
81 
82  //- No copy assignment
83  void operator=(const hexRef8Data&) = delete;
84 
85 
86 public:
87 
88  // Constructors
89 
90  //- Construct read. Has special provision for only some processors
91  // having the files so can be used in redistribution.
92  hexRef8Data(const IOobject& io);
93 
94  //- Construct as subset
96  (
97  const IOobject& io,
98  const hexRef8Data&,
99  const labelList& cellMap,
100  const labelList& pointMap
101  );
102 
103  //- Construct from multiple hexRef8Data
105  (
106  const IOobject& io,
107  const UPtrList<const labelList>& cellMaps,
108  const UPtrList<const labelList>& pointMaps,
110  );
111 
112 
113  //- Destructor
114  ~hexRef8Data();
115 
116 
117  // Member Functions
118 
119  //- Parallel synchronise. This enforces valid objects on all processors
120  // (even if they don't have a mesh). Used by redistributePar.
121  void sync(const IOobject& io);
122 
123  //- Update local numbering for changed mesh.
124  void updateMesh(const mapPolyMesh&);
125 
126  //- In-place distribute
127  void distribute(const mapDistributePolyMesh&);
128 
129  //- Write
130  bool write() const;
131 };
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 } // End namespace Foam
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #endif
141 
142 // ************************************************************************* //
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
UPtrList.H
Foam::hexRef8Data::updateMesh
void updateMesh(const mapPolyMesh &)
Update local numbering for changed mesh.
Definition: hexRef8Data.C:318
Foam::UPtrList
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: UPtrList.H:63
Foam::hexRef8Data::distribute
void distribute(const mapDistributePolyMesh &)
In-place distribute.
Definition: hexRef8Data.C:389
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:257
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:409
Foam::List< label >
labelIOList.H
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:160
Foam::hexRef8Data::~hexRef8Data
~hexRef8Data()
Destructor.
Definition: hexRef8Data.C:251
Foam::mapDistributePolyMesh
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Definition: mapDistributePolyMesh.H:66