35 template<
class Mesh,
template<
class>
class MeshObjectType,
class Type>
38 MeshObjectType<Mesh>(Type::typeName,
mesh.thisDb()),
45 template<
class Mesh,
template<
class>
class MeshObjectType,
class Type>
46 template<
class... Args>
54 mesh.thisDb().objectRegistry::template cfindObject<Type>
66 Pout<<
"MeshObject::New(const " << Mesh::typeName
67 <<
"&, ...) : constructing " << Type::typeName
68 <<
" for region " <<
mesh.name() <<
endl;
71 Type* objectPtr =
new Type(
mesh, std::forward<Args>(
args)...);
73 regIOobject::store(
static_cast<MeshObjectType<Mesh>*
>(objectPtr));
81 template<
class Mesh,
template<
class>
class MeshObjectType,
class Type>
85 mesh.thisDb().objectRegistry::template getObjectPtr<Type>
94 Pout<<
"MeshObject::Delete(const Mesh&) : deleting " 95 << Type::typeName <<
endl;
98 return mesh.thisDb().checkOut(ptr);
108 HashTable<GeometricMeshObject<Mesh>*> meshObjects
110 obr.lookupClass<GeometricMeshObject<Mesh>>()
115 Pout<<
"meshObject::movePoints(objectRegistry&) :" 116 <<
" moving " << Mesh::typeName
117 <<
" meshObjects for region " << obr.
name() <<
endl;
123 auto* objectPtr =
dynamic_cast<MoveableMeshObject<Mesh>*
>(*iter);
131 objectPtr->movePoints();
148 HashTable<GeometricMeshObject<Mesh>*> meshObjects
150 obr.lookupClass<GeometricMeshObject<Mesh>>()
155 Pout<<
"meshObject::updateMesh(objectRegistry&, " 156 "const mapPolyMesh& mpm) : updating " << Mesh::typeName
157 <<
" meshObjects for region " << obr.
name() <<
endl;
163 auto* objectPtr =
dynamic_cast<UpdateableMeshObject<Mesh>*
>(*iter);
171 objectPtr->updateMesh(mpm);
185 template<
class Mesh,
template<
class>
class MeshObjectType>
188 HashTable<MeshObjectType<Mesh>*> meshObjects
190 obr.lookupClass<MeshObjectType<Mesh>>()
195 Pout<<
"meshObject::clear(objectRegistry&) :" 196 <<
" clearing " << Mesh::typeName
197 <<
" meshObjects for region " << obr.
name() <<
endl;
214 template<
class>
class FromType,
215 template<
class>
class ToType
226 Pout<<
"meshObject::clearUpto(objectRegistry&) :" 227 <<
" clearing " << Mesh::typeName
228 <<
" meshObjects for region " << obr.
name() <<
endl;
234 auto* objectPtr =
dynamic_cast<ToType<Mesh>*
>(*iter);
virtual const fileName & name() const
Get the name of the output serial stream. (eg, the name of the Fstream file name) ...
static void updateMesh(objectRegistry &obr, const mapPolyMesh &mpm)
static void clearUpto(objectRegistry &obr)
Clear all meshObject derived from FromType up to (but not including) ToType.
const word & name() const noexcept
Return the object name.
static const Type & New(const Mesh &mesh, Args &&... args)
Get existing or create a new MeshObject.
static bool Delete(const Mesh &mesh)
Static destructor.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool checkOut(regIOobject *io) const
Remove a regIOobject from registry and free memory if the object is ownedByRegistry. A nullptr is ignored.
static void clear(objectRegistry &obr)
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
#define forAllIters(container, iter)
Iterate across all elements in the container object.
A HashTable similar to std::unordered_map.
int debug
Static debugging option.
static void movePoints(objectRegistry &obr)
Registry of regIOobjects.
Foam::argList args(argc, argv)
MeshObject(const Mesh &mesh)
Construct on Mesh type.
HashTable< const Type * > lookupClass(const bool strict=false) const
Return all objects with a class satisfying isA<Type>
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.