PLaSK library
Loading...
Searching...
No Matches
plask::FemMatrix< T > Struct Template Referenceabstract

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

Inheritance diagram for plask::FemMatrix< T >:
[legend]
Collaboration diagram for plask::FemMatrix< T >:
[legend]

Public Member Functions

 FemMatrix (const Solver *solver, size_t rank, size_t size)
 
 FemMatrix (const FemMatrix &)=delete
 
virtual ~FemMatrix ()
 
virtual T & 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< T > &B, DataVector< T > &X)=0
 Solve for the right-hand-side of a system of linear equations.
 
void solve (DataVector< T > &B, DataVector< T > &X)
 Solve the set of linear equations.
 
void solve (DataVector< T > &B)
 Solve the set of linear equations.
 
virtual void mult (const DataVector< const T > &vector, DataVector< T > &result)=0
 Multiply matrix by vector.
 
virtual void addmult (const DataVector< const T > &vector, DataVector< T > &result)=0
 Multiply matrix by vector adding the result.
 
virtual void setBC (DataVector< T > &B, size_t r, T val)=0
 Set Dirichlet boundary condition.
 
template<typename BoundaryConditonsT >
void applyBC (const BoundaryConditonsT &bconds, DataVector< T > &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.
 
T * data
 Pointer to data.
 
const Solversolver
 Solver owning the matrix.
 

Detailed Description

template<typename T = double>
struct plask::FemMatrix< T >

Definition at line 21 of file matrix.hpp.

Constructor & Destructor Documentation

◆ FemMatrix() [1/2]

template<typename T = double>
plask::FemMatrix< T >::FemMatrix ( const Solver solver,
size_t  rank,
size_t  size 
)
inline

Definition at line 27 of file matrix.hpp.

◆ FemMatrix() [2/2]

template<typename T = double>
plask::FemMatrix< T >::FemMatrix ( const FemMatrix< T > &  )
delete

◆ ~FemMatrix()

template<typename T = double>
virtual plask::FemMatrix< T >::~FemMatrix ( )
inlinevirtual

Definition at line 34 of file matrix.hpp.

Member Function Documentation

◆ addmult()

template<typename T = double>
virtual void plask::FemMatrix< T >::addmult ( const DataVector< const T > &  vector,
DataVector< T > &  result 
)
pure virtual

Multiply matrix by vector adding the result.

Parameters
vectorvector to multiply
resultmultiplication result

◆ applyBC()

template<typename T = double>
void plask::FemMatrix< T >::applyBC ( const BoundaryConditonsT bconds,
DataVector< T > &  B 
)
inline

Apply Dirichlet boundary conditions.

Parameters
bcondsboundary conditions
Bright hand side of the equation

Definition at line 107 of file matrix.hpp.

◆ clear()

template<typename T = double>
virtual void plask::FemMatrix< T >::clear ( )
inlinevirtual

Clear the matrix.

Reimplemented in plask::SparseFreeMatrix.

Definition at line 44 of file matrix.hpp.

◆ describe()

template<typename T = double>
virtual std::string plask::FemMatrix< T >::describe ( ) const
inlinevirtual

Reimplemented in plask::BandMatrix< T >, and plask::BandMatrix< dcomplex >.

Definition at line 116 of file matrix.hpp.

◆ factorize()

template<typename T = double>
virtual void plask::FemMatrix< T >::factorize ( )
inlinevirtual

Factorize the matrix in advance to speed up the solution.

Parameters
solversolver to use

Reimplemented in plask::DpbMatrix, plask::DgbMatrix, and plask::electrical::capacitance::ZgbMatrix.

Definition at line 50 of file matrix.hpp.

◆ mult()

template<typename T = double>
virtual void plask::FemMatrix< T >::mult ( const DataVector< const T > &  vector,
DataVector< T > &  result 
)
pure virtual

Multiply matrix by vector.

Parameters
vectorvector to multiply
resultmultiplication result

◆ operator()()

template<typename T = double>
virtual T & plask::FemMatrix< T >::operator() ( size_t  r,
size_t  c 
)
pure virtual

Return reference to array element.

Parameters
rindex of the element row
cindex of the element column

Implemented in plask::DpbMatrix, plask::DgbMatrix, plask::SparseBandMatrix, plask::SparseFreeMatrix, and plask::electrical::capacitance::ZgbMatrix.

◆ setBC()

template<typename T = double>
virtual void plask::FemMatrix< T >::setBC ( DataVector< T > &  B,
size_t  r,
val 
)
pure virtual

Set Dirichlet boundary condition.

Parameters
Bright hand side of the equation
rindex of the row
valvalue of the boundary condition

Implemented in plask::BandMatrix< T >.

◆ solve() [1/2]

template<typename T = double>
void plask::FemMatrix< T >::solve ( DataVector< T > &  B)
inline

Solve the set of linear equations.

Parameters
solversolver to use
[in,out]Bright hand side of the equation, on output contains the solution
Returns
number of iterations

Definition at line 78 of file matrix.hpp.

◆ solve() [2/2]

template<typename T = double>
void plask::FemMatrix< T >::solve ( DataVector< T > &  B,
DataVector< T > &  X 
)
inline

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

Definition at line 67 of file matrix.hpp.

◆ solverhs()

template<typename T = double>
virtual void plask::FemMatrix< T >::solverhs ( DataVector< T > &  B,
DataVector< T > &  X 
)
pure virtual

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

Member Data Documentation

◆ data

template<typename T = double>
T* plask::FemMatrix< T >::data

Pointer to data.

Definition at line 24 of file matrix.hpp.

◆ rank

template<typename T = double>
const size_t plask::FemMatrix< T >::rank

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

Definition at line 22 of file matrix.hpp.

◆ size

template<typename T = double>
const size_t plask::FemMatrix< T >::size

Number of stored elements in the matrix.

Definition at line 23 of file matrix.hpp.

◆ solver

template<typename T = double>
const Solver* plask::FemMatrix< T >::solver

Solver owning the matrix.

Definition at line 25 of file matrix.hpp.


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