www.mooseframework.org
StateSimRunner.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #include "StateSimRunner.h"
9 #include <string>
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<GeneralUserObject>();
16  params.addRequiredParam<std::string>("model_path", "the model location for the state simulation");
17  params.addParam<unsigned int>("seed", 0, "The start seed used for sampling");
18  return params;
19 }
20 
21 StateSimRunner::StateSimRunner(const InputParameters & parameters)
22  : GeneralUserObject(parameters),
23  _model_path("model_path"),
24  _state_sim(100, parameters.get<unsigned int>("seed")), // todo max time step
25  _next_state_time(-1),
26  _ran_state_sim(false)
27 {
28  //_state_sim.setMaxTime(_dt_max); todo
30 }
31 
32 void
34 {
35 }
36 
37 void
39 {
40  _ran_state_sim = false;
41  if ((_next_state_time > 0) && (_t_step >= (int)_next_state_time))
42  {
43  _next_state_time = _state_sim.process(_t_step);
44  _ran_state_sim = true;
45  }
46 }
47 
48 Real
50 {
51  return _ran_state_sim;
52 }
53 
54 void
56 {
57 }
InputParameters validParams< StateSimRunner >()
unsigned int nextTime()
StateProcessor _state_sim
virtual void initialize() override
Real getValue() const
unsigned int process(unsigned int time_step)
virtual void execute() override
virtual void finalize() override
unsigned int _next_state_time
StateSimRunner(const InputParameters &parameters)