Forward compatibility: flex
[foam-extend-3.2.git] / applications / utilities / parallelProcessing / reconstructParMesh / tetPointFieldReconstructor.H
blob2622699cc4c1b948fa7646c862f29300975daece
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     tetPointFieldReconstructor
27 Description
28     Tet point field reconstructor.
30 SourceFiles
31     tetPointFieldReconstructor.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef tetPointFieldReconstructor_H
36 #define tetPointFieldReconstructor_H
38 #include "PtrList.H"
39 #include "objectRegistry.H"
40 #include "foamTime.H"
41 #include "tetPolyMesh.H"
42 #include "tetPointMesh.H"
43 #include "elementMesh.H"
44 #include "IOobjectList.H"
45 #include "tetPolyPatchFields.H"
46 #include "elementPatchFields.H"
47 #include "PointPatchFieldMapper.H"
48 #include "GeometricField.H"
49 #include "labelIOList.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 namespace Foam
56 /*---------------------------------------------------------------------------*\
57               Class tetPointFieldReconstructor Declaration
58 \*---------------------------------------------------------------------------*/
60 class tetPointFieldReconstructor
62     // Private data
64         //- Reconstructed mesh reference
65         const tetPolyMesh& mesh_;
67         //- List of processor meshes
68         const PtrList<tetPolyMesh>& procMeshes_;
70         //- List of processor point addressing lists
71         const PtrList<labelIOList>& pointProcAddressing_;
73         //- List of processor face addressing lists
74         const PtrList<labelIOList>& faceProcAddressing_;
76         //- List of processor cell addressing lists
77         const PtrList<labelIOList>& cellProcAddressing_;
79         //- List of processor boundary addressing lists
80         const PtrList<labelIOList>& boundaryProcAddressing_;
83     // Private Member Functions
85         //- Disallow default bitwise copy construct
86         tetPointFieldReconstructor
87         (
88             const tetPointFieldReconstructor&
89         );
91         //- Disallow default bitwise assignment
92         void operator=(const tetPointFieldReconstructor&);
94         //- Processor-to-global addressing for all points
95         labelList procAddressing(const label procNo) const;
97         //- Patch-to-patch addressing
98         labelList procPatchAddressing
99         (
100             const labelList& procToGlobalAddr,
101             const label procNo,
102             const label patchNo
103         ) const;
106 public:
108         class tetPolyPatchFieldReconstructor
109         :
110             public PointPatchFieldMapper
111         {
112             label size_;
113             label sizeBeforeMapping_;
115         public:
117             // Constructors
119                 //- Construct given addressing
120                 tetPolyPatchFieldReconstructor
121                 (
122                     const label size,
123                     const label sizeBeforeMapping
124                 )
125                 :
126                     size_(size),
127                     sizeBeforeMapping_(sizeBeforeMapping)
128                 {}
131             // Member functions
133                 virtual label size() const
134                 {
135                     return size_;
136                 }
138                 virtual label sizeBeforeMapping() const
139                 {
140                     return sizeBeforeMapping_;
141                 }
143                 virtual bool direct() const
144                 {
145                     return true;
146                 }
148                 virtual const unallocLabelList& directAddressing() const
149                 {
150                     return unallocLabelList::null();
151                 }
152         };
155     // Constructors
157         //- Construct from components
158         tetPointFieldReconstructor
159         (
160             tetPolyMesh& mesh,
161             const PtrList<tetPolyMesh>& procMeshes,
162             const PtrList<labelIOList>& pointProcAddressing,
163             const PtrList<labelIOList>& faceProcAddressing,
164             const PtrList<labelIOList>& cellProcAddressing,
165             const PtrList<labelIOList>& boundaryProcAddressing
166         );
169     // Member Functions
171         //- Reconstruct point field
172         template<class Type>
173         tmp<GeometricField<Type, tetPolyPatchField, tetPointMesh> >
174         reconstructTetPointField
175         (
176             const IOobject& fieldIoObject
177         );
179         //- Reconstruct element field
180         template<class Type>
181         tmp<GeometricField<Type, elementPatchField, elementMesh> >
182         reconstructElementField
183         (
184             const IOobject& fieldIoObject
185         );
187         //- Reconstruct and write all point fields
188         template<class Type>
189         void reconstructTetPointFields
190         (
191             const IOobjectList& objects
192         );
194         //- Reconstruct and write all element fields
195         template<class Type>
196         void reconstructElementFields
197         (
198             const IOobjectList& objects
199         );
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205 } // End namespace Foam
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 #ifdef NoRepository
210 #   include "tetPointFieldReconstructorReconstructFields.C"
211 #endif
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215 #endif
217 // ************************************************************************* //