Reference documentation for deal.II version Git 4c3a1f2 2018-02-23 12:56:49 +0100
TrilinosWrappers::SolverDirect Class Reference

#include <deal.II/lac/trilinos_solver.h>

## Public Member Functions

virtual ~SolverDirect ()=default

void initialize (const SparseMatrix &A)

void solve (MPI::Vector &x, const MPI::Vector &b)

void solve (::LinearAlgebra::distributed::Vector< double > &x, const ::LinearAlgebra::distributed::Vector< double > &b)

void solve (const SparseMatrix &A, MPI::Vector &x, const MPI::Vector &b)

void solve (const SparseMatrix &A,::Vector< double > &x, const ::Vector< double > &b)

void solve (const SparseMatrix &A,::LinearAlgebra::distributed::Vector< double > &x, const ::LinearAlgebra::distributed::Vector< double > &b)

SolverControlcontrol () const

## Static Public Member Functions

static::ExceptionBase & ExcTrilinosError (int arg1)

void do_solve ()

## Private Attributes

SolverControlsolver_control

std::unique_ptr< Epetra_LinearProblem > linear_problem

std::unique_ptr< Amesos_BaseSolver > solver

## Detailed Description

An implementation of Trilinos direct solvers (using the Amesos package). The data field AdditionalData::solver_type can be used to specify the type of solver. It allows the use of built-in solvers Amesos_Klu as well as third-party solvers Amesos_Superludist or Amesos_Mumps.

For instructions on how to install Trilinos for use with direct solvers other than KLU, see the link to the Trilinos installation instructions linked to from the deal.II ReadMe file.

Definition at line 576 of file trilinos_solver.h.

## Constructor & Destructor Documentation

 TrilinosWrappers::SolverDirect::SolverDirect ( SolverControl & cn, const AdditionalData & data = AdditionalData() )

Constructor. Takes the solver control object and creates the solver.

Definition at line 692 of file trilinos_solver.cc.

 virtual TrilinosWrappers::SolverDirect::~SolverDirect ( )
virtualdefault

Destructor.

## Member Function Documentation

 void TrilinosWrappers::SolverDirect::initialize ( const SparseMatrix & A )

Initializes the direct solver for the matrix A and creates a factorization for it with the package chosen from the additional data structure. Note that there is no need for a preconditioner here and solve() is not called.

Definition at line 709 of file trilinos_solver.cc.

 void TrilinosWrappers::SolverDirect::solve ( MPI::Vector & x, const MPI::Vector & b )

Solve the linear system Ax=b based on the package set in intialize(). Note the matrix is not refactorized during this call.

Definition at line 754 of file trilinos_solver.cc.

 void TrilinosWrappers::SolverDirect::solve ( ::LinearAlgebra::distributed::Vector< double > & x, const ::LinearAlgebra::distributed::Vector< double > & b )

Solve the linear system Ax=b based on the package set in intialize() for deal.II's own parallel vectors. Note the matrix is not refactorized during this call.

Definition at line 780 of file trilinos_solver.cc.

 void TrilinosWrappers::SolverDirect::solve ( const SparseMatrix & A, MPI::Vector & x, const MPI::Vector & b )

Solve the linear system Ax=b. Creates a factorization of the matrix with the package chosen from the additional data structure and performs the solve. Note that there is no need for a preconditioner here.

Definition at line 861 of file trilinos_solver.cc.

 void TrilinosWrappers::SolverDirect::solve ( const SparseMatrix & A, ::Vector< double > & x, const ::Vector< double > & b )

Solve the linear system Ax=b. This class works with Trilinos matrices, but takes deal.II serial vectors as argument. Since these vectors are not distributed, this function does only what you expect in case the matrix is serial (i.e., locally owned). Otherwise, an exception will be thrown.

Definition at line 878 of file trilinos_solver.cc.

 void TrilinosWrappers::SolverDirect::solve ( const SparseMatrix & A, ::LinearAlgebra::distributed::Vector< double > & x, const ::LinearAlgebra::distributed::Vector< double > & b )

Solve the linear system Ax=b for deal.II's own parallel vectors. Creates a factorization of the matrix with the package chosen from the additional data structure and performs the solve. Note that there is no need for a preconditioner here.

Definition at line 906 of file trilinos_solver.cc.

 SolverControl & TrilinosWrappers::SolverDirect::control ( ) const

Definition at line 702 of file trilinos_solver.cc.

 void TrilinosWrappers::SolverDirect::do_solve ( )
private

Actually performs the operations for solving the linear system, including the factorization and forward and backward substitution.

Definition at line 810 of file trilinos_solver.cc.

## Member Data Documentation

 SolverControl& TrilinosWrappers::SolverDirect::solver_control
private

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 715 of file trilinos_solver.h.

 std::unique_ptr 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.

Definition at line 722 of file trilinos_solver.h.

 std::unique_ptr TrilinosWrappers::SolverDirect::solver
private

A structure that contains the Trilinos solver and preconditioner objects.

Definition at line 728 of file trilinos_solver.h.

private

Store a copy of the flags for this particular solver.

Definition at line 733 of file trilinos_solver.h.

The documentation for this class was generated from the following files: