displacementMotionSolver: Reorganized the updateMesh function

It is not clear that the original updateMesh function in
displacementLayeredMotionMotionSolver is correct and needs checking and testing.
This commit is contained in:
Henry Weller
2018-06-27 22:23:21 +01:00
parent 42dde9014c
commit cb1237dd4c
4 changed files with 39 additions and 36 deletions

View File

@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/
#include "displacementMotionSolver.H"
#include "mapPolyMesh.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -65,36 +64,4 @@ Foam::displacementMotionSolver::~displacementMotionSolver()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::displacementMotionSolver::updateMesh
(
const mapPolyMesh& mpm
)
{
displacementMotionSolver::updateMesh(mpm);
const vectorField displacement(this->newPoints() - points0_);
forAll(points0_, pointi)
{
label oldPointi = mpm.pointMap()[pointi];
if (oldPointi >= 0)
{
label masterPointi = mpm.reversePointMap()[oldPointi];
if ((masterPointi != pointi))
{
// newly inserted point in this cellZone
// need to set point0 so that it represents the position that
// it would have had if it had existed for all time
points0_[pointi] -= displacement[pointi];
}
}
}
}
// ************************************************************************* //

View File

@ -105,9 +105,6 @@ public:
{
return pointDisplacement_;
}
//- Update topology
virtual void updateMesh(const mapPolyMesh&);
};

View File

@ -31,6 +31,7 @@ License
#include "syncTools.H"
#include "interpolationTable.H"
#include "pointConstraints.H"
#include "mapPolyMesh.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -555,4 +556,39 @@ void Foam::displacementLayeredMotionMotionSolver::solve()
}
void Foam::displacementLayeredMotionMotionSolver::updateMesh
(
const mapPolyMesh& mpm
)
{
FatalErrorInFunction
<< "Probably inconsistent with points0MotionSolver" << nl
<< " Needs to be updated and tested."
<< exit(FatalError);
displacementMotionSolver::updateMesh(mpm);
const vectorField displacement(this->newPoints() - points0_);
forAll(points0_, pointi)
{
const label oldPointi = mpm.pointMap()[pointi];
if (oldPointi >= 0)
{
label masterPointi = mpm.reversePointMap()[oldPointi];
if ((masterPointi != pointi))
{
// newly inserted point in this cellZone
// need to set point0 so that it represents the position that
// it would have had if it had existed for all time
points0_[pointi] -= displacement[pointi];
}
}
}
}
// ************************************************************************* //

View File

@ -148,6 +148,9 @@ public:
//- Solve for motion
virtual void solve();
//- Update topology
virtual void updateMesh(const mapPolyMesh&);
};