/[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 2548 - (show annotations)
Mon Jul 20 06:20:06 2009 UTC (10 years, 3 months ago) by jfenwick
File MIME type: text/plain
File size: 6395 byte(s)
Updating copyright notices
1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2009 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: gross@access.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.05;
54 options->min_coarse_matrix_size=500;
55 options->level_max=5;
56 options->accept_failed_convergence=FALSE;
57 options->coarsening_method=PASO_DEFAULT;
58 options->relaxation_factor=0.95;
59
60 /* diagnostic values */
61 options->num_iter=-1;
62 options->num_level=-1;
63 options->num_inner_iter=-1;
64 options->time=-1.;
65 options->set_up_time=-1.;
66 options->residual_norm=-1.;
67 options->converged=FALSE;
68 }
69 void Paso_Options_showDiagnostics(const Paso_Options* options) {
70 printf("Paso diagonsitics:\n");
71 printf("\tnum_iter = %d\n",options->num_iter);
72 printf("\tnum_level = %d\n",options->num_level);
73 printf("\tnum_inner_iter = %d\n",options->num_inner_iter);
74 printf("\ttime = %e\n",options->time);
75 printf("\tset_up_time = %e\n",options->set_up_time);
76 printf("\tresidual_norm = %e\n",options->residual_norm);
77 printf("\tconverged = %d\n",options->converged);
78 }
79 const char* Paso_Options_name(const index_t key){
80 switch (key) {
81 case PASO_DEFAULT:
82 return "DEFAULT";
83 case PASO_DIRECT:
84 return "DIRECT";
85 case PASO_CHOLEVSKY:
86 return "CHOLEVSKY";
87 case PASO_PCG:
88 return "PCG";
89 case PASO_CR:
90 return "CR";
91 case PASO_CGS:
92 return "CGS";
93 case PASO_BICGSTAB:
94 return "BICGSTAB";
95 case PASO_SSOR:
96 return "SSOR";
97 case PASO_ILU0:
98 return "ILU0";
99 case PASO_ILUT:
100 return "ILUT";
101 case PASO_JACOBI:
102 return "JACOBI";
103 case PASO_GMRES:
104 return "GMRES";
105 case PASO_PRES20:
106 return "PRES20";
107 case PASO_LUMPING:
108 return "LUMPING";
109 case PASO_NO_REORDERING:
110 return "NO_REORDERING";
111 case PASO_MINIMUM_FILL_IN:
112 return "MINIMUM_FILL_IN";
113 case PASO_NESTED_DISSECTION:
114 return "NESTED_DISSECTION";
115 case PASO_MKL:
116 return "MKL";
117 case PASO_UMFPACK:
118 return "UMFPACK";
119 case PASO_ITERATIVE:
120 return "ITERATIVE";
121 case PASO_PASO:
122 return "PASO";
123 case PASO_AMG:
124 return "AMG";
125 case PASO_REC_ILU:
126 return "REC_ILU";
127 case PASO_TRILINOS:
128 return "TRILINOS";
129 case PASO_NONLINEAR_GMRES:
130 return "NONLINEAR_GMRES";
131 case PASO_TFQMR :
132 return "TFQMR";
133 case PASO_MINRES:
134 return "MINRES";
135 case PASO_GAUSS_SEIDEL:
136 return "GAUSS_SEIDEL";
137 case PASO_RILU:
138 return "RILU";
139 case PASO_DEFAULT_REORDERING:
140 return "DEFAULT_REORDERING";
141 case PASO_SUPER_LU:
142 return "SUPER_LU";
143 case PASO_PASTIX:
144 return "PASTIX";
145 case PASO_YAIR_SHAPIRA_COARSENING:
146 return "YAIR_SHAPIRA_COARSENING";
147 case PASO_RUGE_STUEBEN_COARSENING:
148 return "RUGE_STUEBEN_COARSENING";
149 case PASO_AGGREGATION_COARSENING:
150 return "AGGREGATION_COARSENING";
151 case PASO_NO_PRECONDITIONER:
152 return "NO_PRECONDITIONER";
153 case PASO_MIN_COARSE_MATRIX_SIZE:
154 return "MIN_COARSE_MATRIX_SIZE";
155 default:
156 return "<unknown>";
157 }
158 }
159 void Paso_Options_show(const Paso_Options* options ) {
160 printf("Paso options settings:\n");
161 printf("\tverbose = %d\n",options->verbose);
162 printf("\tmethod = %s (%d)\n",Paso_Options_name(options->method),options->method);
163 printf("\tpackage = %s (%d)\n",Paso_Options_name(options->package),options->package);
164 printf("\tsymmetric = %d\n",options->symmetric);
165 printf("\treordering = %s (%d)\n",Paso_Options_name(options->reordering),options->reordering);
166 printf("\ttolerance = %e\n",options->tolerance);
167 printf("\tabsolute_tolerance = %e\n",options->absolute_tolerance);
168 printf("\tinner_tolerance = %e\n",options->inner_tolerance);
169 printf("\tadapt_inner_tolerance = %d\n",options->adapt_inner_tolerance);
170 printf("\tpreconditioner = %s (%d)\n",Paso_Options_name(options->preconditioner),options->preconditioner);
171 printf("\titer_max = %d\n",options->iter_max);
172 printf("\tinner_iter_max = %d\n",options->inner_iter_max);
173 printf("\tdrop_tolerance = %e\n",options->drop_tolerance);
174 printf("\tdrop_storage = %e\n",options->drop_storage);
175 printf("\trestart = %d\n",options->restart);
176 printf("\ttruncation = %d\n",options->truncation);
177 printf("\tsweeps = %d\n",options->sweeps);
178 printf("\tpre_sweeps = %d\n",options->pre_sweeps);
179 printf("\tpost_sweeps = %d\n",options->post_sweeps);
180 printf("\tcoarsening_threshold = %e\n",options->coarsening_threshold);
181 printf("\tlevel_max = %d\n",options->level_max);
182 printf("\taccept_failed_convergence = %d\n",options->accept_failed_convergence);
183 printf("\tcoarsening_method = %s (%d)\n",Paso_Options_name(options->coarsening_method), options->coarsening_method);
184 printf("\trelaxation_factor = %e\n",options->relaxation_factor);
185 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26