Skip to content

Commit

Permalink
- bugfix dynamic state selection for stateSelect = StateSelect.always
Browse files Browse the repository at this point in the history
- add test for EngineV6 (compile and simulation time together around 1 minute but nonliniear solver has trouble)

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@12906 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Jens Frenkel committed Sep 13, 2012
1 parent 0286fcc commit 278f3c0
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions Compiler/BackEnd/IndexReduction.mo
Expand Up @@ -1628,7 +1628,8 @@ algorithm
BackendDAE.AdjacencyMatrixEnhanced me;
BackendDAE.AdjacencyMatrixTEnhanced meT;
array<list<Integer>> mapEqnIncRow;
array<Integer> mapIncRowEqn;
array<Integer> mapIncRowEqn;
Integer dummyvarssize;
case(_,0,_,_,_,_,_,_,_,_,_)
// if no vars then there is nothing do do
then
Expand All @@ -1652,7 +1653,8 @@ algorithm
true = intGt(varSize,1);
true = intEq(eqnsSize,varSize);
Debug.fcall(Flags.BLT_DUMP, print, "equal var and eqn size\n");
Debug.fcall(Flags.BLT_DUMP, BackendDump.dumpEqSystem, BackendDAE.EQSYSTEM(vars,eqns,NONE(),NONE(),BackendDAE.NO_MATCHING()));
Debug.fcall(Flags.BLT_DUMP, BackendDump.dumpVarsArray, vars);
Debug.fcall(Flags.BLT_DUMP, BackendDump.dumpEqnsArray, eqns);
varlst = BackendDAEUtil.varList(vars);
crlst = List.map(varlst,BackendVariable.varCref);
states = List.threadTuple(crlst,List.intRange2(1,varSize));
Expand All @@ -1668,11 +1670,13 @@ algorithm
false = intGt(eqnsSize,varSize);
varlst = BackendDAEUtil.varList(vars);
varlst = List.filter(varlst, notVarStateSelectAlways);
true = intGt(eqnsSize,listLength(varlst));
dummyvarssize = listLength(varlst);
true = intEq(eqnsSize,dummyvarssize);
Debug.fcall(Flags.BLT_DUMP, print, "select dummy vars from stateselection\n");
Debug.fcall(Flags.BLT_DUMP, BackendDump.dumpEqSystem, BackendDAE.EQSYSTEM(vars,eqns,NONE(),NONE(),BackendDAE.NO_MATCHING()));
Debug.fcall(Flags.BLT_DUMP, BackendDump.dumpVarsArray, vars);
Debug.fcall(Flags.BLT_DUMP, BackendDump.dumpEqnsArray, eqns);
crlst = List.map(varlst,BackendVariable.varCref);
states = List.threadTuple(crlst,List.intRange2(1,varSize));
states = List.threadTuple(crlst,List.intRange2(1,dummyvarssize));
Debug.fcall(Flags.BLT_DUMP, print, ("Select as dummyStates:\n"));
Debug.fcall(Flags.BLT_DUMP, BackendDump.debuglst,((states,BackendDAETransform.dumpStates,"\n","\n")));
(hov1,lov,dummystates) = selectDummyStates(states,1,eqnsSize,vars,hov,inLov,inDummyStates);
Expand Down Expand Up @@ -1723,7 +1727,8 @@ algorithm
true = intGt(varSize,1);
true = intGt(eqnsSize,varSize);
print("Structural singular system:\n");
BackendDump.dumpEqSystem(BackendDAE.EQSYSTEM(vars,eqns,NONE(),NONE(),BackendDAE.NO_MATCHING()));
Debug.fcall(Flags.BLT_DUMP, BackendDump.dumpVarsArray, vars);
Debug.fcall(Flags.BLT_DUMP, BackendDump.dumpEqnsArray, eqns);
then
fail();
end matchcontinue;
Expand Down

0 comments on commit 278f3c0

Please sign in to comment.