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  fvFieldReconstructorTemplates.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 "labelIOList.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class fvFieldReconstructor Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 {
55  // Private Data
56 
57  //- Reconstructed mesh reference
58  const fvMesh& completeMesh_;
59 
60  //- List of processor meshes
61  const PtrList<fvMesh>& procMeshes_;
62 
63  //- List of processor face addressing lists
64  const labelListList& faceProcAddressing_;
65 
66  //- List of processor cell addressing lists
67  const labelListList& cellProcAddressing_;
68 
69  //- Boundary field of face addressing
70  const PtrList<surfaceLabelField::Boundary>& faceProcAddressingBf_;
71 
72 
73  // Private Member Functions
74 
75  //- Return whether anything in the object list gets reconstructed
76  template<class FieldType>
77  static bool reconstructs
78  (
79  const IOobjectList& objects,
80  const HashSet<word>& selectedFields
81  );
82 
83  //- Convert a processor patch to the corresponding complete patch index
84  label completePatchID(const label proci, const label procPatchi) const;
85 
86  //- ...
87  template<class Type>
88  static void rmapFaceToFace
89  (
90  Field<Type>& toField,
91  const Field<Type>& fromField,
92  const labelUList& addressing,
93  const bool isFlux
94  );
95 
96  //- Read and reconstruct a volume internal field
97  template<class Type>
99  reconstructVolInternalField(const IOobject& fieldIoObject) const;
100 
101  //- Read and reconstruct a volume field
102  template<class Type>
104  reconstructVolField(const IOobject& fieldIoObject) const;
105 
106  //- Read and reconstruct a surface field
107  template<class Type>
109  reconstructFvSurfaceField(const IOobject& fieldIoObject) const;
110 
111 
112 public:
113 
114  // Constructors
115 
116  //- Construct from components
118  (
119  const fvMesh& mesh,
120  const PtrList<fvMesh>& procMeshes,
121  const labelListList& faceProcAddressing,
122  const labelListList& cellProcAddressing,
123  const PtrList<surfaceLabelField::Boundary>& faceProcAddressingBf
124  );
125 
126  //- Disallow default bitwise copy construction
128 
129 
130  // Member Functions
131 
132  //- Return whether anything in the object list gets reconstructed
133  static bool reconstructs
134  (
135  const IOobjectList& objects,
136  const HashSet<word>& selectedFields
137  );
138 
139  //- Read, reconstruct and write all/selected volume internal fields
140  template<class Type>
142  (
143  const IOobjectList& objects,
144  const HashSet<word>& selectedFields
145  );
146 
147  //- Read, reconstruct and write all/selected volume fields
148  template<class Type>
150  (
151  const IOobjectList& objects,
152  const HashSet<word>& selectedFields
153  );
154 
155  //- Read, reconstruct and write all/selected surface fields
156  template<class Type>
158  (
159  const IOobjectList& objects,
160  const HashSet<word>& selectedFields
161  );
162 
163 
164  // Member Operators
165 
166  //- Disallow default bitwise assignment
167  void operator=(const fvFieldReconstructor&) = delete;
168 };
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #ifdef NoRepository
179 #endif
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #endif
184 
185 // ************************************************************************* //
Pre-declare SubField and related Field type.
Definition: Field.H:83
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.
void operator=(const fvFieldReconstructor &)=delete
Disallow default bitwise assignment.
void reconstructVolInternalFields(const IOobjectList &objects, const HashSet< word > &selectedFields)
Read, reconstruct and write all/selected volume internal fields.
void reconstructVolFields(const IOobjectList &objects, const HashSet< word > &selectedFields)
Read, reconstruct and write all/selected volume fields.
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:99
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.