PLaSK library

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
plask::SparseBandMatrix Struct Reference

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

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

## Public Member Functions
template<typename SolverT >
| SparseBandMatrix (SolverT *solver, size_t rank, size_t major)
| Create 2D matrix.
template<typename SolverT >
| SparseBandMatrix (SolverT *solver, size_t rank, size_t major, size_t minor)
| Create 3D matrix.
template<typename SolverT >
| SparseBandMatrix (SolverT *solver, size_t rank, std::initializer_list< int > bands)
| Create band matrix.
double & | operator() (size_t r, size_t c) override
| Return reference to array element.
void | addmult (const DataVector< const double > &vector, DataVector< double > &result) override
| Multiply matrix by vector adding the result.
void | setBC (DataVector< double > &B, size_t r, double val) override
| Set Dirichlet boundary condition.
Public Member Functions inherited from plask::SparseMatrix
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 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.
template<typename BoundaryConditonsT >
void | applyBC (const BoundaryConditonsT &bconds, DataVector< double > &B)
| Apply Dirichlet boundary conditions.
virtual std::string | describe () const

## Protected Member Functions
NspcgFunc | get_preconditioner () override
Protected Member Functions inherited from plask::SparseMatrix
virtual int | get_maxnz () const

## Additional Inherited Members
Public Types inherited from plask::SparseMatrix
typedef void(* | NspcgFunc) (...)
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.
Protected Attributes inherited from plask::SparseMatrix
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

## Detailed Description

Definition at line 347 of file iterative_matrix.hpp.

## Constructor & Destructor Documentation

## ◆ SparseBandMatrix() [1/3]

template<typename SolverT >

plask::SparseBandMatrix::SparseBandMatrix | ( | SolverT * | solver,
|  | size_t | rank,
|  | size_t | major
| ) |  |
| inline

Create 2D matrix.

Parameters

  solver | solver
  rank | rank of the matrix
  major | shift of nodes to the next row (mesh[x,y+1])

Definition at line 355 of file iterative_matrix.hpp.

## ◆ SparseBandMatrix() [2/3]

template<typename SolverT >

plask::SparseBandMatrix::SparseBandMatrix | ( | SolverT * | solver,
|  | size_t | rank,
|  | size_t | major,
|  | size_t | minor
| ) |  |
| inline

Create 3D matrix.

Parameters

  solver | solver
  rank | rank of the matrix
  major | shift of nodes to the next major row (mesh[x,y,z+1])
  minor | shift of nodes to the next minor row (mesh[x,y+1,z])

Definition at line 373 of file iterative_matrix.hpp.

## ◆ SparseBandMatrix() [3/3]

template<typename SolverT >

plask::SparseBandMatrix::SparseBandMatrix | ( | SolverT * | solver,
|  | size_t | rank,
|  | std::initializer_list< int > | bands
| ) |  |
| inline

Create band matrix.

Parameters

  solver | solver
  rank | rank of the matrix
  bands | list of non-zero bands (shift from diagonal)

Definition at line 399 of file iterative_matrix.hpp.

## Member Function Documentation

## ◆ addmult()

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

Multiply matrix by vector adding the result.

Parameters

  vector | vector to multiply
  result | multiplication result

Implements plask::FemMatrix.

Definition at line 420 of file iterative_matrix.hpp.

## ◆ get_preconditioner()

NspcgFunc plask::SparseBandMatrix::get_preconditioner | ( |  | ) |
| inline override protected virtual

Implements plask::SparseMatrix.

Definition at line 436 of file iterative_matrix.hpp.

## ◆ operator()()

double & plask::SparseBandMatrix::operator() | ( | size_t | r,
|  | size_t | c
| ) |  |
| inline override virtual

Return reference to array element.

Parameters

  r | index of the element row
  c | index of the element column

Returns
  reference to array element

Implements plask::FemMatrix.

Definition at line 412 of file iterative_matrix.hpp.

## ◆ setBC()

void plask::SparseBandMatrix::setBC | ( | DataVector< double > & | B,
|  | size_t | r,
|  | double | val
| ) |  |
| inline override virtual

Set Dirichlet boundary condition.

Parameters

  B | right hand side of the equation
  r | index of the row
  val | value of the boundary condition

Implements plask::FemMatrix.

Definition at line 462 of file iterative_matrix.hpp.

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

- plask/common/fem/iterative_matrix.hpp