Fast Auxiliary Space Preconditioning 2.7.7 Aug/28/2022
PreAMGSetupUA.c
Go to the documentation of this file.
1
22#include <math.h>
23#include <time.h>
24
25#include "fasp.h"
26#include "fasp_functs.h"
27
28/*---------------------------------*/
29/*-- Declare Private Functions --*/
30/*---------------------------------*/
31
32#include "PreAMGAggregation.inl"
33#include "PreAMGAggregationCSR.inl"
34#include "PreAMGAggregationUA.inl"
35
36static SHORT amg_setup_unsmoothP_unsmoothR(AMG_data *, AMG_param *);
37
38/*---------------------------------*/
39/*-- Public Functions --*/
40/*---------------------------------*/
41
56 AMG_param *param)
57{
58 const SHORT prtlvl = param->print_level;
59
60 // Output some info for debuging
61 if ( prtlvl > PRINT_NONE ) printf("\nSetting up UA AMG ...\n");
62
63#if DEBUG_MODE > 0
64 printf("### DEBUG: [-Begin-] %s ...\n", __FUNCTION__);
65 printf("### DEBUG: nr=%d, nc=%d, nnz=%d\n",
66 mgl[0].A.row, mgl[0].A.col, mgl[0].A.nnz);
67#endif
68
69 SHORT status = amg_setup_unsmoothP_unsmoothR(mgl, param);
70
71#if DEBUG_MODE > 0
72 printf("### DEBUG: [--End--] %s ...\n", __FUNCTION__);
73#endif
74
75 return status;
76}
77
78/*---------------------------------*/
79/*-- Private Functions --*/
80/*---------------------------------*/
81
101static SHORT amg_setup_unsmoothP_unsmoothR(AMG_data *mgl,
102 AMG_param *param) {
103 const SHORT prtlvl = param->print_level;
104 const SHORT cycle_type = param->cycle_type;
105 const SHORT csolver = param->coarse_solver;
106 const SHORT min_cdof = MAX(param->coarse_dof, 50);
107 const INT m = mgl[0].A.row;
108
109 // empiric value
110 const REAL cplxmax = 3.0;
111 const REAL xsi = 0.6;
112 INT icum = 1;
113 REAL eta, fracratio;
114
115 // local variables
116 SHORT max_levels = param->max_levels, lvl = 0, status = FASP_SUCCESS;
117 INT i;
118 REAL setup_start, setup_end;
119 ILU_param iluparam;
120 SWZ_param swzparam;
121
122#if DEBUG_MODE > 0
123 printf("### DEBUG: [-Begin-] %s ...\n", __FUNCTION__);
124 printf("### DEBUG: nr=%d, nc=%d, nnz=%d\n",
125 mgl[0].A.row, mgl[0].A.col, mgl[0].A.nnz);
126#endif
127
128 fasp_gettime(&setup_start);
129
130 // level info (fine: 0; coarse: 1)
131 ivector *vertices = (ivector *) fasp_mem_calloc(max_levels, sizeof(ivector));
132
133 // each level stores the information of the number of aggregations
134 INT *num_aggs = (INT *) fasp_mem_calloc(max_levels, sizeof(INT));
135
136 // each level stores the information of the strongly coupled neighborhoods
137 dCSRmat *Neighbor = (dCSRmat *) fasp_mem_calloc(max_levels, sizeof(dCSRmat));
138
139 // Initialize level information
140 for ( i = 0; i < max_levels; ++i ) num_aggs[i] = 0;
141
142 mgl[0].near_kernel_dim = 1;
143 mgl[0].near_kernel_basis = (REAL **) fasp_mem_calloc(mgl->near_kernel_dim, sizeof(REAL * ));
144
145 for ( i = 0; i < mgl->near_kernel_dim; ++i ) {
146 mgl[0].near_kernel_basis[i] = (REAL *) fasp_mem_calloc(m, sizeof(REAL));
147 fasp_darray_set(m, mgl[0].near_kernel_basis[i], 1.0);
148 }
149
150 // Initialize ILU parameters
151 mgl->ILU_levels = param->ILU_levels;
152 if ( param->ILU_levels > 0 ) {
153 iluparam.print_level = param->print_level;
154 iluparam.ILU_lfil = param->ILU_lfil;
155 iluparam.ILU_droptol = param->ILU_droptol;
156 iluparam.ILU_relax = param->ILU_relax;
157 iluparam.ILU_type = param->ILU_type;
158 }
159
160 // Initialize Schwarz parameters
161 mgl->SWZ_levels = param->SWZ_levels;
162 if ( param->SWZ_levels > 0 ) {
163 swzparam.SWZ_mmsize = param->SWZ_mmsize;
164 swzparam.SWZ_maxlvl = param->SWZ_maxlvl;
165 swzparam.SWZ_type = param->SWZ_type;
166 swzparam.SWZ_blksolver = param->SWZ_blksolver;
167 }
168
169 // Initialize AMLI coefficients
170 if ( cycle_type == AMLI_CYCLE ) {
171 const INT amlideg = param->amli_degree;
172 param->amli_coef = (REAL *) fasp_mem_calloc(amlideg + 1, sizeof(REAL));
173 REAL lambda_max = 2.0, lambda_min = lambda_max / 4;
174 fasp_amg_amli_coef(lambda_max, lambda_min, amlideg, param->amli_coef);
175 }
176
177#if DIAGONAL_PREF
178 fasp_dcsr_diagpref(&mgl[0].A); // reorder each row to make diagonal appear first
179#endif
180
181 /*----------------------------*/
182 /*--- checking aggregation ---*/
183 /*----------------------------*/
184
185 // Pairwise matching algorithm requires diagonal preference ordering
186 if ( param->aggregation_type == PAIRWISE ) {
187 param->pair_number = MIN(param->pair_number, max_levels);
188 fasp_dcsr_diagpref(&mgl[0].A);
189 }
190
191 // Main AMG setup loop
192 while ((mgl[lvl].A.row > min_cdof) && (lvl < max_levels - 1)) {
193
194#if DEBUG_MODE > 1
195 printf("### DEBUG: level = %d, row = %d, nnz = %d\n",
196 lvl, mgl[lvl].A.row, mgl[lvl].A.nnz);
197#endif
198
199 /*-- Setup ILU decomposition if necessary */
200 if ( lvl < param->ILU_levels ) {
201 status = fasp_ilu_dcsr_setup(&mgl[lvl].A, &mgl[lvl].LU, &iluparam);
202 if ( status < 0 ) {
203 if ( prtlvl > PRINT_MIN ) {
204 printf("### WARNING: ILU setup on level-%d failed!\n", lvl);
205 printf("### WARNING: Disable ILU for level >= %d.\n", lvl);
206 }
207 param->ILU_levels = lvl;
208 }
209 }
210
211 /*-- Setup Schwarz smoother if necessary */
212 if ( lvl < param->SWZ_levels ) {
213 mgl[lvl].Schwarz.A = fasp_dcsr_sympart(&mgl[lvl].A);
214 fasp_dcsr_shift(&(mgl[lvl].Schwarz.A), 1);
215 status = fasp_swz_dcsr_setup(&mgl[lvl].Schwarz, &swzparam);
216 if ( status < 0 ) {
217 if ( prtlvl > PRINT_MIN ) {
218 printf("### WARNING: Schwarz on level-%d failed!\n", lvl);
219 printf("### WARNING: Disable Schwarz for level >= %d.\n", lvl);
220 }
221 param->SWZ_levels = lvl;
222 }
223 }
224
225 /*-- Aggregation --*/
226 switch ( param->aggregation_type ) {
227
228 case VMB: // VMB aggregation
229 status = aggregation_vmb(&mgl[lvl].A, &vertices[lvl], param, lvl + 1,
230 &Neighbor[lvl], &num_aggs[lvl]);
231
232 /*-- Choose strength threshold adaptively --*/
233 if ( num_aggs[lvl] * 4.0 > mgl[lvl].A.row )
234 param->strong_coupled /= 2.0;
235 else if ( num_aggs[lvl] * 1.25 < mgl[lvl].A.row )
236 param->strong_coupled *= 2.0;
237
238 break;
239
240 case NPAIR: // non-symmetric pairwise matching aggregation
241 status = aggregation_nsympair(mgl, param, lvl, vertices, &num_aggs[lvl]);
242 /*-- Modified by Chunsheng Feng on 10/17/2020, ZCS on 01/15/2021:
243 if NPAIR fail, switch aggregation type to VBM. --*/
244 if ( status != FASP_SUCCESS || num_aggs[lvl] * 2.0 > mgl[lvl].A.row ) {
245 if ( prtlvl > PRINT_MORE ) {
246 printf("### WARNING: Non-symmetric pairwise matching failed on level %d!\n", lvl);
247 printf("### WARNING: Switch to VMB aggregation on level %d!\n", lvl);
248 }
249 param->aggregation_type = VMB;
250 status = aggregation_vmb(&mgl[lvl].A, &vertices[lvl], param, lvl + 1,
251 &Neighbor[lvl], &num_aggs[lvl]);
252 }
253
254 break;
255
256 default: // symmetric pairwise matching aggregation
257 status = aggregation_symmpair(mgl, param, lvl, vertices, &num_aggs[lvl]);
258
259 }
260
261 // Check 1: Did coarsening step succeed?
262 if ( status < 0 ) {
263 // When error happens, stop at the current multigrid level!
264 if ( prtlvl > PRINT_MIN ) {
265 printf("### WARNING: Stop coarsening on level %d!\n", lvl);
266 }
267 status = FASP_SUCCESS;
268 fasp_ivec_free(&vertices[lvl]);
269 fasp_dcsr_free(&Neighbor[lvl]);
270 break;
271 }
272
273 /*-- Form Prolongation --*/
274 form_tentative_p(&vertices[lvl], &mgl[lvl].P, mgl[0].near_kernel_basis,
275 num_aggs[lvl]);
276
277 // Check 2: Is coarse sparse too small?
278 if ( mgl[lvl].P.col < MIN_CDOF ) {
279 fasp_ivec_free(&vertices[lvl]);
280 fasp_dcsr_free(&Neighbor[lvl]);
281 break;
282 }
283
284 // Check 3: Does this coarsening step too aggressive?
285 if ( mgl[lvl].P.row > mgl[lvl].P.col * MAX_CRATE ) {
286 if ( prtlvl > PRINT_MIN ) {
287 printf("### WARNING: Coarsening might be too aggressive!\n");
288 printf("### WARNING: Fine level = %d, coarse level = %d. Discard!\n",
289 mgl[lvl].P.row, mgl[lvl].P.col);
290 }
291 fasp_ivec_free(&vertices[lvl]);
292 fasp_dcsr_free(&Neighbor[lvl]);
293 break;
294 }
295
296 /*-- Form restriction --*/
297 fasp_dcsr_trans(&mgl[lvl].P, &mgl[lvl].R);
298
299 /*-- Form coarse level stiffness matrix --*/
300 fasp_blas_dcsr_rap_agg(&mgl[lvl].R, &mgl[lvl].A, &mgl[lvl].P,
301 &mgl[lvl + 1].A);
302
303 fasp_dcsr_free(&Neighbor[lvl]);
304 fasp_ivec_free(&vertices[lvl]);
305
306 ++lvl;
307
308#if DIAGONAL_PREF
309 fasp_dcsr_diagpref(&mgl[lvl].A); // reorder each row to make diagonal appear first
310#endif
311
312 // Check 4: Is this coarsening ratio too small?
313 if ((REAL) mgl[lvl].P.col > mgl[lvl].P.row * MIN_CRATE ) {
314 param->quality_bound *= 2.0;
315 }
316
317 } // end of the main while loop
318
319 // Setup coarse level systems for direct solvers
320 switch ( csolver ) {
321
322#if WITH_MUMPS
323 case SOLVER_MUMPS: {
324 // Setup MUMPS direct solver on the coarsest level
325 mgl[lvl].mumps.job = 1;
326 fasp_solver_mumps_steps(&mgl[lvl].A, &mgl[lvl].b, &mgl[lvl].x, &mgl[lvl].mumps);
327 break;
328 }
329#endif
330
331#if WITH_UMFPACK
332 case SOLVER_UMFPACK: {
333 // Need to sort the matrix A for UMFPACK to work
334 dCSRmat Ac_tran;
335 Ac_tran = fasp_dcsr_create(mgl[lvl].A.row, mgl[lvl].A.col, mgl[lvl].A.nnz);
336 fasp_dcsr_transz(&mgl[lvl].A, NULL, &Ac_tran);
337 // It is equivalent to do transpose and then sort
338 // fasp_dcsr_trans(&mgl[lvl].A, &Ac_tran);
339 // fasp_dcsr_sort(&Ac_tran);
340 fasp_dcsr_cp(&Ac_tran, &mgl[lvl].A);
341 fasp_dcsr_free(&Ac_tran);
342 mgl[lvl].Numeric = fasp_umfpack_factorize(&mgl[lvl].A, 0);
343 break;
344 }
345#endif
346
347#if WITH_PARDISO
348 case SOLVER_PARDISO: {
349 fasp_dcsr_sort(&mgl[lvl].A);
350 fasp_pardiso_factorize(&mgl[lvl].A, &mgl[lvl].pdata, prtlvl);
351 break;
352 }
353#endif
354
355 default: // Do nothing!
356 break;
357 }
358
359 // setup total level number and current level
360 mgl[0].num_levels = max_levels = lvl + 1;
361 mgl[0].w = fasp_dvec_create(m);
362
363 for ( lvl = 1; lvl < max_levels; ++lvl ) {
364 INT mm = mgl[lvl].A.row;
365 mgl[lvl].num_levels = max_levels;
366 mgl[lvl].b = fasp_dvec_create(mm);
367 mgl[lvl].x = fasp_dvec_create(mm);
368
369 mgl[lvl].cycle_type = cycle_type; // initialize cycle type!
370 mgl[lvl].ILU_levels = param->ILU_levels - lvl; // initialize ILU levels!
371 mgl[lvl].SWZ_levels = param->SWZ_levels - lvl; // initialize Schwarz!
372
373 if ( cycle_type == NL_AMLI_CYCLE )
374 mgl[lvl].w = fasp_dvec_create(3 * mm);
375 else
376 mgl[lvl].w = fasp_dvec_create(2 * mm);
377 }
378
379 // setup for cycle type of unsmoothed aggregation
380 eta = xsi / ((1 - xsi) * (cplxmax - 1));
381 mgl[0].cycle_type = 1;
382 mgl[max_levels - 1].cycle_type = 0;
383
384 for ( lvl = 1; lvl < max_levels - 1; ++lvl ) {
385 fracratio = (REAL) mgl[lvl].A.nnz / mgl[0].A.nnz;
386 mgl[lvl].cycle_type = (INT)(pow((REAL) xsi, (REAL) lvl) / (eta * fracratio * icum));
387 // safe-guard step: make cycle type >= 1 and <= 2
388 mgl[lvl].cycle_type = MAX(1, MIN(2, mgl[lvl].cycle_type));
389 icum = icum * mgl[lvl].cycle_type;
390 }
391
392#if MULTI_COLOR_ORDER
393 INT Colors,rowmax;
394#ifdef _OPENMP
395 int threads = fasp_get_num_threads();
396 if (threads > max_levels-1 ) threads = max_levels-1;
397#pragma omp parallel for private(lvl,rowmax,Colors) schedule(static, 1) num_threads(threads)
398#endif
399 for (lvl=0; lvl<max_levels-1; lvl++){
400
401#if 1
402 dCSRmat_Multicoloring(&mgl[lvl].A, &rowmax, &Colors);
403#else
404 dCSRmat_Multicoloring_Theta(&mgl[lvl].A, mgl[lvl].GS_Theta, &rowmax, &Colors);
405#endif
406 if ( prtlvl > 1 )
407 printf("mgl[%3d].A.row = %12d, rowmax = %5d, rowavg = %7.2lf, colors = %5d, Theta = %le.\n",
408 lvl, mgl[lvl].A.row, rowmax, (double)mgl[lvl].A.nnz/mgl[lvl].A.row,
409 mgl[lvl].A.color, mgl[lvl].GS_Theta);
410 }
411#endif
412
413 if ( prtlvl > PRINT_NONE ) {
414 fasp_gettime(&setup_end);
415 fasp_amgcomplexity(mgl, prtlvl);
416 fasp_cputime("Unsmoothed aggregation setup", setup_end - setup_start);
417 }
418
419 fasp_mem_free(Neighbor);
420 Neighbor = NULL;
421 fasp_mem_free(vertices);
422 vertices = NULL;
423 fasp_mem_free(num_aggs);
424 num_aggs = NULL;
425
426#if DEBUG_MODE > 0
427 printf("### DEBUG: [--End--] %s ...\n", __FUNCTION__);
428#endif
429
430 return status;
431}
432
433/*---------------------------------*/
434/*-- End of File --*/
435/*---------------------------------*/
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_mem_free(void *mem)
Free up previous allocated memory body and set pointer to NULL.
Definition: AuxMemory.c:155
void * fasp_mem_calloc(const unsigned int size, const unsigned int type)
Allocate, initiate, and check memory.
Definition: AuxMemory.c:65
void fasp_cputime(const char *message, const REAL cputime)
Print CPU walltime.
Definition: AuxMessage.c:179
void fasp_amgcomplexity(const AMG_data *mgl, const SHORT prtlvl)
Print level and complexity information of AMG.
Definition: AuxMessage.c:84
void fasp_gettime(REAL *time)
Get system time.
Definition: AuxTiming.c:36
void fasp_ivec_free(ivector *u)
Free vector data space of INT type.
Definition: AuxVector.c:164
dvector fasp_dvec_create(const INT m)
Create dvector data space of REAL type.
Definition: AuxVector.c:62
SHORT fasp_ilu_dcsr_setup(dCSRmat *A, ILU_data *iludata, ILU_param *iluparam)
Get ILU decomposition of a CSR matrix A.
INT fasp_swz_dcsr_setup(SWZ_data *swzdata, SWZ_param *swzparam)
Setup phase for the Schwarz methods.
void fasp_dcsr_diagpref(dCSRmat *A)
Re-order the column and data arrays of a CSR matrix, so that the first entry in each row is the diago...
Definition: BlaSparseCSR.c:680
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_shift(dCSRmat *A, const INT offset)
Re-index a REAL matrix in CSR format to make the index starting from 0 or 1.
void dCSRmat_Multicoloring_Theta(dCSRmat *A, REAL theta, INT *rowmax, INT *groups)
Use the greedy multicoloring algorithm to get color groups for for the adjacency graph of A.
void fasp_dcsr_free(dCSRmat *A)
Free CSR sparse matrix data memory space.
Definition: BlaSparseCSR.c:184
void fasp_dcsr_transz(dCSRmat *A, INT *p, dCSRmat *AT)
Generalized transpose of A: (n x m) matrix given in dCSRmat format.
void fasp_dcsr_sort(dCSRmat *A)
Sort each row of A in ascending order w.r.t. column indices.
Definition: BlaSparseCSR.c:385
void dCSRmat_Multicoloring(dCSRmat *A, INT *rowmax, INT *groups)
Use the greedy multicoloring algorithm to get color groups for for the adjacency graph of A.
void fasp_dcsr_cp(const dCSRmat *A, dCSRmat *B)
copy a dCSRmat to a new one B=A
Definition: BlaSparseCSR.c:851
dCSRmat fasp_dcsr_sympart(dCSRmat *A)
Get symmetric part of a dCSRmat matrix.
INT fasp_dcsr_trans(const dCSRmat *A, dCSRmat *AT)
Find transpose of dCSRmat matrix A.
Definition: BlaSparseCSR.c:952
void fasp_blas_dcsr_rap_agg(const dCSRmat *R, const dCSRmat *A, const dCSRmat *P, dCSRmat *RAP)
Triple sparse matrix multiplication B=R*A*P (nonzeros of R, P = 1)
Definition: BlaSpmvCSR.c:1269
SHORT fasp_amg_setup_ua(AMG_data *mgl, AMG_param *param)
Set up phase of unsmoothed aggregation AMG.
Definition: PreAMGSetupUA.c:55
void fasp_amg_amli_coef(const REAL lambda_max, const REAL lambda_min, const INT degree, REAL *coef)
Compute the coefficients of the polynomial used by AMLI-cycle.
int fasp_solver_mumps_steps(dCSRmat *ptrA, dvector *b, dvector *u, Mumps_data *mumps)
Solve Ax=b by MUMPS in three steps.
Definition: XtrMumps.c:188
Main header file for the FASP project.
#define MIN(a, b)
Definition: fasp.h:75
#define REAL
Definition: fasp.h:67
#define SHORT
FASP integer and floating point numbers.
Definition: fasp.h:63
#define MAX(a, b)
Definition of max, min, abs.
Definition: fasp.h:74
#define INT
Definition: fasp.h:64
#define AMLI_CYCLE
Definition: fasp_const.h:179
#define SOLVER_PARDISO
Definition: fasp_const.h:126
#define NL_AMLI_CYCLE
Definition: fasp_const.h:180
#define FASP_SUCCESS
Definition of return status and error messages.
Definition: fasp_const.h:19
#define NPAIR
Definition: fasp_const.h:171
#define MAX_CRATE
Definition: fasp_const.h:255
#define SOLVER_MUMPS
Definition: fasp_const.h:125
#define PAIRWISE
Definition of aggregation types.
Definition: fasp_const.h:169
#define SOLVER_UMFPACK
Definition: fasp_const.h:124
#define VMB
Definition: fasp_const.h:170
#define MIN_CRATE
Definition: fasp_const.h:254
#define PRINT_MORE
Definition: fasp_const.h:76
#define PRINT_NONE
Print level for all subroutines – not including DEBUG output.
Definition: fasp_const.h:73
#define MIN_CDOF
Definition: fasp_const.h:253
#define PRINT_MIN
Definition: fasp_const.h:74
Data for AMG methods.
Definition: fasp.h:790
INT near_kernel_dim
dimension of the near kernel for SAMG
Definition: fasp.h:835
dCSRmat A
pointer to the matrix at level level_num
Definition: fasp.h:803
INT cycle_type
cycle type
Definition: fasp.h:855
Mumps_data mumps
data for MUMPS
Definition: fasp.h:852
SWZ_data Schwarz
data of Schwarz smoother
Definition: fasp.h:846
dvector b
pointer to the right-hand side at level level_num
Definition: fasp.h:812
REAL ** near_kernel_basis
basis of near kernel space for SAMG
Definition: fasp.h:838
void * Numeric
pointer to the numerical factorization from UMFPACK
Definition: fasp.h:820
INT ILU_levels
number of levels use ILU smoother
Definition: fasp.h:829
INT SWZ_levels
number of levels use Schwarz smoother
Definition: fasp.h:843
dvector x
pointer to the iterative solution at level level_num
Definition: fasp.h:815
SHORT num_levels
number of levels in use <= max_levels
Definition: fasp.h:798
dvector w
temporary work space
Definition: fasp.h:849
Parameters for AMG methods.
Definition: fasp.h:447
INT ILU_lfil
level of fill-in for ILUs and ILUk
Definition: fasp.h:555
REAL ILU_relax
relaxation for ILUs
Definition: fasp.h:561
INT SWZ_mmsize
maximal block size
Definition: fasp.h:570
SHORT print_level
print level for AMG
Definition: fasp.h:453
INT SWZ_maxlvl
maximal levels
Definition: fasp.h:573
SHORT aggregation_type
aggregation type
Definition: fasp.h:510
REAL * amli_coef
coefficients of the polynomial used by AMLI cycle
Definition: fasp.h:501
SHORT ILU_levels
number of levels use ILU smoother
Definition: fasp.h:549
SHORT coarse_solver
coarse solver type
Definition: fasp.h:492
REAL strong_coupled
strong coupled threshold for aggregate
Definition: fasp.h:534
SHORT cycle_type
type of AMG cycle
Definition: fasp.h:468
SHORT amli_degree
degree of the polynomial used by AMLI cycle
Definition: fasp.h:498
SHORT ILU_type
ILU type for smoothing.
Definition: fasp.h:552
INT SWZ_blksolver
type of Schwarz block solver
Definition: fasp.h:579
INT SWZ_type
type of Schwarz method
Definition: fasp.h:576
REAL quality_bound
quality threshold for pairwise aggregation
Definition: fasp.h:471
INT coarse_dof
max number of coarsest level DOF
Definition: fasp.h:465
REAL ILU_droptol
drop tolerance for ILUt
Definition: fasp.h:558
INT SWZ_levels
number of levels use Schwarz smoother
Definition: fasp.h:567
INT pair_number
number of pairwise matchings
Definition: fasp.h:531
SHORT max_levels
max number of levels of AMG
Definition: fasp.h:462
Parameters for ILU.
Definition: fasp.h:396
INT ILU_lfil
level of fill-in for ILUk
Definition: fasp.h:405
REAL ILU_relax
add the sum of dropped elements to diagonal element in proportion relax
Definition: fasp.h:411
SHORT print_level
print level
Definition: fasp.h:399
SHORT ILU_type
ILU type for decomposition.
Definition: fasp.h:402
REAL ILU_droptol
drop tolerance for ILUt
Definition: fasp.h:408
INT job
work for MUMPS
Definition: fasp.h:601
dCSRmat A
pointer to the original coefficient matrix
Definition: fasp.h:717
Parameters for Schwarz method.
Definition: fasp.h:422
INT SWZ_mmsize
maximal size of blocks
Definition: fasp.h:434
INT SWZ_maxlvl
maximal level for constructing the blocks
Definition: fasp.h:431
INT SWZ_blksolver
type of Schwarz block solver
Definition: fasp.h:437
SHORT SWZ_type
type for Schwarz method
Definition: fasp.h:428
Sparse matrix of REAL type in CSR format.
Definition: fasp.h:143
INT col
column of matrix A, n
Definition: fasp.h:149
INT row
row number of matrix A, m
Definition: fasp.h:146
INT nnz
number of nonzero entries
Definition: fasp.h:152
Vector with n entries of INT type.
Definition: fasp.h:361