BUG: polyMesh: update registered pointMesh

This commit is contained in:
mattijs
2012-08-31 12:55:17 +01:00
parent 95c8de9224
commit 844f9433db
4 changed files with 73 additions and 5 deletions

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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,10 +30,26 @@ License
#include "MapGeometricFields.H" #include "MapGeometricFields.H"
#include "MapPointField.H" #include "MapPointField.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(pointMesh, 0);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::pointMesh::mapFields(const mapPolyMesh& mpm) void Foam::pointMesh::mapFields(const mapPolyMesh& mpm)
{ {
if (debug)
{
Pout<< "void pointMesh::mapFields(const mapPolyMesh&): "
<< "Mapping all registered pointFields."
<< endl;
}
// Create a mapper // Create a mapper
const pointMeshMapper m(*this, mpm); const pointMeshMapper m(*this, mpm);
@ -60,6 +76,13 @@ Foam::pointMesh::pointMesh(const polyMesh& pMesh)
GeoMesh<polyMesh>(pMesh), GeoMesh<polyMesh>(pMesh),
boundary_(*this, pMesh.boundaryMesh()) 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.) // Calculate the geometry for the patches (transformation tensors etc.)
boundary_.calcGeometry(); boundary_.calcGeometry();
} }
@ -67,12 +90,24 @@ Foam::pointMesh::pointMesh(const polyMesh& pMesh)
void Foam::pointMesh::movePoints(const pointField& newPoints) void Foam::pointMesh::movePoints(const pointField& newPoints)
{ {
if (debug)
{
Pout<< "pointMesh::movePoints(const pointField&): "
<< "Moving points." << endl;
}
boundary_.movePoints(newPoints); boundary_.movePoints(newPoints);
} }
void Foam::pointMesh::updateMesh(const mapPolyMesh& mpm) void Foam::pointMesh::updateMesh(const mapPolyMesh& mpm)
{ {
if (debug)
{
Pout<< "pointMesh::updateMesh(const mapPolyMesh&): "
<< "Updating for topology changes." << endl;
Pout<< endl;
}
boundary_.updateMesh(); boundary_.updateMesh();
// Map all registered point fields // Map all registered point fields

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 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -71,6 +71,10 @@ class pointMesh
public: public:
// Declare name of the class and its debug switch
ClassName("pointMesh");
typedef pointMesh Mesh; typedef pointMesh Mesh;
typedef pointBoundaryMesh BoundaryMesh; typedef pointBoundaryMesh BoundaryMesh;

View File

@ -73,8 +73,22 @@ void Foam::polyMesh::clearGeom()
tetBasePtIsPtr_.clear(); tetBasePtIsPtr_.clear();
// Remove the cell tree // Remove the cell tree
cellTreePtr_.clear(); 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(); tetBasePtIsPtr_.clear();
// Remove the cell tree // Remove the cell tree
cellTreePtr_.clear(); cellTreePtr_.clear();
pointMesh::Delete(*this);
} }
@ -120,6 +132,8 @@ void Foam::polyMesh::clearPrimitives()
owner_.setSize(0); owner_.setSize(0);
neighbour_.setSize(0); neighbour_.setSize(0);
pointMesh::Delete(*this);
clearedPrimitives_ = true; clearedPrimitives_ = true;
} }
@ -128,11 +142,19 @@ void Foam::polyMesh::clearOut()
{ {
clearGeom(); clearGeom();
clearAddressing(); clearAddressing();
pointMesh::Delete(*this);
} }
void Foam::polyMesh::clearCellTree() void Foam::polyMesh::clearCellTree()
{ {
if (debug)
{
Info<< "void polyMesh::clearCellTree() : "
<< "clearing cell tree"
<< endl;
}
cellTreePtr_.clear(); cellTreePtr_.clear();
} }

View File

@ -38,6 +38,13 @@ Description
void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm) 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) // Update boundaryMesh (note that patches themselves already ok)
boundary_.updateMesh(); boundary_.updateMesh();