Skip to content

GroundMotion

GroundMotion

GroundMotion(motion_type: str)

Bases: ABC

Abstract base class for OpenSees ground motions.

A ground motion defines the displacement, velocity, and/or acceleration history used by OpenSees imposed-motion constraints. Concrete subclasses are responsible for validating their own physical parameters and rendering the corresponding groundMotion Tcl command.

Ground motions intentionally do not self-register and do not assign their own tags. A :class:femora.core.ground_motion_manager.GroundMotionManager owns instance storage, tag assignment, retagging, and deletion. This keeps the base class independent from any particular model and allows separate managers, such as future separate Model instances, to maintain independent ground-motion collections.

Attributes:

Name Type Description
tag Optional[int]

OpenSees ground-motion tag assigned by a GroundMotionManager. It is None until the instance is added to a manager.

motion_type

OpenSees ground-motion type name, such as "Plain" or "Interpolated".

Initialize common ground-motion state.

Parameters:

Name Type Description Default
motion_type str

OpenSees ground-motion type name used by subclasses.

required

Attributes

tag instance-attribute

tag: Optional[int] = None

_owner instance-attribute

_owner: object | None = None

motion_type instance-attribute

motion_type = motion_type

Methods:

_require_tag

_require_tag() -> int

Return this ground motion's tag or fail if unmanaged.

Returns:

Type Description
int

The integer tag assigned by a GroundMotionManager.

Raises:

Type Description
ValueError

If the ground motion has not been added to a manager.

to_tcl abstractmethod

to_tcl() -> str

Render the OpenSees groundMotion command.

Subclasses should call _require_tag() before rendering so unmanaged ground motions fail clearly instead of emitting invalid Tcl.