27 #include "readFields.H" 31 template<
class Type,
template<
class>
class PatchField,
class GeoMesh>
34 const typename GeoMesh::Mesh& mesh,
35 const IOobjectList& objects,
36 PtrList<GeometricField<Type, PatchField, GeoMesh>>& fields,
37 const bool readOldTime
40 typedef GeometricField<Type, PatchField, GeoMesh> GeoField;
43 IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName));
46 IOobjectList::iterator celDistIter = fieldObjects.find(
"cellDist");
47 if (celDistIter != fieldObjects.end())
49 fieldObjects.erase(celDistIter);
54 const wordList masterNames(fieldObjects.sortedNames());
57 fields.
setSize(masterNames.size());
61 const IOobject& io = *fieldObjects[masterNames[i]];
63 fields.set(i,
new GeoField(io, mesh, readOldTime));
68 template<
class Mesh,
class GeoField>
72 const IOobjectList& objects,
73 PtrList<GeoField>& fields
77 IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName));
80 fields.setSize(fieldObjects.size());
84 const wordList masterNames(fieldObjects.sortedNames());
87 fields.
setSize(masterNames.size());
91 const IOobject& io = *fieldObjects[masterNames[i]];
93 fields.set(i,
new GeoField(io, mesh));
#define forAll(list, i)
Loop across all elements in list.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const HashSet< word > &selectedFields, LIFOStack< regIOobject *> &storedObjects)
Read the selected GeometricFields of the specified type.
List< word > wordList
A List of words.
void setSize(const label)
Reset size of List.