jacobi_oo_STL
getmatrix.h
Go to the documentation of this file.
1 #ifndef GETMATRIX_FILE
2 #define GETMATRIX_FILE
3 
4 #include "geom.h"
5 #include <vector>
6 
15 void CalcElem(int const ial[3], double const xc[], double ske[3][3], double fe[3]);
16 
33 void AddElem(int const ial[3], double const ske[3][3], double const fe[3],
34  int const id[], int const ik[], double sk[], double f[]);
35 
36 
37 // #####################################################################
43 {
44  public:
58  explicit CRS_Matrix(Mesh const & mesh);
59 
64  {}
65 
71  void Derive_Matrix_Pattern();
72 
79  void CalculateLaplace(std::vector<double> &f);
80 
89  void ApplyDirichletBC(std::vector<double> const &u, std::vector<double> &f);
90 
96  void GetDiag(std::vector<double> &d) const;
97 
104  void Mult(std::vector<double> &w, std::vector<double> const &u) const;
105 
113  void Defect(std::vector<double> &w,
114  std::vector<double> const &f, std::vector<double> const &u) const;
115 
120  int Nrows() const
121  {return _nrows;}
122 
126  void Debug() const;
127 
137  int fetch(int row, int col) const;
138 
151  void AddElem_3(int const ial[3], double const ske[3][3], double const fe[3], std::vector<double> &f);
152 
165  bool Compare2Old(int nnode, int const id[], int const ik[], double const sk[]) const;
166 
167  private:
168  Mesh const & _mesh;
169  int _nrows;
170  int _nnz;
171  std::vector<int> _id;
172  std::vector<int> _ik;
173  std::vector<double> _sk;
174 
175 };
176 
177 
178 #endif
xc
xc
Definition: ascii_read_meshvector.m:30
AddElem
void AddElem(int const ial[3], double const ske[3][3], double const fe[3], int const id[], int const ik[], double sk[], double f[])
Definition: getmatrix.cpp:46
CRS_Matrix::Compare2Old
bool Compare2Old(int nnode, int const id[], int const ik[], double const sk[]) const
Definition: getmatrix.cpp:233
CRS_Matrix::Nrows
int Nrows() const
Definition: getmatrix.h:120
CRS_Matrix::CRS_Matrix
CRS_Matrix(Mesh const &mesh)
Definition: getmatrix.cpp:88
Mesh
Definition: geom.h:11
CRS_Matrix::ApplyDirichletBC
void ApplyDirichletBC(std::vector< double > const &u, std::vector< double > &f)
Definition: getmatrix.cpp:202
CRS_Matrix::Mult
void Mult(std::vector< double > &w, std::vector< double > const &u) const
Definition: getmatrix.cpp:269
CRS_Matrix::Debug
void Debug() const
Definition: getmatrix.cpp:148
CRS_Matrix::CalculateLaplace
void CalculateLaplace(std::vector< double > &f)
Definition: getmatrix.cpp:169
CRS_Matrix::GetDiag
void GetDiag(std::vector< double > &d) const
Definition: getmatrix.cpp:220
geom.h
CRS_Matrix::~CRS_Matrix
~CRS_Matrix()
Definition: getmatrix.h:63
CRS_Matrix::AddElem_3
void AddElem_3(int const ial[3], double const ske[3][3], double const fe[3], std::vector< double > &f)
Definition: getmatrix.cpp:325
nnode
function vertex minimal boundary edge info in an ASCII file Matlab indexing is stored(starts with 1). % % The output file format is compatible with Mesh_2d_3_matlab nnode
Definition: ascii_write_mesh.m:23
CRS_Matrix
Definition: getmatrix.h:42
CRS_Matrix::Defect
void Defect(std::vector< double > &w, std::vector< double > const &f, std::vector< double > const &u) const
Definition: getmatrix.cpp:286
CRS_Matrix::Derive_Matrix_Pattern
void Derive_Matrix_Pattern()
Definition: getmatrix.cpp:95
CalcElem
void CalcElem(int const ial[3], double const xc[], double ske[3][3], double fe[3])
Definition: getmatrix.cpp:16
CRS_Matrix::fetch
int fetch(int row, int col) const
Definition: getmatrix.cpp:304