Skip to content

embedded_node_interface

embedded_node_interface

Attributes

FEMORA_MAX_NDF module-attribute

FEMORA_MAX_NDF = 9

Classes

InterfaceBase

InterfaceBase(name: str, owners: List[str])

Bases: ABC

Common logic for all interface objects on one Model model.

GeneratesMeshMixin

Role mixin for components that generate auxiliary mesh cells.

Use this mixin when a component needs to create its own mesh representation after the ordinary model geometry already exists. This is common for advanced interfaces that derive extra elements from the assembled mesh rather than from a simple pre-assembly meshpart.

In practice, components using this mixin usually:

  1. subscribe to a lifecycle event such as POST_ASSEMBLE
  2. inspect the assembled mesh or nearby geometry
  3. build an internal interface mesh
  4. merge or attach that mesh into the model-owned assembled mesh

The two hook methods separate those responsibilities:

  • build_mesh() creates the component's internal mesh description
  • integrate_mesh() inserts that mesh into the assembled model
Example
class MyInterface(GeneratesMeshMixin):
    def build_mesh(self, assembled_mesh, **kwargs):
        self.interface_mesh = assembled_mesh.extract_surface()

    def integrate_mesh(self, assembled_mesh, **kwargs):
        assembled_mesh.merge(self.interface_mesh, inplace=True)
Tip

Use this mixin when the component is responsible for cells or an actual interface mesh. If the component only creates standalone points, GeneratesNodesMixin is the better fit.

Methods:
build_mesh
build_mesh(**kwargs) -> None

Construct the component-owned auxiliary mesh.

Subclasses implement this hook to derive the interface mesh they need from runtime context such as the assembled mesh, nearby cells, or component-specific geometry.

Parameters:

Name Type Description Default
**kwargs

Arbitrary keyword arguments passed from the build context.

{}

Raises:

Type Description
NotImplementedError

If the subclass does not implement this method.

integrate_mesh
integrate_mesh(assembled_mesh, **kwargs) -> None

Integrate the generated mesh into the model-owned assembled mesh.

This hook runs after build_mesh() has created the component's auxiliary mesh. Subclasses use it to merge, attach, or otherwise register that geometry with the global assembled mesh.

Parameters:

Name Type Description Default
assembled_mesh

The global assembled mesh object to which the interface mesh cells will be attached.

required
**kwargs

Arbitrary keyword arguments passed from the integration context.

{}

MeshPart

MeshPart(category: str, mesh_type: str, user_name: str, element: Optional[Element], region: Optional[RegionBase] = None)

Bases: ABC

Base class for mesh parts on one Model model.

Instances do not self-register. A :class:MeshPartManager owns tag assignment and lifecycle.

FemoraEvent

Bases: Enum

Lifecycle signals emitted by Femora runtime subsystems.

These enum values describe when a callback is being invoked. They are not ordinary modeling commands. Instead, they mark important stages in the runtime lifecycle so advanced components can react at the right time.

The most important practical events are:

  • PRE_ASSEMBLE: emitted before the final assembled mesh is built
  • POST_ASSEMBLE: emitted after the final assembled mesh exists
  • RESOLVE_CORE_CONFLICTS: emitted after assembly when partition/core ownership updates may need follow-up work
  • PRE_EXPORT and POST_EXPORT: emitted around export-time workflows

More specialized events such as EMBEDDED_BEAM_SOLID_TCL are used by advanced exporters and interface-specific integrations.

EmbeddedNodeInterface

EmbeddedNodeInterface(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, use_mesh_part_points=True, normal_filter: list[float] | None = None, filter_tolerance: float = 0.98, friction_interface: bool = True, friction_interface_kn: float = 100000000.0, friction_interface_kt: float = 100000000.0, friction_interface_mu: float = 0.5, friction_interface_int_type: int = 1, *, meshpart)

Bases: InterfaceBase, GeneratesMeshMixin

Embedded node constraint contact interface.

EmbeddedNodeInterface models multi-point constraint boundary connections in OpenSees by constraining the displacements (and optionally rotations) of a constrained node to be a weighted average of a set of surrounding retained nodes. It leverages a penalty approach element formulation internally.

Tcl form

None (renders internally via OpenSees interface-specific TCL commands).

Example
from femora.core.model import Model

model = Model()
# Create an embedded node interface mapping a constrained node part to retained parts
interface = model.interface.node_interface(
    name="node_soil_interface",
    constrained_node="pile_head_node",
    retained_nodes=["soil_volume"],
    rot=True,
    p=True,
    K=1e10,
)

Initialize the 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

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

None
use_mesh_part_points

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

True
normal_filter list[float] | None

Optional 3D orientation direction vector to filter points. Defaults to None.

None
filter_tolerance float

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

0.98
friction_interface bool

If True, applies frictional interface properties. Defaults to True.

True
friction_interface_kn float

Normal penalty stiffness for friction contact. Defaults to 1e8.

100000000.0
friction_interface_kt float

Tangent penalty stiffness for friction contact. Defaults to 1e8.

100000000.0
friction_interface_mu float

Friction coefficient (mu). Defaults to 0.5.

0.5
friction_interface_int_type int

Frictional element interface formulation type. Defaults to 1.

1
meshpart

MeshPart registry manager from the parent model.

required

Raises:

Type Description
ValueError

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

Methods:
plot
plot(*, show_mesh: bool = True, show_selected_hosts: bool = True, show_generated_interface: bool = True, show_normals: bool = True, show_edges: bool = True, mesh_opacity: float = 0.08, host_opacity: float = 0.55, interface_opacity: float = 0.9, constrained_color: str = 'black', host_color: str = 'orange', point_color: str = 'deepskyblue', interface_color: str = 'crimson', normal_color: str = 'seagreen', off_screen: bool = False, screenshot: str | None = None, window_size: tuple[int, int] = (1400, 900), return_plotter: bool = False) -> pv.Plotter | None

Plot the assembled embedded-node interface selection.

The plot shows the constrained mesh part, the selected retained host cells that contain constrained points, the constrained points used by the interface, optional normals, and the generated interface cells when they are present in the assembled mesh.