]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Non regression test to check that MEDFile support big nb of components
authorageay <ageay>
Fri, 15 Mar 2013 07:22:15 +0000 (07:22 +0000)
committerageay <ageay>
Fri, 15 Mar 2013 07:22:15 +0000 (07:22 +0000)
src/MEDLoader/Swig/MEDLoaderTest.py

index 42f11222e9ff67473b2ee2482bd8380304704a06..e80c1f46f9a9bcffff5d96f1f215f6f5af924075 100644 (file)
@@ -545,6 +545,22 @@ class MEDLoaderTest(unittest.TestCase):
         self.assertTrue(fs[2]=="Field3");
         self.assertTrue(fs[3]=="Field8");
         pass
+
+    def testBigNbOfCompoNonReg(self):
+        fileName="Pyfile57.med"
+        m=MEDLoader.MEDCouplingCMesh() ; m.setCoords(MEDLoader.DataArrayDouble([0,1,2,3]),MEDLoader.DataArrayDouble([0,1]),MEDLoader.DataArrayDouble([0,1]))
+        m=m.buildUnstructured() ; m.setName("TinyMesh")
+        f=MEDLoader.MEDCouplingFieldDouble(MEDLoader.ON_CELLS) ; f.setMesh(m)
+        nbOfCompo=4100
+        arr=MEDLoader.DataArrayDouble(nbOfCompo*3) ; arr.iota()
+        arr.rearrange(nbOfCompo)
+        arr.setInfoOnComponents(["c%i"%(i) for i in xrange(nbOfCompo)])
+        f.setArray(arr)
+        f.setName("FieldBigCompo")
+        MEDLoader.MEDLoader.WriteField(fileName,f,True)
+        f2=MEDLoader.MEDLoader.ReadFieldCell(fileName,m.getName(),0,f.getName(),-1,-1)
+        self.assertTrue(f.isEqual(f2,1e-12,1e-12))
+        pass
     pass
 
 unittest.main()