escript  Revision_
Options.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2020 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-2017 by Centre for Geoscience Computing (GeoComp)
14 * Development from 2019 by School of Earth and Environmental Sciences
15 **
16 *****************************************************************************/
17 
18 
19 /****************************************************************************/
20 
21 /* Paso: Options */
22 
23 /****************************************************************************/
24 
25 /* Copyrights by ACcESS Australia 2003,2004,2005 */
26 /* Author: Lutz Gross, l.gross@uq.edu.au */
27 
28 /****************************************************************************/
29 
30 #ifndef __PASO_OPTIONS_H__
31 #define __PASO_OPTIONS_H__
32 
33 #include "Paso.h"
34 
35 #include <boost/python/object.hpp>
36 
37 // valid solver options
38 #define PASO_DEFAULT 0
39 #define PASO_DIRECT 1
40 #define PASO_CHOLEVSKY 2
41 #define PASO_PCG 3
42 #define PASO_CR 4
43 #define PASO_CGS 5
44 #define PASO_BICGSTAB 6
45 #define PASO_ILU0 8
46 #define PASO_ILUT 9
47 #define PASO_JACOBI 10
48 #define PASO_GMRES 11
49 #define PASO_PRES20 12
50 #define PASO_MKL 15
51 #define PASO_UMFPACK 16
52 #define PASO_NO_REORDERING 17
53 #define PASO_MINIMUM_FILL_IN 18
54 #define PASO_NESTED_DISSECTION 19
55 #define PASO_ITERATIVE 20
56 #define PASO_PASO 21
57 #define PASO_MUMPS 22
58 #define PASO_REC_ILU 23
59 #define PASO_TRILINOS 24
60 #define PASO_NONLINEAR_GMRES 25
61 #define PASO_TFQMR 26
62 #define PASO_MINRES 27
63 #define PASO_GAUSS_SEIDEL 28
64 #define PASO_GS PASO_GAUSS_SEIDEL
65 #define PASO_RILU 29
66 #define PASO_DEFAULT_REORDERING 30
67 #define PASO_NO_PRECONDITIONER 36
68 #define PASO_CLASSIC_INTERPOLATION_WITH_FF_COUPLING 50
69 #define PASO_CLASSIC_INTERPOLATION 51
70 #define PASO_DIRECT_INTERPOLATION 52
71 #define PASO_LINEAR_CRANK_NICOLSON 66
72 #define PASO_CRANK_NICOLSON 67
73 #define PASO_BACKWARD_EULER 68
74 
75 #define PASO_SMOOTHER 99999999
76 
77 namespace paso {
78 
80 {
81  Options() { setDefaults(); }
82 
84  Options(const boost::python::object& options);
85 
87  void setDefaults();
88 
90  void show() const;
91 
93  void showDiagnostics() const;
94 
96  void updateEscriptDiagnostics(boost::python::object& options) const;
97 
99  static int mapEscriptOption(int escriptOption);
100 
101  static const char* name(int key);
102 
103  static int getPackage(int solver, int package, bool symmetry,
104  const escript::JMPI& mpi_info);
105 
107  static int getSolver(int solver, int package, bool symmetry,
108  const escript::JMPI& mpi_info);
109 
110  int method;
111  int package;
112  bool symmetric;
113  bool hermitian;
114  double tolerance;
118  bool verbose;
124  double drop_storage;
127  int sweeps;
133 
134  // diagnostic values
138  double time;
139  double set_up_time;
142  double net_time;
144  bool converged;
145  double preconditioner_size; // in Mbytes
149 };
150 
151 } // namespace paso
152 
153 #endif // __PASO_OPTIONS_H__
154 
index_t dim_t
Definition: DataTypes.h:66
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:61
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:74
Definition: BiCGStab.cpp:25
#define PASO_DLL_API
Definition: paso/src/system_dep.h:29
Definition: Options.h:80
double absolute_tolerance
Definition: Options.h:115
dim_t inner_iter_max
Definition: Options.h:122
bool reordering
Definition: Options.h:119
dim_t num_iter
Definition: Options.h:135
dim_t num_inner_iter
Definition: Options.h:137
double coarsening_matrix_time
Definition: Options.h:141
Options()
Definition: Options.h:81
dim_t iter_max
Definition: Options.h:121
double relaxation_factor
Definition: Options.h:129
bool converged
Definition: Options.h:144
bool adapt_inner_tolerance
Definition: Options.h:117
double drop_tolerance
Definition: Options.h:123
bool verbose
Definition: Options.h:118
bool time_step_backtracking_used
Definition: Options.h:146
int preconditioner
Definition: Options.h:120
double set_up_time
Definition: Options.h:139
bool accept_failed_convergence
Definition: Options.h:128
double residual_norm
Definition: Options.h:143
int package
Definition: Options.h:111
double preconditioner_size
Definition: Options.h:145
double net_time
Definition: Options.h:142
index_t truncation
Definition: Options.h:125
double inner_tolerance
Definition: Options.h:116
double drop_storage
Definition: Options.h:124
double time
Definition: Options.h:138
double tolerance
Definition: Options.h:114
int method
Definition: Options.h:110
int sweeps
Definition: Options.h:127
dim_t refinements
Definition: Options.h:131
dim_t num_coarse_unknowns
Definition: Options.h:148
int ode_solver
Definition: Options.h:132
double coarse_level_sparsity
Definition: Options.h:147
bool use_local_preconditioner
Definition: Options.h:130
bool symmetric
Definition: Options.h:112
Options(const boost::python::object &options)
constructor that fills values from an escript SolverBuddy instance
dim_t num_level
Definition: Options.h:136
double coarsening_selection_time
Definition: Options.h:140
index_t restart
Definition: Options.h:126
bool hermitian
Definition: Options.h:113