Class Solver

Inheritance Relationships

Derived Types

Class Documentation

class Solver

Base class for solver lifecycle management.

Public lifecycle functions validate state before calling protected derived-class hooks. Execute() and Advance() also require successful initialization.

Subclassed by opensn::DiscreteOrdinatesSolver, opensn::UncollidedSolver

Public Functions

explicit Solver(std::string name)
explicit Solver(const InputParameters &params)
virtual ~Solver() = default
std::string GetName() const
void Initialize()

Validates and initializes the solver.

The solver is marked initialized only after InitializeSolver() and post-initialization validation succeed. Calling this again clears the previous initialized state first.

void Execute()

Validates the current state and executes the solver. Requires successful Initialize().

void Advance()

Validates the current state and advances one step. Requires successful Initialize().

virtual ParameterBlock GetInfo(const ParameterBlock &params) const

Generalized query for information supporting varying returns.

ParameterBlock GetInfoWithPreCheck(const ParameterBlock &params) const

PreCheck call to GetInfo.

inline bool IsBalanceEnabled() const

Public Static Functions

static InputParameters GetInputParameters()

Returns the input parameters.

Protected Functions

virtual void ValidateState() const = 0

Validates the solver’s options and the object it drives.

Called before each lifecycle hook and again after InitializeSolver(). Implementations throw std::invalid_argument for unsupported configurations. MPI implementations are collective.

virtual void InitializeSolver() = 0

Performs derived-class initialization after ValidateState() succeeds.

virtual void ExecuteSolver() = 0

Performs derived-class execution after initialization and validation succeed.

virtual void AdvanceSolver()

Performs one derived-class step. The default logs that Advance() is unsupported.