]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
MEDReader properties migration: FileName -> FileNames; AllArray-> FieldsStatus; AllTi... spns/32377/paravis
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Mon, 17 Oct 2022 09:58:22 +0000 (11:58 +0200)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Mon, 17 Oct 2022 09:58:22 +0000 (11:58 +0200)
examples/command_line/medio.py
src/Plugins/DevelopedSurface/plugin/Test/test_dev_surface.py
src/Plugins/MEDReader/plugin/Doc/HowTo0.py
src/Plugins/MEDReader/plugin/Test/TestDataAnalysis.py
src/Plugins/MEDReader/plugin/Test/testMEDReader4.py
src/Plugins/MEDWriter/plugin/Test/TestMEDWriter0.py
src/Plugins/MEDWriter/plugin/Test/TestMEDWriter1.py
src/Plugins/VoroGauss/plugin/Test/test_VoroGauss.py

index 56a68bd875408aac3f4b2e2593d84c6b561b2fa4..884c60a298c1ffd89a8c05a88637492446ae7fa2 100644 (file)
@@ -26,7 +26,7 @@ def __select_data(reader, dataname=None):
     arr_name = [elt.split(separator)[0] for elt in arr_name_with_dis]
     for idx in range(len(keys)):
       if arr_name[idx] == dataname:
-        reader.AllArrays = keys[idx]
+        reader.FieldsStatus = keys[idx]
         break
 
   return reader
@@ -35,22 +35,22 @@ def __select_data(reader, dataname=None):
 def get_element_type(reader):
   # Return 'P0', 'P1'...
   separator = reader.GetProperty("Separator").GetData()
-  return reader.AllArrays[0].split(separator)[1]
+  return reader.FieldsStatus[0].split(separator)[1]
 #
 
 def get_element_name(reader):
   separator = reader.GetProperty("Separator").GetData()
-  return reader.AllArrays[0].split(separator)[0].split("/")[-1]
+  return reader.FieldsStatus[0].split(separator)[0].split("/")[-1]
 #
 
 def load_mesh(med_filename, mesh_name=None):
   import pvsimple
-  reader = pvsimple.MEDReader(FileName=med_filename)
+  reader = pvsimple.MEDReader(FileNames=med_filename)
   return __select_data(reader, mesh_name)
 #
 
 def load_field(med_filename, field_name=None):
   import pvsimple
-  reader = pvsimple.MEDReader(FileName=med_filename)
+  reader = pvsimple.MEDReader(FileNames=med_filename)
   return __select_data(reader, field_name)
 #
index 53d5f8729b4b6e39dbed57b9562d4bcbb8193efc..4e075582fba8d93dda48660a58aa420d5eb847cb 100644 (file)
@@ -24,9 +24,9 @@ from paraview.simple import *
 paraview.simple._DisableFirstRenderCameraReset()
 
 # create a new 'MED Reader'
-multiTSmed = MEDReader(FileName='multiTS.med')
-multiTSmed.AllArrays = ['TS0/Mesh/ComSup0/Pressure@@][@@P0']
-multiTSmed.AllTimeSteps = ['0000', '0001', '0002', '0003', '0004', '0005', '0006', '0007', '0008', '0009']
+multiTSmed = MEDReader(FileNames='multiTS.med')
+multiTSmed.FieldsStatus = ['TS0/Mesh/ComSup0/Pressure@@][@@P0']
+multiTSmed.TimesFlagsStatus = ['0000', '0001', '0002', '0003', '0004', '0005', '0006', '0007', '0008', '0009']
 
 # get animation scene
 animationScene1 = GetAnimationScene()
index b5213bf1005364144de2c15ed87d089617254606..81661b8c4e047b112f5c52a08a516dddb6c25374 100644 (file)
@@ -1,6 +1,6 @@
 from paraview.simple import *
 
-myMedReader=MEDReader(FileName="/home/H87074/WORK/TESTS_AMA/TESTS0/ssll117a/ssll117a.med")
+myMedReader=MEDReader(FileNames="/home/H87074/WORK/TESTS_AMA/TESTS0/ssll117a/ssll117a.med")
 
 # list of all keys
 
