ReadFields.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Global
25  Foam::ReadFields
26 
27 Description
28  Field reading functions for post-processing utilities
29 
30 SourceFiles
31  ReadFields.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef ReadFields_H
36 #define ReadFields_H
37 
38 #include "PtrList.H"
39 #include "wordList.H"
40 #include "HashSet.H"
41 #include "LIFOStack.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 class regIOobject;
49 class IOobjectList;
50 class objectRegistry;
51 
52 //- Read all fields of the specified type.
53 // Returns names of fields read.
54 // Guarantees all processors read fields in same order.
55 template<class GeoField, class Mesh>
57 (
58  const Mesh& mesh,
59  const IOobjectList& objects,
60  PtrList<GeoField>& fields,
61  const bool syncPar = true
62 );
63 
64 //- Read all GeometricFields of the specified type.
65 // The fieldsCache is an objectRegistry of all stored fields
66 template<class GeoField>
67 static void ReadFields
68 (
69  const word& fieldName,
70  const typename GeoField::Mesh& mesh,
71  const wordList& timeNames,
72  objectRegistry& fieldsCache
73 );
74 
75 //- Read all GeometricFields of the specified type.
76 // The fieldsCache is an objectRegistry of all stored fields
77 template<class GeoField>
78 static void ReadFields
79 (
80  const word& fieldName,
81  const typename GeoField::Mesh& mesh,
82  const wordList& timeNames,
83  const word& registryName = "fieldsCache"
84 );
85 
86 //- Read the selected GeometricFields of the specified type.
87 // The fields are transferred to the objectRegistry and a list of them is
88 // returned as a stack for later clean-up
89 template<class GeoFieldType>
90 void readFields
91 (
92  const typename GeoFieldType::Mesh& mesh,
93  const IOobjectList& objects,
94  const HashSet<word>& selectedFields,
95  LIFOStack<regIOobject*>& storedObjects
96 );
97 
98 
99 //- Read the selected UniformDimensionedFields of the specified type.
100 // The fields are transferred to the objectRegistry and a list of them is
101 // returned as a stack for later clean-up
102 template<class GeoFieldType>
104 (
105  const IOobjectList& objects,
106  const HashSet<word>& selectedFields,
107  LIFOStack<regIOobject*>& storedObjects,
108  const bool syncPar = true
109 );
110 
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 } // End namespace Foam
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 #ifdef NoRepository
119  #include "ReadFields.C"
120 #endif
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 #endif
125 
126 // ************************************************************************* //
wordList ReadFields(const Mesh &mesh, const IOobjectList &objects, PtrList< GeoField > &fields, const bool syncPar=true)
Read all fields of the specified type.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const HashSet< word > &selectedFields, LIFOStack< regIOobject *> &storedObjects)
Read the selected GeometricFields of the specified type.
Definition: ReadFields.C:244
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
Definition: createFields.H:97
dynamicFvMesh & mesh
List< word > wordList
A List of words.
Definition: fileName.H:54
void readUniformFields(const IOobjectList &objects, const HashSet< word > &selectedFields, LIFOStack< regIOobject *> &storedObjects, const bool syncPar=true)
Read the selected UniformDimensionedFields of the specified type.
Definition: ReadFields.C:298
Namespace for OpenFOAM.