Fast Auxiliary Space Preconditioning 2.7.7 Aug/28/2022
Loading...
Searching...
No Matches
ItrSmootherCSRcr.c
Go to the documentation of this file.
1
18#include <math.h>
19
20#include "fasp.h"
21#include "fasp_functs.h"
22
23/*---------------------------------*/
24/*-- Public Functions --*/
25/*---------------------------------*/
26
49 INT n,
50 REAL *u,
51 INT *ia,
52 INT *ja,
53 REAL *a,
54 REAL *b,
55 INT L,
56 INT *CF)
57{
58 INT i,j,k,l;
59 REAL t, d=0;
60
61 for (l=0;l<L;++l) {
62 for (i=0;i<n;++i) {
63 if (CF[i] == pt) {
64 t=b[i];
65 for (k=ia[i];k<ia[i+1];++k) {
66 j=ja[k];
67 if (CF[j] == pt) {
68 if (i!=j) {
69 t-=a[k]*u[j];
70 }
71 else {
72 d=a[k];
73 }
74 if (ABS(d)>SMALLREAL) {
75 u[i]=t/d;
76 }
77 else {
78 printf("### ERROR: Diagonal entry_%d (%e) close to 0!\n",
79 i, d);
80 fasp_chkerr(ERROR_MISC, __FUNCTION__);
81 }
82 }
83 }
84 }
85 else {
86 u[i]=0.e0;
87 }
88 }
89 }
90}
91
92/*---------------------------------*/
93/*-- End of File --*/
94/*---------------------------------*/
void fasp_chkerr(const SHORT status, const char *fctname)
Check error status and print out error messages before quit.
Definition: AuxMessage.c:213
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.
Main header file for the FASP project.
#define REAL
Definition: fasp.h:75
#define ABS(a)
Definition: fasp.h:84
#define INT
Definition: fasp.h:72
#define ERROR_MISC
Definition: fasp_const.h:28
#define SMALLREAL
Definition: fasp_const.h:256