MeshObject: Improved diagnostics

This commit is contained in:
Henry
2015-01-08 10:38:25 +00:00
parent e437b9eb92
commit 9dc6b54c3d

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -62,8 +62,9 @@ const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
{ {
if (meshObject::debug) if (meshObject::debug)
{ {
Pout<< "MeshObject::New(const Mesh&) : constructing new " Pout<< "MeshObject::New(const " << Mesh::typeName
<< Type::typeName << endl; << "&) : constructing " << Type::typeName
<< " for region " << mesh.name() << endl;
} }
Type* objectPtr = new Type(mesh); Type* objectPtr = new Type(mesh);
@ -100,8 +101,9 @@ const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
{ {
if (meshObject::debug) if (meshObject::debug)
{ {
Pout<< "MeshObject::New(const Mesh&) : constructing new " Pout<< "MeshObject::New(const " << Mesh::typeName
<< Type::typeName << endl; << "&, const Data1&) : constructing " << Type::typeName
<< " for region " << mesh.name() << endl;
} }
Type* objectPtr = new Type(mesh, d); Type* objectPtr = new Type(mesh, d);
@ -139,8 +141,9 @@ const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
{ {
if (meshObject::debug) if (meshObject::debug)
{ {
Pout<< "MeshObject(const Mesh&) : constructing new " Pout<< "MeshObject::New(const " << Mesh::typeName
<< Type::typeName << endl; << "&, const Data[1-2]&) : constructing " << Type::typeName
<< " for region " << mesh.name() << endl;
} }
Type* objectPtr = new Type(mesh, d1, d2); Type* objectPtr = new Type(mesh, d1, d2);
@ -181,8 +184,9 @@ const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
{ {
if (meshObject::debug) if (meshObject::debug)
{ {
Pout<< "MeshObject(const Mesh&) : constructing new " Pout<< "MeshObject::New(const " << Mesh::typeName
<< Type::typeName << endl; << "&, const Data[1-3]&) : constructing " << Type::typeName
<< " for region " << mesh.name() << endl;
} }
Type* objectPtr = new Type(mesh, d1, d2, d3); Type* objectPtr = new Type(mesh, d1, d2, d3);
@ -221,8 +225,9 @@ const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
{ {
if (meshObject::debug) if (meshObject::debug)
{ {
Pout<< "MeshObject(const Mesh&) : constructing new " Pout<< "MeshObject::New(const " << Mesh::typeName
<< Type::typeName << endl; << "&, const Data[1-4]&) : constructing " << Type::typeName
<< " for region " << mesh.name() << endl;
} }
Type* objectPtr = new Type(mesh, d1, d2, d3, d4); Type* objectPtr = new Type(mesh, d1, d2, d3, d4);
@ -285,6 +290,13 @@ void Foam::meshObject::movePoints(objectRegistry& obr)
obr.lookupClass<GeometricMeshObject<Mesh> >() obr.lookupClass<GeometricMeshObject<Mesh> >()
); );
if (meshObject::debug)
{
Pout<< "meshObject::movePoints(objectRegistry&) :"
<< " moving " << Mesh::typeName
<< " meshObjects for region " << obr.name() << endl;
}
forAllIter forAllIter
( (
typename HashTable<GeometricMeshObject<Mesh>*>, typename HashTable<GeometricMeshObject<Mesh>*>,
@ -296,9 +308,7 @@ void Foam::meshObject::movePoints(objectRegistry& obr)
{ {
if (meshObject::debug) if (meshObject::debug)
{ {
Pout<< "meshObject::movePoints(objectRegistry&) :" Pout<< " Moving " << iter()->name() << endl;
<< " movePoints on "
<< iter()->name() << endl;
} }
dynamic_cast<MoveableMeshObject<Mesh>*>(iter())->movePoints(); dynamic_cast<MoveableMeshObject<Mesh>*>(iter())->movePoints();
} }
@ -306,9 +316,7 @@ void Foam::meshObject::movePoints(objectRegistry& obr)
{ {
if (meshObject::debug) if (meshObject::debug)
{ {
Pout<< "meshObject::movePoints(objectRegistry&) :" Pout<< " Destroying " << iter()->name() << endl;
<< " destroying "
<< iter()->name() << endl;
} }
obr.checkOut(*iter()); obr.checkOut(*iter());
} }
@ -324,6 +332,13 @@ void Foam::meshObject::updateMesh(objectRegistry& obr, const mapPolyMesh& mpm)
obr.lookupClass<GeometricMeshObject<Mesh> >() obr.lookupClass<GeometricMeshObject<Mesh> >()
); );
if (meshObject::debug)
{
Pout<< "meshObject::updateMesh(objectRegistry&, "
"const mapPolyMesh& mpm) : updating " << Mesh::typeName
<< " meshObjects for region " << obr.name() << endl;
}
forAllIter forAllIter
( (
typename HashTable<GeometricMeshObject<Mesh>*>, typename HashTable<GeometricMeshObject<Mesh>*>,
@ -335,9 +350,7 @@ void Foam::meshObject::updateMesh(objectRegistry& obr, const mapPolyMesh& mpm)
{ {
if (meshObject::debug) if (meshObject::debug)
{ {
Pout<< "meshObject::updateMesh(objectRegistry&) :" Pout<< " Updating " << iter()->name() << endl;
<< " updateMesh on "
<< iter()->name() << endl;
} }
dynamic_cast<UpdateableMeshObject<Mesh>*>(iter())->updateMesh(mpm); dynamic_cast<UpdateableMeshObject<Mesh>*>(iter())->updateMesh(mpm);
} }
@ -345,8 +358,7 @@ void Foam::meshObject::updateMesh(objectRegistry& obr, const mapPolyMesh& mpm)
{ {
if (meshObject::debug) if (meshObject::debug)
{ {
Pout<< "meshObject::updateMesh(objectRegistry&) : destroying " Pout<< " Destroying " << iter()->name() << endl;
<< iter()->name() << endl;
} }
obr.checkOut(*iter()); obr.checkOut(*iter());
} }
@ -362,12 +374,18 @@ void Foam::meshObject::clear(objectRegistry& obr)
obr.lookupClass<MeshObjectType<Mesh> >() obr.lookupClass<MeshObjectType<Mesh> >()
); );
if (meshObject::debug)
{
Pout<< "meshObject::clear(objectRegistry&) :"
<< " clearing " << Mesh::typeName
<< " meshObjects for region " << obr.name() << endl;
}
forAllIter(typename HashTable<MeshObjectType<Mesh>*>, meshObjects, iter) forAllIter(typename HashTable<MeshObjectType<Mesh>*>, meshObjects, iter)
{ {
if (meshObject::debug) if (meshObject::debug)
{ {
Pout<< "meshObject::clear(objectRegistry&) : destroying " Pout<< " Destroying " << iter()->name() << endl;
<< iter()->name() << endl;
} }
obr.checkOut(*iter()); obr.checkOut(*iter());
} }
@ -387,14 +405,20 @@ void Foam::meshObject::clearUpto(objectRegistry& obr)
obr.lookupClass<FromType<Mesh> >() obr.lookupClass<FromType<Mesh> >()
); );
if (meshObject::debug)
{
Pout<< "meshObject::clearUpto(objectRegistry&) :"
<< " clearing " << Mesh::typeName
<< " meshObjects for region " << obr.name() << endl;
}
forAllIter(typename HashTable<FromType<Mesh>*>, meshObjects, iter) forAllIter(typename HashTable<FromType<Mesh>*>, meshObjects, iter)
{ {
if (!isA<ToType<Mesh> >(*iter())) if (!isA<ToType<Mesh> >(*iter()))
{ {
if (meshObject::debug) if (meshObject::debug)
{ {
Pout<< "meshObject::clearUpto(objectRegistry&) : destroying " Pout<< " Destroying " << iter()->name() << endl;
<< iter()->name() << endl;
} }
obr.checkOut(*iter()); obr.checkOut(*iter());
} }