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.
rhosupplies 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 ( |
|
doRayleigh |
Rayleigh-damping flag passed to OpenSees ( |
Example
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
|
doRayleigh
|
int
|
Rayleigh damping flag, |
0
|
**kwargs
|
Additional element parameters stored on the base element. |
{}
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If inputs are invalid or the section cannot be resolved. |