Fast Auxiliary Space Preconditioning 2.7.7 Aug/28/2022
Loading...
Searching...
No Matches
AuxParam.c
Go to the documentation of this file.
1
14#include <stdio.h>
15
16#include "fasp.h"
17#include "fasp_functs.h"
18
19#if DEBUG_MODE > 1
20unsigned long total_alloc_mem;
21unsigned long total_alloc_count;
22#endif
23
24/*---------------------------------*/
25/*-- Public Functions --*/
26/*---------------------------------*/
27
41void fasp_param_set(const int argc, const char* argv[], input_param* iniparam)
42{
43 int arg_index = 1;
44 int print_usage = FALSE;
45 SHORT status = FASP_SUCCESS;
46
47 // Option 1. set default input parameters
48 fasp_param_input_init(iniparam);
49
50 while (arg_index < argc) {
51
52 if (strcmp(argv[arg_index], "-help") == 0) {
53 print_usage = TRUE;
54 break;
55 }
56
57 // Option 2. Get parameters from an ini file
58 else if (strcmp(argv[arg_index], "-ini") == 0) {
59 arg_index++;
60 if (arg_index >= argc) {
61 printf("### ERROR: Missing ini filename! [%s]\n", __FUNCTION__);
62 print_usage = TRUE;
63 break;
64 }
65 strcpy(iniparam->inifile, argv[arg_index]);
66 fasp_param_input(iniparam->inifile, iniparam);
67 if (++arg_index >= argc) break;
68 }
69
70 // Option 3. Get parameters from command line input
71 else if (strcmp(argv[arg_index], "-print") == 0) {
72 arg_index++;
73 if (arg_index >= argc) {
74 printf("### ERROR: Expecting print level (from 0 to 10).\n");
75 print_usage = TRUE;
76 break;
77 }
78 iniparam->print_level = atoi(argv[arg_index]);
79 if (++arg_index >= argc) break;
80 }
81
82 else if (strcmp(argv[arg_index], "-output") == 0) {
83 arg_index++;
84 if (arg_index >= argc) {
85 printf("### ERROR: Expecting output type (0 or 1).\n");
86 print_usage = TRUE;
87 break;
88 }
89 iniparam->output_type = atoi(argv[arg_index]);
90 if (++arg_index >= argc) break;
91 }
92
93 else if (strcmp(argv[arg_index], "-solver") == 0) {
94 arg_index++;
95 if (arg_index >= argc) {
96 printf("### ERROR: Expecting solver type.\n");
97 print_usage = TRUE;
98 break;
99 }
100 iniparam->solver_type = atoi(argv[arg_index]);
101 if (++arg_index >= argc) break;
102 }
103
104 else if (strcmp(argv[arg_index], "-precond") == 0) {
105 arg_index++;
106 if (arg_index >= argc) {
107 printf("### ERROR: Expecting preconditioner type.\n");
108 print_usage = TRUE;
109 break;
110 }
111 iniparam->precond_type = atoi(argv[arg_index]);
112 if (++arg_index >= argc) break;
113 }
114
115 else if (strcmp(argv[arg_index], "-maxit") == 0) {
116 arg_index++;
117 if (arg_index >= argc) {
118 printf("### ERROR: Expecting max number of iterations.\n");
119 print_usage = TRUE;
120 break;
121 }
122 iniparam->itsolver_maxit = atoi(argv[arg_index]);
123 if (++arg_index >= argc) break;
124 }
125
126 else if (strcmp(argv[arg_index], "-tol") == 0) {
127 arg_index++;
128 if (arg_index >= argc) {
129 printf("### ERROR: Expecting tolerance for itsolver.\n");
130 print_usage = TRUE;
131 break;
132 }
133 iniparam->itsolver_tol = atof(argv[arg_index]);
134 if (++arg_index >= argc) break;
135 }
136
137 else if (strcmp(argv[arg_index], "-abstol") == 0) {
138 arg_index++;
139 if (arg_index >= argc) {
140 printf("### ERROR: Expecting absolute tolerance for itsolver.\n");
141 print_usage = TRUE;
142 break;
143 }
144 iniparam->itsolver_abstol = atof(argv[arg_index]);
145 if (++arg_index >= argc) break;
146 }
147
148 else if (strcmp(argv[arg_index], "-amgmaxit") == 0) {
149 arg_index++;
150 if (arg_index >= argc) {
151 printf("### ERROR: Expecting max num of iterations for AMG.\n");
152 print_usage = TRUE;
153 break;
154 }
155 iniparam->AMG_maxit = atoi(argv[arg_index]);
156 if (++arg_index >= argc) break;
157 }
158
159 else if (strcmp(argv[arg_index], "-amgtol") == 0) {
160 arg_index++;
161 if (arg_index >= argc) {
162 printf("### ERROR: Expecting tolerance for AMG.\n");
163 print_usage = TRUE;
164 break;
165 }
166 iniparam->AMG_tol = atof(argv[arg_index]);
167 if (++arg_index >= argc) break;
168 }
169
170 else if (strcmp(argv[arg_index], "-amgtype") == 0) {
171 arg_index++;
172 if (arg_index >= argc) {
173 printf("### ERROR: Expecting AMG type (1, 2, 3).\n");
174 print_usage = TRUE;
175 break;
176 }
177 iniparam->AMG_type = atoi(argv[arg_index]);
178 if (++arg_index >= argc) break;
179 }
180
181 else if (strcmp(argv[arg_index], "-amgcycle") == 0) {
182 arg_index++;
183 if (arg_index >= argc) {
184 printf("### ERROR: Expecting AMG cycle type (1, 2, 3, 12, 21).\n");
185 print_usage = TRUE;
186 break;
187 }
188 iniparam->AMG_cycle_type = atoi(argv[arg_index]);
189 if (++arg_index >= argc) break;
190 }
191
192 else if (strcmp(argv[arg_index], "-amgcoarsening") == 0) {
193 arg_index++;
194 if (arg_index >= argc) {
195 printf("### ERROR: Expecting AMG coarsening type.\n");
196 print_usage = TRUE;
197 break;
198 }
199 iniparam->AMG_coarsening_type = atoi(argv[arg_index]);
200 if (++arg_index >= argc) break;
201 }
202
203 else if (strcmp(argv[arg_index], "-amginterplation") == 0) {
204 arg_index++;
205 if (arg_index >= argc) {
206 printf("### ERROR: Expecting AMG interpolation type.\n");
207 print_usage = TRUE;
208 break;
209 }
210 iniparam->AMG_interpolation_type = atoi(argv[arg_index]);
211 if (++arg_index >= argc) break;
212 }
213
214 else if (strcmp(argv[arg_index], "-amgsmoother") == 0) {
215 arg_index++;
216 if (arg_index >= argc) {
217 printf("### ERROR: Expecting AMG smoother type.\n");
218 print_usage = TRUE;
219 break;
220 }
221 iniparam->AMG_smoother = atoi(argv[arg_index]);
222 if (++arg_index >= argc) break;
223 }
224
225 else if (strcmp(argv[arg_index], "-amgsthreshold") == 0) {
226 arg_index++;
227 if (arg_index >= argc) {
228 printf("### ERROR: Expecting AMG strong threshold.\n");
229 print_usage = TRUE;
230 break;
231 }
232 iniparam->AMG_strong_threshold = atof(argv[arg_index]);
233 if (++arg_index >= argc) break;
234 }
235
236 else if (strcmp(argv[arg_index], "-amgscouple") == 0) {
237 arg_index++;
238 if (arg_index >= argc) {
239 printf("### ERROR: Expecting AMG strong coupled threshold.\n");
240 print_usage = TRUE;
241 break;
242 }
243 iniparam->AMG_strong_coupled = atof(argv[arg_index]);
244 if (++arg_index >= argc) break;
245 }
246
247 else {
248 print_usage = TRUE;
249 break;
250 }
251 }
252
253 if (print_usage) {
254
255 printf("FASP command line options:\n");
256
257 printf("================================================================\n");
258 printf(" -ini [CharValue] : Ini file name\n");
259 printf(" -print [IntValue] : Print level\n");
260 printf(" -output [IntValue] : Output to screen or a log file\n");
261 printf(" -solver [IntValue] : Solver type\n");
262 printf(" -precond [IntValue] : Preconditioner type\n");
263 printf(" -maxit [IntValue] : Max number of iterations\n");
264 printf(" -tol [RealValue] : Tolerance for iterative solvers\n");
265 printf(" -amgmaxit [IntValue] : Max number of AMG iterations\n");
266 printf(" -amgtol [RealValue] : Tolerance for AMG methods\n");
267 printf(" -amgtype [IntValue] : AMG type\n");
268 printf(" -amgcycle [IntValue] : AMG cycle type\n");
269 printf(" -amgcoarsening [IntValue] : AMG coarsening type\n");
270 printf(" -amginterpolation [IntValue] : AMG interpolation type\n");
271 printf(" -amgsmoother [IntValue] : AMG smoother type\n");
272 printf(" -amgsthreshold [RealValue] : AMG strong threshold\n");
273 printf(" -amgscoupled [RealValue] : AMG strong coupled threshold\n");
274 printf(" -help : Brief help messages\n");
275
276 exit(ERROR_INPUT_PAR);
277 }
278
279 // sanity checks
280 status = fasp_param_check(iniparam);
281
282 // if meet unexpected input, stop the program
283 fasp_chkerr(status, __FUNCTION__);
284}
285
306void fasp_param_init(const input_param* iniparam,
307 ITS_param* itsparam,
308 AMG_param* amgparam,
309 ILU_param* iluparam,
310 SWZ_param* swzparam)
311{
312#if DEBUG_MODE > 1
313 total_alloc_mem = 0; // initialize total memeory amount
314 total_alloc_count = 0; // initialize alloc count
315#endif
316
317 if (itsparam) fasp_param_solver_init(itsparam);
318 if (amgparam) fasp_param_amg_init(amgparam);
319 if (iluparam) fasp_param_ilu_init(iluparam);
320 if (swzparam) fasp_param_swz_init(swzparam);
321
322 if (iniparam) {
323 if (itsparam) fasp_param_solver_set(itsparam, iniparam);
324 if (amgparam) fasp_param_amg_set(amgparam, iniparam);
325 if (iluparam) fasp_param_ilu_set(iluparam, iniparam);
326 if (swzparam) fasp_param_swz_set(swzparam, iniparam);
327 } else {
328 printf("### WARNING: No input given! Use default values instead.\n");
329 }
330
331 // if using AMG as a solver, set min num of iterations = 50
332 if ((itsparam == NULL) && (amgparam != NULL)) {
333 amgparam->maxit = MAX(amgparam->maxit, 50);
334 }
335}
336
348{
349 strcpy(iniparam->workdir, "../data/");
350
351 // Input/output
352 iniparam->print_level = PRINT_SOME;
353 iniparam->output_type = 0;
354
355 // Problem information
356 iniparam->problem_num = 10;
357 iniparam->solver_type = SOLVER_CG;
358 iniparam->decoup_type = 1;
359 iniparam->precond_type = PREC_AMG;
360 iniparam->stop_type = STOP_REL_RES;
361
362 // Solver parameters
363 iniparam->itsolver_tol = 1e-6;
364 iniparam->itsolver_abstol = 1e-18;
365 iniparam->itsolver_maxit = 500;
366 iniparam->restart = 25;
367
368 // ILU method parameters
369 iniparam->ILU_type = ILUk;
370 iniparam->ILU_lfil = 0;
371 iniparam->ILU_droptol = 0.001;
372 iniparam->ILU_relax = 0;
373 iniparam->ILU_permtol = 0.0;
374
375 // Schwarz method parameters
376 iniparam->SWZ_mmsize = 200;
377 iniparam->SWZ_maxlvl = 2;
378 iniparam->SWZ_type = 1;
379 iniparam->SWZ_blksolver = SOLVER_DEFAULT;
380
381 // AMG method parameters
382 iniparam->AMG_type = CLASSIC_AMG;
383 iniparam->AMG_levels = 20;
384 iniparam->AMG_cycle_type = V_CYCLE;
385 iniparam->AMG_smoother = SMOOTHER_GS;
386 iniparam->AMG_smooth_order = CF_ORDER;
387 iniparam->AMG_presmooth_iter = 1;
388 iniparam->AMG_postsmooth_iter = 1;
389 iniparam->AMG_relaxation = 1.0;
390 iniparam->AMG_coarse_dof = 500;
391 iniparam->AMG_coarse_solver = 0;
392 iniparam->AMG_tol = 1e-6;
393 iniparam->AMG_maxit = 1;
394 iniparam->AMG_ILU_levels = 0;
395 iniparam->AMG_SWZ_levels = 0;
396 iniparam->AMG_coarse_scaling = OFF; // Require investigation --Chensong
397 iniparam->AMG_amli_degree = 1;
398 iniparam->AMG_nl_amli_krylov_type = 2;
399
400 // Classical AMG specific
401 iniparam->AMG_coarsening_type = 1;
402 iniparam->AMG_interpolation_type = 1;
403 iniparam->AMG_max_row_sum = 0.9;
404 iniparam->AMG_strong_threshold = 0.3;
405 iniparam->AMG_truncation_threshold = 0.2;
406 iniparam->AMG_aggressive_level = 0;
407 iniparam->AMG_aggressive_path = 1;
408
409 // Aggregation AMG specific
410 iniparam->AMG_aggregation_type = PAIRWISE;
411 iniparam->AMG_quality_bound = 8.0;
412 iniparam->AMG_pair_number = 2;
413 iniparam->AMG_strong_coupled = 0.25;
414 iniparam->AMG_max_aggregation = 9;
415 iniparam->AMG_tentative_smooth = 0.67;
416 iniparam->AMG_smooth_filter = ON;
417 iniparam->AMG_smooth_restriction = ON;
418 iniparam->AMG_aggregation_norm_type = -1;
419}
420
432{
433 // General AMG parameters
434 amgparam->AMG_type = CLASSIC_AMG;
435 amgparam->print_level = PRINT_NONE;
436 amgparam->maxit = 1;
437 amgparam->tol = 1e-6;
438 amgparam->max_levels = 20;
439 amgparam->coarse_dof = 500;
440 amgparam->cycle_type = V_CYCLE;
441 amgparam->smoother = SMOOTHER_GS;
442 amgparam->smooth_order = CF_ORDER;
443 amgparam->presmooth_iter = 1;
444 amgparam->postsmooth_iter = 1;
445 amgparam->coarse_solver = SOLVER_DEFAULT;
446 amgparam->relaxation = 1.0;
447 amgparam->polynomial_degree = 3;
448 amgparam->coarse_scaling = OFF;
449 amgparam->amli_degree = 2;
450 amgparam->amli_coef = NULL;
452
453 // Classical AMG specific
454 amgparam->coarsening_type = COARSE_RS;
455 amgparam->interpolation_type = INTERP_DIR;
456 amgparam->max_row_sum = 0.9;
457 amgparam->strong_threshold = 0.3;
458 amgparam->truncation_threshold = 0.2;
459 amgparam->aggressive_level = 0;
460 amgparam->aggressive_path = 1;
461
462 // Aggregation AMG specific
463 amgparam->aggregation_type = PAIRWISE;
464 amgparam->quality_bound = 10.0;
465 amgparam->pair_number = 2;
466 amgparam->strong_coupled = 0.08;
467 amgparam->max_aggregation = 20;
468 amgparam->tentative_smooth = 0.67;
469 amgparam->smooth_filter = ON;
470 amgparam->smooth_restriction = ON;
471 amgparam->aggregation_norm_type = -1;
472
473 // ILU smoother parameters
474 amgparam->ILU_type = ILUk;
475 amgparam->ILU_levels = 0;
476 amgparam->ILU_lfil = 0;
477 amgparam->ILU_droptol = 0.001;
478 amgparam->ILU_relax = 0;
479
480 // Schwarz smoother parameters
481 amgparam->SWZ_levels = 0; // levels will use Schwarz smoother
482 amgparam->SWZ_mmsize = 200;
483 amgparam->SWZ_maxlvl = 3; // vertices with smaller distance
484 amgparam->SWZ_type = 1;
485 amgparam->SWZ_blksolver = SOLVER_DEFAULT;
486
487 // reduction-based AMG parameters
488 amgparam->theta = -1.0; // set in amg setup(coarsening) phase, -1.0 means not set
489}
490
502void fasp_param_amg_copy(AMG_param* amgparam_src, AMG_param* amgparam_dest)
503{
504 // General AMG parameters
505 amgparam_dest->AMG_type = amgparam_src->AMG_type;
506 amgparam_dest->print_level = amgparam_src->print_level;
507 amgparam_dest->maxit = amgparam_src->maxit;
508 amgparam_dest->tol = amgparam_src->tol;
509 amgparam_dest->max_levels = amgparam_src->max_levels;
510 amgparam_dest->coarse_dof = amgparam_src->coarse_dof;
511 amgparam_dest->cycle_type = amgparam_src->cycle_type;
512 amgparam_dest->smoother = amgparam_src->smoother;
513 amgparam_dest->smooth_order = amgparam_src->smooth_order;
514 amgparam_dest->presmooth_iter = amgparam_src->presmooth_iter;
515 amgparam_dest->postsmooth_iter = amgparam_src->postsmooth_iter;
516 amgparam_dest->coarse_solver = amgparam_src->coarse_solver;
517 amgparam_dest->relaxation = amgparam_src->relaxation;
518 amgparam_dest->polynomial_degree = amgparam_src->polynomial_degree;
519 amgparam_dest->coarse_scaling = amgparam_src->coarse_scaling;
520 amgparam_dest->amli_degree = amgparam_src->amli_degree;
521 amgparam_dest->amli_coef = amgparam_src->amli_coef;
522 amgparam_dest->nl_amli_krylov_type = amgparam_src->nl_amli_krylov_type;
523
524 // Classical AMG specific
525 amgparam_dest->coarsening_type = amgparam_src->coarsening_type;
526 amgparam_dest->interpolation_type = amgparam_src->interpolation_type;
527 amgparam_dest->max_row_sum = amgparam_src->max_row_sum;
528 amgparam_dest->strong_threshold = amgparam_src->strong_threshold;
529 amgparam_dest->truncation_threshold = amgparam_src->truncation_threshold;
530 amgparam_dest->aggressive_level = amgparam_src->aggressive_level;
531 amgparam_dest->aggressive_path = amgparam_src->aggressive_path;
532
533 // Aggregation AMG specific
534 amgparam_dest->aggregation_type = amgparam_src->aggregation_type;
535 amgparam_dest->quality_bound = amgparam_src->quality_bound;
536 amgparam_dest->pair_number = amgparam_src->pair_number;
537 amgparam_dest->strong_coupled = amgparam_src->strong_coupled;
538 amgparam_dest->max_aggregation = amgparam_src->max_aggregation;
539 amgparam_dest->tentative_smooth = amgparam_src->tentative_smooth;
540 amgparam_dest->smooth_filter = amgparam_src->smooth_filter;
541 amgparam_dest->smooth_restriction = amgparam_src->smooth_restriction;
542 amgparam_dest->aggregation_norm_type = amgparam_src->aggregation_norm_type;
543
544 // ILU smoother parameters
545 amgparam_dest->ILU_type = amgparam_src->ILU_type;
546 amgparam_dest->ILU_levels = amgparam_src->ILU_levels;
547 amgparam_dest->ILU_lfil = amgparam_src->ILU_lfil;
548 amgparam_dest->ILU_droptol = amgparam_src->ILU_droptol;
549 amgparam_dest->ILU_relax = amgparam_src->ILU_relax;
550
551 // Schwarz smoother parameters
552 amgparam_dest->SWZ_levels = amgparam_src->SWZ_levels;
553 amgparam_dest->SWZ_mmsize = amgparam_src->SWZ_mmsize;
554 amgparam_dest->SWZ_maxlvl = amgparam_src->SWZ_maxlvl;
555 amgparam_dest->SWZ_type = amgparam_src->SWZ_type;
556 amgparam_dest->SWZ_blksolver = amgparam_src->SWZ_blksolver;
557
558 // reduction-based AMG parameters
559 amgparam_dest->theta = amgparam_src->theta;
560}
561
573{
574 itsparam->print_level = PRINT_NONE;
575 itsparam->itsolver_type = SOLVER_CG;
576 itsparam->decoup_type = 1;
577 itsparam->precond_type = PREC_AMG;
578 itsparam->stop_type = STOP_REL_RES;
579 itsparam->maxit = 500;
580 itsparam->restart = 25;
581 itsparam->tol = 1e-6;
582 itsparam->abstol = 1e-18; // Added by zcs on 09/05/2022
583}
584
596{
597 iluparam->print_level = PRINT_NONE;
598 iluparam->ILU_type = ILUk;
599 iluparam->ILU_lfil = 2;
600 iluparam->ILU_droptol = 0.001;
601 iluparam->ILU_relax = 0;
602 iluparam->ILU_permtol = 0.01;
603}
604
618{
619 swzparam->print_level = PRINT_NONE;
620 swzparam->SWZ_type = 3;
621 swzparam->SWZ_maxlvl = 2;
622 swzparam->SWZ_mmsize = 200;
623 swzparam->SWZ_blksolver = 0;
624}
625
637void fasp_param_amg_set(AMG_param* param, const input_param* iniparam)
638{
639 param->AMG_type = iniparam->AMG_type;
640 param->print_level = iniparam->print_level;
641
642 if (iniparam->solver_type == SOLVER_AMG) {
643 param->maxit = iniparam->itsolver_maxit;
644 param->tol = iniparam->itsolver_tol;
645 } else if (iniparam->solver_type == SOLVER_FMG) {
646 param->maxit = iniparam->itsolver_maxit;
647 param->tol = iniparam->itsolver_tol;
648 } else {
649 param->maxit = iniparam->AMG_maxit;
650 param->tol = iniparam->AMG_tol;
651 }
652
653 param->max_levels = iniparam->AMG_levels;
654 param->cycle_type = iniparam->AMG_cycle_type;
655 param->smoother = iniparam->AMG_smoother;
656 param->smooth_order = iniparam->AMG_smooth_order;
657 param->relaxation = iniparam->AMG_relaxation;
658 param->coarse_solver = iniparam->AMG_coarse_solver;
659 param->polynomial_degree = iniparam->AMG_polynomial_degree;
660 param->presmooth_iter = iniparam->AMG_presmooth_iter;
661 param->postsmooth_iter = iniparam->AMG_postsmooth_iter;
662 param->coarse_dof = iniparam->AMG_coarse_dof;
663 param->coarse_scaling = iniparam->AMG_coarse_scaling;
664 param->amli_degree = iniparam->AMG_amli_degree;
665 param->amli_coef = NULL;
667
668 param->coarsening_type = iniparam->AMG_coarsening_type;
670 param->strong_threshold = iniparam->AMG_strong_threshold;
672 param->max_row_sum = iniparam->AMG_max_row_sum;
673 param->aggressive_level = iniparam->AMG_aggressive_level;
674 param->aggressive_path = iniparam->AMG_aggressive_path;
675
676 param->aggregation_type = iniparam->AMG_aggregation_type;
677 param->pair_number = iniparam->AMG_pair_number;
678 param->quality_bound = iniparam->AMG_quality_bound;
679 param->strong_coupled = iniparam->AMG_strong_coupled;
680 param->max_aggregation = iniparam->AMG_max_aggregation;
681 param->tentative_smooth = iniparam->AMG_tentative_smooth;
682 param->smooth_filter = iniparam->AMG_smooth_filter;
685
686 param->ILU_levels = iniparam->AMG_ILU_levels;
687 param->ILU_type = iniparam->ILU_type;
688 param->ILU_lfil = iniparam->ILU_lfil;
689 param->ILU_droptol = iniparam->ILU_droptol;
690 param->ILU_relax = iniparam->ILU_relax;
691 param->ILU_permtol = iniparam->ILU_permtol;
692
693 param->SWZ_levels = iniparam->AMG_SWZ_levels;
694 param->SWZ_mmsize = iniparam->SWZ_mmsize;
695 param->SWZ_maxlvl = iniparam->SWZ_maxlvl;
696 param->SWZ_type = iniparam->SWZ_type;
697}
698
710void fasp_param_ilu_set(ILU_param* iluparam, const input_param* iniparam)
711{
712 iluparam->print_level = iniparam->print_level;
713 iluparam->ILU_type = iniparam->ILU_type;
714 iluparam->ILU_lfil = iniparam->ILU_lfil;
715 iluparam->ILU_droptol = iniparam->ILU_droptol;
716 iluparam->ILU_relax = iniparam->ILU_relax;
717 iluparam->ILU_permtol = iniparam->ILU_permtol;
718}
719
731void fasp_param_swz_set(SWZ_param* swzparam, const input_param* iniparam)
732{
733 swzparam->print_level = iniparam->print_level;
734 swzparam->SWZ_type = iniparam->SWZ_type;
735 swzparam->SWZ_maxlvl = iniparam->SWZ_maxlvl;
736 swzparam->SWZ_mmsize = iniparam->SWZ_mmsize;
737 swzparam->SWZ_blksolver = iniparam->SWZ_blksolver;
738}
739
752void fasp_param_solver_set(ITS_param* itsparam, const input_param* iniparam)
753{
754 itsparam->print_level = iniparam->print_level;
755 itsparam->itsolver_type = iniparam->solver_type;
756 itsparam->decoup_type = iniparam->decoup_type;
757 itsparam->precond_type = iniparam->precond_type;
758 itsparam->stop_type = iniparam->stop_type;
759 itsparam->restart = iniparam->restart;
760
761 if (itsparam->itsolver_type == SOLVER_AMG) {
762 itsparam->tol = iniparam->AMG_tol;
763 itsparam->maxit = iniparam->AMG_maxit;
764 } else {
765 itsparam->tol = iniparam->itsolver_tol;
766 itsparam->abstol = iniparam->itsolver_abstol;
767 itsparam->maxit = iniparam->itsolver_maxit;
768 }
769}
770
782void fasp_param_amg_to_prec(precond_data* pcdata, const AMG_param* amgparam)
783{
784 pcdata->AMG_type = amgparam->AMG_type;
785 pcdata->print_level = amgparam->print_level;
786 pcdata->maxit = amgparam->maxit;
787 pcdata->max_levels = amgparam->max_levels;
788 pcdata->tol = amgparam->tol;
789 pcdata->cycle_type = amgparam->cycle_type;
790 pcdata->smoother = amgparam->smoother;
791 pcdata->smooth_order = amgparam->smooth_order;
792 pcdata->presmooth_iter = amgparam->presmooth_iter;
793 pcdata->postsmooth_iter = amgparam->postsmooth_iter;
794 pcdata->coarsening_type = amgparam->coarsening_type;
795 pcdata->coarse_solver = amgparam->coarse_solver;
796 pcdata->relaxation = amgparam->relaxation;
797 pcdata->polynomial_degree = amgparam->polynomial_degree;
798 pcdata->coarse_scaling = amgparam->coarse_scaling;
799 pcdata->amli_degree = amgparam->amli_degree;
800 pcdata->amli_coef = amgparam->amli_coef;
801 pcdata->nl_amli_krylov_type = amgparam->nl_amli_krylov_type;
802 pcdata->tentative_smooth = amgparam->tentative_smooth;
803}
804
816void fasp_param_prec_to_amg(AMG_param* amgparam, const precond_data* pcdata)
817{
818 amgparam->AMG_type = pcdata->AMG_type;
819 amgparam->print_level = pcdata->print_level;
820 amgparam->cycle_type = pcdata->cycle_type;
821 amgparam->smoother = pcdata->smoother;
822 amgparam->smooth_order = pcdata->smooth_order;
823 amgparam->presmooth_iter = pcdata->presmooth_iter;
824 amgparam->postsmooth_iter = pcdata->postsmooth_iter;
825 amgparam->relaxation = pcdata->relaxation;
826 amgparam->polynomial_degree = pcdata->polynomial_degree;
827 amgparam->coarse_solver = pcdata->coarse_solver;
828 amgparam->coarse_scaling = pcdata->coarse_scaling;
829 amgparam->amli_degree = pcdata->amli_degree;
830 amgparam->amli_coef = pcdata->amli_coef;
831 amgparam->nl_amli_krylov_type = pcdata->nl_amli_krylov_type;
832 amgparam->tentative_smooth = pcdata->tentative_smooth;
833 amgparam->ILU_levels = pcdata->mgl_data->ILU_levels;
834}
835
849{
850 pcdata->AMG_type = amgparam->AMG_type;
851 pcdata->print_level = amgparam->print_level;
852 pcdata->maxit = amgparam->maxit;
853 pcdata->max_levels = amgparam->max_levels;
854 pcdata->tol = amgparam->tol;
855 pcdata->cycle_type = amgparam->cycle_type;
856 pcdata->smoother = amgparam->smoother;
857 pcdata->smooth_order = amgparam->smooth_order;
858 pcdata->presmooth_iter = amgparam->presmooth_iter;
859 pcdata->postsmooth_iter = amgparam->postsmooth_iter;
860 pcdata->coarse_solver = amgparam->coarse_solver;
861 pcdata->coarsening_type = amgparam->coarsening_type;
862 pcdata->relaxation = amgparam->relaxation;
863 pcdata->coarse_scaling = amgparam->coarse_scaling;
864 pcdata->amli_degree = amgparam->amli_degree;
865 pcdata->amli_coef = amgparam->amli_coef;
866 pcdata->nl_amli_krylov_type = amgparam->nl_amli_krylov_type;
867 pcdata->tentative_smooth = amgparam->tentative_smooth;
868}
869
883{
884 amgparam->AMG_type = pcdata->AMG_type;
885 amgparam->print_level = pcdata->print_level;
886 amgparam->cycle_type = pcdata->cycle_type;
887 amgparam->smoother = pcdata->smoother;
888 amgparam->smooth_order = pcdata->smooth_order;
889 amgparam->presmooth_iter = pcdata->presmooth_iter;
890 amgparam->postsmooth_iter = pcdata->postsmooth_iter;
891 amgparam->relaxation = pcdata->relaxation;
892 amgparam->coarse_solver = pcdata->coarse_solver;
893 amgparam->coarse_scaling = pcdata->coarse_scaling;
894 amgparam->amli_degree = pcdata->amli_degree;
895 amgparam->amli_coef = pcdata->amli_coef;
896 amgparam->nl_amli_krylov_type = pcdata->nl_amli_krylov_type;
897 amgparam->tentative_smooth = pcdata->tentative_smooth;
898 amgparam->ILU_levels = pcdata->mgl_data->ILU_levels;
899}
900
912{
913
914 if (param) {
915
916 printf("\n Parameters in AMG_param\n");
917 printf("-----------------------------------------------\n");
918
919 printf("AMG print level: %d\n", param->print_level);
920 printf("AMG max num of iter: %d\n", param->maxit);
921 printf("AMG type: %d\n", param->AMG_type);
922 printf("AMG tolerance: %.2e\n", param->tol);
923 printf("AMG max levels: %d\n", param->max_levels);
924 printf("AMG cycle type: %d\n", param->cycle_type);
925 printf("AMG coarse solver type: %d\n", param->coarse_solver);
926 printf("AMG scaling of coarse correction: %d\n", param->coarse_scaling);
927 printf("AMG smoother type: %d\n", param->smoother);
928 printf("AMG smoother order: %d\n", param->smooth_order);
929 printf("AMG num of presmoothing: %d\n", param->presmooth_iter);
930 printf("AMG num of postsmoothing: %d\n", param->postsmooth_iter);
931
932 if (param->smoother == SMOOTHER_SOR || param->smoother == SMOOTHER_SSOR ||
933 param->smoother == SMOOTHER_GSOR || param->smoother == SMOOTHER_SGSOR) {
934 printf("AMG relax factor: %.4f\n", param->relaxation);
935 }
936
937 if (param->smoother == SMOOTHER_POLY) {
938 printf("AMG polynomial smoother degree: %d\n", param->polynomial_degree);
939 }
940
941 if (param->cycle_type == AMLI_CYCLE) {
942 printf("AMG AMLI degree of polynomial: %d\n", param->amli_degree);
943 }
944
945 if (param->cycle_type == NL_AMLI_CYCLE) {
946 printf("AMG Nonlinear AMLI Krylov type: %d\n",
947 param->nl_amli_krylov_type);
948 }
949
950 switch (param->AMG_type) {
951 case CLASSIC_AMG:
952 printf("AMG coarsening type: %d\n",
953 param->coarsening_type);
954 printf("AMG interpolation type: %d\n",
955 param->interpolation_type);
956 printf("AMG dof on coarsest grid: %d\n", param->coarse_dof);
957 printf("AMG strong threshold: %.4f\n",
958 param->strong_threshold);
959 printf("AMG truncation threshold: %.4f\n",
960 param->truncation_threshold);
961 printf("AMG max row sum: %.4f\n", param->max_row_sum);
962 printf("AMG aggressive levels: %d\n",
963 param->aggressive_level);
964 printf("AMG aggressive path: %d\n",
965 param->aggressive_path);
966 break;
967
968 default: // SA_AMG or UA_AMG
969 printf("Aggregation type: %d\n",
970 param->aggregation_type);
971 if (param->aggregation_type == PAIRWISE) {
972 printf("Aggregation number of pairs: %d\n",
973 param->pair_number);
974 printf("Aggregation quality bound: %.2f\n",
975 param->quality_bound);
976 }
977 if (param->aggregation_type == VMB) {
978 printf("Aggregation strong coupling: %.4f\n",
979 param->strong_coupled);
980 printf("Aggregation max aggregation: %d\n",
981 param->max_aggregation);
982 printf("Aggregation tentative smooth: %.4f\n",
983 param->tentative_smooth);
984 printf("Aggregation smooth filter: %d\n",
985 param->smooth_filter);
986 printf("Aggregation smooth restriction: %d\n",
987 param->smooth_restriction);
988 }
989 break;
990 }
991
992 if (param->ILU_levels > 0) {
993 printf("AMG ILU smoother level: %d\n", param->ILU_levels);
994 printf("AMG ILU type: %d\n", param->ILU_type);
995 printf("AMG ILU level of fill-in: %d\n", param->ILU_lfil);
996 printf("AMG ILU drop tol: %e\n", param->ILU_droptol);
997 printf("AMG ILU relaxation: %f\n", param->ILU_relax);
998 }
999
1000 if (param->SWZ_levels > 0) {
1001 printf("AMG Schwarz smoother level: %d\n", param->SWZ_levels);
1002 printf("AMG Schwarz type: %d\n", param->SWZ_type);
1003 printf("AMG Schwarz forming block level: %d\n", param->SWZ_maxlvl);
1004 printf("AMG Schwarz maximal block size: %d\n", param->SWZ_mmsize);
1005 }
1006
1007 printf("-----------------------------------------------\n\n");
1008
1009 } else {
1010 printf("### WARNING: AMG_param has not been set!\n");
1011 } // end if (param)
1012}
1013
1025{
1026 if (param) {
1027
1028 printf("\n Parameters in ILU_param\n");
1029 printf("-----------------------------------------------\n");
1030 printf("ILU print level: %d\n", param->print_level);
1031 printf("ILU type: %d\n", param->ILU_type);
1032 printf("ILU level of fill-in: %d\n", param->ILU_lfil);
1033 printf("ILU relaxation factor: %.4f\n", param->ILU_relax);
1034 printf("ILU drop tolerance: %.2e\n", param->ILU_droptol);
1035 printf("ILU permutation tolerance: %.2e\n", param->ILU_permtol);
1036 printf("-----------------------------------------------\n\n");
1037
1038 } else {
1039 printf("### WARNING: ILU_param has not been set!\n");
1040 }
1041}
1042
1054{
1055 if (param) {
1056
1057 printf("\n Parameters in SWZ_param\n");
1058 printf("-----------------------------------------------\n");
1059 printf("Schwarz print level: %d\n", param->print_level);
1060 printf("Schwarz type: %d\n", param->SWZ_type);
1061 printf("Schwarz forming block level: %d\n", param->SWZ_maxlvl);
1062 printf("Schwarz maximal block size: %d\n", param->SWZ_mmsize);
1063 printf("Schwarz block solver type: %d\n", param->SWZ_blksolver);
1064 printf("-----------------------------------------------\n\n");
1065
1066 } else {
1067 printf("### WARNING: SWZ_param has not been set!\n");
1068 }
1069}
1070
1082{
1083 if (param) {
1084
1085 printf("\n Parameters in ITS_param\n");
1086 printf("-----------------------------------------------\n");
1087
1088 printf("Solver print level: %d\n", param->print_level);
1089 printf("Solver type: %d\n", param->itsolver_type);
1090 printf("Solver precond type: %d\n", param->precond_type);
1091 printf("Solver max num of iter: %d\n", param->maxit);
1092 printf("Solver tolerance: %.5e\n", param->tol);
1093 printf("Solver absolute tolerance: %.5e\n", param->abstol);
1094 printf("Solver stopping type: %d\n", param->stop_type);
1095
1096 if (param->itsolver_type == SOLVER_GMRES ||
1097 param->itsolver_type == SOLVER_VGMRES) {
1098 printf("Solver restart number: %d\n", param->restart);
1099 }
1100
1101 printf("-----------------------------------------------\n\n");
1102
1103 } else {
1104 printf("### WARNING: ITS_param has not been set!\n");
1105 }
1106}
1107
1108/*---------------------------------*/
1109/*-- End of File --*/
1110/*---------------------------------*/
SHORT fasp_param_check(input_param *inparam)
Simple check on input parameters.
Definition: AuxInput.c:33
void fasp_param_input(const char *fname, input_param *inparam)
Read input parameters from disk file.
Definition: AuxInput.c:86
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_ilu_init(ILU_param *iluparam)
Initialize ILU parameters.
Definition: AuxParam.c:595
void fasp_param_amg_copy(AMG_param *amgparam_src, AMG_param *amgparam_dest)
Copy AMG parameters from amgparam_src to amgparam_dest.
Definition: AuxParam.c:502
void fasp_param_init(const input_param *iniparam, ITS_param *itsparam, AMG_param *amgparam, ILU_param *iluparam, SWZ_param *swzparam)
Initialize parameters, global variables, etc.
Definition: AuxParam.c:306
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_precbsr_to_amg(AMG_param *amgparam, const precond_data_bsr *pcdata)
Set AMG_param with precond_data.
Definition: AuxParam.c:882
void fasp_param_amg_set(AMG_param *param, const input_param *iniparam)
Set AMG_param from INPUT.
Definition: AuxParam.c:637
void fasp_param_amg_to_precbsr(precond_data_bsr *pcdata, const AMG_param *amgparam)
Set precond_data_bsr with AMG_param.
Definition: AuxParam.c:848
void fasp_param_swz_init(SWZ_param *swzparam)
Initialize Schwarz parameters.
Definition: AuxParam.c:617
void fasp_param_solver_print(const ITS_param *param)
Print out itsolver parameters.
Definition: AuxParam.c:1081
void fasp_param_swz_set(SWZ_param *swzparam, const input_param *iniparam)
Set SWZ_param with INPUT.
Definition: AuxParam.c:731
void fasp_param_ilu_set(ILU_param *iluparam, const input_param *iniparam)
Set ILU_param with INPUT.
Definition: AuxParam.c:710
void fasp_param_input_init(input_param *iniparam)
Initialize input parameters.
Definition: AuxParam.c:347
void fasp_param_amg_print(const AMG_param *param)
Print out AMG parameters.
Definition: AuxParam.c:911
void fasp_param_solver_init(ITS_param *itsparam)
Initialize ITS_param.
Definition: AuxParam.c:572
void fasp_param_amg_init(AMG_param *amgparam)
Initialize AMG parameters.
Definition: AuxParam.c:431
void fasp_param_ilu_print(const ILU_param *param)
Print out ILU parameters.
Definition: AuxParam.c:1024
void fasp_param_prec_to_amg(AMG_param *amgparam, const precond_data *pcdata)
Set AMG_param with precond_data.
Definition: AuxParam.c:816
void fasp_param_swz_print(const SWZ_param *param)
Print out Schwarz parameters.
Definition: AuxParam.c:1053
void fasp_param_set(const int argc, const char *argv[], input_param *iniparam)
Read input from command-line arguments.
Definition: AuxParam.c:41
void fasp_param_solver_set(ITS_param *itsparam, const input_param *iniparam)
Set ITS_param with INPUT.
Definition: AuxParam.c:752
unsigned long total_alloc_mem
unsigned long total_alloc_count
Main header file for the FASP project.
#define SHORT
FASP integer and floating point numbers.
Definition: fasp.h:71
#define MAX(a, b)
Definition of max, min, abs.
Definition: fasp.h:82
#define AMLI_CYCLE
Definition: fasp_const.h:181
#define SMOOTHER_SOR
Definition: fasp_const.h:195
#define COARSE_RS
Definition of coarsening types.
Definition: fasp_const.h:213
#define SOLVER_FMG
Definition: fasp_const.h:121
#define NL_AMLI_CYCLE
Definition: fasp_const.h:182
#define SOLVER_GMRES
Definition: fasp_const.h:106
#define OFF
Definition: fasp_const.h:68
#define SMOOTHER_GSOR
Definition: fasp_const.h:197
#define FASP_SUCCESS
Definition of return status and error messages.
Definition: fasp_const.h:19
#define STOP_REL_RES
Definition of iterative solver stopping criteria types.
Definition: fasp_const.h:132
#define PAIRWISE
Definition of aggregation types.
Definition: fasp_const.h:170
#define SOLVER_VGMRES
Definition: fasp_const.h:107
#define V_CYCLE
Definition of cycle types.
Definition: fasp_const.h:179
#define SMOOTHER_SGSOR
Definition: fasp_const.h:198
#define PREC_AMG
Definition: fasp_const.h:141
#define SMOOTHER_GS
Definition: fasp_const.h:191
#define INTERP_DIR
Definition of interpolation types.
Definition: fasp_const.h:222
#define SOLVER_DEFAULT
Definition of solver types for iterative methods.
Definition: fasp_const.h:101
#define PRINT_SOME
Definition: fasp_const.h:75
#define VMB
Definition: fasp_const.h:171
#define CF_ORDER
Definition: fasp_const.h:241
#define TRUE
Definition of logic type.
Definition: fasp_const.h:61
#define FALSE
Definition: fasp_const.h:62
#define ERROR_INPUT_PAR
Definition: fasp_const.h:24
#define SOLVER_CG
Definition: fasp_const.h:103
#define SMOOTHER_POLY
Definition: fasp_const.h:199
#define CLASSIC_AMG
Definition of AMG types.
Definition: fasp_const.h:163
#define ON
Definition of switch.
Definition: fasp_const.h:67
#define ILUk
Type of ILU methods.
Definition: fasp_const.h:149
#define PRINT_NONE
Print level for all subroutines – not including DEBUG output.
Definition: fasp_const.h:73
#define SMOOTHER_SSOR
Definition: fasp_const.h:196
#define SOLVER_AMG
Definition: fasp_const.h:120
#define SOLVER_GCG
Definition: fasp_const.h:109
INT ILU_levels
number of levels use ILU smoother
Definition: fasp_block.h:217
INT ILU_levels
number of levels use ILU smoother
Definition: fasp.h:843
Parameters for AMG methods.
Definition: fasp.h:455
SHORT aggregation_norm_type
aggregation norm type
Definition: fasp.h:521
INT ILU_lfil
level of fill-in for ILUs and ILUk
Definition: fasp.h:566
INT aggressive_level
number of levels use aggressive coarsening
Definition: fasp.h:536
REAL ILU_relax
relaxation for ILUs
Definition: fasp.h:572
REAL strong_threshold
strong connection threshold for coarsening
Definition: fasp.h:527
INT SWZ_mmsize
maximal block size
Definition: fasp.h:581
INT aggressive_path
number of paths use to determine strongly coupled C points
Definition: fasp.h:539
SHORT interpolation_type
interpolation type
Definition: fasp.h:524
SHORT print_level
print level for AMG
Definition: fasp.h:461
SHORT polynomial_degree
degree of the polynomial smoother
Definition: fasp.h:497
INT SWZ_maxlvl
maximal levels
Definition: fasp.h:584
SHORT aggregation_type
aggregation type
Definition: fasp.h:518
SHORT coarsening_type
coarsening type
Definition: fasp.h:515
SHORT nl_amli_krylov_type
type of Krylov method used by Nonlinear AMLI cycle
Definition: fasp.h:512
SHORT coarse_scaling
switch of scaling of the coarse grid correction
Definition: fasp.h:503
SHORT smooth_filter
switch for filtered matrix used for smoothing the tentative prolongation
Definition: fasp.h:554
REAL * amli_coef
coefficients of the polynomial used by AMLI cycle
Definition: fasp.h:509
SHORT ILU_levels
number of levels use ILU smoother
Definition: fasp.h:560
SHORT AMG_type
type of AMG method
Definition: fasp.h:458
REAL tol
stopping tolerance for AMG solver
Definition: fasp.h:467
SHORT coarse_solver
coarse solver type
Definition: fasp.h:500
REAL strong_coupled
strong coupled threshold for aggregate
Definition: fasp.h:545
REAL theta
theta for reduction-based amg
Definition: fasp.h:593
REAL relaxation
relaxation parameter for Jacobi and SOR smoother
Definition: fasp.h:494
SHORT smoother
smoother type
Definition: fasp.h:482
SHORT cycle_type
type of AMG cycle
Definition: fasp.h:476
SHORT amli_degree
degree of the polynomial used by AMLI cycle
Definition: fasp.h:506
SHORT ILU_type
ILU type for smoothing.
Definition: fasp.h:563
INT SWZ_blksolver
type of Schwarz block solver
Definition: fasp.h:590
INT SWZ_type
type of Schwarz method
Definition: fasp.h:587
REAL quality_bound
quality threshold for pairwise aggregation
Definition: fasp.h:479
INT coarse_dof
max number of coarsest level DOF
Definition: fasp.h:473
REAL ILU_droptol
drop tolerance for ILUt
Definition: fasp.h:569
REAL tentative_smooth
relaxation parameter for smoothing the tentative prolongation
Definition: fasp.h:551
SHORT postsmooth_iter
number of postsmoothers
Definition: fasp.h:491
INT SWZ_levels
number of levels use Schwarz smoother
Definition: fasp.h:578
INT pair_number
number of pairwise matchings
Definition: fasp.h:542
SHORT max_levels
max number of levels of AMG
Definition: fasp.h:470
SHORT presmooth_iter
number of presmoothers
Definition: fasp.h:488
REAL truncation_threshold
truncation threshold
Definition: fasp.h:533
INT max_aggregation
max size of each aggregate
Definition: fasp.h:548
REAL ILU_permtol
permuted if permtol*|a(i,j)| > |a(i,i)|
Definition: fasp.h:575
REAL max_row_sum
maximal row sum parameter
Definition: fasp.h:530
INT maxit
max number of iterations of AMG
Definition: fasp.h:464
SHORT smooth_restriction
smooth the restriction for SA methods or not
Definition: fasp.h:557
SHORT smooth_order
smoother order
Definition: fasp.h:485
Parameters for ILU.
Definition: fasp.h:404
INT ILU_lfil
level of fill-in for ILUk
Definition: fasp.h:413
REAL ILU_relax
add the sum of dropped elements to diagonal element in proportion relax
Definition: fasp.h:419
SHORT print_level
print level
Definition: fasp.h:407
SHORT ILU_type
ILU type for decomposition.
Definition: fasp.h:410
REAL ILU_droptol
drop tolerance for ILUt
Definition: fasp.h:416
REAL ILU_permtol
permuted if permtol*|a(i,j)| > |a(i,i)|
Definition: fasp.h:422
Parameters for iterative solvers.
Definition: fasp.h:386
SHORT itsolver_type
Definition: fasp.h:389
SHORT print_level
Definition: fasp.h:388
SHORT precond_type
Definition: fasp.h:391
REAL tol
Definition: fasp.h:395
SHORT decoup_type
Definition: fasp.h:390
INT restart
Definition: fasp.h:393
SHORT stop_type
Definition: fasp.h:392
REAL abstol
Definition: fasp.h:396
INT maxit
Definition: fasp.h:394
Parameters for Schwarz method.
Definition: fasp.h:430
INT SWZ_mmsize
maximal size of blocks
Definition: fasp.h:442
SHORT print_level
print leve
Definition: fasp.h:433
INT SWZ_maxlvl
maximal level for constructing the blocks
Definition: fasp.h:439
INT SWZ_blksolver
type of Schwarz block solver
Definition: fasp.h:445
SHORT SWZ_type
type for Schwarz method
Definition: fasp.h:436
Input parameters.
Definition: fasp.h:1125
INT AMG_coarse_dof
Definition: fasp.h:1170
INT ILU_lfil
Definition: fasp.h:1148
REAL ILU_relax
Definition: fasp.h:1150
INT SWZ_mmsize
Definition: fasp.h:1154
SHORT AMG_smooth_order
Definition: fasp.h:1164
REAL itsolver_abstol
Definition: fasp.h:1142
SHORT print_level
Definition: fasp.h:1128
REAL AMG_quality_bound
Definition: fasp.h:1189
INT SWZ_maxlvl
Definition: fasp.h:1155
INT AMG_SWZ_levels
Definition: fasp.h:1177
SHORT AMG_levels
Definition: fasp.h:1161
SHORT AMG_coarsening_type
Definition: fasp.h:1180
SHORT AMG_cycle_type
Definition: fasp.h:1162
INT AMG_pair_number
Definition: fasp.h:1188
REAL AMG_strong_threshold
Definition: fasp.h:1183
char inifile[STRLEN]
Definition: fasp.h:1132
REAL AMG_truncation_threshold
Definition: fasp.h:1184
SHORT AMG_polynomial_degree
Definition: fasp.h:1166
SHORT AMG_coarse_solver
Definition: fasp.h:1173
SHORT precond_type
Definition: fasp.h:1139
SHORT AMG_type
Definition: fasp.h:1160
SHORT AMG_smooth_filter
Definition: fasp.h:1195
char workdir[STRLEN]
Definition: fasp.h:1133
SHORT output_type
Definition: fasp.h:1129
REAL AMG_tentative_smooth
Definition: fasp.h:1194
SHORT AMG_smoother
Definition: fasp.h:1163
REAL AMG_strong_coupled
Definition: fasp.h:1192
INT AMG_max_aggregation
Definition: fasp.h:1193
SHORT decoup_type
Definition: fasp.h:1138
SHORT ILU_type
Definition: fasp.h:1147
SHORT AMG_amli_degree
Definition: fasp.h:1175
INT restart
Definition: fasp.h:1144
SHORT AMG_smooth_restriction
Definition: fasp.h:1196
INT SWZ_blksolver
Definition: fasp.h:1157
INT SWZ_type
Definition: fasp.h:1156
REAL ILU_droptol
Definition: fasp.h:1149
INT AMG_aggressive_path
Definition: fasp.h:1187
SHORT AMG_nl_amli_krylov_type
Definition: fasp.h:1176
SHORT AMG_postsmooth_iter
Definition: fasp.h:1168
INT AMG_aggressive_level
Definition: fasp.h:1186
REAL AMG_max_row_sum
Definition: fasp.h:1185
SHORT AMG_presmooth_iter
Definition: fasp.h:1167
INT itsolver_maxit
Definition: fasp.h:1143
REAL AMG_tol
Definition: fasp.h:1169
SHORT stop_type
Definition: fasp.h:1140
INT problem_num
Definition: fasp.h:1134
SHORT AMG_aggregation_norm_type
Definition: fasp.h:1197
SHORT AMG_interpolation_type
Definition: fasp.h:1182
SHORT AMG_ILU_levels
Definition: fasp.h:1172
REAL ILU_permtol
Definition: fasp.h:1151
REAL itsolver_tol
Definition: fasp.h:1141
INT AMG_maxit
Definition: fasp.h:1171
SHORT AMG_coarse_scaling
Definition: fasp.h:1174
REAL AMG_relaxation
Definition: fasp.h:1165
SHORT solver_type
Definition: fasp.h:1137
SHORT AMG_aggregation_type
Definition: fasp.h:1181
Data for preconditioners in dBSRmat format.
Definition: fasp_block.h:271
SHORT print_level
print level in AMG preconditioner
Definition: fasp_block.h:277
SHORT coarsening_type
coarsening type
Definition: fasp_block.h:304
SHORT nl_amli_krylov_type
type of krylov method used by Nonlinear AMLI cycle
Definition: fasp_block.h:325
SHORT coarse_scaling
switch of scaling of the coarse grid correction
Definition: fasp_block.h:313
REAL * amli_coef
coefficients of the polynomial used by AMLI cycle
Definition: fasp_block.h:319
SHORT AMG_type
type of AMG method
Definition: fasp_block.h:274
REAL tol
tolerance for AMG preconditioner
Definition: fasp_block.h:286
SHORT coarse_solver
coarse solver type for AMG
Definition: fasp_block.h:310
REAL relaxation
relaxation parameter for SOR smoother
Definition: fasp_block.h:307
SHORT smoother
AMG smoother type.
Definition: fasp_block.h:292
SHORT cycle_type
AMG cycle type.
Definition: fasp_block.h:289
SHORT amli_degree
degree of the polynomial used by AMLI cycle
Definition: fasp_block.h:316
REAL tentative_smooth
smooth factor for smoothing the tentative prolongation
Definition: fasp_block.h:322
SHORT postsmooth_iter
number of postsmoothing
Definition: fasp_block.h:301
AMG_data_bsr * mgl_data
AMG preconditioner data.
Definition: fasp_block.h:328
INT max_levels
max number of AMG levels
Definition: fasp_block.h:283
SHORT presmooth_iter
number of presmoothing
Definition: fasp_block.h:298
INT maxit
max number of iterations of AMG preconditioner
Definition: fasp_block.h:280
SHORT smooth_order
AMG smoother ordering.
Definition: fasp_block.h:295
Data for preconditioners.
Definition: fasp.h:894
SHORT print_level
print level in AMG preconditioner
Definition: fasp.h:900
SHORT polynomial_degree
degree of the polynomial smoother
Definition: fasp.h:930
SHORT coarsening_type
switch of scaling of the coarse grid correction
Definition: fasp.h:933
SHORT nl_amli_krylov_type
type of Krylov method used by Nonlinear AMLI cycle
Definition: fasp.h:945
SHORT coarse_scaling
switch of scaling of the coarse grid correction
Definition: fasp.h:939
AMG_data * mgl_data
AMG preconditioner data.
Definition: fasp.h:954
REAL * amli_coef
coefficients of the polynomial used by AMLI cycle
Definition: fasp.h:951
SHORT AMG_type
type of AMG method
Definition: fasp.h:897
REAL tol
tolerance for AMG preconditioner
Definition: fasp.h:909
SHORT coarse_solver
coarse solver type for AMG
Definition: fasp.h:936
REAL relaxation
relaxation parameter for SOR smoother
Definition: fasp.h:927
SHORT smoother
AMG smoother type.
Definition: fasp.h:915
SHORT cycle_type
AMG cycle type.
Definition: fasp.h:912
SHORT amli_degree
degree of the polynomial used by AMLI cycle
Definition: fasp.h:942
REAL tentative_smooth
smooth factor for smoothing the tentative prolongation
Definition: fasp.h:948
SHORT postsmooth_iter
number of postsmoothing
Definition: fasp.h:924
SHORT max_levels
max number of AMG levels
Definition: fasp.h:906
SHORT presmooth_iter
number of presmoothing
Definition: fasp.h:921
INT maxit
max number of iterations of AMG preconditioner
Definition: fasp.h:903
SHORT smooth_order
AMG smoother ordering.
Definition: fasp.h:918