Skip to content

Commit

Permalink
- Removed some unused stuff.
Browse files Browse the repository at this point in the history
- small fixes.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16918 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Aug 26, 2013
1 parent 27a8a7d commit 7d177c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 27 deletions.
30 changes: 5 additions & 25 deletions SimulationRuntime/c/simulation/simulation_runtime.cpp
Expand Up @@ -85,39 +85,21 @@
#include "../../interactive/omi_ServiceInterface.h"
#endif


using namespace std;

static int interactiveSimulation = 0; /* This variable signals if an simulation session is interactive or non-interactive (by default) */

/* This variable is used to get the step size value during the simulation. */
static double stepSize = 0.0;
static double currentTime = 0.0;
static int initTime = 0;
double stepSize = 0.0;

double getSimulationStepSize(double time, int *takeStep)
double getSimulationStepSize()
{
/* if the function is called first time during the simulation. */
if (!initTime) {
initTime = 1;
currentTime = time;
*takeStep = 1;
}
else {
if (currentTime != time) {
currentTime = time;
*takeStep = 1;
}
else {
*takeStep = 0;
}
}
return stepSize;
}

void printSimulationStepSize(double in_stepSize, double time, int takeStep)
void printSimulationStepSize(double in_stepSize, double time)
{
fprintf(stderr, "in_stepSize=%f, time=%f, takeStep=%d\n", in_stepSize, time, takeStep);
fprintf(stderr, "in_stepSize=%f, time=%f\n", in_stepSize, time);
}

/* const char* version = "20110520_1120"; */
Expand Down Expand Up @@ -810,10 +792,8 @@ int initRuntimeAndSimulation(int argc, char**argv, DATA *data)
function_initMemoryState();
read_input_xml(&(data->modelData), &(data->simulationInfo));
initializeOutputFilter(&(data->modelData), data->simulationInfo.variableFilter);
/* set the global stepsize, currentTime & initTime variable */
/* set the global stepsize variable */
stepSize = data->simulationInfo.stepSize;
currentTime = 0.0;
initTime = 0;

/* allocate memory for mixed system solvers */
allocatemixedSystem(data);
Expand Down
4 changes: 2 additions & 2 deletions SimulationRuntime/c/simulation/simulation_runtime.h
Expand Up @@ -95,8 +95,8 @@ extern int functionODE_residual(double *t, double *x, double *xprime, double *de
extern int function_ZeroCrossingsDASSL(fortran_integer *neqm, double *t, double *y,
fortran_integer *ng, double *gout, double *rpar, fortran_integer* ipar);

extern double getSimulationStepSize(double time, int *takeStep);
extern void printSimulationStepSize(double in_stepSize, double time, int takeStep);
extern double getSimulationStepSize();
extern void printSimulationStepSize(double in_stepSize, double time);

/* the main function of the simulation runtime!
* simulation runtime no longer has main, is defined by the generated model code which calls this function.
Expand Down

0 comments on commit 7d177c1

Please sign in to comment.