PLaSK library

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

Symmetric band matrix structure. More...

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

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

## Public Member Functions
| DgbMatrix (const Solver *solver, size_t rank, size_t band)
| Create matrix.
| DgbMatrix (const DgbMatrix &)=delete
size_t | index (size_t r, size_t c)
double & | operator() (size_t r, size_t c) override
| Return reference to array element.
void | factorize () override
| Factorize the matrix in advance to speed up the solution.
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.
void | addmult (const DataVector< const double > &vector, DataVector< double > &result) override
| Multiply matrix by vector adding the result.
Public Member Functions inherited from plask::BandMatrix
| BandMatrix (const Solver *solver, size_t rank, size_t kd, size_t ld)
void | setBC (DataVector< double > &B, size_t r, double val) override
| Set Dirichlet boundary condition.
std::string | describe () const override
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.
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.

## Public Attributes
const size_t | shift
| Shift of the diagonal.
aligned_unique_ptr< int > | ipiv
Public Attributes inherited from plask::BandMatrix
const size_t | ld
| leading dimension of the matrix
const size_t | kd
| Size of the band reduced by one.
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

Symmetric band matrix structure.

Data is stored in LAPACK format.

Definition at line 60 of file gauss_matrix.hpp.

## Constructor & Destructor Documentation

## ◆ DgbMatrix() [1/2]

plask::DgbMatrix::DgbMatrix | ( | const Solver * | solver,
|  | size_t | rank,
|  | size_t | band
| ) |  |
| inline

Create matrix.

Parameters

  rank | rank of the matrix
  band | band size

Definition at line 70 of file gauss_matrix.hpp.

## ◆ DgbMatrix() [2/2]

plask::DgbMatrix::DgbMatrix | ( | const DgbMatrix & |  | ) |
| delete

## Member Function Documentation

## ◆ addmult()

void plask::DgbMatrix::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 132 of file gauss_matrix.hpp.

## ◆ factorize()

void plask::DgbMatrix::factorize | ( |  | ) |
| inline override virtual

Factorize the matrix in advance to speed up the solution.

Parameters

  solver | solver to use

Reimplemented from plask::FemMatrix.

Definition at line 90 of file gauss_matrix.hpp.

## ◆ index()

size_t plask::DgbMatrix::index | ( | size_t | r,
|  | size_t | c
| ) |  |
| inline

Definition at line 76 of file gauss_matrix.hpp.

## ◆ mult()

void plask::DgbMatrix::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 122 of file gauss_matrix.hpp.

## ◆ operator()()

double & plask::DgbMatrix::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

Implements plask::FemMatrix.

Definition at line 88 of file gauss_matrix.hpp.

## ◆ solverhs()

void plask::DgbMatrix::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 107 of file gauss_matrix.hpp.

## Member Data Documentation

## ◆ ipiv

aligned_unique_ptr<int> plask::DgbMatrix::ipiv

Definition at line 63 of file gauss_matrix.hpp.

## ◆ shift

const size_t plask::DgbMatrix::shift

Shift of the diagonal.

Definition at line 61 of file gauss_matrix.hpp.

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

- plask/common/fem/gauss_matrix.hpp