// 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<mcIdType, mcIdType> 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;