elif (hasattr(proxy.Input, 'TimestepValues')):
timestamps = proxy.Input.TimestepValues.GetData()
- if ((timestamp_nb - 1) not in xrange(len(timestamps))):
+ length = len(timestamps)
+ if (timestamp_nb > 0 and (timestamp_nb - 1) not in xrange(length) ) or (timestamp_nb < 0 and -timestamp_nb > length):
raise ValueError("Timestamp number is out of range: " + str(timestamp_nb))
# Return time value
- return timestamps[timestamp_nb - 1]
-
+ if timestamp_nb > 0:
+ return timestamps[timestamp_nb - 1]
+ else:
+ return timestamps[timestamp_nb]
def create_prs(prs_type, proxy, field_entity, field_name, timestamp_nb):
"""Auxiliary function.
source = proxy
- # Quadrature point arrays
- qp_arrays = proxy.QuadraturePointArrays.Available
+ fields_info = proxy.GetProperty("FieldsTreeInfo")[::2]
+ arr_name_with_dis=[elt.split("/")[-1] for elt in fields_info]
+ gauss_name=field_name+proxy.GetProperty("Separator").GetData()+'GAUSS'
# If no quadrature point array is passed, use cell centers
- if field_name in qp_arrays:
+ if arr_name_with_dis.count(gauss_name) > 0:
+ index = arr_name_with_dis.index(gauss_name)
+ field = fields_info[index]
+ source.AllArrays = [field]
generate_qp = pvs.GenerateQuadraturePoints(source)
generate_qp.SelectSourceArray = ['CELLS', 'ELGA_Offset']
source = generate_qp
# MED file
file_name = datadir + "hexa_28320_ELEM.med"
field_name = "pression_elem_dom_pb1"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "Fields_group3D.med"
-field_name = "scalar_field"
-timestamp_nb = 1
+field_name = "scalar field"
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "Hexa8.med"
field_name = "scalar_field"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "Penta6.med"
field_name = "scalar_field"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "Tetra4.med"
field_name = "scalar_field"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "Tria3.med"
field_name = "scalar_field"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "Quad4.med"
field_name = "scalar_field"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "carre_en_quad4_seg2_fields.med"
field_name = "AREA"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "cube_hexa8_quad4.med"
field_name = "fieldcelldouble"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "test_55_solid_concentr_dom.med"
field_name = "RN_precipite_restr"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "H_COUPLEX1.med"
field_name = "Head"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "cas2_2d_couplage_chess_castem.med"
field_name = "pH"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "champc.med"
field_name = "Am241_restriction"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "hydro_sea_alv.med"
field_name = "Head"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "toto.med"
field_name = "erreur"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "couplex_alain.med"
field_name = "Conc._I129"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "KCOUPLEX1.med"
field_name = "Head"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "test_hydro.med"
field_name = "Head"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "ml.med"
field_name = "head_restriction"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "T_COUPLEX1.med"
field_name = "Conc._I129"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "test_hydro_darcy4_out.med"
field_name = "DarcyVelocity"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "UO2_250ans.med"
field_name = "Concentration_O2(aq)_mol_per_l"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.3.med"
field_names = ["REMEUN_ERRE_ELGA_NORE", "REMEZEROERRE_ELGA_NORE"]
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "occ4050.med"
field_name = "champ_reel"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.1.med"
field_names = ["REMEUN_ERRE_ELGA_NORE", "REMEZEROERRE_ELGA_NORE"]
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.2.med"
field_names = ["REMEUN_ERRE_ELGA_NORE", "REMEZEROERRE_ELGA_NORE"]
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "ir.resu.med"
field_name = "gravit_VARI_ELGA"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()
# MED file
file_name = datadir + "petit.rmed"
field_name = "RESPIL_SIEF_ELGA"
-timestamp_nb = 1
+timestamp_nb = -1 # last timestamp
paravis.myParavis.ImportFile(file_name)
med_reader = pvsimple.GetActiveSource()