From 30a25219d79b602cacbfee1fdb70b8c23c016745 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Tue, 16 Apr 2024 15:11:14 +0100 Subject: [PATCH] polyMesh::reorderPatches: Update time instance for the mesh so that the mesh with the changed boundary is written into a new time directory if time has changed. --- src/OpenFOAM/meshes/polyMesh/polyMesh.C | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index a7a802345f..79e56c9da2 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -1188,10 +1188,12 @@ void Foam::polyMesh::reorderPatches const bool validBoundary ) { - // Clear local fields and e.g. polyMesh parallelInfo. Do not clearGeom - // so we keep RepatchableMeshObjects intact. + // Clear local fields and e.g. polyMesh parallelInfo. + // Do not clearGeom to keep RepatchableMeshObjects intact. boundary_.clearGeom(); + clearAddressing(true); + // Clear all but RepatchableMeshObjects meshObjects::clearUpto < @@ -1212,6 +1214,11 @@ void Foam::polyMesh::reorderPatches *this ); + // Update time instance for the mesh + // so that it writes the mesh with the changed boundary + // into a new time directory + setInstance(time().name()); + boundary_.reorderPatches(newToOld, validBoundary); // Warn mesh objects