Skip to content

ElementGroup

ElementGroup dataclass

ElementGroup(name: str, cell_indices: ndarray = None)

Bases: Group

Named nonempty selection of zero-based assembled cell indices.

Parameters:

Name Type Description Default
name str

Group label.

required
cell_indices ArrayLike

One-dimensional, nonempty, nonnegative indices.

None

Construction checks index shape/sign but cannot check bounds against a model. Use the current export cell-tag mapping when converting to solver tags. Rebuilding/reordering the mesh does not automatically update this selection.

Methods:

Name Description
element_tags

Map selected cells through an explicitly supplied export-tag sequence.

to_tcl

Render this group as an OpenSees element region.

Methods:

element_tags

element_tags(export_element_tags: Iterable[int]) -> list[int]

Map selected cells through an explicitly supplied export-tag sequence.

Parameters:

Name Type Description Default
export_element_tags Iterable[int]

Solver tag per assembled cell, in the same cell order used when creating this group.

required

Returns:

Name Type Description
tags list[int]

Solver tags in selection order, preserving duplicates.

Raises:

Type Description
ValueError

A selected index exceeds the mapping length.

to_tcl

to_tcl(export_element_tags: Iterable[int]) -> str

Render this group as an OpenSees element region.

Parameters:

Name Type Description Default
export_element_tags Iterable[int]

Current solver tag per assembled cell.

required

Returns:

Name Type Description
command str

Region-definition Tcl, not an executed selection.

Raises:

Type Description
ValueError

No group tag is assigned or a cell index is out of range.