Repository navigation
Contact potential in a run (first template), FEBio suite table test, documentation - #10
Merged
Merged
Conversation
The contact potential joins the run path as a term (contact/in_run.py): contact points from the model's SurfacePair, the pair search at every iterate, the repulsive forces as an external force with FEBio's sign, and the tangent in a matrix of its own that the system adds to the structural matrix before the solve, so the structural pattern and its map stay fixed. One surface named twice is self-contact. As in FEBio, the initial accelerations of a dynamic step are solved with the mass alone, and contact forces are not counted in the nodal reaction forces. A step is rejected and cut if a node moves farther than R_out in one iterate, a rule of the contact note made a rule of the step. Against stored FEBio results: two blocks pressed together to 4e-13, and a shell folded onto itself, with the contact settings of the open mitral input, to 4e-11. The coverage report now accepts the open mitral input, which is a statement about features and not about results: the run stops converging at time 0.005 of 0.02, as the leaflets close. w_tol is applied per point pair here and per element pair in FEBio, and the report says so. Activation by step, the projected tangent and contact under the adjoint are not built. This is a starting point for the contact work, not its design. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
tests/test_febio_suite.py compares problems of the FEBio test suite with the step count, iteration count and solution norm the suite stores, read from the checkout FEBIO_TEST_SUITE points to. Of the 549 inputs at suite commit 986005f the coverage report accepts 23. - co62 (the contact potential between two blocks), mi06, mi24 and sh54 take FEBio's steps and iterations exactly and reproduce the norm; so do bt01, di01, di02, dy07 and dy16, which are in the tests of their sections. - Nine more (mi02, mi25, mi31, sh02 to sh05, sh11, sh56), which FEBio ran with BFGS or where its line search acted, agree on the solution norm to 1e-5 or better. - The rest are listed in the file with the reason: di03 and sh06 need a line search; sh58 follows FEBio until FEBio's line search acts; sh52 and mi16 end at a zero solution, where the stored norm is only what the iteration leaves at its tolerance. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
The README status table and diagram, and the index of the design notes, are brought up to date with the chordae elements, dynamics and mass damping, the direct solves, and the first contact template. The index points to deviations.md. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
- CONTRIBUTING: test times; how to run the FEBio test suite problems (FEBIO_TEST_SUITE); what is optional and skipped without it (the suite, cuDSS, the GPU-only patches); OMP_NUM_THREADS on machines with many cores; how a FEBio reference is made and described. - docs/design/overview.md: the tables of what follows FEBio and of the first templates, for trusses and springs, loads, dynamics, the linear solves, contact in a run and sensitivity. - references/small_problems/README.md: which inputs are compared today. - references/febio/originals: what each patch folder holds and where it is tested; the status of the open mitral input, including that the stored FEBio 4.9.0 run of it ends in an error at time 0.0135. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
(cherry picked from commit 2c3aa7b)
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
main gained one commit after these branches were cut, which adds the P3CHD project to the first paragraph of the README. This branch already carries that sentence with a link, so the merge keeps the linked form. After this merge the branch merges into main without conflicts. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
FEBio's contact potential excludes element pairs that share a node unless the input sets exclude_neighbors to 0 (FEContactPotential.h: m_excludeNeighbors = true; before FEBio 4.12 neighbors were always excluded). The reader here mapped a missing exclude_neighbors to "element" exclusion, the opposite, and the contact note stated that as FEBio's default. The open mitral input does not set the parameter, so pairs between adjacent leaflet elements were left to w_tol alone: with w_tol 0 the run had 89,843 active pairs where a few thousand are expected. The small reference cases and suite problem co62 give the same results with either setting. Found in a side-by-side reading of FEContactPotential.cpp and the contact code here. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
…ate branch Carries the one-line docstring fix made on mattjolley/dynamics-template so that pre-commit passes on this branch too. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
main now holds the chordae elements and the dynamics, loads and solver work (pull requests 8 and 9), which this branch was built on. The merge brings in their two merge commits; the files of this branch are unchanged by it. 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.
What does this change, and why?
A first template of the contact potential as a term of a run, the FEBio test suite as a table-driven test, and the documentation brought up to date. Design note: contact_in_run.md.
Third of three pull requests merged in order. It is merged by the author so the basic parts run on
mainand the contact work can build on them, and is left here as the record for review afterwards: comments on a merged pull request are welcome and will be acted on. This is a starting point for contact, not its design. Contact is the next area of work and will be approached with FEBio's implementation and the original formulation (Kamensky et al. 2018) side by side.SurfacePair, pairs found at every iterate, the repulsive forces as an external force with FEBio's sign, the tangent in a matrix of its own so the structural pattern stays fixed. A step is cut if a node moves farther thanR_outin one iterateco62, the suite's contact potential problem (20 steps, 85 iterations); nine more agree on the norm; the rest are listed with the reasonmain(one README commit) and the dynamics branch (a one-line fix), so this branch merges without conflictsWhat works and what does not. Two blocks pressed together agree with FEBio to 4e-13 and a shell folded onto itself, with the contact settings of the open mitral input, to 4e-11. The coverage report now accepts the open mitral input (
P2Prolapse_Mitral.feb, FEBio model repository project 134), which is a statement about features and not about results: with its contact removed the run completes; with contact it stops converging as the leaflets close. First experiments point to a line search and a step limit as what is missing. Two facts about the reference for that input are recorded inreferences/febio/originals/cardiofem/valve_pressurization/README.md: the stored FEBio 4.9.0 run of it ends in an error termination at time 0.0135 of 0.02, and FEBio 4.13.0 rejects its<laugon>PENALTY</laugon>as written.Where this differs from FEBio (rows 5, 6 and 20 of
docs/design/deviations.md):w_tolis applied per point pair here and per element pair in FEBio, and the coverage report says so; theR_outstep rule has no FEBio counterpart; the contact tangent is kept in a matrix of its own. Not built: activation by step, the projected tangent, contact under the adjoint.Validation
tests/test_contact_in_run.py,tests/test_febio_suite.py, and changes totests/test_cli.py,tests/test_run_path.pyandtests/test_contact_potential.py.bk_contact_potential_patch(reaction force and stress, 1e-10),sh_self_contact_fold(reaction force 1e-8, displacements 1e-9); FEBio test suite at986005f, values read from the suite's ownlinuxGoldStandards.py.cuda:0, 229 tests) before the last three small commits (the exclusion default, the documentation pass, the merges); after them the quick tier on CPU and the contact and suite tests on the GPU.Checklist
uvx pre-commit run --all-filespasses.WARP_FEBIO_TEST_LEVEL=full uv run -m unittest discover -s tests, and withWARP_FEBIO_TEST_DEVICE=cuda:0for code that runs on the device. (See the note under Validation on the last three commits.)git commit -s). (One exception: "Update README.md" is a copy of the commit of that name already onmain, which was made on GitHub without a sign-off line.)🤖 Generated with Claude Code