- * This method looks if 'this' and 'other' are geometrically equivalent that is to say if each cell in 'other' correspond to one cell and only one
- * in 'this' is found regarding 'prec' parameter and 'cellCompPol' parameter.
- *
- * In case of success cellCor and nodeCor are informed both.
- * @param cellCompPol values are described in MEDCouplingUMesh::zipConnectivityTraducer method.
- * @param cellCor output array giving the correspondance of cells from 'other' to 'this'.
- * @param nodeCor output array giving the correspondance of nodes from 'other' to 'this'.
- */
-void MEDCouplingUMesh::checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
- DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const throw(INTERP_KERNEL::Exception)
-{
- const MEDCouplingUMesh *otherC=dynamic_cast<const MEDCouplingUMesh *>(other);
- if(!otherC)
- throw INTERP_KERNEL::Exception("checkDeepEquivalWith : Two meshes are not not unstructured !");
- MEDCouplingMesh::checkFastEquivalWith(other,prec);
- if(_types!=otherC->_types)
- throw INTERP_KERNEL::Exception("checkDeepEquivalWith : Types are not equal !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=MergeUMeshes(this,otherC);
- bool areNodesMerged;
- int newNbOfNodes;
- int oldNbOfNodes=getNumberOfNodes();
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=m->buildPermArrayForMergeNode(prec,oldNbOfNodes,areNodesMerged,newNbOfNodes);
- //mergeNodes
- if(!areNodesMerged)
- throw INTERP_KERNEL::Exception("checkDeepEquivalWith : Nodes are incompatible ! ");
- const int *pt=std::find_if(da->getConstPointer()+oldNbOfNodes,da->getConstPointer()+da->getNbOfElems(),std::bind2nd(std::greater<int>(),oldNbOfNodes-1));
- if(pt!=da->getConstPointer()+da->getNbOfElems())
- throw INTERP_KERNEL::Exception("checkDeepEquivalWith : some nodes in other are not in this !");
- m->renumberNodes(da->getConstPointer(),newNbOfNodes);
- //
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nodeCor2=da->substr(oldNbOfNodes);
- da=m->mergeNodes(prec,areNodesMerged,newNbOfNodes);
-
- //
- da=m->zipConnectivityTraducer(cellCompPol);
- int maxId=*std::max_element(da->getConstPointer(),da->getConstPointer()+getNumberOfCells());
- pt=std::find_if(da->getConstPointer()+getNumberOfCells(),da->getConstPointer()+da->getNbOfElems(),std::bind2nd(std::greater<int>(),maxId));
- if(pt!=da->getConstPointer()+da->getNbOfElems())
- throw INTERP_KERNEL::Exception("checkDeepEquivalWith : some cells in other are not in this !");
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellCor2=da->selectByTupleId2(getNumberOfCells(),da->getNbOfElems(),1);
- nodeCor=nodeCor2->isIdentity()?0:nodeCor2.retn();
- cellCor=cellCor2->isIdentity()?0:cellCor2.retn();
-}
-
-/*!
- * This method looks if 'this' and 'other' are geometrically equivalent that is to say if each cell in 'other' correspond to one cell and only one
- * in 'this' is found regarding 'prec' parameter and 'cellCompPol' parameter. The difference with MEDCouplingUMesh::checkDeepEquivalWith method is that
- * coordinates of 'this' and 'other' are expected to be the same. If not an exception will be thrown.
- * This method is close to MEDCouplingUMesh::areCellsIncludedIn except that this method throws exception !
- *
- * In case of success cellCor are informed both.
- * @param cellCompPol values are described in MEDCouplingUMesh::zipConnectivityTraducer method.
- * @param cellCor output array giving the correspondance of cells from 'other' to 'this'.
- */
-void MEDCouplingUMesh::checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
- DataArrayInt *&cellCor) const throw(INTERP_KERNEL::Exception)
-{
- const MEDCouplingUMesh *otherC=dynamic_cast<const MEDCouplingUMesh *>(other);
- if(!otherC)
- throw INTERP_KERNEL::Exception("checkDeepEquivalOnSameNodesWith : Two meshes are not not unstructured !");
- MEDCouplingMesh::checkFastEquivalWith(other,prec);
- if(_types!=otherC->_types)
- throw INTERP_KERNEL::Exception("checkDeepEquivalOnSameNodesWith : Types are not equal !");
- if(_coords!=otherC->_coords)
- throw INTERP_KERNEL::Exception("checkDeepEquivalOnSameNodesWith : meshes do not share the same coordinates ! Use tryToShareSameCoordinates or call checkDeepEquivalWith !");
- std::vector<const MEDCouplingUMesh *> ms(2);
- ms[0]=this;
- ms[1]=otherC;
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> m=MergeUMeshesOnSameCoords(ms);
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da=m->zipConnectivityTraducer(cellCompPol);
- int maxId=*std::max_element(da->getConstPointer(),da->getConstPointer()+getNumberOfCells());
- const int *pt=std::find_if(da->getConstPointer()+getNumberOfCells(),da->getConstPointer()+da->getNbOfElems(),std::bind2nd(std::greater<int>(),maxId));
- if(pt!=da->getConstPointer()+da->getNbOfElems())
- {
- throw INTERP_KERNEL::Exception("checkDeepEquivalOnSameNodesWith : some cells in other are not in this !");
- }
- MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellCor2=da->selectByTupleId2(getNumberOfCells(),da->getNbOfElems(),1);
- cellCor=cellCor2->isIdentity()?0:cellCor2.retn();
-}
-
-/*!
- * This method checks fastly that 'this' and 'other' are equal.