LCOV - code coverage report
Current view: top level - src/userobjects - StateSimRunner.C (source / functions) Hit Total Coverage
Test: stochastic_tools Test Coverage Lines: 22 22 100.0 %
Date: 2017-11-21 14:52:30 Functions: 8 8 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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
      13           1 : validParams<StateSimRunner>()
      14             : {
      15           1 :   InputParameters params = validParams<GeneralUserObject>();
      16           3 :   params.addRequiredParam<std::string>("model_path", "the model location for the state simulation");
      17           3 :   params.addParam<unsigned int>("seed", 0, "The start seed used for sampling");
      18           1 :   return params;
      19             : }
      20             : 
      21           1 : StateSimRunner::StateSimRunner(const InputParameters & parameters)
      22             :   : GeneralUserObject(parameters),
      23             :     _model_path("model_path"),
      24           2 :     _state_sim(100, parameters.get<unsigned int>("seed")), // todo max time step
      25             :     _next_state_time(-1),
      26           3 :     _ran_state_sim(false)
      27             : {
      28             :   //_state_sim.setMaxTime(_dt_max); todo
      29           1 :   _next_state_time = _state_sim.nextTime();
      30           1 : }
      31             : 
      32             : void
      33         100 : StateSimRunner::initialize()
      34             : {
      35         100 : }
      36             : 
      37             : void
      38         100 : StateSimRunner::execute()
      39             : {
      40         100 :   _ran_state_sim = false;
      41         100 :   if ((_next_state_time > 0) && (_t_step >= (int)_next_state_time))
      42             :   {
      43           5 :     _next_state_time = _state_sim.process(_t_step);
      44           5 :     _ran_state_sim = true;
      45             :   }
      46         100 : }
      47             : 
      48             : Real
      49         100 : StateSimRunner::getValue() const
      50             : {
      51         100 :   return _ran_state_sim;
      52             : }
      53             : 
      54             : void
      55         100 : StateSimRunner::finalize()
      56             : {
      57        1912 : }

Generated by: LCOV version 1.11