Skip to content

InterfaceManager

InterfaceManager

InterfaceManager(mesh_maker: 'Model')

Register component connections through model.interface.

Factories create named definitions bound to this model's mesh-part registry. Concrete interface implementations use assembly/export lifecycle hooks to generate their connection data. Declare them before assembly unless a concrete interface explicitly documents another supported lifecycle.

Attributes:

Name Type Description
boundary

Absorber configuration namespace; see boundary.absorber below. Queued boundaries are separate from the named interface registry.

Prefer interface objects over manually manipulating their generated elements. Keep component nodes distinct where the interface formulation requires it. Penalty stiffness, spatial resolution, and explicit-step stability must be checked for the full coupled model, not inferred from registration success.

Example
from femora import Model

model = Model()
assert model.interface.get("pile_soil") is None
assert model.interface.get_all() == {}
See Also

The Components interface pages provide concrete geometry, parameter, recorder, and solver-build requirements for each connection type.

Methods:

Name Description
beam_solid_interface

Create an EmbeddedBeamSolidInterface.

node_interface

Create and register an EmbeddedNodeInterface.

add

Bind a definition to this manager, subscribe its hooks, and retain it.

get

Return a named interface or None without creating one.

get_all

Return a shallow name-to-interface snapshot with shared objects.

require

Require a registered interface by exact name.

require_registered

Validate ownership and exact registered object identity.

remove

Remove a named definition and release its lifecycle subscriptions.

clear

Release all interfaces, generated bookkeeping, and pending boundaries.

Methods:

beam_solid_interface

beam_solid_interface(*, name: str, beam_part: MeshPart | str | int, solid_parts: List[MeshPart | str | int] | None = None, shape: str = 'circle', radius: float = 0.5, radius_y: float | None = None, radius_z: float | None = None, width: float | None = None, height: float | None = None, section_points: Sequence[Sequence[float]] | None = None, n_peri: int = 8, n_long: int = 10, penalty_param: float = 1000000000000.0, g_penalty: bool = True, scale_start: float = 1.0, scale_end: float = 1.0, selection_margin: float = 0.35, _diagnostic_geometry: bool = False, _diagnostic_line_mesh: bool = False, region: RegionBase | None = None, write_connectivity: bool = False, write_interface: bool = False) -> EmbeddedBeamSolidInterface

Create an EmbeddedBeamSolidInterface.

Parameters:

Name Type Description Default
name str

Unique name of the contact interface.

required
beam_part MeshPart | str | int

The beam part instance, name, or tag.

required
solid_parts List[MeshPart | str | int] | None

Optional list of solid part instances, names, or tags.

None
shape str

Shape profile of the beam cross-section. Production OpenSees export currently supports only "circle". Defaults to "circle".

'circle'
radius float

Radius of the circular beam interface geometry. Defaults to 0.5.

0.5
radius_y float | None

Internal diagnostic ellipse semi-axis in the local section y direction.

None
radius_z float | None

Internal diagnostic ellipse semi-axis in the local section z direction.

None
width float | None

Internal diagnostic rectangle width in the local section y direction.

None
height float | None

Internal diagnostic rectangle height in the local section z direction.

None
section_points Sequence[Sequence[float]] | None

Internal diagnostic polygon vertices as local (y, z) pairs.

None
n_peri int

Number of points along the perimeter of the circular section. Defaults to 8.

8
n_long int

Number of points along the longitudinal axis of the beam. Defaults to 10.

10
penalty_param float

Penalty stiffness parameter for the constraint. Defaults to 1.0e12.

1000000000000.0
g_penalty bool

If True, uses the geometric penalty formulation. Defaults to True.

True
scale_start float

Internal diagnostic interface envelope scale at the first endpoint of the beam path. Production export requires 1.0.

1.0
scale_end float

Internal diagnostic interface envelope scale at the second endpoint of the beam path. Production export requires 1.0.

1.0
selection_margin float

