Skip to content

Commit

Permalink
- bugfix removeSimpleEquation, do not remove toplevel inputs
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@8704 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Apr 19, 2011
1 parent 47066f2 commit 4cd8255
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions Compiler/BackEnd/BackendDAEOptimize.mo
Expand Up @@ -1606,9 +1606,15 @@ algorithm
Boolean b,b1,b2;
BackendDAE.Variables vars,knvars;
DAE.ComponentRef cr;
BackendDAE.Var var;

case((e as DAE.CREF(DAE.CREF_IDENT(ident = "time",subscriptLst = {}),_), (_,vars,knvars)))
then ((e,false,(true,vars,knvars)));
case((e as DAE.CREF(cr,_), (_,vars,knvars)))
equation
(var::_,_::_)= BackendVariable.getVar(cr, knvars) "input variables stored in known variables are input on top level" ;
true = BackendVariable.isVarOnTopLevelAndInput(var);
then ((e,false,(true,vars,knvars)));
case((e as DAE.CALL(path = Absyn.IDENT(name = "sample"), expLst = {_,_}), (_,vars,knvars))) then ((e,false,(true,vars,knvars) ));
case((e as DAE.CALL(path = Absyn.IDENT(name = "pre"), expLst = {_}), (_,vars,knvars))) then ((e,false,(true,vars,knvars) ));
case((e,(b,vars,knvars))) then ((e,not b,(b,vars,knvars)));
Expand Down
2 changes: 1 addition & 1 deletion Compiler/BackEnd/BackendDAETransform.mo
Expand Up @@ -1173,7 +1173,7 @@ algorithm
(state,stateno) = selectDummyState(states, stateindx, dae, m, mt);
// print("Selected ");print(ComponentReference.printComponentRefStr(state));print(" as dummy state\n");
// print(" From candidates:");print(Util.stringDelimitList(Util.listMap(states,ComponentReference.printComponentRefStr),", "));print("\n");
//dae = propagateDummyFixedAttribute(dae, eqns_1, state, stateno);
// dae = propagateDummyFixedAttribute(dae, eqns_1, state, stateno);
(dummy_der,dae) = newDummyVar(state, dae) ;
// print("Chosen dummy: ");print(ComponentReference.printComponentRefStr(dummy_der));print("\n");
reqns = BackendDAEUtil.eqnsForVarWithStates(mt, stateno);
Expand Down
7 changes: 3 additions & 4 deletions Compiler/BackEnd/BackendDump.mo
Expand Up @@ -1153,11 +1153,10 @@ algorithm
match (inExp,inString)
local
Boolean e;
String s,se,str;
case (SOME(e),s)
String s,str;
case (SOME(true),s)
equation
se = boolString(e);
str = stringAppendList({s," = ",se," "});
str = stringAppendList({s," = true "});
print(str);
then ();
else ();
Expand Down

0 comments on commit 4cd8255

Please sign in to comment.