BUG: (un)refinement: combine topochange+motion. Fixes #2492

Explicitly unset the mesh.moving flag whilst doing the topo change.
This commit is contained in:
mattijs
2022-06-09 11:32:49 +01:00
parent c5cede38aa
commit d2d976bda8
2 changed files with 16 additions and 0 deletions

View File

@ -458,6 +458,12 @@ Foam::dynamicRefineFvMesh::refine
// Create mesh (with inflation), return map from old to new mesh.
//autoPtr<mapPolyMesh> map = meshMod.changeMesh(*this, true);
// Clear moving flag. This is currently required since geometry calculation
// might get triggered when doing processor patches.
// (TBD: should be in changeMesh if no inflation?)
moving(false);
// Create mesh (no inflation), return map from old to new mesh.
autoPtr<mapPolyMesh> map = meshMod.changeMesh(*this, false);
Info<< "Refined from "
@ -575,6 +581,12 @@ Foam::dynamicRefineFvMesh::unrefine
// Change mesh and generate map.
//autoPtr<mapPolyMesh> map = meshMod.changeMesh(*this, true);
// Clear moving flag. This is currently required since geometry calculation
// might get triggered when doing processor patches.
// (TBD: should be in changeMesh if no inflation?)
moving(false);
// Create mesh (no inflation), return map from old to new mesh.
autoPtr<mapPolyMesh> map = meshMod.changeMesh(*this, false);
Info<< "Unrefined from "
@ -1475,6 +1487,7 @@ bool Foam::dynamicRefineFvMesh::updateTopology()
bool Foam::dynamicRefineFvMesh::update()
{
bool hasChanged = updateTopology();
// Do any mesh motion (resets mesh.moving() if it does any mesh motion)
hasChanged = dynamicMotionSolverListFvMesh::update() && hasChanged;
return hasChanged;

View File

@ -10,4 +10,7 @@ cd "${0%/*}" || exit # Run from this directory
runApplication decomposePar
runParallel $(getApplication)
runApplication reconstructParMesh
runApplication reconstructPar
#------------------------------------------------------------------------------