NewtonOptions Struct ReferenceΒΆ

adc_cpp: pops::NewtonOptions Struct Reference
adc_cpp 0.3.0
Model-free C++23 core for coupled hyperbolic-elliptic systems on adaptive (AMR) meshes, with MPI and GPU (Kokkos) backends
pops::NewtonOptions Struct Reference

Options of the local Newton of the implicit source (backward-Euler). More...

#include <implicit_stepper.hpp>

+ Collaboration diagram for pops::NewtonOptions:

Public Attributes

int max_iters = 2
 
Real rel_tol = Real(0)
 
Real abs_tol = Real(0)
 
Real fd_eps = Real(1e-7)
 
Real damping = Real(1)
 
int fail_policy = kFailNone
 

Static Public Attributes

static constexpr int kFailNone = 0
 
static constexpr int kFailWarn = 1
 
static constexpr int kFailThrow = 2
 

Detailed Description

Options of the local Newton of the implicit source (backward-Euler).

The DEFAULTS reproduce EXACTLY the historical behavior: 2 FIXED iterations, no residual evaluation (rel_tol == abs_tol == 0 -> no stop test, no extra cost), finite-difference Jacobian step h = fd_eps*|w| + fd_eps with fd_eps = 1e-7 (the constant historically hard-coded). Device-clean POD (passed BY VALUE into the kernel).

  • max_iters: Newton iteration budget (historical: 2).
  • rel_tol / abs_tol: stop criterion ||F||_inf <= abs_tol + rel_tol*||F0||_inf, evaluated per CELL at the start of an iteration. 0/0 (default) = disabled -> bit-identical historical loop.
  • fd_eps: step (relative AND absolute floor) of the finite-difference Jacobian.
  • damping: damping factor of the update W -= damping * delta. 1 (default) = full Newton, bit-identical (multiplication by 1.0 exact in IEEE). < 1 = damped Newton (very stiff source / poor conditioning: robustness at the cost of speed).
  • fail_policy: HOST reaction (after reduction) to failed cells – kFailNone (default) = record only (historical); kFailWarn = one stderr warning per advance; kFailThrow = std::runtime_error with the offending cell. != kFailNone forces the instrumented path (detection required) – a pure observer, W unchanged.

Member Data Documentation

◆ abs_tol

Real pops::NewtonOptions::abs_tol = Real(0)

◆ damping

Real pops::NewtonOptions::damping = Real(1)

◆ fail_policy

int pops::NewtonOptions::fail_policy = kFailNone

◆ fd_eps

Real pops::NewtonOptions::fd_eps = Real(1e-7)

◆ kFailNone

constexpr int pops::NewtonOptions::kFailNone = 0
staticconstexpr

◆ kFailThrow

constexpr int pops::NewtonOptions::kFailThrow = 2
staticconstexpr

◆ kFailWarn

constexpr int pops::NewtonOptions::kFailWarn = 1
staticconstexpr

◆ max_iters

int pops::NewtonOptions::max_iters = 2

◆ rel_tol

Real pops::NewtonOptions::rel_tol = Real(0)

The documentation for this struct was generated from the following file: