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-2022 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 public:
57 
58  // Public Classes
59 
60  //- Patch field decomposer class
62  :
63  public labelList,
65  {
66  public:
67 
68  // Constructors
69 
70  //- Construct given addressing
72  };
73 
74 
75 private:
76 
77  // Private Data
78 
79  //- Reference to complete mesh
80  const fvMesh& completeMesh_;
81 
82  //- Reference to processor mesh
83  const fvMesh& procMesh_;
84 
85  //- Reference to face addressing
86  const labelList& faceAddressing_;
87 
88  //- Reference to cell addressing
89  const labelList& cellAddressing_;
90 
91  //- Reference to face addressing boundary field
92  const surfaceLabelField::Boundary& faceAddressingBf_;
93 
94  //- List of patch field decomposers
95  PtrList<patchFieldDecomposer> patchFieldDecomposers_;
96 
97 
98  // Private Member Functions
99 
100  //- Convert a processor patch to the corresponding complete patch index
101  label completePatchID(const label procPatchi) const;
102 
103  //- Map cell values to faces
104  template<class Type>
105  static tmp<Field<Type>> mapCellToFace
106  (
107  const labelUList& owner,
108  const labelUList& neighbour,
109  const Field<Type>& field,
110  const labelUList& addressing
111  );
112 
113  //- Map face values to faces
114  template<class Type>
115  static tmp<Field<Type>> mapFaceToFace
116  (
117  const Field<Type>& field,
118  const labelUList& addressing,
119  const bool isFlux
120  );
121 
122 
123 public:
124 
125  // Constructors
126 
127  //- Construct from components
129  (
130  const fvMesh& completeMesh,
131  const fvMesh& procMesh,
132  const labelList& faceAddressing,
133  const labelList& cellAddressing,
134  const surfaceLabelField::Boundary& faceAddressingBf
135  );
136 
137  //- Disallow default bitwise copy construction
138  fvFieldDecomposer(const fvFieldDecomposer&) = delete;
139 
140 
141  //- Destructor
143 
144 
145  // Member Functions
146 
147  //- Decompose volume field
148  template<class Type>
151  (
152  const VolField<Type>& field
153  ) const;
154 
155  //- Decompose surface field
156  template<class Type>
159  (
160  const SurfaceField<Type>& field
161  ) const;
162 
163  //- Decompose a list of fields
164  template<class GeoField>
165  void decomposeFields(const PtrList<GeoField>& fields) const;
166 
167 
168  // Member Operators
169 
170  //- Disallow default bitwise assignment
171  void operator=(const fvFieldDecomposer&) = delete;
172 };
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #ifdef NoRepository
183 #endif
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
Pre-declare SubField and related Field type.
Definition: Field.H:82
Generic GeometricBoundaryField class.
Generic GeometricField class.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
virtual const labelUList & addressing() const
Access to the direct map addressing.
patchFieldDecomposer(const labelUList &addressing)
Construct given addressing.
Finite Volume volume and surface field decomposer.
void decomposeFields(const PtrList< GeoField > &fields) const
Decompose a list of fields.
tmp< VolField< Type > > decomposeField(const VolField< Type > &field) const
Decompose volume field.
fvFieldDecomposer(const fvMesh &completeMesh, const fvMesh &procMesh, const labelList &faceAddressing, const labelList &cellAddressing, const surfaceLabelField::Boundary &faceAddressingBf)
Construct from components.
~fvFieldDecomposer()
Destructor.
void operator=(const fvFieldDecomposer &)=delete
Disallow default bitwise assignment.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
A class for managing temporary objects.
Definition: tmp.H:55
Info<< "Calculating turbulent flame speed field St\n"<< endl;volScalarField St(IOobject("St", runTime.name(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), flameWrinkling->Xi() *Su);multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:230
Namespace for OpenFOAM.
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
bool isFlux(const DimensionedField< Type, surfaceMesh > &df)
Check if surfaceField is a flux.
Definition: surfaceFields.H:55
Foam::surfaceFields.