1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM 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 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::fvFieldDecomposer
29 Finite Volume volume and surface field decomposer.
33 fvFieldDecomposerDecomposeFields.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef fvFieldDecomposer_H
38 #define fvFieldDecomposer_H
41 #include "fvPatchFieldMapper.H"
42 #include "surfaceFields.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 /*---------------------------------------------------------------------------*\
52 Class fvFieldDecomposer Declaration
53 \*---------------------------------------------------------------------------*/
55 class fvFieldDecomposer
59 //- Patch field decomposer class
60 class patchFieldDecomposer
62 public fvPatchFieldMapper
66 label sizeBeforeMapping_;
67 labelList directAddressing_;
73 //- Construct given addressing
76 const label sizeBeforeMapping,
77 const unallocLabelList& addressingSlice,
78 const label addressingOffset
86 return directAddressing_.size();
89 virtual label sizeBeforeMapping() const
91 return sizeBeforeMapping_;
99 const unallocLabelList& directAddressing() const
101 return directAddressing_;
106 //- Processor patch field decomposer class
107 class processorVolPatchFieldDecomposer
109 public fvPatchFieldMapper
113 label sizeBeforeMapping_;
114 labelListList addressing_;
115 scalarListList weights_;
119 //- Construct given addressing
120 processorVolPatchFieldDecomposer
123 const unallocLabelList& addressingSlice
131 return addressing_.size();
134 virtual label sizeBeforeMapping() const
136 return sizeBeforeMapping_;
144 const labelListList& addressing() const
149 const scalarListList& weights() const
156 //- Processor patch field decomposer class
157 class processorSurfacePatchFieldDecomposer
159 public fvPatchFieldMapper
161 label sizeBeforeMapping_;
162 labelListList addressing_;
163 scalarListList weights_;
167 //- Construct given addressing
168 processorSurfacePatchFieldDecomposer
170 label sizeBeforeMapping,
171 const unallocLabelList& addressingSlice
179 return addressing_.size();
182 virtual label sizeBeforeMapping() const
184 return sizeBeforeMapping_;
192 const labelListList& addressing() const
197 const scalarListList& weights() const
208 //- Reference to complete mesh
209 const fvMesh& completeMesh_;
211 //- Reference to processor mesh
212 const fvMesh& procMesh_;
214 //- Reference to face addressing
215 const labelList& faceAddressing_;
217 //- Reference to cell addressing
218 const labelList& cellAddressing_;
220 //- Reference to boundary addressing
221 const labelList& boundaryAddressing_;
223 //- List of patch field decomposers
224 List<patchFieldDecomposer*> patchFieldDecomposerPtrs_;
226 List<processorVolPatchFieldDecomposer*>
227 processorVolPatchFieldDecomposerPtrs_;
229 List<processorSurfacePatchFieldDecomposer*>
230 processorSurfacePatchFieldDecomposerPtrs_;
233 // Private Member Functions
235 //- Disallow default bitwise copy construct
236 fvFieldDecomposer(const fvFieldDecomposer&);
238 //- Disallow default bitwise assignment
239 void operator=(const fvFieldDecomposer&);
246 //- Construct from components
249 const fvMesh& completeMesh,
250 const fvMesh& procMesh,
251 const labelList& faceAddressing,
252 const labelList& cellAddressing,
253 const labelList& boundaryAddressing
259 ~fvFieldDecomposer();
264 //- Decompose volume field
266 tmp<GeometricField<Type, fvPatchField, volMesh> >
269 const GeometricField<Type, fvPatchField, volMesh>& field
272 //- Decompose surface field
274 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
277 const GeometricField<Type, fvsPatchField, surfaceMesh>& field
280 template<class GeoField>
281 void decomposeFields(const PtrList<GeoField>& fields) const;
285 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
287 } // End namespace Foam
289 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
292 # include "fvFieldDecomposerDecomposeFields.C"
295 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
299 // ************************************************************************* //