Skip to content

Commit

Permalink
Add Jacobian variables to the simvar lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Jan 5, 2018
1 parent 705b6a1 commit 62d1de3
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions Compiler/SimCode/SimCodeUtil.mo
Expand Up @@ -8565,14 +8565,9 @@ algorithm
outHT := List.fold(vars.intConstVars, addSimVarToHashTable, outHT);
outHT := List.fold(vars.boolConstVars, addSimVarToHashTable, outHT);
outHT := List.fold(vars.stringConstVars, addSimVarToHashTable, outHT);
if Config.simCodeTarget()=="Cpp" then
// Not needed in the hashtable (actually breaks code generation
// due to bad indexes, no information that they are seed variables
// and so on...
outHT := List.fold(vars.sensitivityVars, addSimVarToHashTable, outHT);
outHT := List.fold(vars.jacobianVars, addSimVarToHashTable, outHT);
outHT := List.fold(vars.seedVars, addSimVarToHashTable, outHT);
end if;
outHT := List.fold(vars.sensitivityVars, addSimVarToHashTable, outHT);
outHT := List.fold(vars.jacobianVars, addSimVarToHashTable, outHT);
outHT := List.fold(vars.seedVars, addSimVarToHashTable, outHT);
outHT := List.fold(vars.realOptimizeConstraintsVars, addSimVarToHashTable, outHT);
outHT := List.fold(vars.realOptimizeFinalConstraintsVars, addSimVarToHashTable, outHT);
else
Expand Down Expand Up @@ -13330,11 +13325,7 @@ algorithm
equation
//print("cref2simvar: " + ComponentReference.printComponentRefStr(inCref) + " not found!\n");
badcref = ComponentReference.makeCrefIdent("ERROR_cref2simvar_failed " + ComponentReference.printComponentRefStr(inCref), DAE.T_REAL_DEFAULT, {});
/* Todo: This also generates an error for example itearation variables, so i commented out
"Template did not find the simulation variable for "+ ComponentReference.printComponentRefStr(cref) + ". ";
Error.addInternalError(errstr, sourceInfo());*/
then
SimCodeVar.SIMVAR(badcref, BackendDAE.VARIABLE(), "", "", "", -2, NONE(), NONE(), NONE(), NONE(), false, DAE.T_REAL_DEFAULT, false, NONE(), SimCodeVar.NOALIAS(), DAE.emptyElementSource, SimCodeVar.INTERNAL(), NONE(), {}, false, true, false, NONE(), NONE());
then SimCodeVar.SIMVAR(badcref, BackendDAE.VARIABLE(), "", "", "", -2, NONE(), NONE(), NONE(), NONE(), false, DAE.T_REAL_DEFAULT, false, NONE(), SimCodeVar.NOALIAS(), DAE.emptyElementSource, SimCodeVar.INTERNAL(), NONE(), {}, false, true, false, NONE(), NONE());
end matchcontinue;
end cref2simvar;

Expand Down

0 comments on commit 62d1de3

Please sign in to comment.