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;
48 const wordList fieldNames(objects.names(GeoField::typeName, syncPar));
51 fields.resize(fieldNames.size());
55 for (
const word& fieldName : fieldNames)
59 Info<<
"Reading " << GeoField::typeName <<
':';
61 Info<<
' ' << fieldName;
63 const IOobject&
io = *objects[fieldName];
92 template<
class GeoField,
class Mesh>
96 const IOobjectList& objects,
102 const wordList fieldNames(objects.names(GeoField::typeName, syncPar));
105 fields.resize(fieldNames.size());
109 for (
const word& fieldName : fieldNames)
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,
154 const wordList fieldNames(objects.names(GeoField::typeName, syncPar));
157 fields.resize(fieldNames.size());
161 for (
const word& fieldName : fieldNames)
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
243 timeCachePtr->store();
247 const objectRegistry& timeCache =
248 fieldsCache.lookupObject<objectRegistry>(
timeName);
251 if (!timeCache.found(fieldName))
265 IOobject::NO_REGISTER
271 GeoField* fldPtr =
new GeoField
290 template<
class GeoField>
293 const word& fieldName,
294 const typename GeoField::Mesh&
mesh,
296 const word& registryName
304 const_cast<objectRegistry&
> 306 mesh.thisDb().subRegistry(registryName,
true)
312 template<
class GeoFieldType>
315 const typename GeoFieldType::Mesh&
mesh,
316 const IOobjectList& objects,
318 LIFOStack<regIOobject*>& storedObjects
326 GeoFieldType::typeName,
333 for (
const word& fieldName : fieldNames)
335 const IOobject&
io = *objects[fieldName];
339 Info<<
" " << GeoFieldType::typeName <<
':';
341 Info<<
' ' << fieldName;
343 GeoFieldType* fieldPtr =
new GeoFieldType
358 storedObjects.push(fieldPtr);
367 template<
class UniformFieldType>
370 const IOobjectList& objects,
372 LIFOStack<regIOobject*>& storedObjects,
381 UniformFieldType::typeName,
389 for (
const word& fieldName : fieldNames)
391 const IOobject&
io = *objects[fieldName];
395 Info<<
" " << UniformFieldType::typeName <<
':';
397 Info<<
' ' << fieldName;
399 UniformFieldType* fieldPtr =
new UniformFieldType
413 storedObjects.push(fieldPtr);
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Field reading functions for post-processing utilities.
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
bool erase(const iterator &iter)
Erase an entry specified by given iterator.
List< word > wordList
List of word.
messageStream Info
Information stream (stdout output on master, null elsewhere)
void readUniformFields(const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject *> &storedObjects, const bool syncPar=true)
Read the selected UniformDimensionedFields of the 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.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)