Skip to content

Add tied contact, node on facet, as an anchored-point term - #114

Merged
mattjolley merged 3 commits into
mainfrom
mattjolley/tied-node-on-facet
Dec 3, 2026
Merged

mattjolley merged 3 commits into
mainfrom
mattjolley/tied-node-on-facet

Conversation

@mattjolley

Copy link
Copy Markdown
Contributor

This pull request sits on #113 and is to be merged after it. Until that one is merged, the diff here also shows its commits; the one commit of this pull request is the last.

What does this change, and why?

A suture line, an edge-to-edge stitch and a sewn-in patch are ties, and FEBio's suite has one input, co26, that misses only tied-node-on-facet. FEBio's sticky, tied-node-on-facet, tied-elastic and the stick state of sliding-elastic are one force: a spring of stiffness penalty times area between a point of the primary surface and a material point of the secondary surface that is held once chosen (decision W3 of valve_workflow.md, section 4.1). sticky on main was that term with its settings fixed in its code. Design note: docs/design/contact.md, sections "The anchored-point term" and "Tied contact, node on facet".

What is built, to FEBio 4.13.0 at e4df3f8:

  • contact/anchored.py, the anchored-point term. The kernels and the attachment state of sticky moved here unchanged; what was constant became arguments (when the anchor is chosen, whether the projection handles its special cases, a largest distance, a shell offset per point). contact/sticky.py keeps the description of FEBio's interface, its coverage and Sticky, now one setting of the term.
  • contact/tied.py, tied-node-on-facet in its penalty form (FETiedInterface): every primary node with a projection on the secondary surface is tied when the interface is activated and never released; max_distance, special, offset_shells, a penalty on a load curve, also declared in a step.
  • The anchors in the State. A kept State carries them in its restart record, state.restart.terms[name] with facet and where per primary point, the same layout for every setting.

No behavior of sticky changes. Measured before the rebase, on CPU: the displacements of every state of its seven small cases and of co42 with held components are the same numbers bit for bit before and after the move, with the same iterations. tests/test_sticky.py is not edited by this pull request.

What is refused, and why:

