Belos  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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>

Inheritance diagram for Belos::Details::LinearSolver< MV, OP, ScalarType, NormType >:
Inheritance graph
[legend]

Public Member Functions

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

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 44 of file Belos_Details_LinearSolver.hpp.

Constructor & Destructor Documentation

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 59 of file Belos_Details_LinearSolver.hpp.

template<class MV , class OP , class ScalarType , class NormType >
virtual Belos::Details::LinearSolver< MV, OP, ScalarType, NormType >::~LinearSolver ( )
inlinevirtual

Destructor (virtual for memory safety).

Reimplemented from Trilinos::Details::LinearSolver< MV, OP, NormType >.

Definition at line 68 of file Belos_Details_LinearSolver.hpp.

Member Function Documentation

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

Set the solver's matrix.

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

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

Definition at line 74 of file Belos_Details_LinearSolver.hpp.

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

Get the solver's matrix.

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

Definition at line 83 of file Belos_Details_LinearSolver.hpp.

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

Solve the linear system AX=B for X.

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

Definition at line 92 of file Belos_Details_LinearSolver.hpp.

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

Set the solver's parameters.

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

Definition at line 119 of file Belos_Details_LinearSolver.hpp.

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

Precompute for matrix structure changes.

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

Definition at line 127 of file Belos_Details_LinearSolver.hpp.

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

Precompute for matrix values' changes.

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

Definition at line 141 of file Belos_Details_LinearSolver.hpp.


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

Generated on Fri Nov 22 2024 09:23:08 for Belos by doxygen 1.8.5