Skip to content

Commit

Permalink
- simplify macros RELATIONHYSTERESIS and RELATION and remove useless …
Browse files Browse the repository at this point in the history
…cases

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@20595 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
lochel committed May 14, 2014
1 parent 93e56b1 commit 7243544
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions SimulationRuntime/c/simulation/solver/model_help.h
Expand Up @@ -38,16 +38,11 @@ extern "C" {

/* lochel: I guess this is used for discrete relations */
#define RELATION(res,exp1,exp2,index,op_w) { \
if(data->simulationInfo.discreteCall == 0){ \
if(data->simulationInfo.discreteCall == 0 || data->simulationInfo.solveContinuous){ \
res = data->simulationInfo.relationsPre[index]; \
} else{ \
if(data->simulationInfo.solveContinuous){ \
res = data->simulationInfo.relationsPre[index]; \
data->simulationInfo.relations[index] = ((op_w)((exp1),(exp2))); \
} else { \
res = ((op_w)((exp1),(exp2))); \
data->simulationInfo.relations[index] = res; \
} \
} else { \
res = ((op_w)((exp1),(exp2))); \
data->simulationInfo.relations[index] = res; \
} \
}

Expand All @@ -57,16 +52,11 @@ extern "C" {
res = ((op_w)((exp1),(exp2))); \
data->simulationInfo.relations[index] = res; \
} else { \
if(data->simulationInfo.discreteCall == 0) { \
if(data->simulationInfo.discreteCall == 0 || data->simulationInfo.solveContinuous) { \
res = data->simulationInfo.relationsPre[index]; \
} else { \
if(data->simulationInfo.solveContinuous){ \
res = data->simulationInfo.relationsPre[index]; \
data->simulationInfo.relations[index] = ((op_w##ZC)((exp1),(exp2),data->simulationInfo.hysteresisEnabled[index])); \
} else { \
res = ((op_w##ZC)((exp1),(exp2),data->simulationInfo.hysteresisEnabled[index])); \
data->simulationInfo.relations[index] = res; \
} \
res = ((op_w##ZC)((exp1),(exp2),data->simulationInfo.hysteresisEnabled[index])); \
data->simulationInfo.relations[index] = res; \
} \
} \
}
Expand Down

0 comments on commit 7243544

Please sign in to comment.