From a60886971f2d19e7527aeea2017a7b88d23d41be Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Wed, 5 Oct 2016 17:29:09 +0200 Subject: [PATCH] Small modif --- src/MEDLoader/MEDFileMesh.cxx | 4 ++-- src/MEDLoader/Swig/MEDLoaderTest3.py | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/MEDLoader/MEDFileMesh.cxx b/src/MEDLoader/MEDFileMesh.cxx index e71326cea..6c2cd2f71 100644 --- a/src/MEDLoader/MEDFileMesh.cxx +++ b/src/MEDLoader/MEDFileMesh.cxx @@ -2291,7 +2291,7 @@ MEDFileUMesh *MEDFileUMesh::New(const MEDCouplingMappedExtrudedMesh *mem) m2D->setCoords(m3D->getCoords()); ret->setMeshAtLevel(0,m3D); ret->setMeshAtLevel(-1,m2D); - ret->setFamilyId(GetSpeStr4ExtMesh(),mem->get2DCellIdForExtrusion()); + ret->setFamilyId(GetSpeStr4ExtMesh(),std::numeric_limits::max()-mem->get2DCellIdForExtrusion()); return ret.retn(); } @@ -4653,7 +4653,7 @@ MEDCouplingMappedExtrudedMesh *MEDFileUMesh::convertToExtrudedMesh() const MCAuto m3D(getMeshAtLevel(0)),m2D(getMeshAtLevel(-1)); if(m3D.isNull() || m2D.isNull()) throw INTERP_KERNEL::Exception("MEDFileUMesh::convertToExtrudedMesh : this must be defined both at level 0 and level -1 !"); - int zeId(getFamilyId(GetSpeStr4ExtMesh())); + int zeId(std::numeric_limits::max()-getFamilyId(GetSpeStr4ExtMesh())); MCAuto ret(MEDCouplingMappedExtrudedMesh::New(m3D,m2D,zeId)); return ret.retn(); } diff --git a/src/MEDLoader/Swig/MEDLoaderTest3.py b/src/MEDLoader/Swig/MEDLoaderTest3.py index 028e17be9..84c6eb84b 100644 --- a/src/MEDLoader/Swig/MEDLoaderTest3.py +++ b/src/MEDLoader/Swig/MEDLoaderTest3.py @@ -5745,13 +5745,17 @@ class MEDLoaderTest3(unittest.TestCase): pass def testExtrudedMesh1(self): - fname1="Pyfile107.med" + fname="Pyfile107.med" arrX=DataArrayDouble([0,1,2,3]) ; arrY=DataArrayDouble([0,1,2,3,4]) ; arrZ=DataArrayDouble([0,1,2,3,4,5]) - mesh3D=MEDCouplingCMesh() ; mesh3D.setCoords(arrX,arrY,arrZ) + mesh3D=MEDCouplingCMesh() ; mesh3D.setCoords(arrX,arrY,arrZ) ; mesh3D.setName("mesh") ex=MEDCouplingMappedExtrudedMesh(mesh3D) mm=MEDFileUMesh(ex) + mm.write(fname,2) ex2=mm.convertToExtrudedMesh() + mm2=MEDFileMesh.New(fname) + ex3=mm2.convertToExtrudedMesh() self.assertTrue(ex.isEqual(ex2,1e-12)) + self.assertTrue(ex.isEqual(ex3,1e-12)) pass pass -- 2.39.2