34#ifndef readFieldsHander_H
35#define readFieldsHander_H
51class readFieldsHandler
65 template<
class FieldType>
66 bool loadAndStore(
const IOobject&
io)
72 <<
" (" << FieldType::typeName <<
')' <<
endl;
74 mesh_.objectRegistry::store(
new FieldType(
io, mesh_));
83 bool loadField(
const IOobject&
io)
85 typedef GeometricField<Type, fvPatchField, volMesh> VolFieldType;
86 typedef typename VolFieldType::Internal IntVolFieldType;
87 typedef GeometricField<Type, fvsPatchField, surfaceMesh>
92 loadAndStore<VolFieldType>(
io)
93 || loadAndStore<IntVolFieldType>(
io)
94 || loadAndStore<SurfaceFieldType>(
io)
100 label loadFields(
const UList<word>& fieldSet_)
104 for (
const word& fieldName : fieldSet_)
107 const auto* ptr = mesh_.cfindObject<regIOobject>(fieldName);
114 << ptr->name() <<
" (" << ptr->type()
115 <<
") already in database" <<
endl;
123 mesh_.time().timeName(),
135 loadField<scalar>(
io)
136 || loadField<vector>(
io)
137 || loadField<sphericalTensor>(
io)
138 || loadField<symmTensor>(
io)
139 || loadField<tensor>(
io)
150 <<
"readFields : failed to load " << fieldName
161 static const bool debug =
false;
178 loadFields(fieldNames);
bool isHeaderClass() const
Check if headerClassName() equals Type::typeName.
const word & name() const noexcept
Return the object name.
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
Read header (uses typeFilePath to find file) and check its info.
bool hasHeaderClass() const noexcept
True if headerClassName() is non-empty (after reading)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Mesh data needed to do the Finite Volume discretisation.
A simple field-loader, as per the readFields function object.
bool execute(const UList< word > &fieldNames)
readFieldsHandler(fvMesh &mesh, bool verbose=true)
Construct.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
#define DebugInfo
Report an information message using Foam::Info.
dimensionedScalar log(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.