Handling time

The simulation time information is only available from the initializeRun , runStep , and finalizeRun methods. They are accessible through the openfluid::base::SimulationInfo and openfluid::base::SimulationStatus classes passed through methods parameters.
The information passed through these classes can be used to get the current time step, the value of the time step in second, the current real date and time, ...

Example:

bool MyFunc::runStep(const openfluid::base::SimulationStatus* SimStatus)
{
  int CurrentStep;
  double TmpValue;
  openfluid::core::Unit* SU;
  DECLARE_UNITS_ORDERED_LOOP(17);
  
  CurrentStep = SimStatus->getCurrentStep();  
  
  BEGIN_UNITS_ORDERED_LOOP(17,"SU",SU)
    OPENFLUID_GetVariable(SU,"the.requested.var",CurrentStep-1,TmpValue);
  END_LOOP;      
}

The real time information is given through the openfluid::core::DateTime class.


Generated using Doxygen 1.7.6.1
Creative Commons License Creative Commons By-NC-ND license