From f9dbb83d5d85b5bfcb0b9a2ce8fe8ef0428c7950 Mon Sep 17 00:00:00 2001 From: ageay Date: Wed, 15 Jan 2014 15:53:25 +0000 Subject: [PATCH] Correct bug on CMesh with no profiles ! --- src/MEDCoupling_Swig/MEDCouplingBasicsTest.py | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py index 58372b3eb..734391fa9 100644 --- a/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py +++ b/src/MEDCoupling_Swig/MEDCouplingBasicsTest.py @@ -14111,8 +14111,8 @@ class MEDCouplingBasicsTest(unittest.TestCase): c.setCoordsAt(0,arr) rn,rni=c.getReverseNodalConnectivity() rn2,rni2=c.buildUnstructured().getReverseNodalConnectivity() - self.assertTrue(rn.isEqual(DataArrayInt([]))) - self.assertTrue(rni.isEqual(DataArrayInt([0,0]))) + self.assertTrue(rn.isEqual(DataArrayInt([0]))) + self.assertTrue(rni.isEqual(DataArrayInt([0,1]))) self.assertTrue(rn.isEqual(rn2)) ; self.assertTrue(rni.isEqual(rni2)) # 1D - limit c=MEDCouplingCMesh() ; arr=DataArrayDouble(0) ; arr.iota() @@ -14181,6 +14181,35 @@ class MEDCouplingBasicsTest(unittest.TestCase): self.assertTrue(f3.getArray().isEqual(ref,1e-12)) pass + def testSwig2GetMeshSpaceDimensionCMesh1(self): + c=MEDCouplingCMesh() + arr0=DataArrayDouble([0,1,2]) + arr1=DataArrayDouble([0]) + c.setCoords(arr0,arr0,arr0) + self.assertEqual(c.getMeshDimension(),3) + self.assertEqual(c.getSpaceDimension(),3) + # + c.setCoords(arr0,arr0,arr1) + self.assertEqual(c.getMeshDimension(),2) + self.assertEqual(c.getSpaceDimension(),3) + # + c.setCoords(arr0,arr0) + self.assertEqual(c.getMeshDimension(),2) + self.assertEqual(c.getSpaceDimension(),2) + # + c.setCoords(arr0,arr1) + self.assertEqual(c.getMeshDimension(),1) + self.assertEqual(c.getSpaceDimension(),2) + # + c.setCoords(arr0) + self.assertEqual(c.getMeshDimension(),1) + self.assertEqual(c.getSpaceDimension(),1) + # + c.setCoords(arr1) + self.assertEqual(c.getMeshDimension(),0) + self.assertEqual(c.getSpaceDimension(),1) + pass + def setUp(self): pass pass -- 2.39.2