31 template<
class Mesh,
template<
class>
class MeshObjectType,
class Type>
39 MeshObjectType<Mesh>(*this),
44 template<
class Mesh,
template<
class>
class MeshObjectType,
class Type>
56 mesh.thisDb().instance(),
60 MeshObjectType<Mesh>(*this),
65 template<
class Mesh,
template<
class>
class MeshObjectType,
class Type>
77 template<
class Mesh,
template<
class>
class MeshObjectType,
class Type>
86 return mesh.thisDb().objectRegistry::template lookupObjectRef<Type>
93 if (meshObjects::debug)
95 Pout<<
"DemandDrivenMeshObject::New(" << Mesh::typeName
96 <<
"&) : constructing " <<
name
97 <<
" of type " << Type::typeName
98 <<
" for region " << mesh.name() <<
endl;
101 Type* objectPtr =
new Type(
name, mesh);
108 template<
class Mesh,
template<
class>
class MeshObjectType,
class Type>
116 return mesh.thisDb().objectRegistry::template lookupObjectRef<Type>
123 if (meshObjects::debug)
125 Pout<<
"DemandDrivenMeshObject::New(" << Mesh::typeName
126 <<
"&) : constructing " << Type::typeName
130 Type* objectPtr =
new Type(mesh);
137 template<
class Mesh,
template<
class>
class MeshObjectType,
class Type>
138 template<
class... Args>
148 return mesh.thisDb().objectRegistry::template lookupObjectRef<Type>
155 if (meshObjects::debug)
157 Pout<<
"DemandDrivenMeshObject::New(" << Mesh::typeName
158 <<
"&, const Data1&) : constructing " <<
name
159 <<
" of type " << Type::typeName
160 <<
" for region " << mesh.name() <<
endl;
163 Type* objectPtr =
new Type(
name, mesh,
args...);
170 template<
class Mesh,
template<
class>
class MeshObjectType,
class Type>
171 template<
class... Args>
180 return mesh.thisDb().objectRegistry::template lookupObjectRef<Type>
187 if (meshObjects::debug)
189 Pout<<
"DemandDrivenMeshObject::New(" << Mesh::typeName
190 <<
"&, const Data1&) : constructing " << Type::typeName
191 <<
" for region " << mesh.
name() <<
endl;
194 Type* objectPtr =
new Type(mesh,
args...);
203 template<
class Mesh,
template<
class>
class MeshObjectType,
class Type>
213 template<
class Mesh,
template<
class>
class MeshObjectType,
class Type>
217 return Type::typeName;
221 template<
class Mesh,
template<
class>
class MeshObjectType,
class Type>
228 return mesh.thisDb().objectRegistry::template foundObject<Type>(
name);
232 template<
class Mesh,
template<
class>
class MeshObjectType,
class Type>
238 return found(Type::typeName, mesh);
Templated abstract base-class for demand-driven mesh objects used to automate their allocation to the...
DemandDrivenMeshObject(const IOobject &io, const Mesh &mesh)
Construct from mesh and IOobject.
virtual ~DemandDrivenMeshObject()
static bool found(const word &name, const Mesh &mesh)
Return true if the DemandDrivenMeshObject with the given name.
static Type & New(const word &name, const Mesh &mesh)
Construct and return the named DemandDrivenMeshObject.
virtual const word & type() const
Runtime type information.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
virtual const fileName & name() const
Return the name of the stream.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
void release()
Release ownership of this object from its registry.
void store()
Transfer ownership of this object to its registry.
A class for handling words, derived from string.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
prefixOSstream Pout(cout, "Pout")
Foam::argList args(argc, argv)