Repository navigation
Add dependent entries, eliminated after assembly - #111
Merged
Merged
Conversation
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>
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>
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 #110 (
mattjolley/rigid-bodies-note) 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 two.What does this change, and why?
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 (
FERigidSolver::RigidStiffnessSolid,FEResidualVector::Assemble;FELinearConstraintManager). This adds that mechanism once, for both: decision R1 ofdocs/design/rigid_bodies.md, section 5.2 (route A ofconstraints.md, section 7). The rigid bodies of the next pull request and thelinear constraintboundary condition of thread K3 (mattjolley/linear-constraint-bc, later in the line) are its two owners.What is built:
assembly/reduction.py, classReduction. A table of dependent entries: for each, its master entries and two 3x3 matrices per link, one for columns and one for rows (FEBio takes the two arms of a rigid node at different configurations when alpha_f is below 1, so they are kept apart). Three operations, each a kernel: carry the residual to the masters, carry the stiffness blocks, spread a vector to the dependent entries.System(set_reduction): the terms assemble on node entries as before; the residual is carried after them, the blocks that touch a dependent entry are carried into an extra slice of the block list with fixed (row, column) pairs, andapply_tangentis the product of the reduced matrix. No term changes, and the matrix pattern stays fixed.DEPENDENTof a component in the field table, beside free, fixed and prescribed.No run changes with this pull request alone: no owner of a table exists until the next one. Gradients: the adjoint and the forward sensitivities refuse a system with a table, since the adjoint solution is not yet spread to the dependent entries.
Validation
All of the following with Warp 1.20.0.
tests/test_reduction.py, new (6 tests): on a table built by hand over a small elastic problem (one entry with two masters, one of them prescribed; one entry that follows in x only and keeps two components; row matrices that are not the transposes of the column matrices), the matrix of the linear solve, the carried residual and the product against the dense product L K T on the host; a run with a term of the test as owner (the constraints hold, the carried residual is zero, Newton takes the iterations it takes without the table); what is refused.mi04,mi05,mi37, which K3 reports at FEBio's counts on this table).9d1af69, on CPU:tests/test_reduction.py, 6 tests, none failed.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.dependent-entriesat its first commit: 1,039 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