Belos Package Browser (Single Doxygen Collection)
Development
|
Belos' implementation of Trilinos::Details::LinearSolver. More...
#include <Belos_Details_LinearSolver.hpp>
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 > ¶ms) |
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_type > | problem_ |
The LinearProblem instance to give to the Belos solver. More... | |
Teuchos::RCP< solver_type > | solver_ |
The Belos solver (SolverManager instance). More... | |
Teuchos::RCP < Teuchos::ParameterList > | params_ |
The Belos solver's list of parameters. More... | |
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.
|
private |
Belos::LinearProblem specialization used by this class.
Definition at line 49 of file Belos_Details_LinearSolver.hpp.
|
private |
Belos' own solver type.
Definition at line 51 of file Belos_Details_LinearSolver.hpp.
|
inline |
Constructor.
solverName | The name of the Belos::SolverManager instance to create. |
Definition at line 59 of file Belos_Details_LinearSolver.hpp.
|
inlinevirtual |
Destructor (virtual for memory safety).
Definition at line 68 of file Belos_Details_LinearSolver.hpp.
|
inlinevirtual |
Set the solver's matrix.
Implements Trilinos::Details::LinearSolver< MV, OP, NormType >.
Definition at line 74 of file Belos_Details_LinearSolver.hpp.
|
inlinevirtual |
Get the solver's matrix.
Implements Trilinos::Details::LinearSolver< MV, OP, NormType >.
Definition at line 83 of file Belos_Details_LinearSolver.hpp.
|
inline |
Solve the linear system AX=B for X.
Definition at line 92 of file Belos_Details_LinearSolver.hpp.
|
inlinevirtual |
Set the solver's parameters.
Implements Trilinos::Details::LinearSolver< MV, OP, NormType >.
Definition at line 119 of file Belos_Details_LinearSolver.hpp.
|
inlinevirtual |
Precompute for matrix structure changes.
Implements Trilinos::Details::LinearSolver< MV, OP, NormType >.
Definition at line 127 of file Belos_Details_LinearSolver.hpp.
|
inlinevirtual |
Precompute for matrix values' changes.
Implements Trilinos::Details::LinearSolver< MV, OP, NormType >.
Definition at line 141 of file Belos_Details_LinearSolver.hpp.
|
private |
The name of the Belos solver to create.
Definition at line 157 of file Belos_Details_LinearSolver.hpp.
|
private |
The LinearProblem instance to give to the Belos solver.
Definition at line 159 of file Belos_Details_LinearSolver.hpp.
|
private |
The Belos solver (SolverManager instance).
Definition at line 161 of file Belos_Details_LinearSolver.hpp.
|
private |
The Belos solver's list of parameters.
Definition at line 163 of file Belos_Details_LinearSolver.hpp.