]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Small modif
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 5 Oct 2016 15:29:09 +0000 (17:29 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 5 Oct 2016 15:29:09 +0000 (17:29 +0200)
src/MEDLoader/MEDFileMesh.cxx
src/MEDLoader/Swig/MEDLoaderTest3.py

index e71326cea842b29f3bacc290de538f6bf3df726c..6c2cd2f71693a42c5d1ce46791e7e44399cde9b9 100644 (file)
@@ -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<int>::max()-mem->get2DCellIdForExtrusion());
   return ret.retn();
 }
 
@@ -4653,7 +4653,7 @@ MEDCouplingMappedExtrudedMesh *MEDFileUMesh::convertToExtrudedMesh() const
   MCAuto<MEDCouplingUMesh> 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<int>::max()-getFamilyId(GetSpeStr4ExtMesh()));
   MCAuto<MEDCouplingMappedExtrudedMesh> ret(MEDCouplingMappedExtrudedMesh::New(m3D,m2D,zeId));
   return ret.retn();
 }
index 028e17be93ef71fed5b5977f54dc425e7bd38aca..84c6eb84b0ee1a3ada718c5ac2c034e9ae51a472 100644 (file)
@@ -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