Belos Version of the Day
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Belos::Details::LinearSolver< MV, OP, ScalarType, NormType > Class Template Reference

Belos' implementation of Trilinos::Details::LinearSolver. More...

#include <Belos_Details_LinearSolver.hpp>

Inherits Trilinos::Details::LinearSolver< MV, OP, NormType >.

Public Member Functions

 LinearSolver (const std::string &solverName)
 Constructor.
 
virtual ~LinearSolver ()
 Destructor (virtual for memory safety).
 
void setMatrix (const Teuchos::RCP< const OP > &A)
 Set the solver's matrix.
 
Teuchos::RCP< const OP > getMatrix () const
 Get the solver's matrix.
 
void solve (MV &X, const MV &B)
 Solve the linear system AX=B for X.
 
void setParameters (const Teuchos::RCP< Teuchos::ParameterList > &params)
 Set the solver's parameters.
 
void symbolic ()
 Precompute for matrix structure changes.
 
void numeric ()
 Precompute for matrix values' changes.
 

Detailed Description

template<class MV, class OP, class ScalarType, class NormType>
class Belos::Details::LinearSolver< MV, OP, ScalarType, NormType >

Belos' implementation of Trilinos::Details::LinearSolver.

Belos' implementation of Trilinos::Details::LinearSolverFactory.

Note to developers: The main question for developers writing a package's implementation of LinearSolver, is whether it can just wrap the package's solver interface directly. (This means that the LinearSolver subclass' constructor just takes an RCP to the package's solver.) If not, then the LinearSolver needs a "factory" inside that can create solvers from that package. This complicates the code a bit and may add to build time.

Belos lets users create a SolverManager without a matrix, and change the matrix after creation. However, Belos solvers can't handle changes to the matrix's domain or range Maps. (Supposedly they should be able to do this, but implementations of SolverManager::reset tend just to call setProblem() without reallocating the basis.) It's safest in this case to destroy the solver and start over. SolverManager instances don't know how to clone themselves in an uninitialized state. This means that LinearSolver cannot wrap the SolverManager directly; it must be able to create Belos solvers inside.

Definition at line 76 of file Belos_Details_LinearSolver.hpp.

Constructor & Destructor Documentation

◆ LinearSolver()

template<class MV , class OP , class ScalarType , class NormType >
Belos::Details::LinearSolver< MV, OP, ScalarType, NormType >::LinearSolver ( const std::string & solverName)
inline

Constructor.

Parameters
solverNameThe name of the Belos::SolverManager instance to create.

Definition at line 91 of file Belos_Details_LinearSolver.hpp.

◆ ~LinearSolver()

Destructor (virtual for memory safety).

Definition at line 100 of file Belos_Details_LinearSolver.hpp.

Member Function Documentation

◆ setMatrix()

template<class MV , class OP , class ScalarType , class NormType >
void Belos::Details::LinearSolver< MV, OP, ScalarType, NormType >::setMatrix ( const Teuchos::RCP< const OP > & A)
inline

Set the solver's matrix.

Parameters
A[in] Pointer to the matrix A in the linear system(s) AX=B to solve.

Definition at line 106 of file Belos_Details_LinearSolver.hpp.

◆ getMatrix()

template<class MV , class OP , class ScalarType , class NormType >
Teuchos::RCP< const OP > Belos::Details::LinearSolver< MV, OP, ScalarType, NormType >::getMatrix ( ) const
inline

Get the solver's matrix.

Definition at line 115 of file Belos_Details_LinearSolver.hpp.

◆ solve()

template<class MV , class OP , class ScalarType , class NormType >
void Belos::Details::LinearSolver< MV, OP, ScalarType, NormType >::solve ( MV & X,
const MV & B )
inline

Solve the linear system AX=B for X.

Definition at line 124 of file Belos_Details_LinearSolver.hpp.

◆ setParameters()

template<class MV , class OP , class ScalarType , class NormType >
void Belos::Details::LinearSolver< MV, OP, ScalarType, NormType >::setParameters ( const Teuchos::RCP< Teuchos::ParameterList > & params)
inline

Set the solver's parameters.

Definition at line 151 of file Belos_Details_LinearSolver.hpp.

◆ symbolic()

template<class MV , class OP , class ScalarType , class NormType >
void Belos::Details::LinearSolver< MV, OP, ScalarType, NormType >::symbolic ( )
inline

Precompute for matrix structure changes.

Definition at line 159 of file Belos_Details_LinearSolver.hpp.

◆ numeric()

template<class MV , class OP , class ScalarType , class NormType >
void Belos::Details::LinearSolver< MV, OP, ScalarType, NormType >::numeric ( )
inline

Precompute for matrix values' changes.

Definition at line 173 of file Belos_Details_LinearSolver.hpp.


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

Generated for Belos by doxygen 1.10.0