Fast Auxiliary Space Preconditioning  2.0.7 March/15/2018
fasp_block.h
Go to the documentation of this file.
1 
15 #include "fasp.h"
16 
17 #ifndef __FASPBLOCK_HEADER__ /*-- allow multiple inclusions --*/
18 #define __FASPBLOCK_HEADER__
20 /*---------------------------*/
21 /*--- Data structures ---*/
22 /*---------------------------*/
23 
34 typedef struct dBSRmat {
35 
38 
41 
44 
46  INT nb; // NOTE: for the moment, allow nb*nb full block
47 
49  INT storage_manner; // 0: row-major order, 1: column-major order
50 
58 
60  INT *IA;
61 
64  INT *JA;
65 
66 } dBSRmat;
74 typedef struct dBLCmat {
75 
78 
81 
84 
85 } dBLCmat;
93 typedef struct iBLCmat {
94 
97 
100 
103 
104 } iBLCmat;
110 typedef struct block_dvector {
111 
114 
117 
118 } block_dvector;
126 typedef struct block_ivector {
127 
130 
133 
134 } block_ivector;
136 /*---------------------------*/
137 /*--- Parameter structures --*/
138 /*---------------------------*/
139 
146 typedef struct {
147 
150 
153 
156 
159 
162 
165 
168 
171 
174 
176  void *Numeric;
177 
180 
183 
186 
189 
192 
195 
198 
201 
204 
207 
210 
213 
214  //-----------------------------------------
215  // extra near kernal space for extra solve
216 
219 
222 
225  //-----------------------------------------
226 
229 
232 
233 } AMG_data_bsr;
241 typedef struct {
242 
245 
248 
257 typedef struct {
258 
261 
264 
267 
270 
273 
276 
279 
282 
285 
288 
291 
294 
297 
300 
303 
306 
309 
312 
315 
318 
321 
324 
325  // extra near kernal space
326 
329 
332 
335 
338 
340  REAL *w;
341 
349 typedef struct {
350 
351  /*-------------------------------------*/
352  /* Basic data for block preconditioner */
353  /*-------------------------------------*/
360  /*------------------------------*/
361  /* Data for the diagonal blocks */
362  /*------------------------------*/
363 
364  /*--- solve by direct solver ---*/
365  void **LU_diag;
367  /*--- solve by AMG ---*/
383 typedef struct {
384 
391  void **local_LU;
395  // temprary work spaces
397  REAL *w;
401 #endif /* end if for __FASPBLOCK_HEADER__ */
402 
403 /*---------------------------------*/
404 /*-- End of File --*/
405 /*---------------------------------*/
dBSRmat R
restriction operator at level level_num
Definition: fasp_block.h:158
dCSRmat * A_nk
Matrix data for near kernal.
Definition: fasp_block.h:328
dvector x
pointer to the iterative solution at level level_num
Definition: fasp_block.h:167
Parameters for AMG methods.
Definition: fasp.h:440
dvector ** blocks
blocks of dvector, point to blocks[brow]
Definition: fasp_block.h:116
SHORT smooth_order
AMG smoother ordering.
Definition: fasp_block.h:281
REAL tol
tolerance for AMG preconditioner
Definition: fasp_block.h:272
ILU_data * LU
ILU preconditioner data (needed for CPR type preconditioner)
Definition: fasp_block.h:320
SHORT amli_degree
degree of the polynomial used by AMLI cycle
Definition: fasp_block.h:302
#define REAL
Definition: fasp.h:66
Data for diagnal preconditioners in dBSRmat format.
Definition: fasp_block.h:241
Vector with n entries of INT type.
Definition: fasp.h:355
INT bcol
column number of blocks A, n
Definition: fasp_block.h:80
dBSRmat A
pointer to the matrix at level level_num
Definition: fasp_block.h:155
ivector cfmark
pointer to the CF marker at level level_num
Definition: fasp_block.h:200
dBSRmat P
prolongation operator at level level_num
Definition: fasp_block.h:161
dCSRmat * A_diag
Definition: fasp_block.h:356
SHORT coarse_solver
coarse solver type for AMG
Definition: fasp_block.h:296
INT nb
dimension of each sub-block
Definition: fasp_block.h:46
Mumps_data mumps
data for MUMPS
Definition: fasp_block.h:231
AMG_data ** mgl
Definition: fasp_block.h:368
REAL * amli_coef
coefficients of the polynomial used by AMLI cycle
Definition: fasp_block.h:305
Block sparse row storage matrix of REAL type.
Definition: fasp_block.h:34
ILU_data LU
ILU matrix for ILU smoother.
Definition: fasp_block.h:206
dCSRmat * P_nk
Prolongation for near kernal.
Definition: fasp_block.h:331
Vector with n entries of REAL type.
Definition: fasp.h:341
dvector w
temporary work space
Definition: fasp_block.h:228
Block INT CSR matrix format.
Definition: fasp_block.h:93
INT near_kernel_dim
dimension of the near kernel for SAMG
Definition: fasp_block.h:209
struct block_dvector block_dvector
SHORT cycle_type
AMG cycle type.
Definition: fasp_block.h:275
INT max_levels
max number of AMG levels
Definition: fasp_block.h:269
SHORT print_level
print level in AMG preconditioner
Definition: fasp_block.h:263
#define INT
Definition: fasp.h:63
dBSRmat * A
Matrix data.
Definition: fasp_block.h:323
Data for ILU setup.
Definition: fasp.h:630
AMG_data * pres_mgl_data
AMG preconditioner data for pressure block.
Definition: fasp_block.h:317
INT brow
row number of blocks in A, m
Definition: fasp_block.h:77
Data for MUMPS interface.
Definition: fasp.h:586
Data for multigrid levels in dBSRmat format.
Definition: fasp_block.h:146
Data for Intel MKL PARDISO interface.
Definition: fasp.h:604
REAL * val
Definition: fasp_block.h:57
INT NNZ
number of nonzero sub-blocks in matrix A, NNZ
Definition: fasp_block.h:43
ILU_data PP_LU
ILU data for pressure block.
Definition: fasp_block.h:197
Data for preconditioners in dBSRmat format.
Definition: fasp_block.h:257
Block REAL vector structure.
Definition: fasp_block.h:110
Block INT vector structure.
Definition: fasp_block.h:126
dvector b
pointer to the right-hand side at level level_num
Definition: fasp_block.h:164
INT storage_manner
storage manner for each sub-block
Definition: fasp_block.h:49
Main header file for the FASP project.
dvector diaginv_SS
pointer to the diagonal inverse of the saturation block at level level_num
Definition: fasp_block.h:194
SHORT coarse_scaling
switch of scaling of the coarse grid correction
Definition: fasp_block.h:299
dCSRmat ** blocks
blocks of dCSRmat, point to blocks[brow][bcol]
Definition: fasp_block.h:83
INT bcol
column number of blocks A, n
Definition: fasp_block.h:99
SHORT smoother
AMG smoother type.
Definition: fasp_block.h:278
dCSRmat * P_nk
Prolongation for near kernal.
Definition: fasp_block.h:221
struct dBSRmat dBSRmat
struct block_ivector block_ivector
struct dBLCmat dBLCmat
INT brow
row number of blocks in A, m
Definition: fasp_block.h:113
Sparse matrix of REAL type in CSR format.
Definition: fasp.h:147
ivector ** blocks
blocks of dvector, point to blocks[brow]
Definition: fasp_block.h:132
INT brow
row number of blocks in A, m
Definition: fasp_block.h:129
AMG_data_bsr * mgl_data
AMG preconditioner data.
Definition: fasp_block.h:314
dvector diaginv
pointer to the diagonal inverse at level level_num
Definition: fasp_block.h:170
struct iBLCmat iBLCmat
INT COL
number of cols of sub-blocks in matrix A, N
Definition: fasp_block.h:40
dCSRmat Ac
pointer to the matrix at level level_num (csr format)
Definition: fasp_block.h:173
dCSRmat * R_nk
Resriction for near kernal.
Definition: fasp_block.h:224
#define SHORT
FASP integer and floating point numbers.
Definition: fasp.h:62
REAL * pw
pointer to the auxiliary vectors for pressure block
Definition: fasp_block.h:185
REAL * w
temporary work space for other usage
Definition: fasp_block.h:340
Data for sweeping preconditioner.
Definition: fasp_block.h:383
INT ILU_levels
number of levels use ILU smoother
Definition: fasp_block.h:203
INT max_levels
max number of levels
Definition: fasp_block.h:149
SHORT coarsening_type
coarsening type
Definition: fasp_block.h:290
iCSRmat ** blocks
blocks of iCSRmat, point to blocks[brow][bcol]
Definition: fasp_block.h:102
INT brow
row number of blocks in A, m
Definition: fasp_block.h:96
dvector r
temporary dvector used to store and restore the residual
Definition: fasp_block.h:337
INT num_levels
number of levels in use <= max_levels
Definition: fasp_block.h:152
Data for AMG methods.
Definition: fasp.h:783
REAL tentative_smooth
smooth factor for smoothing the tentative prolongation
Definition: fasp_block.h:308
SHORT nl_amli_krylov_type
type of krylov method used by Nonlinear AMLI cycle
Definition: fasp_block.h:311
INT maxit
max number of iterations of AMG preconditioner
Definition: fasp_block.h:266
INT ROW
number of rows of sub-blocks in matrix A, M
Definition: fasp_block.h:37
INT * JA
Definition: fasp_block.h:64
dvector diag
diagnal elements
Definition: fasp_block.h:247
SHORT AMG_type
type of AMG method
Definition: fasp_block.h:260
SHORT presmooth_iter
number of presmoothing
Definition: fasp_block.h:284
REAL ** near_kernel_basis
basis of near kernel space for SAMG
Definition: fasp_block.h:212
AMG_param * amgparam
Definition: fasp_block.h:370
SHORT postsmooth_iter
number of postsmoothing
Definition: fasp_block.h:287
dCSRmat PP
pointer to the pressure block (only for reservoir simulation)
Definition: fasp_block.h:182
dCSRmat * R_nk
Resriction for near kernal.
Definition: fasp_block.h:334
dCSRmat * A_nk
Matrix data for near kernal.
Definition: fasp_block.h:218
dBSRmat SS
pointer to the saturation block (only for reservoir simulation)
Definition: fasp_block.h:188
REAL relaxation
relaxation parameter for SOR smoother
Definition: fasp_block.h:293
INT * IA
integer array of row pointers, the size is ROW+1
Definition: fasp_block.h:60
Data for block preconditioners in dBLCmat format.
Definition: fasp_block.h:349
REAL * sw
pointer to the auxiliary vectors for saturation block
Definition: fasp_block.h:191
Block REAL CSR matrix format.
Definition: fasp_block.h:74
Sparse matrix of INT type in CSR format.
Definition: fasp.h:177
INT nb
dimension of each sub-block
Definition: fasp_block.h:244
Pardiso_data pdata
data for Intel MKL PARDISO
Definition: fasp_block.h:179
void * Numeric
pointer to the numerical dactorization from UMFPACK
Definition: fasp_block.h:176