Skip to content

Commit ee7a702

Browse files
author
Jens Frenkel
committed
- Bugfix getVar
- Bugfix BackendDAEEXT.setAssignment - use vars and eqns for BackendDAEUtil.analyzeJacobian - bugfix Tearing git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@12273 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent f4a7b41 commit ee7a702

File tree

10 files changed

+81
-77
lines changed

10 files changed

+81
-77
lines changed

Compiler/BackEnd/BackendDAEEXT.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public function getAssignment
271271
end getAssignment;
272272

273273
public function setAssignment
274-
"function: getAssignment
274+
"function: setAssignment
275275
author: Frenkel TUD 2012-04"
276276
input Integer lenass1;
277277
input Integer lenass2;

Compiler/BackEnd/BackendDAEOptimize.mo

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8053,7 +8053,7 @@ algorithm
80538053
Debug.fcall(Flags.TEARING_DUMP, BackendDump.debuglst,(tvars,intString,", ","\nResidualEquations:\n"));
80548054
Debug.fcall(Flags.TEARING_DUMP, BackendDump.debuglst,(residual,intString,", ","\n"));
80558055
// subsyst = BackendDAEUtil.setEqSystemMatching(subsyst,BackendDAE.MATCHING(ass1,ass2,{}));
8056-
// IndexReduction.dumpSystemGraphML(subsyst,shared,NONE());
8056+
// IndexReduction.dumpSystemGraphML(subsyst,shared,NONE(),"System.graphml");
80578057
// check if tearing make sense
80588058
tornsize = listLength(tvars);
80598059
true = intLt(tornsize,size);
@@ -8594,7 +8594,7 @@ algorithm
85948594
vars1 = BackendDAEUtil.listVar1(vlst);
85958595
eqns1 = BackendDAEUtil.listEquation(elst);
85968596
subsyst = BackendDAE.EQSYSTEM(vars1,eqns1,NONE(),NONE(),BackendDAE.NO_MATCHING());
8597-
IndexReduction.dumpSystemGraphML(subsyst,ishared,NONE());
8597+
IndexReduction.dumpSystemGraphML(subsyst,ishared,NONE(),"System.graphml");
85988598
*/
85998599

86008600
// check for unassigned vars, if there some rerun
@@ -8891,14 +8891,11 @@ algorithm
88918891
true = intEq(listLength(tvars),numvars);
88928892
// replace new residual equations in original system
88938893
syseqns = BackendEquation.daeEqns(isyst);
8894-
eindex1 = List.map1(eindex,intSub,1);
8895-
syseqns = BackendEquation.equationDelete(syseqns, eindex1);
88968894
// all additional vars and equations
88978895
sysvars = BackendVariable.addVars(k0,sysvars);
88988896
sysvars = BackendVariable.addVars(pdvarlst,sysvars);
88998897
syseqns = BackendEquation.addEquations(g0, syseqns);
8900-
syseqns = BackendEquation.addEquations(g, syseqns);
8901-
syseqns = BackendEquation.addEquations(h, syseqns);
8898+
syseqns = replaceHEquationsinSystem(eindex,listAppend(g,h),syseqns);
89028899
syst = BackendDAE.EQSYSTEM(sysvars,syseqns,NONE(),NONE(),BackendDAE.NO_MATCHING());
89038900
// BackendDump.dumpEqSystem(syst);
89048901
then
@@ -8938,25 +8935,27 @@ algorithm
89388935
end tearingSystemNew4;
89398936

89408937
protected function replaceHEquationsinSystem
8941-
input list<Integer> eindx;
8942-
input list<BackendDAE.Equation> HEqns;
8938+
input list<Integer> inEqnIndxes;
8939+
input list<BackendDAE.Equation> inEqns;
89438940
input BackendDAE.EquationArray iEqns;
89448941
output BackendDAE.EquationArray oEqns;
89458942
algorithm
8946-
oEqns := match(eindx,HEqns,iEqns)
8943+
oEqns := match(inEqnIndxes,inEqns,iEqns)
89478944
local
8948-
Integer e;
8949-
list<Integer> rest;
8945+
Integer i;
8946+
list<Integer> indxs;
89508947
BackendDAE.Equation eqn;
8951-
list<BackendDAE.Equation> eqnlst;
8952-
BackendDAE.EquationArray eqns;
8953-
case ({},_,_) then iEqns;
8954-
case (e::rest,eqn::eqnlst,_)
8948+
list<BackendDAE.Equation> eqns;
8949+
BackendDAE.EquationArray eqnsarray;
8950+
case ({},_,_)
8951+
then
8952+
List.fold(inEqns,BackendEquation.equationAdd,iEqns);
8953+
case (i::indxs,eqn::eqns,_)
89558954
equation
8956-
eqns = BackendEquation.equationSetnth(iEqns, e-1, eqn);
8955+
eqnsarray = BackendEquation.equationSetnth(iEqns,i-1,eqn);
89578956
then
8958-
replaceHEquationsinSystem(rest,eqnlst,eqns);
8959-
end match;
8957+
replaceHEquationsinSystem(indxs,eqns,eqnsarray);
8958+
end match;
89608959
end replaceHEquationsinSystem;
89618960

