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
29 Finite Area area and edge field decomposer.
32 Zeljko Tukovic, FSB Zagreb. All rights reserved
36 faFieldDecomposerDecomposeFields.C
38 \*---------------------------------------------------------------------------*/
40 #ifndef faFieldDecomposer_H
41 #define faFieldDecomposer_H
43 // #include "faMesh.H"
44 // #include "faPatchFieldMapper.H"
46 #include "faPatchFieldMapper.H"
47 #include "edgeFields.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 /*---------------------------------------------------------------------------*\
57 Class faFieldDecomposer Declaration
58 \*---------------------------------------------------------------------------*/
60 class faFieldDecomposer
64 //- Patch field decomposer class
65 class patchFieldDecomposer
67 public faPatchFieldMapper
71 label sizeBeforeMapping_;
72 labelList directAddressing_;
78 //- Construct given addressing
81 const label sizeBeforeMapping,
82 const unallocLabelList& addressingSlice,
83 const label addressingOffset
91 return directAddressing_.size();
94 virtual label sizeBeforeMapping() const
96 return sizeBeforeMapping_;
104 const unallocLabelList& directAddressing() const
106 return directAddressing_;
111 //- Processor patch field decomposer class
112 class processorAreaPatchFieldDecomposer
114 public faPatchFieldMapper
118 label sizeBeforeMapping_;
119 labelListList addressing_;
120 scalarListList weights_;
124 //- Construct given addressing
125 processorAreaPatchFieldDecomposer
128 const unallocLabelList& addressingSlice
136 return addressing_.size();
139 virtual label sizeBeforeMapping() const
141 return sizeBeforeMapping_;
149 const labelListList& addressing() const
154 const scalarListList& weights() const
161 //- Processor patch field decomposer class
162 class processorEdgePatchFieldDecomposer
164 public faPatchFieldMapper
166 label sizeBeforeMapping_;
167 labelListList addressing_;
168 scalarListList weights_;
172 //- Construct given addressing
173 processorEdgePatchFieldDecomposer
175 label sizeBeforeMapping,
176 const unallocLabelList& addressingSlice
184 return addressing_.size();
187 virtual label sizeBeforeMapping() const
189 return sizeBeforeMapping_;
197 const labelListList& addressing() const
202 const scalarListList& weights() const
213 //- Reference to complete mesh
214 const faMesh& completeMesh_;
216 //- Reference to processor mesh
217 const faMesh& procMesh_;
219 //- Reference to edge addressing
220 const labelList& edgeAddressing_;
222 //- Reference to face addressing
223 const labelList& faceAddressing_;
225 //- Reference to boundary addressing
226 const labelList& boundaryAddressing_;
228 //- List of patch field decomposers
229 List<patchFieldDecomposer*> patchFieldDecomposerPtrs_;
231 List<processorAreaPatchFieldDecomposer*>
232 processorAreaPatchFieldDecomposerPtrs_;
234 List<processorEdgePatchFieldDecomposer*>
235 processorEdgePatchFieldDecomposerPtrs_;
238 // Private Member Functions
240 //- Disallow default bitwise copy construct
241 faFieldDecomposer(const faFieldDecomposer&);
243 //- Disallow default bitwise assignment
244 void operator=(const faFieldDecomposer&);
251 //- Construct from components
254 const faMesh& completeMesh,
255 const faMesh& procMesh,
256 const labelList& edgeAddressing,
257 const labelList& faceAddressing,
258 const labelList& boundaryAddressing
264 ~faFieldDecomposer();
269 //- Decompose area field
271 tmp<GeometricField<Type, faPatchField, areaMesh> >
274 const GeometricField<Type, faPatchField, areaMesh>& field
277 //- Decompose surface field
279 tmp<GeometricField<Type, faePatchField, edgeMesh> >
282 const GeometricField<Type, faePatchField, edgeMesh>& field
285 template<class GeoField>
286 void decomposeFields(const PtrList<GeoField>& fields) const;
290 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
292 } // End namespace Foam
294 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
297 # include "faFieldDecomposerDecomposeFields.C"
300 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
304 // ************************************************************************* //