From: Anida Khizar Date: Mon, 9 May 2022 07:45:30 +0000 (+0200) Subject: BugFix: local renumbering of cells when the intersecting tool is a closed line X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fakr%2Fconformize3DIJK;p=tools%2Fmedcoupling.git BugFix: local renumbering of cells when the intersecting tool is a closed line --- 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);