Fast Auxiliary Space Preconditioning 2.7.7 Aug/28/2022
Loading...
Searching...
No Matches
PreCSR.c
Go to the documentation of this file.
1
17#include "fasp.h"
18#include "fasp_functs.h"
19
20/*---------------------------------*/
21/*-- Declare Private Functions --*/
22/*---------------------------------*/
23
24#include "PreMGUtil.inl"
25
26/*---------------------------------*/
27/*-- Public Functions --*/
28/*---------------------------------*/
29
46precond *fasp_precond_setup (const SHORT precond_type,
47 AMG_param *amgparam,
48 ILU_param *iluparam,
49 dCSRmat *A)
50{
51 precond *pc = NULL;
52 AMG_data *mgl = NULL;
53 precond_data *pcdata = NULL;
54 ILU_data *ILU = NULL;
55 dvector *diag = NULL;
56
57 INT max_levels, nnz, m, n;
58
59 switch (precond_type) {
60
61 case PREC_AMG: // AMG preconditioner
62
63 pc = (precond *)fasp_mem_calloc(1, sizeof(precond));
64 max_levels = amgparam->max_levels;
65 nnz = A->nnz; m = A->row; n = A->col;
66
67 // initialize A, b, x for mgl[0]
68 mgl=fasp_amg_data_create(max_levels);
69 mgl[0].A=fasp_dcsr_create(m,n,nnz); fasp_dcsr_cp(A,&mgl[0].A);
70 mgl[0].b=fasp_dvec_create(n); mgl[0].x=fasp_dvec_create(n);
71
72 // setup preconditioner
73 switch (amgparam->AMG_type) {
74 case SA_AMG: // Smoothed Aggregation AMG
75 fasp_amg_setup_sa(mgl, amgparam); break;
76 case UA_AMG: // Unsmoothed Aggregation AMG
77 fasp_amg_setup_ua(mgl, amgparam); break;
78 default: // Classical AMG
79 fasp_amg_setup_rs(mgl, amgparam); break;
80 }
81
82 pcdata = (precond_data *)fasp_mem_calloc(1, sizeof(precond_data));
83 fasp_param_amg_to_prec(pcdata, amgparam);
84 pcdata->max_levels = mgl[0].num_levels;
85 pcdata->mgl_data = mgl;
86
87 pc->data = pcdata;
88
89 switch (amgparam->cycle_type) {
90 case AMLI_CYCLE: // AMLI cycle
91 pc->fct = fasp_precond_amli; break;
92 case NL_AMLI_CYCLE: // Nonlinear AMLI
93 pc->fct = fasp_precond_namli; break;
94 default: // V,W-cycles or hybrid cycles
95 pc->fct = fasp_precond_amg; break;
96 }
97
98 break;
99
100 case PREC_FMG: // FMG preconditioner
101
102 pc = (precond *)fasp_mem_calloc(1, sizeof(precond));
103 max_levels = amgparam->max_levels;
104 nnz = A->nnz; m = A->row; n = A->col;
105
106 // initialize A, b, x for mgl[0]
107 mgl=fasp_amg_data_create(max_levels);
108 mgl[0].A=fasp_dcsr_create(m,n,nnz); fasp_dcsr_cp(A,&mgl[0].A);
109 mgl[0].b=fasp_dvec_create(n); mgl[0].x=fasp_dvec_create(n);
110
111 // setup preconditioner
112 switch (amgparam->AMG_type) {
113 case SA_AMG: // Smoothed Aggregation AMG
114 fasp_amg_setup_sa(mgl, amgparam); break;
115 case UA_AMG: // Unsmoothed Aggregation AMG
116 fasp_amg_setup_ua(mgl, amgparam); break;
117 default: // Classical AMG
118 fasp_amg_setup_rs(mgl, amgparam); break;
119 }
120
121 pcdata = (precond_data *)fasp_mem_calloc(1, sizeof(precond_data));
122 fasp_param_amg_to_prec(pcdata, amgparam);
123 pcdata->max_levels = mgl[0].num_levels;
124 pcdata->mgl_data = mgl;
125
126 pc->data = pcdata; pc->fct = fasp_precond_famg;
127
128 break;
129
130 case PREC_ILU: // ILU preconditioner
131
132 pc = (precond *)fasp_mem_calloc(1, sizeof(precond));
133 ILU = (ILU_data *)fasp_mem_calloc(1, sizeof(ILU_data));
134 fasp_ilu_dcsr_setup(A, ILU, iluparam);
135 pc->data = ILU;
136 pc->fct = fasp_precond_ilu;
137
138 break;
139
140 case PREC_DIAG: // Diagonal preconditioner
141
142 pc = (precond *)fasp_mem_calloc(1, sizeof(precond));
143 diag = (dvector *)fasp_mem_calloc(1, sizeof(dvector));
144 fasp_dcsr_getdiag(0, A, diag);
145
146 pc->data = diag;
148
149 break;
150
151 default: // No preconditioner
152
153 break;
154
155 }
156
157 return pc;
158}
159
173 REAL *z,
174 void *data)
175{
176 dvector *diag=(dvector *)data;
177 REAL *diagptr=diag->val;
178 INT i, m=diag->row;
179
180 memcpy(z,r,m*sizeof(REAL));
181 for (i=0;i<m;++i) {
182 if (ABS(diag->val[i])>SMALLREAL) z[i]/=diagptr[i];
183 }
184}
185
199 REAL *z,
200 void *data)
201{
202 ILU_data *iludata=(ILU_data *)data;
203 const INT m=iludata->row, mm1=m-1, memneed=2*m;
204 REAL *zz, *zr;
205
206 if (iludata->nwork<memneed) goto MEMERR; // check this outside this subroutine!!
207
208 zz = iludata->work;
209 zr = iludata->work+m;
210 fasp_darray_cp(m, r, zr);
211
212 {
213 INT i, j, jj, begin_row, end_row, mm2=m-2;
214 INT *ijlu=iludata->ijlu;
215 REAL *lu=iludata->luval;
216
217 // forward sweep: solve unit lower matrix equation L*zz=zr
218 zz[0]=zr[0];
219
220 for (i=1;i<=mm1;++i) {
221 begin_row=ijlu[i]; end_row=ijlu[i+1]-1;
222 for (j=begin_row;j<=end_row;++j) {
223 jj=ijlu[j];
224 if (jj<i) zr[i]-=lu[j]*zz[jj];
225 else break;
226 }
227 zz[i]=zr[i];
228 }
229
230 // backward sweep: solve upper matrix equation U*z=zz
231 z[mm1]=zz[mm1]*lu[mm1];
232 for (i=mm2;i>=0;i--) {
233 begin_row=ijlu[i]; end_row=ijlu[i+1]-1;
234 for (j=end_row;j>=begin_row;j--) {
235 jj=ijlu[j];
236 if (jj>i) zz[i]-=lu[j]*z[jj];
237 else break;
238 }
239 z[i]=zz[i]*lu[i];
240 }
241 }
242
243 return;
244
245MEMERR:
246 printf("### ERROR: Need %d memory, only %d available!\n",
247 memneed, iludata->nwork);
248 fasp_chkerr(ERROR_ALLOC_MEM, __FUNCTION__);
249}
250
264 REAL *z,
265 void *data)
266{
267 ILU_data *iludata=(ILU_data *)data;
268 const INT m=iludata->row, mm1=m-1, memneed=2*m;
269 REAL *zz, *zr;
270
271 if (iludata->nwork<memneed) goto MEMERR;
272
273 zz = iludata->work;
274 zr = iludata->work+m;
275 fasp_darray_cp(m, r, zr);
276
277 {
278 INT i, j, jj, begin_row, end_row;
279 INT *ijlu=iludata->ijlu;
280 REAL *lu=iludata->luval;
281
282 // forward sweep: solve unit lower matrix equation L*z=r
283 zz[0]=zr[0];
284 for (i=1;i<=mm1;++i) {
285 begin_row=ijlu[i]; end_row=ijlu[i+1]-1;
286 for (j=begin_row;j<=end_row;++j) {
287 jj=ijlu[j];
288 if (jj<i) zr[i]-=lu[j]*zz[jj];
289 else break;
290 }
291 zz[i]=zr[i];
292 }
293 }
294
295 fasp_darray_cp(m, zz, z);
296
297 return;
298
299MEMERR:
300 printf("### ERROR: Need %d memory, only %d available!",
301 memneed, iludata->nwork);
302 fasp_chkerr(ERROR_ALLOC_MEM, __FUNCTION__);
303}
304
318 REAL *z,
319 void *data)
320{
321 ILU_data *iludata=(ILU_data *)data;
322 const INT m=iludata->row, mm1=m-1, memneed=2*m;
323 REAL *zz;
324
325 if (iludata->nwork<memneed) goto MEMERR;
326
327 zz = iludata->work;
328 fasp_darray_cp(m, r, zz);
329
330 {
331 INT i, j, jj, begin_row, end_row, mm2=m-2;
332 INT *ijlu=iludata->ijlu;
333 REAL *lu=iludata->luval;
334
335 // backward sweep: solve upper matrix equation U*z=zz
336 z[mm1]=zz[mm1]*lu[mm1];
337 for (i=mm2;i>=0;i--) {
338 begin_row=ijlu[i]; end_row=ijlu[i+1]-1;
339 for (j=end_row;j>=begin_row;j--) {
340 jj=ijlu[j];
341 if (jj>i) zz[i]-=lu[j]*z[jj];
342 else break;
343 }
344 z[i]=zz[i]*lu[i];
345 }
346
347 }
348
349 return;
350
351MEMERR:
352 printf("### ERROR: Need %d memory, only %d available!",
353 memneed, iludata->nwork);
354 fasp_chkerr(ERROR_ALLOC_MEM, __FUNCTION__);
355}
356
372 REAL *z,
373 void *data)
374{
375 SWZ_data * swzdata = (SWZ_data *)data;
376 SWZ_param * swzparam = swzdata->swzparam;
377 const INT swztype = swzdata->SWZ_type;
378 const INT n = swzdata->A.row;
379
380 dvector x, b;
381
382 fasp_dvec_alloc(n, &x);
383 fasp_dvec_alloc(n, &b);
384 fasp_darray_cp(n, r, b.val);
385
386 fasp_dvec_set(n, &x, 0);
387
388 switch (swztype) {
389 case SCHWARZ_BACKWARD:
390 fasp_dcsr_swz_backward(swzdata, swzparam, &x, &b);
391 break;
393 fasp_dcsr_swz_forward(swzdata, swzparam, &x, &b);
394 fasp_dcsr_swz_backward(swzdata, swzparam, &x, &b);
395 break;
396 default:
397 fasp_dcsr_swz_forward(swzdata, swzparam, &x, &b);
398 break;
399 }
400
401 fasp_darray_cp(n, x.val, z);
402}
403
417 REAL *z,
418 void *data)
419{
420 precond_data *pcdata=(precond_data *)data;
421 const INT m=pcdata->mgl_data[0].A.row;
422 const INT maxit=pcdata->maxit;
423 INT i;
424
425 AMG_param amgparam; fasp_param_amg_init(&amgparam);
426 fasp_param_prec_to_amg(&amgparam,pcdata);
427
428 AMG_data *mgl = pcdata->mgl_data;
429 mgl->b.row=m; fasp_darray_cp(m,r,mgl->b.val); // residual is an input
430 mgl->x.row=m; fasp_dvec_set(m,&mgl->x,0.0);
431
432 for ( i=maxit; i--; ) fasp_solver_mgcycle(mgl,&amgparam);
433
434 fasp_darray_cp(m,mgl->x.val,z);
435}
436
450 REAL *z,
451 void *data)
452{
453 precond_data *pcdata=(precond_data *)data;
454 const INT m=pcdata->mgl_data[0].A.row;
455 const INT maxit=pcdata->maxit;
456 INT i;
457
458 AMG_param amgparam; fasp_param_amg_init(&amgparam);
459 fasp_param_prec_to_amg(&amgparam,pcdata);
460
461 AMG_data *mgl = pcdata->mgl_data;
462 mgl->b.row=m; fasp_darray_cp(m,r,mgl->b.val); // residual is an input
463 mgl->x.row=m; fasp_dvec_set(m,&mgl->x,0.0);
464
465 for ( i=maxit; i--; ) fasp_solver_fmgcycle(mgl,&amgparam);
466
467 fasp_darray_cp(m,mgl->x.val,z);
468}
469
483 REAL *z,
484 void *data)
485{
486 precond_data *pcdata=(precond_data *)data;
487 const INT m=pcdata->mgl_data[0].A.row;
488 const INT maxit=pcdata->maxit;
489 INT i;
490
491 AMG_param amgparam; fasp_param_amg_init(&amgparam);
492 fasp_param_prec_to_amg(&amgparam,pcdata);
493
494 AMG_data *mgl = pcdata->mgl_data;
495 mgl->b.row=m; fasp_darray_cp(m,r,mgl->b.val); // residual is an input
496 mgl->x.row=m; fasp_dvec_set(m,&mgl->x,0.0);
497
498 for ( i=maxit; i--; ) fasp_solver_amli(mgl,&amgparam,0);
499
500 fasp_darray_cp(m,mgl->x.val,z);
501}
502
516 REAL *z,
517 void *data)
518{
519 precond_data *pcdata=(precond_data *)data;
520 const INT m=pcdata->mgl_data[0].A.row;
521 const INT maxit=pcdata->maxit;
522 const SHORT num_levels = pcdata->max_levels;
523 INT i;
524
525 AMG_param amgparam; fasp_param_amg_init(&amgparam);
526 fasp_param_prec_to_amg(&amgparam,pcdata);
527
528 AMG_data *mgl = pcdata->mgl_data;
529 mgl->b.row=m; fasp_darray_cp(m,r,mgl->b.val); // residual is an input
530 mgl->x.row=m; fasp_dvec_set(m,&mgl->x,0.0);
531
532 for ( i=maxit; i--; ) fasp_solver_namli(mgl, &amgparam, 0, num_levels);
533 fasp_darray_cp(m,mgl->x.val,z);
534}
535
549 REAL *z,
550 void *data)
551{
552 precond_data *pcdata=(precond_data *)data;
553 const INT m=pcdata->mgl_data[0].A.row;
554 const INT maxit=pcdata->maxit;
555 INT i;
556
557 dCSRmat *A_nk = pcdata->A_nk;
558 dCSRmat *P_nk = pcdata->P_nk;
559 dCSRmat *R_nk = pcdata->R_nk;
560
561 fasp_darray_set(m, z, 0.0);
562
563 // local variables
564 dvector r_nk, z_nk;
565 fasp_dvec_alloc(A_nk->row, &r_nk);
566 fasp_dvec_alloc(A_nk->row, &z_nk);
567
568 //----------------------
569 // extra kernel solve
570 //----------------------
571 // r_nk = R_nk*r
572 fasp_blas_dcsr_mxv(R_nk, r, r_nk.val);
573
574 // z_nk = A_nk^{-1}*r_nk
575#if WITH_UMFPACK // use UMFPACK directly
576 fasp_solver_umfpack(A_nk, &r_nk, &z_nk, 0);
577#else
578 fasp_coarse_itsolver(A_nk, &r_nk, &z_nk, 1e-12, 0);
579#endif
580
581 // z = z + P_nk*z_nk;
582 fasp_blas_dcsr_aAxpy(1.0, P_nk, z_nk.val, z);
583
584 //----------------------
585 // AMG solve
586 //----------------------
587 AMG_param amgparam; fasp_param_amg_init(&amgparam);
588 fasp_param_prec_to_amg(&amgparam,pcdata);
589
590 AMG_data *mgl = pcdata->mgl_data;
591 mgl->b.row=m; fasp_darray_cp(m,r,mgl->b.val); // residual is an input
592 mgl->x.row=m; //fasp_dvec_set(m,&mgl->x,0.0);
593 fasp_darray_cp(m, z, mgl->x.val);
594
595 for ( i=maxit; i--; ) fasp_solver_mgcycle(mgl,&amgparam);
596
597 fasp_darray_cp(m,mgl->x.val,z);
598
599 //----------------------
600 // extra kernel solve
601 //----------------------
602 // r = r - A*z
603 fasp_blas_dcsr_aAxpy(-1.0, &(pcdata->mgl_data[0].A), z, mgl->b.val);
604
605 // r_nk = R_nk*r
606 fasp_blas_dcsr_mxv(R_nk, mgl->b.val, r_nk.val);
607
608 // z_nk = A_nk^{-1}*r_nk
609#if WITH_UMFPACK // use UMFPACK directly
610 fasp_solver_umfpack(A_nk, &r_nk, &z_nk, 0);
611#else
612 fasp_coarse_itsolver(A_nk, &r_nk, &z_nk, 1e-12, 0);
613#endif
614
615 // z = z + P_nk*z_nk;
616 fasp_blas_dcsr_aAxpy(1.0, P_nk, z_nk.val, z);
617}
618
619/*---------------------------------*/
620/*-- End of File --*/
621/*---------------------------------*/
void fasp_darray_set(const INT n, REAL *x, const REAL val)
Set initial value for an array to be x=val.
Definition: AuxArray.c:41
void fasp_darray_cp(const INT n, const REAL *x, REAL *y)
Copy an array to the other y=x.
Definition: AuxArray.c:210
void * fasp_mem_calloc(const unsigned int size, const unsigned int type)
Allocate, initiate, and check memory.
Definition: AuxMemory.c:65
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_param_amg_to_prec(precond_data *pcdata, const AMG_param *amgparam)
Set precond_data with AMG_param.
Definition: AuxParam.c:782
void fasp_param_amg_init(AMG_param *amgparam)
Initialize AMG parameters.
Definition: AuxParam.c:431
void fasp_param_prec_to_amg(AMG_param *amgparam, const precond_data *pcdata)
Set AMG_param with precond_data.
Definition: AuxParam.c:816
dvector fasp_dvec_create(const INT m)
Create dvector data space of REAL type.
Definition: AuxVector.c:62
void fasp_dvec_set(INT n, dvector *x, const REAL val)
Initialize dvector x[i]=val for i=0:n-1.
Definition: AuxVector.c:222
void fasp_dvec_alloc(const INT m, dvector *u)
Create dvector data space of REAL type.
Definition: AuxVector.c:105
SHORT fasp_ilu_dcsr_setup(dCSRmat *A, ILU_data *iludata, ILU_param *iluparam)
Get ILU decomposition of a CSR matrix A.
void fasp_dcsr_swz_forward(SWZ_data *swzdata, SWZ_param *swzparam, dvector *x, dvector *b)
Schwarz smoother: forward sweep.
void fasp_dcsr_swz_backward(SWZ_data *swzdata, SWZ_param *swzparam, dvector *x, dvector *b)
Schwarz smoother: backward sweep.
dCSRmat fasp_dcsr_create(const INT m, const INT n, const INT nnz)
Create CSR sparse matrix data memory space.
Definition: BlaSparseCSR.c:47
void fasp_dcsr_cp(const dCSRmat *A, dCSRmat *B)
copy a dCSRmat to a new one B=A
Definition: BlaSparseCSR.c:851
void fasp_dcsr_getdiag(INT n, const dCSRmat *A, dvector *diag)
Get first n diagonal entries of a CSR matrix A.
Definition: BlaSparseCSR.c:537
void fasp_blas_dcsr_mxv(const dCSRmat *A, const REAL *x, REAL *y)
Matrix-vector multiplication y = A*x.
Definition: BlaSpmvCSR.c:242
void fasp_blas_dcsr_aAxpy(const REAL alpha, const dCSRmat *A, const REAL *x, REAL *y)
Matrix-vector multiplication y = alpha*A*x + y.
Definition: BlaSpmvCSR.c:494
SHORT fasp_amg_setup_rs(AMG_data *mgl, AMG_param *param)
Setup phase of Ruge and Stuben's classic AMG.
Definition: PreAMGSetupRS.c:52
SHORT fasp_amg_setup_sa(AMG_data *mgl, AMG_param *param)
Set up phase of smoothed aggregation AMG.
Definition: PreAMGSetupSA.c:63
SHORT fasp_amg_setup_ua(AMG_data *mgl, AMG_param *param)
Set up phase of unsmoothed aggregation AMG.
Definition: PreAMGSetupUA.c:55
void fasp_precond_amg(REAL *r, REAL *z, void *data)
AMG preconditioner.
Definition: PreCSR.c:416
void fasp_precond_ilu_backward(REAL *r, REAL *z, void *data)
ILU preconditioner: only backward sweep.
Definition: PreCSR.c:317
void fasp_precond_ilu(REAL *r, REAL *z, void *data)
ILU preconditioner.
Definition: PreCSR.c:198
void fasp_precond_swz(REAL *r, REAL *z, void *data)
get z from r by Schwarz
Definition: PreCSR.c:371
void fasp_precond_namli(REAL *r, REAL *z, void *data)
Nonlinear AMLI AMG preconditioner.
Definition: PreCSR.c:515
void fasp_precond_amg_nk(REAL *r, REAL *z, void *data)
AMG with extra near kernel solve as preconditioner.
Definition: PreCSR.c:548
void fasp_precond_diag(REAL *r, REAL *z, void *data)
Diagonal preconditioner z=inv(D)*r.
Definition: PreCSR.c:172
precond * fasp_precond_setup(const SHORT precond_type, AMG_param *amgparam, ILU_param *iluparam, dCSRmat *A)
Setup preconditioner interface for iterative methods.
Definition: PreCSR.c:46
void fasp_precond_famg(REAL *r, REAL *z, void *data)
Full AMG preconditioner.
Definition: PreCSR.c:449
void fasp_precond_ilu_forward(REAL *r, REAL *z, void *data)
ILU preconditioner: only forward sweep.
Definition: PreCSR.c:263
void fasp_precond_amli(REAL *r, REAL *z, void *data)
AMLI AMG preconditioner.
Definition: PreCSR.c:482
AMG_data * fasp_amg_data_create(SHORT max_levels)
Create and initialize AMG_data for classical and SA AMG.
Definition: PreDataInit.c:64
void fasp_solver_fmgcycle(AMG_data *mgl, AMG_param *param)
Solve Ax=b with non-recursive full multigrid K-cycle.
void fasp_solver_mgcycle(AMG_data *mgl, AMG_param *param)
Solve Ax=b with non-recursive multigrid cycle.
Definition: PreMGCycle.c:48
void fasp_solver_namli(AMG_data *mgl, AMG_param *param, INT l, INT num_levels)
Solve Ax=b with recursive nonlinear AMLI-cycle.
void fasp_solver_amli(AMG_data *mgl, AMG_param *param, INT l)
Solve Ax=b with recursive AMLI-cycle.
INT fasp_solver_umfpack(dCSRmat *ptrA, dvector *b, dvector *u, const SHORT prtlvl)
Solve Au=b by UMFpack.
Definition: XtrUmfpack.c:44
Main header file for the FASP project.
#define REAL
Definition: fasp.h:75
#define SHORT
FASP integer and floating point numbers.
Definition: fasp.h:71
#define ABS(a)
Definition: fasp.h:84
#define INT
Definition: fasp.h:72
#define AMLI_CYCLE
Definition: fasp_const.h:181
#define NL_AMLI_CYCLE
Definition: fasp_const.h:182
#define PREC_ILU
Definition: fasp_const.h:143
#define PREC_FMG
Definition: fasp_const.h:142
#define SCHWARZ_BACKWARD
Definition: fasp_const.h:157
#define PREC_AMG
Definition: fasp_const.h:141
#define SCHWARZ_SYMMETRIC
Definition: fasp_const.h:158
#define SA_AMG
Definition: fasp_const.h:164
#define ERROR_ALLOC_MEM
Definition: fasp_const.h:30
#define PREC_DIAG
Definition: fasp_const.h:140
#define SMALLREAL
Definition: fasp_const.h:256
#define UA_AMG
Definition: fasp_const.h:165
Data for AMG methods.
Definition: fasp.h:804
dCSRmat A
pointer to the matrix at level level_num
Definition: fasp.h:817
dvector b
pointer to the right-hand side at level level_num
Definition: fasp.h:826
dvector x
pointer to the iterative solution at level level_num
Definition: fasp.h:829
SHORT num_levels
number of levels in use <= max_levels
Definition: fasp.h:812
Parameters for AMG methods.
Definition: fasp.h:455
SHORT AMG_type
type of AMG method
Definition: fasp.h:458
SHORT cycle_type
type of AMG cycle
Definition: fasp.h:476
SHORT max_levels
max number of levels of AMG
Definition: fasp.h:470
Data for ILU setup.
Definition: fasp.h:651
INT * ijlu
integer array of row pointers and column indexes, the size is nzlu
Definition: fasp.h:669
REAL * luval
nonzero entries of LU
Definition: fasp.h:672
INT nwork
work space size
Definition: fasp.h:678
INT row
row number of matrix LU, m
Definition: fasp.h:660
REAL * work
work space
Definition: fasp.h:681
Parameters for ILU.
Definition: fasp.h:404
Data for Schwarz methods.
Definition: fasp.h:726
dCSRmat A
pointer to the original coefficient matrix
Definition: fasp.h:731
SWZ_param * swzparam
param for Schwarz
Definition: fasp.h:794
INT SWZ_type
Schwarz method type.
Definition: fasp.h:760
Parameters for Schwarz method.
Definition: fasp.h:430
Sparse matrix of REAL type in CSR format.
Definition: fasp.h:151
INT col
column of matrix A, n
Definition: fasp.h:157
INT row
row number of matrix A, m
Definition: fasp.h:154
INT nnz
number of nonzero entries
Definition: fasp.h:160
Vector with n entries of REAL type.
Definition: fasp.h:354
REAL * val
actual vector entries
Definition: fasp.h:360
INT row
number of rows
Definition: fasp.h:357
Data for preconditioners.
Definition: fasp.h:894
AMG_data * mgl_data
AMG preconditioner data.
Definition: fasp.h:954
dCSRmat * A_nk
Matrix data for near kernel.
Definition: fasp.h:965
dCSRmat * R_nk
Restriction for near kernel.
Definition: fasp.h:971
SHORT max_levels
max number of AMG levels
Definition: fasp.h:906
dCSRmat * P_nk
Prolongation for near kernel.
Definition: fasp.h:968
INT maxit
max number of iterations of AMG preconditioner
Definition: fasp.h:903
Preconditioner data and action.
Definition: fasp.h:1095
void * data
data for preconditioner, void pointer
Definition: fasp.h:1098
void(* fct)(REAL *, REAL *, void *)
action for preconditioner, void function pointer
Definition: fasp.h:1101