Skip to content

Element

Element

Element(element_type: str, ndof: int, material: Union[Material, List[Material], None] = None, section: Section = None, transformation: GeometricTransformation = None, **element_params)

Bases: ABC

Base abstract class for manager-owned OpenSees finite elements.

Element instances do not self-register and do not assign their own tags. An ElementManager owns lifecycle operations, tag assignment, removal, and retagging for a local model context.

Attributes:

Name Type Description
tag Optional[int]

Manager-assigned OpenSees element tag. Remains None until this object is added to an ElementManager.

_owner object | None

Reference to the owning manager, or None when unmanaged.

element_type

The type of element (e.g., 'quad', 'truss', 'beam').

_ndof

Number of degrees of freedom for the element.

element_params

Dictionary of element-specific parameters.

_material

Primary material assigned to this element.

_materials

List of all materials assigned to this element.

_section

Section assigned to this element (for section-based elements).

_transformation

Geometric transformation assigned to this element (for beam elements).

Initializes the Element with flexible dependency support.

Attributes

tag instance-attribute

tag: Optional[int] = None

_owner instance-attribute

_owner: object | None = None

element_type instance-attribute

element_type = element_type

_ndof instance-attribute

_ndof = ndof

element_params instance-attribute

element_params = element_params

_material instance-attribute

_material = material

_section instance-attribute

_section = section

_transformation instance-attribute

_transformation = transformation

_materials instance-attribute

_materials = material

Methods:

_require_tag

_require_tag() -> int

Return the assigned tag, or raise if this element is unmanaged.

assign_material

assign_material(material: Union[Material, List[Material]])

Assigns a material to the element.

assign_section

assign_section(section: Section)

Assigns a section to the element.

assign_transformation

assign_transformation(transformation: GeometricTransformation)

Assigns a geometric transformation to the element.

assign_ndof

assign_ndof(ndof: int)

Assigns the number of DOFs for the element.

get_material

get_material() -> Optional[Material]

Retrieves the primary assigned material.

get_materials

get_materials() -> List[Material]

Retrieves all assigned materials.

get_section

get_section() -> Optional[Section]

Retrieves the assigned section.

get_transformation

get_transformation() -> Optional[GeometricTransformation]

Retrieves the assigned geometric transformation.

get_element_params

get_element_params() -> Dict[str, Any]

Retrieves element-specific parameters.

update_element_params

update_element_params(**new_params)

Updates element-specific parameters.

get_ndof

get_ndof() -> int

Gets the number of degrees of freedom for this element.

to_tcl abstractmethod

to_tcl(tag: int, nodes: List[int]) -> str

Converts the element to a TCL command string for OpenSees.

__str__

__str__() -> str

__repr__

__repr__() -> str

get_section_tag

get_section_tag() -> Optional[int]

Gets the tag of the assigned section.

get_material_tag

get_material_tag() -> Optional[int]

Gets the tag of the primary assigned material.

get_mass_per_length

get_mass_per_length() -> float

Gets the mass per length of the element.

get_density

get_density() -> float

Gets the density of the element.