Reference documentation for deal.II version GIT relicensing-462-g03c82a14bd 2024-04-21 16:20:02+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
LinearAlgebra::TpetraWrappers::SolverDirect< Number, MemorySpace > Class Template Reference

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

Inheritance diagram for LinearAlgebra::TpetraWrappers::SolverDirect< Number, MemorySpace >:
Inheritance graph
[legend]

Classes

struct  AdditionalData
 

Public Types

using size_type = ::types::signed_global_dof_index
 
using NodeType = Tpetra::KokkosCompat::KokkosDeviceWrapperNode< typename MemorySpace::kokkos_space::execution_space, typename MemorySpace::kokkos_space >
 
using LinearOperator = Tpetra::Operator< Number, int, size_type, NodeType >
 
using MultiVector = Tpetra::MultiVector< Number, int, size_type, NodeType >
 

Public Member Functions

 SolverDirect (SolverControl &cn, const AdditionalData &additional_data=AdditionalData())
 
void set_pararameter_list (Teuchos::ParameterList &parameter_list)
 
void initialize (const SparseMatrix< Number, MemorySpace > &A)
 
void solve (Vector< Number, MemorySpace > &x, const Vector< Number, MemorySpace > &b)
 
void solve (const SparseMatrix< Number, MemorySpace > &A, Vector< Number, MemorySpace > &x, const Vector< Number, MemorySpace > &b)
 
SolverControlcontrol () const
 

Static Public Member Functions

static ::ExceptionBaseExcTrilinosError (int arg1)
 

Protected Member Functions

void do_solve ()
 

Protected Attributes

SolverControlsolver_control
 
Teuchos::RCP< Amesos2::Solver< typename SparseMatrix< Number, MemorySpace >::MatrixType, MultiVector > > solver
 
std::string solver_type
 
Teuchos::ParameterList parameter_list
 

Detailed Description

template<typename Number, typename MemorySpace = ::MemorySpace::Host>
class LinearAlgebra::TpetraWrappers::SolverDirect< Number, MemorySpace >

A general purpose class to support any solver that the Amesos2 package of Trilinos provides.

Notes for users switching from TrilinosWrappers to TpetraWrappers: The general interface of this class is kept identical to the Amesos(1) wrapper with the notable exception of being templated.

A further addition is the option to fine tune each solver with a Teuchos::ParameterList, to change default parameters.

Definition at line 208 of file trilinos_tpetra_solver_direct.h.

Member Typedef Documentation

◆ size_type

template<typename Number , typename MemorySpace = ::MemorySpace::Host>
using LinearAlgebra::TpetraWrappers::SolverDirectBase< Number, MemorySpace >::size_type = ::types::signed_global_dof_index
inherited

Declare the type for container size.

Definition at line 76 of file trilinos_tpetra_solver_direct.h.

◆ NodeType

template<typename Number , typename MemorySpace = ::MemorySpace::Host>
using LinearAlgebra::TpetraWrappers::SolverDirectBase< Number, MemorySpace >::NodeType = Tpetra::KokkosCompat::KokkosDeviceWrapperNode< typename MemorySpace::kokkos_space::execution_space, typename MemorySpace::kokkos_space>
inherited

Typedef for the NodeType

Definition at line 82 of file trilinos_tpetra_solver_direct.h.

◆ LinearOperator

template<typename Number , typename MemorySpace = ::MemorySpace::Host>
using LinearAlgebra::TpetraWrappers::SolverDirectBase< Number, MemorySpace >::LinearOperator = Tpetra::Operator<Number, int, size_type, NodeType>
inherited

Typedef for the LinearOperator type

Definition at line 94 of file trilinos_tpetra_solver_direct.h.

◆ MultiVector

template<typename Number , typename MemorySpace = ::MemorySpace::Host>
using LinearAlgebra::TpetraWrappers::SolverDirectBase< Number, MemorySpace >::MultiVector = Tpetra::MultiVector<Number, int, size_type, NodeType>
inherited

