Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 4fe93567 authored by Martin Genet's avatar Martin Genet
Browse files

Better logic in compute_strains

parent da02b566
No related branches found
No related tags found
No related merge requests found
...@@ -181,22 +181,22 @@ def compute_strains( ...@@ -181,22 +181,22 @@ def compute_strains(
strain_array_name=strain_array_name, strain_array_name=strain_array_name,
mesh_w_local_basis=ref_mesh, mesh_w_local_basis=ref_mesh,
verbose=verbose) verbose=verbose)
if (ref_mesh is not None)\ if (ref_mesh is not None):
and (iarray_ref_part_id is not None)\ if (iarray_ref_part_id is not None)\
and (remove_boundary_layer ): and (remove_boundary_layer ):
mesh = myvtk.getThresholdedUGrid( mesh = myvtk.getThresholdedUGrid(
ugrid=mesh, ugrid=mesh,
field_support="cells", field_support="cells",
field_name="part_id", field_name="part_id",
threshold_value=0.5, threshold_value=0.5,
threshold_by_upper_or_lower="lower") threshold_by_upper_or_lower="lower")
n_points = mesh.GetNumberOfPoints() n_points = mesh.GetNumberOfPoints()
n_cells = mesh.GetNumberOfCells() n_cells = mesh.GetNumberOfCells()
n_part_ids = 0 n_part_ids = 0
if (iarray_ref_sector_id is not None): if (iarray_ref_sector_id is not None):
iarray_sector_id = mesh.GetCellData().GetArray("sector_id") iarray_sector_id = mesh.GetCellData().GetArray("sector_id")
else: else:
iarray_sector_id = iarray_ref_sector_id iarray_sector_id = iarray_ref_sector_id
mesh_filename = working_folder+"/"+working_basename+("-wStrains")*(not in_place)+"_"+str(k_frame).zfill(working_zfill)+"."+working_ext mesh_filename = working_folder+"/"+working_basename+("-wStrains")*(not in_place)+"_"+str(k_frame).zfill(working_zfill)+"."+working_ext
myvtk.writeUGrid( myvtk.writeUGrid(
ugrid=mesh, ugrid=mesh,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment