Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 62d1de3

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
Add Jacobian variables to the simvar lookup
Belonging to [master]: - #2097 - OpenModelica/OpenModelica-testsuite#814
1 parent 705b6a1 commit 62d1de3

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

Compiler/SimCode/SimCodeUtil.mo

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8565,14 +8565,9 @@ algorithm
85658565
outHT := List.fold(vars.intConstVars, addSimVarToHashTable, outHT);
85668566
outHT := List.fold(vars.boolConstVars, addSimVarToHashTable, outHT);
85678567
outHT := List.fold(vars.stringConstVars, addSimVarToHashTable, outHT);
8568-
if Config.simCodeTarget()=="Cpp" then
8569-
// Not needed in the hashtable (actually breaks code generation
8570-
// due to bad indexes, no information that they are seed variables
8571-
// and so on...
8572-
outHT := List.fold(vars.sensitivityVars, addSimVarToHashTable, outHT);
8573-
outHT := List.fold(vars.jacobianVars, addSimVarToHashTable, outHT);
8574-
outHT := List.fold(vars.seedVars, addSimVarToHashTable, outHT);
8575-
end if;
8568+
outHT := List.fold(vars.sensitivityVars, addSimVarToHashTable, outHT);
8569+
outHT := List.fold(vars.jacobianVars, addSimVarToHashTable, outHT);
8570+
outHT := List.fold(vars.seedVars, addSimVarToHashTable, outHT);
85768571
outHT := List.fold(vars.realOptimizeConstraintsVars, addSimVarToHashTable, outHT);
85778572
outHT := List.fold(vars.realOptimizeFinalConstraintsVars, addSimVarToHashTable, outHT);
85788573
else
@@ -13330,11 +13325,7 @@ algorithm
1333013325
equation
1333113326
//print("cref2simvar: " + ComponentReference.printComponentRefStr(inCref) + " not found!\n");
1333213327
badcref = ComponentReference.makeCrefIdent("ERROR_cref2simvar_failed " + ComponentReference.printComponentRefStr(inCref), DAE.T_REAL_DEFAULT, {});
13333-
/* Todo: This also generates an error for example itearation variables, so i commented out
13334-
"Template did not find the simulation variable for "+ ComponentReference.printComponentRefStr(cref) + ". ";
13335-
Error.addInternalError(errstr, sourceInfo());*/
13336-
then
13337-
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());
13328+
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());
1333813329
end matchcontinue;
1333913330
end cref2simvar;
1334013331

0 commit comments

Comments
 (0)