Refused Why
node_reloc 1 FEBio moves the reference position of each tied node when the interface is activated, after its solid elements have stored their inverse reference Jacobians (FESolidElement::m_J0i). In a run of FEBio 4.13.0 the positions that result are those of the run without node_reloc to 1e-5: the elements stay strained against the mesh as written. Following that would take elements with the reference gradients of one mesh and the weights of another; a mesh that is simply moved is not FEBio's result. Question 27
laugon AUGLAG and LAGMULT Not built (augmented Lagrangian comes with the augmentation hook of #103, in a later pull request)
A tri3 secondary surface; a load curve on a setting other than the penalty Not built
Gradients The term sets adjoint_ready False and the adjoint refuses it, as for sticky on main

Question 27 (docs/design/open_questions.md and deviations.md), for Steve: is the behavior of node_reloc above intended, or is the mesh meant to start at rest with the moved nodes?

Validation

All of the following with Warp 1.20.0, on CPU and on a Tesla P100 (cuDSS; the versions of the gpu extra), at this branch's tip 0ff0f03.

  • Tests added or changed:

    • tests/test_tied.py, new (20 tests): agreement with FEBio on co26 and six small inputs, forces and stiffness of the term, the anchors kept and in the restart record, coverage and every refusal above.
    • tests/test_febio_suite.py: co26 added to FEBIO_STRATEGY (full tier).
    • No existing test is changed.
  • FEBio reference (input file, quantity compared, tolerance, FEBio version), or N/A: FEBio 4.13.0 at e4df3f8.

    Input What it is Agreement
    Suite co26 Two blocks of hex8 tied at matching faces, pulled apart The suite's stored 10 steps and 30 iterations; norm to 2.6e-13, with the preset FEBIO_4_13
    ti_blocks Faces that do not match and start up to 0.12 apart Displacement 1.6e-12, stress 1.6e-12, FEBio's iterations in all 10 time steps
    ti_blocks_max_distance The same with max_distance: 8 of 16 nodes tied 1.6e-12, 2.9e-12, FEBio's iterations
    ti_blocks_in_step Declared in the second of two steps, penalty on a load curve 1.7e-12, 1.9e-12, FEBio's iterations
    ti_ridge, ti_ridge_not_special Nodes above a ridge of the secondary surface, with special 1 and 0 1.7e-12, 1.6e-12, FEBio's iterations
    ti_shell_on_block A shell patch tied to a block with offset_shells 1.5e-12, 3.0e-12, FEBio's iterations

    The six small inputs are written by references/small_problems/generate_tied.py; their references are from the pinned build (skyline solver). The tests hold them to 1e-9 of the largest value. co26 needs a checkout of the FEBio test suite (FEBIO_TEST_SUITE) and is skipped without one, so CI does not run it; it ran here. ti_ridge is also the first comparison with FEBio of a special case of the closest point projection, which sticky shares.

  • Devices the full tier ran on (CPU, and the GPU model if CUDA; say so clearly if no GPU was used):

    • At this tip: test_tied.py (20 tests), test_sticky.py (25) and the documentation links, on CPU: none failed. At the tip of segment C, row 14 (bce0a0b), which holds this change: quick tier of the whole repository, CPU 1,246 tests, none failed (95 skipped); Tesla P100 (cuda:5) 1,246 tests, one failure (86 skipped), the known one on main named below. Full tier of test_tied, test_sticky, test_sliding_pair, test_sliding_elastic, test_tied_elastic and test_febio_suite: CPU 104 tests, none failed; Tesla P100 (cuda:4) 104 tests, none failed.
    • The same change one base earlier, on main df58f1e (tip 413bdba), Warp 1.20.0: the full tier of the whole repository, CPU 1,079 tests, none failed (26 skipped); Tesla P100 1,079 tests, none failed (13 skipped).
    • Known failure on main at 25b5aac on a P100, not of this pull request: tests/test_history_adjoint.py, ForwardSweep.test_the_jacobian_of_a_static_run_goes_through_the_steps (from History in the forward sweep #101; it passes on CPU). It showed in the quick tier at the tip of segment C on the P100 (cuda:5), as the only failure, and in no run on CPU.
    • Not run at this tip: the full tier of the whole repository, on either device (the coordinating session runs it at the end of the line).

Checklist

  • I have read the contributing guide.
  • uvx pre-commit run --all-files passes. (Run on the files of this change: passes.)
  • The full tier passes: FEBIO_WARP_TEST_LEVEL=full uv run -m unittest discover -s tests, and with FEBIO_WARP_TEST_DEVICE=cuda:0 for code that runs on the device. (Not run in full at this tip; see Validation.)
  • If this changes what a design note says, the note is updated; open design questions are in its decision points, not only in this pull request.
  • The change is focused, and every commit is signed off (git commit -s).

🤖 Generated with Claude Code

mattjolley and others added 3 commits December 2, 2026 19:00
A rigid body with a component that no condition holds was refused. It
is the most common reason a suite input does not run, and the last
stage of the published clip procedure needs it (Handoff K, thread K1).

Such a body now has two entries in the field table, its translation
and its rotation vector, and its nodes are dependent entries that the
system eliminates. The orientation is a quaternion updated as FEBio's
rigid solver updates it; rigid_force and rigid_moment are read with
load_type LOAD. Static steps only: the mass and inertia of a body are
not built yet, and a contact surface on such a body is refused until
its stiffness is carried to the body.

Suite inputs ri01, ri03, ri07 and co42 as published take FEBio's time
steps and iterations on CPU and on a Tesla P100. Three generated
inputs with a released component agree with FEBio 4.13.0 to 4e-12,
and a moved body gives the same result on the old path and the new.
A body with no open component stays on the old path.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
A body with unknowns was refused in a dynamic step. This adds its mass
and inertia from the density, FEBio's update of the angular velocity
and acceleration, the inertial force and moment, the rotational mass
block, a body force on a rigid part and the initial accelerations.

Three things of FEBio's rigid solver are followed because its
iterations depend on them: the stiffness of a time step is formed
before its first residual, with the angular momentum of the last
state; a symmetric stiffness keeps the upper triangle of the
rotational mass block, which is not symmetric; and the initial angular
acceleration is scaled by beta dt^2.

Two generated cases of a body spun up by moments agree with FEBio
4.13.0 to 3e-12 with its iterations in every time step, and suite
input dy05 takes FEBio's counts, on CPU and on a Tesla P100. A dynamic
step after a static one, and initial velocities, are refused.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
FEBio's sticky, tied-node-on-facet, tied-elastic and the stick state of
sliding-elastic are one force: a spring of stiffness penalty times area
between a point of the primary surface and a material point of the
secondary surface that is held once chosen (valve_workflow.md, decision
W3). Sticky was that term with its settings fixed in its code.

The kernels and the attachment state of sticky move to
contact/anchored.py unchanged, with what was constant as arguments, and
FEBio's tied-node-on-facet in its penalty form is a second setting of it
(contact/tied.py): anchors chosen at activation and never released,
max_distance, special, offset_shells, a penalty on a load curve, also
declared in a step.

No behavior of sticky changes: on CPU its seven small cases and co42
with held components give the same numbers bit for bit, with the same
iterations.

co26 of FEBio's test suite takes the stored 10 steps and 30 iterations
and the norm to 2.6e-13, on CPU and on a Tesla P100, and six generated
cases agree with FEBio 4.13.0 to 3e-12 with FEBio's iterations.

node_reloc 1 is refused: FEBio moves the reference position of the tied
nodes after its solid elements have stored their reference gradients, so
its result is that of the mesh as written (question 27).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
@mattjolley
mattjolley merged commit 3f59d3d into main Dec 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant