escript  Revision_
Public Member Functions | Protected Attributes | List of all members
escript::SolverBuddy Class Reference

#include <SolverOptions.h>

Public Member Functions

 SolverBuddy ()
 
 ~SolverBuddy ()
 
std::string getSummary () const
 
const char * getName (int key) const
 
void resetDiagnostics (bool all=false)
 
void updateDiagnosticsPy (const std::string &key, const boost::python::object &value)
 
void updateDiagnostics (const std::string &key, bool value)
 
void updateDiagnostics (const std::string &key, int value)
 
void updateDiagnostics (const std::string &key, double value)
 
double getDiagnostics (const std::string name) const
 
bool hasConverged () const
 
void setCoarsening (int coarsening)
 
SolverOptions getCoarsening () const
 
void setMinCoarseMatrixSize (int size)
 
int getMinCoarseMatrixSize () const
 
void setPreconditioner (int preconditioner)
 
SolverOptions getPreconditioner () const
 
void setSmoother (int smoother)
 
SolverOptions getSmoother () const
 
void setSolverMethod (int method)
 
SolverOptions getSolverMethod () const
 
void setSolverTarget (int target)
 
SolverOptions getSolverTarget () const
 
void setPackage (int package)
 
SolverOptions getPackage () const
 
void setReordering (int ordering)
 
SolverOptions getReordering () const
 
void setRestart (int restart)
 
int getRestart () const
 
int _getRestartForC () const
 
void setDiagonalDominanceThreshold (double threshold)
 
double getDiagonalDominanceThreshold () const
 
void setTruncation (int truncation)
 
int getTruncation () const
 
void setInnerIterMax (int iter_max)
 
int getInnerIterMax () const
 
void setIterMax (int iter_max)
 
int getIterMax () const
 
void setLevelMax (int level_max)
 
int getLevelMax () const
 
void setCycleType (int cycle_type)
 
int getCycleType () const
 
void setCoarseningThreshold (double theta)
 
double getCoarseningThreshold () const
 
void setNumSweeps (int sweeps)
 
int getNumSweeps () const
 
void setNumPreSweeps (int sweeps)
 
int getNumPreSweeps () const
 
void setNumPostSweeps (int sweeps)
 
int getNumPostSweeps () const
 
void setTolerance (double rtol)
 
double getTolerance () const
 
void setAbsoluteTolerance (double atol)
 
double getAbsoluteTolerance () const
 
void setInnerTolerance (double rtol)
 
double getInnerTolerance () const
 
void setDropTolerance (double drop_tol)
 
double getDropTolerance () const
 
void setDropStorage (double drop)
 
double getDropStorage () const
 
void setRelaxationFactor (double factor)
 
double getRelaxationFactor () const
 
bool isComplex () const
 
void setComplex (bool complex)
 
bool isSymmetric () const
 
void setSymmetryOn ()
 
void setSymmetryOff ()
 
void setSymmetry (bool symmetry)
 
bool isVerbose () const
 
void setVerbosityOn ()
 
void setVerbosityOff ()
 
void setVerbosity (bool verbose)
 
bool adaptInnerTolerance () const
 
void setInnerToleranceAdaptionOn ()
 
void setInnerToleranceAdaptionOff ()
 
void setInnerToleranceAdaption (bool adaption)
 
bool acceptConvergenceFailure () const
 
void setAcceptanceConvergenceFailureOn ()
 
void setAcceptanceConvergenceFailureOff ()
 
void setAcceptanceConvergenceFailure (bool acceptance)
 
bool useLocalPreconditioner () const
 
void setLocalPreconditionerOn ()
 
void setLocalPreconditionerOff ()
 
void setLocalPreconditioner (bool local)
 
void setMinCoarseMatrixSparsity (double sparsity)
 
double getMinCoarseMatrixSparsity () const
 
void setNumRefinements (int refinements)
 
int getNumRefinements () const
 
void setNumCoarseMatrixRefinements (int refinements)
 
int getNumCoarseMatrixRefinements () const
 
bool usePanel () const
 
void setUsePanelOn ()
 
void setUsePanelOff ()
 
void setUsePanel (bool use)
 
void setAMGInterpolation (int interpolation)
 
SolverOptions getAMGInterpolation () const
 
void setODESolver (int solver)
 
SolverOptions getODESolver () const
 
void setTrilinosParameter (const std::string &name, const boost::python::object &value)
 
boost::python::dict getTrilinosParameters () const
 

Protected Attributes

boost::python::dict trilinosParams
 
SolverOptions target
 
SolverOptions package
 
SolverOptions method
 
SolverOptions preconditioner
 
SolverOptions ode_solver
 
SolverOptions smoother
 
SolverOptions reordering
 
SolverOptions coarsening
 
SolverOptions amg_interpolation_method
 
int level_max
 
double coarsening_threshold
 
int sweeps
 
int pre_sweeps
 
int post_sweeps
 
double tolerance
 
double absolute_tolerance
 
double inner_tolerance
 
double drop_tolerance
 
double drop_storage
 
int iter_max
 
int inner_iter_max
 
int truncation
 
int restart
 
bool is_complex
 
bool symmetric
 
bool verbose
 
bool adapt_inner_tolerance
 
bool accept_convergence_failure
 
int min_coarse_matrix_size
 
double relaxation
 
bool use_local_preconditioner
 
double min_sparsity
 
int refinements
 
int coarse_refinements
 
bool use_panel
 
double diagonal_dominance_threshold
 
int cycle_type
 
int num_iter
 
int num_level
 
int num_inner_iter
 
double time
 
double set_up_time
 
double net_time
 
double residual_norm
 
bool converged
 
int preconditioner_size
 
bool time_step_backtracking_used
 
double coarse_level_sparsity
 
int num_coarse_unknowns
 
int cum_num_inner_iter
 
int cum_num_iter
 
double cum_time
 
double cum_set_up_time
 
double cum_net_time
 

Constructor & Destructor Documentation

◆ SolverBuddy()

escript::SolverBuddy::SolverBuddy ( )

References resetDiagnostics().

◆ ~SolverBuddy()

