Skip to content

Throw instead of asserting on a non-positive step and a non-finite change - #7355

Draft
hnil wants to merge 1 commit into
OPM:masterfrom
hnil:pr/asserts-to-throw
Draft

Throw instead of asserting on a non-positive step and a non-finite change#7355
hnil wants to merge 1 commit into
OPM:masterfrom
hnil:pr/asserts-to-throw

Conversation

@hnil

@hnil hnil commented Aug 24, 2026

Copy link
Copy Markdown
Member

Both conditions come from the run rather than a broken invariant, so they should be reported rather than vanish in a release build:

  • AdaptiveSimulatorTimer — five asserts that the step size is positive. If the controller ever hands over zero, an NDEBUG build carries on with it.
  • The convergence measure — a non-finite solution change is a diverging solution, not a programming error, and it is worth saying so.

Reapplied from #4566, which predates the ebos rename and no longer merges. All the target asserts are still there on master, just in renamed files, so the concern outlived the branch.

…ange

Both conditions come from the run rather than from a broken invariant, so
they should be reported rather than disappear in a release build:

- AdaptiveSimulatorTimer: five asserts that the step size is positive.  If
  the controller ever hands over zero, an NDEBUG build carries on with it.
- The convergence measure: a non-finite solution change is a diverging
  solution, not a programming error, and it is worth saying so.

Reapplied from OPM#4566, which predates the ebos rename and no longer merges.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hnil hnil added the manual:enhancement This is an enhancement/improvent that needs to be documented in the manual label Aug 24, 2026
@bska

bska commented Aug 25, 2026

Copy link
Copy Markdown
Member

Is there more work coming here? I only ask because the PR is in a draft state and not marked "ready for review" yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:enhancement This is an enhancement/improvent that needs to be documented in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants