PLaSK library
Loading...
Searching...
No Matches
plask::SparseMatrix Struct Referenceabstract

#include <plask/common/fem/iterative_matrix.hpp>

Inheritance diagram for plask::SparseMatrix:
[legend]
Collaboration diagram for plask::SparseMatrix:
[legend]

Public Types

typedef void(* NspcgFunc) (...)
 

Public Member Functions

template<typename SolverT >
 SparseMatrix (SolverT *solver, size_t rank, size_t size, size_t isiz)
 
template<typename SolverT >
 SparseMatrix (SolverT *solver, size_t rank, size_t size)
 
 ~SparseMatrix ()
 
void solverhs (DataVector< double > &B, DataVector< double > &X) override
 Solve for the right-hand-side of a system of linear equations.
 
void mult (const DataVector< const double > &vector, DataVector< double > &result) override
 Multiply matrix by vector.
 
- Public Member Functions inherited from plask::FemMatrix
 FemMatrix (const Solver *solver, size_t rank, size_t size)
 
 FemMatrix (const FemMatrix &)=delete
 
virtual ~FemMatrix ()
 
virtual doubleoperator() (size_t r, size_t c)=0
 Return reference to array element.
 
virtual void clear ()
 Clear the matrix.
 
virtual void factorize ()
 Factorize the matrix in advance to speed up the solution.
 
void solve (DataVector< double > &B, DataVector< double > &X)
 Solve the set of linear equations.
 
void solve (DataVector< double > &B)
 Solve the set of linear equations.
 
virtual void addmult (const DataVector< const double > &vector, DataVector< double > &result)=0
 Multiply matrix by vector adding the result.
 
virtual void setBC (DataVector< double > &B, size_t r, double val)=0
 Set Dirichlet boundary condition.
 
template<typename BoundaryConditonsT >
void applyBC (const BoundaryConditonsT &bconds, DataVector< double > &B)
 Apply Dirichlet boundary conditions.
 
virtual std::string describe () const
 

Protected Member Functions

virtual NspcgFunc get_preconditioner ()=0
 
virtual int get_maxnz () const
 

Protected Attributes

inticords
 Vector of non-zero band numbers (shift from diagonal) or non-zero elements.
 
IterativeMatrixParamsparams
 
const int nstore
 
const int ndim
 
const int mdim
 
int ifact = 1
 
int nw = 0
 
int inw = 0
 
doublewksp = nullptr
 
intiwksp = nullptr
 
int kblsz = -1
 
int nbl2d = -1
 

Additional Inherited Members

- Public Attributes inherited from plask::FemMatrix
const size_t rank
 Order of the matrix, i.e. number of columns or rows.
 
const size_t size
 Number of stored elements in the matrix.
 
doubledata
 Pointer to data.
 
const Solversolver
 Solver owning the matrix.
 

Detailed Description

Definition at line 96 of file iterative_matrix.hpp.

Member Typedef Documentation

◆ NspcgFunc

typedef void(* plask::SparseMatrix::NspcgFunc) (...)

Definition at line 97 of file iterative_matrix.hpp.

Constructor & Destructor Documentation

◆ SparseMatrix() [1/2]

template<typename SolverT >
plask::SparseMatrix::SparseMatrix ( SolverT solver,
size_t  rank,
size_t  size,
size_t  isiz 
)
inline

Definition at line 118 of file iterative_matrix.hpp.

◆ SparseMatrix() [2/2]

template<typename SolverT >
plask::SparseMatrix::SparseMatrix ( SolverT solver,
size_t  rank,
size_t  size 
)
inline

Definition at line 127 of file iterative_matrix.hpp.

◆ ~SparseMatrix()

plask::SparseMatrix::~SparseMatrix ( )
inline

Definition at line 135 of file iterative_matrix.hpp.

Member Function Documentation

◆ get_maxnz()

virtual int plask::SparseMatrix::get_maxnz ( ) const
inlineprotectedvirtual

Reimplemented in plask::SparseFreeMatrix.

Definition at line 114 of file iterative_matrix.hpp.

◆ get_preconditioner()

virtual NspcgFunc plask::SparseMatrix::get_preconditioner ( )
protectedpure virtual

◆ mult()

void plask::SparseMatrix::mult ( const DataVector< const double > &  vector,
DataVector< double > &  result 
)
inlineoverridevirtual

Multiply matrix by vector.

Parameters
vectorvector to multiply
resultmultiplication result

Implements plask::FemMatrix.

Definition at line 340 of file iterative_matrix.hpp.

◆ solverhs()

void plask::SparseMatrix::solverhs ( DataVector< double > &  B,
DataVector< double > &  X 
)
inlineoverridevirtual

Solve for the right-hand-side of a system of linear equations.

Parameters
solversolver to use
[in,out]Bright hand side of the equation, on output may be interchanged with X
[in,out]Xinitial estimate of the solution, on output contains the solution (may be interchanged with B)
Returns
number of iterations

Implements plask::FemMatrix.

Definition at line 141 of file iterative_matrix.hpp.

Member Data Documentation

◆ icords

int* plask::SparseMatrix::icords
protected

Vector of non-zero band numbers (shift from diagonal) or non-zero elements.

Definition at line 100 of file iterative_matrix.hpp.

◆ ifact

int plask::SparseMatrix::ifact = 1
protected

Definition at line 106 of file iterative_matrix.hpp.

◆ inw

int plask::SparseMatrix::inw = 0
protected

Definition at line 107 of file iterative_matrix.hpp.

◆ iwksp

int* plask::SparseMatrix::iwksp = nullptr
protected

Definition at line 109 of file iterative_matrix.hpp.

◆ kblsz

int plask::SparseMatrix::kblsz = -1
protected

Definition at line 110 of file iterative_matrix.hpp.

◆ mdim

const int plask::SparseMatrix::mdim
protected

Definition at line 104 of file iterative_matrix.hpp.

◆ nbl2d

int plask::SparseMatrix::nbl2d = -1
protected

Definition at line 110 of file iterative_matrix.hpp.

◆ ndim

const int plask::SparseMatrix::ndim
protected

Definition at line 104 of file iterative_matrix.hpp.

◆ nstore

const int plask::SparseMatrix::nstore
protected

Definition at line 104 of file iterative_matrix.hpp.

◆ nw

int plask::SparseMatrix::nw = 0
protected

Definition at line 107 of file iterative_matrix.hpp.

◆ params

IterativeMatrixParams* plask::SparseMatrix::params
protected

Definition at line 102 of file iterative_matrix.hpp.

◆ wksp

double* plask::SparseMatrix::wksp = nullptr
protected

Definition at line 108 of file iterative_matrix.hpp.


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