GRINS-0.8.0
List of all members | Public Member Functions | Static Public Member Functions
GRINS::TimeSteppingParsing Class Reference

#include <time_stepping_parsing.h>

Public Member Functions

 TimeSteppingParsing ()
 
 ~TimeSteppingParsing ()
 

Static Public Member Functions

static unsigned int parse_n_timesteps (const GetPot &input)
 
static unsigned int parse_backtrack_deltat (const GetPot &input)
 Parse option to retry failed time steps with smaller $ \Delta t $. More...
 
static double parse_theta (const GetPot &input)
 Parse value of $ \theta $ for theta method time stepping. More...
 
static double parse_deltat (const GetPot &input)
 
static std::string parse_time_stepper_name (const GetPot &input)
 

Detailed Description

Definition at line 36 of file time_stepping_parsing.h.

Constructor & Destructor Documentation

GRINS::TimeSteppingParsing::TimeSteppingParsing ( )
inline

Definition at line 40 of file time_stepping_parsing.h.

40 {};
GRINS::TimeSteppingParsing::~TimeSteppingParsing ( )
inline

Definition at line 42 of file time_stepping_parsing.h.

42 {};

Member Function Documentation

unsigned int GRINS::TimeSteppingParsing::parse_backtrack_deltat ( const GetPot &  input)
static

Parse option to retry failed time steps with smaller $ \Delta t $.

backtrack_deltat is the number of time the TimeSolver will try to resolve the timestep with a smaller $ \Delta t $. Default is 0.

Definition at line 62 of file time_stepping_parsing.C.

References GRINS::SolverParsing::dup_solver_option_check(), and grins_warning.

63  {
65  "unsteady-solver/backtrack_deltat",
66  "SolverOptions/TimeStepping/backtrack_deltat");
67 
68  unsigned int backtrack_deltat = 0;
69 
70  if( input.have_variable("unsteady-solver/backtrack_deltat") )
71  {
72  backtrack_deltat = input("unsteady-solver/backtrack_deltat",0);
73 
74  std::string warning = "WARNING: unsteady-solver/backtrack_deltat is DEPRECATED!\n";
75  warning += " Please use SolverOptions/TimeStepping/backtrack_deltat to set backtrack_deltat.\n";
76  grins_warning(warning);
77  }
78  else
79  backtrack_deltat = input("SolverOptions/TimeStepping/backtrack_deltat",0);
80 
81  return backtrack_deltat;
82  }
#define grins_warning(message)
Definition: common.h:34
static void dup_solver_option_check(const GetPot &input, const std::string &option1, const std::string &option2)
double GRINS::TimeSteppingParsing::parse_deltat ( const GetPot &  input)
static

Definition at line 109 of file time_stepping_parsing.C.

References grins_warning.

110  {
111  double delta_t = 0.0;
112 
113  if( input.have_variable("unsteady-solver/deltat") )
114  {
115  delta_t = input("unsteady-solver/deltat",0.0);
116 
117  std::string warning = "WARNING: unsteady-solver/deltat is DEPRECATED!\n";
118  warning += " Please use SolverOptions/TimeStepping/delta_t to set delta_t.\n";
119  grins_warning(warning);
120  }
121  else if( input.have_variable("SolverOptions/TimeStepping/delta_t") )
122  delta_t = input("SolverOptions/TimeStepping/delta_t",0.0);
123  else
124  libmesh_error_msg("ERROR: Could not find valid entry for delta_t!");
125 
126  return delta_t;
127  }
#define grins_warning(message)
Definition: common.h:34
unsigned int GRINS::TimeSteppingParsing::parse_n_timesteps ( const GetPot &  input)
static

Definition at line 38 of file time_stepping_parsing.C.

References GRINS::SolverParsing::dup_solver_option_check(), and grins_warning.

39  {
41  "unsteady-solver/n_timesteps",
42  "SolverOptions/TimeStepping/n_timesteps");
43 
44  unsigned int n_timesteps = 0;
45 
46  if( input.have_variable("unsteady-solver/n_timesteps") )
47  {
48  n_timesteps = input("unsteady-solver/n_timesteps",0);
49 
50  std::string warning = "WARNING: unsteady-solver/n_timesteps is DEPRECATED!\n";
51  warning += " Please use SolverOptions/TimeStepping/n_timesteps to specify # of timesteps.\n";
52  grins_warning(warning);
53  }
54  else if( input.have_variable("SolverOptions/TimeStepping/n_timesteps") )
55  n_timesteps = input("SolverOptions/TimeStepping/n_timesteps",0);
56  else
57  libmesh_error_msg("ERROR: Could not find valid entry for n_timesteps!");
58 
59  return n_timesteps;
60  }
#define grins_warning(message)
Definition: common.h:34
static void dup_solver_option_check(const GetPot &input, const std::string &option1, const std::string &option2)
double GRINS::TimeSteppingParsing::parse_theta ( const GetPot &  input)
static

Parse value of $ \theta $ for theta method time stepping.

$ \theta \in [0,1] $ Option only used for theta method-based time solvers. Defaults to 0.5.

Definition at line 84 of file time_stepping_parsing.C.

References grins_warning.

85  {
86  double theta = 0.0;
87 
88  if( input.have_variable("unsteady-solver/theta") )
89  {
90  theta = input("unsteady-solver/theta",0.5);
91 
92  std::string warning = "WARNING: unsteady-solver/theta is DEPRECATED!\n";
93  warning += " Please use SolverOptions/TimeStepping/theta to set theta.\n";
94  grins_warning(warning);
95  }
96  else
97  theta = input("SolverOptions/TimeStepping/theta",0.5);
98 
99  if( theta < 0.0 || theta > 1.0 )
100  {
101  std::stringstream ts;
102  ts << theta;
103  libmesh_error_msg("ERROR: theta must be between 0.0 and 1.0. Found: "+ts.str());
104  }
105 
106  return theta;
107  }
#define grins_warning(message)
Definition: common.h:34
std::string GRINS::TimeSteppingParsing::parse_time_stepper_name ( const GetPot &  input)
static

Definition at line 129 of file time_stepping_parsing.C.

References grins_warning, and GRINS::SolverNames::libmesh_euler_solver().

130  {
131  std::string default_stepper = SolverNames::libmesh_euler_solver();
132  std::string time_stepper = default_stepper;
133 
134  // Before, we didn't actually set the solver name, we just set whether we
135  // were transient or not. So, if we see this option was set to true, then
136  // we were time stepping with the only option available then (EulerSolver)
137  if( input("unsteady-solver/transient", false) )
138  {
139  std::string warning = "WARNING: using unsteady-solver options is DEPRECATED!\n";
140  warning += " Please use SolverOptions/TimeStepping/solver_type to set the time\n";
141  warning += " stepping algorithm.\n";
142  grins_warning(warning);
143  }
144  else
145  time_stepper = input("SolverOptions/TimeStepping/solver_type", default_stepper);
146 
147  return time_stepper;
148  }
#define grins_warning(message)
Definition: common.h:34
static const std::string libmesh_euler_solver()
Definition: solver_names.h:46

The documentation for this class was generated from the following files:

Generated on Tue Dec 19 2017 12:47:32 for GRINS-0.8.0 by  doxygen 1.8.9.1