Originally defined in KERNEL_TEST/Tools/CommonFunctions file.
"""
import presentations
- mesh_name = presentations.get_mesh_names(proxy).pop()
+ mesh_name = presentations.get_mesh_full_names(proxy).pop()
iterations = {}
# get list of field names
- fields_on_points = list(proxy.PointArrays)
- fields_on_cells = list(proxy.CellArrays)
- all_fields = fields_on_points + fields_on_cells
+ all_fields = proxy.GetProperty("FieldsTreeInfo")[::2]
# get timestamps
timestamps = proxy.TimestepValues.GetData()
timestamp_nb = len(timestamps)
for field in all_fields:
- entity = None
- if fields_on_points.count(field) > 0:
- entity = presentations.EntityType.NODE
- elif fields_on_cells.count(field) > 0:
- entity = presentations.EntityType.CELL
-
- iterations[field] = [entity, timestamp_nb]
+ entity = presentations.get_field_entity(field)
+ field_short_name = presentations.get_field_short_name(field)
+
+ iterations[field_short_name] = [entity, timestamp_nb]
return mesh_name, iterations
print "OK"
# 2. Create mesh
-mesh_names = get_mesh_names(med_reader)
-for mesh_name in mesh_names:
+mesh_names = get_mesh_full_names(med_reader)
+for mesh_name in [get_field_short_name(name) for name in mesh_names]:
print "Mesh name: ", mesh_name
mesh = MeshOnEntity(med_reader, mesh_name, EntityType.CELL)
if mesh is None:
print "Setting of deformation:"
warp_vector = pvsimple.WarpByVector(cutplanes.Input)
-warp_vector.Vectors = ["vectoriel field"]
+warp_vector.Vectors = ["scalar field"]
warp_vector.ScaleFactor = 5.0
print "Got scale : ", warp_vector.ScaleFactor