MPI_jacsolve
getmatrix.h
Go to the documentation of this file.
1 #ifndef GETMATRIX_FILE
2 #define GETMATRIX_FILE
3 #include <cassert>
4 #include <iostream>
5 
17 int fetch(const int row, const int col, const int id[], const int ik[]);
18 
19 inline int fetch(const int row, const int col, const int id[], const int ik[])
20 {
21  const int id2 = id[row + 1];
22  int ip = id[row];
23 
24  while (ip<id2 && ik[ip] != col)
25  {
26  ++ip;
27  }
28 
29  if (ip>=id2) {
30  std::cout << "No column " << col << " in row " << row << std::endl;
31  ip = -1;
32  assert(ip>=id2);
33  }
34 
35  return ip;
36 }
37 
49 void Defect(double w[], const double f[], const double u[],
50  const int nnode, const int id[], const int ik[], const double sk[]);
51 
52 
63 void CrsMult(double w[], const double u[], const int nnode, const int id[], const int ik[], const double sk[]);
64 
65 
66 
76 void GetDiag(const int nnode, const int id[], const int ik[], const double sk[], double d[]);
77 
78 
93 void Get_Matrix_Pattern(const int nelem, const int ndof_e, int const *const ia,
94  int &nnz, int* &id, int* &ik, double* &sk);
95 
96 
97 
106 void CalcElem(const int ial[3], const double xc[], double ske[3][3], double fe[3]);
107 
120 void AddElem(const int ial[3], const double ske[3][3], const double fe[3],
121  const int id[], const int ik[], double sk[], double f[]);
122 
123 
124 
132 void DebugMatrix(const int nnode, const int id[], const int ik[], const double sk[]);
133 
134 
153 void GetMatrix (const int nelem, const int ndof_e, const int ia[], const int nnode, const double xc[],
154  const int nnz, const int id[], const int ik[], double sk[], double f[]);
155 
156 
157 
170 void ApplyDirichletBC(const int nx, const int ny, const int neigh[],
171  const double u[], const int id[], const int ik[] , double sk[], double f[]);
172 
173 
174 
175 
176 
177 #endif
void DebugMatrix(const int nnode, const int id[], const int ik[], const double sk[])
Definition: getmatrix.cpp:180
void Get_Matrix_Pattern(const int nelem, const int ndof_e, int const *const ia, int &nnz, int *&id, int *&ik, double *&sk)
Definition: getmatrix.cpp:62
void CrsMult(double w[], const double u[], const int nnode, const int id[], const int ik[], const double sk[])
Definition: getmatrix.cpp:33
void GetMatrix(const int nelem, const int ndof_e, const int ia[], const int nnode, const double xc[], const int nnz, const int id[], const int ik[], double sk[], double f[])
Definition: getmatrix.cpp:208
int fetch(const int row, const int col, const int id[], const int ik[])
Definition: getmatrix.h:19
void ApplyDirichletBC(const int nx, const int ny, const int neigh[], const double u[], const int id[], const int ik[], double sk[], double f[])
Definition: getmatrix.cpp:241
void AddElem(const int ial[3], const double ske[3][3], const double fe[3], const int id[], const int ik[], double sk[], double f[])
Definition: getmatrix.cpp:147
void GetDiag(const int nnode, const int id[], const int ik[], const double sk[], double d[])
Definition: getmatrix.cpp:50
void CalcElem(const int ial[3], const double xc[], double ske[3][3], double fe[3])
Definition: getmatrix.cpp:119
void Defect(double w[], const double f[], const double u[], const int nnode, const int id[], const int ik[], const double sk[])
Definition: getmatrix.cpp:15