Changeset 7d177c1 in OpenModelica


Ignore:
Timestamp:
2013-08-26T12:04:59+02:00 (11 years ago)
Author:
Adeel Asghar <adeel.asghar@…>
Branches:
Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
Children:
569c48d4
Parents:
27a8a7db
Message:
  • Removed some unused stuff.
  • small fixes.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16918 f25d12d1-65f4-0310-ae8a-bbce733d8d8e

Location:
SimulationRuntime/c/simulation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • SimulationRuntime/c/simulation/simulation_runtime.cpp

    r96b7fe8 r7d177c1  
    8686#endif
    8787
    88 
    8988using namespace std;
    9089
     
    9291
    9392/* This variable is used to get the step size value during the simulation. */
    94 static double stepSize = 0.0;
    95 static double currentTime = 0.0;
    96 static int initTime = 0;
    97 
    98 double getSimulationStepSize(double time, int *takeStep)
    99 {
    100   /* if the function is called first time during the simulation. */
    101   if (!initTime) {
    102     initTime = 1;
    103     currentTime = time;
    104     *takeStep = 1;
    105   }
    106   else {
    107     if (currentTime != time) {
    108       currentTime = time;
    109       *takeStep = 1;
    110     }
    111     else {
    112       *takeStep = 0;
    113     }
    114   }
     93double stepSize = 0.0;
     94
     95double getSimulationStepSize()
     96{
    11597  return stepSize;
    11698}
    11799
    118 void printSimulationStepSize(double in_stepSize, double time, int takeStep)
    119 {
    120   fprintf(stderr, "in_stepSize=%f, time=%f, takeStep=%d\n", in_stepSize, time, takeStep);
     100void printSimulationStepSize(double in_stepSize, double time)
     101{
     102  fprintf(stderr, "in_stepSize=%f, time=%f\n", in_stepSize, time);
    121103}
    122104
     
    811793  read_input_xml(&(data->modelData), &(data->simulationInfo));
    812794  initializeOutputFilter(&(data->modelData), data->simulationInfo.variableFilter);
    813   /* set the global stepsize, currentTime & initTime variable */
     795  /* set the global stepsize variable */
    814796  stepSize = data->simulationInfo.stepSize;
    815   currentTime = 0.0;
    816   initTime = 0;
    817797
    818798  /* allocate memory for mixed system solvers */
  • SimulationRuntime/c/simulation/simulation_runtime.h

    r44afde4 r7d177c1  
    9696        fortran_integer *ng, double *gout, double *rpar, fortran_integer* ipar);
    9797
    98 extern double getSimulationStepSize(double time, int *takeStep);
    99 extern void printSimulationStepSize(double in_stepSize, double time, int takeStep);
     98extern double getSimulationStepSize();
     99extern void printSimulationStepSize(double in_stepSize, double time);
    100100
    101101/* the main function of the simulation runtime!
Note: See TracChangeset for help on using the changeset viewer.