32 #include "libmesh/getpot.h"
33 #include "libmesh/string_to_enum.h"
38 : _is_time_adaptive(false),
39 _target_tolerance(0.0),
40 _upper_tolerance(0.0),
56 if( (input.have_variable(
"unsteady-solver/target_tolerance") &&
57 input.have_section(
"Strategies/AdaptiveTimeStepping/target_tolerance")) ||
58 (input.have_variable(
"unsteady-solver/upper_tolerance") &&
59 input.have_section(
"Strategies/AdaptiveTimeStepping/upper_tolerance")) ||
60 (input.have_variable(
"unsteady-solver/max_growth") &&
61 input.have_section(
"Strategies/AdaptiveTimeStepping/max_growth")) )
62 libmesh_error_msg(
"ERROR: Cannot use both old and new style of options for AdaptiveTimeSteppingOptions!");
67 return input.have_variable(
"unsteady-solver/target_tolerance");
73 std::string warning =
"WARNING: Using [MeshAdaptivity/<options>] is a DEPRECATED\n";
74 warning +=
" style of input for ErrorEstimator options. Please\n";
75 warning +=
" update to use the [Strategies/ErrorEstimation/<options> style.\n";
79 std::string section =
"unsteady-solver";
85 std::string section =
"Strategies/AdaptiveTimeStepping";
92 if( input.have_variable(section+
"/target_tolerance") )
94 if( !input.have_variable(section+
"/upper_tolerance") )
95 libmesh_error_msg(
"ERROR: Must specify "+section+
"/upper_tolerance for adaptive time stepping!");
97 if( !input.have_variable(section+
"/max_growth") )
98 libmesh_error_msg(
"ERROR: Must specify "+section+
"/max_growth for adaptive time stepping!");
106 const unsigned int n_component_norm =
107 input.vector_variable_size(section+
"/component_norm");
109 for (
unsigned int i=0; i != n_component_norm; ++i)
111 const std::string current_norm = input(section+
"/component_norm", std::string(
"L2"), i);
112 _component_norm.set_type(i, libMesh::Utility::string_to_enum<libMesh::FEMNormType>(current_norm) );
void parse_new_style(const GetPot &input)
#define grins_warning(message)
void parse_options(const GetPot &input, const std::string §ion)
AdaptiveTimeSteppingOptions(const GetPot &input)
double _target_tolerance
0.0 means there is no adaptive time stepping enabled.
void check_dup_input_style(const GetPot &input) const
bool is_old_style(const GetPot &input) const
void parse_old_style(const GetPot &input)
libMesh::SystemNorm _component_norm