fvFieldDecomposer.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::fvFieldDecomposer
26 
27 Description
28  Finite Volume volume and surface field decomposer.
29 
30 SourceFiles
31  fvFieldDecomposer.C
32  fvFieldDecomposerDecomposeFields.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef fvFieldDecomposer_H
37 #define fvFieldDecomposer_H
38 
39 #include "fvMesh.H"
41 #include "surfaceFields.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 class IOobjectList;
49 
50 /*---------------------------------------------------------------------------*\
51  Class fvFieldDecomposer Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 {
56 
57 public:
58 
59  //- Patch field decomposer class
61  :
62  public labelList,
64  {
65  // Private Member Functions
66 
67  labelList alignAddressing
68  (
69  const labelUList& addressingSlice,
70  const label addressingOffset
71  ) const;
72 
73 
74  public:
75 
76  // Constructors
77 
78  //- Construct given addressing
80  (
81  const labelUList& addressingSlice,
82  const label addressingOffset
83  );
84  };
85 
86 
87  //- Processor patch field decomposer class. Maps either owner or
88  // neighbour data (no interpolate anymore - processorFvPatchField
89  // holds neighbour data)
91  :
92  public labelList,
94  {
95  // Private Member Functions
96 
97  labelList alignAddressing
98  (
99  const fvMesh& mesh,
100  const labelUList& addressingSlice
101  ) const;
102 
103 
104  public:
105 
106  //- Construct given addressing
108  (
109  const fvMesh& mesh,
110  const labelUList& addressingSlice
111  );
112  };
113 
114 
115 private:
116 
117  // Private Data
118 
119  //- Reference to complete mesh
120  const fvMesh& completeMesh_;
121 
122  //- Reference to processor mesh
123  const fvMesh& procMesh_;
124 
125  //- Reference to face addressing
126  const labelList& faceAddressing_;
127 
128  //- Reference to cell addressing
129  const labelList& cellAddressing_;
130 
131  //- Reference to boundary addressing
132  const labelList& boundaryAddressing_;
133 
134  //- List of patch field decomposers
135  List<patchFieldDecomposer*> patchFieldDecomposerPtrs_;
136 
138  processorVolPatchFieldDecomposerPtrs_;
139 
140 
141  // Private Member Functions
142 
143  //- Helper: map & optionally flip a (face) field
144  template<class Type>
145  static tmp<Field<Type>> mapField
146  (
147  const Field<Type>& field,
148  const labelUList& mapAndSign,
149  const bool applyFlip
150  );
151 
152 
153 public:
154 
155  // Constructors
156 
157  //- Construct from components
159  (
160  const fvMesh& completeMesh,
161  const fvMesh& procMesh,
162  const labelList& faceAddressing,
163  const labelList& cellAddressing,
164  const labelList& boundaryAddressing
165  );
166 
167  //- Disallow default bitwise copy construction
168  fvFieldDecomposer(const fvFieldDecomposer&) = delete;
169 
170 
171  //- Destructor
173 
174 
175  // Member Functions
176 
177  //- Decompose volume field
178  template<class Type>
181  (
183  const bool allowUnknownPatchFields = false
184  ) const;
185 
186  //- Decompose surface field
187  template<class Type>
190  (
192  ) const;
193 
194  template<class GeoField>
195  void decomposeFields(const PtrList<GeoField>& fields) const;
196 
197 
198  // Member Operators
199 
200  //- Disallow default bitwise assignment
201  void operator=(const fvFieldDecomposer&) = delete;
202 };
203 
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 } // End namespace Foam
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #ifdef NoRepository
213 #endif
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 #endif
218 
219 // ************************************************************************* //
Foam::surfaceFields.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Generic GeometricField class.
Info<< "Calculating turbulent flame speed field St\"<< endl;volScalarField St(IOobject("St", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), flameWrinkling->Xi() *Su);multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:228
tmp< GeometricField< Type, fvPatchField, volMesh > > decomposeField(const GeometricField< Type, fvPatchField, volMesh > &field, const bool allowUnknownPatchFields=false) const
Decompose volume field.
dynamicFvMesh & mesh
Pre-declare SubField and related Field type.
Definition: Field.H:56
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
fvFieldDecomposer(const fvMesh &completeMesh, const fvMesh &procMesh, const labelList &faceAddressing, const labelList &cellAddressing, const labelList &boundaryAddressing)
Construct from components.
Finite Volume volume and surface field decomposer.
Processor patch field decomposer class. Maps either owner or.
patchFieldDecomposer(const labelUList &addressingSlice, const label addressingOffset)
Construct given addressing.
void operator=(const UList< label > &)
Assignment to UList operator. Takes linear time.
Definition: List.C:376
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:70
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
~fvFieldDecomposer()
Destructor.
rDeltaTY field()
A class for managing temporary objects.
Definition: PtrList.H:53
void decomposeFields(const PtrList< GeoField > &fields) const
Namespace for OpenFOAM.