Go to the documentation of this file.
35 template<
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;
59 Info<<
"Reading " << GeoField::typeName <<
':';
61 Info<<
' ' << fieldName;
63 const IOobject& io = *objects[fieldName];
92 template<
class GeoField,
class Mesh>
96 const IOobjectList& objects,
113 Info<<
"Reading " << GeoField::typeName <<
':';
115 Info<<
' ' << fieldName;
117 const IOobject& io = *objects[fieldName];
131 IOobject::AUTO_WRITE,
145 template<
class GeoField>
148 const IOobjectList& objects,
149 PtrList<GeoField>&
fields,
165 Info<<
"Reading " << GeoField::typeName <<
':';
167 Info<<
' ' << fieldName;
169 const IOobject& io = *objects[fieldName];
183 IOobject::AUTO_WRITE,
196 template<
class GeoField>
199 const word& fieldName,
200 const typename GeoField::Mesh&
mesh,
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
288 template<
class GeoField>
291 const word& fieldName,
292 const typename GeoField::Mesh&
mesh,
294 const word& registryName
302 const_cast<objectRegistry&
>
304 mesh.thisDb().subRegistry(registryName,
true)
310 template<
class GeoFieldType>
313 const typename GeoFieldType::Mesh&
mesh,
324 GeoFieldType::typeName,
333 const IOobject& io = *objects[fieldName];
337 Info<<
" " << GeoFieldType::typeName <<
':';
339 Info<<
' ' << fieldName;
341 GeoFieldType* fieldPtr =
new GeoFieldType
355 storedObjects.
push(fieldPtr);
364 template<
class UniformFieldType>
378 UniformFieldType::typeName,
388 const IOobject& io = *objects[fieldName];
392 Info<<
" " << UniformFieldType::typeName <<
':';
394 Info<<
' ' << fieldName;
396 UniformFieldType* fieldPtr =
new UniformFieldType
409 storedObjects.
push(fieldPtr);
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A class for handling words, derived from Foam::string.
const fileName & instance() const noexcept
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.
wordList sortedNames() const
The sorted names of the IOobjects.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void readUniformFields(const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects, const bool syncPar=true)
Read the selected UniformDimensionedFields of the templated type.
wordList names() const
The names of the IOobjects.
List< word > wordList
A List of words.
messageStream Info
Information stream (stdout output on master, null elsewhere)
const fileName & local() const noexcept
const wordRes fieldNames(propsDict.getOrDefault< wordRes >("fields", wordRes()))
List of IOobjects with searching and retrieving facilities.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
Field reading functions for post-processing utilities.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
A LIFO stack based on a singly-linked list.
void push(const T &element)
Push an element onto the front of the stack.
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
const objectRegistry & db() const noexcept
Return the local objectRegistry.