diff --git a/src/finiteVolume/fvMesh/fvMesh.C b/src/finiteVolume/fvMesh/fvMesh.C index 7a8de07dd3f9f3f4a1b785946cc9422ccb33ccc5..8d4bee062ea7cef8c29dc7d42486b20626679062 100644 --- a/src/finiteVolume/fvMesh/fvMesh.C +++ b/src/finiteVolume/fvMesh/fvMesh.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -224,7 +224,7 @@ void Foam::fvMesh::storeOldVol(const scalarField& V) } -void Foam::fvMesh::clearOut() +void Foam::fvMesh::clearOutLocal() { clearGeom(); surfaceInterpolation::clearOut(); @@ -233,7 +233,12 @@ void Foam::fvMesh::clearOut() // Clear mesh motion flux deleteDemandDrivenData(phiPtr_); +} + +void Foam::fvMesh::clearOut() +{ + clearOutLocal(); polyMesh::clearOut(); } @@ -659,7 +664,8 @@ Foam::polyMesh::readUpdateState Foam::fvMesh::readUpdate() { DebugInfo << "Topological update" << endl; - clearOut(); + // fvMesh::clearOut() but without the polyMesh::clearOut + clearOutLocal(); } else if (state == polyMesh::POINTS_MOVED) { diff --git a/src/finiteVolume/fvMesh/fvMesh.H b/src/finiteVolume/fvMesh/fvMesh.H index b5b1abf34819f1085151ffb1e50bad6ebe2de6ea..da3748cfe2ad9c5cae88a2b91a5dc53b5cb6d6b9 100644 --- a/src/finiteVolume/fvMesh/fvMesh.H +++ b/src/finiteVolume/fvMesh/fvMesh.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2021 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -143,12 +143,15 @@ protected: // geometric demand-driven data that was set void updateGeomNotOldVol(); - //- Clear geometry + //- Clear local geometry void clearGeom(); - //- Clear addressing + //- Clear local addressing void clearAddressing(const bool isMeshUpdate = false); + //- Clear local-only storage (geometry, addressing etc) + void clearOutLocal(); + //- Preserve old volume(s) void storeOldVol(const scalarField&);