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/>.
28 Finite Area area and edge field decomposer.
31 Zeljko Tukovic, FSB Zagreb. All rights reserved
35 faFieldDecomposerDecomposeFields.C
37 \*---------------------------------------------------------------------------*/
39 #ifndef faFieldDecomposer_H
40 #define faFieldDecomposer_H
42 // #include "faMesh.H"
43 // #include "faPatchFieldMapper.H"
45 #include "faPatchFieldMapper.H"
46 #include "edgeFields.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 /*---------------------------------------------------------------------------*\
56 Class faFieldDecomposer Declaration
57 \*---------------------------------------------------------------------------*/
59 class faFieldDecomposer
63 //- Patch field decomposer class
64 class patchFieldDecomposer
66 public faPatchFieldMapper
70 label sizeBeforeMapping_;
71 labelList directAddressing_;
77 //- Construct given addressing
80 const label sizeBeforeMapping,
81 const unallocLabelList& addressingSlice,
82 const label addressingOffset
90 return directAddressing_.size();
93 virtual label sizeBeforeMapping() const
95 return sizeBeforeMapping_;
103 const unallocLabelList& directAddressing() const
105 return directAddressing_;
110 //- Processor patch field decomposer class
111 class processorAreaPatchFieldDecomposer
113 public faPatchFieldMapper
117 label sizeBeforeMapping_;
118 labelListList addressing_;
119 scalarListList weights_;
123 //- Construct given addressing
124 processorAreaPatchFieldDecomposer
127 const unallocLabelList& addressingSlice
135 return addressing_.size();
138 virtual label sizeBeforeMapping() const
140 return sizeBeforeMapping_;
148 const labelListList& addressing() const
153 const scalarListList& weights() const
160 //- Processor patch field decomposer class
161 class processorEdgePatchFieldDecomposer
163 public faPatchFieldMapper
165 label sizeBeforeMapping_;
166 labelListList addressing_;
167 scalarListList weights_;
171 //- Construct given addressing
172 processorEdgePatchFieldDecomposer
174 label sizeBeforeMapping,
175 const unallocLabelList& addressingSlice
183 return addressing_.size();
186 virtual label sizeBeforeMapping() const
188 return sizeBeforeMapping_;
196 const labelListList& addressing() const
201 const scalarListList& weights() const
212 //- Reference to complete mesh
213 const faMesh& completeMesh_;
215 //- Reference to processor mesh
216 const faMesh& procMesh_;
218 //- Reference to edge addressing
219 const labelList& edgeAddressing_;
221 //- Reference to face addressing
222 const labelList& faceAddressing_;
224 //- Reference to boundary addressing
225 const labelList& boundaryAddressing_;
227 //- List of patch field decomposers
228 List<patchFieldDecomposer*> patchFieldDecomposerPtrs_;
230 List<processorAreaPatchFieldDecomposer*>
231 processorAreaPatchFieldDecomposerPtrs_;
233 List<processorEdgePatchFieldDecomposer*>
234 processorEdgePatchFieldDecomposerPtrs_;
237 // Private Member Functions
239 //- Disallow default bitwise copy construct
240 faFieldDecomposer(const faFieldDecomposer&);
242 //- Disallow default bitwise assignment
243 void operator=(const faFieldDecomposer&);
250 //- Construct from components
253 const faMesh& completeMesh,
254 const faMesh& procMesh,
255 const labelList& edgeAddressing,
256 const labelList& faceAddressing,
257 const labelList& boundaryAddressing
263 ~faFieldDecomposer();
268 //- Decompose area field
270 tmp<GeometricField<Type, faPatchField, areaMesh> >
273 const GeometricField<Type, faPatchField, areaMesh>& field
276 //- Decompose surface field
278 tmp<GeometricField<Type, faePatchField, edgeMesh> >
281 const GeometricField<Type, faePatchField, edgeMesh>& field
284 template<class GeoField>
285 void decomposeFields(const PtrList<GeoField>& fields) const;
289 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
291 } // End namespace Foam
293 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
296 # include "faFieldDecomposerDecomposeFields.C"
299 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
303 // ************************************************************************* //