Bugfix: change the way function objects are updated on topo change

This commit is contained in:
Hrvoje Jasak 2020-03-20 14:00:53 +00:00
parent 364b016db9
commit e518ed21ee
2 changed files with 15 additions and 3 deletions

View file

@ -895,6 +895,10 @@ Foam::polyMesh::~polyMesh()
{ {
clearOut(); clearOut();
resetMotion(); resetMotion();
// Clear mesh objects. See clearGeom()
// HJ, 12/Feb/2020
meshObjectBase::allDelete(*this);
} }

View file

@ -91,9 +91,9 @@ void Foam::polyMesh::clearGeom()
solutionD_ = Vector<label>::zero; solutionD_ = Vector<label>::zero;
// Move points all mesh objects. HJ, 13/Oct/2010 // Move points all mesh objects. HJ, 13/Oct/2010
// This is a problem, because it is called in a destructor. // Functionality update: losing mesh objects on topo change, which should
meshObjectBase::allDelete(*this); // not happen. HJ, 12/Feb/2020
// meshObjectBase::allMovePoints(*this); meshObjectBase::allMovePoints(*this);
} }
@ -116,6 +116,10 @@ void Foam::polyMesh::clearAddressing()
// Reset valid directions // Reset valid directions
geometricD_ = Vector<label>::zero; geometricD_ = Vector<label>::zero;
solutionD_ = Vector<label>::zero; solutionD_ = Vector<label>::zero;
// Update mesh objects?
// HJ, 12/Feb/2020
meshObjectBase::allMovePoints(*this);
} }
@ -129,6 +133,10 @@ void Foam::polyMesh::clearPrimitives()
neighbour_.setSize(0); neighbour_.setSize(0);
clearedPrimitives_ = true; clearedPrimitives_ = true;
// Clear mesh objects. See clearGeom()
// HJ, 12/Feb/2020
meshObjectBase::allDelete(*this);
} }