.TH "solver_option" 4rheolef "Version 7.2" "rheolef" \" -*- nroff -*- .ad l .nh .SH NAME solver_option \- direct and iterative solver options (rheolef-7\&.2) .PP .SH "DESCRIPTION" .PP This class implements a set of options for customizing a \fBsolver(4)\fP\&. An instance of this class can be supplied to the \fBsolver(4)\fP constructor\&. .SH "MAIN OPTION" .PP \fCiterative\fP .PP .RS 4 This boolean flag controls the choice between an iterative or a direct method\&. Default is direct for matrix obtained from 1D or 2D PDE problems and iterative for 3D ones\&. The direct solver bases on the \fCmumps\fP library for a distributed environment and, otherwise, on the \fCsuitesparse\fP or the \fCeigen\fP in a sequential one\&. The iterative solver bases on \fBcg(5)\fP conjugate gradient algorithm for symmetric positive definite matrix and on the \fBgmres(5)\fP algorithm otherwise\&. .RE .PP .SH "OPTION FOR DIRECT SOLVERS" .PP \fCpreferred_library\fP .PP .RS 4 The direct solver bases on an external library: it could be either \fCmumps\fP, \fCsuitesparse\fP or \fCeigen\fP\&. When all these libraries are available, then \fCmumps\fP is the default when is is well configured with either the \fCscoth\fP or the \fCmetis\fP ordering library\&. When neither \fCmumps\fP nor \fCsuitesparse\fP are available, the \fCeigen\fP choice is selected\&. This option allows one to impose an alternative choice e\&.g\&. \fCsuitesparse\fP, by setting the string to \fC'suitesparse'\fP\&. This option can be provided as a list of choices, separated by a space or a coma, e\&.g\&. \fCpreferred_library='suitesparse eigen mumps'\fP\&. .RE .PP \fCdefault_preferred_library(a)\fP .PP .RS 4 This method returns all the the available libraries in the decreasing preference order\&. The result depends upon the matrix \fCa\fP, especially if it is symmetric definite positive or not, and whether it requires memory communications or not\&. .RE .PP used_library(a,sopt) .PP .RS 4 This method returns the name of the available library that will be used by the \fCsolver\fP when a direct solvers is selected\&. The result depends upon the properties of the \fCa\fP matrix and upon the solver option \fCsopt\fP, especially the \fCsopt\&.preferred_library\fP\&. .RE .PP \fCcompute_determinant\fP .PP .RS 4 Compute also the determinant of the matrix\&. Requires \fCmumps\fP or \fCsuitesparse\fP\&. .RE .PP \fCn_refinement\fP .PP .RS 4 Number of iterative refinement, when using a direct method (\fCsuitesparse\fP only support it)\&. .RE .PP .SH "OPTION FOR ITERATIVE SOLVERS" .PP \fCtol\fP .PP .RS 4 This floating parameter control the tolerance for the stopping criterion\&. Default is the machine epsilon for the default \fBFloat_2\fP type\&. Recall that the default \fBFloat_2\fP type is defined at Rheolef \fBconfiguration\fP time and is \fCdouble\fP by default, when no special \fBconfiguration\fP option is used\&. .RE .PP \fCmax_iter\fP .PP .RS 4 Maximum number of iteration when using an iterative method\&. .RE .PP \fCabsolute_stopping\fP .PP .RS 4 Absolute or relative stopping criterion\&. .br With the absolute criterion, the algorithm stops when \fCnorm(A*x-b) < tol\fP, otherwise it stops when \fCnorm(A*x-b) < tol*norm(b)\fP\&. Default is to use an absolute stopping criterion\&. .RE .PP \fCresidue\fP .PP .RS 4 On return, gives the obtained residue, optionally divided by the initial one when using a relative stopping\&. It is less or equal to \fCtol\fP when the iterative algorithm stops with succes\&. .RE .PP \fCn_iter\fP .PP .RS 4 On return, gives the number of iterations performed\&. It is always less or equal to \fCmax_iter\fP when the iterative algorithm stops with succes\&. .RE .PP \fCp_err\fP .PP .RS 4 A pointer to the \fBdiststream(2)\fP where residues are printed during iterations\&. When this pointer is zero, no errors are printed\&. Default is to print to \fCderr\fP standard \fBdiststream(2)\fP error\&. .RE .PP \fClabel\fP .PP .RS 4 When printing errors, each line is prefixed by \fC[label]\fP\&. When the label is empty, each iterative algorithm uses its default label, e\&.g\&. \fC'cg'\fP for the \fBcg(5)\fP conjugate gradient\&. By default the label is empty and this option is used to customize the convergence trace\&. .RE .PP \fCkrylov_dimension\fP .PP .RS 4 The dimension of the Krylov space used by the \fBgmres(5)\fP algorithm\&. Default is \fCkrylov_dimension=6\fP\&. .RE .PP .SH "OPTIONS FOR DEVELOPERS" .PP \fCverbose_level\fP .PP .RS 4 Can be set to 0, 1, 2 or 3\&. The default is 0\&. .RE .PP \fClevel_of_fill\fP .PP .RS 4 Built an incomplete factorization with the prescribed level of fill [1:5]\&. .RE .PP \fCdo_check\fP .PP .RS 4 Performs extra checks for debug\&. .RE .PP \fCforce_seq\fP .PP .RS 4 In distributed mode, restrict the linear system resolution to diagonal blocs per process\&. This option is only active when using the \fCmumps\fP direct solver\&. .RE .PP \fCooc\fP .PP .RS 4 Out-of-core limit (Mo/percent depending on compilation options)\&. In development\&. .RE .PP \fCamalgamation\fP .PP .RS 4 Level of amalgamation [10:70] for Kass\&. In development\&. .RE .PP .SH "IMPLEMENTATION" .PP This documentation has been generated from file linalg/lib/solver_option\&.h .PP .PP .nf 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::epsilon()), #else tol (1e3*std::numeric_limits::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 static std::string default_preferred_library (const csr& a); template static std::string used_library (const csr& a, const solver_option& sopt = solver_option()); .fi .PP .PP .nf }; .fi .PP .SH AUTHOR Pierre Saramito .SH COPYRIGHT Copyright (C) 2000-2018 Pierre Saramito GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.