1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, 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 labelList directAddressing_;
71 //- Construct given addressing
74 const labelUList& addressingSlice,
75 const label addressingOffset
83 return directAddressing_.size();
91 const labelUList& directAddressing() const
93 return directAddressing_;
98 //- Processor patch field decomposer class. Maps either owner or
99 // neighbour data (no interpolate anymore - processorFvPatchField
100 // holds neighbour data)
101 class processorVolPatchFieldDecomposer
103 public fvPatchFieldMapper
107 labelList directAddressing_;
111 //- Construct given addressing
112 processorVolPatchFieldDecomposer
115 const labelUList& addressingSlice
123 return directAddressing_.size();
131 const labelUList& directAddressing() const
133 return directAddressing_;
138 //- Processor patch field decomposer class. Surface field is assumed
139 // to have direction (so manipulates sign when mapping)
140 class processorSurfacePatchFieldDecomposer
142 public fvPatchFieldMapper
144 labelListList addressing_;
145 scalarListList weights_;
149 //- Construct given addressing
150 processorSurfacePatchFieldDecomposer
152 const labelUList& addressingSlice
160 return addressing_.size();
168 const labelListList& addressing() const
173 const scalarListList& weights() const
184 //- Reference to complete mesh
185 const fvMesh& completeMesh_;
187 //- Reference to processor mesh
188 const fvMesh& procMesh_;
190 //- Reference to face addressing
191 const labelList& faceAddressing_;
193 //- Reference to cell addressing
194 const labelList& cellAddressing_;
196 //- Reference to boundary addressing
197 const labelList& boundaryAddressing_;
199 //- List of patch field decomposers
200 List<patchFieldDecomposer*> patchFieldDecomposerPtrs_;
202 List<processorVolPatchFieldDecomposer*>
203 processorVolPatchFieldDecomposerPtrs_;
205 List<processorSurfacePatchFieldDecomposer*>
206 processorSurfacePatchFieldDecomposerPtrs_;
209 // Private Member Functions
211 //- Disallow default bitwise copy construct
212 fvFieldDecomposer(const fvFieldDecomposer&);
214 //- Disallow default bitwise assignment
215 void operator=(const fvFieldDecomposer&);
222 //- Construct from components
225 const fvMesh& completeMesh,
226 const fvMesh& procMesh,
227 const labelList& faceAddressing,
228 const labelList& cellAddressing,
229 const labelList& boundaryAddressing
234 ~fvFieldDecomposer();
239 //- Decompose volume field
241 tmp<GeometricField<Type, fvPatchField, volMesh> >
244 const GeometricField<Type, fvPatchField, volMesh>& field
247 //- Decompose surface field
249 tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
252 const GeometricField<Type, fvsPatchField, surfaceMesh>& field
255 template<class GeoField>
256 void decomposeFields(const PtrList<GeoField>& fields) const;
260 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
262 } // End namespace Foam
264 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
267 # include "fvFieldDecomposerDecomposeFields.C"
270 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
274 // ************************************************************************* //