Loading...
Searching...
No Matches
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) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2016-2023 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Global
28 Foam::ReadFields
29
30Description
31 Field reading functions for post-processing utilities
32
33SourceFiles
34 ReadFields.C
35 ReadFieldsTemplates.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef Foam_ReadFields_H
40#define Foam_ReadFields_H
41
42#include "PtrList.H"
43#include "wordList.H"
44#include "DynamicList.H"
45#include "GeometricField.H"
46#include "HashSet.H"
47#include "LIFOStack.H"
48
49// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50
51namespace Foam
52{
53
54class regIOobject;
55class IOobjectList;
56class objectRegistry;
57
58//- Read Geometric fields of templated type.
59// \return sorted names of fields read.
60// \note All processors guaranteed to read fields in same order.
61template<class Type, template<class> class PatchField, class GeoMesh>
63(
64 const typename GeoMesh::Mesh& mesh,
65 const IOobjectList& objects,
67 const bool syncPar = true,
68 const bool readOldTime = false
69);
70
71
72//- Read fields of the templated type.
73// \return sorted names of fields read.
74// \note All processors guaranteed to read fields in same order.
75template<class GeoField, class Mesh>
77(
78 const Mesh& mesh,
79 const IOobjectList& objects,
81 const bool syncPar = true
82);
83
84//- Read non-mesh fields (uniformDimensionedField like 'g').
85// \return sorted names of fields read.
86// \note All processors guaranteed to read fields in same order.
87template<class GeoField>
89(
90 const IOobjectList& objects,
92 const bool syncPar = true
93);
94
95//- Read all GeometricFields of the templated type.
96// \param fieldsCache is an objectRegistry of all stored fields
97template<class GeoField>
98static void ReadFields
99(
100 const word& fieldName,
101 const typename GeoField::Mesh& mesh,
102 const wordList& timeNames,
103 objectRegistry& fieldsCache
104);
105
106//- Read all GeometricFields of the templated type.
107// \param fieldsCache is the objectRegistry name where fields are stored
108template<class GeoField>
109static void ReadFields
110(
111 const word& fieldName,
112 const typename GeoField::Mesh& mesh,
113 const wordList& timeNames,
114 const word& registryName = "fieldsCache"
115);
116
118//- Read the selected GeometricFields of the templated type
119//- and store on the objectRegistry.
120// Returns a list of field pointers for later cleanup
121template<class GeoFieldType, class NameMatchPredicate>
122void readFields
123(
124 const typename GeoFieldType::Mesh& mesh,
125 const IOobjectList& objects,
127 const NameMatchPredicate& selectedFields,
129 DynamicList<regIOobject*>& storedObjects
130);
131
132//- Read the selected UniformDimensionedFields of the templated type
133//- and store on the objectRegistry.
134// Returns a list of field pointers for later cleanup
135template<class UniformFieldType, class NameMatchPredicate>
137(
138 const IOobjectList& objects,
140 const NameMatchPredicate& selectedFields,
142 DynamicList<regIOobject*>& storedObjects,
143 const bool syncPar = true
144);
145
146
147// Housekeeping
148
149//- Read the selected GeometricFields of the templated type
150//- and store on the objectRegistry.
151// \deprecated(2023-07) - prefer the DynamicList version
152// Returns a stack of field pointers for later cleanup
153template<class GeoFieldType, class NameMatchPredicate>
154FOAM_DEPRECATED_FOR(2023-07, "DynamicList version")
155void readFields
156(
157 const typename GeoFieldType::Mesh& mesh,
158 const IOobjectList& objects,
159 const NameMatchPredicate& selectedFields,
160 LIFOStack<regIOobject*>& storedObjects
161);
162
163
164//- Read the selected UniformDimensionedFields of the templated type
165//- and store on the objectRegistry.
166// \deprecated(2023-07) - prefer the DynamicList version
167// Returns a stack of field pointers for later cleanup
168template<class UniformFieldType, class NameMatchPredicate>
169FOAM_DEPRECATED_FOR(2023-07, "DynamicList version")
171(
172 const IOobjectList& objects,
173 const NameMatchPredicate& selectedFields,
174 LIFOStack<regIOobject*>& storedObjects,
175 const bool syncPar = true
176);
177
178
179// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180
181} // End namespace Foam
182
183// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184
185#ifdef NoRepository
186 #include "ReadFieldsTemplates.C"
187#endif
188
189// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190
191#endif
192
193// ************************************************************************* //
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition DynamicList.H:68
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,...
A LIFO stack based on a singly-linked list.
Definition LIFOStack.H:48
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition PtrList.H:67
Registry of regIOobjects.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition regIOobject.H:71
A class for handling words, derived from Foam::string.
Definition word.H:66
dynamicFvMesh & mesh
Namespace for OpenFOAM.
wordList ReadFields(const typename GeoMesh::Mesh &mesh, const IOobjectList &objects, PtrList< GeometricField< Type, PatchField, GeoMesh > > &fields, const bool syncPar=true, const bool readOldTime=false)
Read Geometric fields of templated type.
List< word > wordList
List of word.
Definition fileName.H:60
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const NameMatchPredicate &selectedFields, DynamicList< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type and store on the objectRegistry.
void readUniformFields(const IOobjectList &objects, const NameMatchPredicate &selectedFields, DynamicList< regIOobject * > &storedObjects, const bool syncPar=true)
Read the selected UniformDimensionedFields of the templated type and store on the objectRegistry.
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
Definition NamedEnum.H:66
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
#define FOAM_DEPRECATED_FOR(since, replacement)
Definition stdFoam.H:43