SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::solver::detail Namespace Reference

Classes

struct  InitialEvaluation
 Keep a freshly qualified metric beside the exact system from which it was measured. More...
 
struct  NewtonFailure
 Explain why a candidate cannot provide a usable nonlinear metric. More...
 
struct  QualifiedStep
 Own a qualified trial; a terminal root deliberately has no prepared inverse. More...
 
class  SolveObservation
 Adapt callbacks and latch requests; only the Newton driver decides when stopping is safe. More...
 

Concepts

concept  NewtonStrategyFor
 A custom method must supply the exact correction contract; malformed overrides never select a fallback.
 

Functions

template<typename Problem, typename State, typename Options, typename Observer>
auto run_newton (Problem &problem, State initial_state, Options options, Observer observer, std::optional< NewtonProgress > restart)
 Find equilibrium while retaining the last fully qualified physical state.
 
std::optional< std::string > preparation_rejection (const auto &problem, const auto &evaluation)
 Preserve numerical preparation failures while propagating invalid physical configurations.
 
std::expected< MetricEvaluation, NewtonFailure > qualify_candidate (auto &problem, const auto &state, const auto &evaluation, auto &metric_function, auto &strategy, TrialAssessment assessment={})
 Qualify one already evaluated candidate through the same physical and metric gates everywhere.
 
bool finite_correction (std::span< const double > correction, const int expected_size)
 Every custom backend must preserve the correction dimensions and finite coefficients.
 
void validate_start (const auto &options, const std::optional< NewtonProgress > &restart, std::size_t size)
 Validate controls and restored history before any physical preparation.
 
template<typename Problem>
std::expected< InitialEvaluation< typename Problem::System >, NewtonFailure > evaluate_start (Problem &problem, auto &state, auto &options, const std::optional< NewtonProgress > &restart, SolveDiagnostics &diagnostics)
 Qualify the initial state and verify a restart against its original convergence reference.
 
std::expected< DirectionAssessment, NewtonFailure > compute_direction (auto &problem, const auto &accepted, const auto &prepared, auto &options, SolveDiagnostics &diagnostics, auto &rhs, auto &correction, std::span< double > physical_direction)
 Solve and qualify a normalized correction before exposing its physical direction to backtracking.
 
template<typename Problem, typename State, typename System, typename Model>
auto find_acceptable_step (Problem &problem, const SolveResult< State, System, Model > &accepted, MetricEvaluation accepted_metric, const auto &correction, std::span< const double > physical_direction, const DirectionAssessment &direction, double step, auto &options, SolveDiagnostics &diagnostics, auto &observation)
 Find a safe, sufficiently decreasing candidate without changing the accepted state.
 
void save_progress (auto &result, auto &options, SolveDiagnostics &diagnostics, MetricEvaluation metric, std::span< const double > correction, double next_step)
 Snapshot only fully committed numerical history; reporting has no influence on restart.
 

Variables

template<typename Options>
constexpr bool checkpointable_options
 Only built-in stateless numerical policies currently have a complete restart contract.
 

Function Documentation

◆ compute_direction()

std::expected< DirectionAssessment, NewtonFailure > serif::solver::detail::compute_direction ( auto & problem,
const auto & accepted,
const auto & prepared,
auto & options,
SolveDiagnostics & diagnostics,
auto & rhs,
auto & correction,
std::span< double > physical_direction )
nodiscard

Solve and qualify a normalized correction before exposing its physical direction to backtracking.

◆ evaluate_start()

template<typename Problem>
std::expected< InitialEvaluation< typename Problem::System >, NewtonFailure > serif::solver::detail::evaluate_start ( Problem & problem,
auto & state,
auto & options,
const std::optional< NewtonProgress > & restart,
SolveDiagnostics & diagnostics )
nodiscard

Qualify the initial state and verify a restart against its original convergence reference.

◆ find_acceptable_step()

template<typename Problem, typename State, typename System, typename Model>
auto serif::solver::detail::find_acceptable_step ( Problem & problem,
const SolveResult< State, System, Model > & accepted,
MetricEvaluation accepted_metric,
const auto & correction,
std::span< const double > physical_direction,
const DirectionAssessment & direction,
double step,
auto & options,
SolveDiagnostics & diagnostics,
auto & observation )
nodiscard

Find a safe, sufficiently decreasing candidate without changing the accepted state.

Note
A nonterminal candidate must prepare its inverse before publication. Preparation failure terminates this attempt; the caller still owns the previously accepted physical star.

◆ finite_correction()

bool serif::solver::detail::finite_correction ( std::span< const double > correction,
const int expected_size )
inlinenodiscard

Every custom backend must preserve the correction dimensions and finite coefficients.

◆ preparation_rejection()

std::optional< std::string > serif::solver::detail::preparation_rejection ( const auto & problem,
const auto & evaluation )
inlinenodiscard

Preserve numerical preparation failures while propagating invalid physical configurations.

◆ qualify_candidate()

std::expected< MetricEvaluation, NewtonFailure > serif::solver::detail::qualify_candidate ( auto & problem,
const auto & state,
const auto & evaluation,
auto & metric_function,
auto & strategy,
TrialAssessment assessment = {} )
inlinenodiscard

Qualify one already evaluated candidate through the same physical and metric gates everywhere.

◆ run_newton()

template<typename Problem, typename State, typename Options, typename Observer>
auto serif::solver::detail::run_newton ( Problem & problem,
State initial_state,
Options options,
Observer observer,
std::optional< NewtonProgress > restart )
nodiscard

Find equilibrium while retaining the last fully qualified physical state.

Note
Preparation belongs to the problem; this driver alone publishes accepted steps. Scratch vectors use the problem's native storage. Timing belongs entirely to observers.

◆ save_progress()

void serif::solver::detail::save_progress ( auto & result,
auto & options,
SolveDiagnostics & diagnostics,
MetricEvaluation metric,
std::span< const double > correction,
double next_step )

Snapshot only fully committed numerical history; reporting has no influence on restart.

◆ validate_start()

void serif::solver::detail::validate_start ( const auto & options,
const std::optional< NewtonProgress > & restart,
std::size_t size )

Validate controls and restored history before any physical preparation.

Variable Documentation

◆ checkpointable_options

template<typename Options>
bool serif::solver::detail::checkpointable_options
inlineconstexpr
Initial value:
=
std::same_as<std::remove_cvref_t<decltype(std::declval<Options>().strategies)>, StandardNewton> &&
std::same_as<std::remove_cvref_t<decltype(std::declval<Options>().metric)>, NormalizedResidualMetric> &&
std::same_as<std::remove_cvref_t<decltype(std::declval<Options>().linear_solver)>, linear::FGMRES>
Use the Euclidean norm of SERiF's normalized residual and half its square.
Definition options.hpp:53
Ordinary Newton supplies every strategy phase; custom policies may replace individual phases explicit...
Definition options.hpp:74
Flexible GMRES accepts both fixed linear inverses and variable inner preconditioners.
Definition linear.hpp:23

Only built-in stateless numerical policies currently have a complete restart contract.