Skip to content

Commit

Permalink
- fix for evaluateOutputOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
vwaurich authored and OpenModelica-Hudson committed Nov 19, 2015
1 parent f2902c0 commit 63cd39e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
16 changes: 9 additions & 7 deletions Compiler/BackEnd/BackendDAEOptimize.mo
Expand Up @@ -5492,12 +5492,11 @@ algorithm
BackendDAE.EQSYSTEM(orderedVars = vars) := syst;
varLst := BackendVariable.varList(vars);
varLst := List.filterOnTrue(varLst,BackendVariable.isOutputVar);
if listEmpty(varLst) then
//print("No output variables in this system\n");

//THIS SYSTEM CONTAINS OUTPUT VARIABLES
//-------------------------------------
else
if not listEmpty(varLst) then

//THIS SYSTEM CONTAINS OUTPUT VARIABLES
//-------------------------------------
outputVarIndxs := BackendVariable.getVarIndexFromVars(varLst,vars);
outputTasks := List.map(List.map1(outputVarIndxs,Array.getIndexFirst,varCompMapping),Util.tuple31);
//print("outputTasks "+stringDelimitList(List.map(outputTasks,intString),", ")+"\n");
Expand All @@ -5523,7 +5522,7 @@ algorithm
(states,stateIndxs) := BackendVariable.getVarLst(crefs,vars,{},{});
(stateIndxs,states) := List.filter1OnTrueSync(stateIndxs,stateVarIsNotVisited,varVisited,states);//not yet visited
if not listEmpty(stateIndxs) then
//print("states "+stringDelimitList(List.map(states,BackendDump.varString),"\n ")+"\n");
print("states "+stringDelimitList(List.map(states,BackendDump.varString),"\n ")+"\n");
List.map2_0(stateIndxs,Array.updateIndexFirst,1,varVisited);
//add the new tasks which are necessary for the states
stateTasks1 := List.map(List.map1(stateIndxs,Array.getIndexFirst,varCompMapping),Util.tuple31);
Expand Down Expand Up @@ -5574,8 +5573,11 @@ algorithm
(syst, _, _, mapEqnIncRow, mapIncRowEqn) := BackendDAEUtil.getIncidenceMatrixScalar(syst, BackendDAE.NORMAL(), SOME(funcTree));
syst := BackendDAETransform.strongComponentsScalar(syst,shared,mapEqnIncRow,mapIncRowEqn);

systsNew := syst::systsNew;
else
print("No output variables in this system\n");
end if;

systsNew := syst::systsNew;
end for;

//alias vars are not necessary anymore
Expand Down
4 changes: 1 addition & 3 deletions Compiler/BackEnd/EvaluateParameter.mo
Expand Up @@ -198,13 +198,11 @@ protected
BackendVarTransform.VariableReplacements repl;
algorithm
if Flags.isSet(Flags.EVAL_ALL_PARAMS) then
BackendDump.dumpBackendDAE(inDAE,"INDAE");
(outDAE,repl) := evaluateParameters(inDAE,BackendVariable.isParam);
if not BackendVarTransform.isReplacementEmpty(repl) then
BackendVarTransform.dumpReplacements(repl);
//BackendVarTransform.dumpReplacements(repl);
outDAE := replaceEvaluatedParametersEqns(outDAE, repl);
end if;
BackendDump.dumpBackendDAE(outDAE,"OUTDAE");
else
outDAE := inDAE;
end if;
Expand Down
2 changes: 1 addition & 1 deletion Compiler/SimCode/SimCodeUtil.mo
Expand Up @@ -2733,7 +2733,7 @@ algorithm
case (BackendDAE.EQSYSTEM(orderedVars=vars, orderedEqs=eqns), _, BackendDAE.TORNSYSTEM(strictTearingSet, casualTearingSet, linear=b, mixedSystem=mixedSystem))
equation
if Flags.isSet(Flags.GRAPHML) then
BackendDump.dumpBipartiteGraphStrongComponent1(inComp,BackendEquation.equationList(eqns),BackendVariable.varList(vars), SOME(BackendDAEUtil.getFunctions(ishared)),"BIPARITEGRPAH_LS_"+intString(iuniqueEqIndex));
BackendDump.dumpBipartiteGraphStrongComponent1(inComp,BackendEquation.equationList(eqns),BackendVariable.varList(vars), SOME(BackendDAEUtil.getFunctions(ishared)),"BIPARITEGRPAH_TS_"+intString(iuniqueEqIndex));
end if;

(equations_, uniqueEqIndex, tempvars) = createTornSystem(b, skipDiscInAlgorithm, strictTearingSet, casualTearingSet, isyst, ishared, iuniqueEqIndex, mixedSystem, itempvars);
Expand Down

0 comments on commit 63cd39e

Please sign in to comment.