Loading...
Searching...
No Matches
fvFieldReconstructor.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) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2018-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::fvFieldReconstructor
29
30Description
31 Finite volume reconstructor for volume and surface fields.
32
33SourceFiles
34 fvFieldReconstructor.cxx
35 fvFieldReconstructor.txx
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef Foam_fvFieldReconstructor_H
40#define Foam_fvFieldReconstructor_H
41
42#include "PtrList.H"
43#include "fvMesh.H"
44#include "IOobjectList.H"
45#include "fvPatchFieldMapper.H"
46#include "labelIOList.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
53/*---------------------------------------------------------------------------*\
54 Class fvFieldReconstructor Declaration
55\*---------------------------------------------------------------------------*/
56
57class fvFieldReconstructor
58{
59 // Private Data
60
61 //- Reconstructed mesh reference
62 fvMesh& mesh_;
63
64 //- List of processor meshes
65 const UPtrList<fvMesh>& procMeshes_;
66
67 //- List of processor face addressing lists
68 const UPtrList<labelIOList>& faceProcAddressing_;
69
70 //- List of processor cell addressing lists
71 const UPtrList<labelIOList>& cellProcAddressing_;
72
73 //- List of processor boundary addressing lists
74 const UPtrList<labelIOList>& boundaryProcAddressing_;
75
76 //- Number of fields reconstructed
77 label nReconstructed_;
78
79
80 // Private Member Functions
81
82 //- No copy construct
83 fvFieldReconstructor(const fvFieldReconstructor&) = delete;
84
85 //- No copy assignment
86 void operator=(const fvFieldReconstructor&) = delete;
87
88
89public:
90
91 // Public Classes
92
93 //- Mapper for sizing only - does not do any actual mapping.
95 :
97 {
98 label size_;
99
100 public:
101
102 // Constructors
103
104 //- Construct given size
106 :
107 size_(size)
108 {}
109
110
111 // Member functions
112
113 label size() const
114 {
115 return size_;
116 }
117
118 bool direct() const
119 {
120 return true;
121 }
122
123 bool hasUnmapped() const
124 {
125 return false;
126 }
127
129 {
130 return labelUList::null();
131 }
132 };
134
135 // Static Data
136
137 //- Output verbosity when writing
138 static int verbose_;
139
140
141 // Constructors
142
143 //- Construct from components
144 fvFieldReconstructor
145 (
146 fvMesh& mesh,
147 const UPtrList<fvMesh>& procMeshes,
148 const UPtrList<labelIOList>& faceProcAddressing,
149 const UPtrList<labelIOList>& cellProcAddressing,
150 const UPtrList<labelIOList>& boundaryProcAddressing
151 );
152
153
154 // Member Functions
156 //- Return number of fields reconstructed
157 label nReconstructed() const noexcept
158 {
159 return nReconstructed_;
160 }
161
162 //- Reconstruct volume internal field
163 template<class Type>
166 (
167 const IOobject& fieldObject,
169 ) const;
170
171 //- Read and reconstruct volume internal field
172 template<class Type>
174 reconstructInternalField(const IOobject& fieldObject) const;
175
176
177 //- Reconstruct volume field
182 const IOobject& fieldObject,
184 ) const;
185
186 //- Read and reconstruct volume field
187 template<class Type>
189 reconstructVolumeField(const IOobject& fieldObject) const;
190
191
192 //- Reconstruct surface field
193 template<class Type>
196 (
197 const IOobject& fieldObject,
199 ) const;
200
201 //- Read and reconstruct surface field
202 template<class Type>
204 reconstructSurfaceField(const IOobject& fieldObject) const;
205
206
207 //- Read, reconstruct and write specified volume internal fields
208 template<class Type>
210 (
211 const UPtrList<const IOobject>& fieldObjects
212 );
213
214 //- Read, reconstruct and write specified volume fields
215 template<class Type>
217 (
218 const UPtrList<const IOobject>& fieldObjects
219 );
220
221 //- Read, reconstruct and write specified surface fields
222 template<class Type>
224 (
225 const UPtrList<const IOobject>& fieldObjects
226 );
227
228
229 //- Read, reconstruct and write all/selected volume internal fields
230 // An empty wordRes corresponds to select ALL.
231 template<class Type>
233 (
234 const IOobjectList& objects,
235 const wordRes& selectedFields = wordRes()
236 );
238 //- Read, reconstruct and write all/selected volume fields
239 // An empty wordRes corresponds to select ALL.
240 template<class Type>
242 (
243 const IOobjectList& objects,
244 const wordRes& selectedFields = wordRes()
245 );
246
247 //- Read, reconstruct and write all/selected surface fields
248 // An empty wordRes corresponds to select ALL.
249 template<class Type>
251 (
252 const IOobjectList& objects,
253 const wordRes& selectedFields = wordRes()
254 );
255
256 //- Reconstruct all known field types
258 (
259 const IOobjectList& objects,
260 const wordRes& selectedFields = wordRes()
261 );
263
264
265// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
266
267} // End namespace Foam
268
269// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
270
271#ifdef NoRepository
272 #include "fvFieldReconstructor.txx"
273#endif
275// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
276
277#endif
278
279// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable,...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
static const UList< label > & null() noexcept
Definition UList.H:225
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
Definition UPtrList.H:101
Mapper for sizing only - does not do any actual mapping.
bool direct() const
Is it a direct (non-interpolating) mapper?
const labelUList & directAddressing() const
Return the direct addressing values.
fvPatchFieldReconstructor(const label size)
Construct given size.
label reconstructInternalFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes())
Read, reconstruct and write all/selected volume internal fields.
fvFieldReconstructor(fvMesh &mesh, const UPtrList< fvMesh > &procMeshes, const UPtrList< labelIOList > &faceProcAddressing, const UPtrList< labelIOList > &cellProcAddressing, const UPtrList< labelIOList > &boundaryProcAddressing)
Construct from components.
tmp< DimensionedField< Type, volMesh > > reconstructField(const IOobject &fieldObject, const UPtrList< DimensionedField< Type, volMesh > > &procFields) const
Reconstruct volume internal field.
tmp< GeometricField< Type, fvPatchField, volMesh > > reconstructVolumeField(const IOobject &fieldObject) const
Read and reconstruct volume field.
label reconstructVolumeFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes())
Read, reconstruct and write all/selected volume fields.
label reconstructInternalFields(const UPtrList< const IOobject > &fieldObjects)
Read, reconstruct and write specified volume internal fields.
tmp< GeometricField< Type, fvPatchField, volMesh > > reconstructField(const IOobject &fieldObject, const UPtrList< GeometricField< Type, fvPatchField, volMesh > > &) const
Reconstruct volume field.
label reconstructVolumeFields(const UPtrList< const IOobject > &fieldObjects)
Read, reconstruct and write specified volume fields.
label reconstructAllFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes())
Reconstruct all known field types.
label reconstructSurfaceFields(const IOobjectList &objects, const wordRes &selectedFields=wordRes())
Read, reconstruct and write all/selected surface fields.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > reconstructSurfaceField(const IOobject &fieldObject) const
Read and reconstruct surface field.
label nReconstructed() const noexcept
Return number of fields reconstructed.
static int verbose_
Output verbosity when writing.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > reconstructField(const IOobject &fieldObject, const UPtrList< GeometricField< Type, fvsPatchField, surfaceMesh > > &) const
Reconstruct surface field.
label reconstructSurfaceFields(const UPtrList< const IOobject > &fieldObjects)
Read, reconstruct and write specified surface fields.
tmp< DimensionedField< Type, volMesh > > reconstructInternalField(const IOobject &fieldObject) const
Read and reconstruct volume internal field.
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
A FieldMapper for finite-volume patch fields.
fvPatchFieldMapper()=default
Default construct.
A class for managing temporary objects.
Definition tmp.H:75
A List of wordRe with additional matching capabilities.
Definition wordRes.H:56
dynamicFvMesh & mesh
Namespace for OpenFOAM.
const direction noexcept
Definition scalarImpl.H:265
UList< label > labelUList
A UList of labels.
Definition UList.H:75