Typedef for the MultiVector type

Definition at line 99 of file trilinos_tpetra_solver_direct.h.

Constructor & Destructor Documentation

◆ SolverDirect()

template<typename Number , typename MemorySpace = ::MemorySpace::Host>
LinearAlgebra::TpetraWrappers::SolverDirect< Number, MemorySpace >::SolverDirect ( SolverControl cn,
const AdditionalData additional_data = AdditionalData() 
)

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

Member Function Documentation

◆ set_pararameter_list()

template<typename Number , typename MemorySpace = ::MemorySpace::Host>
void LinearAlgebra::TpetraWrappers::SolverDirect< Number, MemorySpace >::set_pararameter_list ( Teuchos::ParameterList &  parameter_list)

Set a parameter list to fine tune the solver. The valid parameters depend on the solver you use and the possible parameters can be found in the documentation of Amesos2.

◆ initialize()

template<typename Number , typename MemorySpace = ::MemorySpace::Host>
void LinearAlgebra::TpetraWrappers::SolverDirectBase< Number, MemorySpace >::initialize ( const SparseMatrix< Number, MemorySpace > &  A)
inherited

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.

◆ solve() [1/2]

template<typename Number , typename MemorySpace = ::MemorySpace::Host>
void LinearAlgebra::TpetraWrappers::SolverDirectBase< Number, MemorySpace >::solve ( Vector< Number, MemorySpace > &  x,
const Vector< Number, MemorySpace > &  b 
)
inherited

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

◆ solve() [2/2]

template<typename Number , typename MemorySpace = ::MemorySpace::Host>
void LinearAlgebra::TpetraWrappers::SolverDirectBase< Number, MemorySpace >::solve ( const SparseMatrix< Number, MemorySpace > &  A,
Vector< Number, MemorySpace > &  x,
const Vector< Number, MemorySpace > &  b 
)
inherited

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.

◆ control()

template<typename Number , typename MemorySpace = ::MemorySpace::Host>
SolverControl & LinearAlgebra::TpetraWrappers::SolverDirectBase< Number, MemorySpace >::control ( ) const
inherited

Access to object that controls convergence.

◆ do_solve()

template<typename Number , typename MemorySpace = ::MemorySpace::Host>
void LinearAlgebra::TpetraWrappers::SolverDirectBase< Number, MemorySpace >::do_solve ( )
protectedinherited

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

Member Data Documentation

◆ solver_control

template<typename Number , typename MemorySpace = ::MemorySpace::Host>
SolverControl& LinearAlgebra::TpetraWrappers::SolverDirectBase< Number, MemorySpace >::solver_control
protectedinherited

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 169 of file trilinos_tpetra_solver_direct.h.

◆ solver

template<typename Number , typename MemorySpace = ::MemorySpace::Host>
Teuchos::RCP< Amesos2::Solver<typename SparseMatrix<Number, MemorySpace>::MatrixType, MultiVector> > LinearAlgebra::TpetraWrappers::SolverDirectBase< Number, MemorySpace >::solver
protectedinherited

A structure that contains the Trilinos solver object.

Definition at line 177 of file trilinos_tpetra_solver_direct.h.

◆ solver_type

template<typename Number , typename MemorySpace = ::MemorySpace::Host>
std::string LinearAlgebra::TpetraWrappers::SolverDirectBase< Number, MemorySpace >::solver_type
protectedinherited

Definition at line 182 of file trilinos_tpetra_solver_direct.h.

◆ parameter_list

template<typename Number , typename MemorySpace = ::MemorySpace::Host>
Teuchos::ParameterList LinearAlgebra::TpetraWrappers::SolverDirectBase< Number, MemorySpace >::parameter_list
protectedinherited

An optional Teuchos::ParameterList for fine tuning the solver. Please refer to the Amesos2 manual to see which parameters to set for each individual solver.

Definition at line 189 of file trilinos_tpetra_solver_direct.h.


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