/[escript]/trunk/paso/src/Options_setDefaults.c
ViewVC logotype

Annotation of /trunk/paso/src/Options_setDefaults.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3642 - (hide annotations)
Thu Oct 27 03:41:51 2011 UTC (7 years, 6 months ago) by caltinay
File MIME type: text/plain
File size: 8105 byte(s)
Assorted spelling/comment fixes in paso.

1 ksteube 1312
2     /*******************************************************
3 ksteube 1811 *
4 jfenwick 2881 * Copyright (c) 2003-2010 by University of Queensland
5 ksteube 1811 * Earth Systems Science Computational Center (ESSCC)
6     * http://www.uq.edu.au/esscc
7     *
8     * Primary Business: Queensland, Australia
9     * Licensed under the Open Software License version 3.0
10     * http://www.opensource.org/licenses/osl-3.0.php
11     *
12     *******************************************************/
13 dhawcroft 631
14 ksteube 1811
15 jgs 150 /**************************************************************/
16    
17     /* Paso: solver options */
18    
19     /**************************************************************/
20    
21     /* Copyrights by ACcESS Australia, 2003,2004 */
22 jfenwick 2625 /* author: l.gross@uq.edu.au */
23 jgs 150
24     /**************************************************************/
25    
26     #include "Paso.h"
27     #include "Options.h"
28    
29     /**************************************************************/
30    
31     /* set the default values for solver options */
32    
33     void Paso_Options_setDefaults(Paso_Options* options) {
34 gross 2474 options->verbose=FALSE;
35 jgs 150 options->method=PASO_DEFAULT;
36     options->package=PASO_DEFAULT;
37     options->symmetric=FALSE;
38     options->reordering=PASO_NO_REORDERING;
39     options->tolerance=1.E-8;
40 gross 1476 options->absolute_tolerance=0.;
41     options->inner_tolerance=0.9;
42     options->adapt_inner_tolerance=TRUE;
43 jgs 150 options->preconditioner=PASO_JACOBI;
44 jgs 154 options->iter_max=10000;
45 gross 2988 options->inner_iter_max=10;
46 jgs 150 options->drop_tolerance=0.01;
47     options->drop_storage=2.;
48     options->restart=-1;
49     options->truncation=20;
50 artak 1843 options->sweeps=2;
51 gross 2446 options->pre_sweeps=2;
52     options->post_sweeps=2;
53 artak 2686 options->coarsening_threshold=0.25;
54 artak 2524 options->min_coarse_matrix_size=500;
55 gross 3283 options->level_max=100;
56 gross 2474 options->accept_failed_convergence=FALSE;
57     options->coarsening_method=PASO_DEFAULT;
58     options->relaxation_factor=0.95;
59 artak 2828 options->smoother=PASO_GS;
60 gross 3094 options->use_local_preconditioner=FALSE;
61 gross 3283 options->min_coarse_sparsity=0.05;
62     options->refinements=2;
63     options->coarse_matrix_refinements=0;
64     options->diagonal_dominance_threshold=0.5;
65 lgao 3508 options->cycle_type=1;
66 gross 3352 options->usePanel=TRUE;
67 gross 3440 options->interpolation_method=PASO_DIRECT_INTERPOLATION;
68 gross 3283
69 gross 2446
70     /* diagnostic values */
71 gross 2474 options->num_iter=-1;
72     options->num_level=-1;
73     options->num_inner_iter=-1;
74     options->time=-1.;
75     options->set_up_time=-1.;
76 gross 3283 options->coarsening_selection_time=-1.;
77     options->coarsening_matrix_time=-1;
78 lgao 2596 options->net_time=-1.;
79 gross 2474 options->residual_norm=-1.;
80     options->converged=FALSE;
81 gross 3094 options->preconditioner_size=-1.;
82 gross 3111 options->time_step_backtracking_used=FALSE;
83 gross 3402 options->coarse_level_sparsity=-1.;
84     options->num_coarse_unknowns=-1;
85 jgs 150 }
86 caltinay 3642
87 gross 2474 void Paso_Options_showDiagnostics(const Paso_Options* options) {
88 caltinay 3642 printf("Paso diagnostics:\n");
89 gross 2474 printf("\tnum_iter = %d\n",options->num_iter);
90     printf("\tnum_level = %d\n",options->num_level);
91     printf("\tnum_inner_iter = %d\n",options->num_inner_iter);
92     printf("\ttime = %e\n",options->time);
93     printf("\tset_up_time = %e\n",options->set_up_time);
94 gross 3283 printf("\tcoarsening_selection_time = %e\n",options->coarsening_selection_time);
95 caltinay 3642 printf("\tcoarsening_matrix_time = %e\n",options->coarsening_matrix_time);
96 gross 3283 printf("\tnet_time = %e\n",options->net_time);
97 gross 2474 printf("\tresidual_norm = %e\n",options->residual_norm);
98     printf("\tconverged = %d\n",options->converged);
99 gross 3094 printf("\tpreconditioner_size = %e Mbytes\n", options->preconditioner_size);
100 gross 3111 printf("\ttime_step_backtracking_used = %d\n", options->time_step_backtracking_used);
101 gross 2474 }
102     const char* Paso_Options_name(const index_t key){
103     switch (key) {
104     case PASO_DEFAULT:
105     return "DEFAULT";
106     case PASO_DIRECT:
107     return "DIRECT";
108     case PASO_CHOLEVSKY:
109     return "CHOLEVSKY";
110     case PASO_PCG:
111     return "PCG";
112     case PASO_CR:
113     return "CR";
114     case PASO_CGS:
115     return "CGS";
116     case PASO_BICGSTAB:
117     return "BICGSTAB";
118     case PASO_ILU0:
119     return "ILU0";
120     case PASO_ILUT:
121     return "ILUT";
122     case PASO_JACOBI:
123     return "JACOBI";
124     case PASO_GMRES:
125     return "GMRES";
126     case PASO_PRES20:
127     return "PRES20";
128     case PASO_LUMPING:
129     return "LUMPING";
130     case PASO_NO_REORDERING:
131     return "NO_REORDERING";
132     case PASO_MINIMUM_FILL_IN:
133     return "MINIMUM_FILL_IN";
134     case PASO_NESTED_DISSECTION:
135     return "NESTED_DISSECTION";
136     case PASO_MKL:
137     return "MKL";
138     case PASO_UMFPACK:
139     return "UMFPACK";
140 lgao 3508 case PASO_BOOMERAMG:
141     return "BOOMERAMG";
142 gross 2474 case PASO_ITERATIVE:
143     return "ITERATIVE";
144     case PASO_PASO:
145     return "PASO";
146     case PASO_AMG:
147     return "AMG";
148 artak 2760 case PASO_AMLI:
149     return "AMLI";
150 gross 2474 case PASO_REC_ILU:
151     return "REC_ILU";
152     case PASO_TRILINOS:
153     return "TRILINOS";
154     case PASO_NONLINEAR_GMRES:
155     return "NONLINEAR_GMRES";
156     case PASO_TFQMR :
157     return "TFQMR";
158     case PASO_MINRES:
159     return "MINRES";
160     case PASO_GAUSS_SEIDEL:
161     return "GAUSS_SEIDEL";
162     case PASO_RILU:
163     return "RILU";
164     case PASO_DEFAULT_REORDERING:
165     return "DEFAULT_REORDERING";
166     case PASO_SUPER_LU:
167     return "SUPER_LU";
168     case PASO_PASTIX:
169     return "PASTIX";
170     case PASO_YAIR_SHAPIRA_COARSENING:
171     return "YAIR_SHAPIRA_COARSENING";
172     case PASO_RUGE_STUEBEN_COARSENING:
173     return "RUGE_STUEBEN_COARSENING";
174     case PASO_AGGREGATION_COARSENING:
175     return "AGGREGATION_COARSENING";
176 artak 2816 case PASO_STANDARD_COARSENING:
177     return "STANDARD_COARSENING";
178 gross 2474 case PASO_NO_PRECONDITIONER:
179     return "NO_PRECONDITIONER";
180 lgao 3508 case PASO_CIJP_FIXED_RANDOM_COARSENING:
181     return "CIJP_FIXED_RANDOM_COARSENING";
182     case PASO_CIJP_COARSENING:
183     return "CIJP_COARSENING";
184     case PASO_FALGOUT_COARSENING:
185     return "FALGOUT_COARSENING";
186     case PASO_PMIS_COARSENING:
187     return "PMIS_COARSENING";
188     case PASO_HMIS_COARSENING:
189     return "HMIS_COARSENING";
190 gross 2474 default:
191     return "<unknown>";
192     }
193     }
194     void Paso_Options_show(const Paso_Options* options ) {
195     printf("Paso options settings:\n");
196     printf("\tverbose = %d\n",options->verbose);
197     printf("\tmethod = %s (%d)\n",Paso_Options_name(options->method),options->method);
198     printf("\tpackage = %s (%d)\n",Paso_Options_name(options->package),options->package);
199     printf("\tsymmetric = %d\n",options->symmetric);
200     printf("\treordering = %s (%d)\n",Paso_Options_name(options->reordering),options->reordering);
201     printf("\ttolerance = %e\n",options->tolerance);
202     printf("\tabsolute_tolerance = %e\n",options->absolute_tolerance);
203     printf("\tinner_tolerance = %e\n",options->inner_tolerance);
204     printf("\tadapt_inner_tolerance = %d\n",options->adapt_inner_tolerance);
205     printf("\tpreconditioner = %s (%d)\n",Paso_Options_name(options->preconditioner),options->preconditioner);
206     printf("\titer_max = %d\n",options->iter_max);
207     printf("\tinner_iter_max = %d\n",options->inner_iter_max);
208     printf("\tdrop_tolerance = %e\n",options->drop_tolerance);
209     printf("\tdrop_storage = %e\n",options->drop_storage);
210     printf("\trestart = %d\n",options->restart);
211     printf("\ttruncation = %d\n",options->truncation);
212     printf("\tsweeps = %d\n",options->sweeps);
213     printf("\tpre_sweeps = %d\n",options->pre_sweeps);
214     printf("\tpost_sweeps = %d\n",options->post_sweeps);
215     printf("\tcoarsening_threshold = %e\n",options->coarsening_threshold);
216     printf("\tlevel_max = %d\n",options->level_max);
217     printf("\taccept_failed_convergence = %d\n",options->accept_failed_convergence);
218     printf("\tcoarsening_method = %s (%d)\n",Paso_Options_name(options->coarsening_method), options->coarsening_method);
219     printf("\trelaxation_factor = %e\n",options->relaxation_factor);
220 gross 3094 printf("\tuse_local_preconditioner = %d\n",options->use_local_preconditioner);
221 gross 3283 printf("\tmin_coarse_sparsity = %e\n",options->min_coarse_sparsity);
222     printf("\trefinements = %d\n",options->refinements);
223     printf("\tcoarse_matrix_refinements = %d\n",options->coarse_matrix_refinements);
224 lgao 3508 printf("\tcycle_type = %d\n",options->cycle_type);
225 gross 2474 }
226 caltinay 3642

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26