Classes | |
struct | AdditionalData |
class | ExcTrilinosError |
Public Member Functions | |
SolverDirect (SolverControl &cn, const AdditionalData &data=AdditionalData()) | |
virtual | ~SolverDirect () |
void | solve (const SparseMatrix &A, VectorBase &x, const VectorBase &b) |
void | solve (const SparseMatrix &A,::Vector< double > &x, const ::Vector< double > &b) |
SolverControl & | control () const |
Private Attributes | |
SolverControl & | solver_control |
std::auto_ptr < Epetra_LinearProblem > | linear_problem |
std::auto_ptr< Amesos_BaseSolver > | solver |
const AdditionalData | additional_data |
An implementation of the Trilinos KLU direct solver (using the Amesos package).
TrilinosWrappers::SolverDirect::SolverDirect | ( | SolverControl & | cn, | |
const AdditionalData & | data = AdditionalData() | |||
) |
Constructor. Takes the solver control object and creates the solver.
virtual TrilinosWrappers::SolverDirect::~SolverDirect | ( | ) | [virtual] |
Destructor.
void TrilinosWrappers::SolverDirect::solve | ( | const SparseMatrix & | A, | |
VectorBase & | x, | |||
const VectorBase & | b | |||
) |
Solve the linear system Ax=b
. Creates a KLU factorization of the matrix and performs the solve. Note that there is no need for a preconditioner here.
void TrilinosWrappers::SolverDirect::solve | ( | const SparseMatrix & | A, | |
::Vector< double > & | x, | |||
const ::Vector< double > & | b | |||
) |
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::SolverDirect::control | ( | ) | const |
Access to object that controls convergence.
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::SolverDirect::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.
std::auto_ptr<Amesos_BaseSolver> TrilinosWrappers::SolverDirect::solver [private] |
A structure that contains the Trilinos solver and preconditioner objects.
const AdditionalData TrilinosWrappers::SolverDirect::additional_data [private] |
Store a copy of the flags for this particular solver.