escript::SolverBuddy::~SolverBuddy ( )

Member Function Documentation

◆ _getRestartForC()

int escript::SolverBuddy::_getRestartForC ( ) const

Returns the number of iterations steps after which GMRES performs a restart. If -1 is returned no restart is performed.

References getRestart().

◆ acceptConvergenceFailure()

bool escript::SolverBuddy::acceptConvergenceFailure ( ) const

Returns true if a failure to meet the stopping criteria within the given number of iteration steps does not raise an exception. This is useful if a solver is used in a non-linear context where the non-linear solver can continue even if the returned solution does not necessarily meet the stopping criteria. One can use the hasConverged method to check if the last call to the solver was successful.

Returns
true if a failure to achieve convergence is accepted.

References accept_convergence_failure.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ adaptInnerTolerance()

bool escript::SolverBuddy::adaptInnerTolerance ( ) const

Returns true if the tolerance of the inner solver is selected automatically. Otherwise the inner tolerance set by setInnerTolerance is used.

Returns
true if inner tolerance adaption is chosen.

References adapt_inner_tolerance.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getAbsoluteTolerance()

double escript::SolverBuddy::getAbsoluteTolerance ( ) const

Returns the absolute tolerance for the solver

References absolute_tolerance.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getAMGInterpolation()

SolverOptions escript::SolverBuddy::getAMGInterpolation ( ) const

Returns key of the interpolation method for the AMG preconditioner

References amg_interpolation_method.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getCoarsening()

SolverOptions escript::SolverBuddy::getCoarsening ( ) const

Returns the key of the coarsening algorithm to be applied for AMG, AMLI or BoomerAMG

References coarsening.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getCoarseningThreshold()

double escript::SolverBuddy::getCoarseningThreshold ( ) const

Returns the threshold for coarsening in the algebraic multi level solver or preconditioner

References coarsening_threshold.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getCycleType()

int escript::SolverBuddy::getCycleType ( ) const

Returns the cycle type (V- or W-cycle) to be used in an algebraic multi level solver or preconditioner

References cycle_type.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getDiagnostics()

double escript::SolverBuddy::getDiagnostics ( const std::string  name) const

Returns the diagnostic information for the given name. Possible values are:

  • "num_iter": the number of iteration steps
  • "cum_num_iter": the cumulative number of iteration steps
  • "num_level": the number of level in multi level solver
  • "num_inner_iter": the number of inner iteration steps
  • "cum_num_inner_iter": the cumulative number of inner iteration steps
  • "time": execution time
  • "cum_time": cumulative execution time
  • "set_up_time": time to set up the solver, typically this includes factorization and reordering
  • "cum_set_up_time": cumulative time to set up the solver
  • "net_time": net execution time, excluding setup time for the solver and execution time for preconditioner
  • "cum_net_time": cumulative net execution time
  • "preconditioner_size": size of preconditioner [Bytes]
  • "converged": true if solution has converged
  • "time_step_backtracking_used": true if time step back tracking has been used
  • "coarse_level_sparsity": sparsity of the matrix on the coarsest level
  • "num_coarse_unknowns": number of unknowns on the coarsest level
Parameters
namename of diagnostic information to return
Returns
requested value or 0 if the value is yet to be defined.
Note
If the solver has thrown an exception diagnostic values have an undefined status.

References coarse_level_sparsity, converged, cum_net_time, cum_num_inner_iter, cum_num_iter, cum_set_up_time, cum_time, net_time, num_coarse_unknowns, num_inner_iter, num_iter, num_level, preconditioner_size, residual_norm, set_up_time, time, and time_step_backtracking_used.

Referenced by BOOST_PYTHON_MODULE().

◆ getDiagonalDominanceThreshold()

double escript::SolverBuddy::getDiagonalDominanceThreshold ( ) const

Returns the threshold for diagonal dominant rows which are eliminated during AMG coarsening.

References diagonal_dominance_threshold.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getDropStorage()

double escript::SolverBuddy::getDropStorage ( ) const

Returns the maximum allowed increase in storage for ILUT

References drop_storage.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getDropTolerance()

double escript::SolverBuddy::getDropTolerance ( ) const

Returns the relative drop tolerance in ILUT

References drop_tolerance.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getInnerIterMax()

int escript::SolverBuddy::getInnerIterMax ( ) const

Returns maximum number of inner iteration steps

References inner_iter_max.

Referenced by BOOST_PYTHON_MODULE().

◆ getInnerTolerance()

double escript::SolverBuddy::getInnerTolerance ( ) const

Returns the relative tolerance for an inner iteration scheme

References inner_tolerance.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getIterMax()

int escript::SolverBuddy::getIterMax ( ) const

Returns maximum number of iteration steps

References iter_max.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getLevelMax()

int escript::SolverBuddy::getLevelMax ( ) const

Returns the maximum number of coarsening levels to be used in an algebraic multi level solver or preconditioner

References level_max.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getMinCoarseMatrixSize()

int escript::SolverBuddy::getMinCoarseMatrixSize ( ) const

Returns the minimum size of the coarsest level matrix in AMG or AMLI

References min_coarse_matrix_size.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getMinCoarseMatrixSparsity()

double escript::SolverBuddy::getMinCoarseMatrixSparsity ( ) const

Returns the minimum sparsity on the coarsest level. Typically a direct solver is used when the sparsity becomes bigger than the set limit.

Returns
minimal sparsity

References min_sparsity.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getName()

const char * escript::SolverBuddy::getName ( int  key) const

Returns the name of a given key

Parameters
keya valid key from SolverOptions

