Skip to content

Commit 79bc483

Browse files
author
Willi Braun
committed
- fixed bug with array with size 1.
- uncommented print of communicate status (breaks the testsuite) git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10268 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent e370306 commit 79bc483

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

Compiler/BackEnd/BackendDAETransform.mo

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,6 @@ algorithm
876876
outComp:=
877877
match (inComp,syst,shared,inIncidenceMatrix,inIncidenceMatrixT,inAss1,inAss2)
878878
local
879-
BackendDAE.Value compelem,v;
880879
list<BackendDAE.Value> comp;
881880
list<tuple<BackendDAE.Var,BackendDAE.Value>> var_varindx_lst;
882881
array<Integer> ass1,ass2;
@@ -886,14 +885,10 @@ algorithm
886885
list<BackendDAE.Equation> eqn_lst;
887886
BackendDAE.EquationArray eqns;
888887
BackendDAE.StrongComponent compX;
889-
case (compelem::{},_,_,_,_,_,ass2)
890-
equation
891-
v = ass2[compelem];
892-
then BackendDAE.SINGLEEQUATION(compelem,v);
893888
case (comp,syst as BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns),shared,m,mt,ass1,ass2)
894889
equation
895890
(eqn_lst,var_varindx_lst) = List.map3_2(comp, getEquationAndSolvedVar_Internal, eqns, vars, ass2);
896-
compX = analyseStrongComponentBlock(comp,eqn_lst,var_varindx_lst,syst,shared,m,mt,ass1,ass2);
891+
compX = analyseStrongComponentBlock(comp,eqn_lst,var_varindx_lst,syst,shared,m,mt,ass1,ass2,false);
897892
then
898893
compX;
899894
else
@@ -915,13 +910,15 @@ protected function analyseStrongComponentBlock"function: analyseStrongComponentB
915910
input BackendDAE.IncidenceMatrix inIncidenceMatrix;
916911
input BackendDAE.IncidenceMatrixT inIncidenceMatrixT;
917912
input array<Integer> inAss1;
918-
input array<Integer> inAss2;
913+
input array<Integer> inAss2;
914+
input Boolean inLoop; //true if the function call itself
919915
output BackendDAE.StrongComponent outComp;
920916
algorithm
921917
outComp:=
922-
matchcontinue (inComp,inEqnLst,inVarVarindxLst,syst,shared,inIncidenceMatrix,inIncidenceMatrixT,inAss1,inAss2)
918+
matchcontinue (inComp,inEqnLst,inVarVarindxLst,syst,shared,inIncidenceMatrix,inIncidenceMatrixT,inAss1,inAss2,inLoop)
923919
local
924920
Integer i;
921+
BackendDAE.Value compelem,v;
925922
list<BackendDAE.Value> comp,varindxs;
926923
list<tuple<BackendDAE.Var,BackendDAE.Value>> var_varindx_lst,var_varindx_lst_cond;
927924
array<Integer> ass1,ass2;
@@ -938,31 +935,35 @@ algorithm
938935
array<DAE.Algorithm> al;
939936
Option<list<tuple<Integer, Integer, BackendDAE.Equation>>> jac;
940937
BackendDAE.JacobianType jac_tp;
941-
BackendDAE.StrongComponent sc;
942-
case (comp,eqn_lst,var_varindx_lst,_,_,m,mt,ass1,ass2)
938+
BackendDAE.StrongComponent sc;
939+
case (comp,eqn_lst,var_varindx_lst,_,_,m,mt,ass1,ass2,false)
943940
equation
944941
SOME(i) = singleAlgorithmEquation(eqn_lst,NONE());
945942
varindxs = List.map(var_varindx_lst,Util.tuple22);
946943
then
947944
BackendDAE.SINGLEALGORITHM(i,comp,varindxs);
948-
case (comp,eqn_lst,var_varindx_lst,_,_,m,mt,ass1,ass2)
945+
case (comp,eqn_lst,var_varindx_lst,_,_,m,mt,ass1,ass2,false)
949946
equation
950947
SOME(i) = singleArrayEquation(eqn_lst,NONE());
951948
varindxs = List.map(var_varindx_lst,Util.tuple22);
952949
then
953950
BackendDAE.SINGLEARRAY(i,comp,varindxs);
954-
case (comp,eqn_lst,var_varindx_lst,syst as BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns),shared as BackendDAE.SHARED(arrayEqs=ae,algorithms=al),m,mt,ass1,ass2)
951+
case (compelem::{},_,_,_,_,_,_,_,ass2,false)
952+
equation
953+
v = ass2[compelem];
954+
then BackendDAE.SINGLEEQUATION(compelem,v);
955+
case (comp,eqn_lst,var_varindx_lst,syst as BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns),shared as BackendDAE.SHARED(arrayEqs=ae,algorithms=al),m,mt,ass1,ass2,_)
955956
equation
956957
var_lst = List.map(var_varindx_lst,Util.tuple21);
957958
true = BackendVariable.hasDiscreteVar(var_lst);
958959
true = BackendVariable.hasContinousVar(var_lst);
959960
varindxs = List.map(var_varindx_lst,Util.tuple22);
960961
(cont_eqn,cont_var,disc_eqn,disc_var,indxcont_eqn,indxcont_var,indxdisc_eqn,indxdisc_var) = splitMixedEquations(eqn_lst, comp, var_lst, varindxs);
961962
var_varindx_lst_cond = List.threadTuple(cont_var,indxcont_var);
962-
sc = analyseStrongComponentBlock(indxcont_eqn,cont_eqn,var_varindx_lst_cond,syst,shared,m,mt,ass1,ass2);
963+
sc = analyseStrongComponentBlock(indxcont_eqn,cont_eqn,var_varindx_lst_cond,syst,shared,m,mt,ass1,ass2,true);
963964
then
964965
BackendDAE.MIXEDEQUATIONSYSTEM(sc,indxdisc_eqn,indxdisc_var);
965-
case (comp,eqn_lst,var_varindx_lst,syst as BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns),shared as BackendDAE.SHARED(arrayEqs=ae,algorithms=al),m,mt,ass1,ass2)
966+
case (comp,eqn_lst,var_varindx_lst,syst as BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns),shared as BackendDAE.SHARED(arrayEqs=ae,algorithms=al),m,mt,ass1,ass2,_)
966967
equation
967968
var_lst = List.map(var_varindx_lst,Util.tuple21);
968969
varindxs = List.map(var_varindx_lst,Util.tuple22);

c_runtime/simulation_runtime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ void communicateStatus(const char *phase, double completionPercent /*0.0 to 1.0*
10791079
s << (int)(completionPercent*10000) << " " << phase << endl;
10801080
std::string str(s.str());
10811081
sim_communication_port.send(str);
1082-
cout << str;
1082+
//cout << str;
10831083
}
10841084
#endif
10851085
}

0 commit comments

Comments
 (0)