Skip to content

TrussElement

TrussElement

TrussElement(ndof: int, section: Union[Section, int, str], rho: float = 0.0, cMass: int = 0, doRayleigh: int = 0, **kwargs)

Bases: Element

Axial truss element defined by a section stiffness model.

This two-node element carries axial force only. Cross-section area and axial stiffness come from the assigned section, typically an elastic section for braces or struts. It supports 2D, 3D, or mixed 6-DOF structural models.

Tcl form

element trussSection <tag> <iNode> <jNode> <secTag> <-rho rho> <-cMass cFlag> <-doRayleigh rFlag>

Note
  • Requires a managed section with an assigned tag before Tcl export.
  • rho supplies optional mass per unit length for dynamic analyses.

Attributes:

Name Type Description
rho

Mass per unit length used when dynamic mass formation is requested.

cMass

Consistent-mass flag passed to OpenSees (0 or 1).

doRayleigh

Rayleigh-damping flag passed to OpenSees (0 or 1).

Example
from femora.core.model import Model
import femora.components.section.beam  # noqa: F401

model = Model()
sec = model.section.beam.elastic(
    user_name="Brace",
    E=29000.0,
    A=2.5,
    Iz=0.1,
)
ele = model.element.beam.truss(
    ndof=3,
    section=sec,
    rho=0.01,
)
print(ele.tag)

Create a TrussElement with validated section and mass options.

Parameters:

Name Type Description Default
ndof int

Number of nodal DOFs in the surrounding model (2, 3, or 6).

required
section Union[Section, int, str]

Managed section object defining axial stiffness and area.

required
rho float

Optional mass per unit length.

0.0
cMass int

Consistent mass flag, 0 or 1.

0
doRayleigh int

Rayleigh damping flag, 0 or 1.

0
**kwargs

Additional element parameters stored on the base element.

{}

Raises:

Type Description
ValueError

If inputs are invalid or the section cannot be resolved.

Methods:

get_mass_per_length

get_mass_per_length() -> float

Return the mass per unit length assigned to this truss element.

Returns:

Type Description
float

Mass per unit length from rho.