hertzforge.service.ops_element_shapes¶
ops_element_shapes
¶
Strain and stress shapes in the window: reading a solved model's modes
element by element (Project.element_shapes), drawing a set on its model
each element its own color, and playing modal coordinates with the
elements colored as the model moves.
The view is the model's mode shape, or a clip of modal coordinates,
animated, with the elements read drawn over it in the colormap
(element_values). The service sends each mode's tensor at each
element's centroid once; the shell sums them with the modal coordinates
each frame and forms the scalar chosen (von Mises, a principal stress or
one component) from the summed tensor, so a clip is never stored element
by element in time. Strain and stress jump from one element to the next,
so each element keeps its own flat color rather than a value averaged at
the nodes. The rest of the model is drawn gray.
Functions:
| Name | Description |
|---|---|
element_skin |
The outside of a set of solid elements, as triangles of node rows |
largest_component |
The component that reaches furthest at the elements' centroids over |
color_scalar |
The scalar a set is colored by: |
colored_elements |
Which of the set's elements are colored (a mask over |
element_field |
The |
with_rows |
A drawing ( |
element_view |
An element shape set on its model: the modes picked (all when |
played_rows |
The set's mode for each mode of |
element_shapes |
|
color_element_shapes |
|
play_element_shapes |
|
Classes¶
Functions:¶
element_skin
¶
The outside of a set of solid elements, as triangles of node rows
(u32 [T, 3]) and each triangle's element, as its index in elements
(u32 [T]): every face no second element of the set shares, fanned
from its first corner.
largest_component
¶
The component that reaches furthest at the elements' centroids over every mode: what a set is drawn by until another is chosen.
color_scalar
¶
The scalar a set is colored by: component, or the component that
reaches furthest for 'largest'. Strain is colored by one component; von
Mises, Tresca and the principal stresses are stresses.
colored_elements
¶
Which of the set's elements are colored (a mask over shapes.elements):
those in the element groups groups names, or every one for blank.
element_field
¶
element_field(geometry: Any, name: str, shapes: Any, rows: list[int], quantity: str, component: str, mask: ndarray, color_max: float = 0.0, coordinates: Any = None) -> dict
The element_values of a view: the set's modes rows, in the order the
view plays them, as each element's tensor at its centroid (modes,
elements, 6, in SI), with the outside faces of the elements mask keeps
as rows of geometry's nodes (the caller maps them to its own drawing).
The top of the color scale is color_max (SI) when above 0, else the
largest value shown: over the clip of coordinates (modes, samples), or
over each mode's cycle for modes.
with_rows
¶
with_rows(rows: ndarray, triangles: ndarray, lines: ndarray, extra: ndarray, num_nodes: int) -> tuple[ndarray, ndarray, ndarray, ndarray]
A drawing (drawn_mesh's rows, triangles and lines) with the nodes
extra drawn too, as (rows, triangles, lines, each geometry node's
drawn index or -1): the skin of a group inside the model has nodes the
model's own drawing leaves out.
element_view
¶
element_view(project: Any, name: str, picked: list[int] | None = None, quantity: str = 'stress', component: str = 'largest', title: str | None = None, color_groups: str = '', color_max: float = 0.0) -> dict
An element shape set on its model: the modes picked (all when
None), each animated by the shape set it was read from while that set
is still in the project, with the elements read (those of the element
groups color_groups when given) colored by one scalar of their tensor
at their centroids through each mode's cycle.
played_rows
¶
The set's mode for each mode of basis a clip plays (played, from 0),
in that order; ValueError when the set was not read from basis or does
not hold one of them.
element_shapes
¶
project.element_shapes: a solved model's modes read as strain
and stress at each solid element's centroid and rule points
(Project.element_shapes), drawn on the model by the component
chosen.
color_element_shapes
¶
project.color_element_shapes: an element shape set drawn on its
model by another quantity or scalar, on a stated scale when given.
play_element_shapes
¶
project.play_element_shapes: modal coordinates played on the model
an element shape set was read on, through the shape set it was read
from, with its elements colored by one scalar of the tensor summed each
frame.