Skip to content

hertzforge.core.element_shapes

element_shapes

Strain and stress shapes: a solved model's modes read element by element.

A mode shape is a displacement at every node. Its strain is the displacement's derivative, and in a finite element model that derivative is continuous inside an element and jumps from one element to the next, so strain and stress belong to the elements, not the nodes. An element shape set holds them that way, as an Exodus file holds element variables: for every mode, the six strain components and the six stress components at each solid element's centroid and at the points of the volume rule its stiffness was integrated with, in the global axes and in SI.

The values come from the element's own strain matrix and elasticity (fem._solid_strains_many, the gradients its stiffness is built from), so nothing about the element is written twice. For the brick, Wilson's incompatible modes are recovered from the nodal displacements before the strain is formed, through the same static condensation the stiffness used. Read at the rule's points with their weights, the stress and strain give back each mode's strain energy: for a mass-normalized set, half of the sum over every element of weight times stress dot strain is omega^2 / 2.

Strain is per unit modal coordinate, as the shapes it is read from are. The shear strains are engineering shears (gamma_xy = du/dy + dv/dx), the convention the elasticity matrix and a strain gauge's rosette use. Each row of the set is a stress point: one element at one point. That is the row a benchmark's stress table is written in, and the components, not von Mises or principal values, are what it needs: they are linear in the modal coordinates, so a response's root mean square and its rates follow from the modal displacements alone.

Solids are covered: the eight-node brick, the six-node wedge and the four- and ten-node tetrahedra (element types 115, 112, 111 and 118, and the thick-element types 104 and 101 that build the same solids). Plates, beams and every other element are refused by name; point masses, grounds, springs and rigid links hold no strain field and are passed over when no groups are named.

Classes:

Name Description
ElementShapeSet

Strain and stress per mode at each solid element's stress points.

Functions:

Name Description
element_shapes

The strain and stress of a solved model's modes at each solid

gauge_strains

The strain a gauge on a solid's surface reads in each mode: at a

Classes

ElementShapeSet

ElementShapeSet(frequency: Any, damping: Any, element: Any, point: Any, xyz: Any, weight: Any, strain: Any, stress: Any, mass_unit: str | None = None, length_unit: str | None = None, comment: str = '')

Strain and stress per mode at each solid element's stress points.

Every row is a stress point: one element at one point, the centroid (point 0, weight 0) and then the points of the volume rule the element's stiffness was integrated with (points 1 on, each weighted by its share of the element's volume). A brick has nine, a wedge seven, a ten-node tetrahedron 28 and a four-node one two (its one rule point is its centroid).

Attributes: frequency: Hz per mode, as the shape set's. damping: Fraction of critical per mode, as the shape set's. element: The element id of each row. point: Each row's point in its element: 0 the centroid, 1 on the rule's points in the element's own order. xyz: Each row's position, (rows, 3), global, in meters (in the geometry's own numbers while its unit is undeclared). weight: Each row's share of its element's volume, m^3; zero at the centroid, and summing over an element to its volume. strain: (modes, rows, 6), the components in COMPONENTS order, per unit modal coordinate. stress: (modes, rows, 6), Pa per unit modal coordinate. mass_unit: The mass unit the modes were normalized against, or None when it was not declared. length_unit: The geometry's length unit, or None when it was not declared. comment: One line, what the set was read from.

Methods:

Name Description
rows_of

The rows of one element, its centroid first.

values

One component of one mode: per element at its centroid, or

strain_energy

Each mode's strain energy over the elements held: half the

kept

A copy with only these modes, in this order; every mode when None.

Attributes:

Name Type Description
num_shapes int

How many modes.

num_points int

How many stress points (rows).

elements ndarray

The element ids, each once, in the order the rows hold them.

Attributes
num_shapes property
num_shapes: int

How many modes.

num_points property
num_points: int

How many stress points (rows).

elements property
elements: ndarray

The element ids, each once, in the order the rows hold them.

Methods:
rows_of
rows_of(element: int) -> ndarray

The rows of one element, its centroid first.

Parameters:

Name Type Description Default
element int

The element's id.

required

Returns:

Type Description
ndarray

Row indices; refused when the set does not hold the element.

values
values(quantity: str, component: str, mode: int, at: str = 'centroid') -> ndarray

One component of one mode: per element at its centroid, or at every stress point.

Parameters:

Name Type Description Default
quantity ('strain', 'stress')
'strain'
component str

One of COMPONENTS.

required
mode int

The mode, from 0.

required
at ('centroid', 'points')

Each element's centroid, in elements order, or every row.

'centroid'

Returns:

Type Description
ndarray
strain_energy
strain_energy() -> ndarray

Each mode's strain energy over the elements held: half the sum over the rule's points of weight times stress dot strain. For a mass-normalized set read over every element it is omega^2 / 2.

Returns:

Type Description
ndarray

One value per mode, J per unit modal coordinate squared.

kept
kept(modes: Sequence[int] | None) -> ElementShapeSet

A copy with only these modes, in this order; every mode when None.

Functions:

element_shapes

element_shapes(geometry: Geometry, shapes: ShapeSet, groups: Sequence[int] | None = None, modes: Sequence[int] | None = None, comment: str = '') -> ElementShapeSet

The strain and stress of a solved model's modes at each solid element's stress points.

Each element is read at its centroid and at its volume rule's points from its own strain matrix and elasticity (fem._solid_strains_many), in the coordinates the model was solved in: a node a mated surface ties is moved onto the point it is tied to, as fem.Model.from_geometry moves it. The brick's incompatible modes are recovered from the nodal displacements first.

Parameters:

Name Type Description Default
geometry Geometry

The model the shapes were solved on, its element groups carrying their materials (geometry.group_properties).

required
shapes ShapeSet

The solved modes, at every node of the elements read.

required
groups sequence of int

The element groups to read, by id. Every group of solids when omitted, point elements passed over; a named group holding anything but solids is refused.

None
modes sequence of int

The modes, by index from 0. Every mode when omitted.

None
comment str

What the set was read from.

''

Returns:

Type Description
ElementShapeSet

gauge_strains

gauge_strains(geometry: Geometry, shapes: ShapeSet, gauges: Sequence[tuple[int, Sequence[float]]], modes: Sequence[int] | None = None) -> ndarray

The strain a gauge on a solid's surface reads in each mode: at a node, along a direction in the surface.

Each solid meeting at the node is read at that node through its own strain matrix (fem._solid_strains_many at the node's natural coordinates, the brick's incompatible modes recovered), and the tensors are averaged over those solids. The gauge reads the normal strain along its direction d, the tensor's d . E . d, so a gauge turned end for end reads the same. It is the strain at a point: a gauge averages over its grid, which a mesh finer than the grid resolves and a coarser one does not.

Parameters:

Name Type Description Default
geometry Geometry

The model the shapes were solved on.

required
shapes ShapeSet

The solved modes, with translations at every node of the solids at each gauge.

required
gauges sequence of (int, sequence of float)

Each gauge's node and its direction in the global axes (any length; it is made a unit vector).

required
modes sequence of int

The modes, by index from 0. Every mode when omitted.

None

Returns:

Type Description
ndarray

(modes, gauges), strain per unit modal coordinate.