Skip to content

hertzforge.core.rigid

rigid

Rigid-body mode shapes of a geometry.

Every free structure has six rigid-body shapes: three translations and three rotations about a reference point. They are the first step of the virtual point workflow, where the responses measured at the control DOFs are transformed through them to the six motions of one point, and a specification is transformed the same way so the two can be compared at that point.

The shapes depend only on the geometry and the reference point. A rigid translation moves every node one unit along an axis, and a rotation of one radian about an axis e through the point c moves a node at r by e × (r − c). Mass does not enter. The point is usually the center of gravity (CG), and Geometry.suggest_mass_properties uses the centroid of the nodes.

The mass and inertia only scale the shapes. ShapeSet holds mass-normalized shapes, φᵀMφ = I. A rigid body's 6×6 mass matrix about its CG is diagonal in its principal axes (the mass three times, then the three principal moments), so normalizing divides each translation by √m and each rotation by √I about its own axis. That is all the mass properties are used for, and it is why they are given together or not at all: mass without inertia would scale three shapes and not the other three, and the resulting modal masses would have no meaning. Without them the set is unscaled, the same as a fit without a drive point: unit shapes, with the modal mass only a convention.

The rotation axes are the principal axes of the inertia tensor. Rotations about the global axes are mass-orthogonal only when the products of inertia are zero. With a coupled tensor the six orthonormal shapes must rotate about its eigenvectors, so the principal decomposition is always used. A diagonal tensor's principal axes are the global axes, so three moments typed in give X, Y and Z back; a coupled tensor gives its own axes, which are named in the mode descriptions. Using only the diagonal of a coupled tensor would give shapes that look mass-normalized and are not.

Mass normalization only has meaning about the CG. About any other point the rigid mass matrix couples translation and rotation and the six shapes are not orthogonal, so the mass properties, when given, are taken to be about the reference point. Unscaled shapes about any point span the same six-dimensional space, which is what the virtual point transformation needs: it builds unscaled shapes about the virtual point, an interface location and not the CG, with this same function.

Classes:

Name Description
MassProperties

The reference point, and optionally the mass and inertia about it.

Functions:

Name Description
is_rigid_set

Whether a set is the six rigid-body shapes rigid_body_shapes writes.

axis_name

The name of an axis in a rotation mode's description.

rigid_body_shapes

The six rigid-body mode shapes of a geometry about a point.

Classes

MassProperties dataclass

MassProperties(point: tuple[float, float, float], mass: float | None = None, inertia: tuple[float, float, float, float, float, float] | None = None)

The reference point, and optionally the mass and inertia about it.

point is in meters, mass in kilograms and inertia in kg·m², since every stored value is SI. The six inertia terms are the tensor's Ixx, Iyy, Izz, Ixy, Ixz, Iyz (INERTIA_TERMS).

The object is frozen, like Averaging and Truncation, because it is stored on the geometry and its fields are compared to tell when shapes made from it are out of date; a value that could change in place would make that comparison wrong. It is checked when it is created: the point must be three finite numbers, mass and inertia must be given together or not at all, the mass must be positive, and the tensor must be one a real body could have (symmetric positive definite, which a typo in a product of inertia usually breaks; the triangle inequality Ixx + Iyy ≥ Izz follows from it). Any failure raises ValueError.

Methods:

Name Description
tensor

The 3×3 inertia tensor, or the identity when no inertia is

principal_axes

(moments, axes): the principal moments, and the unit axis

describe

The settings as text, for example

Attributes:

Name Type Description
scaled bool

True when mass and inertia are given and the shapes are

Attributes
scaled property
scaled: bool

True when mass and inertia are given and the shapes are mass-normalized, False for unit shapes.

Methods:
tensor
tensor() -> ndarray

The 3×3 inertia tensor, or the identity when no inertia is given, which makes the unscaled rotation axes X, Y and Z.

principal_axes
principal_axes() -> tuple[ndarray, ndarray]

(moments, axes): the principal moments, and the unit axis of each as the rows of axes, one per rotation mode.

They are ordered and signed so that mode 4 rotates about the principal axis nearest X, mode 5 nearest Y and mode 6 nearest Z, each with a positive component along its global axis. A diagonal tensor gives exactly X, Y and Z, and a lightly coupled one gives axes that are still close to X, Y and Z. Each rotation shape is built from its own axis, so the three axes are not forced to form a right-handed set.

describe
describe(unit_system: UnitSystem | None = None, *, defined: bool = True) -> str

The settings as text, for example 'about (0.1, 0, 0.05) m, unit shapes'.

Used by the status line and by the message that explains why derived shapes are out of date. The values are in SI by default, or in a unit system's display units when one is given. defined=False means the geometry's coordinates have no units, so the point is labeled 'units undefined' instead of meters.

Functions:

is_rigid_set

is_rigid_set(shapes: ShapeSet) -> bool

Whether a set is the six rigid-body shapes rigid_body_shapes writes.

True for six modes at exactly 0 Hz whose descriptions start with 'Rigid translation' (the first three) and 'Rigid rotation' (the last three). It is decided from the set's contents, not from a flag, so a rigid set that was saved to a file, copied or built in a script is still recognized.

axis_name

axis_name(axis: ndarray) -> str

The name of an axis in a rotation mode's description.

'X', 'Y' or 'Z' for a global axis, otherwise the axis's three components to two decimals, as in '(0.71, 0.71, 0.00)'.

rigid_body_shapes

rigid_body_shapes(geometry: Geometry, properties: MassProperties) -> ShapeSet

The six rigid-body mode shapes of a geometry about a point.

Three translations, then three rotations, over the three translational DOFs of every node, with each coefficient in the node's own displacement coordinate system. The DOF directions come from deform.dof_directions, the same function the animation uses, so the shapes and the animation of them agree. Rotational DOFs are not included, because nothing measures them.

The frequencies are exactly 0.0, which is how the FRF synthesis recognizes a rigid mode, and the damping is 0.0.

Parameters:

Name Type Description Default
geometry Geometry

The nodes the shapes are written over.

required
properties MassProperties

The reference point and, optionally, the mass and inertia that mass-normalize the set. Mass properties are refused on a geometry whose length unit has not been defined, because an inertia in kg·m² cannot be combined with coordinates that have no unit.

required

Returns:

Type Description
ShapeSet

Six modes over 3 × nodes DOFs, unscaled unless mass properties were given.

Raises:

Type Description
ValueError

If the geometry has no nodes, or if mass properties are given and the geometry's units are not defined.