parFvFieldReconstructor.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 | Copyright (C) 2015 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::parFvFieldReconstructor
26 
27 Description
28  Finite volume reconstructor for volume and surface fields.
29 
30  Runs in parallel. Reconstructs from procMesh to baseMesh. baseMesh
31  is non-zero cells on processor0 only.
32 
33 SourceFiles
34  parFvFieldReconstructor.C
35  parFvFieldReconstructorReconstructFields.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef parFvFieldReconstructor_H
40 #define parFvFieldReconstructor_H
41 
42 #include "PtrList.H"
43 #include "fvMesh.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 class mapDistributePolyMesh;
51 class mapDistributeBase;
52 class IOobjectList;
53 
54 /*---------------------------------------------------------------------------*\
55  Class parFvFieldReconstructor Declaration
56 \*---------------------------------------------------------------------------*/
57 
59 {
60  // Private data
61 
62  //- Reconstructed mesh reference
64 
65  //- Processor mesh reference
66  const fvMesh& procMesh_;
67 
68  //- Distribution map reference
70 
71  //- Do I need to to write (usually master only)
72  const bool isWriteProc_;
73 
74  //- Patch mappers
76 
77 
78  // Private Member Functions
79 
80  //- Construct per-patch addressing
81  void createPatchFaceMaps();
82 
83  //- Disallow default bitwise copy construct
85 
86  //- Disallow default bitwise assignment
88 
89 
90 public:
91 
92  // Constructors
93 
94  //- Construct from components
96  (
97  fvMesh& baseMesh,
98  const fvMesh& procMesh,
99  const mapDistributePolyMesh& distMap,
100  const bool isWriteProc
101  );
102 
103 
104  // Member Functions
105 
106  //- Reconstruct volume internal field
107  template<class Type>
110  (
112  ) const;
113 
114  //- Read and reconstruct volume internal field
115  template<class Type>
117  reconstructFvVolumeInternalField(const IOobject& fieldIoObject) const;
118 
119 
120 
121  //- Reconstruct volume field
122  template<class Type>
125  (
127  ) const;
128 
129  //- Read and reconstruct volume field
130  template<class Type>
132  reconstructFvVolumeField(const IOobject& fieldIoObject) const;
133 
134 
135 
136  //- Reconstruct surface field
137  template<class Type>
140  (
142  ) const;
143 
144  //- Read and reconstruct surface field
145  template<class Type>
147  reconstructFvSurfaceField(const IOobject& fieldIoObject) const;
148 
149 
150  //- Read, reconstruct and write all/selected volume internal fields
151  template<class Type>
153  (
154  const IOobjectList& objects,
155  const HashSet<word>& selectedFields
156  ) const;
157 
158  //- Read, reconstruct and write all/selected volume fields
159  template<class Type>
161  (
162  const IOobjectList& objects,
163  const HashSet<word>& selectedFields
164  ) const;
165 
166  //- Read, reconstruct and write all/selected surface fields
167  template<class Type>
169  (
170  const IOobjectList& objects,
171  const HashSet<word>& selectedFields
172  ) const;
173 
174  //- Helper: reconstruct and write mesh points
175  // (note: should be moved to something like processorMeshes class)
176  void reconstructPoints();
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #ifdef NoRepository
187 # include "parFvFieldReconstructorReconstructFields.C"
188 #endif
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #endif
193 
194 // ************************************************************************* //
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::parFvFieldReconstructor::reconstructFvVolumeInternalField
tmp< DimensionedField< Type, volMesh > > reconstructFvVolumeInternalField(const DimensionedField< Type, volMesh > &) const
Reconstruct volume internal field.
Foam::parFvFieldReconstructor::reconstructPoints
void reconstructPoints()
Helper: reconstruct and write mesh points.
Definition: parFvFieldReconstructor.C:95
Foam::parFvFieldReconstructor::isWriteProc_
const bool isWriteProc_
Do I need to to write (usually master only)
Definition: parFvFieldReconstructor.H:71
Foam::parFvFieldReconstructor::baseMesh_
fvMesh & baseMesh_
Reconstructed mesh reference.
Definition: parFvFieldReconstructor.H:62
Foam::HashSet
A HashTable with keys but without contents.
Definition: HashSet.H:59
Foam::parFvFieldReconstructor::patchFaceMaps_
PtrList< mapDistributeBase > patchFaceMaps_
Patch mappers.
Definition: parFvFieldReconstructor.H:74
Foam::parFvFieldReconstructor::procMesh_
const fvMesh & procMesh_
Processor mesh reference.
Definition: parFvFieldReconstructor.H:65
Foam::parFvFieldReconstructor::reconstructFvVolumeInternalFields
void reconstructFvVolumeInternalFields(const IOobjectList &objects, const HashSet< word > &selectedFields) const
Read, reconstruct and write all/selected volume internal fields.
Definition: parFvFieldReconstructorReconstructFields.C:420
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::parFvFieldReconstructor::operator=
void operator=(const parFvFieldReconstructor &)
Disallow default bitwise assignment.
Foam::parFvFieldReconstructor::reconstructFvSurfaceField
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > reconstructFvSurfaceField(const GeometricField< Type, fvsPatchField, surfaceMesh > &) const
Reconstruct surface field.
fld
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
fvMesh.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::parFvFieldReconstructor::distMap_
const mapDistributePolyMesh & distMap_
Distribution map reference.
Definition: parFvFieldReconstructor.H:68
Foam::parFvFieldReconstructor::reconstructFvSurfaceFields
void reconstructFvSurfaceFields(const IOobjectList &objects, const HashSet< word > &selectedFields) const
Read, reconstruct and write all/selected surface fields.
Definition: parFvFieldReconstructorReconstructFields.C:504
Foam::IOobjectList
List of IOobjects with searching and retrieving facilities.
Definition: IOobjectList.H:50
Foam::parFvFieldReconstructor::parFvFieldReconstructor
parFvFieldReconstructor(const parFvFieldReconstructor &)
Disallow default bitwise copy construct.
Foam::parFvFieldReconstructor::reconstructFvVolumeField
tmp< GeometricField< Type, fvPatchField, volMesh > > reconstructFvVolumeField(const GeometricField< Type, fvPatchField, volMesh > &fld) const
Reconstruct volume field.
PtrList.H
Foam::parFvFieldReconstructor::reconstructFvVolumeFields
void reconstructFvVolumeFields(const IOobjectList &objects, const HashSet< word > &selectedFields) const
Read, reconstruct and write all/selected volume fields.
Definition: parFvFieldReconstructorReconstructFields.C:461
Foam::mapDistributePolyMesh
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Definition: mapDistributePolyMesh.H:57
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::parFvFieldReconstructor::createPatchFaceMaps
void createPatchFaceMaps()
Construct per-patch addressing.
Definition: parFvFieldReconstructor.C:31
Foam::parFvFieldReconstructor
Finite volume reconstructor for volume and surface fields.
Definition: parFvFieldReconstructor.H:57
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51