mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
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:
@ -24,7 +24,6 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "displacementMotionSolver.H"
|
#include "displacementMotionSolver.H"
|
||||||
#include "mapPolyMesh.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * 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];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -105,9 +105,6 @@ public:
|
|||||||
{
|
{
|
||||||
return pointDisplacement_;
|
return pointDisplacement_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Update topology
|
|
||||||
virtual void updateMesh(const mapPolyMesh&);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -31,6 +31,7 @@ License
|
|||||||
#include "syncTools.H"
|
#include "syncTools.H"
|
||||||
#include "interpolationTable.H"
|
#include "interpolationTable.H"
|
||||||
#include "pointConstraints.H"
|
#include "pointConstraints.H"
|
||||||
|
#include "mapPolyMesh.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * 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];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -148,6 +148,9 @@ public:
|
|||||||
|
|
||||||
//- Solve for motion
|
//- Solve for motion
|
||||||
virtual void solve();
|
virtual void solve();
|
||||||
|
|
||||||
|
//- Update topology
|
||||||
|
virtual void updateMesh(const mapPolyMesh&);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user