Skip to content

SpConstraintManager

SpConstraintManager

SpConstraintManager(owner: 'ConstraintManager')

Create supports through model.constraint.sp.

dofs in these factories is a fixity flag vector: one entry per nodal DOF, with 1 fixed and 0 free. It is not a list of DOF numbers. Coordinate factories emit solver selection commands; macro factories use model-boundary variables generated during export. Creation alone does not test whether the selected nodes exist or whether the supports stabilize the model.

Example
from femora import Model

model = Model()
support = model.constraint.sp.fix(1, [1, 1, 1])
assert "fix 1" in support.to_tcl()

Methods:

Name Description
fix

Register explicit nodal fixity.

fix_x

Register fixity on a constant-global-x plane.

fix_y

Register fixity on a constant-global-y plane.

fix_z

Register fixity on a constant-global-z plane.

fix_macro_x_min

Register fixity at the exported minimum-x macro boundary.

fix_macro_x_max

Register fixity at the exported maximum-x macro boundary.

fix_macro_y_min

Register fixity at the exported minimum-y macro boundary.

fix_macro_y_max

Register fixity at the exported maximum-y macro boundary.

fix_macro_z_min

Register fixity at the exported minimum-z macro boundary.

fix_macro_z_max

Register fixity at the exported maximum-z macro boundary.

add

Register an SP object, returning it with an assigned constraint tag.

get

Return an SP definition by integer-convertible registry tag, or None.

get_all

Return a shallow tag-to-definition snapshot with shared object values.

remove

Detach a definition and compact surviving constraint registry tags.

clear

Detach every SP definition and clear its registry tag.

set_tag_start

Set the positive SP registry origin and retag existing definitions.

to_tcl

Render explicit-node and coordinate-plane fixities grouped by kind.

Methods:

fix

fix(node_tag: int, dofs: List[int]) -> FixConstraint

Register explicit nodal fixity.

Parameters:

Name Type Description Default
node_tag int

Solver node tag.

required
dofs list[int]

Per-DOF 0/1 fixity flags.

required

Returns:

Name Type Description
constraint FixConstraint

Registered definition; no solver is run.

fix_x

fix_x(xCoordinate: float, dofs: List[int], tol: float = 1e-10) -> FixXConstraint

Register fixity on a constant-global-x plane.

Parameters:

Name Type Description Default
xCoordinate float

Plane coordinate in model length units.

required
dofs list[int]

Per-DOF 0/1 fixity flags.

required
tol float

Coordinate selection tolerance in length units.

1e-10

Returns:

Name Type Description
constraint FixXConstraint

Deferred coordinate-based constraint.

fix_y

fix_y(yCoordinate: float, dofs: List[int], tol: float = 1e-10) -> FixYConstraint

Register fixity on a constant-global-y plane.

Parameters:

Name Type Description Default
yCoordinate float

Plane coordinate in model length units.

required
dofs list[int]

Per-DOF 0/1 fixity flags.

required
tol float

Coordinate selection tolerance in length units.

1e-10

Returns:

Name Type Description
constraint FixYConstraint

Deferred coordinate-based constraint.

fix_z

fix_z(zCoordinate: float, dofs: List[int], tol: float = 1e-10) -> FixZConstraint

Register fixity on a constant-global-z plane.

Parameters:

Name Type Description Default
zCoordinate float

Plane coordinate in model length units.

required
dofs list[int]

Per-DOF 0/1 fixity flags.

required
tol float

Coordinate selection tolerance in length units.

1e-10

Returns:

Name Type Description
constraint FixZConstraint

Deferred coordinate-based constraint.

fix_macro_x_min

fix_macro_x_min(dofs: List[int], tol: float = 1e-10) -> FixMacroX_min

Register fixity at the exported minimum-x macro boundary.

Parameters:

Name Type Description Default
dofs list[int]

Per-DOF fixity flags.

required
tol float

