Salome HOME
Going to multi discretizations per geo type management in the MEDReader.
[tools/medcoupling.git] / src / MEDLoader / Swig / MEDLoaderTest4.py
index 56d0b4a5757d067ec618dcd2c7bf118f12404a75..1cad4bfdb02c9d45a69d6433be0f305e94fb4e7f 100644 (file)
@@ -158,7 +158,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
@@ -369,7 +373,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
@@ -531,7 +539,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
@@ -782,7 +794,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
@@ -910,7 +926,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
@@ -1072,7 +1092,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
@@ -1277,7 +1301,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
@@ -1472,7 +1500,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
@@ -1616,7 +1648,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
@@ -1745,7 +1781,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
@@ -1844,7 +1884,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
@@ -1935,7 +1979,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
@@ -2048,7 +2096,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
@@ -2200,7 +2252,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
@@ -2358,7 +2414,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
@@ -2546,7 +2606,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
@@ -2618,7 +2682,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
@@ -2730,7 +2798,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
@@ -2795,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
@@ -2896,7 +2972,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
@@ -3076,7 +3156,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
@@ -3273,7 +3357,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
@@ -3381,7 +3469,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
@@ -3482,7 +3574,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
@@ -3586,7 +3682,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
@@ -3796,7 +3896,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
@@ -3911,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
@@ -4049,7 +4157,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
@@ -4183,7 +4295,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
@@ -4287,7 +4403,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
@@ -4393,7 +4513,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
@@ -4489,7 +4613,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
@@ -4537,6 +4665,9 @@ class MEDLoaderTest4(unittest.TestCase):
         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)
@@ -4586,7 +4717,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