Fraction of each candidate solid cell bounding radius allowed outside the interface envelope during fast solid discovery. Smaller values select tighter neighborhoods. Defaults to 0.35.

0.35
_diagnostic_geometry bool

Internal flag used by visual diagnostics to exercise non-exported envelope shapes and tapered discovery.

False
_diagnostic_line_mesh bool

Internal flag used by visual diagnostics to allow generic line-cell meshparts that are not export-ready.

False
region RegionBase | None

Optional region bounding the interface. Not implemented yet.

None
write_connectivity bool

If True, outputs boundary connectivity maps to file. Defaults to False.

False
write_interface bool

If True, outputs boundary mesh surfaces to file. Defaults to False.

False

Raises:

Type Description
ValueError

If beam_part cannot be resolved or if shape is unsupported.

TypeError

If argument types are invalid (e.g. beam_part is not a line mesh).

NotImplementedError

If unsupported parameter configurations are provided.

Returns:

Name Type Description
interface EmbeddedBeamSolidInterface

Registered definition bound to this Model.

Note

The owning mesh-part manager is supplied automatically; callers do not provide meshpart. Constructor validation and lifecycle behavior are unchanged.

node_interface

node_interface(*, name: str, constrained_node: MeshPart | str | int, retained_nodes: List[MeshPart | str | int] | None = None, rot: bool = False, p: bool = False, K: float | None = None, KP: float | None = None, offset: float | None = None, use_mesh_part_points: bool = True, normal_filter: ArrayLike | Callable[[ndarray, ndarray], ArrayLike] | None = None, filter_tolerance: float = 0.98, contact: bool = False, Kn: float = 100000000.0, Kt: float = 100000000.0, mu: float = 0.5, int_type: int = 1, area_scaled: bool = False) -> EmbeddedNodeInterface

Create and register an EmbeddedNodeInterface.

Parameters:

Name Type Description Default
name str

Unique name of the node interface.

required
constrained_node MeshPart | str | int

The constrained node part instance, name, or tag.

required
retained_nodes List[MeshPart | str | int] | None

Optional list of retained node part instances, names, or tags. If None, uses all mesh parts in the model except the constrained node.

None
rot bool

If True, constrains rotational degrees of freedom. Defaults to False.

False
p bool

If True, activates pressure-dof constraints. Defaults to False.

False
K float | None

Penalty stiffness parameter for translation constraints.

None
KP float | None

Penalty stiffness parameter for rotational constraints.

None
offset float | None

Geometric normal offset for locating coupling nodes. Defaults to None.

None
use_mesh_part_points bool

If True, uses mesh part nodal points directly. Defaults to True.

True
filter_tolerance float

Direction cosine tolerance for the normal filter. Defaults to 0.98.

0.98
contact bool

If True, creates a frictional EmbeddedNodeContact interface. Otherwise, creates a tied ASDEmbeddedNodeElement interface. Defaults to False.

False
Kn float

Normal penalty stiffness for contact. Defaults to 1e8.

100000000.0
Kt float

Tangential penalty stiffness for contact. Defaults to 1e8.

100000000.0
mu float

Friction coefficient for contact. Defaults to 0.5.

0.5
int_type int

Contact integration type: 0 for implicit or 1 for IMPL-EX. Defaults to 1.

1
area_scaled bool

If True, Kn and Kt are stiffnesses per unit area (force / length / area) and each contact node receives Kn * A and Kt * A, with A its tributary area on the selected part of the constrained surface. Defaults to False.

False
normal_filter ArrayLike | Callable[[ndarray, ndarray], ArrayLike] | None

Either a 3-vector (nodes whose surface normal is within filter_tolerance of it) or a function f(points, normals) -> bool array called with the surface points and their face normals; see above.

None

Raises:

Type Description
ValueError

If offset is negative or if constrained node matches retained node tag.

Returns:

Name Type Description
interface EmbeddedNodeInterface

Registered definition bound to this Model.

Note

