oomph::Factories Namespace Reference

Functions

TimeSteppertime_stepper_factory (const std::string &ts_name)
 

Function Documentation

◆ time_stepper_factory()

TimeStepper* oomph::Factories::time_stepper_factory ( const std::string &  ts_name)

Make a timestepper from an input argument using new.

251  {
252 
253  // Always make timestepper adaptive, we can control adaptivity by
254  // calling adaptive or non adaptive newton solve.
255  bool adaptive_flag = true;
256 
257  if(ts_name == "bdf1")
258  {
259  return new BDF<1>(adaptive_flag);
260  }
261  else if(ts_name == "bdf2")
262  {
263  return new BDF<2>(adaptive_flag);
264  }
265  else if(ts_name == "real-imr")
266  {
267  IMR* mp_pt = new IMR(adaptive_flag);
268  ExplicitTimeStepper* pred_pt = new EBDF3;
269  mp_pt->set_predictor_pt(pred_pt);
270  return mp_pt;
271  }
272  else if(ts_name == "imr")
273  {
274  IMRByBDF* mp_pt = new IMRByBDF(adaptive_flag);
275  ExplicitTimeStepper* pred_pt = new EBDF3;
276  mp_pt->set_predictor_pt(pred_pt);
277  return mp_pt;
278  }
279  else if(ts_name == "steady")
280  {
281  // 2 steps so that we have enough space to do reasonable time
282  // derivative estimates in e.g. energy derivatives.
283  return new Steady<3>;
284  }
285  else if(ts_name == "tr")
286  {
287  // 2 steps so that we have enough space to do reasonable time
288  // derivative estimates in e.g. energy derivatives.
289  return new TR(adaptive_flag);
290  }
291  else
292  {
293  std::string err = "Unrecognised time stepper name";
294  throw OomphLibError(err, OOMPH_CURRENT_FUNCTION,
296  }
297  }
#define TR
Definition: common.h:40
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::TimeStepper::set_predictor_pt(), oomph::Global_string_for_annotation::string(), and TR.

Referenced by main().