89628961
protected function equationToExp

Compiler/BackEnd/BackendDAETransform.mo

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,11 +1100,10 @@ algorithm
11001100
syst = BackendDAE.EQSYSTEM(vars_1,eqns_1,NONE(),NONE(),BackendDAE.NO_MATCHING());
11011101
shared = BackendDAE.SHARED(evars,evars,av,eeqns,eeqns,constrs,funcs,BackendDAE.EVENT_INFO({},{}),{},BackendDAE.ALGEQSYSTEM(),{});
11021102
(m,mt) = BackendDAEUtil.incidenceMatrix(syst, shared, BackendDAE.ABSOLUTE());
1103-
subsystem_dae = BackendDAE.DAE({syst},shared);
11041103
// calculate jacobian. If constant, linear system of equations. Otherwise nonlinear
11051104
jac = BackendDAEUtil.calculateJacobian(vars_1, eqns_1, m, mt,true);
11061105
// Jacobian of a Linear System is always linear
1107-
jac_tp = BackendDAEUtil.analyzeJacobian(subsystem_dae, jac);
1106+
jac_tp = BackendDAEUtil.analyzeJacobian(vars_1,eqns_1,jac);
11081107
then
11091108
BackendDAE.EQUATIONSYSTEM(comp,varindxs,jac,jac_tp);
11101109
case (comp,eqn_lst,var_varindx_lst,syst as BackendDAE.EQSYSTEM(orderedVars=vars,orderedEqs=eqns),shared,ass1,ass2,_)

Compiler/BackEnd/BackendDAEUtil.mo

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5555,7 +5555,7 @@ algorithm
55555555
// index = numberOfEqs (we reach the end)
55565556
case (_, _, _, _, _, _, _, false, _, _, _, _, _)
55575557
then
5558-
(listArray(inIncidenceArray),inIncidenceArrayT,listArray(listReverse(imapEqnIncRow)),listArray(listReverse(imapIncRowEqn)));
5558+
(listArray(listReverse(inIncidenceArray)),inIncidenceArrayT,listArray(listReverse(imapEqnIncRow)),listArray(listReverse(imapIncRowEqn)));
55595559

55605560
// index < numberOfEqs
55615561
case (_, _, _, iArr, _, _, _, true, _, _, _, _ , _)
@@ -6736,50 +6736,49 @@ public function analyzeJacobian "function: analyzeJacobian
67366736
Analyze the jacobian to find out if the jacobian of system of equations
67376737
can be solved at compiletime or runtime or if it is a nonlinear system
67386738
of equations."
6739-
input BackendDAE.BackendDAE inBackendDAE;
6739+
input BackendDAE.Variables vars;
6740+
input EquationArray eqns;
67406741
input Option<list<tuple<Integer, Integer, BackendDAE.Equation>>> inTplIntegerIntegerEquationLstOption;
67416742
output BackendDAE.JacobianType outJacobianType;
67426743
algorithm
67436744
outJacobianType:=
6744-
matchcontinue (inBackendDAE,inTplIntegerIntegerEquationLstOption)
6745+
matchcontinue (vars,eqns,inTplIntegerIntegerEquationLstOption)
67456746
local
6746-
Variables vars;
67476747
list<tuple<BackendDAE.Value, BackendDAE.Value, BackendDAE.Equation>> jac;
6748-
case (_,SOME(jac))
6748+
case (_,_,SOME(jac))
67496749
equation
67506750
true = jacobianConstant(jac);
6751-
true = rhsConstant(inBackendDAE);
6751+
true = rhsConstant(vars,eqns);
67526752
then
67536753
BackendDAE.JAC_CONSTANT();
6754-
case (BackendDAE.DAE(eqs=BackendDAE.EQSYSTEM(orderedVars=vars)::{}),SOME(jac))
6754+
case (_,_,SOME(jac))
67556755
equation
67566756
true = jacobianNonlinear(vars, jac);
67576757
then
67586758
BackendDAE.JAC_NONLINEAR();
6759-
case (_,SOME(jac)) then BackendDAE.JAC_TIME_VARYING();
6760-
case (_,NONE()) then BackendDAE.JAC_NO_ANALYTIC();
6759+
case (_,_,SOME(jac)) then BackendDAE.JAC_TIME_VARYING();
6760+
case (_,_,NONE()) then BackendDAE.JAC_NO_ANALYTIC();
67616761
end matchcontinue;
67626762
end analyzeJacobian;
67636763

67646764
protected function rhsConstant "function: rhsConstant
67656765
author: PA
67666766
Determines if the right hand sides of an equation system,
67676767
represented as a BackendDAE, is constant."
6768-
input BackendDAE.BackendDAE inBackendDAE;
6768+
input BackendDAE.Variables vars;
6769+
input EquationArray eqns;
67696770
output Boolean outBoolean;
67706771
algorithm
67716772
outBoolean:=
6772-
matchcontinue (inBackendDAE)
6773+
matchcontinue (vars,eqns)
67736774
local
67746775
Boolean res;
6775-
EquationArray eqns;
6776-
BackendDAE.Variables vars;
6777-
case ((BackendDAE.DAE(eqs=BackendDAE.EQSYSTEM(orderedEqs = eqns)::{})))
6776+
case (_,_)
67786777
equation
67796778
0 = equationSize(eqns);
67806779
then
67816780
true;
6782-
case ((BackendDAE.DAE(eqs=BackendDAE.EQSYSTEM(orderedVars = vars,orderedEqs = eqns)::{})))
6781+
case (_,_)
67836782
equation
67846783
((_,res)) = BackendEquation.traverseBackendDAEEqnsWithStop(eqns,rhsConstant2,(vars,true));
67856784
then

Compiler/BackEnd/BackendDump.mo

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ algorithm
655655
match (inEqSystem)
656656
local
657657
list<BackendDAE.Var> vars;
658-
BackendDAE.Value varlen,eqnlen;
658+
Integer varlen,eqnlen,eqnssize;
659659
String varlen_str,eqnlen_str,s;
660660
list<BackendDAE.Equation> eqnsl;
661661
list<String> ss;
@@ -680,6 +680,9 @@ algorithm
680680
eqnlen = listLength(eqnsl);
681681
eqnlen_str = intString(eqnlen);
682682
print(eqnlen_str);
683+
eqnssize = BackendDAEUtil.equationSize(eqns);
684+
print(", ");
685+
print(intString(eqnssize));
683686
print(")\n");
684687
print("=========\n");
685688
dumpEqns(eqnsl);
@@ -1200,7 +1203,7 @@ algorithm
12001203
local
12011204
String s1,s2,s3,res,indx_str,is,var_str,intsStr,outsStr;
12021205
DAE.Exp e1,e2,e;
1203-
BackendDAE.Value indx,i;
1206+
Integer indx,i;
12041207
list<DAE.Exp> expl,inps,outs;
12051208
DAE.ComponentRef cr;
12061209
BackendDAE.WhenEquation weqn;
@@ -1221,22 +1224,21 @@ algorithm
12211224
s2 = ExpressionDump.printExpStr(e2);
12221225
res = stringAppendList({s1," = ",s2});
12231226
then
1224-
res;
1227+
res;
12251228
case (BackendDAE.ARRAY_EQUATION(left = e1,right = e2))
12261229
equation
12271230
s1 = ExpressionDump.printExpStr(e1);
12281231
s2 = ExpressionDump.printExpStr(e2);
12291232
res = stringAppendList({s1," = ",s2});
12301233
then
1231-
res;
1234+
res;
12321235
case (BackendDAE.SOLVED_EQUATION(componentRef = cr,exp = e2))
12331236
equation
12341237
s1 = ComponentReference.printComponentRefStr(cr);
12351238
s2 = ExpressionDump.printExpStr(e2);
12361239
res = stringAppendList({s1," := ",s2});
12371240
then
12381241
res;
1239-
12401242
case (BackendDAE.WHEN_EQUATION(whenEquation = BackendDAE.WHEN_EQ(index = i,left = cr,right = e2, elsewhenPart = SOME(weqn))))
12411243
equation
12421244
s1 = ComponentReference.printComponentRefStr(cr);
@@ -1264,15 +1266,15 @@ algorithm
12641266
equation
12651267
res = DAEDump.dumpAlgorithmsStr({DAE.ALGORITHM(alg,source)});
12661268
then
1267-
res;
1269+
res;
12681270
case (BackendDAE.IF_EQUATION(conditions=e1::expl, eqnstrue=eqns::eqnstrue, eqnsfalse=eqnsfalse, source=source))
12691271
equation
12701272
s1 = ExpressionDump.printExpStr(e1);
12711273
s2 = stringDelimitList(List.map(eqns,equationStr),"\n ");
12721274
s3 = stringAppendList({"if ",s1," then\n ",s2});
12731275
res = ifequationStr(expl,eqnstrue,eqnsfalse,s3);
12741276
then
1275-
res;
1277+
res;
12761278
end matchcontinue;
12771279
end equationStr;
12781280

Compiler/BackEnd/BackendVariable.mo

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3716,7 +3716,7 @@ algorithm
37163716
case (cr,_) /* check if array or record */
37173717
equation
37183718
crlst = ComponentReference.expandCref(cr,true);
3719-
(vLst,indxs) = getVarLst(crlst,inVariables,{},{});
3719+
(vLst as _::_,indxs) = getVarLst(crlst,inVariables,{},{});
37203720
then
37213721
(vLst,indxs);
37223722
/* failure
@@ -3752,13 +3752,11 @@ algorithm
37523752
(varlst,ilst) = getVarLst(crlst,inVariables,v::iVarLst,indx::iIntegerLst);
37533753
then
37543754
(varlst,ilst);
3755-
case (cr::crlst,_,_,_)
3755+
case (_::crlst,_,_,_)
37563756
equation
3757-
true = Flags.isSet(Flags.FAILTRACE);
3758-
Debug.traceln("- BackendVariable.getVarLst failed on " +&
3759-
ComponentReference.printComponentRefStr(cr));
3757+
(varlst,ilst) = getVarLst(crlst,inVariables,iVarLst,iIntegerLst);
37603758
then
3761-
fail();
3759+
(varlst,ilst);
37623760
end matchcontinue;
37633761
end getVarLst;
37643762

Compiler/BackEnd/IndexReduction.mo

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3311,8 +3311,9 @@ public function dumpSystemGraphML
33113311
input BackendDAE.EqSystem isyst;
33123312
input BackendDAE.Shared ishared;
33133313
input Option<array<Integer>> inids;
3314+
input String filename;
33143315
algorithm
3315-
_ := match(isyst,ishared,inids)
3316+
_ := match(isyst,ishared,inids,filename)
33163317
local
33173318
BackendDAE.Variables vars;
33183319
BackendDAE.EquationArray eqns;
@@ -3322,47 +3323,53 @@ algorithm
33223323
list<Integer> eqnsids;
33233324
Integer neqns;
33243325
array<Integer> vec1,vec2,vec3,mapIncRowEqn;
3325-
case (BackendDAE.EQSYSTEM(matching=BackendDAE.NO_MATCHING()),_,NONE())
3326+
case (BackendDAE.EQSYSTEM(matching=BackendDAE.NO_MATCHING()),_,NONE(),_)
33263327
equation
33273328
vars = BackendVariable.daeVars(isyst);
33283329
eqns = BackendEquation.daeEqns(isyst);
3329-
(_,m,mt,_,mapIncRowEqn) = BackendDAEUtil.getIncidenceMatrixScalar(isyst,ishared,BackendDAE.NORMAL());
3330+
(_,m,mt) = BackendDAEUtil.getIncidenceMatrix(isyst,ishared,BackendDAE.NORMAL());
3331+
mapIncRowEqn = listArray(List.intRange(arrayLength(m)));
3332+
//(_,m,mt,_,mapIncRowEqn) = BackendDAEUtil.getIncidenceMatrixScalar(isyst,ishared,BackendDAE.NORMAL());
33303333
graph = GraphML.getGraph("G",false);
33313334
((_,graph)) = BackendVariable.traverseBackendDAEVars(vars,addVarGraph,(1,graph));
3332-
neqns = BackendDAEUtil.systemSize(isyst);
3335+
neqns = BackendDAEUtil.equationArraySize(eqns);
3336+
//neqns = BackendDAEUtil.equationSize(eqns);
33333337
eqnsids = List.intRange(neqns);
33343338
graph = List.fold2(eqnsids,addEqnGraph,eqns,mapIncRowEqn,graph);
33353339
((_,_,graph)) = List.fold(eqnsids,addEdgesGraph,(1,m,graph));
3336-
GraphML.dumpGraph(graph,"System.graphml");
3340+
GraphML.dumpGraph(graph,filename);
33373341
then
33383342
();
3339-
case (BackendDAE.EQSYSTEM(matching=BackendDAE.MATCHING(ass1=vec1,ass2=vec2)),_,NONE())
3343+
case (BackendDAE.EQSYSTEM(matching=BackendDAE.MATCHING(ass1=vec1,ass2=vec2)),_,NONE(),_)
33403344
equation
33413345
vars = BackendVariable.daeVars(isyst);
33423346
eqns = BackendEquation.daeEqns(isyst);
3347+
//(_,m,mt) = BackendDAEUtil.getIncidenceMatrix(isyst,ishared,BackendDAE.NORMAL());
3348+
//mapIncRowEqn = listArray(List.intRange(arrayLength(m)));
33433349
(_,m,mt,_,mapIncRowEqn) = BackendDAEUtil.getIncidenceMatrixScalar(isyst,ishared,BackendDAE.NORMAL());
33443350
graph = GraphML.getGraph("G",false);
33453351
((_,_,graph)) = BackendVariable.traverseBackendDAEVars(vars,addVarGraphMatch,(1,vec1,graph));
3346-
neqns = BackendDAEUtil.systemSize(isyst);
3352+
//neqns = BackendDAEUtil.equationArraySize(eqns);
3353+
neqns = BackendDAEUtil.equationSize(eqns);
33473354
eqnsids = List.intRange(neqns);
33483355
graph = List.fold2(eqnsids,addEqnGraphMatch,eqns,(vec2,mapIncRowEqn),graph);
33493356
//graph = List.fold3(eqnsids,addEqnGraphMatch,eqns,vec2,mapIncRowEqn,graph);
33503357
((_,_,_,graph)) = List.fold(eqnsids,addDirectedEdgesGraph,(1,m,vec2,graph));
3351-
GraphML.dumpGraph(graph,"System.graphml");
3358+
GraphML.dumpGraph(graph,filename);
33523359
then
33533360
();
3354-
case (BackendDAE.EQSYSTEM(matching=BackendDAE.MATCHING(ass1=vec1,ass2=vec2)),_,SOME(vec3))
3361+
case (BackendDAE.EQSYSTEM(matching=BackendDAE.MATCHING(ass1=vec1,ass2=vec2)),_,SOME(vec3),_)
33553362
equation
33563363
vars = BackendVariable.daeVars(isyst);
33573364
eqns = BackendEquation.daeEqns(isyst);
33583365
(_,m,mt,_,mapIncRowEqn) = BackendDAEUtil.getIncidenceMatrixScalar(isyst,ishared,BackendDAE.NORMAL());
33593366
graph = GraphML.getGraph("G",false);
33603367
((_,graph)) = BackendVariable.traverseBackendDAEVars(vars,addVarGraph,(1,graph));
3361-
neqns = BackendDAEUtil.systemSize(isyst);
3368+
neqns = BackendDAEUtil.equationSize(eqns);
33623369
eqnsids = List.intRange(neqns);
33633370
graph = List.fold2(eqnsids,addEqnGraph,eqns,mapIncRowEqn,graph);
33643371
((_,_,_,_,graph)) = List.fold(eqnsids,addDirectedNumEdgesGraph,(1,m,vec2,vec3,graph));
3365-
GraphML.dumpGraph(graph,"System.graphml");
3372+
GraphML.dumpGraph(graph,filename);
33663373
then
33673374
();
33683375
end match;
@@ -3383,13 +3390,15 @@ algorithm
33833390
case ((v as BackendDAE.VAR(varName=cr),(id,g)))
33843391
equation
33853392
true = BackendVariable.isStateVar(v);
3386-
g = GraphML.addNode("v" +& intString(id),ComponentReference.printComponentRefStr(cr),GraphML.COLOR_BLUE,GraphML.ELLIPSE(),g);
3393+
//g = GraphML.addNode("v" +& intString(id),ComponentReference.printComponentRefStr(cr),GraphML.COLOR_BLUE,GraphML.ELLIPSE(),g);
33873394
//g = GraphML.addNode("v" +& intString(id),intString(id),GraphML.COLOR_BLUE,GraphML.ELLIPSE(),g);
3395+
g = GraphML.addNode("v" +& intString(id),intString(id) +& ": " +& ComponentReference.printComponentRefStr(cr),GraphML.COLOR_BLUE,GraphML.ELLIPSE(),g);
33883396
then ((v,(id+1,g)));
33893397
case ((v as BackendDAE.VAR(varName=cr),(id,g)))
33903398
equation
3391-
g = GraphML.addNode("v" +& intString(id),ComponentReference.printComponentRefStr(cr),GraphML.COLOR_RED,GraphML.ELLIPSE(),g);
3399+
//g = GraphML.addNode("v" +& intString(id),ComponentReference.printComponentRefStr(cr),GraphML.COLOR_RED,GraphML.ELLIPSE(),g);
33923400
//g = GraphML.addNode("v" +& intString(id),intString(id),GraphML.COLOR_RED,GraphML.ELLIPSE(),g);
3401+
g = GraphML.addNode("v" +& intString(id),intString(id) +& ": " +&ComponentReference.printComponentRefStr(cr),GraphML.COLOR_RED,GraphML.ELLIPSE(),g);
33933402
then ((v,(id+1,g)));
33943403
case inTpl then inTpl;
33953404
end matchcontinue;
@@ -3414,13 +3423,15 @@ algorithm
34143423
true = BackendVariable.isStateVar(v);
34153424
color = Util.if_(intGt(vec1[id],0),GraphML.COLOR_BLUE,GraphML.COLOR_YELLOW);
34163425
//g = GraphML.addNode("v" +& intString(id),ComponentReference.printComponentRefStr(cr),color,GraphML.ELLIPSE(),g);
3417-
g = GraphML.addNode("v" +& intString(id),intString(id),color,GraphML.ELLIPSE(),g);
3426+
//g = GraphML.addNode("v" +& intString(id),intString(id),color,GraphML.ELLIPSE(),g);
3427+
g = GraphML.addNode("v" +& intString(id),intString(id) +& ":" +& ComponentReference.printComponentRefStr(cr),color,GraphML.ELLIPSE(),g);
34183428
then ((v,(id+1,vec1,g)));
34193429
case ((v as BackendDAE.VAR(varName=cr),(id,vec1,g)))
34203430
equation
34213431
color = Util.if_(intGt(vec1[id],0),GraphML.COLOR_RED,GraphML.COLOR_YELLOW);
34223432
//g = GraphML.addNode("v" +& intString(id),ComponentReference.printComponentRefStr(cr),color,GraphML.ELLIPSE(),g);
3423-
g = GraphML.addNode("v" +& intString(id),intString(id),color,GraphML.ELLIPSE(),g);
3433+
//g = GraphML.addNode("v" +& intString(id),intString(id),color,GraphML.ELLIPSE(),g);
3434+
g = GraphML.addNode("v" +& intString(id),intString(id) +& ":" +& ComponentReference.printComponentRefStr(cr),color,GraphML.ELLIPSE(),g);
34243435
then ((v,(id+1,vec1,g)));
34253436
case inTpl then inTpl;
34263437
end matchcontinue;
@@ -3439,6 +3450,7 @@ algorithm
34393450
eqn := BackendDAEUtil.equationNth(eqns, mapIncRowEqn[inNode]-1);
34403451
str := BackendDump.equationStr(eqn);
34413452
//str := intString(inNode);
3453+
str := intString(inNode) +& ": " +& BackendDump.equationStr(eqn);
34423454
outGraph := GraphML.addNode("n" +& intString(inNode),str,GraphML.COLOR_GREEN,GraphML.RECTANGLE(),inGraph);
34433455
end addEqnGraph;
34443456

@@ -3474,9 +3486,9 @@ protected
34743486
algorithm
34753487
(vec2,mapIncRowEqn) := atpl;
34763488
eqn := BackendDAEUtil.equationNth(eqns, mapIncRowEqn[inNode]-1);
3477-
//str := BackendDump.equationStr(eqn);
3478-
//str := intString(mapIncRowEqn[inNode]) +& ": " +& str;
3479-
str := intString(inNode);
3489+
str := BackendDump.equationStr(eqn);
3490+
str := intString(mapIncRowEqn[inNode]) +& ": " +& str;
3491+
//str := intString(inNode);
34803492
color := Util.if_(intGt(vec2[inNode],0),GraphML.COLOR_GREEN,GraphML.COLOR_PURPLE);
34813493
outGraph := GraphML.addNode("n" +& intString(inNode),str,color,GraphML.RECTANGLE(),inGraph);
34823494
end addEqnGraphMatch;

0 commit comments

Comments
 (0)