Skip to content

Section

Section

Section(section_type: str, section_name: str, user_name: str)

Bases: ABC

Abstract base class for all sections with manager-owned tagging.

Section objects do not self-register and do not assign their own tags. A :class:~femora.core.section_manager.SectionManager owns lifecycle operations, tag assignment, removal, and retagging for a local model context.

Parameters:

Name Type Description Default
section_type str

The type of section (e.g., 'section').

required
section_name str

The specific section name for OpenSees (e.g., 'Elastic').

required
user_name str

User-specified name for the section.

required

Attributes:

Name Type Description
tag Optional[int]

Manager-assigned OpenSees tag. It remains None until the instance is added to a :class:~femora.core.section_manager.SectionManager.

_owner Optional[Any]

Reference to the owning manager, or None when unmanaged.

Attributes

tag instance-attribute

tag: Optional[int] = None

_owner instance-attribute

_owner: Optional[Any] = None

section_type instance-attribute

section_type = section_type

section_name instance-attribute

section_name = section_name

user_name instance-attribute

user_name = user_name

material instance-attribute

material: Optional[Material] = None

Methods:

_require_tag

_require_tag() -> int

Return the assigned tag or fail if the instance is unmanaged.

Returns:

Type Description
int

The manager-assigned integer tag.

Raises:

Type Description
ValueError

If this section has not been added to a manager.

to_tcl abstractmethod

to_tcl() -> str

Convert the section to a TCL string representation for OpenSees.

Returns:

Type Description
str

TCL command string for this section.

resolve_material

resolve_material(material_input: Union[int, str, 'Material', None]) -> Optional['Material']

Resolve material using the owner manager when possible.

resolve_materials_dict

resolve_materials_dict(materials_input: Dict[str, Union[int, str, 'Material']]) -> Dict[str, 'Material']

Resolve a dictionary of material references.

resolve_section

resolve_section(section_input: Union[int, str, 'Section', None]) -> Optional['Section']

Resolve another section using the owner manager when possible.

resolve_material_reference staticmethod

resolve_material_reference(material_input: Union[int, str, 'Material', None]) -> Optional['Material']

Resolve a material object passed directly to an unmanaged section.

get_materials

get_materials() -> List['Material']

Return materials used by this section for dependency tracking.

has_material

has_material() -> bool

Return True when this section depends on a material.

get_area

get_area() -> float

Return cross-sectional area when the section provides it.

get_Iy

get_Iy() -> float

Return second moment of area about local y when available.

get_Iz

get_Iz() -> float

Return second moment of area about local z when available.

get_J

get_J() -> float

Return torsional constant when the section provides it.

__str__

__str__() -> str