References escript::SO_COARSENING_AGGREGATION, escript::SO_COARSENING_CIJP, escript::SO_COARSENING_CIJP_FIXED_RANDOM, escript::SO_COARSENING_FALGOUT, escript::SO_COARSENING_HMIS, escript::SO_COARSENING_PMIS, escript::SO_COARSENING_RUGE_STUEBEN, escript::SO_COARSENING_STANDARD, escript::SO_COARSENING_YAIR_SHAPIRA, escript::SO_DEFAULT, escript::SO_INTERPOLATION_CLASSIC, escript::SO_INTERPOLATION_CLASSIC_WITH_FF_COUPLING, escript::SO_INTERPOLATION_DIRECT, escript::SO_METHOD_BICGSTAB, escript::SO_METHOD_CGLS, escript::SO_METHOD_CGS, escript::SO_METHOD_CHOLEVSKY, escript::SO_METHOD_CR, escript::SO_METHOD_DIRECT, escript::SO_METHOD_DIRECT_MUMPS, escript::SO_METHOD_DIRECT_PARDISO, escript::SO_METHOD_DIRECT_SUPERLU, escript::SO_METHOD_DIRECT_TRILINOS, escript::SO_METHOD_GMRES, escript::SO_METHOD_HRZ_LUMPING, escript::SO_METHOD_ITERATIVE, escript::SO_METHOD_LSQR, escript::SO_METHOD_MINRES, escript::SO_METHOD_NONLINEAR_GMRES, escript::SO_METHOD_PCG, escript::SO_METHOD_PRES20, escript::SO_METHOD_ROWSUM_LUMPING, escript::SO_METHOD_TFQMR, escript::SO_ODESOLVER_BACKWARD_EULER, escript::SO_ODESOLVER_CRANK_NICOLSON, escript::SO_ODESOLVER_LINEAR_CRANK_NICOLSON, escript::SO_PACKAGE_CUSP, escript::SO_PACKAGE_MKL, escript::SO_PACKAGE_PASO, escript::SO_PACKAGE_TRILINOS, escript::SO_PACKAGE_UMFPACK, escript::SO_PRECONDITIONER_AMG, escript::SO_PRECONDITIONER_AMLI, escript::SO_PRECONDITIONER_BOOMERAMG, escript::SO_PRECONDITIONER_GAUSS_SEIDEL, escript::SO_PRECONDITIONER_ILU0, escript::SO_PRECONDITIONER_ILUT, escript::SO_PRECONDITIONER_JACOBI, escript::SO_PRECONDITIONER_NONE, escript::SO_PRECONDITIONER_REC_ILU, escript::SO_PRECONDITIONER_RILU, escript::SO_REORDERING_DEFAULT, escript::SO_REORDERING_MINIMUM_FILL_IN, escript::SO_REORDERING_NESTED_DISSECTION, escript::SO_REORDERING_NONE, escript::SO_TARGET_CPU, and escript::SO_TARGET_GPU.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getNumCoarseMatrixRefinements()

int escript::SolverBuddy::getNumCoarseMatrixRefinements ( ) const

Returns the number of refinement steps to refine the solution on the coarsest level when a direct solver is applied.

References coarse_refinements.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getNumPostSweeps()

int escript::SolverBuddy::getNumPostSweeps ( ) const

Returns the number of sweeps in the post-smoothing step of a multi level solver or preconditioner

References post_sweeps.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getNumPreSweeps()

int escript::SolverBuddy::getNumPreSweeps ( ) const

Returns he number of sweeps in the pre-smoothing step of a multi level solver or preconditioner

References pre_sweeps.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getNumRefinements()

int escript::SolverBuddy::getNumRefinements ( ) const

Returns the number of refinement steps to refine the solution when a direct solver is applied.

References refinements.

Referenced by BOOST_PYTHON_MODULE().

◆ getNumSweeps()

int escript::SolverBuddy::getNumSweeps ( ) const

Returns the number of sweeps in a Jacobi or Gauss-Seidel/SOR preconditioner.

References sweeps.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getODESolver()

SolverOptions escript::SolverBuddy::getODESolver ( ) const

Returns the key of the solver method for ODEs.

References ode_solver.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getPackage()

SolverOptions escript::SolverBuddy::getPackage ( ) const

◆ getPreconditioner()

SolverOptions escript::SolverBuddy::getPreconditioner ( ) const

◆ getRelaxationFactor()

double escript::SolverBuddy::getRelaxationFactor ( ) const

Returns the relaxation factor used to add dropped elements in RILU to the main diagonal.

References relaxation.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getReordering()

SolverOptions escript::SolverBuddy::getReordering ( ) const

Returns the key of the reordering method to be applied if supported by the solver.

References reordering.

Referenced by BOOST_PYTHON_MODULE().

◆ getRestart()

int escript::SolverBuddy::getRestart ( ) const

Returns the number of iterations steps after which GMRES performs a restart. 0 means no restart is performed.

References restart.

Referenced by _getRestartForC(), BOOST_PYTHON_MODULE(), and getSummary().

◆ getSmoother()

SolverOptions escript::SolverBuddy::getSmoother ( ) const

Returns the key of the smoother to be used.

References smoother.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getSolverMethod()

SolverOptions escript::SolverBuddy::getSolverMethod ( ) const

◆ getSolverTarget()

SolverOptions escript::SolverBuddy::getSolverTarget ( ) const

Returns the key of the solver target.

References target.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getSummary()

std::string escript::SolverBuddy::getSummary ( ) const

◆ getTolerance()

double escript::SolverBuddy::getTolerance ( ) const

Returns the relative tolerance for the solver

References tolerance.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ getTrilinosParameters()

bp::dict escript::SolverBuddy::getTrilinosParameters ( ) const

Returns a boost python dictionary of set Trilinos parameters.

Note
This method returns an empty dictionary in a non-Trilinos build.

References trilinosParams.

Referenced by BOOST_PYTHON_MODULE().

◆ getTruncation()

int escript::SolverBuddy::getTruncation ( ) const

Returns the number of residuals in GMRES to be stored for orthogonalization.

References truncation.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ hasConverged()

bool escript::SolverBuddy::hasConverged ( ) const

Returns true if the last solver call has been finalized successfully.

Note
if an exception has been thrown by the solver the status of this flag is undefined.

References converged.

Referenced by BOOST_PYTHON_MODULE().

◆ isComplex()

bool escript::SolverBuddy::isComplex ( ) const

Checks if the coefficient matrix is set to be complex-valued.

Returns
true if a complex-valued PDE is indicated, false otherwise

References is_complex.

