From d288ad97345898d63886843fe9eb4a9f2a5c27da Mon Sep 17 00:00:00 2001 From: Maximilien Siavelis Date: Thu, 28 Sep 2017 11:26:34 +0200 Subject: [PATCH] correction in computeEnlargedNeighborsOfNodes --- src/MEDCoupling/MEDCouplingUMesh.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/MEDCoupling/MEDCouplingUMesh.cxx b/src/MEDCoupling/MEDCouplingUMesh.cxx index 94be2bd5a..07ba32835 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh.cxx @@ -974,8 +974,12 @@ void MEDCouplingUMesh::computeEnlargedNeighborsOfNodes(MCAuto &nei neighborsIdx=DataArrayInt::New(); neighborsIdx->alloc(nbOfNodes+1,1); neighborsIdx->setIJ(0,0,0); { int *neighIdx(neighborsIdx->getPointer()); - for(std::vector< std::set >::const_iterator it=st0.begin();it!=st0.end();it++,neighIdx++) - neighIdx[1]=neighIdx[0]+(*it).size()-1; + for(std::vector< std::set >::const_iterator it=st0.begin();it!=st0.end();it++,neighIdx++){ + if ((*it).empty()) + neighIdx[1]=neighIdx[0]; + else + neighIdx[1]=neighIdx[0]+(*it).size()-1; + } } neighbors=DataArrayInt::New(); neighbors->alloc(neighborsIdx->back(),1); { -- 2.39.2