Options.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2020 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
* Development 2012-2013 by School of Earth Sciences
* Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
* Development from 2019 by School of Earth and Environmental Sciences
**
*****************************************************************************/
/****************************************************************************/
/* Paso: Options */
/****************************************************************************/
/* Copyrights by ACcESS Australia 2003,2004,2005 */
/* Author: Lutz Gross, l.gross@uq.edu.au */
/****************************************************************************/
#ifndef __PASO_OPTIONS_H__
#define __PASO_OPTIONS_H__
#include "Paso.h"
#include <boost/python/object.hpp>
// valid solver options
#define PASO_DEFAULT 0
#define PASO_DIRECT 1
#define PASO_CHOLEVSKY 2
#define PASO_PCG 3
#define PASO_CR 4
#define PASO_CGS 5
#define PASO_BICGSTAB 6
#define PASO_ILU0 8
#define PASO_ILUT 9
#define PASO_JACOBI 10
#define PASO_GMRES 11
#define PASO_PRES20 12
#define PASO_MKL 15
#define PASO_UMFPACK 16
#define PASO_NO_REORDERING 17
#define PASO_MINIMUM_FILL_IN 18
#define PASO_NESTED_DISSECTION 19
#define PASO_ITERATIVE 20
#define PASO_PASO 21
#define PASO_REC_ILU 23
#define PASO_TRILINOS 24
#define PASO_NONLINEAR_GMRES 25
#define PASO_TFQMR 26
#define PASO_MINRES 27
#define PASO_GAUSS_SEIDEL 28
#define PASO_GS PASO_GAUSS_SEIDEL
#define PASO_RILU 29
#define PASO_DEFAULT_REORDERING 30
#define PASO_NO_PRECONDITIONER 36
#define PASO_CLASSIC_INTERPOLATION_WITH_FF_COUPLING 50
#define PASO_CLASSIC_INTERPOLATION 51
#define PASO_DIRECT_INTERPOLATION 52
#define PASO_LINEAR_CRANK_NICOLSON 66
#define PASO_CRANK_NICOLSON 67
#define PASO_BACKWARD_EULER 68
#define PASO_SMOOTHER 99999999
namespace paso {
struct Options
{
Options() { setDefaults(); }
Options(const boost::python::object& options);
void setDefaults();
void show() const;
void showDiagnostics() const;
void updateEscriptDiagnostics(boost::python::object& options) const;
static int mapEscriptOption(int escriptOption);
static const char* name(int key);
static int getPackage(int solver, int package, bool symmetry,
const escript::JMPI& mpi_info);
static int getSolver(int solver, int package, bool symmetry,
const escript::JMPI& mpi_info);
int method;
int package;
bool symmetric;
bool hermitian;
double tolerance;
double absolute_tolerance;
double inner_tolerance;
bool adapt_inner_tolerance;
bool verbose;
bool reordering;
int preconditioner;
dim_t iter_max;
dim_t inner_iter_max;
double drop_tolerance;
double drop_storage;
index_t truncation;
index_t restart;
int sweeps;
bool accept_failed_convergence;
double relaxation_factor;
bool use_local_preconditioner;
dim_t refinements;
int ode_solver;
// diagnostic values
dim_t num_iter;
dim_t num_level;
dim_t num_inner_iter;
double time;
double set_up_time;
double coarsening_selection_time;
double coarsening_matrix_time;
double net_time;
double residual_norm;
bool converged;
double preconditioner_size; // in Mbytes
bool time_step_backtracking_used;
double coarse_level_sparsity;
dim_t num_coarse_unknowns;
};
} // namespace paso
#endif // __PASO_OPTIONS_H__
escript::SolverBuddy::getDropTolerance
double getDropTolerance() const
Definition: SolverOptions.cpp:609
paso::Options::show
void show() const
prints current option values
Definition: Options.cpp:136
escript::SO_REORDERING_NONE
@ SO_REORDERING_NONE
Definition: SolverOptions.h:167
escript::SolverBuddy
Definition: SolverOptions.h:172
PASO_TRILINOS
#define PASO_TRILINOS
Definition: Options.h:58
PASO_CR
#define PASO_CR
Definition: Options.h:42
paso::Options::Options
Options()
Definition: Options.h:80
PASO_DIRECT
#define PASO_DIRECT
Definition: Options.h:39
paso::Options::setDefaults
void setDefaults()
sets the default values for solver options
Definition: Options.cpp:76
paso::Options::num_level
dim_t num_level
Definition: Options.h:135
PASO_GAUSS_SEIDEL
#define PASO_GAUSS_SEIDEL
Definition: Options.h:62
escript::SO_METHOD_GMRES
@ SO_METHOD_GMRES
Definition: SolverOptions.h:133
escript::SolverBuddy::useLocalPreconditioner
bool useLocalPreconditioner() const
Definition: SolverOptions.cpp:763
paso::Options::preconditioner_size
double preconditioner_size
Definition: Options.h:144
PASO_ILUT
#define PASO_ILUT
Definition: Options.h:46
paso::Options::accept_failed_convergence
bool accept_failed_convergence
Definition: Options.h:127
paso::Options::package
int package
Definition: Options.h:110
PASO_DEFAULT
#define PASO_DEFAULT
Definition: Options.h:38
escript::SolverBuddy::getTolerance
double getTolerance() const
Definition: SolverOptions.cpp:573
escript::SO_METHOD_DIRECT
@ SO_METHOD_DIRECT
Definition: SolverOptions.h:128
PASO_RILU
#define PASO_RILU
Definition: Options.h:64
paso::Options::getSolver
static int getSolver(int solver, int package, bool symmetry, const escript::JMPI &mpi_info)
returns the solver to be used with given combination
Definition: Options.cpp:234
escript::SolverBuddy::getAbsoluteTolerance
double getAbsoluteTolerance() const
Definition: SolverOptions.cpp:585
escript::SO_ODESOLVER_BACKWARD_EULER
@ SO_ODESOLVER_BACKWARD_EULER
Definition: SolverOptions.h:155
escript::SolverBuddy::getTruncation
int getTruncation() const
Definition: SolverOptions.cpp:525
paso::Options::showDiagnostics
void showDiagnostics() const
prints diagnostic data
Definition: Options.cpp:119
paso::Options::time_step_backtracking_used
bool time_step_backtracking_used
Definition: Options.h:145
PASO_ILU0
#define PASO_ILU0
Definition: Options.h:45
escript::SO_PRECONDITIONER_ILU0
@ SO_PRECONDITIONER_ILU0
Definition: SolverOptions.h:147
PASO_ITERATIVE
#define PASO_ITERATIVE
Definition: Options.h:55
escript::SolverBuddy::getNumSweeps
int getNumSweeps() const
Definition: SolverOptions.cpp:561
paso::Options::time
double time
Definition: Options.h:137
paso::Options::getPackage
static int getPackage(int solver, int package, bool symmetry, const escript::JMPI &mpi_info)
Definition: Options.cpp:325
PASO_GMRES
#define PASO_GMRES
Definition: Options.h:48
escript::SolverBuddy::getSolverMethod
SolverOptions getSolverMethod() const
Definition: SolverOptions.cpp:409
paso::Options::tolerance
double tolerance
Definition: Options.h:113
SET
#define SET(__key__, __val__, __type__)
PASO_MINIMUM_FILL_IN
#define PASO_MINIMUM_FILL_IN
Definition: Options.h:53
escript::SolverBuddy::getNumRefinements
int getNumRefinements() const
Definition: SolverOptions.cpp:793
paso::Options::mapEscriptOption
static int mapEscriptOption(int escriptOption)
returns the corresponding paso option code for an escript option code
Definition: Options.cpp:365
PASO_CRANK_NICOLSON
#define PASO_CRANK_NICOLSON
Definition: Options.h:71
escript::SO_ODESOLVER_LINEAR_CRANK_NICOLSON
@ SO_ODESOLVER_LINEAR_CRANK_NICOLSON
Definition: SolverOptions.h:157
escript::SO_PRECONDITIONER_REC_ILU
@ SO_PRECONDITIONER_REC_ILU
Definition: SolverOptions.h:151
escript::SO_REORDERING_MINIMUM_FILL_IN
@ SO_REORDERING_MINIMUM_FILL_IN
Definition: SolverOptions.h:165
paso::Options::num_coarse_unknowns
dim_t num_coarse_unknowns
Definition: Options.h:147
PASO_PRES20
#define PASO_PRES20
Definition: Options.h:49
paso::Options::hermitian
bool hermitian
Definition: Options.h:112
escript::SO_PRECONDITIONER_ILUT
@ SO_PRECONDITIONER_ILUT
Definition: SolverOptions.h:148
escript::SolverBuddy::isHermitian
bool isHermitian() const
Definition: SolverOptions.cpp:671
paso::Options::net_time
double net_time
Definition: Options.h:141
escript::SO_METHOD_NONLINEAR_GMRES
@ SO_METHOD_NONLINEAR_GMRES
Definition: SolverOptions.h:138
PASO_MKL
#define PASO_MKL
Definition: Options.h:50
PASO_NO_REORDERING
#define PASO_NO_REORDERING
Definition: Options.h:52
PASO_NO_PRECONDITIONER
#define PASO_NO_PRECONDITIONER
Definition: Options.h:66
paso::Options::verbose
bool verbose
Definition: Options.h:117
PASO_DEFAULT_REORDERING
#define PASO_DEFAULT_REORDERING
Definition: Options.h:65
Options.h
paso::Options::method
int method
Definition: Options.h:109
escript::SolverBuddy::isVerbose
bool isVerbose() const
Definition: SolverOptions.cpp:694
escript::SO_PACKAGE_PASO
@ SO_PACKAGE_PASO
Definition: SolverOptions.h:118
PASO_PCG
#define PASO_PCG
Definition: Options.h:41
PASO_TFQMR
#define PASO_TFQMR
Definition: Options.h:60
Paso.h
paso::Options::truncation
index_t truncation
Definition: Options.h:124
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:93
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:72
escript::SO_REORDERING_DEFAULT
@ SO_REORDERING_DEFAULT
Definition: SolverOptions.h:164
paso::Options::reordering
bool reordering
Definition: Options.h:118
escript::SolverBuddy::acceptConvergenceFailure
bool acceptConvergenceFailure() const
Definition: SolverOptions.cpp:740
PASO_LINEAR_CRANK_NICOLSON
#define PASO_LINEAR_CRANK_NICOLSON
Definition: Options.h:70
paso::Options::symmetric
bool symmetric
Definition: Options.h:111
paso::Options::inner_tolerance
double inner_tolerance
Definition: Options.h:115
paso::Options::refinements
dim_t refinements
Definition: Options.h:130
escript::SolverBuddy::getRelaxationFactor
double getRelaxationFactor() const
Definition: SolverOptions.cpp:633
paso::Options::num_inner_iter
dim_t num_inner_iter
Definition: Options.h:136
escript::SolverBuddy::getInnerIterMax
int getInnerIterMax() const
Definition: SolverOptions.cpp:537
escript::SolverBuddy::getInnerTolerance
double getInnerTolerance() const
Definition: SolverOptions.cpp:597
escript::SolverBuddy::_getRestartForC
int _getRestartForC() const
Definition: SolverOptions.cpp:510
escript::SO_ODESOLVER_CRANK_NICOLSON
@ SO_ODESOLVER_CRANK_NICOLSON
Definition: SolverOptions.h:156
paso::Options::drop_storage
double drop_storage
Definition: Options.h:123
PASO_NONLINEAR_GMRES
#define PASO_NONLINEAR_GMRES
Definition: Options.h:59
paso::Options::iter_max
dim_t iter_max
Definition: Options.h:120
escript::SO_METHOD_CGS
@ SO_METHOD_CGS
Definition: SolverOptions.h:125
paso::Options::updateEscriptDiagnostics
void updateEscriptDiagnostics(boost::python::object &options) const
updates SolverBuddy diagnostics from this
Definition: Options.cpp:444
paso::Options::converged
bool converged
Definition: Options.h:143
paso::Options::use_local_preconditioner
bool use_local_preconditioner
Definition: Options.h:129
paso::Options::relaxation_factor
double relaxation_factor
Definition: Options.h:128
PASO_PASO
#define PASO_PASO
Definition: Options.h:56
paso::Options::coarse_level_sparsity
double coarse_level_sparsity
Definition: Options.h:146
PASO_UMFPACK
#define PASO_UMFPACK
Definition: Options.h:51
escript::SolverBuddy::getIterMax
int getIterMax() const
Definition: SolverOptions.cpp:549
paso::Options::adapt_inner_tolerance
bool adapt_inner_tolerance
Definition: Options.h:116
escript::SO_METHOD_ITERATIVE
@ SO_METHOD_ITERATIVE
Definition: SolverOptions.h:135
PASO_BICGSTAB
#define PASO_BICGSTAB
Definition: Options.h:44
escript::SolverBuddy::getReordering
SolverOptions getReordering() const
Definition: SolverOptions.cpp:492
escript::SolverBuddy::isSymmetric
bool isSymmetric() const
Definition: SolverOptions.cpp:648
paso::Options::residual_norm
double residual_norm
Definition: Options.h:142
escript::SO_REORDERING_NESTED_DISSECTION
@ SO_REORDERING_NESTED_DISSECTION
Definition: SolverOptions.h:166
escript::SO_METHOD_BICGSTAB
@ SO_METHOD_BICGSTAB
Definition: SolverOptions.h:123
escript::SolverBuddy::getPreconditioner
SolverOptions getPreconditioner() const
Definition: SolverOptions.cpp:353
paso::Options::ode_solver
int ode_solver
Definition: Options.h:131
paso::Options::drop_tolerance
double drop_tolerance
Definition: Options.h:122
paso::PasoException
PasoException exception class.
Definition: PasoException.h:47
PASO_MINRES
#define PASO_MINRES
Definition: Options.h:61
paso::Options::preconditioner
int preconditioner
Definition: Options.h:119
escript::SO_METHOD_MINRES
@ SO_METHOD_MINRES
Definition: SolverOptions.h:137
PASO_JACOBI
#define PASO_JACOBI
Definition: Options.h:47
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:88
paso::Options::inner_iter_max
dim_t inner_iter_max
Definition: Options.h:121
PASO_CGS
#define PASO_CGS
Definition: Options.h:43
paso::Options::name
static const char * name(int key)
Definition: Options.cpp:164
escript::SO_METHOD_CR
@ SO_METHOD_CR
Definition: SolverOptions.h:127
paso::Options::set_up_time
double set_up_time
Definition: Options.h:138
paso::Options::sweeps
int sweeps
Definition: Options.h:126
escript::SO_PRECONDITIONER_GAUSS_SEIDEL
@ SO_PRECONDITIONER_GAUSS_SEIDEL
Definition: SolverOptions.h:146
escript::SO_DEFAULT
@ SO_DEFAULT
Definition: SolverOptions.h:110
escript::SO_PRECONDITIONER_NONE
@ SO_PRECONDITIONER_NONE
Definition: SolverOptions.h:150
paso::Options::coarsening_selection_time
double coarsening_selection_time
Definition: Options.h:139
PasoException.h
PASO_REC_ILU
#define PASO_REC_ILU
Definition: Options.h:57
PASO_BACKWARD_EULER
#define PASO_BACKWARD_EULER
Definition: Options.h:72
PASO_NESTED_DISSECTION
#define PASO_NESTED_DISSECTION
Definition: Options.h:54
paso::Options::absolute_tolerance
double absolute_tolerance
Definition: Options.h:114
escript::SO_PRECONDITIONER_RILU
@ SO_PRECONDITIONER_RILU
Definition: SolverOptions.h:152
escript::SO_PACKAGE_TRILINOS
@ SO_PACKAGE_TRILINOS
Definition: SolverOptions.h:119
escript::SolverBuddy::adaptInnerTolerance
bool adaptInnerTolerance() const
Definition: SolverOptions.cpp:717
paso
Definition: BiCGStab.cpp:26
paso::Options::coarsening_matrix_time
double coarsening_matrix_time
Definition: Options.h:140
escript::SO_PACKAGE_MKL
@ SO_PACKAGE_MKL
Definition: SolverOptions.h:117
escript::SO_PRECONDITIONER_JACOBI
@ SO_PRECONDITIONER_JACOBI
Definition: SolverOptions.h:149
escript::SO_METHOD_PRES20
@ SO_METHOD_PRES20
Definition: SolverOptions.h:140
escript::SolverBuddy::getDropStorage
double getDropStorage() const
Definition: SolverOptions.cpp:621
escript::SO_PACKAGE_UMFPACK
@ SO_PACKAGE_UMFPACK
Definition: SolverOptions.h:120
escript::SO_METHOD_TFQMR
@ SO_METHOD_TFQMR
Definition: SolverOptions.h:142
escript::SO_METHOD_PCG
@ SO_METHOD_PCG
Definition: SolverOptions.h:139
paso::Options
Definition: Options.h:78
escript::SolverBuddy::getODESolver
SolverOptions getODESolver() const
Definition: SolverOptions.cpp:812
PASO_CHOLEVSKY
#define PASO_CHOLEVSKY
Definition: Options.h:40
paso::Options::num_iter
dim_t num_iter
Definition: Options.h:134
paso::Options::restart
index_t restart
Definition: Options.h:125
escript::SO_METHOD_CHOLEVSKY
@ SO_METHOD_CHOLEVSKY
Definition: SolverOptions.h:126