Salome HOME
Move MEDFileUMesh::addGroup to MEDFileMesh level -> addGroup is now available in...
[tools/medcoupling.git] / src / MEDLoader / Swig / MEDLoaderTest4.py
index 164269087805c54946bec3e3dd41153c8807385b..dd9d76beb31b639731aec7d9b4856d14e2fcf8e1 100644 (file)
@@ -1,10 +1,10 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2013  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 # License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
 #
 # This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -151,13 +151,18 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader, by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False) # False is important to not read the values
+        fields.removeFieldsWithoutAnyTimeStep()
         refMem=fields.getHeapMemorySize()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -362,12 +367,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader, by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -523,12 +533,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader, by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -773,12 +788,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader, by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -900,12 +920,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -1061,12 +1086,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -1265,12 +1295,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -1459,12 +1494,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                #for itmp in tmp:
+                #    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                #    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -1602,12 +1642,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                #for itmp in tmp:
+                #    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                #    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -1730,12 +1775,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -1828,12 +1878,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                #for itmp in tmp:
+                #    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                #    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -1918,12 +1973,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                #for itmp in tmp:
+                #    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                #    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -2030,12 +2090,17 @@ class MEDLoaderTest4(unittest.TestCase):
             ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
             ms=MEDFileMeshes(fname)
             fields=MEDFileFields(fname,False)
+            fields.removeFieldsWithoutAnyTimeStep()
             fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
             allFMTSLeavesToDisplay=[]
             for fields in fields_per_mesh:
                 allFMTSLeavesToDisplay2=[]
                 for fmts in fields:
-                    allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                    tmp=fmts.splitDiscretizations()
+                    for itmp in tmp:
+                        self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                        pass
+                    allFMTSLeavesToDisplay2+=tmp
                     pass
                 allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
                 pass
@@ -2181,12 +2246,17 @@ class MEDLoaderTest4(unittest.TestCase):
             ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
             ms=MEDFileMeshes(fname)
             fields=MEDFileFields(fname,False)
+            fields.removeFieldsWithoutAnyTimeStep()
             fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
             allFMTSLeavesToDisplay=[]
             for fields in fields_per_mesh:
                 allFMTSLeavesToDisplay2=[]
                 for fmts in fields:
-                    allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                    tmp=fmts.splitDiscretizations()
+                    for itmp in tmp:
+                        self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                        pass
+                    allFMTSLeavesToDisplay2+=tmp
                     pass
                 allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
                 pass
@@ -2338,12 +2408,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -2525,12 +2600,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -2596,12 +2676,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -2707,12 +2792,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -2777,7 +2867,11 @@ class MEDLoaderTest4(unittest.TestCase):
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -2872,12 +2966,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -3051,12 +3150,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -3247,12 +3351,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -3354,12 +3463,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -3454,12 +3568,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -3557,12 +3676,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False) # false is absolutely necessary for the test
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -3766,12 +3890,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -3876,6 +4005,7 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         self.assertEqual(fields[0].getMeshName(),"mesh")
         self.assertEqual(fields[1].getMeshName(),"mesh")
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
@@ -3885,7 +4015,11 @@ class MEDLoaderTest4(unittest.TestCase):
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -4017,12 +4151,17 @@ class MEDLoaderTest4(unittest.TestCase):
         ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
         ms=MEDFileMeshes(fname)
         fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
         fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
         allFMTSLeavesToDisplay=[]
         for fields in fields_per_mesh:
             allFMTSLeavesToDisplay2=[]
             for fmts in fields:
-                allFMTSLeavesToDisplay2+=fmts.splitDiscretizations()
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
                 pass
             allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
             pass
@@ -4123,6 +4262,720 @@ class MEDLoaderTest4(unittest.TestCase):
         vExp=DataArrayDouble([-1.1,-3.1,5,4,3,2,1,0])
         self.assertTrue(v.isEqual(vExp,1e-12))
         pass
