Skip to content

Commit 5a7bb42

Browse files
committed
Restore meshOldPoints checkpoint outside of fvMesh.movePoints.
Calling `(void)mesh_.onDemandField()` before `fvMesh.movePoints()` does not clear the old geometry fields.
1 parent 1ec34aa commit 5a7bb42

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

Adapter.C

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -789,20 +789,13 @@ void preciceAdapter::Adapter::reloadMeshPoints()
789789
return;
790790
}
791791

792-
// Invalidate on-demand fields
793-
// fvMesh::updateGeomNotOldVol()
794-
// (void)mesh_.V();
795-
(void)mesh_.Sf();
796-
(void)mesh_.magSf();
797-
(void)mesh_.C();
798-
(void)mesh_.Cf();
799-
800-
// fvMesh.movePoints overwrites the pointer to the oldPoints
801-
const_cast<pointField&>(mesh_.points()) = *meshOldPoints_;
802-
803792
// Reload mesh points
804793
const_cast<Foam::fvMesh&>(mesh_).movePoints(*meshPoints_);
805794

795+
// polyMesh.movePoints will only update oldPoints
796+
// if (curMotionTimeIndex_ != time().timeIndex())
797+
const_cast<pointField&>(mesh_.oldPoints()) = *meshOldPoints_;
798+
806799
readMeshCheckpoint();
807800

808801
DEBUG(adapterInfo("Moved mesh points to their previous locations."));

0 commit comments

Comments
 (0)