diff --git a/src/OpenFOAM/meshes/pointMesh/pointMesh.C b/src/OpenFOAM/meshes/pointMesh/pointMesh.C index 6022f03c39bd51df8ef895c244b4d3e182bd0f61..f378a5d78026fa466a2b8bd338202f82e39d8b35 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointMesh.C +++ b/src/OpenFOAM/meshes/pointMesh/pointMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,10 +30,26 @@ License #include "MapGeometricFields.H" #include "MapPointField.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + +defineTypeNameAndDebug(pointMesh, 0); + +} + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void Foam::pointMesh::mapFields(const mapPolyMesh& mpm) { + if (debug) + { + Pout<< "void pointMesh::mapFields(const mapPolyMesh&): " + << "Mapping all registered pointFields." + << endl; + } // Create a mapper const pointMeshMapper m(*this, mpm); @@ -60,6 +76,13 @@ Foam::pointMesh::pointMesh(const polyMesh& pMesh) GeoMesh<polyMesh>(pMesh), boundary_(*this, pMesh.boundaryMesh()) { + if (debug) + { + Pout<< "pointMesh::pointMesh(const polyMesh&): " + << "Constructing from polyMesh " << pMesh.name() + << endl; + } + // Calculate the geometry for the patches (transformation tensors etc.) boundary_.calcGeometry(); } @@ -67,12 +90,24 @@ Foam::pointMesh::pointMesh(const polyMesh& pMesh) void Foam::pointMesh::movePoints(const pointField& newPoints) { + if (debug) + { + Pout<< "pointMesh::movePoints(const pointField&): " + << "Moving points." << endl; + } + boundary_.movePoints(newPoints); } void Foam::pointMesh::updateMesh(const mapPolyMesh& mpm) { + if (debug) + { + Pout<< "pointMesh::updateMesh(const mapPolyMesh&): " + << "Updating for topology changes." << endl; + Pout<< endl; + } boundary_.updateMesh(); // Map all registered point fields diff --git a/src/OpenFOAM/meshes/pointMesh/pointMesh.H b/src/OpenFOAM/meshes/pointMesh/pointMesh.H index e40e211aefaab8ece852601319d3babd0c48ddf8..25e8af95304c4719b1747bfa4429b26a53106ac0 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointMesh.H +++ b/src/OpenFOAM/meshes/pointMesh/pointMesh.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -71,6 +71,10 @@ class pointMesh public: + // Declare name of the class and its debug switch + ClassName("pointMesh"); + + typedef pointMesh Mesh; typedef pointBoundaryMesh BoundaryMesh; diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C b/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C index d765e9f60b7742b2b0846f3b08bec092a36e6d32..f2c7bca7de485f58a915f865d1d4f5d46f309949 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshClear.C @@ -73,8 +73,22 @@ void Foam::polyMesh::clearGeom() tetBasePtIsPtr_.clear(); // Remove the cell tree cellTreePtr_.clear(); +} - pointMesh::Delete(*this); + +void Foam::polyMesh::clearAdditionalGeom() +{ + if (debug) + { + Info<< "void polyMesh::clearAdditionalGeom() : " + << "clearing additional geometric data" + << endl; + } + + // Remove the stored tet base points + tetBasePtIsPtr_.clear(); + // Remove the cell tree + cellTreePtr_.clear(); } @@ -106,8 +120,6 @@ void Foam::polyMesh::clearAddressing() tetBasePtIsPtr_.clear(); // Remove the cell tree cellTreePtr_.clear(); - - pointMesh::Delete(*this); } @@ -120,6 +132,8 @@ void Foam::polyMesh::clearPrimitives() owner_.setSize(0); neighbour_.setSize(0); + pointMesh::Delete(*this); + clearedPrimitives_ = true; } @@ -128,11 +142,19 @@ void Foam::polyMesh::clearOut() { clearGeom(); clearAddressing(); + pointMesh::Delete(*this); } void Foam::polyMesh::clearCellTree() { + if (debug) + { + Info<< "void polyMesh::clearCellTree() : " + << "clearing cell tree" + << endl; + } + cellTreePtr_.clear(); } diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C b/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C index 96dc726b44a1c2a2bb53667a99b9036dcefa712f..0fdce95e37a7945241119dc66d4590f03545b3f1 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C @@ -38,6 +38,13 @@ Description void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm) { + if (debug) + { + Info<< "void polyMesh::updateMesh(const mapPolyMesh&) : " + << "updating addressing and (optional) pointMesh/pointFields" + << endl; + } + // Update boundaryMesh (note that patches themselves already ok) boundary_.updateMesh();