]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
addition of checkDeepEquivalWith and checkDeepEquivalOnSameNodesWith in python API
authorageay <ageay>
Mon, 18 Mar 2013 15:30:21 +0000 (15:30 +0000)
committerageay <ageay>
Mon, 18 Mar 2013 15:30:21 +0000 (15:30 +0000)
src/MEDCoupling_Swig/MEDCouplingBasicsTest.py
src/MEDCoupling_Swig/MEDCouplingCommon.i

index e29fa484d320ad3164a0a703eac63256d40c7945..183b034d46929046c2e4616384bd20e1324bac81 100644 (file)
@@ -2669,6 +2669,12 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         self.assertTrue(nodeCor==None);
         cellCor=0;
         self.assertTrue(nodeCor==None);
+        a,b=mesh1.checkDeepEquivalWith(mesh2,0,1e-12);
+        self.assertEqual(renum,list(a.getValues()))
+        self.assertTrue(b==None);
+        mesh2.setCoords(mesh1.getCoords())
+        a=mesh1.checkDeepEquivalOnSameNodesWith(mesh2,0,1e-12);
+        self.assertEqual(renum,list(a.getValues()))
         #4th test : cell and node permutation by keeping the first the middle and the last as it is.
         mesh2=MEDCouplingDataForTest.build2DTargetMesh_3();
         renum2=[0,2,1,3,4,5,6,8,7,9,10]
index 513a3822da2346597d619993e44c692b451e6db6..1b549df739a88046023ff6f41024c851b959b071 100644 (file)
@@ -285,6 +285,7 @@ using namespace INTERP_KERNEL;
 %newobject ParaMEDMEM::DataArrayDouble::__rdiv__;
 %newobject ParaMEDMEM::DataArrayDoubleTuple::buildDADouble;
 %newobject ParaMEDMEM::MEDCouplingMesh::deepCpy;
+%newobject ParaMEDMEM::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith;
 %newobject ParaMEDMEM::MEDCouplingMesh::checkTypeConsistencyAndContig;
 %newobject ParaMEDMEM::MEDCouplingMesh::computeNbOfNodesPerCell;
 %newobject ParaMEDMEM::MEDCouplingMesh::giveCellsWithType;
@@ -704,6 +705,24 @@ namespace ParaMEDMEM
            PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
            return res;
          }
+
+         PyObject *checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
+         {
+           DataArrayInt *cellCor=0,*nodeCor=0;
+           self->checkDeepEquivalWith(other,cellCompPol,prec,cellCor,nodeCor);
+           PyObject *res = PyList_New(2);
+           PyList_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(cellCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, cellCor?SWIG_POINTER_OWN | 0:0 ));
+           PyList_SetItem(res,1,SWIG_NewPointerObj(SWIG_as_voidptr(nodeCor),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, nodeCor?SWIG_POINTER_OWN | 0:0 ));
+           return res;
+         }
+         
+         DataArrayInt *checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec) const throw(INTERP_KERNEL::Exception)
+         {
+           DataArrayInt *cellCor=0;
+           self->checkDeepEquivalOnSameNodesWith(other,cellCompPol,prec,cellCor);
+           return cellCor;
+         }
+
          DataArrayInt *getCellIdsFullyIncludedInNodeIds(PyObject *li) const throw(INTERP_KERNEL::Exception)
          {
            void *da=0;