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-2018 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 ReadFields_H
40#define ReadFields_H
41
42#include "PtrList.H"
43#include "wordList.H"
44#include "GeometricField.H"
45#include "HashSet.H"
46#include "LIFOStack.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53class regIOobject;
54class IOobjectList;
55class objectRegistry;
56
57//- Read Geometric fields of templated type.
58// \return sorted names of fields read.
59// \note All processors guaranteed to read fields in same order.
60template<class Type, template<class> class PatchField, class GeoMesh>
62(
63 const typename GeoMesh::Mesh& mesh,
64 const IOobjectList& objects,
66 const bool syncPar = true,
67 const bool readOldTime = false
68);
69
70
71//- Read fields of the templated type.
72// \return sorted names of fields read.
73// \note All processors guaranteed to read fields in same order.
74template<class GeoField, class Mesh>
76(
77 const Mesh& mesh,
78 const IOobjectList& objects,
80 const bool syncPar = true
81);
82
83//- Read non-mesh fields (uniformDimensionedField like 'g').
84// \return sorted names of fields read.
85// \note All processors guaranteed to read fields in same order.
86template<class GeoField>
88(
89 const IOobjectList& objects,
91 const bool syncPar = true
92);
93
94//- Read all GeometricFields of the templated type.
95// \param fieldsCache is an objectRegistry of all stored fields
96template<class GeoField>
97static void ReadFields
98(
99 const word& fieldName,
100 const typename GeoField::Mesh& mesh,
101 const wordList& timeNames,
102 objectRegistry& fieldsCache
103);
104
105//- Read all GeometricFields of the templated type.
106// \param fieldsCache is the objectRegistry name where fields are stored
107template<class GeoField>
108static void ReadFields
109(
110 const word& fieldName,
111 const typename GeoField::Mesh& mesh,
112 const wordList& timeNames,
113 const word& registryName = "fieldsCache"
114);
115
116//- Read the selected GeometricFields of the templated type.
117// The fields are transferred to the objectRegistry and a list of them is
118// returned as a stack for later cleanup
119template<class GeoFieldType>
120void readFields
121(
122 const typename GeoFieldType::Mesh& mesh,
123 const IOobjectList& objects,
124 const wordHashSet& selectedFields,
125 LIFOStack<regIOobject*>& storedObjects
126);
127
128
129//- Read the selected UniformDimensionedFields of the templated type.
130// The fields are transferred to the objectRegistry and a list of them is
131// returned as a stack for later cleanup
132template<class GeoFieldType>
134(
135 const IOobjectList& objects,
136 const wordHashSet& selectedFields,
137 LIFOStack<regIOobject*>& storedObjects,
138 const bool syncPar = true
139);
140
141
142// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143
144} // End namespace Foam
145
146// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147
148#ifdef NoRepository
149 #include "ReadFieldsTemplates.C"
150#endif
151
152// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153
154#endif
155
156// ************************************************************************* //
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
A LIFO stack based on a singly-linked list.
Definition: LIFOStack.H:54
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
Registry of regIOobjects.
A class for handling words, derived from Foam::string.
Definition: word.H:68
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.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
void readUniformFields(const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects, const bool syncPar=true)
Read the selected UniformDimensionedFields of the templated type.
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:97