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

Namespaces

namespace  admissibility
 
namespace  backend
 
namespace  continuation
 
namespace  detail
 
namespace  linear
 
namespace  normalization
 
namespace  preconditioner
 
namespace  seed
 

Classes

struct  Backtracking
 Shorten a Newton step until the complete residual merit decreases sufficiently. More...
 
struct  DirectionAssessment
 A modified direction must report whether it is usable and any measured merit slope. More...
 
struct  MetricEvaluation
 Separate the convergence norm from the line-search merit for custom metrics. More...
 
struct  Newton
 Accuracy and work limits for finding one equilibrium star. More...
 
struct  NewtonCheckpoint
 Own the accepted physical star and the small amount of Newton history needed to continue it. More...
 
struct  NewtonProgress
 Numerical continuation data at one accepted Newton boundary. More...
 
struct  NoModel
 Marker for algebraic tests and custom problems without a stellar description. More...
 
struct  NoObserver
 Disable observation without introducing runtime callback allocation. More...
 
struct  NormalizedResidualMetric
 Use the Euclidean norm of SERiF's normalized residual and half its square. More...
 
struct  SolveDiagnostics
 Bounded work totals; accepted physical snapshots are stored separately from diagnostics. More...
 
struct  SolveEvent
 Small event record suitable for logging without retaining every iterate. More...
 
class  SolveResult
 Own the last accepted physical state, matching frozen system, and descriptive model. More...
 
struct  SolverOptions
 Select numerical policies while keeping equilibrium physics in the model. More...
 
struct  SolveTiming
 Optional elapsed wall time, kept separately from numerical restart history. More...
 
struct  StandardNewton
 Ordinary Newton supplies every strategy phase; custom policies may replace individual phases explicitly. More...
 
class  TimedObserver
 Measure solves explicitly while retaining an ordinary progress or stop callback. More...
 
struct  TrialAssessment
 A numerical policy explicitly accepts its work or explains why this candidate must be rejected. More...
 

Typedefs

using VolumeOptions = operators::backend::mfem::VolumeOptions
 

Enumerations

enum class  SolveStatus {
  converged , initial_state_rejected , invalid_metric , preparation_failure ,
  linear_solve_failure , globalization_failure , maximum_iterations , stopped
}
 Numerical termination; invalid configuration and user callback errors remain exceptions. More...
 
enum class  EventKind {
  initial , before_iteration , trial_rejected , before_accept ,
  accepted , finished , resumed
}
 Events expose immutable accepted/trial snapshots; callbacks never decide acceptance. More...
 
enum class  SolveControl { continue_solve , stop }
 A stop request is remembered until the next initial, resumed or accepted Newton boundary. More...
 

Functions

template<typename Family, typename Factory, typename State, typename Options = SolverOptions<>>
requires std::copy_constructible<Options>
auto continue_equilibrium (const Family &family, Factory configure, const State &initial_state, continuation::Options< Family > continuation_options, Options solver_options=continuation::default_solver_options())
 Continue moving-star equilibria through an explicitly declared physical family.
 
template<typename Family, typename Factory, typename State>
auto continue_equilibrium (const Family &family, Factory configure, const State &initial_state)
 Start with the family's physics-owned default coordinates and bounded fallback route.
 
template<typename Family, typename Factory, typename State, typename Options = SolverOptions<>>
requires std::copy_constructible<Options>
auto continue_equilibrium (const Family &family, Factory configure, const State &initial_state, const Vector &displacement, continuation::Options< Family > continuation_options, Options solver_options=continuation::default_solver_options())
 Continue a fixed-geometry model while preserving its prescribed displacement.
 
template<typename Family, typename Factory, typename State>
auto continue_equilibrium (const Family &family, Factory configure, const State &initial_state, const Vector &displacement)
 Use the same default route and absolute qualification tolerance for fixed geometry.
 
