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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3352 - (show annotations)
Tue Nov 16 03:58:09 2010 UTC (8 years, 11 months ago) by gross
File MIME type: text/plain
File size: 7540 byte(s)
exposure of AMG options
1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2010 by University of Queensland
5 * 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
14
15 /**************************************************************/
16
17 /* Paso: solver options */
18
19 /**************************************************************/
20
21 /* Copyrights by ACcESS Australia, 2003,2004 */
22 /* author: l.gross@uq.edu.au */
23
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 options->verbose=FALSE;
35 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 options->absolute_tolerance=0.;
41 options->inner_tolerance=0.9;
42 options->adapt_inner_tolerance=TRUE;
43 options->preconditioner=PASO_JACOBI;
44 options->iter_max=10000;
45 options->inner_iter_max=10;
46 options->drop_tolerance=0.01;
47 options->drop_storage=2.;
48 options->restart=-1;
49 options->truncation=20;
50 options->sweeps=2;
51 options->pre_sweeps=2;
52 options->post_sweeps=2;
53 options->coarsening_threshold=0.25;
54 options->min_coarse_matrix_size=500;
55 options->level_max=100;
56 options->accept_failed_convergence=FALSE;
57 options->coarsening_method=PASO_DEFAULT;
58 options->relaxation_factor=0.95;
59 options->smoother=PASO_GS;
60 options->use_local_preconditioner=FALSE;
61 options->min_coarse_sparsity=0.05;
62 options->refinements=2;
63 options->coarse_matrix_refinements=0;
64 options->diagonal_dominance_threshold=0.5;
65 options->usePanel=TRUE;
66 options->useDirectInterpolation=FALSE;
67
68
69 /* diagnostic values */
70 options->num_iter=-1;
71 options->num_level=-1;
72 options->num_inner_iter=-1;
73 options->time=-1.;
74 options->set_up_time=-1.;
75 options->coarsening_selection_time=-1.;
76 options->coarsening_matrix_time=-1;
77 options->net_time=-1.;
78 options->residual_norm=-1.;
79 options->converged=FALSE;
80 options->preconditioner_size=-1.;
81 options->time_step_backtracking_used=FALSE;
82 }
83 void Paso_Options_showDiagnostics(const Paso_Options* options) {
84 printf("Paso diagonsitics:\n");
85 printf("\tnum_iter = %d\n",options->num_iter);
86 printf("\tnum_level = %d\n",options->num_level);
87 printf("\tnum_inner_iter = %d\n",options->num_inner_iter);
88 printf("\ttime = %e\n",options->time);
89 printf("\tset_up_time = %e\n",options->set_up_time);
90 printf("\tcoarsening_selection_time = %e\n",options->coarsening_selection_time);
91 printf("\tscoarsening_matrix_time = %e\n",options->coarsening_matrix_time);
92 printf("\tnet_time = %e\n",options->net_time);
93 printf("\tresidual_norm = %e\n",options->residual_norm);
94 printf("\tconverged = %d\n",options->converged);
95 printf("\tpreconditioner_size = %e Mbytes\n", options->preconditioner_size);
96 printf("\ttime_step_backtracking_used = %d\n", options->time_step_backtracking_used);
97 }
98 const char* Paso_Options_name(const index_t key){
99 switch (key) {
100 case PASO_DEFAULT:
101 return "DEFAULT";
102 case PASO_DIRECT:
103 return "DIRECT";
104 case PASO_CHOLEVSKY:
105 return "CHOLEVSKY";
106 case PASO_PCG:
107 return "PCG";
108 case PASO_CR:
109 return "CR";
110 case PASO_CGS:
111 return "CGS";
112 case PASO_BICGSTAB:
113 return "BICGSTAB";
114 case PASO_ILU0:
115 return "ILU0";
116 case PASO_ILUT:
117 return "ILUT";
118 case PASO_JACOBI:
119 return "JACOBI";
120 case PASO_GMRES:
121 return "GMRES";
122 case PASO_PRES20:
123 return "PRES20";
124 case PASO_LUMPING:
125 return "LUMPING";
126 case PASO_NO_REORDERING:
127 return "NO_REORDERING";
128 case PASO_MINIMUM_FILL_IN:
129 return "MINIMUM_FILL_IN";
130 case PASO_NESTED_DISSECTION:
131 return "NESTED_DISSECTION";
132 case PASO_MKL:
133 return "MKL";
134 case PASO_UMFPACK:
135 return "UMFPACK";
136 case PASO_ITERATIVE:
137 return "ITERATIVE";
138 case PASO_PASO:
139 return "PASO";
140 case PASO_AMG:
141 return "AMG";
142 case PASO_AMLI:
143 return "AMLI";
144 case PASO_REC_ILU:
145 return "REC_ILU";
146 case PASO_TRILINOS:
147 return "TRILINOS";
148 case PASO_NONLINEAR_GMRES:
149 return "NONLINEAR_GMRES";
150 case PASO_TFQMR :
151 return "TFQMR";
152 case PASO_MINRES:
153 return "MINRES";
154 case PASO_GAUSS_SEIDEL:
155 return "GAUSS_SEIDEL";
156 case PASO_RILU:
157 return "RILU";
158 case PASO_DEFAULT_REORDERING:
159 return "DEFAULT_REORDERING";
160 case PASO_SUPER_LU:
161 return "SUPER_LU";
162 case PASO_PASTIX:
163 return "PASTIX";
164 case PASO_YAIR_SHAPIRA_COARSENING:
165 return "YAIR_SHAPIRA_COARSENING";
166 case PASO_RUGE_STUEBEN_COARSENING:
167 return "RUGE_STUEBEN_COARSENING";
168 case PASO_AGGREGATION_COARSENING:
169 return "AGGREGATION_COARSENING";
170 case PASO_STANDARD_COARSENING:
171 return "STANDARD_COARSENING";
172 case PASO_NO_PRECONDITIONER:
173 return "NO_PRECONDITIONER";
174 default:
175 return "<unknown>";
176 }
177 }
178 void Paso_Options_show(const Paso_Options* options ) {
179 printf("Paso options settings:\n");
180 printf("\tverbose = %d\n",options->verbose);
181 printf("\tmethod = %s (%d)\n",Paso_Options_name(options->method),options->method);
182 printf("\tpackage = %s (%d)\n",Paso_Options_name(options->package),options->package);
183 printf("\tsymmetric = %d\n",options->symmetric);
184 printf("\treordering = %s (%d)\n",Paso_Options_name(options->reordering),options->reordering);
185 printf("\ttolerance = %e\n",options->tolerance);
186 printf("\tabsolute_tolerance = %e\n",options->absolute_tolerance);
187 printf("\tinner_tolerance = %e\n",options->inner_tolerance);
188 printf("\tadapt_inner_tolerance = %d\n",options->adapt_inner_tolerance);
189 printf("\tpreconditioner = %s (%d)\n",Paso_Options_name(options->preconditioner),options->preconditioner);
190 printf("\titer_max = %d\n",options->iter_max);
191 printf("\tinner_iter_max = %d\n",options->inner_iter_max);
192 printf("\tdrop_tolerance = %e\n",options->drop_tolerance);
193 printf("\tdrop_storage = %e\n",options->drop_storage);
194 printf("\trestart = %d\n",options->restart);
195 printf("\ttruncation = %d\n",options->truncation);
196 printf("\tsweeps = %d\n",options->sweeps);
197 printf("\tpre_sweeps = %d\n",options->pre_sweeps);
198 printf("\tpost_sweeps = %d\n",options->post_sweeps);
199 printf("\tcoarsening_threshold = %e\n",options->coarsening_threshold);
200 printf("\tlevel_max = %d\n",options->level_max);
201 printf("\taccept_failed_convergence = %d\n",options->accept_failed_convergence);
202 printf("\tcoarsening_method = %s (%d)\n",Paso_Options_name(options->coarsening_method), options->coarsening_method);
203 printf("\trelaxation_factor = %e\n",options->relaxation_factor);
204 printf("\tuse_local_preconditioner = %d\n",options->use_local_preconditioner);
205 printf("\tmin_coarse_sparsity = %e\n",options->min_coarse_sparsity);
206 printf("\trefinements = %d\n",options->refinements);
207 printf("\tcoarse_matrix_refinements = %d\n",options->coarse_matrix_refinements);
208
209 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26