35template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
38 const typename GeoMesh::Mesh&
mesh,
39 const IOobjectList& objects,
40 PtrList<GeometricField<Type, PatchField, GeoMesh>>&
fields,
42 const bool readOldTime
45 typedef GeometricField<Type, PatchField, GeoMesh> GeoField;
51 fields.resize(fieldNames.size());
55 for (
const word& fieldName : fieldNames)
61 Info<<
' ' << fieldName;
63 const IOobject&
io = *objects[fieldName];
92template<
class GeoField,
class Mesh>
96 const IOobjectList& objects,
105 fields.resize(fieldNames.size());
109 for (
const word& fieldName : fieldNames)
115 Info<<
' ' << fieldName;
117 const IOobject&
io = *objects[fieldName];
131 IOobject::AUTO_WRITE,
145template<
class GeoField>
148 const IOobjectList& objects,
149 PtrList<GeoField>&
fields,
157 fields.resize(fieldNames.size());
161 for (
const word& fieldName : fieldNames)
167 Info<<
' ' << fieldName;
169 const IOobject&
io = *objects[fieldName];
183 IOobject::AUTO_WRITE,
196template<
class GeoField>
199 const word& fieldName,
201 const wordList& timeNames,
202 objectRegistry& fieldsCache
208 unusedTimes.erase(timeNames);
212 for (
const word&
timeName : unusedTimes)
214 objectRegistry& timeCache =
215 fieldsCache.lookupObjectRef<objectRegistry>(
timeName);
217 fieldsCache.checkOut(timeCache);
223 for (
const word&
timeName : timeNames)
231 objectRegistry* timeCachePtr =
new objectRegistry
242 timeCachePtr->store();
246 const objectRegistry& timeCache =
247 fieldsCache.lookupObject<objectRegistry>(
timeName);
250 if (!timeCache.found(fieldName))
270 GeoField* fldPtr =
new GeoField
288template<
class GeoField>
291 const word& fieldName,
293 const wordList& timeNames,
294 const word& registryName
302 const_cast<objectRegistry&
>
304 mesh.thisDb().subRegistry(registryName,
true)
310template<
class GeoFieldType>
313 const typename GeoFieldType::Mesh&
mesh,
324 GeoFieldType::typeName,
331 for (
const word& fieldName : fieldNames)
337 Info<<
" " << GeoFieldType::typeName <<
':';
339 Info<<
' ' << fieldName;
341 GeoFieldType* fieldPtr =
new GeoFieldType
355 storedObjects.
push(fieldPtr);
364template<
class UniformFieldType>
378 UniformFieldType::typeName,
386 for (
const word& fieldName : fieldNames)
392 Info<<
" " << UniformFieldType::typeName <<
':';
394 Info<<
' ' << fieldName;
396 UniformFieldType* fieldPtr =
new UniformFieldType
409 storedObjects.
push(fieldPtr);
Field reading functions for post-processing utilities.
List of IOobjects with searching and retrieving facilities.
wordList sortedNames() const
The sorted names of the IOobjects.
wordList names() const
The unsorted names of the IOobjects.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A LIFO stack based on a singly-linked list.
void push(const T &elem)
Push an element onto the front of the stack.
faMesh Mesh
The mesh type.
A class for handling words, derived from Foam::string.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
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
A List of words.
messageStream Info
Information stream (stdout output on master, null elsewhere)
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
static const char *const typeName
The type name used in ensight case files.