/[escript]/trunk/paso/src/Options.h
ViewVC logotype

Contents of /trunk/paso/src/Options.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6799 - (show annotations)
Mon Mar 25 05:53:58 2019 UTC (5 months, 3 weeks ago) by aellery
File MIME type: text/plain
File size: 4107 byte(s)
I have rewritten the solverbuddy. Briefly:

1. The remaining AMG code has been removed from PASO.
2. If Trilinos is available, escript will now use it by default.
3. eScript will use a direct solver by default, (if one is available,) when solving 2 dimensional problems and an iterative solver, by default, when solving 3 dimensional problems. This can be changed by a user by manually specifying which solver to use.
4. There is a new option available, setHermitian(), that allows a user to specify when a coefficient matrix is Hermitian.
5. Symmetry information is always passed onto the Trilinos solver when this information is relevant.
6. All tests have been updated, when relevant, to reflect these changes.
7. I fixed a couple of undocumented bugs.


1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2018 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16
17
18 /****************************************************************************/
19
20 /* Paso: Options */
21
22 /****************************************************************************/
23
24 /* Copyrights by ACcESS Australia 2003,2004,2005 */
25 /* Author: Lutz Gross, l.gross@uq.edu.au */
26
27 /****************************************************************************/
28
29 #ifndef __PASO_OPTIONS_H__
30 #define __PASO_OPTIONS_H__
31
32 #include "Paso.h"
33
34 #include <boost/python/object.hpp>
35
36 // valid solver options
37 #define PASO_DEFAULT 0
38 #define PASO_DIRECT 1
39 #define PASO_CHOLEVSKY 2
40 #define PASO_PCG 3
41 #define PASO_CR 4
42 #define PASO_CGS 5
43 #define PASO_BICGSTAB 6
44 #define PASO_ILU0 8
45 #define PASO_ILUT 9
46 #define PASO_JACOBI 10
47 #define PASO_GMRES 11
48 #define PASO_PRES20 12
49 #define PASO_MKL 15
50 #define PASO_UMFPACK 16
51 #define PASO_NO_REORDERING 17
52 #define PASO_MINIMUM_FILL_IN 18
53 #define PASO_NESTED_DISSECTION 19
54 #define PASO_ITERATIVE 20
55 #define PASO_PASO 21
56 #define PASO_REC_ILU 23
57 #define PASO_TRILINOS 24
58 #define PASO_NONLINEAR_GMRES 25
59 #define PASO_TFQMR 26
60 #define PASO_MINRES 27
61 #define PASO_GAUSS_SEIDEL 28
62 #define PASO_GS PASO_GAUSS_SEIDEL
63 #define PASO_RILU 29
64 #define PASO_DEFAULT_REORDERING 30
65 #define PASO_NO_PRECONDITIONER 36
66 #define PASO_CLASSIC_INTERPOLATION_WITH_FF_COUPLING 50
67 #define PASO_CLASSIC_INTERPOLATION 51
68 #define PASO_DIRECT_INTERPOLATION 52
69 #define PASO_LINEAR_CRANK_NICOLSON 66
70 #define PASO_CRANK_NICOLSON 67
71 #define PASO_BACKWARD_EULER 68
72
73 #define PASO_SMOOTHER 99999999
74
75 namespace paso {
76
77 struct Options
78 {
79 Options() { setDefaults(); }
80
81 /// constructor that fills values from an escript SolverBuddy instance
82 Options(const boost::python::object& options);
83
84 /// sets the default values for solver options
85 void setDefaults();
86
87 /// prints current option values
88 void show() const;
89
90 /// prints diagnostic data
91 void showDiagnostics() const;
92
93 /// updates SolverBuddy diagnostics from this
94 void updateEscriptDiagnostics(boost::python::object& options) const;
95
96 /// returns the corresponding paso option code for an escript option code
97 static int mapEscriptOption(int escriptOption);
98
99 static const char* name(int key);
100
101 static int getPackage(int solver, int package, bool symmetry,
102 const escript::JMPI& mpi_info);
103
104 /// returns the solver to be used with given combination
105 static int getSolver(int solver, int package, bool symmetry,
106 const escript::JMPI& mpi_info);
107
108 int method;
109 int package;
110 bool symmetric;
111 bool hermitian;
112 double tolerance;
113 double absolute_tolerance;
114 double inner_tolerance;
115 bool adapt_inner_tolerance;
116 bool verbose;
117 bool reordering;
118 int preconditioner;
119 dim_t iter_max;
120 dim_t inner_iter_max;
121 double drop_tolerance;
122 double drop_storage;
123 index_t truncation;
124 index_t restart;
125 int sweeps;
126 bool accept_failed_convergence;
127 double relaxation_factor;
128 bool use_local_preconditioner;
129 dim_t refinements;
130 int ode_solver;
131
132 // diagnostic values
133 dim_t num_iter;
134 dim_t num_level;
135 dim_t num_inner_iter;
136 double time;
137 double set_up_time;
138 double coarsening_selection_time;
139 double coarsening_matrix_time;
140 double net_time;
141 double residual_norm;
142 bool converged;
143 double preconditioner_size; // in Mbytes
144 bool time_step_backtracking_used;
145 double coarse_level_sparsity;
146 dim_t num_coarse_unknowns;
147 };
148
149 } // namespace paso
150
151 #endif // __PASO_OPTIONS_H__
152

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26