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-2019 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 "fvMesh.H"
41 #include "IOobjectList.H"
42 #include "fvPatchFieldMapper.H"
43 #include "setSizeFieldMapper.H"
44 #include "labelIOList.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 
52 /*---------------------------------------------------------------------------*\
53  Class fvFieldReconstructor Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 {
58  // Private Data
59 
60  //- Reconstructed mesh reference
61  fvMesh& mesh_;
62 
63  //- List of processor meshes
64  const PtrList<fvMesh>& procMeshes_;
65 
66  //- List of processor face addressing lists
67  const PtrList<labelIOList>& faceProcAddressing_;
68 
69  //- List of processor cell addressing lists
70  const PtrList<labelIOList>& cellProcAddressing_;
71 
72  //- List of processor boundary addressing lists
73  const PtrList<labelIOList>& boundaryProcAddressing_;
74 
75  //- Number of fields reconstructed
76  label nReconstructed_;
77 
78 
79 public:
80 
81  //- Mapper for sizing only - does not do any actual mapping.
83  :
84  public fvPatchFieldMapper,
85  public setSizeFieldMapper
86  {
87  public:
88 
89  // Constructors
90 
91  //- Construct given size
93  :
94  setSizeFieldMapper(size)
95  {}
96  };
97 
98 
99  // Constructors
100 
101  //- Construct from components
103  (
104  fvMesh& mesh,
105  const PtrList<fvMesh>& procMeshes,
107  const PtrList<labelIOList>& cellProcAddressing,
108  const PtrList<labelIOList>& boundaryProcAddressing
109  );
110 
111  //- Disallow default bitwise copy construction
113 
114 
115  // Member Functions
116 
117  //- Return number of fields reconstructed
118  label nReconstructed() const
119  {
120  return nReconstructed_;
121  }
122 
123  //- Reconstruct volume internal field
124  template<class Type>
127  (
128  const IOobject& fieldIoObject,
129  const PtrList<DimensionedField<Type, volMesh>>& procFields
130  ) const;
131 
132  //- Read and reconstruct volume internal field
133  template<class Type>
135  reconstructFvVolumeInternalField(const IOobject& fieldIoObject) const;
136 
137 
138  //- Reconstruct volume field
139  template<class Type>
142  (
143  const IOobject& fieldIoObject,
145  ) const;
146 
147  //- Read and reconstruct volume field
148  template<class Type>
150  reconstructFvVolumeField(const IOobject& fieldIoObject) const;
151 
152 
153  //- Reconstruct surface field
154  template<class Type>
157  (
158  const IOobject& fieldIoObject,
160  ) const;
161 
162  //- Read and reconstruct surface field
163  template<class Type>
165  reconstructFvSurfaceField(const IOobject& fieldIoObject) const;
166 
167  //- Read, reconstruct and write all/selected volume internal fields
168  template<class Type>
170  (
171  const IOobjectList& objects,
172  const HashSet<word>& selectedFields
173  );
174 
175  //- Read, reconstruct and write all/selected volume fields
176  template<class Type>
178  (
179  const IOobjectList& objects,
180  const HashSet<word>& selectedFields
181  );
182 
183  //- Read, reconstruct and write all/selected surface fields
184  template<class Type>
186  (
187  const IOobjectList& objects,
188  const HashSet<word>& selectedFields
189  );
190 
191 
192  // Member Operators
193 
194  //- Disallow default bitwise assignment
195  void operator=(const fvFieldReconstructor&) = delete;
196 };
197 
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 } // End namespace Foam
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #ifdef NoRepository
207 #endif
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 #endif
212 
213 // ************************************************************************* //
A HashTable with keys but without contents.
Definition: HashSet.H:59
Field sizing mapper which sets the field size and does not map values.
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
List of IOobjects with searching and retrieving facilities.
Definition: IOobjectList.H:50
tmp< GeometricField< Type, fvPatchField, volMesh > > reconstructFvVolumeField(const IOobject &fieldIoObject, const PtrList< GeometricField< Type, fvPatchField, volMesh >> &) const
Reconstruct volume field.
PtrList< labelIOList > & faceProcAddressing
void reconstructFvSurfaceFields(const IOobjectList &objects, const HashSet< word > &selectedFields)
Read, reconstruct and write all/selected surface fields.
Generic GeometricField class.
void operator=(const fvFieldReconstructor &)=delete
Disallow default bitwise assignment.
dynamicFvMesh & mesh
Foam::fvPatchFieldMapper.
fvPatchFieldReconstructor(const label size)
Construct given size.
fvFieldReconstructor(fvMesh &mesh, const PtrList< fvMesh > &procMeshes, const PtrList< labelIOList > &faceProcAddressing, const PtrList< labelIOList > &cellProcAddressing, const PtrList< labelIOList > &boundaryProcAddressing)
Construct from components.
objects
Finite volume reconstructor for volume and surface fields.
Mapper for sizing only - does not do any actual mapping.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:70
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
label nReconstructed() const
Return number of fields reconstructed.
tmp< DimensionedField< Type, volMesh > > reconstructFvVolumeInternalField(const IOobject &fieldIoObject, const PtrList< DimensionedField< Type, volMesh >> &procFields) const
Reconstruct volume internal field.
void reconstructFvVolumeFields(const IOobjectList &objects, const HashSet< word > &selectedFields)
Read, reconstruct and write all/selected volume fields.
A class for managing temporary objects.
Definition: PtrList.H:53
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
void reconstructFvVolumeInternalFields(const IOobjectList &objects, const HashSet< word > &selectedFields)
Read, reconstruct and write all/selected volume internal fields.
Namespace for OpenFOAM.
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > reconstructFvSurfaceField(const IOobject &fieldIoObject, const PtrList< GeometricField< Type, fvsPatchField, surfaceMesh >> &) const
Reconstruct surface field.