The owning mesh-part manager is supplied automatically; callers do not provide meshpart. Constructor validation and lifecycle behavior are unchanged.

add

add(interface: InterfaceBase) -> InterfaceBase

Bind a definition to this manager, subscribe its hooks, and retain it.

Parameters:

Name Type Description Default
interface InterfaceBase

Concrete interface object.

required

Returns:

Name Type Description
interface InterfaceBase

Same registered object.

Raises:

Type Description
TypeError

Object is not an InterfaceBase.

ValueError

Name conflict or an object already owned by another manager.

get

get(name: str) -> Optional[InterfaceBase]

Return a named interface or None without creating one.

Parameters:

Name Type Description Default
name str

Exact, case-sensitive registry key.

required

get_all

get_all() -> Dict[str, InterfaceBase]

Return a shallow name-to-interface snapshot with shared objects.

Queued boundary absorber configurations are not included in this mapping.

require

require(name: str) -> InterfaceBase

Require a registered interface by exact name.

Parameters:

Name Type Description Default
name str

Registry key.

required

Raises:

Type Description
ValueError

The interface is missing, rather than returning None.

require_registered

require_registered(interface: InterfaceBase) -> InterfaceBase

Validate ownership and exact registered object identity.

Parameters:

Name Type Description Default
interface InterfaceBase

Object to check.

required

Returns:

Name Type Description
interface InterfaceBase

The unchanged object on success.

Raises:

Type Description
ValueError

Unmanaged, foreign-owned, or not the object registered under its current name. This does not validate assembled geometry.

remove

remove(name: str) -> None

Remove a named definition and release its lifecycle subscriptions.

Parameters:

Name Type Description Default
name str

Exact key; missing names are ignored.

required

This is not a rollback of generated mesh cells or already exported Tcl. Rebuild the affected assembly after changing connection definitions.

clear

clear() -> None

Release all interfaces, generated bookkeeping, and pending boundaries.

Associated subscriptions are removed. The current assembled mesh and solver output files are not reverted or deleted.

model.interface.boundary

Boundary-specialized interface registration namespace.

Methods:

Name Description
absorber

Queue a rectangular absorbing boundary for the post-assembly stage.

Methods:

absorber

absorber(*, num_layers: Optional[int] = None, num_partitions: Optional[int] = None, partition_algo: Optional[str] = None, geometry: Optional[str] = None, boundary_type: Optional[str] = None, rayleigh_damping: Optional[float] = None, match_damping: Optional[bool] = None, progress_callback: Callable[..., None] | None = None, numLayers: int | None = None, numPartitions: int | None = None, partitionAlgo: str | None = None, type: str | None = None, rayleighDamping: float | None = None, matchDamping: bool | None = None) -> None

Queue a rectangular absorbing boundary for the post-assembly stage.

Parameters:

Name Type Description Default
num_layers int | None

Absorber layer count passed to normalization.

None
num_partitions int | None

Absorber partition count, not a scheduler request.

None
partition_algo str | None

Absorber partitioner selection.

None
geometry str | None

Geometry selector supported by the boundary component.

None
boundary_type str | None

Absorber formulation selector.

None
rayleigh_damping float | None

Boundary damping configuration.

None
match_damping bool | None

Whether boundary damping matches the host.

None
progress_callback Callable | None

Boundary-generation progress callback.

None
numLayers int | None

Compatibility alias for num_layers.

None
numPartitions int | None

Compatibility alias for num_partitions.

None
partitionAlgo str | None

Compatibility alias for partition_algo.

None
type str | None

Compatibility alias for boundary_type.

None
rayleighDamping float | None

Compatibility alias for rayleigh_damping.

None
matchDamping bool | None

Compatibility alias for match_damping.

None

Returns:

Name Type Description
result None

Configuration is queued, not added as a named interface.

Note

Omitted defaults and validation follow the boundary component. Queued requests are consumed during post-assembly processing; requeue them when rebuilding a fresh assembly. Failure is not transactional.