PTEMS  0.1.0-dev+git.81fd0e4
PolyTopic Element Method Solver
ptems::MumpsSolver< T > Class Template Reference

Linear system solver using the MUMPS direct solver. More...

#include <ptems/solvers/mumps.hpp>

Inheritance diagram for ptems::MumpsSolver< T >:
Collaboration diagram for ptems::MumpsSolver< T >:

Public Member Functions

 MumpsSolver (const ParallelComm &comm, const SparsityPattern &mat, std::size_t size, MumpsMatrixType type=MumpsMatrixType::Unsymmetric, bool distributedConstruction=true)
 Construct the MUMPS linear solver. More...
 
 ~MumpsSolver ()
 Cleans up the MUMPS solver. More...
 
virtual bool DistributedConstruction () const override
 Gets if the matrix and right hand side should be constructed distributed (for MPI) More...
 
virtual opt_ref Entry (std::size_t i, std::size_t j) override
 Gets a reference to the specified matrix entry. More...
 
virtual opt_const_ref Entry (std::size_t i, std::size_t j) const override
 Gets a const reference to the specified matrix entry. More...
 
virtual void Clear () override
 Clear the matrix of the linear system. More...
 
std::size_t size () const override
 Gets the size of the linear system. More...
 
virtual std::vector< T > Solve (const std::vector< T > &rhs, std::size_t offsetRHS=0, std::size_t lenRHS=-1) override
 Solves the linear system with the specified right-hand side. More...
 

Detailed Description

template<typename T>
class ptems::MumpsSolver< T >

Linear system solver using the MUMPS direct solver.

Template Parameters
TThe type of the matrix entries

Constructor & Destructor Documentation

◆ MumpsSolver()

template<typename T >
ptems::MumpsSolver< T >::MumpsSolver ( const ParallelComm comm,
const SparsityPattern mat,
std::size_t  size,
MumpsMatrixType  type = MumpsMatrixType::Unsymmetric,
bool  distributedConstruction = true 
)
inline

Construct the MUMPS linear solver.

Parameters
commMPI communicator to use for construction and solving
matThe sparsity pattern of the sparse matrix for MUMPS
sizeThe size of the linear system
typeThe type of the matrix (symmetric, positive definite, unsymmetric)
distributedConstructiontrue if the matrix and right hand side should be constructed distributed over the MPI processes

◆ ~MumpsSolver()

template<typename T >
ptems::MumpsSolver< T >::~MumpsSolver ( )
inline

Cleans up the MUMPS solver.

Member Function Documentation

◆ Clear()

template<typename T >
virtual void ptems::MumpsSolver< T >::Clear ( )
inlineoverridevirtual

◆ DistributedConstruction()

template<typename T >
virtual bool ptems::MumpsSolver< T >::DistributedConstruction ( ) const
inlineoverridevirtual

Gets if the matrix and right hand side should be constructed distributed (for MPI)

Returns
true yo distribute construction across processes, false otherwise

Implements ptems::LinearSolver< T, detail::MumpsTypes< T >::reference, detail::MumpsTypes< T >::const_reference >.

◆ Entry() [1/2]

template<typename T >
virtual opt_const_ref ptems::MumpsSolver< T >::Entry ( std::size_t  i,
std::size_t  j 
) const
inlineoverridevirtual

Gets a const reference to the specified matrix entry.

Exceptions
std::out_of_rangeIf the row or column index are not less than the linear system size
Parameters
iThe row index
jThe column index
Returns
A const reference to the element if its a non-zero entry, or an empty optional if the entry is a zero entry in the sparse matrix

Implements ptems::LinearSolver< T, detail::MumpsTypes< T >::reference, detail::MumpsTypes< T >::const_reference >.

◆ Entry() [2/2]

template<typename T >
virtual opt_ref ptems::MumpsSolver< T >::Entry ( std::size_t  i,
std::size_t  j 
)
inlineoverridevirtual

Gets a reference to the specified matrix entry.

Exceptions
std::out_of_rangeIf the row or column index are not less than the linear system size
Parameters
iThe row index
jThe column index
Returns
A reference to the element if its a non-zero entry, or an empty optional if the entry is a zero entry in the sparse matrix

Implements ptems::LinearSolver< T, detail::MumpsTypes< T >::reference, detail::MumpsTypes< T >::const_reference >.

◆ size()

template<typename T >
std::size_t ptems::MumpsSolver< T >::size ( ) const
inlineoverridevirtual

Gets the size of the linear system.

Returns
The number of rows and columns in the sparse matrix

Implements ptems::LinearSolver< T, detail::MumpsTypes< T >::reference, detail::MumpsTypes< T >::const_reference >.

◆ Solve()

template<typename T >
virtual std::vector<T> ptems::MumpsSolver< T >::Solve ( const std::vector< T > &  rhs,
std::size_t  offsetRHS = 0,
std::size_t  lenRHS = -1 
)
inlineoverridevirtual

Solves the linear system with the specified right-hand side.

Parameters
rhsThe right hand side vector
offsetRHSIf using distributed matrix/rhs construction specifies the offset to the start of the right hand side vector populated by this process
lenRHSIf using distributed matrix/rhs construction specifies the length of the right hand side vector populated by this process (or greater than size() for all)
Returns
std::vector<T>

Implements ptems::LinearSolver< T, detail::MumpsTypes< T >::reference, detail::MumpsTypes< T >::const_reference >.


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