template<typename Configuration, typename Layout, typename Options = SolverOptions<>, typename Observer = NoObserver, utils::dependencies::IsDependencyContext Inputs = utils::dependencies::DependencyContext<>, typename ObserverFactory = utils::dependencies::NoGraphObservers>
requires utils::dependencies::ContainsKey<discretization::blocks::surface_deformation::coefficients, typename Layout::Values>
auto solve_equilibrium (Configuration configuration, model::StellarState< Layout > initial_state, Options options={}, Observer observer={}, VolumeOptions volume_options={}, Inputs prescribed=Inputs{}, ObserverFactory observer_factory={})
 Solve a moving star from an owning physical initial state.
 
template<typename Configuration, typename Layout, typename Options = SolverOptions<>, typename Observer = NoObserver, utils::dependencies::IsDependencyContext Inputs = utils::dependencies::DependencyContext<>, typename ObserverFactory = utils::dependencies::NoGraphObservers>
requires (!utils::dependencies::ContainsKey<discretization::blocks::surface_deformation::coefficients, typename Layout::Values>)
auto solve_equilibrium (Configuration configuration, model::StellarState< Layout > initial_state, const Vector &displacement, Options options={}, Observer observer={}, VolumeOptions volume_options={}, Inputs prescribed=Inputs{}, ObserverFactory observer_factory={})
 Solve a fixed-geometry model with prescribed displacement outside its unknown vector.
 
template<typename Configuration, typename Layout, typename Options = SolverOptions<>, typename Observer = NoObserver, utils::dependencies::IsDependencyContext Inputs = utils::dependencies::DependencyContext<>, typename ObserverFactory = utils::dependencies::NoGraphObservers>
requires utils::dependencies::ContainsKey<discretization::blocks::surface_deformation::coefficients, typename Layout::Values>
auto resume_equilibrium (Configuration configuration, NewtonCheckpoint< model::StellarState< Layout > > checkpoint, Options options={}, Observer observer={}, VolumeOptions volume_options={}, Inputs prescribed=Inputs{}, ObserverFactory observer_factory={})
 Continue a moving-star checkpoint using reconstructed physical and numerical configuration.
 
template<typename Configuration, typename Layout, typename Options = SolverOptions<>, typename Observer = NoObserver, utils::dependencies::IsDependencyContext Inputs = utils::dependencies::DependencyContext<>, typename ObserverFactory = utils::dependencies::NoGraphObservers>
requires (!utils::dependencies::ContainsKey<discretization::blocks::surface_deformation::coefficients, typename Layout::Values>)
auto resume_equilibrium (Configuration configuration, NewtonCheckpoint< model::StellarState< Layout > > checkpoint, const Vector &displacement, Options options={}, Observer observer={}, VolumeOptions volume_options={}, Inputs prescribed=Inputs{}, ObserverFactory observer_factory={})
 Continue a fixed-geometry checkpoint with its separately restored prescribed displacement.
 
template<typename Problem, typename State, typename Options = SolverOptions<>, typename Observer = NoObserver>
requires detail::NewtonStrategyFor<Problem, State, Options>
auto solve_newton (Problem &problem, State initial_state, Options options={}, Observer observer={})
 Solve a custom numerical problem using its native Vector, evaluate, prepare and solve_linear operations.
 
template<typename Problem, typename State, typename Options = SolverOptions<>, typename Observer = NoObserver>
requires detail::NewtonStrategyFor<Problem, State, Options>
auto resume_newton (Problem &problem, NewtonCheckpoint< State > checkpoint, Options options={}, Observer observer={})
 Resume the original convergence reference, correction reuse, and cumulative work budget.
 
double next_backtracking_step (double rejected_step, double accepted_determinant, double rejected_determinant, bool inverted, const Backtracking &options) noexcept
 Skip only existing backtracking rungs when an inverted trial gives a finite boundary estimate.
 
std::optional< std::string > validate_newton_progress (const NewtonProgress &progress, const std::size_t state_size)
 Reject incomplete or inconsistent imported history before preparing any runtime operators.
 

Typedef Documentation

◆ VolumeOptions

