MFEM v4.8.0
Finite element discretization library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
mfem::IterativeSolverController Class Reference

Abstract base class for an iterative solver controller. More...

#include <solvers.hpp>

Inheritance diagram for mfem::IterativeSolverController:
[legend]
Collaboration diagram for mfem::IterativeSolverController:
[legend]

Public Member Functions

 IterativeSolverController ()
 
virtual ~IterativeSolverController ()
 
bool HasConverged ()
 
virtual void Reset ()
 
virtual void MonitorResidual (int it, real_t norm, const Vector &r, bool final)
 Monitor the solution vector r.
 
virtual void MonitorSolution (int it, real_t norm, const Vector &x, bool final)
 Monitor the solution vector x.
 
void SetIterativeSolver (const IterativeSolver &solver)
 This method is invoked by IterativeSolver::SetMonitor, informing the monitor which IterativeSolver is using it.
 

Protected Attributes

const class IterativeSolveriter_solver
 The last IterativeSolver to which this controller was attached.
 
bool converged = false
 

Detailed Description

Abstract base class for an iterative solver controller.

Definition at line 36 of file solvers.hpp.

Constructor & Destructor Documentation

◆ IterativeSolverController()

mfem::IterativeSolverController::IterativeSolverController ( )
inline

Definition at line 47 of file solvers.hpp.

◆ ~IterativeSolverController()

virtual mfem::IterativeSolverController::~IterativeSolverController ( )
inlinevirtual

Definition at line 49 of file solvers.hpp.

Member Function Documentation

◆ HasConverged()

bool mfem::IterativeSolverController::HasConverged ( )
inline

Has the solver converged?

Can be used if convergence is detected in the controller (before reaching the relative or absolute tolerance of the IterativeSolver).

Definition at line 55 of file solvers.hpp.

◆ MonitorResidual()

virtual void mfem::IterativeSolverController::MonitorResidual ( int it,
real_t norm,
const Vector & r,
bool final )
inlinevirtual

Monitor the solution vector r.

Reimplemented in mfem::ResidualBCMonitor.

Definition at line 64 of file solvers.hpp.

◆ MonitorSolution()

virtual void mfem::IterativeSolverController::MonitorSolution ( int it,
real_t norm,
const Vector & x,
bool final )
inlinevirtual

Monitor the solution vector x.

Definition at line 70 of file solvers.hpp.

◆ Reset()

virtual void mfem::IterativeSolverController::Reset ( )
inlinevirtual

Reset the controller to its initial state.

This function is called by the IterativeSolver::Mult() method on the first iteration.

Definition at line 61 of file solvers.hpp.

◆ SetIterativeSolver()

void mfem::IterativeSolverController::SetIterativeSolver ( const IterativeSolver & solver)
inline

This method is invoked by IterativeSolver::SetMonitor, informing the monitor which IterativeSolver is using it.

Definition at line 77 of file solvers.hpp.

Member Data Documentation

◆ converged

bool mfem::IterativeSolverController::converged = false
protected

In MonitorResidual or MonitorSolution, this member variable can be set to true to indicate early convergence.

Definition at line 44 of file solvers.hpp.

◆ iter_solver

const class IterativeSolver* mfem::IterativeSolverController::iter_solver
protected

The last IterativeSolver to which this controller was attached.

Definition at line 40 of file solvers.hpp.


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