|
opm-simulators
|
Context for iteration-dependent decisions in the Newton solver. More...
#include <NewtonIterationContext.hpp>
Public Member Functions | |
| int | iteration () const |
| Getters. | |
| bool | inLocalSolve () const |
| Whether we are inside a domain-local solve (NLDD). | |
| bool | timestepInitialized () const |
| Whether timestep initialization has been performed. | |
| bool | needsTimestepInit () const |
| Semantic Queries. | |
| bool | isFirstGlobalIteration () const |
| Is this the first iteration of the global solve (not a local solve)? | |
| bool | withinNupcol (int nupcol) const |
| Are we within the NUPCOL iteration window? | |
| bool | shouldRelax (int strictIterations) const |
| Should tolerances be relaxed based on iteration count? | |
| bool | shouldRunInnerWellIterations (int maxIter) const |
| Whether inner well iterations should run. | |
| void | markTimestepInitialized () |
| State Mutations. | |
| void | advanceIteration () |
| Advance the current iteration counter. | |
| void | resetForNewTimestep () |
| Reset all state for a new timestep. | |
| NewtonIterationContext | forLocalSolve () const |
| Create a context for a domain-local solve. | |
Context for iteration-dependent decisions in the Newton solver.
Provides explicit state for iteration-dependent behavior:
For domain-local solves, forLocalSolve() creates a context that preserves the global iteration but resets local state.
|
inline |
Advance the current iteration counter.
Advances the local iteration during domain-local solves, and the global iteration otherwise.
|
inline |
Create a context for a domain-local solve.
Preserves global iteration, resets local iteration to 0.
|
inline |
Is this the first iteration of the global solve (not a local solve)?
Use for one-time-per-timestep logic
|
inline |
Getters.
Current iteration number (0-based). Returns the local iteration during domain-local solves, and the global iteration otherwise.
|
inline |
State Mutations.
Mark timestep initialization as complete.
|
inline |
Semantic Queries.
Should timestep initialization run? True only on first global iteration before initialization is done.
|
inline |
Should tolerances be relaxed based on iteration count?
Uses local iteration for local solves, global otherwise.
|
inline |
Whether inner well iterations should run.
Returns false during local solves, otherwise true while below maxIter.
|
inline |
Are we within the NUPCOL iteration window?
Always uses global iteration regardless of local solve state.