readFields.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) 2016-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
26InClass
27 Foam::readFields
28
29Description
30 Helper routines for reading a field or fields, optionally with
31 a mesh subset (using fvMeshSubsetProxy).
32
33SourceFiles
34 readFields.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_readFields_H
39#define Foam_readFields_H
40
41#include "fvMeshSubsetProxy.H"
42#include "IOobjectList.H"
43#include "PtrList.H"
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50//- Get the field or return nullptr
51template<class GeoField>
53(
54 const IOobject* io,
55 const typename GeoField::Mesh& mesh,
56 const bool syncPar
57);
58
59
60//- Get the field and subset it, or return nullptr
61template<class GeoField>
63(
64 const IOobject* io,
65 const fvMeshSubsetProxy& proxy,
66 const bool syncPar
67);
68
69
70//- Get the named field from the objects, or return nullptr.
71template<class GeoField>
73(
74 const typename GeoField::Mesh& mesh,
75 const IOobjectList& objects,
76 const word& fieldName,
77 const bool syncPar
78);
79
80
81//- Get the named field from the objects and subset it, or return nullptr
82template<class GeoField>
84(
85 const fvMeshSubsetProxy& proxy,
86 const IOobjectList& objects,
87 const word& fieldName,
88 const bool syncPar
89);
90
91
92//- Read the fields, and return as a pointer list
93template<class GeoField>
95(
96 const typename GeoField::Mesh& mesh,
97 const IOobjectList& objects
98);
99
100
101//- Read the fields, optionally subset, and return as a pointer list
102template<class GeoField>
104(
105 const fvMeshSubsetProxy& proxy,
106 const IOobjectList& objects
107);
108
109
110} // End namespace Foam
111
112// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113
114#ifdef NoRepository
115 #include "readFields.C"
116#endif
117
118// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119
120#endif
121
122// ************************************************************************* //
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
Simple proxy for holding a mesh, or mesh-subset. The subMeshes are currently limited to cellSet or ce...
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Namespace for OpenFOAM.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
tmp< GeoField > getField(const IOobject *io, const typename GeoField::Mesh &mesh)
Get the field or return nullptr.
Definition: readFields.H:53