SERiF v0.0.1a
Stellar Evolution and Rotation in Four Dimensions
Loading...
Searching...
No Matches
serif::solver::SolveResult< State, System, Model > Class Template Reference

Own the last accepted physical state, matching frozen system, and descriptive model. More...

#include <result.hpp>

Collaboration diagram for serif::solver::SolveResult< State, System, Model >:
[legend]

Public Member Functions

 SolveResult (std::shared_ptr< const Model > model={})
 Retain the physical definition before any numerical attempt is made.
 
bool converged () const noexcept
 True only after the complete nonlinear convergence test succeeds.
 
bool has_state () const noexcept
 Distinguish a usable accepted checkpoint from a rejected initial guess.
 
const State & state () const
 Read the last accepted physical coefficients; reject access when none were evaluated.
 
const std::shared_ptr< const System > & system () const noexcept
 Retain or inspect the exact residual and Jacobian belonging to state().
 
const Model & model () const
 Read the physical definition owned by a stellar result.
 
const SolveDiagnostics & diagnostics () const noexcept
 Inspect work counts and final convergence measurements.
 
SolveStatus status () const noexcept
 Inspect the numerical reason for termination.
 
const std::string & message () const noexcept
 Read the diagnostic associated with numerical termination.
 
bool has_checkpoint () const noexcept
 Whether this accepted boundary has supported, complete numerical restart data.
 
NewtonCheckpoint< State > checkpoint () const
 Copy a portable accepted boundary without retaining runtime operators or caches.
 
void checkpoint (NewtonProgress progress)
 Record history only after all accepted-step correction and step-length updates are complete.
 
void accept (State state, std::shared_ptr< const System > system)
 Publish a complete state/system pair only after candidate preparation succeeds.
 
void finish (SolveStatus status, std::string message, SolveDiagnostics diagnostics)
 Finalize bounded diagnostics without altering the accepted checkpoint.
 

Private Attributes

std::shared_ptr< const Model > m_model
 
std::optional< State > m_state
 
std::shared_ptr< const System > m_system
 
std::optional< NewtonProgress > m_progress
 
SolveStatus m_status {SolveStatus::initial_state_rejected}
 
std::string m_message
 
SolveDiagnostics m_diagnostics
 

Detailed Description

template<typename State, typename System, typename Model = NoModel>
class serif::solver::SolveResult< State, System, Model >

Own the last accepted physical state, matching frozen system, and descriptive model.

Note
A failed initial evaluation has no accepted state. A later failure retains the last accepted star, which remains usable after the solver and its dependency cache are destroyed.

Constructor & Destructor Documentation

◆ SolveResult()

template<typename State, typename System, typename Model = NoModel>
serif::solver::SolveResult< State, System, Model >::SolveResult ( std::shared_ptr< const Model > model = {})
inlineexplicit

Retain the physical definition before any numerical attempt is made.

Member Function Documentation

◆ accept()

template<typename State, typename System, typename Model = NoModel>
void serif::solver::SolveResult< State, System, Model >::accept ( State state,
std::shared_ptr< const System > system )
inline

Publish a complete state/system pair only after candidate preparation succeeds.

◆ checkpoint() [1/2]

template<typename State, typename System, typename Model = NoModel>
NewtonCheckpoint< State > serif::solver::SolveResult< State, System, Model >::checkpoint ( ) const
inlinenodiscard

Copy a portable accepted boundary without retaining runtime operators or caches.

◆ checkpoint() [2/2]

template<typename State, typename System, typename Model = NoModel>
void serif::solver::SolveResult< State, System, Model >::checkpoint ( NewtonProgress progress)
inline

Record history only after all accepted-step correction and step-length updates are complete.

◆ converged()

template<typename State, typename System, typename Model = NoModel>
bool serif::solver::SolveResult< State, System, Model >::converged ( ) const
inlinenodiscardnoexcept

True only after the complete nonlinear convergence test succeeds.

◆ diagnostics()

template<typename State, typename System, typename Model = NoModel>
const SolveDiagnostics & serif::solver::SolveResult< State, System, Model >::diagnostics ( ) const
inlinenodiscardnoexcept

Inspect work counts and final convergence measurements.

◆ finish()

template<typename State, typename System, typename Model = NoModel>
void serif::solver::SolveResult< State, System, Model >::finish ( SolveStatus status,
std::string message,
SolveDiagnostics diagnostics )
inline

Finalize bounded diagnostics without altering the accepted checkpoint.

◆ has_checkpoint()

template<typename State, typename System, typename Model = NoModel>
bool serif::solver::SolveResult< State, System, Model >::has_checkpoint ( ) const
inlinenodiscardnoexcept

Whether this accepted boundary has supported, complete numerical restart data.

◆ has_state()

template<typename State, typename System, typename Model = NoModel>
bool serif::solver::SolveResult< State, System, Model >::has_state ( ) const
inlinenodiscardnoexcept

Distinguish a usable accepted checkpoint from a rejected initial guess.

◆ message()

template<typename State, typename System, typename Model = NoModel>
const std::string & serif::solver::SolveResult< State, System, Model >::message ( ) const
inlinenodiscardnoexcept

Read the diagnostic associated with numerical termination.

◆ model()

template<typename State, typename System, typename Model = NoModel>
const Model & serif::solver::SolveResult< State, System, Model >::model ( ) const
inlinenodiscard

Read the physical definition owned by a stellar result.

◆ state()

template<typename State, typename System, typename Model = NoModel>
const State & serif::solver::SolveResult< State, System, Model >::state ( ) const
inlinenodiscard

Read the last accepted physical coefficients; reject access when none were evaluated.

◆ status()

template<typename State, typename System, typename Model = NoModel>
SolveStatus serif::solver::SolveResult< State, System, Model >::status ( ) const
inlinenodiscardnoexcept

Inspect the numerical reason for termination.

◆ system()

template<typename State, typename System, typename Model = NoModel>
const std::shared_ptr< const System > & serif::solver::SolveResult< State, System, Model >::system ( ) const
inlinenodiscardnoexcept

Retain or inspect the exact residual and Jacobian belonging to state().

Member Data Documentation

◆ m_diagnostics

template<typename State, typename System, typename Model = NoModel>
SolveDiagnostics serif::solver::SolveResult< State, System, Model >::m_diagnostics
private

◆ m_message

template<typename State, typename System, typename Model = NoModel>
std::string serif::solver::SolveResult< State, System, Model >::m_message
private

◆ m_model

template<typename State, typename System, typename Model = NoModel>
std::shared_ptr<const Model> serif::solver::SolveResult< State, System, Model >::m_model
private

◆ m_progress

template<typename State, typename System, typename Model = NoModel>
std::optional<NewtonProgress> serif::solver::SolveResult< State, System, Model >::m_progress
private

◆ m_state

template<typename State, typename System, typename Model = NoModel>
std::optional<State> serif::solver::SolveResult< State, System, Model >::m_state
private

◆ m_status

template<typename State, typename System, typename Model = NoModel>
SolveStatus serif::solver::SolveResult< State, System, Model >::m_status {SolveStatus::initial_state_rejected}
private

◆ m_system

template<typename State, typename System, typename Model = NoModel>
std::shared_ptr<const System> serif::solver::SolveResult< State, System, Model >::m_system
private

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