template<class LinearSystem>
Rodin::Solver::SolverBase class

Abstract base class for linear algebra solvers.

Template parameters
LinearSystem Type of linear system to solve

Base class for linear system solvers.

Represents an object which can solve sysystems of the type:

\[ Ax = b \: , \]

where $ A $ has type $ \text{OperatorType} $ , the solution $ x $ has type $ \text{VectorType} $ , and the right hand side $ b $ has type $ \text{VectorType} $ .

This abstract base class defines the interface for solving linear systems of equations. Derived classes implement specific solver algorithms such as direct factorization methods or iterative methods.

Base classes

class Copyable
Abstract base class for objects that can be copied.

Public types

using ScalarType = typename FormLanguage::Traits<LinearSystem>::ScalarType
Scalar type used in the linear system.
using VectorType = typename FormLanguage::Traits<LinearSystem>::VectorType
Vector type for solution and right-hand side.
using OperatorType = typename FormLanguage::Traits<LinearSystem>::OperatorType
Operator (matrix) type for the linear system.
using ProblemBaseType = Variational::ProblemBase<LinearSystem>
Base problem type.
using Parent = Copyable
Parent class type.

Constructors, destructors, conversion operators

~SolverBase() defaulted virtual
Default virtual destructor.
SolverBase(ProblemBaseType& pb)
Constructs a solver for the given problem.
SolverBase(const SolverBase& other)
Copy constructor.
SolverBase(SolverBase&& other)
Move constructor.

Public functions

void solve()
Solves the associated problem.
void solve(LinearSystem& system) pure virtual
Solves the linear system.

Function documentation

template<class LinearSystem>
Rodin::Solver::SolverBase<LinearSystem>::SolverBase(ProblemBaseType& pb)

Constructs a solver for the given problem.

Parameters
pb Reference to the problem to solve

template<class LinearSystem>
Rodin::Solver::SolverBase<LinearSystem>::SolverBase(const SolverBase& other)

Copy constructor.

Parameters
other Solver to copy from

template<class LinearSystem>
Rodin::Solver::SolverBase<LinearSystem>::SolverBase(SolverBase&& other)

Move constructor.

Parameters
other Solver to move from

template<class LinearSystem>
void Rodin::Solver::SolverBase<LinearSystem>::solve()

Solves the associated problem.

This method delegates solving to the problem's solve method, passing this solver as the argument.

template<class LinearSystem>
void Rodin::Solver::SolverBase<LinearSystem>::solve(LinearSystem& system) pure virtual

Solves the linear system.

Parameters
system in/out The linear system to solve. The solution is stored in the system's solution vector.

Solves the linear system $ Ax = b $ where $ A $ is the matrix operator, $ x $ is the solution vector, and $ b $ is the right-hand side vector.