faFieldReconstructor.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2016-2017 Wikki Ltd
9 Copyright (C) 2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::faFieldReconstructor
29
30Description
31 Finite Area area and edge fields reconstruction.
32
33Author
34 Zeljko Tukovic, FSB Zagreb
35 Hrvoje Jasak, Wikki Ltd.
36
37SourceFiles
38 faFieldReconstructor.C
39 faFieldReconstructorTemplates.C
40
41\*---------------------------------------------------------------------------*/
42
43#ifndef Foam_faFieldReconstructor_H
44#define Foam_faFieldReconstructor_H
45
46#include "PtrList.H"
47#include "faMesh.H"
48#include "IOobjectList.H"
49#include "faPatchFieldMapper.H"
50#include "labelIOList.H"
51
52// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53
54namespace Foam
55{
56
57/*---------------------------------------------------------------------------*\
58 Class faFieldReconstructor Declaration
59\*---------------------------------------------------------------------------*/
62{
63 // Private Data
64
65 //- Reconstructed mesh reference
66 faMesh& mesh_;
67
68 //- List of processor meshes
69 const PtrList<faMesh>& procMeshes_;
70
71 //- List of processor edge addressing lists
72 const PtrList<labelIOList>& edgeProcAddressing_;
73
74 //- List of processor face addressing lists
75 const PtrList<labelIOList>& faceProcAddressing_;
76
77 //- List of processor boundary addressing lists
78 const PtrList<labelIOList>& boundaryProcAddressing_;
79
80 //- Number of fields reconstructed
81 label nReconstructed_;
82
83
84 // Private Member Functions
85
86 //- No copy construct
88
89 //- No copy assignment
90 void operator=(const faFieldReconstructor&) = delete;
91
92
93public:
94
95 // Public Classes
98 :
100 {
101 label size_;
102 label sizeBeforeMapping_;
103
104 public:
105
106 // Constructors
107
108 //- Construct given size
110 (
111 const label size,
112 const label sizeBeforeMapping
113 )
114 :
115 size_(size),
116 sizeBeforeMapping_(sizeBeforeMapping)
117 {}
118
119
120 // Member Functions
122 virtual label size() const
123 {
124 return size_;
125 }
127 virtual label sizeBeforeMapping() const
128 {
129 return sizeBeforeMapping_;
130 }
132 virtual bool direct() const
133 {
134 return true;
135 }
137 virtual bool hasUnmapped() const
138 {
139 return false;
140 }
142 virtual const labelUList& directAddressing() const
143 {
144 return labelUList::null();
145 }
146 };
147
148
149 // Static Data
150
151 //- Output verbosity when writing
152 static int verbose_;
153
154
155 // Constructors
156
157 //- Construct from components
159 (
160 faMesh& mesh, // Target mesh
161 const PtrList<faMesh>& procMeshes, // Source meshes
162 const PtrList<labelIOList>& edgeProcAddressing,
163 const PtrList<labelIOList>& faceProcAddressing,
164 const PtrList<labelIOList>& boundaryProcAddressing
165 );
166
167
168 // Member Functions
169
170 //- Return number of fields reconstructed
171 label nReconstructed() const noexcept
172 {
173 return nReconstructed_;
174 }
175
176 //- Reconstruct area field
177 template<class Type>
180 (
181 const IOobject& fieldObject,
183 ) const;
184
185 //- Read and reconstruct area field
186 template<class Type>
188 reconstructAreaField(const IOobject& fieldObject);
189
190
191 //- Reconstruct edge field
192 template<class Type>
195 (
196 const IOobject& fieldObject,
198 ) const;
199
200 //- Read and reconstruct edge field
201 template<class Type>
203 reconstructEdgeField(const IOobject& fieldObject);
204
205
206 //- Read, reconstruct and write specified area fields
207 template<class Type>
209 (
210 const UPtrList<const IOobject>& fieldObjects
211 );
212
213 //- Read, reconstruct and write specified edge fields
214 template<class Type>
216 (
217 const UPtrList<const IOobject>& fieldObjects
218 );
219
220
221 //- Read, reconstruct and write all/selected area fields
222 // An empty wordRes corresponds to select ALL.
223 template<class Type>
225 (
226 const IOobjectList& objects,
227 const wordRes& selectedFields = wordRes()
228 );
229
230 //- Read, reconstruct and write all/selected edge fields
231 // An empty wordRes corresponds to select ALL.
232 template<class Type>
234 (
235 const IOobjectList& objects,
236 const wordRes& selectedFields = wordRes()
237 );
238
239 //- Reconstruct all supported area/edge field types
241 (
242 const IOobjectList& objects,
243 const wordRes& selectedFields = wordRes()
244 );
245};
246
247
248// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
249
250} // End namespace Foam
251
252// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
253
254#ifdef NoRepository
256#endif
257
258// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
259
260#endif
261
262// ************************************************************************* //
Generic GeometricField class.
List of IOobjects with searching and retrieving facilities.
Definition: IOobjectList.H:59
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
static const UList< label > & null()
Return a UList reference to a nullObject.
Definition: UListI.H:53
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition: UPtrList.H:71
virtual label size() const
The size of the mapper.
virtual bool hasUnmapped() const
Any unmapped values?
virtual const labelUList & directAddressing() const
Return the direct addressing values.
virtual bool direct() const
Is it a direct (non-interpolating) mapper?
faPatchFieldReconstructor(const label size, const label sizeBeforeMapping)
Construct given size.
Finite Area area and edge fields reconstruction.
label reconstructEdgeFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes())
Read, reconstruct and write all/selected edge fields.
tmp< GeometricField< Type, faPatchField, areaMesh > > reconstructAreaField(const IOobject &fieldObject)
Read and reconstruct area field.
tmp< GeometricField< Type, faePatchField, edgeMesh > > reconstructField(const IOobject &fieldObject, const PtrList< GeometricField< Type, faePatchField, edgeMesh > > &) const
Reconstruct edge field.
tmp< GeometricField< Type, faPatchField, areaMesh > > reconstructField(const IOobject &fieldObject, const PtrList< GeometricField< Type, faPatchField, areaMesh > > &) const
Reconstruct area field.
tmp< GeometricField< Type, faePatchField, edgeMesh > > reconstructEdgeField(const IOobject &fieldObject)
Read and reconstruct edge field.
label reconstructEdgeFields(const UPtrList< const IOobject > &fieldObjects)
Read, reconstruct and write specified edge fields.
label nReconstructed() const noexcept
Return number of fields reconstructed.
static int verbose_
Output verbosity when writing.
label reconstructAreaFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes())
Read, reconstruct and write all/selected area fields.
label reconstructAreaFields(const UPtrList< const IOobject > &fieldObjects)
Read, reconstruct and write specified area fields.
label reconstructAllFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes())
Reconstruct all supported area/edge field types.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:100
A FieldMapper for finite-area patch fields.
A class for managing temporary objects.
Definition: tmp.H:65
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:54
dynamicFvMesh & mesh
Namespace for OpenFOAM.
const direction noexcept
Definition: Scalar.H:223