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 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 fieldsDistributorTemplates.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef Foam_fieldsDistributor_H
38#define Foam_fieldsDistributor_H
39
40#include "IOobjectList.H"
41#include "boolList.H"
42#include "PtrList.H"
43#include "GeometricField.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50/*---------------------------------------------------------------------------*\
51 Class fieldsDistributor Declaration
52\*---------------------------------------------------------------------------*/
55{
56public:
57
58 // Reading helpers
59
60 //- Generic mesh-based field reading
61 template<class GeoField>
62 static void readField
63 (
64 const IOobject& io,
65 const typename GeoField::Mesh& mesh,
66 const label i,
68 );
69
70 //- Definition of readField for GeometricFields only
71 template<class Type, template<class> class PatchField, class GeoMesh>
72 static void readField
73 (
74 const IOobject& io,
75 const typename GeoMesh::Mesh& mesh,
76 const label i,
78 );
79
80
81 //- Read fields and store on the pointer list
82 template
83 <
84 class Type,
85 template<class> class PatchField,
86 class GeoMesh
87 >
88 static void readFields
89 (
90 const typename GeoMesh::Mesh& mesh,
91 const IOobjectList& objects,
93 const bool readOldTime
94 );
95
96 //- Read fields and hold on the pointer list
97 template<class Mesh, class GeoField>
98 static void readFields
99 (
100 const Mesh& mesh,
101 const IOobjectList& objects,
103 );
104
105
106 //- Read volume/surface/point/area fields that may or may not exist
107 //- on all processors
108 template<class GeoField, class MeshSubsetter>
109 static void readFields
110 (
111 const boolList& haveMeshOnProc,
112 const typename GeoField::Mesh& mesh,
113 const autoPtr<MeshSubsetter>& subsetterPtr,
114 IOobjectList& allObjects,
116 const bool deregister = false
117 );
118};
119
120
121// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122
123} // End namespace Foam
124
125// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126
127#ifdef NoRepository
129#endif
130
131// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132
133#endif
134
135// ************************************************************************* //
Generic mesh wrapper used by volMesh, surfaceMesh, pointMesh etc.
Definition: GeoMesh.H:49
MESH Mesh
Definition: GeoMesh.H:62
Generic GeometricField class.
List of IOobjects with searching and retrieving facilities.
Definition: IOobjectList.H:59
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
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 readField(const IOobject &io, const typename GeoField::Mesh &mesh, const label i, PtrList< GeoField > &fields)
Generic mesh-based field reading.
dynamicFvMesh & mesh
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Namespace for OpenFOAM.
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:97