PLaSK library

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

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

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

## Public Member Functions
| 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.
virtual void | solverhs (DataVector< double > &B, DataVector< double > &X)=0
| Solve for the right-hand-side of a system of linear equations.
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 | mult (const DataVector< const double > &vector, DataVector< double > &result)=0
| Multiply matrix by vector.
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

## Public Attributes
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 21 of file matrix.hpp.

## Constructor & Destructor Documentation

## ◆ FemMatrix() [1/2]

plask::FemMatrix::FemMatrix | ( | const Solver * | solver,
|  | size_t | rank,
|  | size_t | size
| ) |  |
| inline

Definition at line 27 of file matrix.hpp.

## ◆ FemMatrix() [2/2]

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

## ◆ ~FemMatrix()

virtual plask::FemMatrix::~FemMatrix | ( |  | ) |
| inline virtual

Definition at line 34 of file matrix.hpp.

## Member Function Documentation

## ◆ addmult()

virtual void plask::FemMatrix::addmult | ( | const DataVector< const double > & | vector,
|  | DataVector< double > & | result
| ) |  |
| pure virtual

Multiply matrix by vector adding the result.

Parameters

  vector | vector to multiply
  result | multiplication result

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

## ◆ applyBC()

template<typename BoundaryConditonsT >

void plask::FemMatrix::applyBC | ( | const BoundaryConditonsT & | bconds,
|  | DataVector< double > & | B
| ) |  |
| inline

Apply Dirichlet boundary conditions.

Parameters

  bconds | boundary conditions
  B | right hand side of the equation

Definition at line 111 of file matrix.hpp.

## ◆ clear()

virtual void plask::FemMatrix::clear | ( |  | ) |
| inline virtual

Clear the matrix.

Reimplemented in plask::SparseFreeMatrix.

Definition at line 44 of file matrix.hpp.

## ◆ describe()

virtual std::string plask::FemMatrix::describe | ( |  | ) | const
| inline virtual

Reimplemented in plask::BandMatrix.

Definition at line 120 of file matrix.hpp.

## ◆ factorize()

virtual void plask::FemMatrix::factorize | ( |  | ) |
| inline virtual

Factorize the matrix in advance to speed up the solution.

Parameters

  solver | solver to use

Reimplemented in plask::DpbMatrix, and plask::DgbMatrix.

Definition at line 52 of file matrix.hpp.

## ◆ mult()

virtual void plask::FemMatrix::mult | ( | const DataVector< const double > & | vector,
|  | DataVector< double > & | result
| ) |  |
| pure virtual

Multiply matrix by vector.

Parameters

  vector | vector to multiply
  result | multiplication result

Implemented in plask::DpbMatrix, plask::DgbMatrix, and plask::SparseMatrix.

## ◆ operator()()

virtual double & plask::FemMatrix::operator() | ( | size_t | r,
|  | size_t | c
| ) |  |
| pure virtual

Return reference to array element.

Parameters

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

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

## ◆ setBC()

virtual void plask::FemMatrix::setBC | ( | DataVector< double > & | B,
|  | size_t | r,
|  | double | val
| ) |  |
| pure virtual

Set Dirichlet boundary condition.

Parameters

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

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

## ◆ solve() [1/2]

void plask::FemMatrix::solve | ( | DataVector< double > & | B | ) |
| inline

Solve the set of linear equations.

Parameters

  | solver | solver to use
  [in,out] | B | right hand side of the equation, on output contains the solution

Returns
  number of iterations

Definition at line 80 of file matrix.hpp.

## ◆ solve() [2/2]

void plask::FemMatrix::solve | ( | DataVector< double > & | B,
|  | DataVector< double > & | X
| ) |  |
| inline

Solve the set 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)

Definition at line 69 of file matrix.hpp.

## ◆ solverhs()

virtual void plask::FemMatrix::solverhs | ( | DataVector< double > & | B,
|  | DataVector< double > & | X
| ) |  |
| pure 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

Implemented in plask::DpbMatrix, plask::DgbMatrix, and plask::SparseMatrix.

## Member Data Documentation

## ◆ data

double* plask::FemMatrix::data

Pointer to data.

Definition at line 24 of file matrix.hpp.

## ◆ rank

const size_t plask::FemMatrix::rank

Order of the matrix, i.e. number of columns or rows.

Definition at line 22 of file matrix.hpp.

## ◆ size

const size_t plask::FemMatrix::size

Number of stored elements in the matrix.

Definition at line 23 of file matrix.hpp.

## ◆ solver

const Solver* plask::FemMatrix::solver

Solver owning the matrix.

Definition at line 25 of file matrix.hpp.

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

- plask/common/fem/matrix.hpp