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) 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 #include "LagrangianMesh.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 class IOobjectList;
48 
49 /*---------------------------------------------------------------------------*\
50  Class LagrangianFieldReconstructor Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 {
55  // Private Data
56 
57  //- The complete mesh
58  LagrangianMesh completeMesh_;
59 
60  //- List of processor meshes
61  PtrList<LagrangianMesh> procMeshes_;
62 
63 
64  // Private Member Functions
65 
66  //- Return whether anything in the object list gets reconstructed
67  template<class GeoField>
68  static bool reconstructs
69  (
70  const IOobjectList& objects,
71  const HashSet<word>& selectedFields
72  );
73 
74  //- Return the reconstructed primitive field given a list of processor
75  // (internal) fields
76  template
77  <
78  class Type,
79  template<class> class PrimitiveField,
80  template<class, class, template<class> class> class GeoField
81  >
82  tmp<PrimitiveField<Type>> reconstructLagrangianPrimitiveField
83  (
84  const PtrList
85  <
86  GeoField<Type, LagrangianMesh, PrimitiveField>
87  >& procFields
88  ) const;
89 
90  //- Return the reconstructed internal field given a list of processor
91  // internal fields
92  template<class Type, template<class> class PrimitiveField>
94  reconstructLagrangianField
95  (
96  const PtrList
97  <
99  >& procFields
100  ) const;
101 
102  //- Return the reconstructed field given a list of processor fields
103  template<class Type, template<class> class PrimitiveField>
105  reconstructLagrangianField
106  (
107  const PtrList
108  <
110  >& procFields
111  ) const;
112 
113 
114 public:
115 
116  // Constructors
117 
118  //- Construct from components
120  (
121  const fvMesh& completeFvMesh,
122  const PtrList<fvMesh>& procFvMeshes,
123  const labelListList& faceProcAddressing,
124  const labelListList& cellProcAddressing,
125  const word& LagrangianName
126  );
127 
128  //- Disallow default bitwise copy construction
130  (
132  ) = delete;
133 
134 
135  //- Destructor
137 
138 
139  // Member Functions
140 
141  //- Access the complete mesh
142  inline const LagrangianMesh& completeMesh() const
143  {
144  return completeMesh_;
145  }
146 
147  //- Access the list of processor meshes
148  inline const PtrList<LagrangianMesh>& procMeshes() const
149  {
150  return procMeshes_;
151  }
152 
153  //- Return whether anything in the object list gets reconstructed
154  static bool reconstructs
155  (
156  const IOobjectList& objects,
157  const HashSet<word>& selectedFields
158  );
159 
160  //- Write the reconstructed positions
161  void reconstructPositions() const;
162 
163  //- Read and reconstruct a field
164  template<class GeoField>
166 
167  //- Read, reconstruct and write all/selected Lagrangian fields
168  template<class GeoField>
169  void reconstructFields
170  (
171  const IOobjectList& objects,
172  const HashSet<word>& selectedFields
173  ) const;
174 
175 
176  // Member Operators
177 
178  //- Disallow default bitwise assignment
179  void operator=(const LagrangianFieldReconstructor&) = delete;
180 };
181 
182 
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184 
185 } // End namespace Foam
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #ifdef NoRepository
191 #endif
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 #endif
196 
197 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
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
tmp< GeoField > reconstructField(const IOobject &) const
Read and reconstruct a field.
const LagrangianMesh & completeMesh() const
Access the complete mesh.
LagrangianFieldReconstructor(const fvMesh &completeFvMesh, const PtrList< fvMesh > &procFvMeshes, const labelListList &faceProcAddressing, const labelListList &cellProcAddressing, const word &LagrangianName)
Construct from components.
void reconstructPositions() const
Write the reconstructed positions.
const PtrList< LagrangianMesh > & procMeshes() const
Access the list of processor meshes.
void operator=(const LagrangianFieldReconstructor &)=delete
Disallow default bitwise assignment.
void reconstructFields(const IOobjectList &objects, const HashSet< word > &selectedFields) const
Read, reconstruct and write all/selected Lagrangian fields.
Class containing Lagrangian geometry and topology.
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
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:96
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