Skip to main content

Structural Displacement

Structural Displacement Dataset

A static structural analysis result for a motor rotor cross-section, stored as a single legacy VTK unstructured grid. It carries a nodal displacement vector field and a von Mises stress field, making it the reference dataset for set_deformation().

PropertyValue
Format.vtk (legacy VTK, UNSTRUCTURED_GRID)
Points431
Cells756
Time Stepsnone (static result)

Functions

structural_displacement_path()

Returns the absolute file path to the bundled structural displacement dataset.

def structural_displacement_path() -> str
Returns
  • str - Absolute path to structural_displacement.vtk bundled with the package.

Data Arrays

ArrayAssociationmodeDescription
displacementpointThree-component nodal displacement vector
displacement_magnitudepoint"node"Magnitude of the displacement vector
node_idpoint"node"Original node identifier
von_misescell"element"Von Mises stress
element_idcell"element"Original element identifier
property_idcell"element"Material/property group identifier
element_kindcell"element"Element classification
vtk_cell_typecell"element"VTK cell type code

Since this is a single dataset rather than a multiblock collection, block-oriented methods such as set_block_visibility() do not apply.

Usage Examples

Basic Usage

from pyemsi import examples

# Get the path to the structural displacement dataset
file_path = examples.structural_displacement_path()
print(file_path)
# Output: /path/to/site-packages/pyemsi/examples/structural_displacement.vtk

With Plotter

from pyemsi import Plotter, examples

file_path = examples.structural_displacement_path()

plt1 = Plotter(file_path)
plt1.set_feature_edges(color="red", line_width=2)
plt1.set_scalar("von_mises", mode="element")
plt1.set_deformation("displacement", scale=5e4)
plt1.show()

The displacements are small in absolute terms, so a large scale (here 5e4) is needed to make the deformed shape visible. The source file is never modified — the scale factor only affects the rendered geometry.

Coloring by Displacement Magnitude

from pyemsi import Plotter, examples

plt1 = Plotter(examples.structural_displacement_path())
plt1.set_scalar("displacement_magnitude") # point data -> default mode="node"
plt1.set_deformation("displacement", scale=5e4)
plt1.show()
tip

The example datasets are installed alongside the package, so they are always available regardless of your working directory.