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
\\ / 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

View File

@ -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;

View File

@ -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();
}

View File

@ -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();