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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26