index 9b73133b72b8b8054f76adbbd7b74a353afcbaa9..6ea52cc8ba1223ac61e2c97698b7e11bf651790d 100644 (file)
@@ -44,8 +44,8 @@ print ("**** Importing MED file")
 myResult0 = MEDReader(FileNames=[MEDFILE])
 if myResult0 is None : raise "Erreur de fichier MED"
 
-# Imposition GenerateVectors à faire
-myResult0.GenerateVectors=1
+# Imposition VectorsProperty à faire
+myResult0.VectorsProperty=1
 
 NB_ORDRE = myResult0.GetPropertyValue('TimestepValues')
 
index 59da6cfde467ed5068712284967d2578da331d9c..e386c483f00d706c6e5a3c40bc771964f8f2eb5d 100644 (file)
@@ -74,7 +74,7 @@ def test(baseline_file):
   testMEDReader4_med=MEDReader(FileNames=[fname])
 
   testMEDReader4_med.FieldsStatus=['TS0/mesh/ComSup0/f0NoPfl@@][@@P1','TS0/mesh/ComSup0/mesh@@][@@P1']
-  #testMEDReader4_med.AllTimeSteps=['0000']
+  #testMEDReader4_med.TimesFlagsStatus=['0000']
 
   Glyph1=Glyph(Input=testMEDReader4_med,GlyphType='Sphere')
   Glyph1.ScaleArray=['POINTS','No scale array']#f0NoPflN
index 0947d5ac0f5e0d8cb57adb03343ce28ed5b5eb7f..04192e6e758601081b78d505c34974b3c23e3404 100644 (file)
@@ -49,9 +49,9 @@ with tempfile.TemporaryDirectory(prefix="MEDWriter_") as tmpdir:
     plane1 = Sphere()
     SaveData(fname0,proxy=plane1,WriteAllTimeSteps=1)
     #
-    totomed=MEDReader(FileName=fname0)
-    totomed.AllArrays=['TS1/Mesh/ComSup0/Mesh@@][@@P0']
-    totomed.AllTimeSteps=['0000']
+    totomed=MEDReader(FileNames=fname0)
+    totomed.FieldsStatus=['TS1/Mesh/ComSup0/Mesh@@][@@P0']
+    totomed.TimesFlagsStatus=['0000']
     SaveData(fname1,proxy=totomed,WriteAllTimeSteps=1)
     # Sphere has been written. Try to check to write it in MED file !
     mfd=ml.MEDFileData(fname0)
@@ -110,9 +110,9 @@ with tempfile.TemporaryDirectory(prefix="MEDWriter_") as tmpdir:
     f1ts1.setFieldNoProfileSBT(f0)
     f1ts1.write(fname2,0)
     #
-    test3=MEDReader(FileName=fname2)
-    test3.AllArrays=['TS0/%s/ComSup0/%s@@][@@P0'%(mName,fieldName0),'TS0/%s/ComSup0/%s@@][@@P1'%(mName,fieldName1)]
-    test3.AllTimeSteps = ['0000']
+    test3=MEDReader(FileNames=fname2)
+    test3.FieldsStatus=['TS0/%s/ComSup0/%s@@][@@P0'%(mName,fieldName0),'TS0/%s/ComSup0/%s@@][@@P1'%(mName,fieldName1)]
+    test3.TimesFlagsStatus = ['0000']
     SaveData(fname3,proxy=test3,WriteAllTimeSteps=1)
     ### test content of fname3
     mfd2=ml.MEDFileData(fname3)
index 9dced79bfc57e68289a7d5d13020a0816e574cea..efbcc49b791f2b0bdfe8ef2b177ca8eda570f226 100644 (file)
@@ -84,7 +84,7 @@ with tempfile.TemporaryDirectory(prefix="MEDWriter_") as tmpdir:
     f1ts12n.setFieldNoProfileSBT(f1n)
     f1ts12n.write(fname_int64,0)
 
-    test12=MEDReader(FileName=fname_int64)
+    test12=MEDReader(FileNames=fname_int64)
     SaveData(fname_int64_exported, WriteAllTimeSteps=1)
     ### test content of fname_int64_exported
     mfd2=ml.MEDFileData(fname_int64_exported)
index fcdeea09e3da5d5fb74a6c7a99e454cafd8aba57..175ea721a37f3190fc74070d523a894a29abffb8 100644 (file)
@@ -79,8 +79,8 @@ def test_geom(result, ref_mass_center, ref_volumes):
 # create a new 'MED Reader'
 file_name = os.path.join(data_dir, "testMEDReader14.med")
 testMEDReader14med = MEDReader(registrationName='testMEDReader14.med',
-                               FileName=file_name)
-testMEDReader14med.AllTimeSteps = ['0000', '0001', '0002', '0003', '0004']
+                               FileNames=file_name)
+testMEDReader14med.TimesFlagsStatus = ['0000', '0001', '0002', '0003', '0004']
 print("Testing {}".format(file_name))
 
 fields = [(['zeField0'],
@@ -112,7 +112,7 @@ fields = [(['zeField0'],
          ]
 
 for field_names, field, refs, center_mass, volume in fields:
-    testMEDReader14med.AllArrays = field
+    testMEDReader14med.FieldsStatus = field
     testMEDReader14med.UpdatePipeline()
 
     # create a new 'ELGA field To Surface'
@@ -134,9 +134,9 @@ for field_names, field, refs, center_mass, volume in fields:
 ###
 # create a new 'MED Reader'
 file_name = os.path.join(data_dir, "PG_3D.med")
-pG_3Dmed = MEDReader(registrationName='PG_3D.med', FileName=file_name)
-pG_3Dmed.AllArrays = ['TS0/Extruded/ComSup0/Extruded@@][@@P0',
-                      'TS0/Extruded/ComSup0/MyFieldPG@@][@@GAUSS']
+pG_3Dmed = MEDReader(registrationName='PG_3D.med', FileNames=file_name)
+pG_3Dmed.FieldsStatus = ['TS0/Extruded/ComSup0/Extruded@@][@@P0',
+                         'TS0/Extruded/ComSup0/MyFieldPG@@][@@GAUSS']
 print("Testing {}".format(file_name))
 pG_3Dmed.UpdatePipeline()
 
@@ -219,10 +219,10 @@ f1.setArray(arr)
 WriteFieldUsingAlreadyWrittenMesh(fname,f1)
 
 # create a new 'MED Reader'
-voroGauss1med = MEDReader(registrationName='VoroGauss1.med', FileName=fname)
-voroGauss1med.AllArrays = ['TS0/mesh/ComSup0/MyFieldCell@@][@@P0',
-                           'TS0/mesh/ComSup0/MyFieldPG@@][@@GAUSS']
-voroGauss1med.AllTimeSteps = ['0000']
+voroGauss1med = MEDReader(registrationName='VoroGauss1.med', FileNames=fname)
+voroGauss1med.FieldsStatus = ['TS0/mesh/ComSup0/MyFieldCell@@][@@P0',
+                              'TS0/mesh/ComSup0/MyFieldPG@@][@@GAUSS']
+voroGauss1med.TimesFlagsStatus = ['0000']
 print("Testing {}".format(fname))
 voroGauss1med.UpdatePipeline()
 
@@ -356,10 +356,10 @@ fieldGauss2.checkConsistencyLight();
 WriteFieldUsingAlreadyWrittenMesh(file_name, fieldGauss2)
 
 # create a new 'MED Reader'
-simple_meshmed = MEDReader(registrationName='simple_mesh.med', FileName=file_name)
-simple_meshmed.AllArrays = ['TS0/MESH/ComSup0/RESU____EPSI_NOEU@@][@@GAUSS',
-                            'TS0/MESH/ComSup0/RESU____SIGM_NOEU@@][@@GAUSS']
-simple_meshmed.AllTimeSteps = ['0000']
+simple_meshmed = MEDReader(registrationName='simple_mesh.med', FileNames=file_name)
+simple_meshmed.FieldsStatus = ['TS0/MESH/ComSup0/RESU____EPSI_NOEU@@][@@GAUSS',
+                               'TS0/MESH/ComSup0/RESU____SIGM_NOEU@@][@@GAUSS']
+simple_meshmed.TimesFlagsStatus = ['0000']
 print("Testing {}".format(file_name))
 simple_meshmed.UpdatePipeline()