From 6952fe84d182a8bb749a4ec9a6663ad944e23ae5 Mon Sep 17 00:00:00 2001 From: abn Date: Fri, 8 Oct 2021 15:48:11 +0200 Subject: [PATCH] Bug fix ! --- src/MEDCoupling/MEDCouplingUMesh.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/MEDCoupling/MEDCouplingUMesh.cxx b/src/MEDCoupling/MEDCouplingUMesh.cxx index 3a63bc6d6..f4e1789e3 100755 --- a/src/MEDCoupling/MEDCouplingUMesh.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh.cxx @@ -2545,9 +2545,12 @@ void MEDCouplingUMesh::findCellsToRenumber(const MEDCouplingUMesh& otherDimM1OnS // Build map giving for each cell ID in mAroundGrp the corresponding cell ID on the other side of the crack: // Note that this does not cover all cells around the crack (a cell like a triangle might touche the crack only with its tip) std::map toOtherSide; - const mcIdType *revDP=revDesc00->begin(), *revDIP=revDescI00->begin(); + const mcIdType *revDP=revDesc00->begin(), *revDIP=revDescI00->begin(); + const mcIdType nCellsArGrpDesc = mArGrpDesc->getNumberOfCells(); for (const auto& v: *idsOfM1) { + if (v >= nCellsArGrpDesc) // Keep valid match only + continue; mcIdType idx0 = revDIP[v]; mcIdType c1=revDP[idx0], c2=revDP[idx0+1]; toOtherSide[c1] = c2; -- 2.39.2