+
+    def test29(self):
+        """ This test focused on HEXA27 cell for which the MED numbering is not equal to the VTK numbering. So here the HEXA27 cell is those in MED file documentation (reference element).
+        """
+        fname="ForMEDReader29.med"
+        coo=DataArrayDouble([[0.,2.,2.],[0.,0.,2.],[2.,0.,2.],[2.,2.,2.],[0.,2.,0.],[0.,0.,0.],[2.,0.,0.],[2.,2.,0.], [0.,1.,2.],[1.,0.,2.],[2.,1.,2.],[1.,2.,2.], [0.,1.,0.],[1.,0.,0.],[2.,1.,0.],[1.,2.,0.], [0.,2.,1.],[0.,0.,1.],[2.,0.,1.],[2.,2.,1.], [1.,1.,2.], [0.,1.,1.],[1.,0.,1.],[2.,1.,1.],[1.,2.,1.], [1.,1.,0.], [1.,1.,1.]])
+        m=MEDCouplingUMesh("mesh",3) ; m.setCoords(coo)
+        m.allocateCells()
+        # MED = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]
+        # VTK = [0,1,2,3,4,5,6,7, 8,9,10,11,12,13,14,15,16,17,18,19,24,22,21,23,20,25,26]
+        m.insertNextCell(NORM_HEXA27,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26])
+        fCell=MEDCouplingFieldDouble(ON_CELLS) ; fCell.setName("fCell")
+        arrCell=DataArrayDouble([7.]) ; arrCell.setInfoOnComponent(0,"smth") ; fCell.setArray(arrCell)
+        fCell.setMesh(m)
+        MEDLoader.WriteField(fname,fCell,True)
+        refCoo=[-1.,-1.,-1.,-1.,1.,-1.,1.,1.,-1.,1.,-1.,-1.,-1.,-1.,1.,-1.,1.,1.,1.,1.,1.,1.,-1.,1.,-1.,0.,-1.,0.,1.,-1.,1.,0.,-1.,0.,-1.,-1.,-1.,0.,1.,0.,1.,1.,1.,0.,1.,0.,-1.,1.,-1.,-1.,0.,-1.,1.,0.,1.,1.,0.,1.,-1.,0.,0.,0.,-1.,-1.,0.,0.,0.,1.,0.,1.,0.,0.,0.,-1.,0.,0.,0.,1.,0.,0.,0.]
+        weights=[0.1714677640603571,0.27434842249657115,0.1714677640603571,0.27434842249657115,0.43895747599451346,0.27434842249657115,0.1714677640603571,0.27434842249657115,0.1714677640603571,0.27434842249657115,0.43895747599451346,0.27434842249657115,0.43895747599451346,0.7023319615912209,0.43895747599451346,0.27434842249657115,0.43895747599451346,0.27434842249657115,0.1714677640603571,0.27434842249657115,0.1714677640603571,0.27434842249657115,0.43895747599451346,0.27434842249657115,0.1714677640603571,0.27434842249657115,0.1714677640603571]
+        gCoords=[-0.774596669241483,-0.774596669241483,-0.774596669241483,-0.774596669241483,-0.774596669241483,0.0,-0.774596669241483,-0.774596669241483,0.774596669241483,-0.774596669241483,0.0,-0.774596669241483,-0.774596669241483,0.0,0.0,-0.774596669241483,0.0,0.774596669241483,-0.774596669241483,0.774596669241483,-0.774596669241483,-0.774596669241483,0.774596669241483,0.0,-0.774596669241483,0.774596669241483,0.774596669241483,0.0,-0.774596669241483,-0.774596669241483,0.0,-0.774596669241483,0.0,0.0,-0.774596669241483,0.774596669241483,0.0,0.0,-0.774596669241483,0.0,0.0,0.0,0.0,0.0,0.774596669241483,0.0,0.774596669241483,-0.774596669241483,0.0,0.774596669241483,0.0,0.0,0.774596669241483,0.774596669241483,0.774596669241483,-0.774596669241483,-0.774596669241483,0.774596669241483,-0.774596669241483,0.0,0.774596669241483,-0.774596669241483,0.774596669241483,0.774596669241483,0.0,-0.774596669241483,0.774596669241483,0.0,0.0,0.774596669241483,0.0,0.774596669241483,0.774596669241483,0.774596669241483,-0.774596669241483,0.774596669241483,0.774596669241483,0.0,0.774596669241483,0.774596669241483,0.774596669241483]
+        fGauss=MEDCouplingFieldDouble(ON_GAUSS_PT) ; fGauss.setName("fGauss")
+        fGauss.setMesh(m)
+        fGauss.setGaussLocalizationOnType(NORM_HEXA27,refCoo,gCoords,weights)
+        arrGauss=DataArrayDouble(fGauss.getNumberOfTuplesExpected()) ; arrGauss.setInfoOnComponent(0,"gaussc") ; arrGauss.iota()
+        fGauss.setArray(arrGauss)
+        MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,fGauss)
+        ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
+        ms=MEDFileMeshes(fname)
+        fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
+        fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
+        allFMTSLeavesToDisplay=[]
+        for fields in fields_per_mesh:
+            allFMTSLeavesToDisplay2=[]
+            for fmts in fields:
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
+                pass
+            allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
+            pass
+        self.assertEqual(len(allFMTSLeavesToDisplay),1)
+        self.assertEqual(len(allFMTSLeavesToDisplay[0]),2)
+        allFMTSLeavesPerTimeSeries=MEDFileAnyTypeFieldMultiTS.SplitIntoCommonTimeSeries(sum(allFMTSLeavesToDisplay,[]))
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries),1)
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries[0]),2)
+        allFMTSLeavesPerCommonSupport1=MEDFileAnyTypeFieldMultiTS.SplitPerCommonSupport(allFMTSLeavesToDisplay[0],ms[ms.getMeshesNames()[0]])
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1),1)
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1[0][0]),2)
+        #
+        mst=MEDFileMeshStruct.New(ms[0])
+        #
+        fcscp=allFMTSLeavesPerCommonSupport1[0][1]
+        mml=fcscp.buildFromScratchDataSetSupport(0,fields)
+        mml2=mml.prepare()
+        self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(a0.isEqual(coo,1e-12))
+        self.assertTrue(a1.isEqual(DataArrayByte([29])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0])))
+        # the connectivity must be not a iota as declared in m.insertNextCell
+        self.assertTrue(a3.isEqual(DataArrayInt([27,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,24,22,21,23,20,25,26])))# the test is on this line to check that connectivity has been processed for HEXA27
+        self.assertTrue(a4 is None)
+        self.assertTrue(a5 is None)
+        ffCell=allFMTSLeavesPerCommonSupport1[0][0][0][0]
+        fsst=MEDFileField1TSStructItem.BuildItemFrom(ffCell,mst)
+        ffCell.loadArraysIfNecessary()
+        v=mml2.buildDataArray(fsst,fields,ffCell.getUndergroundDataArray())
+        self.assertEqual(v.getHiddenCppPointer(),ffCell.getUndergroundDataArray().getHiddenCppPointer())
+        self.assertEqual(ffCell.getName(),"fCell")
+        self.assertTrue(v.isEqual(arrCell,1e-12)) ; self.assertTrue(v.isEqualWithoutConsideringStr(DataArrayDouble([7.]),1e-12)) ; self.assertEqual(v.getInfoOnComponents(),["smth"])
+        del ffCell
+        #
+        ffGauss=allFMTSLeavesPerCommonSupport1[0][0][1][0]
+        fsst=MEDFileField1TSStructItem.BuildItemFrom(ffGauss,mst)
+        ffGauss.loadArraysIfNecessary()
+        v=mml2.buildDataArray(fsst,fields,ffGauss.getUndergroundDataArray())
+        self.assertEqual(v.getHiddenCppPointer(),ffGauss.getUndergroundDataArray().getHiddenCppPointer())
+        self.assertEqual(ffGauss.getName(),"fGauss")
+        self.assertTrue(v.isEqual(arrGauss,1e-12)) ; self.assertTrue(v.isEqualWithoutConsideringStr(DataArrayDouble(range(27)),1e-12)) ; self.assertEqual(v.getInfoOnComponents(),["gaussc"])
+        ffGauss=allFMTSLeavesPerCommonSupport1[0][0][1][0]
+        pass
+
+    def test30(self):
+        """ This test is focused on cartesian meshes. Here the cartesian mesh "CartMesh" has a field on HEXA8 (FieldOnCells) and a field on QUAD4 (FieldOnFaces).
+        So the first one (FieldOnCells) lies on a cartesian mesh whereas the second one lies on unstructured one.
+        """
+        fname="ForMEDReader30.med"
+        c=MEDCouplingCMesh()
+        arrX=DataArrayDouble(3) ; arrX.iota()
+        arrY=DataArrayDouble(4) ; arrY.iota()
+        arrZ=DataArrayDouble(5) ; arrZ.iota()
+        c.setCoords(arrX,arrY,arrZ)
+        c.setName("CartMesh")
+        cc=MEDFileCMesh()
+        cc.setMesh(c)
+        tmpFacesMesh=c.build1SGTSubLevelMesh()
+        famIdFaces=DataArrayInt(98) ; famIdFaces[:36]=-1 ; famIdFaces[36:68]=-2 ; famIdFaces[68:]=-3
+        famIdCells=DataArrayInt(24) ; famIdCells[:]=0
+        #cc.setFamilyFieldArr(0,famIdCells)
+        #cc.setFamilyFieldArr(-1,famIdFaces)
+        cc.addFamily("FacesX",-1) ; cc.addFamily("FacesY",-2) ; cc.addFamily("FacesZ",-3)
+        cc.setFamiliesOnGroup("FacesX1",["FacesX"])
+        cc.setFamiliesOnGroup("FacesY1",["FacesY"])
+        cc.setFamiliesOnGroup("FacesZ1",["FacesZ"])
+        #
+        fmts0=MEDFileFieldMultiTS()
+        fmts1=MEDFileFieldMultiTS()
+        for i in xrange(30):
+            f1ts=MEDFileField1TS()
+            fFaces=MEDCouplingFieldDouble(ON_CELLS) ; fFaces.setName("FieldOnFaces")
+            arr=DataArrayDouble(98) ; arr.iota() ; arr[i]=100.
+            fFaces.setArray(arr)
+            fFaces.setTime(float(i)+0.1,i,-1)
+            fFaces.setMesh(tmpFacesMesh)
+            f1ts.setFieldNoProfileSBT(fFaces)
+            fmts0.pushBackTimeStep(f1ts)
+            #
+            f1ts=MEDFileField1TS()
+            fCells=MEDCouplingFieldDouble(ON_CELLS) ; fCells.setName("FieldOnCells")
+            arr=DataArrayDouble(24) ; arr.iota() ; arr[i%24]=30.
+            fCells.setArray(arr)
+            fCells.setTime(float(i)+0.1,i,-1)
+            fCells.setMesh(c)
+            f1ts.setFieldNoProfileSBT(fCells)
+            fmts1.pushBackTimeStep(f1ts)
+            pass
+        fs=MEDFileFields()
+        fs.pushField(fmts0)
+        fs.pushField(fmts1)
+        cc.write(fname,2)
+        fs.write(fname,0)
+        ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
+        ms=MEDFileMeshes(fname)
+        fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
+        fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
+        allFMTSLeavesToDisplay=[]
+        for fields in fields_per_mesh:
+            allFMTSLeavesToDisplay2=[]
+            for fmts in fields:
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
+                pass
+            allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
+            pass
+        self.assertEqual(len(allFMTSLeavesToDisplay),1)
+        self.assertEqual(len(allFMTSLeavesToDisplay[0]),2)
+        allFMTSLeavesPerTimeSeries=MEDFileAnyTypeFieldMultiTS.SplitIntoCommonTimeSeries(sum(allFMTSLeavesToDisplay,[]))
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries),1)
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries[0]),2)
+        allFMTSLeavesPerCommonSupport1=MEDFileAnyTypeFieldMultiTS.SplitPerCommonSupport(allFMTSLeavesToDisplay[0],ms[ms.getMeshesNames()[0]])
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1),2)
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1[0][0]),1)
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1[1][0]),1)
+        #
+        mst=MEDFileMeshStruct.New(ms[0])
+        #
+        fcscp=allFMTSLeavesPerCommonSupport1[0][1]
+        mml=fcscp.buildFromScratchDataSetSupport(0,fields)
+        mml2=mml.prepare()
+        self.assertTrue(isinstance(mml2,MEDCMeshMultiLev)) # here CMesh is important
+        (a,b,c),d=mml2.buildVTUArrays()
+        self.assertTrue(d)#d is True because the a,b and c are directly those in the internal data structure
+        self.assertTrue(a.isEqual(arrX,1e-12))
+        self.assertTrue(b.isEqual(arrY,1e-12))
+        self.assertTrue(c.isEqual(arrZ,1e-12))
+        for i in xrange(30):
+            ffCell=allFMTSLeavesPerCommonSupport1[0][0][0][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(ffCell,mst)
+            ffCell.loadArraysIfNecessary()
+            v=mml2.buildDataArray(fsst,fields,ffCell.getUndergroundDataArray())
+            self.assertEqual(v.getHiddenCppPointer(),ffCell.getUndergroundDataArray().getHiddenCppPointer())
+            myarr=DataArrayDouble(24) ; myarr.iota() ; myarr[i%24]=30.
+            self.assertEqual(ffCell.getName(),"FieldOnCells")
+            self.assertTrue(v.isEqual(myarr,1e-12))
+            pass
+        #
+        fcscp=allFMTSLeavesPerCommonSupport1[1][1]
+        mml=fcscp.buildFromScratchDataSetSupport(0,fields)
+        mml2=mml.prepare()
+        self.assertTrue(isinstance(mml2,MEDUMeshMultiLev)) # here UMesh is important
+        ref=ms[0].getImplicitFaceMesh().getCoords().getHiddenCppPointer()
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertEqual(ref,a0.getHiddenCppPointer())
+        self.assertTrue(ncc)
+        self.assertTrue(a1.isEqual(DataArrayByte([9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125,130,135,140,145,150,155,160,165,170,175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,255,260,265,270,275,280,285,290,295,300,305,310,315,320,325,330,335,340,345,350,355,360,365,370,375,380,385,390,395,400,405,410,415,420,425,430,435,440,445,450,455,460,465,470,475,480,485])))
+        self.assertTrue(a3.isEqual(DataArrayInt([4,0,12,15,3,4,12,24,27,15,4,24,36,39,27,4,36,48,51,39,4,3,15,18,6,4,15,27,30,18,4,27,39,42,30,4,39,51,54,42,4,6,18,21,9,4,18,30,33,21,4,30,42,45,33,4,42,54,57,45,4,1,13,16,4,4,13,25,28,16,4,25,37,40,28,4,37,49,52,40,4,4,16,19,7,4,16,28,31,19,4,28,40,43,31,4,40,52,55,43,4,7,19,22,10,4,19,31,34,22,4,31,43,46,34,4,43,55,58,46,4,2,14,17,5,4,14,26,29,17,4,26,38,41,29,4,38,50,53,41,4,5,17,20,8,4,17,29,32,20,4,29,41,44,32,4,41,53,56,44,4,8,20,23,11,4,20,32,35,23,4,32,44,47,35,4,44,56,59,47,4,0,12,13,1,4,12,24,25,13,4,24,36,37,25,4,36,48,49,37,4,1,13,14,2,4,13,25,26,14,4,25,37,38,26,4,37,49,50,38,4,3,15,16,4,4,15,27,28,16,4,27,39,40,28,4,39,51,52,40,4,4,16,17,5,4,16,28,29,17,4,28,40,41,29,4,40,52,53,41,4,6,18,19,7,4,18,30,31,19,4,30,42,43,31,4,42,54,55,43,4,7,19,20,8,4,19,31,32,20,4,31,43,44,32,4,43,55,56,44,4,9,21,22,10,4,21,33,34,22,4,33,45,46,34,4,45,57,58,46,4,10,22,23,11,4,22,34,35,23,4,34,46,47,35,4,46,58,59,47,4,0,1,4,3,4,3,4,7,6,4,6,7,10,9,4,1,2,5,4,4,4,5,8,7,4,7,8,11,10,4,12,13,16,15,4,15,16,19,18,4,18,19,22,21,4,13,14,17,16,4,16,17,20,19,4,19,20,23,22,4,24,25,28,27,4,27,28,31,30,4,30,31,34,33,4,25,26,29,28,4,28,29,32,31,4,31,32,35,34,4,36,37,40,39,4,39,40,43,42,4,42,43,46,45,4,37,38,41,40,4,40,41,44,43,4,43,44,47,46,4,48,49,52,51,4,51,52,55,54,4,54,55,58,57,4,49,50,53,52,4,52,53,56,55,4,55,56,59,58])))
+        self.assertTrue(a4 is None)
+        self.assertTrue(a5 is None)
+        for i in xrange(30):
+            ffCell=allFMTSLeavesPerCommonSupport1[1][0][0][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(ffCell,mst)
+            ffCell.loadArraysIfNecessary()
+            v=mml2.buildDataArray(fsst,fields,ffCell.getUndergroundDataArray())
+            self.assertEqual(v.getHiddenCppPointer(),ffCell.getUndergroundDataArray().getHiddenCppPointer())
+            myarr=DataArrayDouble(98) ; myarr.iota() ; myarr[i]=100.
+            self.assertEqual(ffCell.getName(),"FieldOnFaces")
+            self.assertTrue(v.isEqual(myarr,1e-12))
+            pass
+        pass
+
+    def test31(self):
+        """non regression test of EDF 7972"""
+        fname="ForMEDReader31.med"
+        c=MEDCouplingCMesh()
+        arrX=DataArrayDouble(3) ; arrX.iota()
+        arrY=DataArrayDouble(4) ; arrY.iota()
+        arrZ=DataArrayDouble(5) ; arrZ.iota()
+        c.setCoords(arrX,arrY,arrZ)
+        c.setName("CartMesh")
+        cc=MEDFileCMesh()
+        cc.setMesh(c)
+        famIdCells=DataArrayInt(24) ; famIdCells[:]=0
+        cc.setFamilyFieldArr(0,famIdCells)
+        #cc.setFamilyFieldArr(-1,famIdFaces)
+        cc.addFamily("FacesX",-1) ; cc.addFamily("FacesY",-2) ; cc.addFamily("FacesZ",-3)
+        cc.setFamiliesOnGroup("FacesX1",["FacesX"])
+        cc.setFamiliesOnGroup("FacesY1",["FacesY"])
+        cc.setFamiliesOnGroup("FacesZ1",["FacesZ"])
+        fmts0=MEDFileFieldMultiTS()
+        fmts1=MEDFileFieldMultiTS()
+        pfl=DataArrayInt(11) ; pfl.iota() ; pfl.setName("PflOnHECA8")
+        for i in xrange(30):
+            f1ts=MEDFileField1TS()
+            fFaces=MEDCouplingFieldDouble(ON_CELLS) ; fFaces.setName("FieldOnCells")
+            arr=DataArrayDouble(11) ; arr.iota() ; arr[i%11]=100.
+            fFaces.setArray(arr)
+            fFaces.setTime(float(i)+0.1,i,-1)
+            fFaces.setMesh(c.buildUnstructured()[:11])
+            f1ts.setFieldProfile(fFaces,cc,0,pfl)# here, a test is done to check that "NORM_HEXA8" string is not 30 times appended at the end of pfl name.
+            self.assertEqual("PflOnHECA8",pfl.getName())
+            fmts0.pushBackTimeStep(f1ts)
+            pass
+        fs=MEDFileFields()
+        fs.pushField(fmts0)
+        cc.write(fname,2)
+        fs.write(fname,0)
+        ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
+        ms=MEDFileMeshes(fname)
+        fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
+        fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
+        allFMTSLeavesToDisplay=[]
+        for fields in fields_per_mesh:
+            allFMTSLeavesToDisplay2=[]
+            for fmts in fields:
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
+                pass
+            allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
+            pass
+        self.assertEqual(len(allFMTSLeavesToDisplay),1)
+        self.assertEqual(len(allFMTSLeavesToDisplay[0]),1)
+        allFMTSLeavesPerTimeSeries=MEDFileAnyTypeFieldMultiTS.SplitIntoCommonTimeSeries(sum(allFMTSLeavesToDisplay,[]))
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries),1)
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries[0]),1)
+        allFMTSLeavesPerCommonSupport1=MEDFileAnyTypeFieldMultiTS.SplitPerCommonSupport(allFMTSLeavesToDisplay[0],ms[ms.getMeshesNames()[0]])
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1),1)
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1[0][0]),1)
+        #
+        mst=MEDFileMeshStruct.New(ms[0])
+        #
+        fcscp=allFMTSLeavesPerCommonSupport1[0][1]
+        mml=fcscp.buildFromScratchDataSetSupport(0,fields)
+        mml2=mml.prepare()
+        self.assertTrue(isinstance(mml2,MEDUMeshMultiLev)) # here UMesh is important
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc)# here ncc=False because the coordinates are not in ms neither in children. This is the most important line in the test.
+        self.assertTrue(a0.isEqual(DataArrayDouble([0.,0.,0.,1.,0.,0.,2.,0.,0.,0.,1.,0.,1.,1.,0.,2.,1.,0.,0.,2.,0.,1.,2.,0.,2.,2.,0.,0.,3.,0.,1.,3.,0.,2.,3.,0.,0.,0.,1.,1.,0.,1.,2.,0.,1.,0.,1.,1.,1.,1.,1.,2.,1.,1.,0.,2.,1.,1.,2.,1.,2.,2.,1.,0.,3.,1.,1.,3.,1.,2.,3.,1.,0.,0.,2.,1.,0.,2.,2.,0.,2.,0.,1.,2.,1.,1.,2.,2.,1.,2.,0.,2.,2.,1.,2.,2.,2.,2.,2.,0.,3.,2.,1.,3.,2.,2.,3.,2.,0.,0.,3.,1.,0.,3.,2.,0.,3.,0.,1.,3.,1.,1.,3.,2.,1.,3.,0.,2.,3.,1.,2.,3.,2.,2.,3.,0.,3.,3.,1.,3.,3.,2.,3.,3.,0.,0.,4.,1.,0.,4.,2.,0.,4.,0.,1.,4.,1.,1.,4.,2.,1.,4.,0.,2.,4.,1.,2.,4.,2.,2.,4.,0.,3.,4.,1.,3.,4.,2.,3.,4.],60,3),1e-12))
+        self.assertTrue(a1.isEqual(DataArrayByte([12,12,12,12,12,12,12,12,12,12,12])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,9,18,27,36,45,54,63,72,81,90])))
+        self.assertTrue(a3.isEqual(DataArrayInt([8,1,0,3,4,13,12,15,16,8,2,1,4,5,14,13,16,17,8,4,3,6,7,16,15,18,19,8,5,4,7,8,17,16,19,20,8,7,6,9,10,19,18,21,22,8,8,7,10,11,20,19,22,23,8,13,12,15,16,25,24,27,28,8,14,13,16,17,26,25,28,29,8,16,15,18,19,28,27,30,31,8,17,16,19,20,29,28,31,32,8,19,18,21,22,31,30,33,34])))
+        self.assertTrue(a4 is None)
+        self.assertTrue(a5 is None)
+        for i in xrange(30):
+            ffCell=allFMTSLeavesPerCommonSupport1[0][0][0][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(ffCell,mst)
+            ffCell.loadArraysIfNecessary()
+            v=mml2.buildDataArray(fsst,fields,ffCell.getUndergroundDataArray())
+            # self.assertEqual(v.getHiddenCppPointer(),ffCell.getUndergroundDataArray().getHiddenCppPointer()) # to be improved... maybe this line could be true
+            myarr=DataArrayDouble(11) ; myarr.iota() ; myarr[i%11]=100.
+            self.assertEqual(ffCell.getName(),"FieldOnCells")
+            self.assertTrue(v.isEqual(myarr,1e-12))
+            pass
+        pass
+
+    def test32(self):
+        """ This test is close to test30 except that here the profiles on dim-1 of structured mesh is considered here."""
+        fname="ForMEDReader32.med"
+        c=MEDCouplingCMesh()
+        arrX=DataArrayDouble(3) ; arrX.iota()
+        arrY=DataArrayDouble(4) ; arrY.iota()
+        arrZ=DataArrayDouble(5) ; arrZ.iota()
+        c.setCoords(arrX,arrY,arrZ)
+        c.setName("CartMesh")
+        cc=MEDFileCMesh()
+        cc.setMesh(c)
+        tmpFacesMesh=c.build1SGTSubLevelMesh()
+        famIdFaces=DataArrayInt(98) ; famIdFaces[:36]=-1 ; famIdFaces[36:68]=-2 ; famIdFaces[68:]=-3
+        famIdCells=DataArrayInt(24) ; famIdCells[:]=0
+        cc.setFamilyFieldArr(0,famIdCells)
+        #cc.setFamilyFieldArr(-1,famIdFaces)
+        cc.addFamily("FacesX",-1) ; cc.addFamily("FacesY",-2) ; cc.addFamily("FacesZ",-3)
+        cc.setFamiliesOnGroup("FacesX1",["FacesX"])
+        cc.setFamiliesOnGroup("FacesY1",["FacesY"])
+        cc.setFamiliesOnGroup("FacesZ1",["FacesZ"])
+        fmts0=MEDFileFieldMultiTS()
+        fmts1=MEDFileFieldMultiTS()
+        pfl=DataArrayInt(31) ; pfl.iota() ; pfl.setName("PflOnQUAD4")
+        for i in xrange(30):
+            f1ts=MEDFileField1TS()
+            fFaces=MEDCouplingFieldDouble(ON_CELLS) ; fFaces.setName("FieldOnFaces")
+            arr=DataArrayDouble(31) ; arr.iota() ; arr[i]=100.
+            fFaces.setArray(arr)
+            fFaces.setTime(float(i)+0.1,i,-1)
+            fFaces.setMesh(tmpFacesMesh[:31])
+            f1ts.setFieldProfile(fFaces,cc,-1,pfl)# here, a test is done to check that "NORM_QUAD4" string is not 30 times appended at the end of pfl name.
+            self.assertEqual("PflOnQUAD4",pfl.getName())
+            fmts0.pushBackTimeStep(f1ts)
+            #
+            f1ts=MEDFileField1TS()
+            fCells=MEDCouplingFieldDouble(ON_CELLS) ; fCells.setName("FieldOnCells")
+            arr=DataArrayDouble(24) ; arr.iota() ; arr[i%24]=30.
+            fCells.setArray(arr)
+            fCells.setTime(float(i)+0.1,i,-1)
+            fCells.setMesh(c)
+            f1ts.setFieldNoProfileSBT(fCells)
+            fmts1.pushBackTimeStep(f1ts)
+            pass
+        fs=MEDFileFields()
+        fs.pushField(fmts0)
+        fs.pushField(fmts1)
+        cc.write(fname,2)
+        fs.write(fname,0)
+        ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
+        ms=MEDFileMeshes(fname)
+        fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
+        fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
+        allFMTSLeavesToDisplay=[]
+        for fields in fields_per_mesh:
+            allFMTSLeavesToDisplay2=[]
+            for fmts in fields:
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
+                pass
+            allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
+            pass
+        self.assertEqual(len(allFMTSLeavesToDisplay),1)
+        self.assertEqual(len(allFMTSLeavesToDisplay[0]),2)
+        allFMTSLeavesPerTimeSeries=MEDFileAnyTypeFieldMultiTS.SplitIntoCommonTimeSeries(sum(allFMTSLeavesToDisplay,[]))
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries),1)
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries[0]),2)
+        allFMTSLeavesPerCommonSupport1=MEDFileAnyTypeFieldMultiTS.SplitPerCommonSupport(allFMTSLeavesToDisplay[0],ms[ms.getMeshesNames()[0]])
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1),2)
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1[0][0]),1)
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1[1][0]),1)
+        #
+        mst=MEDFileMeshStruct.New(ms[0])
+        #
+        fcscp=allFMTSLeavesPerCommonSupport1[0][1]
+        mml=fcscp.buildFromScratchDataSetSupport(0,fields)
+        mml2=mml.prepare()
+        self.assertTrue(isinstance(mml2,MEDCMeshMultiLev)) # here CMesh is important
+        (a,b,c),d=mml2.buildVTUArrays()
+        self.assertTrue(d)#d is True because the a,b and c are directly those in the internal data structure
+        self.assertTrue(a.isEqual(arrX,1e-12))
+        self.assertTrue(b.isEqual(arrY,1e-12))
+        self.assertTrue(c.isEqual(arrZ,1e-12))
+        for i in xrange(30):
+            ffCell=allFMTSLeavesPerCommonSupport1[0][0][0][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(ffCell,mst)
+            ffCell.loadArraysIfNecessary()
+            v=mml2.buildDataArray(fsst,fields,ffCell.getUndergroundDataArray())
+            self.assertEqual(v.getHiddenCppPointer(),ffCell.getUndergroundDataArray().getHiddenCppPointer())
+            myarr=DataArrayDouble(24) ; myarr.iota() ; myarr[i%24]=30.
+            self.assertEqual(ffCell.getName(),"FieldOnCells")
+            self.assertTrue(v.isEqual(myarr,1e-12))
+            pass
+        #
+        fcscp=allFMTSLeavesPerCommonSupport1[1][1]
+        mml=fcscp.buildFromScratchDataSetSupport(0,fields)
+        mml2=mml.prepare()
+        self.assertTrue(isinstance(mml2,MEDUMeshMultiLev)) # here UMesh is important
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(ncc)# True because, the coords are computed by the implicit unstructured level -1 structured mesh
+        self.assertTrue(a0.isEqual(DataArrayDouble([0.,0.,0.,1.,0.,0.,2.,0.,0.,0.,1.,0.,1.,1.,0.,2.,1.,0.,0.,2.,0.,1.,2.,0.,2.,2.,0.,0.,3.,0.,1.,3.,0.,2.,3.,0.,0.,0.,1.,1.,0.,1.,2.,0.,1.,0.,1.,1.,1.,1.,1.,2.,1.,1.,0.,2.,1.,1.,2.,1.,2.,2.,1.,0.,3.,1.,1.,3.,1.,2.,3.,1.,0.,0.,2.,1.,0.,2.,2.,0.,2.,0.,1.,2.,1.,1.,2.,2.,1.,2.,0.,2.,2.,1.,2.,2.,2.,2.,2.,0.,3.,2.,1.,3.,2.,2.,3.,2.,0.,0.,3.,1.,0.,3.,2.,0.,3.,0.,1.,3.,1.,1.,3.,2.,1.,3.,0.,2.,3.,1.,2.,3.,2.,2.,3.,0.,3.,3.,1.,3.,3.,2.,3.,3.,0.,0.,4.,1.,0.,4.,2.,0.,4.,0.,1.,4.,1.,1.,4.,2.,1.,4.,0.,2.,4.,1.,2.,4.,2.,2.,4.,0.,3.,4.,1.,3.,4.,2.,3.,4.],60,3),1e-12))
+        self.assertTrue(a1.isEqual(DataArrayByte([9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125,130,135,140,145,150])))
+        self.assertTrue(a3.isEqual(DataArrayInt([4,0,12,15,3,4,12,24,27,15,4,24,36,39,27,4,36,48,51,39,4,3,15,18,6,4,15,27,30,18,4,27,39,42,30,4,39,51,54,42,4,6,18,21,9,4,18,30,33,21,4,30,42,45,33,4,42,54,57,45,4,1,13,16,4,4,13,25,28,16,4,25,37,40,28,4,37,49,52,40,4,4,16,19,7,4,16,28,31,19,4,28,40,43,31,4,40,52,55,43,4,7,19,22,10,4,19,31,34,22,4,31,43,46,34,4,43,55,58,46,4,2,14,17,5,4,14,26,29,17,4,26,38,41,29,4,38,50,53,41,4,5,17,20,8,4,17,29,32,20,4,29,41,44,32])))
+        self.assertTrue(a4 is None)
+        self.assertTrue(a5 is None)
+        a6,a7=mml2.retrieveFamilyIdsOnCells()
+        self.assertTrue(a6 is None)
+        self.assertTrue(a7)
+        for i in xrange(30):
+            ffCell=allFMTSLeavesPerCommonSupport1[1][0][0][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(ffCell,mst)
+            ffCell.loadArraysIfNecessary()
+            v=mml2.buildDataArray(fsst,fields,ffCell.getUndergroundDataArray())
+            self.assertEqual(v.getHiddenCppPointer(),ffCell.getUndergroundDataArray().getHiddenCppPointer())
+            myarr=DataArrayDouble(31) ; myarr.iota() ; myarr[i]=100.
+            self.assertEqual(ffCell.getName(),"FieldOnFaces")
+            self.assertTrue(v.isEqual(myarr,1e-12))
+            pass
+        pass
+    
+    def test33(self):
+        """Non regression test concerning polygons. Thanks Adrien. This bug can't be shown by simply reading an displaying a MED file containing only polygons. A filter must be applied on it to show it. The a2 array was responsible of that bug."""
+        fname="ForMEDReader33.med"
+        fieldName="ACellField"
+        coo=DataArrayDouble([(5.5,0.5),(5.5,-0.5),(6.5,0.5),(6.5,-0.5),(6.5,1.5),(7.5,0.5),(7.5,-0.5),(7.5,1.5),(7.5,2.5),(8.5,0.5),(8.5,-0.5),(8.5,1.5),(8.5,2.5),(8.5,3.5),(8.55,0.5),(8.55,-0.5),(8.55,1.5),(8.55,2.5),(8.55,3.5)])
+        m=MEDCouplingUMesh("mesh",2)
+        m.setCoords(coo)
+        m.allocateCells()
+        for i,c in enumerate([(1,0,2,3),(3,2,5,6),(2,4,7,5),(6,5,9,10),(5,7,11,9),(7,8,12,11),(10,9,14,15),(9,11,16,14),(11,12,17,16),(12,13,18,17)]):
+            if i<6:
+                typ=NORM_QUAD4
+                pass
+            else:
+                typ=NORM_POLYGON
+                pass
+            m.insertNextCell(typ,c)
+            pass
+        mm=MEDFileUMesh()
+        mm.setMeshAtLevel(0,m)
+        mm.write(fname,2)
+        for i in xrange(15):
+            fCell0=MEDCouplingFieldDouble(ON_CELLS) ; fCell0.setTime(float(i)+0.1,i,0)
+            fCell0.setName(fieldName) ; fCell0.setMesh(m)
+            arr=DataArrayDouble(m.getNumberOfCells()) ; arr.iota(0) ; arr[i%10]=100.
+            fCell0.setArray(arr) ; arr.setInfoOnComponents(["Comp1 [m]"])
+            fCell0.checkCoherency()
+            MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,fCell0)
+            pass
+        ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
+        ms=MEDFileMeshes(fname)
+        fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
+        fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
+        allFMTSLeavesToDisplay=[]
+        for fields in fields_per_mesh:
+            allFMTSLeavesToDisplay2=[]
+            for fmts in fields:
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    self.assertTrue(not itmp.presenceOfMultiDiscPerGeoType())
+                    pass
+                allFMTSLeavesToDisplay2+=tmp
+                pass
+            allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
+            pass
+        self.assertEqual(len(allFMTSLeavesToDisplay),1)
+        self.assertEqual(len(allFMTSLeavesToDisplay[0]),1)
+        allFMTSLeavesPerTimeSeries=MEDFileAnyTypeFieldMultiTS.SplitIntoCommonTimeSeries(sum(allFMTSLeavesToDisplay,[]))
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries),1)
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries[0]),1)
+        allFMTSLeavesPerCommonSupport1=MEDFileAnyTypeFieldMultiTS.SplitPerCommonSupport(allFMTSLeavesToDisplay[0],ms[ms.getMeshesNames()[0]])
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1),1)
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport1[0][0]),1)
+        #
+        mst=MEDFileMeshStruct.New(ms[0])
+        #
+        fcscp=allFMTSLeavesPerCommonSupport1[0][1]
+        mml=fcscp.buildFromScratchDataSetSupport(0,fields)
+        mml2=mml.prepare()
+        self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc)# false beacause 2D in MED file
+        self.assertTrue(a0.isEqual(DataArrayDouble([(5.5,0.5,0),(5.5,-0.5,0),(6.5,0.5,0),(6.5,-0.5,0),(6.5,1.5,0),(7.5,0.5,0),(7.5,-0.5,0),(7.5,1.5,0),(7.5,2.5,0),(8.5,0.5,0),(8.5,-0.5,0),(8.5,1.5,0),(8.5,2.5,0),(8.5,3.5,0),(8.55,0.5,0),(8.55,-0.5,0),(8.55,1.5,0),(8.55,2.5,0),(8.55,3.5,0)]),1e-12))
+        self.assertTrue(a1.isEqual(DataArrayByte([9,9,9,9,9,9,7,7,7,7])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,5,10,15,20,25,30,35,40,45])))# the bug was here.
+        self.assertTrue(a3.isEqual(DataArrayInt([4,1,0,2,3,4,3,2,5,6,4,2,4,7,5,4,6,5,9,10,4,5,7,11,9,4,7,8,12,11,4,10,9,14,15,4,9,11,16,14,4,11,12,17,16,4,12,13,18,17])))
+        self.assertTrue(a4 is None)
+        self.assertTrue(a5 is None)
+        for i in xrange(15):
+            ffCell=allFMTSLeavesPerCommonSupport1[0][0][0][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(ffCell,mst)
+            ffCell.loadArraysIfNecessary()
+            v=mml2.buildDataArray(fsst,fields,ffCell.getUndergroundDataArray())
+            self.assertEqual(v.getHiddenCppPointer(),ffCell.getUndergroundDataArray().getHiddenCppPointer())
+            myarr=DataArrayDouble(10) ; myarr.iota() ; myarr[i%10]=100. ; myarr.setInfoOnComponent(0,"Comp1 [m]")
+            self.assertEqual(ffCell.getName(),fieldName)
+            self.assertTrue(v.isEqual(myarr,1e-12))
+            pass
+        pass
+
+    def test34(self):
+        """ This test is the thirs ultimate test (base on test12) for the profiles with gauss points.
+        This test highlight the hidden imp linked to bug #8655.
+        This test is close to test11 but here a 2nd field on cells without profile. So here the mesh is expected to be the same than m.
+        """
+        fname="ForMEDReader34.med"
+        m=MEDCouplingCMesh("mesh")
+        arr=DataArrayDouble(5) ; arr.iota()
+        m.setCoords(arr,arr)
+        m=m.buildUnstructured() ; m.getCoords().setInfoOnComponents(["XX [m]","YYY [km]"])
+        mm=MEDFileUMesh() ; mm.setMeshes([m])
+        #
+        fieldName0="zeField0"
+        fieldName1="zeField1"
+        fs0=MEDFileFieldMultiTS() ; fs1=MEDFileFieldMultiTS()
+        for i in xrange(5):
+            f=MEDFileField1TS()
+            fNode=MEDCouplingFieldDouble(ON_GAUSS_PT) ; fNode.setTime(float(i),i,0)
+            fNode.setName(fieldName0) ; fNode.setMesh(m)
+            fNode.setGaussLocalizationOnCells([0,2,3,4,7,15],[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[0.5,0.5,0.7,0.7],[0.8,0.2])
+            fNode.setGaussLocalizationOnCells([1,5,8,9],[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[0.5,0.5,0.7,0.7,0.1,0.1,0.2,0.2,0.3,0.3],[0.8,0.05,0.1,0.04,0.01])
+            fNode.setGaussLocalizationOnCells([6,10,13],[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[0.5,0.5,0.7,0.7,0.1,0.1,0.2,0.2],[0.8,0.05,0.1,0.04])
+            fNode.setGaussLocalizationOnCells([11,12,14],[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[0.5,0.5,0.7,0.7,0.1,0.1,0.2,0.2,0.3,0.3,0.4,0.4,0.8,0.8],[0.8,0.05,0.1,0.01,0.02,0.005,0.005])
+            arr=DataArrayDouble(2*(2*6+5*4+4*3+7*3)) ; arr.iota(0+1000*i) ; arr.rearrange(2)
+            fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_0 [m]","Com2_0 [s^2]"]) ; fNode.checkCoherency()
+            f.setFieldNoProfileSBT(fNode)
+            fs0.pushBackTimeStep(f)
+            #
+            f=MEDFileField1TS()
+            fNode=MEDCouplingFieldDouble(ON_CELLS) ; fNode.setTime(float(i),i,0)
+            fNode.setName(fieldName1) ; fNode.setMesh(m)
+            arr=DataArrayDouble(2*16) ; arr.iota(300+1000*i) ; arr.rearrange(2)
+            fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_1 [m]","Com2_1 [s^2]"]) ; fNode.checkCoherency()
+            f.setFieldNoProfileSBT(fNode)
+            fs1.pushBackTimeStep(f)
+            pass
+        mm.write(fname,2)
+        fs0.write(fname,0) ; fs1.write(fname,0)
+        a0Exp=mm.getCoords().deepCpy()
+        del m,mm,fs0,fs1,f,fNode
+        ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
+        ms=MEDFileMeshes(fname)
+        fields=MEDFileFields(fname,False)
+        fields.removeFieldsWithoutAnyTimeStep()
+        fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
+        allFMTSLeavesToDisplay=[]
+        for fields in fields_per_mesh:
+            allFMTSLeavesToDisplay2=[]
+            for fmts in fields:
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    if itmp.presenceOfMultiDiscPerGeoType():
+                        tmp2=itmp.splitMultiDiscrPerGeoTypes()
+                        for iii,itmp2 in enumerate(tmp2):
+                            name="%s_%i"%(itmp2.getName(),iii)
+                            itmp2.setName(name)
+                            allFMTSLeavesToDisplay2.append(itmp2)
+                            pass
+                        pass
+                    else:
+                        allFMTSLeavesToDisplay2.append(itmp)
+                        pass
+                pass
+            allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
+            pass
+        # Here 2 MED fields in input and at the end 5 ! 1+4 ! 4 fields have been built from zeField0 due to subspliting per dis / per geo type
+        self.assertEqual(len(allFMTSLeavesToDisplay),1)
+        self.assertEqual(len(allFMTSLeavesToDisplay[0]),5)
+        allFMTSLeavesPerTimeSeries=MEDFileAnyTypeFieldMultiTS.SplitIntoCommonTimeSeries(sum(allFMTSLeavesToDisplay,[]))
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries),1) # one time serie here : because the 2 fields are defined on the same time steps
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries[0]),5)
+        allFMTSLeavesPerCommonSupport=MEDFileAnyTypeFieldMultiTS.SplitPerCommonSupport(allFMTSLeavesPerTimeSeries[0],ms[ms.getMeshesNames()[0]])
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport),5)
+        for i in xrange(5):
+            self.assertEqual(len(allFMTSLeavesPerCommonSupport[i][0]),1)
+        #
+        mst=MEDFileMeshStruct.New(ms[0])
+        #
+        fcscp=allFMTSLeavesPerCommonSupport[4][1]
+        mml=fcscp.buildFromScratchDataSetSupport(0,fields)
+        mml2=mml.prepare()
+        self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(not ncc)
+        self.assertTrue(a0.isEqual(a0Exp.changeNbOfComponents(3,0.),1e-12))
+        self.assertTrue(a1.isEqual(DataArrayByte([9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75])))
+        self.assertTrue(a3.isEqual(DataArrayInt([4,1,0,5,6,4,2,1,6,7,4,3,2,7,8,4,4,3,8,9,4,6,5,10,11,4,7,6,11,12,4,8,7,12,13,4,9,8,13,14,4,11,10,15,16,4,12,11,16,17,4,13,12,17,18,4,14,13,18,19,4,16,15,20,21,4,17,16,21,22,4,18,17,22,23,4,19,18,23,24]))) # <- here the mesh is NOT renumbered : the mesh is equal to m
+        self.assertTrue(a4 is None)
+        self.assertTrue(a5 is None)
+        for i in xrange(1,5):
+            self.assertTrue((fcscp.isDataSetSupportEqualToThePreviousOne(i,fields)))
+            pass
+        for i in xrange(5):
+            f=allFMTSLeavesPerCommonSupport[0][0][0][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst)
+            f.loadArraysIfNecessary()
+            v=mml.buildDataArray(fsst,fields,f.getUndergroundDataArray())
+            self.assertEqual(f.getName(),fieldName0)
+            vExp=DataArrayDouble([(0.,1.),(2.,3.),(14.,15.),(16.,17.),(18.,19.),(20.,21.),(22.,23.),(24.,25.),(44.,45.),(46.,47.),(126.,127.),(128.,129.)])
+            vExp.setInfoOnComponents(['Comp1_0 [m]','Com2_0 [s^2]'])
+            vExp+=i*1000
+            self.assertTrue(v.isEqual(vExp,1e-12))
+            #
+            f=allFMTSLeavesPerCommonSupport[1][0][0][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst)
+            f.loadArraysIfNecessary()
+            v=mml.buildDataArray(fsst,fields,f.getUndergroundDataArray())
+            self.assertEqual(f.getName(),fieldName0)
+            vExp=DataArrayDouble([(4.,5.),(6.,7.),(8.,9.),(10.,11.),(12.,13.),(26.,27.),(28.,29.),(30.,31.),(32.,33.),(34.,35.),(48.,49.),(50.,51.),(52.,53.),(54.,55.),(56.,57.),(58.,59.),(60.,61.),(62.,63.),(64.,65.),(66.,67.)])
+            vExp.setInfoOnComponents(['Comp1_0 [m]','Com2_0 [s^2]'])
+            vExp+=i*1000
+            self.assertTrue(v.isEqual(vExp,1e-12))
+            #
+            f=allFMTSLeavesPerCommonSupport[2][0][0][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst)
+            f.loadArraysIfNecessary()
+            v=mml.buildDataArray(fsst,fields,f.getUndergroundDataArray())
+            self.assertEqual(f.getName(),fieldName0)
+            vExp=DataArrayDouble([(36.,37.),(38.,39.),(40.,41.),(42.,43.),(68.,69.),(70.,71.),(72.,73.),(74.,75.),(104.,105.),(106.,107.),(108.,109.),(110.,111.)])
+            vExp.setInfoOnComponents(['Comp1_0 [m]','Com2_0 [s^2]'])
+            vExp+=i*1000
+            self.assertTrue(v.isEqual(vExp,1e-12))
+            #
+            f=allFMTSLeavesPerCommonSupport[3][0][0][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst)
+            f.loadArraysIfNecessary()
+            v=mml.buildDataArray(fsst,fields,f.getUndergroundDataArray())
+            self.assertEqual(f.getName(),fieldName0)
+            vExp=DataArrayDouble([(76,77),(78,79),(80,81),(82,83),(84,85),(86,87),(88,89),(90,91),(92,93),(94,95),(96,97),(98,99),(100,101),(102,103),(112,113),(114,115),(116,117),(118,119),(120,121),(122,123),(124,125)])
+            vExp.setInfoOnComponents(['Comp1_0 [m]','Com2_0 [s^2]'])
+            vExp+=i*1000
+            self.assertTrue(v.isEqual(vExp,1e-12))
+            #
+            f=allFMTSLeavesPerCommonSupport[4][0][0][i]
+            fsst=MEDFileField1TSStructItem.BuildItemFrom(f,mst)
+            f.loadArraysIfNecessary()
+            v=mml.buildDataArray(fsst,fields,f.getUndergroundDataArray())
+            self.assertEqual(f.getName(),fieldName1)
+            self.assertEqual(v.getHiddenCppPointer(),f.getUndergroundDataArray().getHiddenCppPointer())
+            vExp=DataArrayDouble(16*2) ; vExp.iota(300+i*1000) ; vExp.rearrange(2) ; vExp.setInfoOnComponents(['Comp1_1 [m]','Com2_1 [s^2]'])
+            self.assertTrue(v.isEqual(vExp,1e-12))
+            pass
+        pass
+
+    def test35(self):
+        """ Emulate MEDReader in // mode context. Here a Simple mesh having more nodes than really needed. This test focuses on that point particulary."""
+        fname="ForMEDReader35.med"
+        arrX=DataArrayDouble(7) ; arrX.iota()
+        arrY=DataArrayDouble([0.,1.])
+        m=MEDCouplingCMesh() ; m.setCoords(arrX,arrY) ; m=m.buildUnstructured() ; m=m[[0,5,1,4,2,3]] ; m.changeSpaceDimension(3,0.) ; m.setName("Mesh")
+        f=MEDCouplingFieldDouble(ON_CELLS) ; f.setMesh(m) ; f.setName("Field") ; f.setArray(DataArrayDouble([(0.1,1.1),(2.1,3.1),(4.1,5.1),(6.1,7.1),(8.1,9.1),(10.1,11.1)])) ; f.getArray().setInfoOnComponents(["aa","bbb"])
+        MEDLoader.WriteUMesh(fname,m,True)
+        MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f)
+        ########## GO for reading in MEDReader,by not loading all. Mesh is fully loaded but not fields values
+        ms=MEDFileMeshes() # here we reproduce what is done by ParaMEDFileMeshes.ParaNew
+        ms.pushMesh(MEDFileUMesh.LoadPartOf(fname,"Mesh",[NORM_QUAD4],[0,2,1],-1,-1));
+        ms[0].zipCoords() 
+        #
+        fields=MEDFileFields.LoadPartOf(fname,False,ms);
+        fields.removeFieldsWithoutAnyTimeStep()
+        fields_per_mesh=[fields.partOfThisLyingOnSpecifiedMeshName(meshName) for meshName in ms.getMeshesNames()]
+        allFMTSLeavesToDisplay=[]
+        for fields in fields_per_mesh:
+            allFMTSLeavesToDisplay2=[]
+            for fmts in fields:
+                tmp=fmts.splitDiscretizations()
+                for itmp in tmp:
+                    if itmp.presenceOfMultiDiscPerGeoType():
+                        tmp2=itmp.splitMultiDiscrPerGeoTypes()
+                        for iii,itmp2 in enumerate(tmp2):
+                            name="%s_%i"%(itmp2.getName(),iii)
+                            itmp2.setName(name)
+                            allFMTSLeavesToDisplay2.append(itmp2)
+                            pass
+                        pass
+                    else:
+                        allFMTSLeavesToDisplay2.append(itmp)
+                        pass
+                pass
+            allFMTSLeavesToDisplay.append(allFMTSLeavesToDisplay2)
+            pass
+        #
+        self.assertEqual(len(allFMTSLeavesToDisplay),1)
+        self.assertEqual(len(allFMTSLeavesToDisplay[0]),1)
+        allFMTSLeavesPerTimeSeries=MEDFileAnyTypeFieldMultiTS.SplitIntoCommonTimeSeries(sum(allFMTSLeavesToDisplay,[]))
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries),1) # one time serie here : because the 2 fields are defined on the same time steps
+        self.assertEqual(len(allFMTSLeavesPerTimeSeries[0]),1)
+        allFMTSLeavesPerCommonSupport=MEDFileAnyTypeFieldMultiTS.SplitPerCommonSupport(allFMTSLeavesPerTimeSeries[0],ms[ms.getMeshesNames()[0]])
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport),1)
+        self.assertEqual(len(allFMTSLeavesPerCommonSupport[0][0]),1)
+        #
+        mst=MEDFileMeshStruct.New(ms[0])
+        #
+        fcscp=allFMTSLeavesPerCommonSupport[0][1]
+        mml=fcscp.buildFromScratchDataSetSupport(0,fields)
+        mml2=mml.prepare()
+        self.assertTrue(isinstance(mml2,MEDUMeshMultiLev))
+        ncc,a0,a1,a2,a3,a4,a5=mml2.buildVTUArrays()
+        self.assertTrue(ncc)
+        self.assertTrue(a0.isEqual(m.getCoords()[[0,1,5,6,7,8,12,13]],1e-12))# <- the aim of the test
+        self.assertTrue(a1.isEqual(DataArrayByte([9,9])))
+        self.assertTrue(a2.isEqual(DataArrayInt([0,5])))
+        self.assertTrue(a3.isEqual(DataArrayInt([4,1,0,4,5,4,3,2,6,7])))
+        self.assertTrue(a4 is None)
+        self.assertTrue(a5 is None)
+        f2=allFMTSLeavesPerCommonSupport[0][0][0][0]
+        fsst=MEDFileField1TSStructItem.BuildItemFrom(f2,mst)
+        f2.loadArraysIfNecessary()
+        v=mml.buildDataArray(fsst,fields,f2.getUndergroundDataArray())
+        self.assertEqual(f2.getName(),f.getName())
+        vExp=DataArrayDouble([(0.1,1.1),(2.1,3.1)])
+        vExp.setInfoOnComponents(['aa','bbb'])
+        self.assertTrue(v.isEqual(vExp,1e-12))
+        pass
+
     pass
 
 unittest.main()