Repository navigation
Solve for rigid bodies with open components - #112
Merged
Merged
Conversation
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>
A node of a rigid body, and the parent of a linear constraint, has no equation of its own in FEBio: what is assembled on it is carried to other equations. This adds that mechanism once, for both (decision R1 of docs/design/rigid_bodies.md), so that the rigid bodies of thread K1 and the linear constraints of thread K3 share it. The terms assemble on node entries as before. The system then carries the residual and the blocks of a dependent entry to its masters, in three kernels, and the matrix pattern stays fixed. An owner fills the table; none exists yet, so no run changes. The adjoint and the forward sensitivities refuse a system with a table. Checked against the dense product on a small elastic problem, on CPU and on a Tesla P100. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
A rigid body that shares no element with anything (dy05 of the suite) has dependent entries and no carried block, and the empty slice of the block list raised. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
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>
3 of 5 tasks
3 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request sits on #111 (
mattjolley/dependent-entries) 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 one.What does this change, and why?
A rigid body with a component that no condition holds was refused. It is the most common reason an input of FEBio's test suite does not run, and the last stage of the published clip procedure frees its clip. This solves for such a body as FEBio's rigid solver does, in static steps (the next pull request adds dynamic ones). Design note:
docs/design/rigid_bodies.md, sections 5 and 13;docs/design/constraints.mdhas the status.What is built, to FEBio 4.13.0 at
e4df3f8:constraints/rigid_parts.pyalready made. The nodes of the body (of its parts, and tied to it by the boundary conditionrigid) are dependent entries of the table of the previous pull request.constraints/rigid_system.py): FEBio's update of a body (FERigidSolverNew), with the rotation increments of a time step composed through the Cayley transform and the orientation kept as a quaternion; the rule for a step in which all three rotations are known (question 14, followed as it is);rigid_forceandrigid_momentwithload_typeLOAD. The bodies are few, so their kinematics are computed on the host; the nodes are placed and their arms formed by kernels.Refused, with the reason: such a body in a dynamic step (the next pull request); a prescribed rotation beside an open one (an error in FEBio);
FOLLOW,TARGETandrelativeloads; connectors under load; a contact interface with a surface on such a body (its stiffness, kept in a matrix of its own, is not carried to the body in this pull request); nodes of a shell part tied to a body, and a rigid shell part; gradients (adjoint_readyis False).Existing tests that change, named plainly. Three assertions in
tests/test_rigid_moved.pyand two coverage tests intests/test_sticky.pyasserted that an input is refused because its body can move. Those inputs now run, and each is replaced by a comparison with FEBio in this pull request (bk_rigid_lid_released,bk_rigid_lid_reopened,bk_rigid_tied_free; suiteco42as published). Every comparison of a body as moving geometry is unchanged.Validation
All of the following with Warp 1.20.0.
Tests added or changed:
tests/test_rigid_unknowns.py, new: the suite inputs and the three generated inputs below; the two paths; the quaternion functions and the Cayley composition against closed forms; equilibrium of a body under a load; the entries and the report; every refusal.tests/test_rigid_moved.pyandtests/test_sticky.py: the five assertions named above.FEBio reference (input file, quantity compared, tolerance, FEBio version), or N/A: FEBio's test suite at
986005fwith the presetFEBIO_4_13(steps, iterations and solution norm, which counts the unknowns of the bodies), and three generated inputs with references from FEBio 4.13.0 ate4df3f8(displacement of every logged node and stress at every state; compared at 1e-9).ri01rigid_forceri03ri07co42bk_rigid_lid_releasedbk_rigid_lid_reopenedbk_rigid_tied_freeThe same counts on CPU and on a Tesla P100. The three generated inputs are stored inputs with one rigid condition taken out (
references/small_problems/generate.py). Running that generator on the workstation rewraps the comments of ten inputs that are already stored; those were restored and only new files are added.Devices the full tier ran on (CPU, and the GPU model if CUDA; say so clearly if no GPU was used):
5aa376b, on CPU:test_rigid_unknowns,test_rigid_moved,test_rigid_refusals,test_reduction,test_stickyand the document links in the full tier: 79 tests, none failed (run before a one-line correction of the number of inputs stated in the references README; not rerun after it).mattjolley/rigid-body-dynamicsd876c2e, 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 thegpuextra), 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 unchangedmainat25b5aacon 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.rigid-body-unknownsat its earlier tip: 1,054 tests on each, none failed), with Warp 1.19.0. The suite scoreboard was not run again on this base.Checklist
uvx pre-commit run --all-filespasses. (Run on the files of this change: passes.)FEBIO_WARP_TEST_LEVEL=full uv run -m unittest discover -s tests, and withFEBIO_WARP_TEST_DEVICE=cuda:0for code that runs on the device. (Not run in full; see Validation.)git commit -s).🤖 Generated with Claude Code