Continue symplectic integrators after finite Newton maxiter#486
Closed
krystophny wants to merge 3 commits into
Closed
Continue symplectic integrators after finite Newton maxiter#486krystophny wants to merge 3 commits into
krystophny wants to merge 3 commits into
Conversation
Member
Author
|
Superseded by #487, which preserves bounded continuation while rejecting excessive or non-finite corrections and keeps numerical failures distinct from physical losses. |
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.
Risk tier
Correctness contract
Intended behavior change
All symplectic integrators accept the final Newton iterate after the configured
iteration limit if every state component is finite. This restores the warning
and continue behavior used before #457 for Euler 1, Euler 2, midpoint, Gauss
orders 1 through 4, and Lobatto 3.
symplectic_newton_warning_mode = .false.restores strict termination.
Each accepted maximum-iteration step increments its integrator-specific
diagnostic counter. Midpoint now has a separate
midpoint_maxitcounter.Behavior that must not change
Converged steps use the same discrete maps, timestep, nonlinear equations,
tolerances, iteration limits, and update order. LCFS, wall, outside-domain,
singular-linear-system, non-finite, and unresolved-boundary-event failures
remain terminal. Strict mode rolls back the integrator and field to the last
accepted step.
The canonical state remains
(s, theta, phi, p_phi), with normalized toroidalflux
sand angles in radians. Field, time, energy, and momentum units areunchanged. This change does not alter the Hamiltonian, source distribution,
field, wall, boundary conditions, or symmetry.
Numerical limitation
The accepted maximum-iteration state has not met the configured nonlinear
tolerance, so that step only approximately satisfies its discrete symplectic
map. The unchanged counters expose every such step.
CPU and GPU behavior
The CPU implementation covers every symplectic integrator. The GPU path uses
the same warning-mode rule for its Euler solver. NaN and infinity rejection
uses IEEE-754 exponent bits because the fast-math build can optimize
ieee_is_finiteincorrectly. The finite-state check runs only after Newtonreaches its iteration limit; the converged hot path is unchanged.
Tests added
4, and Lobatto 3
Golden-record impact
Verification
The non-finite regression failed before the bit-pattern check: warning mode
accepted a NaN under fast-math. It passes with this commit.
The skipped chartmap test records the existing libneo issue #179 condition.