1 /*---------------------------------------------------------------------------*\
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 -------------------------------------------------------------------------------
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/>.
25 Foam::fvFieldDecomposer
28 Finite Volume volume and surface field decomposer.
32 fvFieldDecomposerDecomposeFields.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef fvFieldDecomposer_H
37 #define fvFieldDecomposer_H
40 #include "fvPatchFieldMapper.H"
41 #include "surfaceFields.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 /*---------------------------------------------------------------------------*\
51 Class fvFieldDecomposer Declaration
52 \*---------------------------------------------------------------------------*/
54 class fvFieldDecomposer
58 //- Patch field decomposer class
59 class patchFieldDecomposer
61 public fvPatchFieldMapper
65 label sizeBeforeMapping_;
66 labelList directAddressing_;
72 //- Construct given addressing
75 const label sizeBeforeMapping,
76 const unallocLabelList& addressingSlice,
77 const label addressingOffset
85 return directAddressing_.size();
88 virtual label sizeBeforeMapping() const
90 return sizeBeforeMapping_;
98 const unallocLabelList& directAddressing() const
100 return directAddressing_;
105 //- Processor patch field decomposer class
106 class processorVolPatchFieldDecomposer
108 public fvPatchFieldMapper
112 label sizeBeforeMapping_;
113 labelListList addressing_;
114 scalarListList weights_;
118 //- Construct given addressing
119 processorVolPatchFieldDecomposer
122 const unallocLabelList& addressingSlice
130 return addressing_.size();
133 virtual label sizeBeforeMapping() const
135 return sizeBeforeMapping_;
143 const labelListList& addressing() const
148 const scalarListList& weights() const
155 //- Processor patch field decomposer class
156 class processorSurfacePatchFieldDecomposer
158 public fvPatchFieldMapper
160 label sizeBeforeMapping_;
161 labelListList addressing_;
162 scalarListList weights_;
166 //- Construct given addressing
167 processorSurfacePatchFieldDecomposer
169 label sizeBeforeMapping,
170 const unallocLabelList& addressingSlice
178 return addressing_.size();
181 virtual label sizeBeforeMapping() const
183 return sizeBeforeMapping_;
191 const labelListList& addressing() const
196 const scalarListList& weights() const
207 //- Reference to complete mesh
208 const fvMesh& completeMesh_;
210 //- Reference to processor mesh
211 const fvMesh& procMesh_;
213 //- Reference to face addressing
214 const labelList& faceAddressing_;
216 //- Reference to cell addressing
217 const labelList& cellAddressing_;
219 //- Reference to boundary addressing
220 const labelList& boundaryAddressing_;
222 //- List of patch field decomposers
223 List<patchFieldDecomposer*> patchFieldDecomposerPtrs_;
225 List<processorVolPatchFieldDecomposer*>
226 processorVolPatchFieldDecomposerPtrs_;
228 List<processorSurfacePatchFieldDecomposer*>
229 processorSurfacePatchFieldDecomposerPtrs_;
232 // Private Member Functions
234 //- Disallow default bitwise copy construct
235 fvFieldDecomposer(const fvFieldDecomposer&);
237 //- Disallow default bitwise assignment
238 void operator=(const fvFieldDecomposer&);
245 //- Construct from components
248 const fvMesh& completeMesh,
249 const fvMesh& procMesh,
250 const labelList& faceAddressing,
251 const labelList& cellAddressing,
252 const labelList& boundaryAddressing
258 ~fvFieldDecomposer();
263 //- Decompose volume field
265 tmp<GeometricField<Type, fvPatchField, volMesh> >
268 const GeometricField<Type, fvPatchField, volMesh>& field
271 //- Decompose surface field
273 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
276 const GeometricField<Type, fvsPatchField, surfaceMesh>& field
279 template<class GeoField>
280 void decomposeFields(const PtrList<GeoField>& fields) const;
284 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
286 } // End namespace Foam
288 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
291 # include "fvFieldDecomposerDecomposeFields.C"
294 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
298 // ************************************************************************* //