Skip to content

ElementManager

ElementManager

ElementManager(mesh_maker: Model)

Create and register element definitions through model.element.

A definition stores formulation, degrees of freedom, dependencies, and options. A mesh part uses it for its cells; it is not an individual solver element with node connectivity. The definition's registry tag is distinct from the assembled cell tags written to OpenSees.

Attributes:

Name Type Description
beam BeamElementManager

Beam-column and truss factories.

brick BrickElementManager

Three-dimensional continuum factories.

quad QuadElementManager

Quadrilateral continuum factories.

special SpecialElementManager

Auxiliary and contact element factories.

Example
from femora import Model

model = Model()
soil = model.material.nd.elastic_isotropic(user_name="soil", E=1e5, nu=0.3, rho=1.8)
brick = model.element.brick.std(ndof=3, material=soil)
assert model.element.get(brick.tag) is brick
assert brick.get_material() is soil
Note

Prefer managed dependency objects from the same Model. Material string references are converted to integer tags, not looked up by user name. Transformation names are explicitly unsupported. Removal and retagging do not repair dependent mesh parts or an already assembled mesh.

Methods:

Name Description
add

Register a definition, assign its tag, and retain it in this model.

get

Return a definition by its current registry tag, or None if absent.

get_all

Return a shallow registry copy keyed by current definition tag.

remove

Detach one definition and compact the tags of surviving definitions.

clear

Detach all definitions and clear their tags without deleting meshes.

set_tag_start

Set the positive registry tag origin and retag existing definitions.

Methods:

add

add(element: Element) -> Element

Register a definition, assign its tag, and retain it in this model.

Parameters:

Name Type Description Default
element Element

Unmanaged definition, or one already owned here.

required

Returns:

Name Type Description
element Element

The same object, with a registry tag.

Raises:

Type Description
TypeError

The object is not an Element.

ValueError

Another manager owns it or its tag conflicts.

get

get(tag: int) -> Optional[Element]

Return a definition by its current registry tag, or None if absent.

Parameters:

Name Type Description Default
tag int

Value converted through int(tag); conversion errors propagate. This is not an assembled solver cell tag.

required

get_all

get_all() -> Dict[int, Element]

Return a shallow registry copy keyed by current definition tag.

Object values are shared with the model; editing the returned dictionary does not add or remove registrations.

remove

remove(tag: int) -> None

Detach one definition and compact the tags of surviving definitions.

Parameters:

Name Type Description Default
tag int

Current registry tag; missing tags are ignored.

required
Warning

Held integer tags can become stale. Dependent meshes are not removed and solver cells are not individually deleted by this call.

clear

clear() -> None

Detach all definitions and clear their tags without deleting meshes.

Materials, sections, transformations, and output files are not cleared. Rebuild dependent model data before exporting after a registry reset.

set_tag_start

set_tag_start(start_tag: int) -> None

Set the positive registry tag origin and retag existing definitions.

Parameters:

Name Type Description Default
start_tag int

First definition tag, validated by the tagging policy.

required

Raises:

Type Description
ValueError

The tag origin is invalid. This setting is unrelated to model.set_eletag_start() for exported solver cells.