lagrangianFieldReconstructor.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-2025 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::lagrangianFieldReconstructor
26 
27 Description
28  Lagrangian field reconstructor.
29 
30 SourceFiles
31  lagrangianFieldReconstructor.C
32  lagrangianFieldReconstructorTemplates.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef lagrangianFieldReconstructor_H
37 #define lagrangianFieldReconstructor_H
38 
39 #include "fvMesh.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 class IOobjectList;
47 class passiveParticleCloud;
48 
49 /*---------------------------------------------------------------------------*\
50  Class lagrangianFieldReconstructor Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 {
55  // Private Data
56 
57  //- Reference to complete mesh
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  //- The name of the cloud
70  const word cloudName_;
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  //- Read, reconstruct and write all fields
84  template
85  <
86  class Type,
87  template<class> class ReadIOContainer,
88  template<class> class IOContainer
89  >
90  void reconstructFields
91  (
92  const IOobjectList& objects,
93  const HashSet<word>& selectedFields
94  ) const;
95 
96 
97 public:
98 
99  // Constructors
100 
101  //- Construct from components
103  (
104  const fvMesh& completeMesh,
105  const PtrList<fvMesh>& procMeshes,
106  const labelListList& faceProcAddressing,
107  const labelListList& cellProcAddressing,
108  const word& cloudName
109  );
110 
111  //- Disallow default bitwise copy construction
113  (
115  ) = delete;
116 
117 
118  //- Destructor
120 
121 
122  // Member Functions
123 
124  //- Return whether anything in the object list gets reconstructed
125  static bool reconstructs
126  (
127  const IOobjectList& objects,
128  const HashSet<word>& selectedFields
129  );
130 
131  //- Generate the reconstructed cloud
133 
134  //- Write the reconstructed positions
135  void reconstructPositions() const;
136 
137  //- Read and reconstruct a field
138  template
139  <
140  class Type,
141  template<class> class ReadIOContainer,
142  template<class> class IOContainer
143  >
145  (
146  const IOobject& fieldIoObject
147  ) const;
148 
149  //- Read, reconstruct and write all/selected lagrangian fields
150  template<class Type>
151  void reconstructFields
152  (
153  const IOobjectList& objects,
154  const HashSet<word>& selectedFields
155  ) const;
156 
157 
158  // Member Operators
159 
160  //- Disallow default bitwise assignment
161  void operator=(const lagrangianFieldReconstructor&) = delete;
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #ifdef NoRepository
173 #endif
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
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
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:96
void reconstructPositions() const
Write the reconstructed positions.
autoPtr< passiveParticleCloud > completeCloud() const
Generate the reconstructed cloud.
void operator=(const lagrangianFieldReconstructor &)=delete
Disallow default bitwise assignment.
tmp< IOContainer< Type > > reconstructField(const IOobject &fieldIoObject) const
Read and reconstruct a field.
lagrangianFieldReconstructor(const fvMesh &completeMesh, const PtrList< fvMesh > &procMeshes, const labelListList &faceProcAddressing, const labelListList &cellProcAddressing, const word &cloudName)
Construct from components.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
objects
const word cloudName(propsDict.lookup("cloudName"))