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-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::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 "cloud.H"
40 #include "fvMesh.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  //- Reference to complete mesh
58  const fvMesh& completeMesh_;
59 
60  //- List of processor meshes
61  const PtrList<fvMesh>& procMeshes_;
62 
63  //- The name of the cloud
64  const word cloudName_;
65 
66 
67  // Private Member Functions
68 
69  //- Return whether anything in the object list gets reconstructed
70  template<class FieldType>
71  static bool reconstructs
72  (
73  const IOobjectList& objects,
74  const HashSet<word>& selectedFields
75  );
76 
77  //- Reconstruct a field
78  template
79  <
80  class Type,
81  template<class> class IOContainer,
82  template<class> class IOContainerType
83  >
85  reconstructField(const IOobject& fieldIoObject) const;
86 
87  //- Read, reconstruct and write all fields
88  template
89  <
90  class Type,
91  template<class> class IOContainer,
92  template<class> class IOContainerType
93  >
94  void reconstructFields
95  (
96  const IOobjectList& objects,
97  const HashSet<word>& selectedFields
98  );
99 
100 
101 public:
102 
103  // Constructors
104 
105  //- Construct from components
107  (
108  const fvMesh& completeMesh,
109  const PtrList<fvMesh>& procMeshes,
110  const labelListList& faceProcAddressing,
111  const labelListList& cellProcAddressing,
112  const word& cloudName
113  );
114 
115  //- Disallow default bitwise copy construction
117  (
119  ) = delete;
120 
121 
122  //- Destructor
124 
125 
126  // Member Functions
127 
128  //- Return whether anything in the object list gets reconstructed
129  static bool reconstructs
130  (
131  const IOobjectList& objects,
132  const HashSet<word>& selectedFields
133  );
134 
135  //- Read, reconstruct and write all fields
136  template<class Type>
137  void reconstructFields
138  (
139  const IOobjectList& objects,
140  const HashSet<word>& selectedFields
141  );
142 
143 
144  // Member Operators
145 
146  //- Disallow default bitwise assignment
147  void operator=(const lagrangianFieldReconstructor&) = delete;
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #ifdef NoRepository
159 #endif
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165 // ************************************************************************* //
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
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
void operator=(const lagrangianFieldReconstructor &)=delete
Disallow default bitwise assignment.
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"))