Fast Auxiliary Space Preconditioning  1.8.4 Feb/15/2016
smoother_csr_cr.c
Go to the documentation of this file.
1 
8 #include <math.h>
9 
10 #include "fasp.h"
11 #include "fasp_functs.h"
12 
13 /*---------------------------------*/
14 /*-- Public Functions --*/
15 /*---------------------------------*/
16 
39  INT n,
40  REAL *u,
41  INT *ia,
42  INT *ja,
43  REAL *a,
44  REAL *b,
45  INT L,
46  INT *CF)
47 {
48  INT i,j,k,l;
49  REAL t, d=0;
50 
51  for (l=0;l<L;++l) {
52  for (i=0;i<n;++i) {
53  if (CF[i] == pt) {
54  t=b[i];
55  for (k=ia[i];k<ia[i+1];++k) {
56  j=ja[k];
57  if (CF[j] == pt) {
58  if (i!=j) {
59  t-=a[k]*u[j];
60  }
61  else {
62  d=a[k];
63  }
64  if (ABS(d)>SMALLREAL) {
65  u[i]=t/d;
66  }
67  else {
68  printf("### ERROR: Diagonal entry (%d,%e) close to 0!\n",i,d);
69  fasp_chkerr(ERROR_MISC, __FUNCTION__);
70  }
71  }
72  }
73  }
74  else {
75  u[i]=0.e0;
76  }
77  }
78  }
79 }
80 
81 /*---------------------------------*/
82 /*-- End of File --*/
83 /*---------------------------------*/
void fasp_smoother_dcsr_gscr(INT pt, INT n, REAL *u, INT *ia, INT *ja, REAL *a, REAL *b, INT L, INT *CF)
Gauss Seidel method restriced to a block.
void fasp_chkerr(const SHORT status, const char *fctname)
Check error status and print out error messages before quit.
Definition: message.c:199
#define REAL
Definition: fasp.h:67
#define INT
Definition: fasp.h:64
#define ERROR_MISC
Definition: fasp_const.h:35
Main header file for FASP.
#define ABS(a)
Definition: fasp.h:74
#define SMALLREAL
Definition: fasp_const.h:238