]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
last timestamp for GaussPointsOnField
authorvtn <vtn@opencascade.com>
Wed, 19 Mar 2014 14:53:05 +0000 (18:53 +0400)
committervtn <vtn@opencascade.com>
Wed, 19 Mar 2014 14:53:05 +0000 (18:53 +0400)
29 files changed:
src/PV_SWIG/VTKWrapping/presentations.py
test/VisuPrs/GaussPoints/A0.py
test/VisuPrs/GaussPoints/A2.py
test/VisuPrs/GaussPoints/A3.py
test/VisuPrs/GaussPoints/A4.py
test/VisuPrs/GaussPoints/A5.py
test/VisuPrs/GaussPoints/A6.py
test/VisuPrs/GaussPoints/A7.py
test/VisuPrs/GaussPoints/A9.py
test/VisuPrs/GaussPoints/B0.py
test/VisuPrs/GaussPoints/B1.py
test/VisuPrs/GaussPoints/B2.py
test/VisuPrs/GaussPoints/B3.py
test/VisuPrs/GaussPoints/B4.py
test/VisuPrs/GaussPoints/B5.py
test/VisuPrs/GaussPoints/B6.py
test/VisuPrs/GaussPoints/B7.py
test/VisuPrs/GaussPoints/B8.py
test/VisuPrs/GaussPoints/B9.py
test/VisuPrs/GaussPoints/C0.py
test/VisuPrs/GaussPoints/C1.py
test/VisuPrs/GaussPoints/C2.py
test/VisuPrs/GaussPoints/C3.py
test/VisuPrs/GaussPoints/C4.py
test/VisuPrs/GaussPoints/C5.py
test/VisuPrs/GaussPoints/C6.py
test/VisuPrs/GaussPoints/C7.py
test/VisuPrs/GaussPoints/C8.py
test/VisuPrs/GaussPoints/C9.py

index 3e7ebff3afcc729ec713a8d2f0f0ad046b929b3f..8f4a57f42df3ccd866e84ba594e27f242a61815e 100644 (file)
@@ -967,12 +967,15 @@ def get_time(proxy, timestamp_nb):
     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.
@@ -2010,11 +2013,15 @@ def GaussPointsOnField(proxy, entity, field_name,
 
     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
index 904adb318420cbd5e63f6951d31298cfbe2eb550..66215d6da65dcbbedd9b180a340932b3db12e5f3 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index 22d4c2143c583ed36daaa939577551626fff2e4c..e9ce5f9020f730d41cea3199f4418de2d86426f1 100644 (file)
@@ -36,8 +36,8 @@ if not picturedir.endswith(os.sep):
     
 # 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()
index bef3d322e8e17fb6ec4a7fbd724280116e025da6..856f9ade1e45f147ee4f33a1ab385cfa7da34027 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index 27ce8f7b8c86da65501cc916e987f598e3261db4..cff8dcd9cfd2e39552d08f3b783006772a217ed1 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index fe34ed17d020da8d1f04e0d82a1d0e6f4cb0c5b5..fdf3420a4f99aa58489126dffa05eda6617d6c79 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index 30c51c7e7018933c5343d162ea716a0a4686160d..19fded2e017efb7b7780e0b2e5f5e193e38c5da6 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index a55ea80f90685435b10cbc9911037180efcae1de..ed2537544173a6a1b2cea9d2175460ec15fd2ab2 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index 5c438a4f31203e2f069d0ca75d7d9a3b69be77be..3bc4f999fec85a6961769b116b634b72509fcaaa 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index 7ad89f77433d92eef28c424a3f17f6ccc28c3722..d336acf43d7cd28e055ab81f9fff1086910a3d28 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index aa6cc3eab2d8ec67f4de4982163a44b4dba4d646..c2664bee2ba1eefccbd7f76d676eaf2f7eccc080 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index 48185d5cfe8250ad4954406efa2917e31f30bc11..c4dace7eb867f9934b54aa28580d2593c9493d54 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index 0bbb799de0ed70113bc5dcc7779c6a6af212c040..2835c0c5f281dca196865cc42549e530a92e5809 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index 15e6971e5461af30b3e83f4fd666af29039cbfda..f945ed32ac1e81e92bda8dbf1c06355b75c8a8a9 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index 774e269deb637add0ac3e63eac54b5b933d868bf..d5aa0bc07483515b5d7f8ea13328c967cd5c20fb 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index 60fcb2f92feffa5f2e8244a394cfe6bacf1f906c..f7e3dc1032893e2d02dfee1293eddbc43015dc5e 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index ab4737d6f86b8c1707d4994895727e6c69f0966b..d215648f2a63cede7ef46a077302a60c558ea0a7 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index 25720004293994f4163b977de9b588e20caa386d..4797087e09eeb2c2a36d69e00ffb3ea6f3cc90c8 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index 2085d27a6fcad5a62b93c9c53cd166a01f1f32ef..a0ee7766f2510ebc378ce8bca2ba3474aa9ff9f1 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index 1f127f5c9d2d1eb41c86b3d554c77b795670eddb..583d3939810f276f0dd0481931849fbc9cbd39a4 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index 04581e0513aa1985dcb5c40c8ec0b6e8aaf6aca7..4e4715abd144449c4d8b931291b9d593a47cb4f3 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index 4326d4a60a81facc9a9ab6dc8002ff6709d7e654..d628fc4ef3ac71c9a54bd85b1dccee3e130a8222 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index a8c2348fee4de5c0cffbd45b56e12823c60c8487..672e93b968138ede21440b02135a714ce813379c 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index bfe47bee76eed08a9676abef3eefe62407d4370e..7cbae10c613850d86d31897b2379a8b4a3d56f50 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index 6ca4a0804bc5b17621340df520d758a0bf5480d2..2e123c4982a611a0156b99607318bca5437d0950 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index 1490e2b53e18cf84bd0551f06101a50dc6944353..52e950394d50d503c95ba8e4837b27a6be2f20b2 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index c8ecec6eca4926fa3906cd5ed73f6719d5b122c7..a62633356e0c3c793ee7faac81a79dd15a25f99b 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index a804bffd21ae58e98bd4b37e463ccd999eb2a88e..5d277b90924bcf487d69f26cdd538a1c41a12a1c 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()
index 61d2e0f21357d336fd96a96265852fe6f7e39638..3f602a39e9a30ddc0de03c70089db58ec38cdeb1 100644 (file)
@@ -37,7 +37,7 @@ if not picturedir.endswith(os.sep):
 # 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()