SpECTRE  v2024.05.11
Convergence::Criteria Struct Reference

Criteria that determine an iterative algorithm has converged. More...

#include <Criteria.hpp>


struct  AbsoluteResidual
struct  MaxIterations
struct  RelativeResidual

Public Types

using options = tmpl::list< MaxIterations, AbsoluteResidual, RelativeResidual >

Public Member Functions

 Criteria (size_t max_iterations_in, double absolute_residual_in, double relative_residual_in)
void pup (PUP::er &p)

Public Attributes

size_t max_iterations {}
double absolute_residual {}
double relative_residual {}

Static Public Attributes

static constexpr Options::String help

Detailed Description

Criteria that determine an iterative algorithm has converged.


Most criteria are based on a residual magnitude \(r_k\) after completion of an iteration \(k\) (see, for instance, the Linear Solver documentation, LinearSolver::Tags::Residual and LinearSolver::Tags::Magnitude).

The following criteria are implemented, ordered from highest to lowest priority:

  • AbsoluteResidual: Matches if the residual has reached this magnitude.
  • RelativeResidual: Matches if the residual has decreased by this factor, relative to the start of the first iteration.
  • MaxIterations: Matches if the number of iterations exceeds this limit.

Member Data Documentation

◆ help

constexpr Options::String Convergence::Criteria::help
Initial value:
"The algorithm terminates when any of these criteria is matched."

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