From: Anthony Geay Date: Mon, 4 Jan 2016 07:05:21 +0000 (+0100) Subject: Small fix. X-Git-Tag: V7_8_0a1~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c2c3283baf2c498b476582478eb896d15590106a;p=tools%2Fmedcoupling.git Small fix. --- diff --git a/src/MEDLoader/MEDFileMesh.cxx b/src/MEDLoader/MEDFileMesh.cxx index 6c5bd3afe..c858bf9f0 100644 --- a/src/MEDLoader/MEDFileMesh.cxx +++ b/src/MEDLoader/MEDFileMesh.cxx @@ -3164,6 +3164,7 @@ MEDFileMesh *MEDFileUMesh::cartesianize() const if((const MEDFileUMeshSplitL1 *)(*it)) *it=(*it)->shallowCpyUsingCoords(coordsCart); ret->_coords=coordsCart; + ret->setAxType(AX_CART); return ret.retn(); } } @@ -6210,6 +6211,7 @@ MEDFileMesh *MEDFileCMesh::cartesianize() const MEDCouplingAutoRefCountObjectPtr ret(MEDFileCurveLinearMesh::New()); ret->MEDFileStructuredMesh::operator=(*this); ret->setMesh(clmesh); + ret->setAxType(AX_CART); return ret.retn(); } } @@ -6421,6 +6423,7 @@ MEDFileMesh *MEDFileCurveLinearMesh::cartesianize() const MEDCouplingAutoRefCountObjectPtr coordsCart(coords->cartesianize(getAxType())); mesh2->setCoords(coordsCart); ret->setMesh(mesh2); + ret->setAxType(AX_CART); return ret.retn(); } } diff --git a/src/MEDLoader/Swig/MEDLoaderTest3.py b/src/MEDLoader/Swig/MEDLoaderTest3.py index b50dae798..f717cbda1 100644 --- a/src/MEDLoader/Swig/MEDLoaderTest3.py +++ b/src/MEDLoader/Swig/MEDLoaderTest3.py @@ -4763,6 +4763,7 @@ class MEDLoaderTest(unittest.TestCase): ref3=mm.getDirectUndergroundSingleGeoTypeMesh(NORM_QUAD4).getNodalConnectivity().getHiddenCppPointer() self.assertEqual(ref0,mm.getDirectUndergroundSingleGeoTypeMesh(NORM_QUAD4).getCoords().getHiddenCppPointer()) mm2=mm.cartesianize() # the trigger + self.assertEqual(mm2.getAxType(),AX_CART) self.assertTrue(isinstance(mm2,MEDFileUMesh)) self.assertTrue(mm.getHiddenCppPointer()!=mm2.getHiddenCppPointer()) self.assertTrue(ref0==mm.getCoords().getHiddenCppPointer()) # <- here important @@ -4787,6 +4788,7 @@ class MEDLoaderTest(unittest.TestCase): # UMesh cart mm.setAxType(AX_CART) mm2=mm.cartesianize() # the trigger + self.assertEqual(mm2.getAxType(),AX_CART) self.assertTrue(isinstance(mm2,MEDFileUMesh)) self.assertTrue(mm.getHiddenCppPointer()==mm2.getHiddenCppPointer()) # optimization # CurveLinearMesh non cart @@ -4796,6 +4798,7 @@ class MEDLoaderTest(unittest.TestCase): mm.setName("a") ; mm.setDescription("b") ; mm.setTime(3,4,5.) ; mm.addFamily("c",-4) ; mm.setFamiliesOnGroup("d",["c"]) ; mm.setTimeUnit("ms") ref0=mm.getMesh().getCoords().getHiddenCppPointer() mm2=mm.cartesianize() # the trigger + self.assertEqual(mm2.getAxType(),AX_CART) self.assertTrue(isinstance(mm2,MEDFileCurveLinearMesh)) self.assertTrue(mm.getHiddenCppPointer()!=mm2.getHiddenCppPointer()) self.assertTrue(ref0==mm.getMesh().getCoords().getHiddenCppPointer()) # <- here important @@ -4816,6 +4819,7 @@ class MEDLoaderTest(unittest.TestCase): # CurveLinearMesh cart mm.setAxType(AX_CART) mm2=mm.cartesianize() # the trigger + self.assertEqual(mm2.getAxType(),AX_CART) self.assertTrue(isinstance(mm2,MEDFileCurveLinearMesh)) self.assertTrue(mm.getHiddenCppPointer()==mm2.getHiddenCppPointer()) # optimization # CMesh non cart @@ -4824,6 +4828,7 @@ class MEDLoaderTest(unittest.TestCase): mm.setFamilyFieldArr(0,d1) ; mm.setFamilyFieldArr(1,d0) mm.setName("a") ; mm.setDescription("b") ; mm.setTime(3,4,5.) ; mm.addFamily("c",-4) ; mm.setFamiliesOnGroup("d",["c"]) ; mm.setTimeUnit("ms") mm2=mm.cartesianize() # the trigger + self.assertEqual(mm2.getAxType(),AX_CART) self.assertTrue(isinstance(mm2,MEDFileCurveLinearMesh)) self.assertEqual(mm2.getMesh().getNodeGridStructure(),mm.getMesh().getNodeGridStructure()) self.assertEqual(mm2.getName(),mm.getName()) @@ -4841,6 +4846,7 @@ class MEDLoaderTest(unittest.TestCase): # CMesh cart mm.setAxType(AX_CART) mm2=mm.cartesianize() # the trigger + self.assertEqual(mm2.getAxType(),AX_CART) self.assertTrue(isinstance(mm2,MEDFileCMesh)) self.assertTrue(mm.getHiddenCppPointer()==mm2.getHiddenCppPointer()) # optimization pass