Referenced by BOOST_PYTHON_MODULE(), ripley::RipleyDomain::getSystemMatrixTypeId(), dudley::DudleyDomain::getSystemMatrixTypeId(), and finley::FinleyDomain::getSystemMatrixTypeId().

◆ isSymmetric()

bool escript::SolverBuddy::isSymmetric ( ) const

Checks if symmetry of the coefficient matrix is indicated.

Returns
true if a symmetric PDE is indicated, false otherwise

References symmetric.

Referenced by BOOST_PYTHON_MODULE(), getSummary(), ripley::RipleyDomain::getSystemMatrixTypeId(), dudley::DudleyDomain::getSystemMatrixTypeId(), and finley::FinleyDomain::getSystemMatrixTypeId().

◆ isVerbose()

bool escript::SolverBuddy::isVerbose ( ) const

Returns true if the solver is expected to be verbose.

Returns
true if verbosity is on

References verbose.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ resetDiagnostics()

void escript::SolverBuddy::resetDiagnostics ( bool  all = false)

Resets the diagnostics

Parameters
allif all is true all diagnostics including accumulative counters are reset.

References coarse_level_sparsity, converged, cum_net_time, cum_num_inner_iter, cum_num_iter, cum_set_up_time, cum_time, net_time, num_coarse_unknowns, num_inner_iter, num_iter, num_level, preconditioner_size, residual_norm, set_up_time, time, and time_step_backtracking_used.

Referenced by BOOST_PYTHON_MODULE(), and SolverBuddy().

◆ setAbsoluteTolerance()

void escript::SolverBuddy::setAbsoluteTolerance ( double  atol)

Sets the absolute tolerance for the solver

Parameters
atolabsolute tolerance

References absolute_tolerance.

Referenced by BOOST_PYTHON_MODULE().

◆ setAcceptanceConvergenceFailure()

void escript::SolverBuddy::setAcceptanceConvergenceFailure ( bool  acceptance)

Sets the flag to indicate the acceptance of a failure of convergence.

Parameters
acceptanceIf true, any failure to achieve convergence is accepted.

References setAcceptanceConvergenceFailureOff(), and setAcceptanceConvergenceFailureOn().

Referenced by BOOST_PYTHON_MODULE().

◆ setAcceptanceConvergenceFailureOff()

void escript::SolverBuddy::setAcceptanceConvergenceFailureOff ( )

Switches the acceptance of a failure of convergence off

References accept_convergence_failure.

Referenced by BOOST_PYTHON_MODULE(), and setAcceptanceConvergenceFailure().

◆ setAcceptanceConvergenceFailureOn()

void escript::SolverBuddy::setAcceptanceConvergenceFailureOn ( )

Switches the acceptance of a failure of convergence on

References accept_convergence_failure.

Referenced by BOOST_PYTHON_MODULE(), and setAcceptanceConvergenceFailure().

◆ setAMGInterpolation()

void escript::SolverBuddy::setAMGInterpolation ( int  interpolation)

Sets the interpolation method for the AMG preconditioner.

Parameters
interpolationkey of the interpolation method to be used, should be in SO_INTERPOLATION_CLASSIC_WITH_FF_COUPLING, SO_INTERPOLATION_CLASSIC, SO_INTERPOLATION_DIRECT

References amg_interpolation_method, method, escript::SO_INTERPOLATION_CLASSIC, escript::SO_INTERPOLATION_CLASSIC_WITH_FF_COUPLING, and escript::SO_INTERPOLATION_DIRECT.

Referenced by BOOST_PYTHON_MODULE().

◆ setCoarsening()

void escript::SolverBuddy::setCoarsening ( int  coarsening)

Sets the key of the coarsening method to be applied in AMG, AMLI or BoomerAMG.

Parameters
coarseningthe coarsening method, one of SO_DEFAULT, SO_COARSENING_YAIR_SHAPIRA, SO_COARSENING_RUGE_STUEBEN, SO_COARSENING_AGGREGATION, SO_COARSENING_CIJP_FIXED_RANDOM, SO_COARSENING_CIJP, SO_COARSENING_FALGOUT, SO_COARSENING_PMIS, SO_COARSENING_HMIS

References coarsening, method, escript::SO_COARSENING_AGGREGATION, escript::SO_COARSENING_CIJP, escript::SO_COARSENING_CIJP_FIXED_RANDOM, escript::SO_COARSENING_FALGOUT, escript::SO_COARSENING_HMIS, escript::SO_COARSENING_PMIS, escript::SO_COARSENING_RUGE_STUEBEN, escript::SO_COARSENING_STANDARD, escript::SO_COARSENING_YAIR_SHAPIRA, and escript::SO_DEFAULT.

Referenced by BOOST_PYTHON_MODULE().

◆ setCoarseningThreshold()

void escript::SolverBuddy::setCoarseningThreshold ( double  theta)

Sets the threshold for coarsening in the algebraic multi level solver or preconditioner

Parameters
thetathreshold for coarsening

References coarsening_threshold.

Referenced by BOOST_PYTHON_MODULE().

◆ setComplex()

void escript::SolverBuddy::setComplex ( bool  complex)

Sets the complex flag for the coefficient matrix to flag.

Parameters
complexIf true, the complex flag is set otherwise reset.

References is_complex.

Referenced by BOOST_PYTHON_MODULE().

◆ setCycleType()

void escript::SolverBuddy::setCycleType ( int  cycle_type)

Sets the cycle type (V-cycle or W-cycle) to be used in an algebraic multi level solver or preconditioner

Parameters
cycle_typethe type of cycle

References cycle_type.

Referenced by BOOST_PYTHON_MODULE().

◆ setDiagonalDominanceThreshold()

void escript::SolverBuddy::setDiagonalDominanceThreshold ( double  threshold)

Sets the threshold for diagonal dominant rows which are eliminated during AMG coarsening.

References diagonal_dominance_threshold.

Referenced by BOOST_PYTHON_MODULE().

◆ setDropStorage()

void escript::SolverBuddy::setDropStorage ( double  drop)

Sets the maximum allowed increase in storage for ILUT. An increase of 2 would mean that a doubling of the storage needed for the coefficient matrix is allowed during ILUT factorization.