Enumeration Type Documentation

◆ EventKind

enum class serif::solver::EventKind
strong

Events expose immutable accepted/trial snapshots; callbacks never decide acceptance.

Enumerator
initial 
before_iteration 
trial_rejected 
before_accept 
accepted 
finished 
resumed 

◆ SolveControl

enum class serif::solver::SolveControl
strong

A stop request is remembered until the next initial, resumed or accepted Newton boundary.

Enumerator
continue_solve 
stop 

◆ SolveStatus

enum class serif::solver::SolveStatus
strong

Numerical termination; invalid configuration and user callback errors remain exceptions.

Enumerator
converged 
initial_state_rejected 
invalid_metric 
preparation_failure 
linear_solve_failure 
globalization_failure 
maximum_iterations 
stopped 

Function Documentation

◆ continue_equilibrium() [1/4]

template<typename Family, typename Factory, typename State>
auto serif::solver::continue_equilibrium ( const Family & family,
Factory configure,
const State & initial_state )
nodiscard

Start with the family's physics-owned default coordinates and bounded fallback route.

◆ continue_equilibrium() [2/4]

template<typename Family, typename Factory, typename State>
auto serif::solver::continue_equilibrium ( const Family & family,
Factory configure,
const State & initial_state,
const Vector & displacement )
nodiscard

Use the same default route and absolute qualification tolerance for fixed geometry.

◆ continue_equilibrium() [3/4]

template<typename Family, typename Factory, typename State, typename Options = SolverOptions<>>
requires std::copy_constructible<Options>
auto serif::solver::continue_equilibrium ( const Family & family,
Factory configure,
const State & initial_state,
const Vector & displacement,
continuation::Options< Family > continuation_options,
Options solver_options = continuation::default_solver_options() )
nodiscard

Continue a fixed-geometry model while preserving its prescribed displacement.

◆ continue_equilibrium() [4/4]

template<typename Family, typename Factory, typename State, typename Options = SolverOptions<>>
requires std::copy_constructible<Options>
auto serif::solver::continue_equilibrium ( const Family & family,
Factory configure,
const State & initial_state,
continuation::Options< Family > continuation_options,
Options solver_options = continuation::default_solver_options() )
nodiscard

Continue moving-star equilibria through an explicitly declared physical family.

Parameters
configureOwn or borrow a callable that returns a configured discretization for its supplied model. It must preserve the physical coordinate layout and finite-element reference of transferred states; fresh evaluators are implicit.
Note
The explicit factory supports move-only resource policies without inventing a mutable clone/context hierarchy.

◆ next_backtracking_step()

double serif::solver::next_backtracking_step ( double rejected_step,
double accepted_determinant,
double rejected_determinant,
bool inverted,
const Backtracking & options )
nodiscardnoexcept

Skip only existing backtracking rungs when an inverted trial gives a finite boundary estimate.

◆ resume_equilibrium() [1/2]

template<typename Configuration, typename Layout, typename Options = SolverOptions<>, typename Observer = NoObserver, utils::dependencies::IsDependencyContext Inputs = utils::dependencies::DependencyContext<>, typename ObserverFactory = utils::dependencies::NoGraphObservers>
requires (!utils::dependencies::ContainsKey<discretization::blocks::surface_deformation::coefficients, typename Layout::Values>)
auto serif::solver::resume_equilibrium ( Configuration configuration,
NewtonCheckpoint< model::StellarState< Layout > > checkpoint,
const Vector & displacement,
Options options = {},
Observer observer = {},
VolumeOptions volume_options = {},
Inputs prescribed = Inputs{},
ObserverFactory observer_factory = {} )
nodiscard

Continue a fixed-geometry checkpoint with its separately restored prescribed displacement.

Note
The optional final observer factory measures graph work separately from physics and solver history. It is rebuilt for this solve and is not stored in the checkpoint.

◆ resume_equilibrium() [2/2]

