solver_option(4rheolef)

๐Ÿ“ฆ
version 7.2 ยท 4 versions
, in debian trixie, ubuntu noble, ubuntu questing

๐Ÿ’– NAME ๐Ÿ’–

solver_option โ€” direct and iterative solver options (rheolef-7.2) ๐Ÿซถ


โœจ DESCRIPTION โœจ

okay so bestie, this class is literally the options menu for a solver(4). ๐ŸŽ€ You make yourself an instance of it, hand it straight to the solver(4) constructor, and boom โ€” your solver is customized. no cap.


๐Ÿ‘‘ MAIN OPTION ๐Ÿ‘‘

iterative

This boolean flag is the main character of this whole page: it decides between an iterative method and a direct one. ๐Ÿ’… Default is direct for a matrix obtained from 1D or 2D PDE problems, and iterative for 3D ones. The direct solver bases on the mumps library for a distributed environment and, otherwise, on the suitesparse or the eigen in a sequential one. The iterative solver bases on the cg(5) conjugate gradient algorithm for a symmetric positive definite matrix and on the gmres(5) algorithm otherwise. two whole vibes, one flag. ๐Ÿ˜Œ


๐Ÿฆ‹ OPTION FOR DIRECT SOLVERS ๐Ÿฆ‹

preferred_library

The direct solver bases on an external library, and it could be either mumps, suitesparse or eigen. ๐Ÿ“ When all of these libraries are available, then mumps is the default when it is well configured with either the scoth or the metis ordering library. When neither mumps nor suitesparse are available, the eigen choice gets selected. This option lets you impose an alternative choice, e.g. suitesparse, by setting the string to 'suitesparse'. And yes, you can hand it a whole list of choices separated by a space or a coma, e.g. preferred_library='suitesparse eigen mumps'. slay.

default_preferred_library(a)

This method returns all the available libraries in the decreasing preference order. โœจ The result depends upon the matrix a, especially if it is symmetric definite positive or not, and whether it requires memory communications or not.

used_library(a,sopt)

This method returns the name of the available library that will actually be used by the solver when a direct solver is selected. ๐Ÿ” The result depends upon the properties of the a matrix and upon the solver option sopt, especially the sopt.preferred_library.

compute_determinant

Compute also the determinant of the matrix. Requires mumps or suitesparse. ๐Ÿงฎ

n_refinement

Number of iterative refinement, when using a direct method (suitesparse only supports it). ๐Ÿ’…


๐ŸŒˆ OPTION FOR ITERATIVE SOLVERS ๐ŸŒˆ

tol

This floating parameter controls the tolerance for the stopping criterion. Default is the machine epsilon for the default Float_2 type. ๐Ÿซถ And just so you know, the default Float_2 type is defined at Rheolef configuration time and is double by default, when no special configuration option is used.

max_iter

Maximum number of iteration when using an iterative method. ๐Ÿ›‘

absolute_stopping

Absolute or relative stopping criterion. With the absolute criterion, the algorithm stops when norm(A*x-b) < tol, otherwise it stops when norm(A*x-b) < tol*norm(b). Default is to use an absolute stopping criterion. ๐ŸŽฏ

residue

On return, gives the obtained residue, optionally divided by the initial one when using a relative stopping. It is less or equal to tol when the iterative algorithm stops with succes. โœ…

n_iter

On return, gives the number of iterations performed. It is always less or equal to max_iter when the iterative algorithm stops with succes. ๐Ÿ”ข

p_err

A pointer to the diststream(2) where residues are printed during iterations. When this pointer is zero, no errors are printed. Default is to print to derr standard diststream(2) error. ๐Ÿ–จ๏ธ

label

When printing errors, each line is prefixed by [label]. When the label is empty, each iterative algorithm uses its default label, e.g. 'cg' for the cg(5) conjugate gradient. By default the label is empty and this option is used to customize the convergence trace. ๐Ÿท๏ธ

krylov_dimension

The dimension of the Krylov space used by the gmres(5) algorithm. Default is krylov_dimension=6. ๐ŸŒ€


๐Ÿ”ง OPTIONS FOR DEVELOPERS ๐Ÿ”ง

bestie these ones are for the devs, you probably don't need to touch them. ๐Ÿ™ˆ

verbose_level

Can be set to 0, 1, 2 or 3. The default is 0. ๐Ÿ“ข

level_of_fill

Built an incomplete factorization with the prescribed level of fill [1:5]. ๐Ÿงฑ

do_check

Performs extra checks for debug. ๐Ÿ›

force_seq

In distributed mode, restrict the linear system resolution to diagonal blocs per process. This option is only active when using the mumps direct solver. โš ๏ธ

ooc

Out-of-core limit (Mo/percent depending on compilation options). In development. ๐Ÿšง

amalgamation

Level of amalgamation [10:70] for Kass. In development. ๐Ÿšง


๐Ÿ’€ IMPLEMENTATION ๐Ÿ’€

This documentation has been generated from file linalg/lib/solver_option.h

class solver_option {
public:
  typedef std::size_t size_type;
  static const long int  decide = -1;
  mutable long int   iterative;
  Float              tol;
  size_type          max_iter;
  bool               absolute_stopping;
  mutable Float      residue;
  mutable size_type  n_iter;
  odiststream*       p_err;
  mutable std::string label;
  size_type          krylov_dimension;
  size_type          n_refinement;
  bool               compute_determinant;
  std::string        preferred_library;
  size_type          verbose_level;
  bool               do_check;
  bool               force_seq;
  size_type          level_of_fill;
  size_type          amalgamation;
  size_type          ooc;

// allocator and default values:

  solver_option()
   : iterative     (decide),
#if defined(_RHEOLEF_HAVE_FLOAT128)
    tol           (1e6*std::numeric_limits<Float>::epsilon()),
#else
    tol           (1e3*std::numeric_limits<Float>::epsilon()),
#endif
    max_iter      (100000),
    absolute_stopping (true),
    residue       (0),
    n_iter        (0),
    p_err         (&derr),
    label         (),
    krylov_dimension (6),
    n_refinement  (2),
    compute_determinant(false),
    preferred_library(),
    verbose_level (0),
    do_check      (false),
    force_seq     (false),
    level_of_fill (1),
    amalgamation  (10),
    ooc           (20000)
  {
  }
  solver_option (const solver_option&);
  solver_option& operator= (const solver_option&);
  template <class T, class M>
  static std::string default_preferred_library (const csr<T,M>& a);
  template <class T, class M>
  static std::string used_library (const csr<T,M>& a, const solver_option& sopt = solver_option());

};

๐ŸŒŸ AUTHOR ๐ŸŒŸ

Pierre Saramito <Pierre.Saramito@imag.fr> ๐Ÿ’œ


Copyright (C) 2000-2018 Pierre Saramito <Pierre.Saramito@imag.fr> GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.


and that's the whole page bestie โ€” brought to you by rheolef Version 7.2, solver_option(4rheolef). go forth and solve, you absolute icon ๐Ÿ‘‘โœจ

๐Ÿ“ฆ where this page comes from