Belos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Types | Private Attributes | 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...
 

Private Types

typedef Belos::LinearProblem
< ScalarType, MV, OP > 
problem_type
 Belos::LinearProblem specialization used by this class. More...
 
typedef Belos::SolverManager
< ScalarType, MV, OP > 
solver_type
 Belos' own solver type. More...
 

Private Attributes

std::string solverName_
 The name of the Belos solver to create. More...
 
Teuchos::RCP< problem_typeproblem_
 The LinearProblem instance to give to the Belos solver. More...
 
Teuchos::RCP< solver_typesolver_
 The Belos solver (SolverManager instance). More...
 
Teuchos::RCP
< Teuchos::ParameterList
params_
 The Belos solver's list of parameters. 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 76 of file Belos_Details_LinearSolver.hpp.

Member Typedef Documentation

template<class MV , class OP , class ScalarType , class NormType >
typedef Belos::LinearProblem<ScalarType, MV, OP> Belos::Details::LinearSolver< MV, OP, ScalarType, NormType >::problem_type
private

Belos::LinearProblem specialization used by this class.

Definition at line 81 of file Belos_Details_LinearSolver.hpp.

template<class MV , class OP , class ScalarType , class NormType >
typedef Belos::SolverManager<ScalarType, MV, OP> Belos::Details::LinearSolver< MV, OP, ScalarType, NormType >::solver_type
private

Belos' own solver type.

Definition at line 83 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 91 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).

Definition at line 100 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 106 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 115 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 
)
inline

Solve the linear system AX=B for X.

Definition at line 124 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 151 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 159 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 173 of file Belos_Details_LinearSolver.hpp.

Member Data Documentation

template<class MV , class OP , class ScalarType , class NormType >
std::string Belos::Details::LinearSolver< MV, OP, ScalarType, NormType >::solverName_
private

The name of the Belos solver to create.

Definition at line 189 of file Belos_Details_LinearSolver.hpp.

template<class MV , class OP , class ScalarType , class NormType >
Teuchos::RCP<problem_type> Belos::Details::LinearSolver< MV, OP, ScalarType, NormType >::problem_
private

The LinearProblem instance to give to the Belos solver.

Definition at line 191 of file Belos_Details_LinearSolver.hpp.

template<class MV , class OP , class ScalarType , class NormType >
Teuchos::RCP<solver_type> Belos::Details::LinearSolver< MV, OP, ScalarType, NormType >::solver_
private

The Belos solver (SolverManager instance).

Definition at line 193 of file Belos_Details_LinearSolver.hpp.

template<class MV , class OP , class ScalarType , class NormType >
Teuchos::RCP<Teuchos::ParameterList> Belos::Details::LinearSolver< MV, OP, ScalarType, NormType >::params_
private

The Belos solver's list of parameters.

Definition at line 195 of file Belos_Details_LinearSolver.hpp.


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