1 #include "parameters/parameters_linear_solver.h" 8 prm.enter_subsection(
"linear solver");
10 prm.declare_entry(
"linear_solver_output",
"quiet",
11 dealii::Patterns::Selection(
"quiet|verbose"),
12 "State whether output from linear solver should be printed. " 13 "Choices are <quiet|verbose>.");
15 prm.declare_entry(
"linear_solver_type",
"gmres",
16 dealii::Patterns::Selection(
"direct|gmres"),
17 "Enum of linear solver" 18 "Choices are <direct|gmres>.");
20 prm.enter_subsection(
"gmres options");
22 prm.declare_entry(
"linear_residual_tolerance",
"1e-4",
23 dealii::Patterns::Double(),
24 "Linear residual tolerance for convergence of the linear system");
25 prm.declare_entry(
"max_iterations",
"1000",
26 dealii::Patterns::Integer(),
27 "Maximum number of iterations for linear solver");
28 prm.declare_entry(
"restart_number",
"30",
29 dealii::Patterns::Integer(),
30 "Number of iterations before restarting GMRES");
33 prm.declare_entry(
"ilut_fill",
"1",
34 dealii::Patterns::Integer(),
35 "Amount of additional fill-in elements besides the sparse matrix structure." 36 "For ilut_fill >= 1.0, " 37 "Number of entries to keep in the strict upper triangle of the " 38 " current row, and in the strict lower triangle of the current " 39 " row. It does NOT correspond to the $p$ parameter in Saad's original. " 40 " description. This parameter represents a maximum fill fraction. " 41 " In this implementation, the L and U factors always contains nonzeros corresponding " 42 " to the original sparsity pattern of A, so this value should be >= 1.0. " 43 " Letting $fill = \frac{(level-of-fill - 1)*nnz(A)}{2*N}$, " 44 " each row of the computed L and U factors contains at most $fill$ " 45 " nonzero elements in addition to those from the sparsity pattern of A." 46 " For ilut_fill >= 1.0, " 47 " Typical graph-based level of-fill of the factorization such that the pattern corresponds to A^(p+1). ");
48 prm.declare_entry(
"ilut_drop",
"0.0",
49 dealii::Patterns::Double(),
50 "relative size of elements which should be dropped when forming an incomplete lu decomposition with threshold");
51 prm.declare_entry(
"ilut_rtol",
"1.0",
52 dealii::Patterns::Double(),
53 "Amount of an absolute perturbation that will be added to the diagonal of the matrix, " 54 "which sometimes can help to get better preconditioners");
55 prm.declare_entry(
"ilut_atol",
"0.0",
56 dealii::Patterns::Double(),
57 "Factor by which the diagonal of the matrix will be scaled, " 58 "which sometimes can help to get better preconditioners");
60 prm.leave_subsection();
62 prm.enter_subsection(
"JFNK options");
64 prm.declare_entry(
"newton_residual",
"1E-7",
65 dealii::Patterns::Double(),
66 "Convergence tolerance for Newton iterations");
67 prm.declare_entry(
"newton_max_iterations",
"100",
68 dealii::Patterns::Integer(),
69 "Maximum number of Newton iterations");
70 prm.declare_entry(
"perturbation_magnitude",
"1.490116119384765625e-8",
71 dealii::Patterns::Double(),
72 "Small perturbation for Jacobian-free methods." 73 " Default value is the square root of machine epsilon.");
75 prm.leave_subsection();
78 prm.leave_subsection();
83 prm.enter_subsection(
"linear solver");
85 const std::string output_string = prm.get(
"linear_solver_output");
89 const std::string solver_string = prm.get(
"linear_solver_type");
92 if (solver_string ==
"gmres")
95 prm.enter_subsection(
"gmres options");
101 ilut_fill = prm.get_integer(
"ilut_fill");
106 prm.leave_subsection();
109 prm.enter_subsection(
"JFNK options");
115 prm.leave_subsection();
118 prm.leave_subsection();
double ilut_drop
Threshold to drop terms close to zero.
static void declare_parameters(dealii::ParameterHandler &prm)
Declares the possible variables and sets the defaults.
double ilut_atol
Add ilu_rtol to diagonal for more diagonal dominance.
Files for the baseline physics.
int newton_max_iterations
Maximum number of Newton iterations (for Jacobian-free Newton-Krylov)
int restart_number
Number of iterations before restarting GMRES.
double linear_residual
Tolerance for linear residual.
LinearSolverEnum linear_solver_type
direct or gmres.
double ilut_rtol
Multiplies diagonal by ilut_rtol for more diagonal dominance.
int max_iterations
Maximum number of linear iteration.
void parse_parameters(dealii::ParameterHandler &prm)
Parses input file and sets the variables.
int ilut_fill
ILU fill-in.
double perturbation_magnitude
Small perturbation magnitude for Jacobian-free methods.
double newton_residual
Tolerance for Newton iteration residual (for Jacobian-free Newton-Krylov)
OutputEnum linear_solver_output
Can either be verbose or quiet.