X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingFieldDiscretization.cxx;h=a927a731c068e65c8c6dafb02d2c7831e300dc77;hb=ffe6d640bbaae9d66ac15d1015761d047a495ede;hp=ec5661169ea9571644563621f1fa1515c00b9c0c;hpb=2c41aa62fe11582c6fcca44bde487d1e648d3bb9;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx b/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx index ec5661169..a927a731c 100644 --- a/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx +++ b/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx @@ -1323,7 +1323,7 @@ const char *MEDCouplingFieldDiscretizationGauss::getRepr() const */ int MEDCouplingFieldDiscretizationGauss::getNumberOfTuplesExpectedRegardingCode(const MEDCouplingMesh *mesh, const std::vector& code, const std::vector& idsPerType) const throw(INTERP_KERNEL::Exception) { - if(!_discr_per_cell || _discr_per_cell->isAllocated() || _discr_per_cell->getNumberOfComponents()!=1) + if(!_discr_per_cell || !_discr_per_cell->isAllocated() || _discr_per_cell->getNumberOfComponents()!=1) throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::getNumberOfTuplesExpectedRegardingCode"); if(code.size()%3!=0) throw INTERP_KERNEL::Exception("MEDCouplingFieldDiscretizationGauss::getNumberOfTuplesExpectedRegardingCode : invalid input code !"); @@ -1366,8 +1366,17 @@ int MEDCouplingFieldDiscretizationGauss::getNumberOfTuples(const MEDCouplingMesh throw INTERP_KERNEL::Exception("Discretization is not initialized!"); const int *dcPtr=_discr_per_cell->getConstPointer(); int nbOfTuples=_discr_per_cell->getNumberOfTuples(); + int maxSz=(int)_loc.size(); for(const int *w=dcPtr;w!=dcPtr+nbOfTuples;w++) - ret+=_loc[*w].getNumberOfGaussPt(); + { + if(*w>=0 && *w