From f776857284ccef114198b32ad5725f1eed901e06 Mon Sep 17 00:00:00 2001 From: ageay Date: Mon, 4 Feb 2013 16:00:18 +0000 Subject: [PATCH] Addition of MEDCouplingCurveLinearMesh --- src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx | 2 -- src/MEDCoupling_Swig/MEDCouplingBasicsTest.py | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) 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): -- 2.39.2