]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
debugging session
authorageay <ageay>
Fri, 21 Jun 2013 09:35:36 +0000 (09:35 +0000)
committerageay <ageay>
Fri, 21 Jun 2013 09:35:36 +0000 (09:35 +0000)
src/MEDCoupling/MEDCouplingUMesh.cxx
src/MEDCoupling_Swig/MEDCouplingBasicsTest.py
src/MEDCoupling_Swig/MEDCouplingCommon.i

index 7053039d2e883fc8a9230a1b02793b410c20a98b..fe6f8f71f00d178e2cd62e522d546a8a69d99d78 100644 (file)
@@ -6697,7 +6697,10 @@ MEDCoupling1GTUMesh *MEDCouplingUMesh::convertIntoSingleGeoTypeMesh() const thro
   ret->setCoords(getCoords());
   MEDCoupling1SGTUMesh *retC=dynamic_cast<MEDCoupling1SGTUMesh *>((MEDCoupling1GTUMesh*)ret);
   if(retC)
-    retC->setNodalConnectivity(convertNodalConnectivityToStaticGeoTypeMesh());
+    {
+      MEDCouplingAutoRefCountObjectPtr<DataArrayInt> c=convertNodalConnectivityToStaticGeoTypeMesh();
+      retC->setNodalConnectivity(c);
+    }
   else
     {
       MEDCoupling1DGTUMesh *retD=dynamic_cast<MEDCoupling1DGTUMesh *>((MEDCoupling1GTUMesh*)ret);
@@ -6758,6 +6761,7 @@ void MEDCouplingUMesh::convertNodalConnectivityToDynamicGeoTypeMesh(DataArrayInt
   c->alloc(lgth-nbCells,1); ci->alloc(nbCells+1,1);
   int *cp(c->getPointer()),*cip(ci->getPointer());
   const int *incp(_nodal_connec->begin()),*incip(_nodal_connec_index->begin());
+  cip[0]=0;
   for(int i=0;i<nbCells;i++,cip++,incip++)
     {
       int strt(incip[0]+1),stop(incip[1]);//+1 to skip geo type
index 71f26e55c24227e85eaaca94fef56b1cd0c9788b..0a05392e707b1c48a37edbb7e1e5cf8c931b9cb4 100644 (file)
@@ -13179,6 +13179,19 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         self.assertTrue(f.getArray().isEqual(DataArrayDouble(6*[(0,0,-1)]),1e-12))
         mcpy.changeSpaceDimension(2)
         self.assertEqual(1,mcpy.getCellContainingPoint([1.5,0.5],1e-12))
+        ##
+        self.assertTrue(mcpy.fillCellIdsToKeepFromNodeIds(DataArrayInt([6,7]),False).isEqual(DataArrayInt([0,1,5])))
+        ##
+        mcpy2=mcpy.deepCpy()
+        self.assertEqual([None,None],mcpy.checkGeoEquivalWith(mcpy2,1,1e-12))#fast equal
+        mcpy.checkFastEquivalWith(mcpy2,1e-12)
+        mcpy2.renumberCells([0,2,4,3,1,5])
+        mcpy.checkFastEquivalWith(mcpy2,1e-12)
+        self.assertEqual([None,None],mcpy.checkGeoEquivalWith(mcpy2,1,1e-12))#fast equal
+        mcpy2.renumberCells([0,2,4,3,1,5])
+        mcpy2.renumberCells([1,3,5,0,2,4])
+        self.assertRaises(InterpKernelException,mcpy.checkFastEquivalWith,mcpy2,1e-12)
+        self.assertRaises(InterpKernelException,mcpy.checkGeoEquivalWith,mcpy2,1,1e-12)#fast equal
         pass
 
     def setUp(self):
index a625d708e68a24e6a9b013c5fcfd115c6e622307..1854d889d588e96381a347d3bfeb21c81d59104f 100644 (file)
@@ -248,6 +248,7 @@ using namespace INTERP_KERNEL;
 %newobject ParaMEDMEM::DataArrayInt::negate;
 %newobject ParaMEDMEM::DataArrayInt::getIdsInRange;
 %newobject ParaMEDMEM::DataArrayInt::Aggregate;
+%newobject ParaMEDMEM::DataArrayInt::AggregateIndexes;
 %newobject ParaMEDMEM::DataArrayInt::Meld;
 %newobject ParaMEDMEM::DataArrayInt::Add;
 %newobject ParaMEDMEM::DataArrayInt::Substract;