PLaSK library

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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 double & | operator() (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
int * | icords
| Vector of non-zero band numbers (shift from diagonal) or non-zero elements.
IterativeMatrixParams * | params
const int | nstore
const int | ndim
const int | mdim
int | ifact = 1
int | nw = 0
int | inw = 0
double * | wksp = nullptr
int * | iwksp = 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.
double * | data
| Pointer to data.
const Solver * | solver
| 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
| inline protected virtual

Reimplemented in plask::SparseFreeMatrix.

Definition at line 114 of file iterative_matrix.hpp.

## ◆ get_preconditioner()

virtual NspcgFunc plask::SparseMatrix::get_preconditioner | ( |  | ) |
| protected pure virtual

Implemented in plask::SparseBandMatrix, and plask::SparseFreeMatrix.

## ◆ mult()

void plask::SparseMatrix::mult | ( | const DataVector< const double > & | vector,
|  | DataVector< double > & | result
| ) |  |
| inline override virtual

Multiply matrix by vector.

Parameters

  vector | vector to multiply
  result | multiplication result

Implements plask::FemMatrix.

Definition at line 341 of file iterative_matrix.hpp.

## ◆ solverhs()

void plask::SparseMatrix::solverhs | ( | DataVector< double > & | B,
|  | DataVector< double > & | X
| ) |  |
| inline override virtual

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

Parameters

  | solver | solver to use
  [in,out] | B | right hand side of the equation, on output may be interchanged with X
  [in,out] | X | initial 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:

- plask/common/fem/iterative_matrix.hpp