Fast Auxiliary Space Preconditioning  1.8.4 Feb/15/2016
fasp_block.h
Go to the documentation of this file.
1 
19 #include "fasp.h"
20 
21 #ifndef __FASPBLOCK_HEADER__ /*-- allow multiple inclusions --*/
22 #define __FASPBLOCK_HEADER__
27 #define SMOOTHER_BLKOIL 11
28 #define SMOOTHER_SPETEN 19
30 /*---------------------------*/
31 /*--- Data structures ---*/
32 /*---------------------------*/
33 
44 typedef struct dBSRmat {
45 
48 
51 
54 
56  INT nb; // NOTE: for the moment, allow nb*nb full block
57 
59  INT storage_manner; // 0: row-major order, 1: column-major order
60 
68 
70  INT *IA;
71 
74  INT *JA;
75 
76 } dBSRmat;
84 typedef struct block_dCSRmat {
85 
88 
91 
94 
95 } block_dCSRmat;
103 typedef struct block_iCSRmat {
104 
107 
110 
113 
114 } block_iCSRmat;
120 typedef struct block_dvector {
121 
124 
127 
128 } block_dvector;
136 typedef struct block_ivector {
137 
140 
143 
144 } block_ivector;
151 typedef struct block_Reservoir {
152 
155 
158 
161 
164 
165 } block_Reservoir;
172 typedef struct block_BSR {
173 
176 
179 
182 
185 
186 } block_BSR;
188 /*---------------------------*/
189 /*--- Parameter structures --*/
190 /*---------------------------*/
191 
198 typedef struct {
199 
202 
205 
208 
211 
214 
217 
220 
223 
226 
228  void *Numeric;
229 
232 
235 
238 
241 
244 
247 
250 
253 
256 
259 
262 
265 
266  //-----------------------------------------
267  // extra near kernal space for extra solve
268 
271 
274 
277  //-----------------------------------------
278 
281 
284 
285 } AMG_data_bsr;
293 typedef struct {
294 
297 
300 
301 } precond_diagbsr;
311 typedef struct {
312 
315 
318 
321 
324 
327 
330 
333 
336 
339 
342 
345 
348 
351 
354 
357 
360 
363 
366 
369 
372 
375 
378 
379  // extra near kernal space
380 
383 
386 
389 
392 
394  REAL *w;
395 
405 
408 
411 
414 
417 
420 
423 
426 
429 
432 
435 
438 
441 
444 
447 
450 
453 
456 
459 
462 
465 
468 
471 
474 
475  // Data used for FASP solvers
491  // temporary work space
493  REAL *w;
502 typedef struct {
503 
504  /*-------------------------------------*/
505  /* Basic data for block preconditioner */
506  /*-------------------------------------*/
513  /*------------------------------*/
514  /* Data for the diagonal blocks */
515  /*------------------------------*/
516  /*--- solve by direct solver ---*/
517  void **LU_diag;
519  /*--- solve by AMG ---*/
531 typedef struct {
532 
533  //-------------------------------------------------------------------------------
535  //-------------------------------------------------------------------------------
538  //-------------------------------------------------------------------------------
540  //-------------------------------------------------------------------------------
541  // diagonal scaling for reservoir block
546  // neighborhood and reordering of reservoir block
550  // data for GS/bGS smoother for saturation block
555  // data of AMG for pressure block
559  SHORT print_level;
561 
564 
567 
570 
573 
576 
579 
582 
585 
588 
591 
594 
597 
600 
603 
606 
609 
610  // data of GS/bGS smoother for reservoir block
614  ILU_data *LU;
616 
617  // data for the argumented well block
622  void *Numeric;
624 
627 
628  // parameters for krylov method used for blocks
633  // temporary work space
635  REAL *w;
648 typedef struct {
649 
656  void **local_LU;
660  // temprary work spaces
662  REAL *w;
666 #endif /* end if for __FASPBLOCK_HEADER__ */
667 
668 /*---------------------------------*/
669 /*-- End of File --*/
670 /*---------------------------------*/
dBSRmat R
restriction operator at level level_num
Definition: fasp_block.h:210
REAL * amli_coef
coefficients of the polynomial used by AMLI cycle
Definition: fasp_block.h:605
block_dCSRmat * A
Definition: fasp_block.h:652
INT brow
row number of blocks in A, m
Definition: fasp_block.h:106
Block INT CSR matrix format.
Definition: fasp_block.h:103
dCSRmat * A_nk
Matrix data for near kernal.
Definition: fasp_block.h:382
dvector x
pointer to the iterative solution at level level_num
Definition: fasp_block.h:219
dCSRmat WelWel
well-well block
Definition: fasp_block.h:184
INT maxit_AMG
max number of iterations of AMG preconditioner
Definition: fasp_block.h:563
dCSRmat ** blocks
blocks of dCSRmat, point to blocks[brow][bcol]
Definition: fasp_block.h:93
Parameters for AMG solver.
Definition: fasp.h:583
dBSRmat ResRes
reservoir-reservoir block
Definition: fasp_block.h:175
dvector ** blocks
blocks of dvector, point to blocks[brow]
Definition: fasp_block.h:126
SHORT smooth_order
AMG smoother ordering.
Definition: fasp_block.h:335
REAL tol
tolerance for AMG preconditioner
Definition: fasp_block.h:326
ILU_data * LU
ILU preconditioner data (needed for CPR type preconditioner)
Definition: fasp_block.h:374
SHORT amli_degree
degree of the polynomial used by AMLI cycle
Definition: fasp_block.h:356
#define REAL
Definition: fasp.h:67
Vector with n entries of INT type.
Definition: fasp.h:356
dBSRmat A
pointer to the matrix at level level_num
Definition: fasp_block.h:207
ivector cfmark
pointer to the CF marker at level level_num
Definition: fasp_block.h:252
dCSRmat WelRes
well-reservoir block
Definition: fasp_block.h:181
REAL relaxation
relaxation parameter for SOR smoother
Definition: fasp_block.h:596
Block REAL matrix format for reservoir simulation.
Definition: fasp_block.h:172
dBSRmat P
prolongation operator at level level_num
Definition: fasp_block.h:213
struct block_Reservoir block_Reservoir
AMG_data * mgl_data
AMG data for presure-presure block.
Definition: fasp_block.h:425
SHORT print_level
print level in AMG preconditioner
Definition: fasp_block.h:428
dCSRmat * A_diag
Definition: fasp_block.h:509
SHORT coarse_solver
coarse solver type for AMG
Definition: fasp_block.h:350
INT nb
dimension of each sub-block
Definition: fasp_block.h:56
SHORT max_levels
max number of AMG levels
Definition: fasp_block.h:566
Mumps_data mumps
data for MUMPS
Definition: fasp_block.h:283
AMG_data ** mgl
Definition: fasp_block.h:520
Block REAL matrix format for reservoir simulation.
Definition: fasp_block.h:151
SHORT coarse_solver
coarse level solver type
Definition: fasp_block.h:593
Structure matrix of REAL type.
Definition: fasp.h:304
REAL * amli_coef
coefficients of the polynomial used by AMLI cycle
Definition: fasp_block.h:359
Block sparse row storage matrix of REAL type.
Definition: fasp_block.h:44
REAL tol
tolerance for convergence
Definition: fasp_block.h:467
ILU_data LU
ILU matrix for ILU smoother.
Definition: fasp_block.h:258
dCSRmat * Acsr
problem data in CSR format
Definition: fasp_block.h:413
dCSRmat * P_nk
Prolongation for near kernal.
Definition: fasp_block.h:385
REAL amg_tol
tolerance for AMG preconditioner
Definition: fasp_block.h:437
Vector with n entries of REAL type.
Definition: fasp.h:342
dSTRmat ResRes
reservoir-reservoir block
Definition: fasp_block.h:154
SHORT postsmooth_iter
number of postsmoothing
Definition: fasp_block.h:584
dvector w
temporary work space
Definition: fasp_block.h:280
INT near_kernel_dim
dimension of the near kernel for SAMG
Definition: fasp_block.h:261
struct block_dvector block_dvector
SHORT cycle_type
AMG cycle type.
Definition: fasp_block.h:329
SHORT presmooth_iter
number of presmoothing
Definition: fasp_block.h:581
INT max_levels
max number of AMG levels
Definition: fasp_block.h:323
SHORT print_level
print level in AMG preconditioner
Definition: fasp_block.h:317
#define INT
Definition: fasp.h:64
dBSRmat * A
Matrix data.
Definition: fasp_block.h:377
block_dCSRmat * Ai
Definition: fasp_block.h:653
Data for ILU setup.
Definition: fasp.h:400
AMG_data * pres_mgl_data
AMG preconditioner data for pressure block.
Definition: fasp_block.h:371
INT bcol
column number of blocks A, n
Definition: fasp_block.h:90
dCSRmat ResWel
reservoir-well block
Definition: fasp_block.h:157
SHORT presmooth_iter
number of presmoothing
Definition: fasp_block.h:446
Data passed to the preconditioner for reservoir simulation problems.
Definition: fasp_block.h:404
REAL amg_tol
tolerance for AMG preconditioner
Definition: fasp_block.h:569
struct block_dCSRmat block_dCSRmat
Parameters for MUMPS interface.
Definition: fasp.h:459
REAL * invS
inverse of the schur complement (-I - Awr*Arr^{-1}*Arw)^{-1}, Arr may be replaced by LU ...
Definition: fasp_block.h:626
block_Reservoir * A
problem data in block_Reservoir format
Definition: fasp_block.h:407
SHORT cycle_type
AMG cycle type.
Definition: fasp_block.h:572
Data for multigrid levels. (BSR format)
Definition: fasp_block.h:198
INT coarse_dof
coarset dof
Definition: fasp_block.h:590
SHORT coarse_scaling
switch of scaling of coarse grid correction
Definition: fasp_block.h:458
Parameters for Intel MKL PARDISO interface.
Definition: fasp.h:477
REAL * val
Definition: fasp_block.h:67
INT NNZ
number of nonzero sub-blocks in matrix A, NNZ
Definition: fasp_block.h:53
ILU_data PP_LU
ILU data for pressure block.
Definition: fasp_block.h:249
Data passed to the preconditioners.
Definition: fasp_block.h:311
Block REAL vector structure.
Definition: fasp_block.h:120
INT restart
number of iterations for restart
Definition: fasp_block.h:464
dvector * DPSinvDSS
Diag(PS) * inv(Diag(SS))
Definition: fasp_block.h:473
SHORT cycle_type
AMG cycle type.
Definition: fasp_block.h:440
Block INT vector structure.
Definition: fasp_block.h:136
dvector b
pointer to the right-hand side at level level_num
Definition: fasp_block.h:216
INT storage_manner
storage manner for each sub-block
Definition: fasp_block.h:59
Main header file for FASP.
dvector diaginv_SS
pointer to the diagonal inverse of the saturation block at level level_num
Definition: fasp_block.h:246
SHORT coarse_scaling
switch of scaling of the coarse grid correction
Definition: fasp_block.h:353
ILU_data * LUcsr
LU matrix for Reservoir-Reservoir block in CSR format.
Definition: fasp_block.h:422
Data passed to the preconditioner for preconditioning reservoir simulation problems.
Definition: fasp_block.h:531
INT maxit_AMG
max number of iterations of AMG preconditioner
Definition: fasp_block.h:431
SHORT smoother
AMG smoother type.
Definition: fasp_block.h:332
dCSRmat * P_nk
Prolongation for near kernal.
Definition: fasp_block.h:273
Data passed to diagnal preconditioner for dBSRmat matrices.
Definition: fasp_block.h:293
struct dBSRmat dBSRmat
struct block_ivector block_ivector
SHORT smoother
AMG smoother type.
Definition: fasp_block.h:443
INT brow
row number of blocks in A, m
Definition: fasp_block.h:123
Sparse matrix of REAL type in CSR format.
Definition: fasp.h:148
ivector ** blocks
blocks of dvector, point to blocks[brow]
Definition: fasp_block.h:142
INT brow
row number of blocks in A, m
Definition: fasp_block.h:139
INT brow
row number of blocks in A, m
Definition: fasp_block.h:87
AMG_data_bsr * mgl_data
AMG preconditioner data.
Definition: fasp_block.h:368
dvector diaginv
pointer to the diagonal inverse at level level_num
Definition: fasp_block.h:222
dCSRmat WelWel
well-well block
Definition: fasp_block.h:163
INT COL
number of cols of sub-blocks in matrix A, N
Definition: fasp_block.h:50
SHORT smooth_order
AMG smoothing order.
Definition: fasp_block.h:578
dCSRmat Ac
pointer to the matrix at level level_num (csr format)
Definition: fasp_block.h:225
dSTRmat * LU
LU matrix for Reservoir-Reservoir block in STR format.
Definition: fasp_block.h:419
dCSRmat * R_nk
Resriction for near kernal.
Definition: fasp_block.h:276
struct precond_block_reservoir_data precond_block_reservoir_data
Block REAL CSR matrix format.
Definition: fasp_block.h:84
#define SHORT
FASP integer and floating point numbers.
Definition: fasp.h:63
REAL * pw
pointer to the auxiliary vectors for pressure block
Definition: fasp_block.h:237
REAL * w
temporary work space for other usage
Definition: fasp_block.h:394
Data passed to the preconditioner for sweeping preconditioning.
Definition: fasp_block.h:648
INT ILU_levels
number of levels use ILU smoother
Definition: fasp_block.h:255
INT max_levels
max number of levels
Definition: fasp_block.h:201
SHORT coarsening_type
coarsening type
Definition: fasp_block.h:344
REAL tentative_smooth
relaxation parameter for smoothing the tentative prolongation
Definition: fasp_block.h:608
INT bcol
column number of blocks A, n
Definition: fasp_block.h:109
SHORT smoother
AMG smoother type.
Definition: fasp_block.h:575
dvector diag
diagnal elements
Definition: fasp_block.h:299
SHORT amli_degree
degree of the polynomial used by AMLI cycle
Definition: fasp_block.h:602
dvector r
temporary dvector used to store and restore the residual
Definition: fasp_block.h:391
block_dCSRmat * Abcsr
problem data in block_dCSRmat format
Definition: fasp_block.h:410
INT maxit
max number of iterations
Definition: fasp_block.h:461
INT num_levels
number of levels in use <= max_levels
Definition: fasp_block.h:204
Data for AMG solvers.
Definition: fasp.h:722
SHORT coarse_scaling
switch of scaling of coarse grid correction
Definition: fasp_block.h:599
REAL tentative_smooth
smooth factor for smoothing the tentative prolongation
Definition: fasp_block.h:362
SHORT nl_amli_krylov_type
type of krylov method used by Nonlinear AMLI cycle
Definition: fasp_block.h:365
struct block_BSR block_BSR
SHORT max_levels
max number of AMG levels
Definition: fasp_block.h:434
INT maxit
max number of iterations of AMG preconditioner
Definition: fasp_block.h:320
INT ROW
number of rows of sub-blocks in matrix A, M
Definition: fasp_block.h:47
REAL relaxation
relaxation parameter for SOR smoother
Definition: fasp_block.h:455
INT * JA
Definition: fasp_block.h:74
SHORT AMG_type
type of AMG method
Definition: fasp_block.h:314
REAL * invS
inverse of the Schur complement (-I - Awr*Arr^{-1}*Arw)^{-1}, Arr may be replaced by LU ...
Definition: fasp_block.h:470
SHORT presmooth_iter
number of presmoothing
Definition: fasp_block.h:338
REAL ** near_kernel_basis
basis of near kernel space for SAMG
Definition: fasp_block.h:264
AMG_param * amgparam
Definition: fasp_block.h:521
SHORT postsmooth_iter
number of postsmoothing
Definition: fasp_block.h:341
dCSRmat PP
pointer to the pressure block (only for reservoir simulation)
Definition: fasp_block.h:234
INT nb
dimension of each sub-block
Definition: fasp_block.h:296
block_dCSRmat * Abcsr
Definition: fasp_block.h:507
dCSRmat * R_nk
Resriction for near kernal.
Definition: fasp_block.h:388
dCSRmat * A_nk
Matrix data for near kernal.
Definition: fasp_block.h:270
dBSRmat SS
pointer to the saturation block (only for reservoir simulation)
Definition: fasp_block.h:240
REAL relaxation
relaxation parameter for SOR smoother
Definition: fasp_block.h:347
iCSRmat ** blocks
blocks of iCSRmat, point to blocks[brow][bcol]
Definition: fasp_block.h:112
SHORT scaled
Part 2: Data for CPR-like preconditioner for reservoir block.
Definition: fasp_block.h:542
block_BSR * A
Part 1: Basic data.
Definition: fasp_block.h:536
INT * IA
integer array of row pointers, the size is ROW+1
Definition: fasp_block.h:70
Data passed to the preconditioner for block preconditioning for block_dCSRmat format.
Definition: fasp_block.h:502
SHORT postsmooth_iter
number of postsmoothing
Definition: fasp_block.h:449
REAL * sw
pointer to the auxiliary vectors for saturation block
Definition: fasp_block.h:243
dCSRmat ResWel
reservoir-well block
Definition: fasp_block.h:178
Sparse matrix of INT type in CSR format.
Definition: fasp.h:178
dCSRmat WelRes
well-reservoir block
Definition: fasp_block.h:160
struct block_iCSRmat block_iCSRmat
SHORT coarsening_type
coarsening type
Definition: fasp_block.h:452
Data passed to diagonal preconditioner for dSTRmat matrices.
Definition: fasp.h:983
precond_diagstr * diag
Definition: fasp_block.h:484
Pardiso_data pdata
data for Intel MKL PARDISO
Definition: fasp_block.h:231
INT ILU_lfil
level of fill-in for structured ILU(k)
Definition: fasp_block.h:416
SHORT coarsening_type
coarsening type
Definition: fasp_block.h:587
void * Numeric
pointer to the numerical dactorization from UMFPACK
Definition: fasp_block.h:228