From: Maximilien Siavelis Date: Thu, 28 Sep 2017 09:26:34 +0000 (+0200) Subject: correction in computeEnlargedNeighborsOfNodes X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d288ad97345898d63886843fe9eb4a9f2a5c27da;p=tools%2Fmedcoupling.git correction in computeEnlargedNeighborsOfNodes --- 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); {