Parameters
dropallowed storage increase

References drop_storage.

Referenced by BOOST_PYTHON_MODULE().

◆ setDropTolerance()

void escript::SolverBuddy::setDropTolerance ( double  drop_tol)

Sets the relative drop tolerance in ILUT

Parameters
drop_toldrop tolerance

References drop_tolerance.

Referenced by BOOST_PYTHON_MODULE().

◆ setInnerIterMax()

void escript::SolverBuddy::setInnerIterMax ( int  iter_max)

Sets the maximum number of iteration steps for the inner iteration.

Parameters
iter_maxmaximum number of inner iterations

References inner_iter_max, and iter_max.

Referenced by BOOST_PYTHON_MODULE().

◆ setInnerTolerance()

void escript::SolverBuddy::setInnerTolerance ( double  rtol)

Sets the relative tolerance for an inner iteration scheme for instance on the coarsest level in a multi-level scheme.

Parameters
rtolinner relative tolerance

References inner_tolerance.

Referenced by BOOST_PYTHON_MODULE().

◆ setInnerToleranceAdaption()

void escript::SolverBuddy::setInnerToleranceAdaption ( bool  adaption)

Sets the flag to indicate automatic selection of the inner tolerance.

Parameters
adaptionIf true, the inner tolerance is selected automatically

References setInnerToleranceAdaptionOff(), and setInnerToleranceAdaptionOn().

Referenced by BOOST_PYTHON_MODULE().

◆ setInnerToleranceAdaptionOff()

void escript::SolverBuddy::setInnerToleranceAdaptionOff ( )

Switches the automatic selection of inner tolerance off

References adapt_inner_tolerance.

Referenced by BOOST_PYTHON_MODULE(), and setInnerToleranceAdaption().

◆ setInnerToleranceAdaptionOn()

void escript::SolverBuddy::setInnerToleranceAdaptionOn ( )

Switches the automatic selection of inner tolerance on

References adapt_inner_tolerance.

Referenced by BOOST_PYTHON_MODULE(), and setInnerToleranceAdaption().

◆ setIterMax()

void escript::SolverBuddy::setIterMax ( int  iter_max)

Sets the maximum number of iteration steps

Parameters
iter_maxmaximum number of iteration steps

References iter_max.

Referenced by BOOST_PYTHON_MODULE().

◆ setLevelMax()

void escript::SolverBuddy::setLevelMax ( int  level_max)

Sets the maximum number of coarsening levels to be used in an algebraic multi level solver or preconditioner

Parameters
level_maxmaximum number of levels

References level_max.

Referenced by BOOST_PYTHON_MODULE().

◆ setLocalPreconditioner()

void escript::SolverBuddy::setLocalPreconditioner ( bool  local)

Sets the flag to use local preconditioning

Parameters
localIf true, local proconditioning on each MPI rank is applied

References setLocalPreconditionerOff(), and setLocalPreconditionerOn().

Referenced by BOOST_PYTHON_MODULE().

◆ setLocalPreconditionerOff()

void escript::SolverBuddy::setLocalPreconditionerOff ( )

Sets the flag to use local preconditioning to off

References use_local_preconditioner.

Referenced by BOOST_PYTHON_MODULE(), and setLocalPreconditioner().

◆ setLocalPreconditionerOn()

void escript::SolverBuddy::setLocalPreconditionerOn ( )

Sets the flag to use local preconditioning to on

References use_local_preconditioner.

Referenced by BOOST_PYTHON_MODULE(), and setLocalPreconditioner().

◆ setMinCoarseMatrixSize()

void escript::SolverBuddy::setMinCoarseMatrixSize ( int  size)

Sets the minimum size of the coarsest level matrix in AMG or AMLI

Parameters
sizeminimum size of the coarsest level matrix .

References min_coarse_matrix_size.

Referenced by BOOST_PYTHON_MODULE().

◆ setMinCoarseMatrixSparsity()

void escript::SolverBuddy::setMinCoarseMatrixSparsity ( double  sparsity)

Sets the minimum sparsity at the coarsest level. Typically a direct solver is used when the sparsity becomes larger than the set limit.

Parameters
sparsityminimal sparsity

References min_sparsity.

Referenced by BOOST_PYTHON_MODULE().

◆ setNumCoarseMatrixRefinements()

void escript::SolverBuddy::setNumCoarseMatrixRefinements ( int  refinements)

Sets the number of refinement steps to refine the solution on the coarsest level when a direct solver is applied.

Parameters
refinementsnumber of refinements

References coarse_refinements, and refinements.

Referenced by BOOST_PYTHON_MODULE().

◆ setNumPostSweeps()

void escript::SolverBuddy::setNumPostSweeps ( int  sweeps)

Sets the number of sweeps in the post-smoothing step of a multi level solver or preconditioner

Parameters
sweepsnumber of sweeps

References post_sweeps, and sweeps.

Referenced by BOOST_PYTHON_MODULE().

◆ setNumPreSweeps()

void escript::SolverBuddy::setNumPreSweeps ( int  sweeps)

Sets the number of sweeps in the pre-smoothing step of a multi level solver or preconditioner

Parameters
sweepsnumber of sweeps

References pre_sweeps, and sweeps.

Referenced by BOOST_PYTHON_MODULE().

◆ setNumRefinements()

void escript::SolverBuddy::setNumRefinements ( int  refinements)

Sets the number of refinement steps to refine the solution when a direct solver is applied.

Parameters
refinementsnumber of refinements

References refinements.

Referenced by BOOST_PYTHON_MODULE().

◆ setNumSweeps()

void escript::SolverBuddy::setNumSweeps ( int  sweeps)

Sets the number of sweeps in a Jacobi or Gauss-Seidel/SOR preconditioner.

Parameters
sweepsnumber of sweeps

References sweeps.

Referenced by BOOST_PYTHON_MODULE().

◆ setODESolver()

void escript::SolverBuddy::setODESolver ( int  solver)

Sets the solver method for ODEs.

