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,
314 const IOobjectList& objects,
316 LIFOStack<regIOobject*>& storedObjects
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>
367 const IOobjectList& objects,
369 LIFOStack<regIOobject*>& storedObjects,
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);