Skip to content

Commit

Permalink
fix function fixAliasVarsCausal2
Browse files Browse the repository at this point in the history
  • Loading branch information
Willi Braun authored and OpenModelica-Hudson committed Jan 26, 2016
1 parent de5898c commit b7eda9c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Compiler/BackEnd/RemoveSimpleEquations.mo
Expand Up @@ -257,7 +257,7 @@ protected function fixAliasVarsCausal2
output BackendDAE.BackendDAE outDAE;
protected
DAE.Exp binding;
DAE.ComponentRef rightCref;
list<DAE.ComponentRef> rightCrefs;
BackendDAE.EqSystems eqs, eqs1 = {};
BackendDAE.Shared shared;
Boolean done=false;
Expand All @@ -270,15 +270,14 @@ protected
algorithm
try
binding := BackendVariable.varBindExp(inVar);
rightCref::{} := Expression.getAllCrefs(binding);
//print("rightCref: " + ComponentReference.printComponentRefStr(rightCref) + "\n");
rightCrefs := Expression.getAllCrefs(binding);
BackendDAE.DAE(eqs, shared) := inDAE;
var := BackendVariable.setBindExp(inVar, NONE());
var := BackendVariable.setVarFixed(var, false) "??? should we do this ???";
eqn := BackendDAE.EQUATION(BackendVariable.varExp(var), binding, DAE.emptyElementSource, BackendDAE.EQ_ATTR_DEFAULT_BINDING);
for eq in eqs loop
BackendDAE.EQSYSTEM(orderedVars=orderedVars, orderedEqs=orderedEqs) := eq;
if BackendVariable.existsVar(rightCref, orderedVars, false) then
if BackendVariable.existsAnyVar(rightCrefs, orderedVars, false) then
orderedVars := BackendVariable.addVar(var, orderedVars);
orderedEqs := BackendEquation.addEquation(eqn, orderedEqs);
eqs1 := BackendDAEUtil.setEqSystEqs(BackendDAEUtil.setEqSystVars(eq, orderedVars), orderedEqs)::eqs1;
Expand Down

0 comments on commit b7eda9c

Please sign in to comment.