fvFieldReconstructor.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-2023 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::fvFieldReconstructor
26 
27 Description
28  Finite volume reconstructor for volume and surface fields.
29 
30 SourceFiles
31  fvFieldReconstructor.C
32  fvFieldReconstructorReconstructFields.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef fvFieldReconstructor_H
37 #define fvFieldReconstructor_H
38 
39 #include "PtrList.H"
40 #include "surfaceFields.H"
41 #include "IOobjectList.H"
42 #include "fvPatchFieldMapper.H"
44 #include "labelIOList.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class fvFieldReconstructor Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 {
57  // Private Data
58 
59  //- Reconstructed mesh reference
60  const fvMesh& completeMesh_;
61 
62  //- List of processor meshes
63  const PtrList<fvMesh>& procMeshes_;
64 
65  //- List of processor face addressing lists
66  const labelListList& faceProcAddressing_;
67 
68  //- List of processor cell addressing lists
69  const labelListList& cellProcAddressing_;
70 
71  //- Boundary field of face addressing
72  const PtrList<surfaceLabelField::Boundary>& faceProcAddressingBf_;
73 
74  //- Number of fields reconstructed
75  label nReconstructed_;
76 
77 
78  // Private Member Functions
79 
80  //- Convert a processor patch to the corresponding complete patch index
81  label completePatchID(const label proci, const label procPatchi) const;
82 
83  //- ...
84  template<class Type>
85  static void rmapFaceToFace
86  (
87  Field<Type>& toField,
88  const Field<Type>& fromField,
89  const labelUList& addressing,
90  const bool isFlux
91  );
92 
93 
94 public:
95 
96  // Constructors
97 
98  //- Construct from components
100  (
101  const fvMesh& mesh,
102  const PtrList<fvMesh>& procMeshes,
103  const labelListList& faceProcAddressing,
104  const labelListList& cellProcAddressing,
105  const PtrList<surfaceLabelField::Boundary>& faceProcAddressingBf
106  );
107 
108  //- Disallow default bitwise copy construction
110 
111 
112  // Member Functions
113 
114  //- Return number of fields reconstructed
115  label nReconstructed() const
116  {
117  return nReconstructed_;
118  }
119 
120  //- Reconstruct volume internal field
121  template<class Type>
124  (
125  const IOobject& fieldIoObject,
126  const PtrList<DimensionedField<Type, volMesh>>& procFields
127  ) const;
128 
129  //- Read and reconstruct volume internal field
130  template<class Type>
132  reconstructFvVolumeInternalField(const IOobject& fieldIoObject) const;
133 
134 
135  //- Reconstruct volume field
136  template<class Type>
139  (
140  const IOobject& fieldIoObject,
141  const PtrList<VolField<Type>>&
142  ) const;
143 
144  //- Read and reconstruct volume field
145  template<class Type>
147  reconstructFvVolumeField(const IOobject& fieldIoObject) const;
148 
149 
150  //- Reconstruct surface field
151  template<class Type>
154  (
155  const IOobject& fieldIoObject,
157  ) const;
158 
159  //- Read and reconstruct surface field
160  template<class Type>
162  reconstructFvSurfaceField(const IOobject& fieldIoObject) const;
163 
164  //- Read, reconstruct and write all/selected volume internal fields
165  template<class Type>
167  (
168  const IOobjectList& objects,
169  const HashSet<word>& selectedFields
170  );
171 
172  //- Read, reconstruct and write all/selected volume fields
173  template<class Type>
175  (
176  const IOobjectList& objects,
177  const HashSet<word>& selectedFields
178  );
179 
180  //- Read, reconstruct and write all/selected surface fields
181  template<class Type>
183  (
184  const IOobjectList& objects,
185  const HashSet<word>& selectedFields
186  );
187 
188 
189  // Member Operators
190 
191  //- Disallow default bitwise assignment
192  void operator=(const fvFieldReconstructor&) = delete;
193 };
194 
195 
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197 
198 } // End namespace Foam
199 
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201 
202 #ifdef NoRepository
204 #endif
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #endif
209 
210 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Pre-declare SubField and related Field type.
Definition: Field.H:82
Generic GeometricField class.
A HashTable with keys but without contents.
Definition: HashSet.H:62
List of IOobjects with searching and retrieving facilities.
Definition: IOobjectList.H:53
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
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
Finite volume reconstructor for volume and surface fields.
tmp< SurfaceField< Type > > reconstructFvSurfaceField(const IOobject &fieldIoObject, const PtrList< SurfaceField< Type >> &) const
Reconstruct surface field.
void reconstructFvVolumeInternalFields(const IOobjectList &objects, const HashSet< word > &selectedFields)
Read, reconstruct and write all/selected volume internal fields.
void operator=(const fvFieldReconstructor &)=delete
Disallow default bitwise assignment.
void reconstructFvVolumeFields(const IOobjectList &objects, const HashSet< word > &selectedFields)
Read, reconstruct and write all/selected volume fields.
tmp< DimensionedField< Type, volMesh > > reconstructFvVolumeInternalField(const IOobject &fieldIoObject, const PtrList< DimensionedField< Type, volMesh >> &procFields) const
Reconstruct volume internal field.
label nReconstructed() const
Return number of fields reconstructed.
tmp< VolField< Type > > reconstructFvVolumeField(const IOobject &fieldIoObject, const PtrList< VolField< Type >> &) const
Reconstruct volume field.
void reconstructFvSurfaceFields(const IOobjectList &objects, const HashSet< word > &selectedFields)
Read, reconstruct and write all/selected surface fields.
fvFieldReconstructor(const fvMesh &mesh, const PtrList< fvMesh > &procMeshes, const labelListList &faceProcAddressing, const labelListList &cellProcAddressing, const PtrList< surfaceLabelField::Boundary > &faceProcAddressingBf)
Construct from components.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
A class for managing temporary objects.
Definition: tmp.H:55
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
objects
Foam::surfaceFields.