Parameters
solverkey of the ODE solver method to be used, should be in SO_ODESOLVER_CRANK_NICOLSON, SO_ODESOLVER_BACKWARD_EULER, SO_ODESOLVER_LINEAR_CRANK_NICOLSON

References method, ode_solver, escript::SO_ODESOLVER_BACKWARD_EULER, escript::SO_ODESOLVER_CRANK_NICOLSON, and escript::SO_ODESOLVER_LINEAR_CRANK_NICOLSON.

Referenced by BOOST_PYTHON_MODULE().

◆ setPackage()

void escript::SolverBuddy::setPackage ( int  package)

Sets the solver package to be used as a solver.

Parameters
packagekey of the solver package to be used, should be in SO_DEFAULT, SO_PACKAGE_CUSP, SO_PACKAGE_PASO, SO_PACKAGE_MKL, SO_PACKAGE_UMFPACK, SO_PACKAGE_TRILINOS
Note
Not all packages are supported on all implementation. An exception may be thrown on some platforms if the selected package is unsupported.

References package, escript::SO_DEFAULT, escript::SO_PACKAGE_CUSP, escript::SO_PACKAGE_MKL, escript::SO_PACKAGE_PASO, escript::SO_PACKAGE_TRILINOS, and escript::SO_PACKAGE_UMFPACK.

Referenced by BOOST_PYTHON_MODULE().

◆ setPreconditioner()

void escript::SolverBuddy::setPreconditioner ( int  preconditioner)

Sets the preconditioner to be used.

Parameters
preconditionerkey of the preconditioner to be used, one of SO_PRECONDITIONER_ILU0, SO_PRECONDITIONER_ILUT, SO_PRECONDITIONER_JACOBI, SO_PRECONDITIONER_AMG, SO_PRECONDITIONER_AMLI, SO_PRECONDITIONER_REC_ILU, SO_PRECONDITIONER_GAUSS_SEIDEL, SO_PRECONDITIONER_RILU, SO_PRECONDITIONER_BOOMERAMG, SO_PRECONDITIONER_NONE
Note
Not all packages support all preconditioners. It can be assumed that a package makes a reasonable choice if it encounters an unknown preconditioner.

References preconditioner, escript::SO_PRECONDITIONER_AMG, escript::SO_PRECONDITIONER_AMLI, escript::SO_PRECONDITIONER_BOOMERAMG, escript::SO_PRECONDITIONER_GAUSS_SEIDEL, escript::SO_PRECONDITIONER_ILU0, escript::SO_PRECONDITIONER_ILUT, escript::SO_PRECONDITIONER_JACOBI, escript::SO_PRECONDITIONER_NONE, escript::SO_PRECONDITIONER_REC_ILU, and escript::SO_PRECONDITIONER_RILU.

Referenced by BOOST_PYTHON_MODULE().

◆ setRelaxationFactor()

void escript::SolverBuddy::setRelaxationFactor ( double  factor)

Sets the relaxation factor used to add dropped elements in RILU to the main diagonal.

Parameters
factorrelaxation factor
Note
RILU with a relaxation factor 0 is identical to ILU0

References relaxation.

Referenced by BOOST_PYTHON_MODULE().

◆ setReordering()

void escript::SolverBuddy::setReordering ( int  ordering)

Sets the key of the reordering method to be applied if supported by the solver. Some direct solvers support reordering to optimize compute time and storage use during elimination.

Parameters
orderingselects the reordering strategy, should be in SO_REORDERING_NONE, SO_REORDERING_MINIMUM_FILL_IN, SO_REORDERING_NESTED_DISSECTION, 'SO_REORDERING_DEFAULT`

References reordering, escript::SO_REORDERING_DEFAULT, escript::SO_REORDERING_MINIMUM_FILL_IN, escript::SO_REORDERING_NESTED_DISSECTION, and escript::SO_REORDERING_NONE.

Referenced by BOOST_PYTHON_MODULE().

◆ setRestart()

void escript::SolverBuddy::setRestart ( int  restart)

Sets the number of iterations steps after which GMRES performs a restart.

Parameters
restartnumber of iteration steps after which to perform a restart. If 0 no restart is performed.

References restart.

Referenced by BOOST_PYTHON_MODULE().

◆ setSmoother()

void escript::SolverBuddy::setSmoother ( int  smoother)

Sets the smoother to be used.

Parameters
smootherkey of the smoother to be used, should be in SO_PRECONDITIONER_JACOBI, SO_PRECONDITIONER_GAUSS_SEIDEL
Note
Not all packages support all smoothers. It can be assumed that a package makes a reasonable choice if it encounters an unknown smoother.

References smoother, escript::SO_PRECONDITIONER_GAUSS_SEIDEL, and escript::SO_PRECONDITIONER_JACOBI.

Referenced by BOOST_PYTHON_MODULE().

◆ setSolverMethod()

void escript::SolverBuddy::setSolverMethod ( int  method)

Sets the solver method to be used. Use method=SO_METHOD_DIRECT to indicate that a direct rather than an iterative solver should be used and use method=SO_METHOD_ITERATIVE to indicate that an iterative rather than a direct solver should be used.

Parameters
methodkey of the solver method to be used, should be in SO_DEFAULT, SO_METHOD_DIRECT, SO_METHOD_DIRECT_MUMPS, SO_METHOD_DIRECT_PARDISO, SO_METHOD_DIRECT_SUPERLU, SO_METHOD_DIRECT_TRILINOS, SO_METHOD_CHOLEVSKY, SO_METHOD_PCG, SO_METHOD_CR, SO_METHOD_CGS, SO_METHOD_BICGSTAB, SO_METHOD_GMRES, SO_METHOD_PRES20, SO_METHOD_ROWSUM_LUMPING, SO_METHOD_HRZ_LUMPING, SO_METHOD_ITERATIVE, SO_METHOD_LSQR, SO_METHOD_NONLINEAR_GMRES, SO_METHOD_TFQMR, SO_METHOD_MINRES
Note
Not all packages support all solvers. It can be assumed that a package makes a reasonable choice if it encounters an unknown solver method.

