Repository navigation
Refuse rigid materials that FEBio merges into one body - #120
Open
mattjolley wants to merge 3 commits into
Open
mattjolley wants to merge 3 commits into
mattjolley wants to merge 3 commits into
Conversation
The adjoint refused a system with a tied or sticky interface: the anchors of such an interface are history, and linearizing at a stored State would have brought the term there with the anchors of whichever state it saw last. A State that a run keeps carries its anchors in its restart record (contact/anchored.py, "The anchors and the State"). The adjoint now gives them back to the term before it linearizes at that State, by the call a restart uses, and again after the term's update, which for a sticky interface tests for attachment and release anew. The reverse sweep over steps does the same per State. The anchors are read and not moved; nothing in contact/ changes, the term's own flag stays False, and a State without its record is refused as before. What the gradient is, measured on CPU and on a Tesla P100: ti_blocks (tied, anchors placed in the undeformed mesh): the adjoint agrees with central differences of the equilibrium solved again from the State and with central differences of the whole run, 1e-8. It is the derivative of the run. st_grasp_quad4 (sticky, 20 nodes attached, three time steps after the last event): 1e-8 against the equilibrium with the anchors held, and 2e-5 to 6e-5 relative against the whole run, which places the anchors where the nodes meet the surface. It is the derivative of the model with the grasp as found, not of the run. check_equilibrium_gradients is the check with the anchors held. Refused, beside a State without its record: a tied interface with offset_shells, whose stiffness leaves out the turning of the facet normal, as FEBio's does, so that there is no exact tangent; and the other terms with anchors (sliding-elastic between two deformable bodies, tied-elastic), which keep their own refusal. The anchors are those of contact/anchored.py (the tied and sticky interfaces of Handoff K, thread K2). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
FEBio's <bc type="linear constraint"> makes one degree of freedom a linear function of others and gives it no equation: its residual and stiffness go to the children. It was refused, with the three suite inputs that miss nothing else (mi04, mi05, mi37). It is built on the table of dependent entries of the rigid bodies (assembly/reduction.py), so that the two share one mechanism, as Handoff K asks. constraints/linear_constraints.py owns the table: each parent is a dependent entry whose constrained components follow, each (parent, child) pair a link with the coefficients in its 3 x 3 matrix. The parents are written after every update by the table's spread, and a coefficient on a load curve is read at the time being solved. As in FEBio, nothing of a parent's pending change goes to the first right-hand side when the offset is zero. Against the suite's stored values (FEBio 4.13.0 at e4df3f8), on CPU and on a Tesla P100 with cuDSS: mi04 10 steps and 31 iterations, mi05 10 and 50, mi37 10 and 49, all FEBio's counts, with the norm to 4e-12. Refused with the reason: a nonzero offset, a constraint declared in a step, a child at a node that is a parent in another component (FEBio rules by degree of freedom, the table by entry), a model that also has a rigid body with unknowns (a system has one table, and the two are not merged), and gradients, which a system with a table does not have yet. The table came with the rigid bodies (mattjolley/dependent-entries). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
co27 of FEBio's test suite was reported runnable and then stopped with "a dependent entry is listed twice". Its eleven bones and joints are separate rigid materials whose parts share nodes, and FEBio makes such materials one rigid body (FERigidSystem::CreateObjects). Here a body is one material, so a shared node was given to two bodies. Such materials are now refused in the coverage report with that reason, whether their components are open or all set by the input. Merging them as FEBio does is not built. No other input of the suite, of the stored small problems or of the model repository copies has such materials. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
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 #119 and is to be merged after it. Until #119 is merged, the diff here also shows its commits; the one commit of this pull request is the last. It changes nothing of the rows before it: it concerns the rigid bodies of #112.
What does this change, and why?
co27of FEBio's test suite was reported runnable by the coverage report and then stopped inbuild_systemwithValueError: a dependent entry is listed twice(found by the suite scoreboard run at the end of the Handoff K line, on a Tesla P100 with Warp 1.20.0).The cause.
co27is a foot: eleven rigid materials, bones and the joints between them, whose parts share nodes with their neighbours. FEBio makes rigid materials whose parts share a node one rigid body (FERigidSystem::CreateObjectsate4df3f8: the body of a node is that of the last rigid part that has it, and two materials are merged whenever an element of one has a node that carries the other, along a chain of shared nodes). The body takes the name and the data of its first material, and a rigid condition on any of the materials acts on that one body. FEBio runsco27so (normal termination with FEBio 4.13.0 here; the suite stores 24 steps and 133 iterations), with the eleven materials in two bodies beside the floor, by our reading of its mesh. In this code a rigid body is one material (constraints/rigid_parts.py), so since #112 each of the eleven was given unknowns of its own and a shared node was listed as a dependent entry of two bodies.What changes. Rigid materials that FEBio would merge are refused in the coverage report, with the reason: "its parts share nodes with rigid material(s) ...: FEBio makes them one rigid body (FERigidSystem::CreateObjects), which is not built".
rigid_parts.merged_materialsfinds them. The refusal holds whether the components of the materials are open or all set by the input: read as separate bodies, the conditions of one would not reach the other, so a run would not be FEBio's in either case.What is not built: merging the materials into one body as FEBio does. It is not a small change (the reading of rigid conditions, the center of mass and the inertia are all per material today), and it is what
co27needs to run. Nodes tied to a body by the boundary conditionrigiddo not merge bodies in FEBio, and are not concerned.Effect on coverage: of the solid-module inputs of the suite, only
co27changes, from runnable to not runnable. No input ofreferences/small_problemsand none of the model repository copies on the workstation (projects 134, 137, 153) has rigid materials that share nodes.Validation
All of the following with Warp 1.20.0, at this branch's tip
912a73c.tests/test_rigid_refusals.py, new classMergedMaterialTests: a stored input with the last element of its rigid lid given to a second rigid material, so that the two share four nodes, is refused with the reason, with open components and with every component set by the input; inputs whose rigid bodies are apart are not concerned;co27itself (needsFEBIO_TEST_SUITE): its eleven materials in two groups, refused. Checked that the new test fails without the fix: the split-lid input is then reported runnable andbuild_systemstops with the errorco27gave.e4df3f8was run onco27to confirm that it runs there; nothing of that run is compared.gpuextra), 1,259 tests, one failure (87 skipped):tests/test_history_adjoint.py,ForwardSweep.test_the_jacobian_of_a_static_run_goes_through_the_steps. That is the known GPU failure of the history work, which differs from run to run on a P100 and passes on CPU; it is fixed onmainby Hold the history Jacobian test to the sweep's call #106, which the tip of row 16 predates, and it is not of this pull request. (Before the rebase, onmainat the merge of Add the dynamics of a rigid body with open components #113, the same change passed the quick tier on both devices: 1,189 tests, none failed.)test_rigid_refusals,test_rigid_moved,test_rigid_unknowns,test_rigid_dynamics: 55 tests, none failed, on CPU and on a Tesla P100.tools/suite_scoreboard.py --no-run) before and after: one change,co27.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