Loading...
Searching...
No Matches
fieldsDistributor.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2022-2025 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 fieldsDistributor
28
29Description
30 Common methods/utilities for field decomposers/distributors etc.
31
32SourceFiles
33 fieldsDistributor.txx
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef Foam_fieldsDistributor_H
38#define Foam_fieldsDistributor_H
39
40#include "bitSet.H"
41#include "fileOperation.H"
42#include "PtrList.H"
43#include "IOobjectList.H"
44#include "GeometricField.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
51/*---------------------------------------------------------------------------*\
52 Class fieldsDistributor Declaration
53\*---------------------------------------------------------------------------*/
54
56{
57 // Private Methods
58
59 //- Read volume/surface/point/area fields that may or may not exist
60 //- on all processors
61 template<class BoolListType, class GeoField, class MeshSubsetter>
62 static void readFieldsImpl
63 (
65 refPtr<fileOperation>* readHandlerPtr,
66 const BoolListType& haveMeshOnProc,
68 const MeshSubsetter* subsetter,
69 const typename GeoField::Mesh& mesh,
70 IOobjectList& allObjects,
72 const bool deregister
73 );
74
75
76public:
77
78 // Reading helpers
79
80 //- Generic mesh-based field reading
81 template<class GeoField>
82 static void readField
83 (
84 const IOobject& io,
85 const typename GeoField::Mesh& mesh,
86 const label i,
88 );
89
90 //- Definition of readField for GeometricFields only
91 template<class Type, template<class> class PatchField, class GeoMesh>
92 static void readField
93 (
94 const IOobject& io,
95 const typename GeoMesh::Mesh& mesh,
96 const label i,
98 );
99
100
101 //- Read fields and store on the pointer list
102 template
103 <
104 class Type,
105 template<class> class PatchField,
106 class GeoMesh
107 >
108 static void readFields
109 (
110 const typename GeoMesh::Mesh& mesh,
111 const IOobjectList& objects,
113 const bool readOldTime
114 );
115
116 //- Read fields and hold on the pointer list
117 template<class Mesh, class GeoField>
118 static void readFields
119 (
120 const Mesh& mesh,
121 const IOobjectList& objects,
123 );
124
125
126 //- Read volume/surface/point/area fields that may or may not exist
127 //- on all processors
128 template<class GeoField, class MeshSubsetter>
129 static void readFields
130 (
131 const bitSet& haveMeshOnProc,
133 const MeshSubsetter* subsetter,
134 const typename GeoField::Mesh& mesh,
135 IOobjectList& allObjects,
137 const bool deregister = false
138 );
139
140 //- Read volume/surface/point/area fields that may or may not exist
141 //- on all processors
142 template<class GeoField, class MeshSubsetter>
143 static void readFields
144 (
145 const boolUList& haveMeshOnProc,
147 const MeshSubsetter* subsetter,
148 const typename GeoField::Mesh& mesh,
149 IOobjectList& allObjects,
151 const bool deregister = false
152 );
153
154 //- Read volume/surface/point/area fields that may or may not exist
155 //- on all processors
156 template<class GeoField, class MeshSubsetter>
157 static void readFields
158 (
159 const bitSet& haveMeshOnProc,
160 const typename GeoField::Mesh& mesh,
162 const autoPtr<MeshSubsetter>& subsetter,
163 IOobjectList& allObjects,
165 const bool deregister = false
166 );
167
168 //- Read volume/surface/point/area fields that may or may not exist
169 //- on all processors
170 template<class GeoField, class MeshSubsetter>
171 static void readFields
172 (
173 const boolUList& haveMeshOnProc,
174 const typename GeoField::Mesh& mesh,
176 const autoPtr<MeshSubsetter>& subsetter,
177 IOobjectList& allObjects,
179 const bool deregister = false
180 );
181
182 //- Read volume/surface/point/area fields that may or may not exist
183 //- on all processors
184 template<class GeoField, class MeshSubsetter>
185 static void readFields
186 (
187 const bitSet& haveMeshOnProc,
188 refPtr<fileOperation>& readHandler,
189 const typename GeoField::Mesh& mesh,
191 const autoPtr<MeshSubsetter>& subsetter,
192 IOobjectList& allObjects,
194 const bool deregister = false
195 );
196
197 //- Read volume/surface/point/area fields that may or may not exist
198 //- on all processors
199 template<class GeoField, class MeshSubsetter>
200 static void readFields
201 (
202 const boolUList& haveMeshOnProc,
203 refPtr<fileOperation>& readHandler,
204 const typename GeoField::Mesh& mesh,
206 const autoPtr<MeshSubsetter>& subsetter,
207 IOobjectList& allObjects,
209 const bool deregister = false
210 );
211};
212
213
214// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215
216} // End namespace Foam
218// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219
220#ifdef NoRepository
221 #include "fieldsDistributor.txx"
222#endif
223
224// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225
226#endif
227
228// ************************************************************************* //
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition GeoMesh.H:46
Generic GeometricField class.
List of IOobjects with searching and retrieving facilities. Implemented as a HashTable,...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition PtrList.H:67
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition bitSet.H:61
static void readFields(const typename GeoMesh::Mesh &mesh, const IOobjectList &objects, PtrList< GeometricField< Type, PatchField, GeoMesh > > &fields, const bool readOldTime)
Read fields and store on the pointer list.
static void readFields(const boolUList &haveMeshOnProc, refPtr< fileOperation > &readHandler, const typename GeoField::Mesh &mesh, const autoPtr< MeshSubsetter > &subsetter, IOobjectList &allObjects, PtrList< GeoField > &fields, const bool deregister=false)
Read volume/surface/point/area fields that may or may not exist on all processors.
static void readFields(const bitSet &haveMeshOnProc, refPtr< fileOperation > &readHandler, const typename GeoField::Mesh &mesh, const autoPtr< MeshSubsetter > &subsetter, IOobjectList &allObjects, PtrList< GeoField > &fields, const bool deregister=false)
Read volume/surface/point/area fields that may or may not exist on all processors.
static void readField(const IOobject &io, const typename GeoMesh::Mesh &mesh, const label i, PtrList< GeometricField< Type, PatchField, GeoMesh > > &fields)
Definition of readField for GeometricFields only.
static void readField(const IOobject &io, const typename GeoField::Mesh &mesh, const label i, PtrList< GeoField > &fields)
Generic mesh-based field reading.
static void readFields(const bitSet &haveMeshOnProc, const MeshSubsetter *subsetter, const typename GeoField::Mesh &mesh, IOobjectList &allObjects, PtrList< GeoField > &fields, const bool deregister=false)
Read volume/surface/point/area fields that may or may not exist on all processors.
static void readFields(const bitSet &haveMeshOnProc, const typename GeoField::Mesh &mesh, const autoPtr< MeshSubsetter > &subsetter, IOobjectList &allObjects, PtrList< GeoField > &fields, const bool deregister=false)
Read volume/surface/point/area fields that may or may not exist on all processors.
static void readFields(const boolUList &haveMeshOnProc, const MeshSubsetter *subsetter, const typename GeoField::Mesh &mesh, IOobjectList &allObjects, PtrList< GeoField > &fields, const bool deregister=false)
Read volume/surface/point/area fields that may or may not exist on all processors.
static void readFields(const Mesh &mesh, const IOobjectList &objects, PtrList< GeoField > &fields)
Read fields and hold on the pointer list.
static void readFields(const boolUList &haveMeshOnProc, const typename GeoField::Mesh &mesh, const autoPtr< MeshSubsetter > &subsetter, IOobjectList &allObjects, PtrList< GeoField > &fields, const bool deregister=false)
Read volume/surface/point/area fields that may or may not exist on all processors.
A class for managing references or pointers (no reference counting).
Definition refPtr.H:54
dynamicFvMesh & mesh
const auto & io
Namespace for OpenFOAM.
UList< bool > boolUList
A UList of bools.
Definition UList.H:73
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields