Add backtracking to ElementJacobianDamper#32807
Add backtracking to ElementJacobianDamper#32807Andreas-Lepak wants to merge 3 commits intoidaholab:nextfrom
Conversation
|
Job Precheck, step Clang format on b97b5c9 wanted to post the following: Your code requires style changes. A patch was auto generated and copied here
Alternatively, with your repository up to date and in the top level of your repository:
|
b97b5c9 to
4b96447
Compare
|
Job Documentation, step Docs: sync website on e46bda2 wanted to post the following: View the site here This comment will be updated on new commits. |
4b96447 to
8133965
Compare
- add opt-in backtracking parameters - retry damped trial updates after DegenerateMap - restore node coordinates after failed probes - add regression coverage and documentation refs idaholab#32806
8133965 to
28794bd
Compare
|
Job Coverage, step Generate coverage on e46bda2 wanted to post the following: Framework coverageCoverage did not change Modules coverageSolid mechanics
Full coverage reportsReports
This comment will be updated on new commits. |
||||||||||||||||||||||||||
| "use_backtracking", | ||
| false, | ||
| "If true, iteratively cut back the probed Newton update until the displaced mesh remains " | ||
| "nondegenerate and the Jacobian increment stays within max_increment."); |
There was a problem hiding this comment.
the Jacobian update will always be within max_increment if it starts within max incremenent? How would you exceed by further cutting back?
There was a problem hiding this comment.
it is for recovering from a trial that is either degenerate or still over the Jacobian-change limit.
There was a problem hiding this comment.
isnt the "over the Jacobian-change limit" simply handled by scaling the update by the ratio of the limit to the current value?
|
|
||
| unsigned int has_exception = _fe_problem.hasException() ? 1 : 0; | ||
| _communicator.max(has_exception); | ||
| if (has_exception) |
There was a problem hiding this comment.
not sure I understand this
add a comment please? why is an exception ok for returning a damping factor
There was a problem hiding this comment.
Added comment
// The exception flag will abort the nonlinear step after the damper returns, so return the
// last trial damping only to satisfy the interface.
There was a problem hiding this comment.
and we know this exception is not one such that backtracking the damping would remove it?
| Real max_difference = 0.0; | ||
| bool valid = false; | ||
|
|
||
| PARALLEL_TRY { valid = probe_trial(damping, max_difference, error_message); } |
There was a problem hiding this comment.
valid is a boolean but this routine can be returning "_max_jacobian_diff / max_difference;" ?
There was a problem hiding this comment.
probe_trial should now return bool. The lambda ends with: return !invalid_local; and !invalid_local is a boolean expression, so probe_trial(...) cannot return _max_jacobian_diff / max_difference.
| if (!valid) | ||
| damping *= _backtrack_factor; | ||
| else | ||
| damping = | ||
| std::min(damping * _backtrack_factor, damping * _max_jacobian_diff / max_difference); |
There was a problem hiding this comment.
let's rename valid to make it obvious it's actually a criteria for reducing the damping factor
There was a problem hiding this comment.
it is now renamed trial_nondegenerate
Co-authored-by: Guillaume Giudicelli <guillaume.giudicelli@gmail.com>
9df72f7 to
e46bda2
Compare
|
Test failure is unrelated |
|
Job Test, step Results summary on e46bda2 wanted to post the following: Framework test summaryCompared against 5b391df in job civet.inl.gov/job/3787211. No added testsRun time changes
Modules test summaryCompared against 5b391df in job civet.inl.gov/job/3787211. Added tests
Run time changes
|
refs #32806
Reason
ElementJacobianDamperalready limits large element Jacobian changes on the displaced mesh, butits probe path can still encounter a degenerate map when the full trial Newton update inverts an
element. In that case the solve falls back to a timestep cutback instead of trying a smaller
nonlinear update first.
This change adds an opt-in backtracking mode so the damper can reduce the probed update before FE
assembly reaches a
DegenerateMap.Design
use_backtracking,backtrack_factor, andmax_backtrack_stepsparameters toElementJacobianDamper.relative
JxWchange.then iteratively reduce the trial damping until the probe succeeds and the Jacobian increment is
below
max_increment.displaced mesh in a modified state.
Impact
This is a backward-compatible enhancement to
ElementJacobianDamper.use_backtracking = true.nonlinear update due to temporary element inversion.
Testing
exception_handling.iwithout backtracking to confirm the existing negative-Jacobian path ispreserved.
exception_handling.iwithDampers/jac/use_backtracking=trueto confirm the damper nowreduces the update without emitting the negative-Jacobian error.
git diff --check.