From fde63a0e517971f549752bbf384259a75c870fed Mon Sep 17 00:00:00 2001 From: Anida Khizar Date: Mon, 9 May 2022 09:45:30 +0200 Subject: [PATCH] BugFix: local renumbering of cells when the intersecting tool is a closed line --- src/MEDCoupling/MEDCouplingUMesh_intersection.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx b/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx index 4f5e96377..0b07220ae 100644 --- a/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh_intersection.cxx @@ -1120,14 +1120,14 @@ MEDCouplingUMesh *BuildMesh2DCutInternal(double eps, MEDCouplingUMesh *splitMesh renumb->alloc(nbCellsInSplitMesh1D,1); const mcIdType * renumbP(renumb->begin()); - mcIdType i, first=cSplitPtr[1]; + mcIdType i, renumOffset = 0, first=cSplitPtr[1]; // Follow 1D line backward as long as it is connected: - for (i=nbCellsInSplitMesh1D-1; cSplitPtr[ciSplitPtr[i]+2] == first; i--) + for (i=nbCellsInSplitMesh1D-1; cSplitPtr[ciSplitPtr[i]+2] == first; i--,renumOffset++) first=cSplitPtr[ciSplitPtr[i]+1]; if (i < nbCellsInSplitMesh1D-1) { // Build circular permutation to shift consecutive edges together - renumb->iota(i+1); + renumb->iota(renumOffset); renumb->applyModulus(nbCellsInSplitMesh1D); splitMesh1D->renumberCells(renumbP, false); -- 2.39.2