Skip to content

element_load

element_load

Attributes

__all__ module-attribute

__all__ = ['ElementLoad']

Classes

Load

Load()

Bases: ABC

Base class for OpenSees load commands emitted inside a pattern Plain block.

Load instances do not self-register. A :class:LoadManager owns tag assignment and lifecycle for a single model context.

ElementLoad

ElementLoad(*, kind: str, params: Dict[str, float], ele_tags: Optional[List[int]] = None, ele_range: Optional[Tuple[int, int]] = None, element_mask: Optional[object] = None, pid: Optional[int] = None)

Bases: Load

Element load component for applying distributed or point loads to elements.

ElementLoad represents a line or point load applied along the length of beam-column elements. It is commonly used in plain load patterns to represent gravity, uniform pressure, or point loads.

Tcl form

For uniform loads: eleLoad -ele <tags> -type -beamUniform <Wy> <Wz> <Wx> For point loads: eleLoad -ele <tags> -type -beamPoint <Py> <Pz> <xL> <Px>

Note
  • The kind must be either 'beamUniform' or 'beamPoint'.
  • Uniform load (beamUniform) requires parameter Wy, while Wz and Wx are optional.
  • Point load (beamPoint) requires Py and xL (relative position along the element from node I, between 0.0 and 1.0), while Pz and Px are optional.
  • The elements can be specified using a list of explicit tags (ele_tags), an index range (ele_range), or an element_mask.
Example
from femora.core.model import Model

model = Model()
ts = model.time_series.constant(factor=1.0)
pattern = model.pattern.plain(time_series=ts)

# Apply a uniform vertical load of -10.0 along the local y-axis of element 2
load = pattern.add_load.element(
    kind="beamUniform",
    ele_tags=[2],
    params={"Wy": -10.0},
)

Create an element load component.

Parameters:

Name Type Description Default
kind str

Type of element load. Must be either 'beamUniform' or 'beamPoint'.

required
params Dict[str, float]

Dictionary of load parameters. For 'beamUniform': Wy (required), Wz (optional), Wx (optional). For 'beamPoint': Py (required), xL (required, relative distance from node I), Pz (optional), Px (optional).

required
ele_tags Optional[List[int]]

Optional list of explicit element tags.

None
ele_range Optional[Tuple[int, int]]

Optional tuple of (start, end) element tags defining a range.

None
element_mask Optional[object]

Optional ElementMask object to apply the load to.

None
pid Optional[int]

Optional processor partition ID for parallel execution.

None

Raises:

Type Description
ValueError

If constructor arguments are invalid or conflict.

Methods:
to_tcl
to_tcl() -> str

Render this element load component as OpenSees Tcl commands.

Returns:

Type Description
str

The OpenSees eleLoad command string.

Functions:

_require_numeric

_require_numeric(name: str, value: Any) -> float

Validate and convert a value to a float.

Parameters:

Name Type Description Default
name str

Name of the parameter/field for validation reporting.

required
value Any

The value to convert.

required

Returns:

Type Description
float

The validated float value.

Raises:

Type Description
ValueError

If the value cannot be converted to a float.