Boundary coordinate tolerance in model length units.

1e-10

Returns:

Name Type Description
constraint SPConstraint

Macro definition requiring export context.

fix_macro_x_max

fix_macro_x_max(dofs: List[int], tol: float = 1e-10) -> FixMacroX_max

Register fixity at the exported maximum-x macro boundary.

Parameters:

Name Type Description Default
dofs list[int]

Per-DOF fixity flags.

required
tol float

Boundary coordinate tolerance in model length units.

1e-10

Returns:

Name Type Description
constraint SPConstraint

Macro definition requiring export context.

fix_macro_y_min

fix_macro_y_min(dofs: List[int], tol: float = 1e-10) -> FixMacroY_min

Register fixity at the exported minimum-y macro boundary.

Parameters:

Name Type Description Default
dofs list[int]

Per-DOF fixity flags.

required
tol float

Boundary coordinate tolerance in model length units.

1e-10

Returns:

Name Type Description
constraint SPConstraint

Macro definition requiring export context.

fix_macro_y_max

fix_macro_y_max(dofs: List[int], tol: float = 1e-10) -> FixMacroY_max

Register fixity at the exported maximum-y macro boundary.

Parameters:

Name Type Description Default
dofs list[int]

Per-DOF fixity flags.

required
tol float

Boundary coordinate tolerance in model length units.

1e-10

Returns:

Name Type Description
constraint SPConstraint

Macro definition requiring export context.

fix_macro_z_min

fix_macro_z_min(dofs: List[int], tol: float = 1e-10) -> FixMacroZ_min

Register fixity at the exported minimum-z macro boundary.

Parameters:

Name Type Description Default
dofs list[int]

Per-DOF fixity flags.

required
tol float

Boundary coordinate tolerance in model length units.

1e-10

Returns:

Name Type Description
constraint SPConstraint

Macro definition requiring export context.

fix_macro_z_max

fix_macro_z_max(dofs: List[int], tol: float = 1e-10) -> FixMacroZ_max

Register fixity at the exported maximum-z macro boundary.

Parameters:

Name Type Description Default
dofs list[int]

Per-DOF fixity flags.

required
tol float

Boundary coordinate tolerance in model length units.

1e-10

Returns:

Name Type Description
constraint SPConstraint

Macro definition requiring export context.

add

add(constraint: SPConstraint) -> SPConstraint

Register an SP object, returning it with an assigned constraint tag.

Parameters:

Name Type Description Default
constraint SPConstraint

Unmanaged object or one already owned here.

required

Raises:

Type Description
TypeError

The object is not an SPConstraint.

ValueError

Ownership or registry-tag conflict.

get

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

Return an SP definition by integer-convertible registry tag, or None.

Parameters:

Name Type Description Default
tag int

Constraint registry tag, not the constrained solver node tag.

required

get_all

get_all() -> Dict[int, SPConstraint]

Return a shallow tag-to-definition snapshot with shared object values.

remove

remove(tag: int) -> None

Detach a definition and compact surviving constraint registry tags.

Parameters:

Name Type Description Default
tag int

Current tag; absent tags are ignored. Solver node tags stored inside constraints do not change during compaction.

required

clear

clear() -> None

Detach every SP definition and clear its registry tag.

MP constraints and model meshes remain unchanged. Exported files and a running solver are not affected.

set_tag_start

set_tag_start(start_tag: int) -> None

Set the positive SP registry origin and retag existing definitions.

Parameters:

Name Type Description Default
start_tag int

Positive origin validated by the tagging policy.

required

Raises:

Type Description
ValueError

Invalid origin. This does not change solver node numbering.

to_tcl

to_tcl() -> str

Render explicit-node and coordinate-plane fixities grouped by kind.

This convenience renderer includes Fix/FixX/FixY/FixZ definitions only; macro-boundary definitions require the full model export path. It does not launch OpenSees or verify selected nodes.