Skip to content

Commit a54875b

Browse files
author
Jens Frenkel
committed
- fix dynamic stateselection der({x,y}) -> {der(x),der(y)}
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@12808 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent cb13dcf commit a54875b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Compiler/BackEnd/IndexReduction.mo

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2608,7 +2608,8 @@ algorithm
26082608
e1 = listGet(explst,1);
26092609
e1 = Util.if_(intGt(rang,1),DAE.ARRAY(DAE.T_REAL_DEFAULT,false,explst),e1);
26102610
e2 = listGet(explst,1);
2611-
e2 = Util.if_(intGt(rang,1),DAE.CALL(Absyn.IDENT("der"),{DAE.ARRAY(DAE.T_REAL_DEFAULT,false,explst)},DAE.callAttrBuiltinReal),DAE.CALL(Absyn.IDENT("der"),{e2},DAE.callAttrBuiltinReal));
2611+
explst = List.map(explst,makeder);
2612+
e2 = Util.if_(intGt(rang,1),DAE.ARRAY(DAE.T_REAL_DEFAULT,false,explst),DAE.CALL(Absyn.IDENT("der"),{e2},DAE.callAttrBuiltinReal));
26122613
con = DAE.RELATION(contexp,DAE.EQUAL(DAE.T_INTEGER_DEFAULT),DAE.ICONST(index),-1,NONE());
26132614
wc = BackendDAE.WHEN_CLAUSE(con,{BackendDAE.REINIT(crset,e1,DAE.emptyElementSource)},NONE());
26142615
startvalues = List.map(varlst,BackendVariable.varStartValue);
@@ -2618,6 +2619,14 @@ algorithm
26182619
end match;
26192620
end generateSelectEquationsMulti;
26202621

2622+
protected function makeder
2623+
"function makeder
2624+
Author: Frenkel TUD 2012-09"
2625+
input DAE.Exp inExp;
2626+
output DAE.Exp outExp;
2627+
algorithm
2628+
outExp := DAE.CALL(Absyn.IDENT("der"),{inExp},DAE.callAttrBuiltinReal);
2629+
end makeder;
26212630

26222631
protected function changeVarToStartValue "
26232632
function changeVarToStartValue

0 commit comments

Comments
 (0)