Skip to content

elastic

elastic

Uniaxial linear elastic material used with OpenSees truss, spring, and fiber models.

Attributes

__all__ module-attribute

__all__ = ['ElasticUniaxialMaterial']

Classes

Material

Material(material_type: str, material_name: str, user_name: str)

Bases: ABC

Abstract base class for manager-owned OpenSees material objects.

Material instances do not self-register and do not assign their own tags. A :class:~femora.core.material_manager.MaterialManager owns lifecycle operations, tag assignment, removal, and retagging for a local model context.

Parameters:

Name Type Description Default
material_type str

OpenSees material category (e.g. 'nDMaterial').

required
material_name str

Concrete OpenSees material name (e.g. 'ElasticIsotropic').

required
user_name str

User-specified label for this material instance.

required

Attributes:

Name Type Description
tag Optional[int]

Manager-assigned OpenSees material tag. Remains None until this object is added to a :class:~femora.core.material_manager.MaterialManager.

_owner object | None

Reference to the owning manager, or None when unmanaged.

Methods:
to_tcl abstractmethod
to_tcl() -> str

Render the OpenSees material definition command as a Tcl string.

updateMaterialStage
updateMaterialStage(state: str) -> str

Return an updateMaterialStage Tcl command, or empty string.

set_parameter
set_parameter(parameter_name: str, new_value: Union[float, int, str, None] = None, element_tags: Optional[List[int]] = None) -> str

Return a setParameter Tcl command, or empty string.

get_param
get_param(key: str) -> Any

Return the value of a stored parameter by key.

ElasticUniaxialMaterial

ElasticUniaxialMaterial(user_name: str = 'Unnamed', *, E: float | None = None, eta: float = 0.0, Eneg: float | None = None, **_: Any)

Bases: Material

One-dimensional elastic stress-strain law with optional asymmetric stiffness.

Suitable for simple bars, trusses, springs, and fiber sections needing a basic uniaxial constitutive rule. The tangent E controls loading stiffness, eta adds optional damping tangent contribution, and Eneg sets an optional distinct compression tangent.

Tcl form

uniaxialMaterial Elastic <tag> E eta Eneg; # user_name

Note
  • Manager ownership is required before Tcl export so the OpenSees tag can be inserted after Elastic.
  • Eneg defaults to E when omitted.

Attributes:

Name Type Description
params Dict[str, float]

Mapping of emitted E, eta, and Eneg values.

Example
from femora.core.model import Model

model = Model()
mat = model.material.uniaxial.elastic(
    user_name="rebar_truss",
    E=200000.0,
    eta=0.0,
    Eneg=200000.0,
)
print(mat.tag)

Normalize moduli and damping tangent for OpenSees insertion.

Parameters:

Name Type Description Default
user_name str

Comment key for Tcl plus manager uniqueness constraint.

'Unnamed'
E float | None

Primary tensile or loading stiffness, strictly positive.

None
eta float

Supplemental damping tangent, non-negative after coercion.

0.0
Eneg float | None

Compression-side stiffness. Falls back to E when omitted.

None
**_ Any

Ignored extension keywords.

{}

Raises:

Type Description
ValueError

If E is missing.

ValueError

If E, eta, or Eneg cannot be converted to numeric values.

ValueError

If E or Eneg is not positive, or if eta is negative.

Methods:
to_tcl
to_tcl() -> str

Return the uniaxialMaterial Elastic command for this instance.

Returns:

Name Type Description
str str

Tcl string with Elastic, the assigned tag, and the stored

str

E, eta, and Eneg values.

Raises:

Type Description
ValueError

If the material is unmanaged.