![]() |
Reference documentation for deal.II version 8.4.2
|
#include <deal.II/lac/trilinos_solver.h>
Classes | |
| struct | AdditionalData |
Public Types | |
| enum | SolverName |
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 (Epetra_Operator &A, VectorBase &x, const VectorBase &b, const PreconditionBase &preconditioner) |
| void | solve (const SparseMatrix &A, ::Vector< double > &x, const ::Vector< double > &b, const PreconditionBase &preconditioner) |
| void | solve (Epetra_Operator &A, ::Vector< double > &x, const ::Vector< double > &b, const PreconditionBase &preconditioner) |
| void | solve (const SparseMatrix &A, ::parallel::distributed::Vector< double > &x, const ::parallel::distributed::Vector< double > &b, const PreconditionBase &preconditioner) |
| void | solve (Epetra_Operator &A, ::parallel::distributed::Vector< double > &x, const ::parallel::distributed::Vector< double > &b, const PreconditionBase &preconditioner) |
| SolverControl & | control () const |
| DeclException1 (ExcTrilinosError, int,<< "An error with error number "<< arg1<< " occurred while calling a Trilinos function") | |
Protected Attributes | |
| SolverControl & | solver_control |
Private Member Functions | |
| void | do_solve (const PreconditionBase &preconditioner) |
Private Attributes | |
| std_cxx11::shared_ptr< Epetra_LinearProblem > | linear_problem |
| AztecOO | solver |
| const AdditionalData | additional_data |
Base class for solver classes using the Trilinos solvers. Since solvers in Trilinos are selected based on flags passed to a generic solver object, basically all the actual solver calls happen in this class, and derived classes simply set the right flags to select one solver or another, or to set certain parameters for individual solvers. For a general discussion on the Trilinos solver package AztecOO, we refer to the AztecOO user guide.
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.
Definition at line 66 of file trilinos_solver.h.
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:
Definition at line 77 of file trilinos_solver.h.
| TrilinosWrappers::SolverBase::SolverBase | ( | SolverControl & | cn | ) |
Constructor. Takes the solver control object and creates the solver.
Definition at line 41 of file trilinos_solver.cc.
| 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.
Definition at line 49 of file trilinos_solver.cc.
|
virtual |
Destructor.
Definition at line 58 of file trilinos_solver.cc.
| 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.
Definition at line 72 of file trilinos_solver.cc.
| void TrilinosWrappers::SolverBase::solve | ( | Epetra_Operator & | A, |
| VectorBase & | x, | ||
| const VectorBase & | b, | ||
| const PreconditionBase & | preconditioner | ||
| ) |
Solve the linear system Ax=b where A is an operator. This function can be used for matrix free computation. 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.
Definition at line 92 of file trilinos_solver.cc.
| 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.
Definition at line 112 of file trilinos_solver.cc.
| void TrilinosWrappers::SolverBase::solve | ( | Epetra_Operator & | A, |
| ::Vector< double > & | x, | ||
| const ::Vector< double > & | b, | ||
| const PreconditionBase & | preconditioner | ||
| ) |
Solve the linear system Ax=b where A is an operator. This function can be used for matrix free computations. 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.
Definition at line 145 of file trilinos_solver.cc.
| void TrilinosWrappers::SolverBase::solve | ( | const SparseMatrix & | A, |
| ::parallel::distributed::Vector< double > & | x, | ||
| const ::parallel::distributed::Vector< double > & | b, | ||
| const PreconditionBase & | preconditioner | ||
| ) |
Solve the linear system Ax=b for deal.II's parallel distributed vectors. 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.
Definition at line 165 of file trilinos_solver.cc.
| void TrilinosWrappers::SolverBase::solve | ( | Epetra_Operator & | A, |
| ::parallel::distributed::Vector< double > & | x, | ||
| const ::parallel::distributed::Vector< double > & | b, | ||
| const PreconditionBase & | preconditioner | ||
| ) |
Solve the linear system Ax=b where A is an operator. This function can be used for matrix free computation. 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.
Definition at line 194 of file trilinos_solver.cc.
| SolverControl & TrilinosWrappers::SolverBase::control | ( | ) | const |
Access to object that controls convergence.
Definition at line 64 of file trilinos_solver.cc.
| TrilinosWrappers::SolverBase::DeclException1 | ( | ExcTrilinosError | , |
| int | , | ||
| << "An error with error number "<< arg1<< " occurred while calling a Trilinos function" | |||
| ) |
Exception
|
private |
The solve function is used to set properly the Epetra_LinearProblem, once it is done this function solves the linear problem.
Definition at line 219 of file trilinos_solver.cc.
|
protected |
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.
Definition at line 230 of file trilinos_solver.h.
|
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.
Definition at line 245 of file trilinos_solver.h.
|
private |
A structure that contains the Trilinos solver and preconditioner objects.
Definition at line 251 of file trilinos_solver.h.
|
private |
Store a copy of the flags for this particular solver.
Definition at line 256 of file trilinos_solver.h.
1.8.12