References method, escript::SO_DEFAULT, escript::SO_METHOD_BICGSTAB, escript::SO_METHOD_CGLS, escript::SO_METHOD_CGS, escript::SO_METHOD_CHOLEVSKY, escript::SO_METHOD_CR, escript::SO_METHOD_DIRECT, escript::SO_METHOD_DIRECT_MUMPS, escript::SO_METHOD_DIRECT_PARDISO, escript::SO_METHOD_DIRECT_SUPERLU, escript::SO_METHOD_DIRECT_TRILINOS, escript::SO_METHOD_GMRES, escript::SO_METHOD_HRZ_LUMPING, escript::SO_METHOD_ITERATIVE, escript::SO_METHOD_LSQR, escript::SO_METHOD_MINRES, escript::SO_METHOD_NONLINEAR_GMRES, escript::SO_METHOD_PCG, escript::SO_METHOD_PRES20, escript::SO_METHOD_ROWSUM_LUMPING, and escript::SO_METHOD_TFQMR.

Referenced by BOOST_PYTHON_MODULE().

◆ setSolverTarget()

void escript::SolverBuddy::setSolverTarget ( int  target)

Sets the solver target to be used. By default the solver is run on the host CPU(s). If escript was compiled with GPU support then SO_TARGET_GPU is a valid option and the solver will run on GPU(s) if the package supports it.

Parameters
targetkey of the solver target. Valid settings: SO_TARGET_CPU, SO_TARGET_GPU

References escript::SO_TARGET_CPU, escript::SO_TARGET_GPU, and target.

Referenced by BOOST_PYTHON_MODULE().

◆ setSymmetry()

void escript::SolverBuddy::setSymmetry ( bool  symmetry)

Sets the symmetry flag for the coefficient matrix to flag.

Parameters
symmetryIf true, the symmetry flag is set otherwise reset.

References setSymmetryOff(), and setSymmetryOn().

Referenced by BOOST_PYTHON_MODULE().

◆ setSymmetryOff()

void escript::SolverBuddy::setSymmetryOff ( )

Clears the symmetry flag for the coefficient matrix.

References symmetric.

Referenced by BOOST_PYTHON_MODULE(), and setSymmetry().

◆ setSymmetryOn()

void escript::SolverBuddy::setSymmetryOn ( )

Sets the symmetry flag to indicate that the coefficient matrix is symmetric.

References symmetric.

Referenced by BOOST_PYTHON_MODULE(), and setSymmetry().

◆ setTolerance()

void escript::SolverBuddy::setTolerance ( double  rtol)

Sets the relative tolerance for the solver

Parameters
rtolrelative tolerance

References tolerance.

Referenced by BOOST_PYTHON_MODULE().

◆ setTrilinosParameter()

void escript::SolverBuddy::setTrilinosParameter ( const std::string &  name,
const boost::python::object &  value 
)

Sets a Trilinos preconditioner/solver parameter.

Note
Escript does not check for validity of the parameter name (e.g. spelling mistakes). Parameters are passed 1:1 to escript's Trilinos wrapper and from there to the relevant Trilinos package. See the relevant Trilinos documentation for valid parameter strings and values.
This method does nothing in a non-Trilinos build.

References trilinosParams.

Referenced by BOOST_PYTHON_MODULE().

◆ setTruncation()

void escript::SolverBuddy::setTruncation ( int  truncation)

Sets the number of residuals in GMRES to be stored for orthogonalization. The more residuals are stored the faster GMRES converges but more memory is required.

References truncation.

Referenced by BOOST_PYTHON_MODULE().

◆ setUsePanel()

void escript::SolverBuddy::setUsePanel ( bool  use)

Sets the flag to use a panel to find unknowns in AMG coarsening

Parameters
useIf true, a panel is used to find unknowns in AMG coarsening

References setUsePanelOff(), and setUsePanelOn().

Referenced by BOOST_PYTHON_MODULE().

◆ setUsePanelOff()

void escript::SolverBuddy::setUsePanelOff ( )

Sets the flag to use a panel to find unknowns in AMG coarsening to off

References use_panel.

Referenced by BOOST_PYTHON_MODULE(), and setUsePanel().

◆ setUsePanelOn()

void escript::SolverBuddy::setUsePanelOn ( )

Sets the flag to use a panel to find unknowns in AMG coarsening

References use_panel.

Referenced by BOOST_PYTHON_MODULE(), and setUsePanel().

◆ setVerbosity()

void escript::SolverBuddy::setVerbosity ( bool  verbose)

Sets the verbosity flag for the solver to flag.

Parameters
verboseIf true, the verbosity of the solver is switched on.

References setVerbosityOff(), and setVerbosityOn().

Referenced by BOOST_PYTHON_MODULE().

◆ setVerbosityOff()

void escript::SolverBuddy::setVerbosityOff ( )

Switches the verbosity of the solver off.

References verbose.

Referenced by BOOST_PYTHON_MODULE(), and setVerbosity().

◆ setVerbosityOn()

void escript::SolverBuddy::setVerbosityOn ( )

Switches the verbosity of the solver on.

References verbose.

Referenced by BOOST_PYTHON_MODULE(), and setVerbosity().

◆ updateDiagnostics() [1/3]

void escript::SolverBuddy::updateDiagnostics ( const std::string &  key,
bool  value 
)

◆ updateDiagnostics() [2/3]

void escript::SolverBuddy::updateDiagnostics ( const std::string &  key,
int  value 
)

◆ updateDiagnostics() [3/3]

void escript::SolverBuddy::updateDiagnostics ( const std::string &  key,
double  value 
)

◆ updateDiagnosticsPy()

void escript::SolverBuddy::updateDiagnosticsPy ( const std::string &  key,
const boost::python::object &  value 
)

Updates diagnostic information

Parameters
keyname of diagnostic (a python string in the list "num_iter", "num_level", "num_inner_iter", "time", "set_up_time", "net_time", "residual_norm", "converged").
valuenew value of the diagnostic information

References coarse_level_sparsity, converged, cum_net_time, cum_num_inner_iter, cum_num_iter, cum_set_up_time, cum_time, net_time, num_coarse_unknowns, num_inner_iter, num_iter, num_level, residual_norm, set_up_time, time, and time_step_backtracking_used.

