Repository navigation
Valve: the open mitral input closes end to end and agrees with FEBio - #14
Merged
Merged
Conversation
…rgy per state A contact interface's outputs are kept in the results of every state under the interface's name. "contact area" is FEBio's surface data of that name for the contact potential: the area of the integration points with a nonzero force (the rule of Wu et al. 2022). On the open mitral input it is 90.2 where FEBio's is 89.6 at FEBio's last output time. It is a sum of step functions of the state, so it is an output and not an objective. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
cuDSS does the host part of its analysis (reordering) on one thread unless it is given a threading layer, and nvmath-python warns at every analysis. Contact repeats the analysis whenever the pairs change, so both the time and the noise added up. The OpenMP layer that the cuDSS wheel ships is now passed when it is found. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Matthew Jolley <12954190+mattjolley@users.noreply.github.com>
examples/valve/mitral_closure.py runs the open mitral input (FEBio model repository project 134: 7,200 quad4 shells, 100 chord springs, pressure, mass damping, leaflet self-contact, dynamic) and compares it in time with the FEBio results kept beside the input. With FEBio's line search and FEBio's exclusion of neighboring elements the run goes through leaflet closure to the end (286 steps, 1252 Newton iterations, 8 minutes on a Quadro RTX 8000 with the cudss solve). Against the stored FEBio 4.9.0 run, which ends in an error at time 0.0135 of 0.02: contact starts at the same time (0.00304); the closed contact area is 90.2 against 89.6; and the first principal stress of the elements of the six leaflet regions, at FEBio's 394 output times, differs by 0.5 percent in the median. FEBio used BFGS and tangent_scale and takes other time steps, so this is agreement at the level those differences allow, not to round-off. docs/design/contact_in_run.md (v0.4) records what was tried to get there and what each change did; a smooth alternative to the normal test w_tol for gradients (exclusion by reference distance, as the original formulation does), with its measurements; the plan from here in ten pieces by package; and four new decision points (K6 to K9). README, the design overview, the work plan, the deviations note and the README of the reference input are brought up to date. The example needs a GPU and the optional cudss solve to finish in minutes, so it is not a test. 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?
The open mitral input now runs end to end, through leaflet closure, and agrees with the FEBio results stored for it. This pull request adds the example that runs it and makes the comparison, two small pieces it needed, and the contact note with what was tried and the plan from here. Design note: contact_in_run.md (v0.4).
Merged by the author so the work can continue; comments afterwards are welcome.
contact areafor the contact potential (area of the integration points with a nonzero force), in the results of every stateexamples/valve/mitral_closure.py, and the notesWhat made the valve close. Nothing new: FEBio's line search (pull request 11) and FEBio's default for excluding neighboring elements from contact (pull request 10). The note has the table of what each ingredient did on its own. A projected contact tangent, a step limit and
tangent_scalewere not needed for this input and stay as options for harder ones.Agreement with FEBio (input:
P2Prolapse_Mitral.feb, FEBio model repository project 134; reference: the stored FEBio 4.9.0 run, which itself ends in an error termination at time 0.0135 of 0.02, so the comparison covers times up to there):cudsssolve).FEBio ran the input with BFGS and
tangent_scale10 and takes other time steps, so the run is interpolated in time for the comparison and the agreement is at the level those differences allow, not to round-off.For gradients: a smooth alternative to the normal test.
w_tolswitches pairs by the solution, which is what a gradient through closure cannot have. The note measures a variant that excludes pairs by reference distance instead, as the original formulation does (Kamensky et al. 2018): contact starts when FEBio's does, the stresses agree as well, the run takes a third of the time, and the contact area is 17 percent lower for a reason not yet separated (decision K6). Nothing of that variant is in the code as a setting yet; it is piece 5 of the plan.The plan from here is in the note as ten pieces by package, each with what it will be checked against, and four new decision points (K6 to K9), among them a question for the FEBio team: FEBio 4.13.0 does not read this input as written (it rejects
<laugon>PENALTY</laugon>), and whether a current build completes it is not known.Validation
tests/test_contact_in_run.py(contact outputs per state).references/febio/originals/cardiofem/valve_pressurization/mitral_p2prolapse.febagainst the element data and contact area files infebio_results/(FEBio 4.9.0), as above. This comparison is an example and not a test: it needs a GPU and the optionalcudsssolve to finish in minutes.cuda:0); the example on the same GPU from an environment with nvmath-python. The full tier as a whole was not rerun for this change.Checklist
uvx pre-commit run --all-filespasses.git commit -s).🤖 Generated with Claude Code