/[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 3283 - (show annotations)
Mon Oct 18 22:39:28 2010 UTC (10 years, 4 months ago) by gross
File MIME type: text/plain
File size: 7473 byte(s)
AMG reengineered, BUG is Smoother fixed.


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
66
67 /* diagnostic values */
68 options->num_iter=-1;
69 options->num_level=-1;
70 options->num_inner_iter=-1;
71 options->time=-1.;
72 options->set_up_time=-1.;
73 options->coarsening_selection_time=-1.;
74 options->coarsening_matrix_time=-1;
75 options->net_time=-1.;
76 options->residual_norm=-1.;
77 options->converged=FALSE;
78 options->preconditioner_size=-1.;
79 options->time_step_backtracking_used=FALSE;
80 }
81 void Paso_Options_showDiagnostics(const Paso_Options* options) {
82 printf("Paso diagonsitics:\n");
83 printf("\tnum_iter = %d\n",options->num_iter);
84 printf("\tnum_level = %d\n",options->num_level);
85 printf("\tnum_inner_iter = %d\n",options->num_inner_iter);
86 printf("\ttime = %e\n",options->time);
87 printf("\tset_up_time = %e\n",options->set_up_time);
88 printf("\tcoarsening_selection_time = %e\n",options->coarsening_selection_time);
89 printf("\tscoarsening_matrix_time = %e\n",options->coarsening_matrix_time);
90 printf("\tnet_time = %e\n",options->net_time);
91 printf("\tresidual_norm = %e\n",options->residual_norm);
92 printf("\tconverged = %d\n",options->converged);
93 printf("\tpreconditioner_size = %e Mbytes\n", options->preconditioner_size);
94 printf("\ttime_step_backtracking_used = %d\n", options->time_step_backtracking_used);
95 }
96 const char* Paso_Options_name(const index_t key){
97 switch (key) {
98 case PASO_DEFAULT:
99 return "DEFAULT";
100 case PASO_DIRECT:
101 return "DIRECT";
102 case PASO_CHOLEVSKY:
103 return "CHOLEVSKY";
104 case PASO_PCG:
105 return "PCG";
106 case PASO_CR:
107 return "CR";
108 case PASO_CGS:
109 return "CGS";
110 case PASO_BICGSTAB:
111 return "BICGSTAB";
112 case PASO_ILU0:
113 return "ILU0";
114 case PASO_ILUT:
115 return "ILUT";
116 case PASO_JACOBI:
117 return "JACOBI";
118 case PASO_GMRES:
119 return "GMRES";
120 case PASO_PRES20:
121 return "PRES20";
122 case PASO_LUMPING:
123 return "LUMPING";
124 case PASO_NO_REORDERING:
125 return "NO_REORDERING";
126 case PASO_MINIMUM_FILL_IN:
127 return "MINIMUM_FILL_IN";
128 case PASO_NESTED_DISSECTION:
129 return "NESTED_DISSECTION";
130 case PASO_MKL:
131 return "MKL";
132 case PASO_UMFPACK:
133 return "UMFPACK";
134 case PASO_ITERATIVE:
135 return "ITERATIVE";
136 case PASO_PASO:
137 return "PASO";
138 case PASO_AMG:
139 return "AMG";
140 case PASO_AMLI:
141 return "AMLI";
142 case PASO_REC_ILU:
143 return "REC_ILU";
144 case PASO_TRILINOS:
145 return "TRILINOS";
146 case PASO_NONLINEAR_GMRES:
147 return "NONLINEAR_GMRES";
148 case PASO_TFQMR :
149 return "TFQMR";
150 case PASO_MINRES:
151 return "MINRES";
152 case PASO_GAUSS_SEIDEL:
153 return "GAUSS_SEIDEL";
154 case PASO_RILU:
155 return "RILU";
156 case PASO_DEFAULT_REORDERING:
157 return "DEFAULT_REORDERING";
158 case PASO_SUPER_LU:
159 return "SUPER_LU";
160 case PASO_PASTIX:
161 return "PASTIX";
162 case PASO_YAIR_SHAPIRA_COARSENING:
163 return "YAIR_SHAPIRA_COARSENING";
164 case PASO_RUGE_STUEBEN_COARSENING:
165 return "RUGE_STUEBEN_COARSENING";
166 case PASO_AGGREGATION_COARSENING:
167 return "AGGREGATION_COARSENING";
168 case PASO_STANDARD_COARSENING:
169 return "STANDARD_COARSENING";
170 case PASO_NO_PRECONDITIONER:
171 return "NO_PRECONDITIONER";
172 default:
173 return "<unknown>";
174 }
175 }
176 void Paso_Options_show(const Paso_Options* options ) {
177 printf("Paso options settings:\n");
178 printf("\tverbose = %d\n",options->verbose);
179 printf("\tmethod = %s (%d)\n",Paso_Options_name(options->method),options->method);
180 printf("\tpackage = %s (%d)\n",Paso_Options_name(options->package),options->package);
181 printf("\tsymmetric = %d\n",options->symmetric);
182 printf("\treordering = %s (%d)\n",Paso_Options_name(options->reordering),options->reordering);
183 printf("\ttolerance = %e\n",options->tolerance);
184 printf("\tabsolute_tolerance = %e\n",options->absolute_tolerance);
185 printf("\tinner_tolerance = %e\n",options->inner_tolerance);
186 printf("\tadapt_inner_tolerance = %d\n",options->adapt_inner_tolerance);
187 printf("\tpreconditioner = %s (%d)\n",Paso_Options_name(options->preconditioner),options->preconditioner);
188 printf("\titer_max = %d\n",options->iter_max);
189 printf("\tinner_iter_max = %d\n",options->inner_iter_max);
190 printf("\tdrop_tolerance = %e\n",options->drop_tolerance);
191 printf("\tdrop_storage = %e\n",options->drop_storage);
192 printf("\trestart = %d\n",options->restart);
193 printf("\ttruncation = %d\n",options->truncation);
194 printf("\tsweeps = %d\n",options->sweeps);
195 printf("\tpre_sweeps = %d\n",options->pre_sweeps);
196 printf("\tpost_sweeps = %d\n",options->post_sweeps);
197 printf("\tcoarsening_threshold = %e\n",options->coarsening_threshold);
198 printf("\tlevel_max = %d\n",options->level_max);
199 printf("\taccept_failed_convergence = %d\n",options->accept_failed_convergence);
200 printf("\tcoarsening_method = %s (%d)\n",Paso_Options_name(options->coarsening_method), options->coarsening_method);
201 printf("\trelaxation_factor = %e\n",options->relaxation_factor);
202 printf("\tuse_local_preconditioner = %d\n",options->use_local_preconditioner);
203 printf("\tmin_coarse_sparsity = %e\n",options->min_coarse_sparsity);
204 printf("\trefinements = %d\n",options->refinements);
205 printf("\tcoarse_matrix_refinements = %d\n",options->coarse_matrix_refinements);
206
207 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26