AMDiS 2.10
The Adaptive Multi-Dimensional Simulation Toolbox
MatrixFacade< T, MatrixImpl > Class Template Reference

#include <MatrixFacade.hpp>

Public Member Functions

template<class RowBasis , class ColBasis >
 MatrixFacade (RowBasis const &rowBasis, ColBasis const &colBasis)
 
Impl const & impl () const
 Return the underlying matrix backend.
 
Implimpl ()
 
template<class SparsityPattern >
void init (SparsityPattern const &pattern)
 Initialize the matrix for insertion and allocate the non-zero pattern.
 
void init ()
 Initialize the matrix for insertion while keeping the pattern unchanged.
 
void finish ()
 Finish the matrix insertion, e.g. cleanup or final insertion.
 
template<class RowIndex , class ColIndex , REQUIRES(Concepts::MultiIndex< RowIndex >) , REQUIRES(Concepts::MultiIndex< ColIndex >) >
void insert (RowIndex const &row, ColIndex const &col, typename Impl::value_type const &value)
 Insert a single value into the matrix (add to existing value)
 
template<class RowLocalView , class ColLocalView , class LocalMatrix , REQUIRES(Concepts::LocalView< RowLocalView >) , REQUIRES(Concepts::LocalView< ColLocalView >) >
void scatter (RowLocalView const &r, ColLocalView const &c, LocalMatrix const &localMatrix)
 
template<class Idx , REQUIRES(Concepts::MultiIndex< Idx >) >
void zeroRows (std::vector< Idx > const &ind, bool diag)
 Set all entries of the specified rows to zero and the diagonal element to diag
 
template<class RowIdx , class ColIdx , REQUIRES(Concepts::MultiIndex< RowIdx >) , REQUIRES(Concepts::MultiIndex< ColIdx >) >
void zeroRows (std::vector< RowIdx > const &rowInd, std::vector< ColIdx > const &colInd, bool diag)
 Set all entries of the specified rows to zero and the diagonal element to diag
 
template<class Idx , class VecX , class VecB , REQUIRES(Concepts::MultiIndex< Idx >) >
void zeroRowsColumns (std::vector< Idx > const &ind, bool diag, VecX const &x, VecB &b)
 Set all entries of the specified rows and columns==rows to zero and the diagonal element to 1 if diag is set to true. Additionally, modify the entries of the vector b according to the solution values x times the corresponding matrix entries.
 
template<class Idx , REQUIRES(Concepts::MultiIndex< Idx >) >
void zeroRowsColumns (std::vector< Idx > const &ind, bool diag)
 Set all entries of the specified rows and columns==rows to zero and the main diagonal element to 1 if diag is set to true.
 
template<class RowIdx , class ColIdx , class VecX , class VecB , REQUIRES(Concepts::MultiIndex< RowIdx >) , REQUIRES(Concepts::MultiIndex< ColIdx >) >
void zeroRowsColumns (std::vector< RowIdx > const &rowInd, std::vector< ColIdx > const &colInd, bool diag, VecX const &x, VecB &b)
 Set all entries of the specified rows and columns to zero and the diagonal elements defined as pairs of row and column indices to 1 if diag is set to true. Additionally, modify the entries of the vector b according to the solution values x times the corresponding matrix entries.
 
template<class RowIdx , class ColIdx , REQUIRES(Concepts::MultiIndex< RowIdx >) , REQUIRES(Concepts::MultiIndex< ColIdx >) >
void zeroRowsColumns (std::vector< RowIdx > const &rowInd, std::vector< ColIdx > const &colInd, bool diag)
 Set all entries of the specified rows and columns to zero and the diagonal elements defined as pairs of row and column indices to 1 if diag is set to true.
 
std::size_t nnz () const
 Number of nonzeros in the matrix.
 

Protected Attributes

Impl impl_
 The matrix backend.
 

Detailed Description

template<class T, template< class > class MatrixImpl>
class AMDiS::MatrixFacade< T, MatrixImpl >

Basis implementation of DOFMatrix, i.e. a sparse matrix storing all the assembled Operators indexed with DOF indices. The matrix data is associated to a row and column global basis.

Template Parameters
TThe coefficient type of the matrix
MatrixImplA linear-algebra backend for the matrix storage

Constructor & Destructor Documentation

◆ MatrixFacade()

MatrixFacade ( RowBasis const &  rowBasis,
ColBasis const &  colBasis 
)
inline

Constructor. Forwards the bases to the implementation class and constructs a matrix sparsity pattern.

Member Function Documentation

◆ scatter()

void scatter ( RowLocalView const &  r,
ColLocalView const &  c,
LocalMatrix const &  localMatrix 
)
inline

Insert a block of values into the sparse matrix (add to existing values) The global matrix indices are determined by the corresponding localviews.

References MatrixFacade< T, MatrixImpl >::impl_.


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