]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
BugFix: local renumbering of cells when the intersecting tool is a closed line akr/conformize3DIJK
authorAnida Khizar <anida.khizar@cea.fr>
Mon, 9 May 2022 07:45:30 +0000 (09:45 +0200)
committerAnida Khizar <anida.khizar@cea.fr>
Mon, 9 May 2022 07:45:30 +0000 (09:45 +0200)
src/MEDCoupling/MEDCouplingUMesh_intersection.cxx

index 4f5e96377014accaf055b01ed92169431a7f55ed..0b07220ae04ebf18fc7476359f7b56155db5d63e 100644 (file)
@@ -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);