From 4377b66c40a832a9249a0810cce852ce46567cc6 Mon Sep 17 00:00:00 2001 From: Reza Rastak Date: Thu, 29 Aug 2019 20:06:48 -0400 Subject: [PATCH] parameter handling for a couple of classes improved --- include/deal.II/algorithms/newton.templates.h | 7 ++++--- include/deal.II/algorithms/theta_timestepping.templates.h | 2 +- source/algorithms/timestep_control.cc | 6 +++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/deal.II/algorithms/newton.templates.h b/include/deal.II/algorithms/newton.templates.h index b821beab49..e276451ee0 100644 --- a/include/deal.II/algorithms/newton.templates.h +++ b/include/deal.II/algorithms/newton.templates.h @@ -50,9 +50,9 @@ namespace Algorithms { param.enter_subsection("Newton"); ReductionControl::declare_parameters(param); - param.declare_entry("Assemble threshold", "0.", Patterns::Double()); - param.declare_entry("Stepsize iterations", "21", Patterns::Integer()); - param.declare_entry("Debug level", "0", Patterns::Integer()); + param.declare_entry("Assemble threshold", "0.", Patterns::Double(0.)); + param.declare_entry("Stepsize iterations", "21", Patterns::Integer(0)); + param.declare_entry("Debug level", "0", Patterns::Integer(0)); param.declare_entry("Debug vectors", "false", Patterns::Bool()); param.leave_subsection(); } @@ -65,6 +65,7 @@ namespace Algorithms control.parse_parameters(param); assemble_threshold = param.get_double("Assemble threshold"); n_stepsize_iterations = param.get_integer("Stepsize iterations"); + debug = param.get_integer("Debug level"); debug_vectors = param.get_bool("Debug vectors"); param.leave_subsection(); } diff --git a/include/deal.II/algorithms/theta_timestepping.templates.h b/include/deal.II/algorithms/theta_timestepping.templates.h index 9534f63678..2048a2b212 100644 --- a/include/deal.II/algorithms/theta_timestepping.templates.h +++ b/include/deal.II/algorithms/theta_timestepping.templates.h @@ -58,7 +58,7 @@ namespace Algorithms { param.enter_subsection("ThetaTimestepping"); TimestepControl::declare_parameters(param); - param.declare_entry("Theta", ".5", Patterns::Double()); + param.declare_entry("Theta", ".5", Patterns::Double(0., 1.)); param.declare_entry("Adaptive", "false", Patterns::Bool()); param.leave_subsection(); } diff --git a/source/algorithms/timestep_control.cc b/source/algorithms/timestep_control.cc index b8758f5027..9d5c865a29 100644 --- a/source/algorithms/timestep_control.cc +++ b/source/algorithms/timestep_control.cc @@ -54,9 +54,9 @@ TimestepControl::declare_parameters(ParameterHandler ¶m) { param.declare_entry("Start", "0.", Patterns::Double()); param.declare_entry("Final", "1.", Patterns::Double()); - param.declare_entry("First step", "1.e-2", Patterns::Double()); - param.declare_entry("Max step", "1.", Patterns::Double()); - param.declare_entry("Tolerance", "1.e-2", Patterns::Double()); + param.declare_entry("First step", "1.e-2", Patterns::Double(0.)); + param.declare_entry("Max step", "1.", Patterns::Double(0.)); + param.declare_entry("Tolerance", "1.e-2", Patterns::Double(0.)); param.declare_entry("Print step", "-1.", Patterns::Double()); param.declare_entry("Strategy", "uniform", -- 2.39.5