Belos
Version of the Day
|
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... | |
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.
|
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).
Reimplemented from Trilinos::Details::LinearSolver< MV, OP, NormType >.
Definition at line 68 of file Belos_Details_LinearSolver.hpp.
|
inlinevirtual |
Set the solver's matrix.
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.
|
inlinevirtual |
Get the solver's matrix.
Implements Trilinos::Details::LinearSolver< MV, OP, NormType >.
Definition at line 83 of file Belos_Details_LinearSolver.hpp.
|
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.
|
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.