Skip to content

Add the design note for rigid bodies as unknowns - #110

Merged
mattjolley merged 6 commits into
mainfrom
mattjolley/rigid-bodies-note
Dec 3, 2026
Merged

mattjolley merged 6 commits into
mainfrom
mattjolley/rigid-bodies-note

Conversation

@mattjolley

Copy link
Copy Markdown
Contributor

This pull request sits on #109 (mattjolley/rigid-wall) and is to be merged after it. Until that is merged, the diff here also shows its commits; the commits of this pull request are the last three.

What does this change, and why?

Documents only: docs/design/rigid_bodies.md, and its row in the index docs/design/README.md. Handoff K, thread K1, asked for the note before the code. It settles how a rigid body that responds to load enters this code in FEBio's formulation (decision W1 of valve_workflow.md, taken by MJ on December 2: FEBio's rigid system), and it fixes the mechanism the linear constraints share.

What the note has:

  • FEBio's formulation, read from its source at e4df3f8 (section 4): bodies, their nodes and equations; the update of a body; dynamics; conditions and loads; connectors; the rigid wall. Compared with FEBio develop at e71ed382, where the only change in these files is the Euler angle commit df85bbae.
  • The proposal (section 5): two entries per body in the field table; the nodes of a body as dependent entries that the system eliminates after assembly; a fixed matrix pattern; the orientation as a quaternion updated by FEBio's composition of rotation increments.
  • The conventions of the body state as FEBio has them (section 7), for a later conversion or export.
  • What is differentiable and what is not (section 8).
  • Decision points R1 to R9 (section 10). R4 (the augmentation loop) was answered by MJ: the hook of Let a term take part in the augmentation loop #103. R1 to R3 are built as proposed in the next three pull requests. R5 to R9 are with MJ, and the code follows the proposed option in each.
  • What is built and measured (section 13), with what the building found in FEBio: a symmetric stiffness keeps the upper triangle of a block that is not symmetric; the stiffness of a time step is formed before its first residual; the initial angular acceleration of a body is scaled by beta dt^2.

The note is ahead of the code in this pull request: section 13 describes the next three pull requests (rows 8 to 10) and two branches that follow the contact pull requests (sticky contact on a body with unknowns; TARGET loads).

Validation

All of the following with Warp 1.20.0.

  • Tests added or changed:
    • None. No code is changed.
  • FEBio reference (input file, quantity compared, tolerance, FEBio version), or N/A: N/A (documents only). The measurements the note reports are those of the pull requests of rows 6 and 8 to 10.
  • Devices the full tier ran on (CPU, and the GPU model if CUDA; say so clearly if no GPU was used):
    • At this branch's own tip adeca96, on CPU: tests/test_docs_links.py, which checks the links of the notes: passes.
    • At the tip of the five rigid body pull requests (mattjolley/rigid-body-dynamics d876c2e, which contains this one), Warp 1.20.0: quick tier of the whole repository on CPU, 1,187 tests, none failed (91 skipped); on a Tesla P100 (cuDSS; the versions of the gpu extra), 1,187 tests, one failure (82 skipped): tests/test_history_adjoint.py, ForwardSweep.test_the_jacobian_of_a_static_run_goes_through_the_steps (from History in the forward sweep #101), which fails on unchanged main at 25b5aac on the same GPU and passes on CPU; it is not of this pull request. The full tier of the nine test files these five pull requests add, change or meet (test_rigid_wall, test_reduction, test_rigid_unknowns, test_rigid_dynamics, test_rigid_moved, test_rigid_refusals, test_sticky, test_alpha_f, test_static_after_dynamic): 125 tests, none failed, on CPU and on a Tesla P100.
    • Not run: the full tier of the whole repository, on either device, and no tier at this branch's own tip beyond the link check: it changes documents only.

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; 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 6 commits December 2, 2026 17:27
Design only. The adjoint refuses every term that keeps something from
one converged state to the next: the attachments of sticky contact, the
multipliers of an augmented constraint, a beam's rotations. Handoff K
asks what it would take to carry such history in the State, first for
the anchors of a tied or sticky interface and then for a material with
internal variables.

Section 14 of the sensitivity note lists the history there is, the
reverse sweep with one more adjoint for it, what that needs of the State
and of the terms, and which gradients are the derivative of the run and
which are not because the run depends on its iterates. Three decisions
are put for MJ (S11 to S13).

The section names inputs and a section of the steps note that are on
the branches of K3-2 and K3-3 and not on main at this date.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
Main has a first material with history since pull request 98, with a
committed and a trial array in the brick domain and the pair held by
every converged State, and the reverse sweep through it since pull
request 99. The note said such history was not built for solids and
shells. What stays design in section 14 is the rest: anchors,
multipliers, the kept velocity. No code.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
FEBio's rigid_wall constraint holds the nodes of a surface on one side
of a plane. Four suite inputs miss nothing else (co08, co10, tu03 and
the dynamic dy03); it is the first piece of Handoff K, thread K1, and
independent of rigid bodies.

Read from FERigidWallInterface.cpp at e4df3f8. The facets are
integrated at their nodes, since the base class asks for nodal
integration; on the curved surface of dy03 a Gauss rule gives another
result. Newton uses FEBio's stiffness and the adjoint the derivative,
which differ by the squared length of the plane's vector.

The four inputs take FEBio's time steps and iterations on CPU and on a
Tesla P100. Augmented Lagrangian is refused: it is not built for the
wall yet.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
Handoff K, thread K1, asks for the note before the code: how body
unknowns enter the field table, how the elimination is done on the
device, what happens to the matrix pattern, the rotation update, what
is differentiable, and FEBio's conventions of the body state. It also
fixes the mechanism (dependent entries, eliminated at the level of the
system) that the linear constraints of thread K3 share.

Written from FEBio's source at e4df3f8, compared with develop e71ed382.
Design only; nothing was run.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
main gained an augmentation loop on December 2, which settles most of
decision R4. The rigid wall is built on its own branch; its area rule
and what was measured are recorded here.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
MJ answered R4: thread K3 builds the augmentation hook, and K1 uses
it. Section 13 now has the elimination, bodies with open components
in static and dynamic steps, and what the building found in FEBio.

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 159ee3d 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