]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Addition of MEDCouplingCurveLinearMesh
authorageay <ageay>
Mon, 4 Feb 2013 16:00:18 +0000 (16:00 +0000)
committerageay <ageay>
Mon, 4 Feb 2013 16:00:18 +0000 (16:00 +0000)
src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx
src/MEDCoupling_Swig/MEDCouplingBasicsTest.py

index 2b7771f0f54b5f3910d3beedf9d890818598e833..f14a85e3a6df997526ac5b138ce24298f18da5bf 100644 (file)
@@ -309,8 +309,6 @@ const DataArrayDouble *MEDCouplingCurveLinearMesh::getCoords() const throw(INTER
 
 void MEDCouplingCurveLinearMesh::setCoords(const DataArrayDouble *coords) throw(INTERP_KERNEL::Exception)
 {
-  if(coords)
-    coords->checkNbOfComps(1,"MEDCouplingCurveLinearMesh::setCoords");
   if(coords!=(const DataArrayDouble *)_coords)
     {
       _coords=const_cast<DataArrayDouble *>(coords);
index 59642040ea7fc3d3d7366e656ab3a2c472205000..dbdb5e777b20e516d5d57eb1677eb81d72ad7d97 100644 (file)
@@ -10992,6 +10992,22 @@ class MEDCouplingBasicsTest(unittest.TestCase):
             pass
         self.assertTrue(m.getNodalConnectivity().isEqual(DataArrayInt([3,0,1,2,3,0,1,3,3,0,1,4,3,0,1,5,3,0,1,6])))
         self.assertTrue(m.getNodalConnectivityIndex().isEqual(DataArrayInt([0,4,8,12,16,20])))
+        self.assertRaises(InterpKernelException,m.insertNextCell,NORM_TRI3,None)
+        pass
+
+    def testSwigCurveLinearMesh1(self):
+        m=MEDCouplingCurveLinearMesh("toto")
+        m.setNodeGridStructure([2,3])
+        coords=DataArrayDouble([0.,0., 2.,0., 0.,1., 1.9,1.1, 0.3,1.9, 2.2,2.1],6,2)
+        m.setCoords(coords)
+        m.checkCoherency()
+        m0=m.deepCpy()
+        self.assertTrue(m0.isEqual(m,1e-12))
+        m.getCoords().setInfoOnComponents(["X [m]","Y [m]"])
+        self.assertTrue(not m0.isEqual(m,1e-12))
+        m0=m.deepCpy()
+        self.assertTrue(m0.isEqual(m,1e-12))
+        self.assertEqual(m.getNodeGridStructure(),(2,3))
         pass
 
     def setUp(self):