|
jacobi.template
|
#include <getmatrix.h>
Public Member Functions | |
| FEM_Matrix (Mesh const &mesh) | |
| FEM_Matrix (FEM_Matrix const &)=default | |
| ~FEM_Matrix () override | |
| void | Derive_Matrix_Pattern () |
| void | Derive_Matrix_Pattern_fast () |
| void | Derive_Matrix_Pattern_slow () |
| void | CalculateLaplace (std::vector< double > &f) |
| void | ApplyDirichletBC (std::vector< double > const &u, std::vector< double > &f) |
| void | AddElem_3 (int const ial[3], double const ske[3][3], double const fe[3], std::vector< double > &f) |
| ** | |
Public Member Functions inherited from CRS_Matrix | |
| CRS_Matrix () | |
| CRS_Matrix (CRS_Matrix const &)=default | |
| virtual | ~CRS_Matrix () override |
| void | GetDiag (std::vector< double > &d) const override |
| void | Mult (std::vector< double > &w, std::vector< double > const &u) const override |
| ** | |
| void | Defect (std::vector< double > &w, std::vector< double > const &f, std::vector< double > const &u) const override |
| void | Debug () const override |
| int | fetch (int row, int col) const override |
| bool | Compare2Old (int nnode, int const id[], int const ik[], double const sk[]) const |
Public Member Functions inherited from Matrix | |
| Matrix (int nrows, int ncols) | |
| Matrix (Matrix const &)=default | |
| virtual | ~Matrix () |
| bool | isSquare () const |
| int | Nrows () const |
| int | Ncols () const |
| std::vector< double > const & | GetDiag () const |
Private Attributes | |
| Mesh const & | _mesh |
| reference to discretization | |
Additional Inherited Members | |
Protected Attributes inherited from CRS_Matrix | |
| int | _nnz |
| number of non-zero entries | |
| std::vector< int > | _id |
| start indices of matrix rows | |
| std::vector< int > | _ik |
| column indices | |
| std::vector< double > | _sk |
| non-zero values | |
Protected Attributes inherited from Matrix | |
| int | _nrows |
| number of rows in matrix | |
| int | _ncols |
| number of columns in matrix | |
| std::vector< double > | _dd |
| diagonal matrix elements | |
FEM Matrix in CRS format (compressed row storage; also named CSR), see an introduction.
Definition at line 235 of file getmatrix.h.
|
explicit |
Initializes the CRS matrix structure from the given discretization in mesh.
The sparse matrix pattern is generated but the values are 0.
| [in] | mesh | given discretization |
mesh is stored inside this class. Therefore, changing mesh outside requires also to call method Derive_Matrix_Pattern explicitly.Definition at line 184 of file getmatrix.cpp.
|
default |
|
override |
Destructor.
Definition at line 191 of file getmatrix.cpp.
| void FEM_Matrix::AddElem_3 | ( | int const | ial[3], |
| double const | ske[3][3], | ||
| double const | fe[3], | ||
| std::vector< double > & | f | ||
| ) |
**
Adds the element stiffness matrix ske and the element load vector fe of one triangular element with linear shape functions to the appropriate positions in the stiffness matrix, stored as CSR matrix K(sk,id, ik).
| [in] | ial | node indices of the three element vertices |
| [in] | ske | element stiffness matrix |
| [in] | fe | element load vector |
| [in,out] | f | distributed local vector storing the right hand side |
Definition at line 398 of file getmatrix.cpp.
| void FEM_Matrix::ApplyDirichletBC | ( | std::vector< double > const & | u, |
| std::vector< double > & | f | ||
| ) |
Applies Dirichlet boundary conditions to stiffness matrix and to load vector f. The penalty method is used for incorporating the given values u.
| [in] | u | (global) vector with Dirichlet data |
| [in,out] | f | load vector |
Definition at line 366 of file getmatrix.cpp.
| void FEM_Matrix::CalculateLaplace | ( | std::vector< double > & | f | ) |
Calculates the entries of f.e. stiffness matrix and load/rhs vector f for the Laplace operator in 2D. No memory is allocated.
| [in,out] | f | (preallocated) rhs/load vector |
Definition at line 308 of file getmatrix.cpp.
|
inline |
Generates the sparse matrix pattern and overwrites the existing pattern.
The sparse matrix pattern is generated but the values are 0.
Definition at line 265 of file getmatrix.h.
| void FEM_Matrix::Derive_Matrix_Pattern_fast | ( | ) |
Definition at line 194 of file getmatrix.cpp.
| void FEM_Matrix::Derive_Matrix_Pattern_slow | ( | ) |
Definition at line 244 of file getmatrix.cpp.
|
private |
reference to discretization
Definition at line 316 of file getmatrix.h.