Forward compatibility: flex
[foam-extend-3.2.git] / applications / utilities / parallelProcessing / reconstructParMesh / processorMeshesReconstructor.H
blob4671dff7b7a5e649ef9799e052e7630d27c022ea
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation, either version 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::processorMeshesReconstructor
27 Description
29 SourceFiles
30     processorMeshesReconstructor.C
31     processorMeshesRebuild.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef processorMeshesReconstructor_H
36 #define processorMeshesReconstructor_H
38 #include "PtrList.H"
39 #include "objectRegistry.H"
40 #include "foamTime.H"
41 #include "fvMesh.H"
42 #include "labelIOList.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 // Forward declaration of friend functions and operators
51 class processorPolyPatch;
53 /*---------------------------------------------------------------------------*\
54                   Class processorMeshesReconstructor Declaration
55 \*---------------------------------------------------------------------------*/
57 class processorMeshesReconstructor
59     // Private data
61         //- Processor databases
62         PtrList<Time>& databases_;
64         const word meshName_;
66         //- List of processor meshes
67         PtrList<fvMesh> meshes_;
69         //- List of processor point addressing lists
70         PtrList<labelIOList> pointProcAddressing_;
72         //- List of processor face addressing lists
73         PtrList<labelIOList> faceProcAddressing_;
75         //- List of processor cell addressing lists
76         PtrList<labelIOList> cellProcAddressing_;
78         //- List of processor boundary addressing lists
79         PtrList<labelIOList> boundaryProcAddressing_;
82     // Private Member Functions
84         //- Disallow default bitwise copy construct
85         processorMeshesReconstructor(const processorMeshesReconstructor&);
87         //- Disallow default bitwise assignment
88         void operator=(const processorMeshesReconstructor&);
91         //- Read all meshes
92         void readMeshes();
94         //- Attempt to read mapping.  If not available, return false
95         bool readMapping();
97         //- Return neighbour processor patch
98         const processorPolyPatch& neighbourProcPatch
99         (
100             const processorPolyPatch& procPatch
101         ) const;
103         //- Return neighbour processor patch
104         labelList procPatchPointMapping
105         (
106             const processorPolyPatch& procPatch
107         ) const;
109         //- Clear reconstruction maps
110         void clearMaps();
113 public:
115     // Constructors
117         //- Construct from components
118         processorMeshesReconstructor
119         (
120             PtrList<Time>& databases,
121             const word& meshName
122         );
125     // Destructor - default
128     // Member Functions
130         //- Update the meshes based on the mesh files saved in
131         //  time directories
132         fvMesh::readUpdateState readUpdate();
134         //- Reconstruct mesh after topology change in parallel
135         autoPtr<fvMesh> reconstructMesh(const Time& db);
137         //- Reconstruct point position after motion in parallel
138         void reconstructPoints(fvMesh& mesh) const;
140         //- Return meshes
141         const PtrList<fvMesh>& meshes()
142         {
143             return meshes_;
144         }
146         //- Return point-processor addressing arrays
147         const PtrList<labelIOList>& pointProcAddressing() const;
149         //- Return face-processor addressing arrays
150         const PtrList<labelIOList>& faceProcAddressing() const;
152         //- Return cell-processor addressing arrays
153         const PtrList<labelIOList>& cellProcAddressing() const;
155         //- Return boundary-processor addressing arrays
156         const PtrList<labelIOList>& boundaryProcAddressing() const;
159         //- Write addressing
160         void writeAddressing();
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 } // End namespace Foam
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 #endif
172 // ************************************************************************* //