template<typename Configuration, typename Layout, typename Options = SolverOptions<>, typename Observer = NoObserver, utils::dependencies::IsDependencyContext Inputs = utils::dependencies::DependencyContext<>, typename ObserverFactory = utils::dependencies::NoGraphObservers>
requires utils::dependencies::ContainsKey<discretization::blocks::surface_deformation::coefficients, typename Layout::Values>
auto serif::solver::resume_equilibrium ( Configuration configuration,
NewtonCheckpoint< model::StellarState< Layout > > checkpoint,
Options options = {},
Observer observer = {},
VolumeOptions volume_options = {},
Inputs prescribed = Inputs{},
ObserverFactory observer_factory = {} )
nodiscard

Continue a moving-star checkpoint using reconstructed physical and numerical configuration.

Note
The optional final observer factory measures graph work separately from physics and solver history. It is rebuilt for this solve and is not stored in the checkpoint.

◆ resume_newton()

template<typename Problem, typename State, typename Options = SolverOptions<>, typename Observer = NoObserver>
requires detail::NewtonStrategyFor<Problem, State, Options>
auto serif::solver::resume_newton ( Problem & problem,
NewtonCheckpoint< State > checkpoint,
Options options = {},
Observer observer = {} )
nodiscard

Resume the original convergence reference, correction reuse, and cumulative work budget.

◆ solve_equilibrium() [1/2]

template<typename Configuration, typename Layout, typename Options = SolverOptions<>, typename Observer = NoObserver, utils::dependencies::IsDependencyContext Inputs = utils::dependencies::DependencyContext<>, typename ObserverFactory = utils::dependencies::NoGraphObservers>
requires (!utils::dependencies::ContainsKey<discretization::blocks::surface_deformation::coefficients, typename Layout::Values>)
auto serif::solver::solve_equilibrium ( Configuration configuration,
model::StellarState< Layout > initial_state,
const Vector & displacement,
Options options = {},
Observer observer = {},
VolumeOptions volume_options = {},
Inputs prescribed = Inputs{},
ObserverFactory observer_factory = {} )
nodiscard

Solve a fixed-geometry model with prescribed displacement outside its unknown vector.

Note
The optional final observer factory measures graph work separately from physics and solver history. It is rebuilt for this solve and is not stored in the checkpoint.

◆ solve_equilibrium() [2/2]

template<typename Configuration, typename Layout, typename Options = SolverOptions<>, typename Observer = NoObserver, utils::dependencies::IsDependencyContext Inputs = utils::dependencies::DependencyContext<>, typename ObserverFactory = utils::dependencies::NoGraphObservers>
requires utils::dependencies::ContainsKey<discretization::blocks::surface_deformation::coefficients, typename Layout::Values>
auto serif::solver::solve_equilibrium ( Configuration configuration,
model::StellarState< Layout > initial_state,
Options options = {},
Observer observer = {},
VolumeOptions volume_options = {},
Inputs prescribed = Inputs{},
ObserverFactory observer_factory = {} )
nodiscard

Solve a moving star from an owning physical initial state.

Note
The model defines equilibrium; its evaluator and reusable cache are constructed internally. The returned result owns the last accepted physical star even when the solve does not converge. Initialize the backend's MPI runtime before using a recipe containing Hypre AMG. The optional final observer factory measures graph work separately from physics and solver history.

◆ solve_newton()

template<typename Problem, typename State, typename Options = SolverOptions<>, typename Observer = NoObserver>
requires detail::NewtonStrategyFor<Problem, State, Options>
auto serif::solver::solve_newton ( Problem & problem,
State initial_state,
Options options = {},
Observer observer = {} )
nodiscard

Solve a custom numerical problem using its native Vector, evaluate, prepare and solve_linear operations.

Note
Strategies here are executable numerical methods; solve_equilibrium uses the same strategies.

◆ validate_newton_progress()

std::optional< std::string > serif::solver::validate_newton_progress ( const NewtonProgress & progress,
const std::size_t state_size )
inlinenodiscard

Reject incomplete or inconsistent imported history before preparing any runtime operators.