From: ageay Date: Mon, 4 Feb 2013 16:00:18 +0000 (+0000) Subject: Addition of MEDCouplingCurveLinearMesh X-Git-Tag: V6_main_FINAL~394 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f776857284ccef114198b32ad5725f1eed901e06;p=tools%2Fmedcoupling.git Addition of MEDCouplingCurveLinearMesh --- diff --git a/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx b/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx index 2b7771f0f..f14a85e3a 100644 --- a/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx +++ b/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx @@ -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(coords); diff --git a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py index 59642040e..dbdb5e777 100644 --- a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py +++ b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py @@ -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):