Reference documentation for deal.II version 8.4.2
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
TrilinosWrappers::SolverDirect Class Reference

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

Classes

struct  AdditionalData
 

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)
 
void solve (const SparseMatrix &A, ::parallel::distributed::Vector< double > &x, const ::parallel::distributed::Vector< double > &b)
 
SolverControlcontrol () const
 
 DeclException1 (ExcTrilinosError, int,<< "An error with error number "<< arg1<< " occurred while calling a Trilinos function")
 

Private Member Functions

void do_solve ()
 

Private Attributes

SolverControlsolver_control
 
std_cxx11::shared_ptr< Epetra_LinearProblem > linear_problem
 
std_cxx11::shared_ptr< Amesos_BaseSolver > solver
 
const AdditionalData additional_data
 

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.

Author
Martin Kronbichler, 2009, Uwe Köcher, 2014

Definition at line 515 of file trilinos_solver.h.

Constructor & Destructor Documentation

§ SolverDirect()

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

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

Definition at line 423 of file trilinos_solver.cc.

§ ~SolverDirect()

TrilinosWrappers::SolverDirect::~SolverDirect ( )
virtual

Destructor.

Definition at line 432 of file trilinos_solver.cc.

Member Function Documentation

§ solve() [1/3]

void TrilinosWrappers::SolverDirect::solve ( const SparseMatrix A,
VectorBase x,
const VectorBase 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 500 of file trilinos_solver.cc.

§ solve() [2/3]

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 517 of file trilinos_solver.cc.

§ solve() [3/3]

void TrilinosWrappers::SolverDirect::solve ( const SparseMatrix A,
::parallel::distributed::Vector< double > &  x,
const ::parallel::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 545 of file trilinos_solver.cc.

§ control()

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

Access to object that controls convergence.

Definition at line 438 of file trilinos_solver.cc.

§ DeclException1()

TrilinosWrappers::SolverDirect::DeclException1 ( ExcTrilinosError  ,
int  ,
<< "An error with error number "<< arg1<< " occurred while calling a Trilinos function"   
)

Exception

§ do_solve()

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 446 of file trilinos_solver.cc.

Member Data Documentation

§ solver_control

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

§ linear_problem

std_cxx11::shared_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.

Definition at line 637 of file trilinos_solver.h.

§ solver

std_cxx11::shared_ptr<Amesos_BaseSolver> TrilinosWrappers::SolverDirect::solver
private

A structure that contains the Trilinos solver and preconditioner objects.

Definition at line 643 of file trilinos_solver.h.

§ additional_data

const AdditionalData TrilinosWrappers::SolverDirect::additional_data
private

Store a copy of the flags for this particular solver.

Definition at line 648 of file trilinos_solver.h.


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