pysdic.SDICAnalysis.with_mesh#
- SDICAnalysis.with_mesh(mesh, *, keep_displacements=True)[source]#
Create a new analysis with another mesh and the same views.
The new analysis shares the views and (if kept) the displacements with this analysis, without copy. The new mesh is locked; the mesh of this analysis stays locked (it is still used by this analysis).
- Parameters:
mesh (
pysdic.Mesh) – The new reference mesh, with an element type (not copied: it is locked).keep_displacements (bool, optional (default:
True)) – If True, the displacements of this analysis are kept: the new mesh must then have the same number of vertices and dimension, and the vertex \(i\) of the new mesh gets the displacement of the vertex \(i\) of the current one. If False, the new analysis has no displacement.
- Returns:
The new analysis.
- Return type:
- Raises:
ValueError – If the new mesh has no element type, if its dimension does not match the cameras, or if the displacements are kept and the shape \((N_v, E)\) of the new mesh differs from the current one while a displacement is set.
Examples
Refine the analysis with a modified mesh (the current mesh is locked):
new_mesh = analysis.mesh.copy() new_mesh.coordinates = smoothed_coordinates new_sdic = analysis.with_mesh(new_mesh)