From: abn Date: Wed, 4 Jun 2014 07:14:06 +0000 (+0200) Subject: checkDeepEquivalWith: simpler cell checking logic to account for redundant cells X-Git-Tag: V7_5_0a1~2^2~29 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1e1b3627ba920be958c46a2cb1ee097ebdbc5a8f;p=tools%2Fmedcoupling.git checkDeepEquivalWith: simpler cell checking logic to account for redundant cells in a given mesh. --- diff --git a/src/MEDCoupling/MEDCouplingPointSet.cxx b/src/MEDCoupling/MEDCouplingPointSet.cxx index d44c666dc..27ce1b93b 100644 --- a/src/MEDCoupling/MEDCouplingPointSet.cxx +++ b/src/MEDCoupling/MEDCouplingPointSet.cxx @@ -1472,25 +1472,19 @@ void MEDCouplingPointSet::checkDeepEquivalWith(const MEDCouplingMesh *other, int // da=m->zipConnectivityTraducer(cellCompPol); int nbCells=getNumberOfCells(); + if (nbCells != other->getNumberOfCells()) + throw INTERP_KERNEL::Exception("checkDeepEquivalWith : some cells in other are not in this !"); int maxId=-1; int dan = da->getNumberOfTuples(); if (dan) { - if (dan & 1) - throw INTERP_KERNEL::Exception("checkDeepEquivalWith : some cells in other are not in this !"); MEDCouplingAutoRefCountObjectPtr da1 = DataArrayInt::New(), da2 = DataArrayInt::New(); da1->alloc(dan/2,1); da2->alloc(dan/2,1); std::copy(da->getConstPointer(), da->getConstPointer()+dan/2, da1->getPointer()); std::copy(da->getConstPointer()+dan/2, da->getConstPointer()+dan, da2->getPointer()); da1->sort(); da2->sort(); - if (*da1->getConstPointer() != *da2->getConstPointer()) + if (!da1->isEqualWithoutConsideringStr(*da2)) throw INTERP_KERNEL::Exception("checkDeepEquivalWith : some cells in other are not in this !"); - if (dan > 2) - { - MEDCouplingAutoRefCountObjectPtr dsi1 = da1->deltaShiftIndex(), dsi2 = da2->deltaShiftIndex(); - if (!(dsi1->isUniform(1) && dsi2->isUniform(1))) - throw INTERP_KERNEL::Exception("checkDeepEquivalWith : some cells in other are not in this !"); - } } MEDCouplingAutoRefCountObjectPtr cellCor2=da->selectByTupleId2(nbCells,da->getNbOfElems(),1); nodeCor=nodeCor2->isIdentity()?0:nodeCor2.retn();