solver_option2rheolef
Options for direct or interative solvers
Overview
This class implements a set of options for direct or iterative solvers, as implemented by the solver(2). An instance of this class can be supplied to the solver constructor.
Options
iterative-
Indicate if we want to use an iterative solver or a a direct one. Default is direct for 1D or 2D problems and iterative for 3D ones. Direct solver is
mumpswhen available, otherwiseumfpackor builtin solver when none of these solvers are available at Rheolef configure time. Iterative solver iscgfor symmetric positive definite systems andgmresotherwise.
Options for iterative solvers
tol-
Tolerance for the stopping criterion. Default is the machine epsilon for the default
Floattype. The defaultFloattype isdoubledefined at Rheolef configure time and isdoubleby default, when no special configure option is used.
max_iter-
Maximum number of iteration when using 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 relatiive stopping. It is less or equal to
tolwhen the iterative algorithm stops with succes.
n_iter-
On return, gives the number of iterations performed. It is always less or equal to
max_iterwhen the iterative algorithm stops with succes.
p_err-
A pointer to the
odiststeamstandard error where residues are printed during iterations. When this pointer is zero, no errors are printed. Default is to print toderr.
label-
When printing errors, each line is prefixed by
[@var{label]}. When the label is empty, each iterative algorithm uses its default label, e.g."cg"for the conjugate gradientcg. By default the label is empty and this option is used to superset the algorithm default.
krylov_dimension-
The dimension of the Krylov space used by the
gmresalgorithm. Default iskrylov_dimension=6.
Options for direct solvers
n_refinement-
Number of iterative refinement, when using direct method (
umfpackonly support it). This option is only active when using iterative solvers.
compute_determinant-
Compute also the determinant of the matrix. This option is only active when using direct solvers. Requires
mumpsorumfpack.
prefered_library-
When both
mumpsandumfpackare available, thenmumpsis the default. This option allows one to force to chooseumfpack, by setting the string to"umfpack". This option is only active when using direct solvers.
Options for developpers
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
mumpsdirect 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
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 prefered_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 (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),
prefered_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&);
};