31 template<
class OtherFieldSourceType>
32 const OtherFieldSourceType&
38 if (!isA<OtherFieldSourceType>(*
this))
41 <<
"The '" <<
type() <<
"' source of field '"
43 <<
"' for the '" << model.type() <<
"' Lagrangian model '"
44 << model.
name() <<
"' requires the corresponding source of field '"
47 <<
"' (or a derivation thereof), rather than '" <<
type()
51 return refCast<const OtherFieldSourceType>(*
this);
55 template<
class OtherType>
64 db().template lookupObject<LagrangianDynamicField<OtherType>>(
name);
70 template<
class OtherType,
class OtherFieldSourceType>
78 fieldSource<OtherType>(
name, model);
80 if (!isA<OtherFieldSourceType>(lfs))
83 <<
"The '" <<
type() <<
"' source of field '"
84 << (db().dbDir()/internalIo_.name()).c_str()
85 <<
"' for the '" << model.type() <<
"' Lagrangian model '"
86 << model.
name() <<
"' requires the corresponding source of field '"
87 << (db().dbDir()/
name).c_str()
89 <<
"' (or a derivation thereof), rather than '" << lfs.type()
93 return refCast<const OtherFieldSourceType>(lfs);
97 template<
class OtherModelType>
103 if (!isA<OtherModelType>(model))
106 <<
"The '" <<
type() <<
"' source of field '"
107 << (db().dbDir()/internalIo_.name()).c_str()
108 <<
"' for the Lagrangian model '" << model.
name()
110 <<
"' (or a derivation thereof), rather than '" << model.type()
114 return refCast<const OtherModelType>(model);
118 template<
class OtherType>
127 return fieldSource<OtherType>(
name, source).value(source, subMesh);
131 template<
class OtherType>
140 return fieldSource<OtherType>(
name, injection).value(injection, subMesh);
Generic GeometricField class.
const Sources & sources() const
Return const-reference to the sources.
const word & name() const
Return name.
const word & internalName() const
Return internal field name.
const regIOobject & internalIo_
Reference to the internal IO object.
const OtherFieldSourceType & fieldSourceCast(const LagrangianModel &) const
Cast a to the specified type. Handle errors.
const objectRegistry & db() const
Return local objectRegistry.
const OtherModelType & modelCast(const LagrangianModel &) const
Cast a model to the specified type. Handle errors.
tmp< LagrangianSubField< OtherType > > value(const word &name, const LagrangianSource &, const LagrangianSubMesh &) const
Lookup and return the value of another field source.
const LagrangianFieldSource< OtherType > & fieldSource(const word &name, const LagrangianModel &) const
Lookup and return another field source.
Base class for Lagrangian source conditions.
Base class for Lagrangian injections. Minimal wrapper over LagrangianSource. Implements some utility ...
Base class for Lagrangian models.
const word & name() const
The source name.
Base class for Lagrangian sources. Minimal wrapper over LagrangianModel that provides an interface to...
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
const fileName & dbDir() const
Local directory path of this objectRegistry relative to the time.
A class for managing temporary objects.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.