Referenced by BOOST_PYTHON_MODULE().

◆ useLocalPreconditioner()

bool escript::SolverBuddy::useLocalPreconditioner ( ) const

Returns true if the preconditoner is applied locally on each MPI rank. This reduces communication costs and speeds up the application of the preconditioner but at the cost of more iteration steps. This can be an advantage on clusters with slower interconnects.

References use_local_preconditioner.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

◆ usePanel()

bool escript::SolverBuddy::usePanel ( ) const

Returns true if a panel is used to search for unknowns in the AMG coarsening, The panel approach is normally faster but can lead to larger coarse level systems.

References use_panel.

Referenced by BOOST_PYTHON_MODULE(), and getSummary().

Member Data Documentation

◆ absolute_tolerance

double escript::SolverBuddy::absolute_tolerance
protected

◆ accept_convergence_failure

bool escript::SolverBuddy::accept_convergence_failure
protected

◆ adapt_inner_tolerance

bool escript::SolverBuddy::adapt_inner_tolerance
protected

◆ amg_interpolation_method

SolverOptions escript::SolverBuddy::amg_interpolation_method
protected

◆ coarse_level_sparsity

double escript::SolverBuddy::coarse_level_sparsity
protected

◆ coarse_refinements

int escript::SolverBuddy::coarse_refinements
protected

◆ coarsening

SolverOptions escript::SolverBuddy::coarsening
protected

Referenced by getCoarsening(), and setCoarsening().

◆ coarsening_threshold

double escript::SolverBuddy::coarsening_threshold
protected

◆ converged

bool escript::SolverBuddy::converged
protected

◆ cum_net_time

double escript::SolverBuddy::cum_net_time
protected

◆ cum_num_inner_iter

int escript::SolverBuddy::cum_num_inner_iter
protected

◆ cum_num_iter

int escript::SolverBuddy::cum_num_iter
protected

◆ cum_set_up_time

double escript::SolverBuddy::cum_set_up_time
protected

◆ cum_time

double escript::SolverBuddy::cum_time
protected

◆ cycle_type

int escript::SolverBuddy::cycle_type
protected

Referenced by getCycleType(), and setCycleType().

◆ diagonal_dominance_threshold

double escript::SolverBuddy::diagonal_dominance_threshold
protected

◆ drop_storage

double escript::SolverBuddy::drop_storage
protected

Referenced by getDropStorage(), and setDropStorage().

◆ drop_tolerance

double escript::SolverBuddy::drop_tolerance
protected

◆ inner_iter_max

int escript::SolverBuddy::inner_iter_max
protected

Referenced by getInnerIterMax(), and setInnerIterMax().

◆ inner_tolerance

double escript::SolverBuddy::inner_tolerance
protected

◆ is_complex

bool escript::SolverBuddy::is_complex
protected

Referenced by isComplex(), and setComplex().

◆ iter_max

int escript::SolverBuddy::iter_max
protected

◆ level_max

int escript::SolverBuddy::level_max
protected

Referenced by getLevelMax(), and setLevelMax().

◆ method

SolverOptions escript::SolverBuddy::method
protected

◆ min_coarse_matrix_size

int escript::SolverBuddy::min_coarse_matrix_size
protected

◆ min_sparsity

double escript::SolverBuddy::min_sparsity
protected

◆ net_time

double escript::SolverBuddy::net_time
protected

◆ num_coarse_unknowns

int escript::SolverBuddy::num_coarse_unknowns
protected

◆ num_inner_iter

int escript::SolverBuddy::num_inner_iter
protected

◆ num_iter

int escript::SolverBuddy::num_iter
protected

◆ num_level

int escript::SolverBuddy::num_level
protected

◆ ode_solver

SolverOptions escript::SolverBuddy::ode_solver
protected

Referenced by getODESolver(), and setODESolver().

◆ package

SolverOptions escript::SolverBuddy::package
protected

Referenced by getPackage(), and setPackage().

◆ post_sweeps

int escript::SolverBuddy::post_sweeps
protected

◆ pre_sweeps

int escript::SolverBuddy::pre_sweeps
protected

Referenced by getNumPreSweeps(), and setNumPreSweeps().

◆ preconditioner

SolverOptions escript::SolverBuddy::preconditioner
protected

◆ preconditioner_size

int escript::SolverBuddy::preconditioner_size
protected

Referenced by getDiagnostics(), and resetDiagnostics().

◆ refinements

int escript::SolverBuddy::refinements
protected

◆ relaxation

double escript::SolverBuddy::relaxation
protected

◆ reordering

SolverOptions escript::SolverBuddy::reordering
protected

Referenced by getReordering(), and setReordering().

◆ residual_norm

double escript::SolverBuddy::residual_norm
protected

◆ restart

int escript::SolverBuddy::restart
protected

Referenced by getRestart(), and setRestart().

◆ set_up_time

double escript::SolverBuddy::set_up_time
protected

◆ smoother

SolverOptions escript::SolverBuddy::smoother
protected

Referenced by getSmoother(), and setSmoother().

◆ sweeps

int escript::SolverBuddy::sweeps
protected

◆ symmetric

bool escript::SolverBuddy::symmetric
protected

◆ target

SolverOptions escript::SolverBuddy::target
protected

Referenced by getSolverTarget(), and setSolverTarget().

◆ time

double escript::SolverBuddy::time
protected

◆ time_step_backtracking_used

bool escript::SolverBuddy::time_step_backtracking_used
protected

◆ tolerance

double escript::SolverBuddy::tolerance
protected

Referenced by getTolerance(), and setTolerance().

◆ trilinosParams

boost::python::dict escript::SolverBuddy::trilinosParams
protected

◆ truncation

int escript::SolverBuddy::truncation
protected

Referenced by getTruncation(), and setTruncation().

◆ use_local_preconditioner

bool escript::SolverBuddy::use_local_preconditioner
protected

◆ use_panel

bool escript::SolverBuddy::use_panel
protected

◆ verbose

bool escript::SolverBuddy::verbose
protected

The documentation for this class was generated from the following files: