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
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)
#
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()
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
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')
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
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)
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)
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)
# 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'],
]
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'
###
# 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()
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()
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()