34 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
37 const typename GeoMesh::Mesh&
mesh,
38 const IOobjectList& objects,
39 PtrList<GeometricField<Type, PatchField, GeoMesh> >&
fields,
41 const bool readOldTime
44 typedef GeometricField<Type, PatchField, GeoMesh> GeoField;
47 IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName));
51 fields.setSize(masterNames.size());
57 Info<<
"Reading " << GeoField::typeName <<
' ' << masterNames[i]
60 const IOobject& io = *fieldObjects[masterNames[i]];
88 template<
class GeoField,
class Mesh>
92 const IOobjectList& objects,
98 IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName));
102 fields.setSize(masterNames.size());
108 Info<<
"Reading " << GeoField::typeName <<
' ' << masterNames[i]
111 const IOobject& io = *fieldObjects[masterNames[i]];
125 IOobject::AUTO_WRITE,
138 template<
class GeoField>
141 const IOobjectList& objects,
142 PtrList<GeoField>&
fields,
147 IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName));
151 fields.setSize(masterNames.size());
157 Info<<
"Reading " << GeoField::typeName <<
' ' << masterNames[i]
160 const IOobject& io = *fieldObjects[masterNames[i]];
174 IOobject::AUTO_WRITE,
184 template<
class GeoField>
187 const word& fieldName,
188 const typename GeoField::Mesh&
mesh,
190 objectRegistry& fieldsCache
195 HashSet<word> usedTimes(timeNames);
197 DynamicList<word> unusedTimes(fieldsCache.size());
199 forAllIter(objectRegistry, fieldsCache, timeIter)
201 const word& tm = timeIter.key();
202 if (!usedTimes.found(tm))
204 unusedTimes.append(tm);
212 objectRegistry& timeCache =
const_cast<objectRegistry&
>
214 fieldsCache.lookupObject<objectRegistry>(unusedTimes[i])
216 fieldsCache.checkOut(timeCache);
224 const word& tm = timeNames[i];
227 if (!fieldsCache.found(tm))
232 objectRegistry* timeCachePtr =
new objectRegistry
243 timeCachePtr->store();
247 const objectRegistry& timeCache =
248 fieldsCache.lookupObject<objectRegistry>
254 if (!timeCache.found(fieldName))
274 GeoField* fldPtr =
new GeoField
292 template<
class GeoField>
295 const word& fieldName,
296 const typename GeoField::Mesh&
mesh,
298 const word& registryName
306 const_cast<objectRegistry&
>
308 mesh.thisDb().subRegistry(registryName,
true)