Classes | |
struct | AdditionalData |
class | ExcTrilinosError |
Public Types | |
enum | SolverName { cg, cgs, gmres, bicgstab, tfqmr } |
Public Member Functions | |
SolverBase (SolverControl &cn) | |
SolverBase (const enum SolverName solver_name, SolverControl &cn) | |
virtual | ~SolverBase () |
void | solve (const SparseMatrix &A, VectorBase &x, const VectorBase &b, const PreconditionBase &preconditioner) |
void | solve (const SparseMatrix &A,::Vector< double > &x, const ::Vector< double > &b, const PreconditionBase &preconditioner) |
SolverControl & | control () const |
Public Attributes | |
enum TrilinosWrappers::SolverBase::SolverName | solver_name |
Protected Attributes | |
SolverControl & | solver_control |
Private Attributes | |
std::auto_ptr < Epetra_LinearProblem > | linear_problem |
AztecOO | solver |
const AdditionalData | additional_data |
This solver class can also be used as a standalone class, where the respective Krylov method is set via the flag solver_name
. This can be done at runtime (e.g., when parsing the solver from a ParameterList) and is similar to the deal.II class SolverSelector.
Enumeration object that is set in the constructor of the derived classes and tells Trilinos which solver to use. This option can also be set in the user program, so one might use this base class instead of one of the specialized derived classes when the solver should be set at runtime. Currently enabled options are:
TrilinosWrappers::SolverBase::SolverBase | ( | SolverControl & | cn | ) |
Constructor. Takes the solver control object and creates the solver.
TrilinosWrappers::SolverBase::SolverBase | ( | const enum SolverName | solver_name, | |
SolverControl & | cn | |||
) |
Second constructor. This constructor takes an enum object that specifies the solver name and sets the appropriate Krylov method.
virtual TrilinosWrappers::SolverBase::~SolverBase | ( | ) | [virtual] |
Destructor.
void TrilinosWrappers::SolverBase::solve | ( | const SparseMatrix & | A, | |
VectorBase & | x, | |||
const VectorBase & | b, | |||
const PreconditionBase & | preconditioner | |||
) |
Solve the linear system Ax=b
. Depending on the information provided by derived classes and the object passed as a preconditioner, one of the linear solvers and preconditioners of Trilinos is chosen.
void TrilinosWrappers::SolverBase::solve | ( | const SparseMatrix & | A, | |
::Vector< double > & | x, | |||
const ::Vector< double > & | b, | |||
const PreconditionBase & | preconditioner | |||
) |
Solve the linear system Ax=b
. Depending on the information provided by derived classes and the object passed as a preconditioner, one of the linear solvers and preconditioners of Trilinos is chosen. This class works with matrices according to the TrilinosWrappers format, but can take deal.II vectors as argument. Since deal.II are serial vectors (not distributed), this function does only what you expect in case the matrix is locally owned. Otherwise, an exception will be thrown.
SolverControl& TrilinosWrappers::SolverBase::control | ( | ) | const |
Access to object that controls convergence.
Enumeration object that is set in the constructor of the derived classes and tells Trilinos which solver to use. This option can also be set in the user program, so one might use this base class instead of one of the specialized derived classes when the solver should be set at runtime. Currently enabled options are:
Reference to the object that controls convergence of the iterative solver. In fact, for these Trilinos wrappers, Trilinos does so itself, but we copy the data from this object before starting the solution process, and copy the data back into it afterwards.
std::auto_ptr<Epetra_LinearProblem> TrilinosWrappers::SolverBase::linear_problem [private] |
A structure that collects the Trilinos sparse matrix, the right hand side vector and the solution vector, which is passed down to the Trilinos solver.
AztecOO TrilinosWrappers::SolverBase::solver [private] |
A structure that contains the Trilinos solver and preconditioner objects.
const AdditionalData TrilinosWrappers::SolverBase::additional_data [private] |
Store a copy of the flags for this particular solver.
Reimplemented in TrilinosWrappers::SolverCG, TrilinosWrappers::SolverCGS, TrilinosWrappers::SolverGMRES, TrilinosWrappers::SolverBicgstab, and TrilinosWrappers::SolverTFQMR.