Skip to content

Commit ed947ef

Browse files
committed
2 parents cf3a3f6 + 1bda3b0 commit ed947ef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+17363
-16074
lines changed

3rdParty

Submodule 3rdParty updated 98 files

Compiler/BackEnd/BackendDAE.mo

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,17 @@ uniontype Equation
349349
.DAE.ElementSource source "origin of equation";
350350
EquationAttributes attr;
351351
end IF_EQUATION;
352+
353+
record FOR_EQUATION "a for-equation"
354+
.DAE.Exp iter "the iterator variable";
355+
.DAE.Exp start "start of iteration";
356+
.DAE.Exp stop "end of iteration";
357+
.DAE.Exp left;
358+
.DAE.Exp right;
359+
.DAE.ElementSource source "origin of equation";
360+
EquationAttributes attr;
361+
end FOR_EQUATION;
362+
352363
end Equation;
353364

354365
public

Compiler/BackEnd/BackendDAEOptimize.mo

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4628,5 +4628,89 @@ algorithm
46284628
end match;
46294629
end warnAboutVars;
46304630

4631+
public function addTimeAsState
4632+
input BackendDAE.BackendDAE inDAE;
4633+
output BackendDAE.BackendDAE outDAE = inDAE;
4634+
protected
4635+
BackendDAE.EqSystems eqs;
4636+
BackendDAE.EqSystem eq;
4637+
BackendDAE.Shared shared;
4638+
BackendDAE.Variables orderedVars "ordered Variables, only states and alg. vars";
4639+
BackendDAE.EquationArray orderedEqs "ordered Equations";
4640+
BackendDAE.Var var;
4641+
algorithm
4642+
if Flags.getConfigBool(Flags.ADD_TIME_AS_STATE) then
4643+
(BackendDAE.DAE(eqs, shared), _) := BackendDAEUtil.mapEqSystemAndFold(inDAE, addTimeAsState1, 0);
4644+
orderedVars := BackendVariable.emptyVars();
4645+
var := BackendDAE.VAR(DAE.crefTimeState, BackendDAE.STATE(1, NONE()), DAE.BIDIR(), DAE.NON_PARALLEL(), DAE.T_REAL_DEFAULT, NONE(), NONE(), {}, DAE.emptyElementSource, NONE(), NONE(), NONE(), DAE.NON_CONNECTOR(), DAE.NOT_INNER_OUTER(), true);
4646+
var := BackendVariable.setVarFixed(var, true);
4647+
var := BackendVariable.setVarStartValue(var, DAE.CREF(DAE.crefTime, DAE.T_REAL_DEFAULT));
4648+
orderedVars := BackendVariable.addVar(var, orderedVars);
4649+
orderedEqs := BackendEquation.emptyEqns();
4650+
orderedEqs := BackendEquation.addEquation(BackendDAE.EQUATION(DAE.CALL(Absyn.IDENT("der"), {DAE.CREF(DAE.crefTimeState, DAE.T_REAL_DEFAULT)}, DAE.callAttrBuiltinReal), DAE.RCONST(1.0), DAE.emptyElementSource, BackendDAE.EQ_ATTR_DEFAULT_DYNAMIC), orderedEqs);
4651+
eq := BackendDAE.EQSYSTEM(orderedVars, orderedEqs, NONE(), NONE(), BackendDAE.NO_MATCHING(), {}, BackendDAE.CONTINUOUS_TIME_PARTITION());
4652+
outDAE := BackendDAE.DAE(eq::eqs, shared);
4653+
end if;
4654+
end addTimeAsState;
4655+
4656+
protected function addTimeAsState1
4657+
input BackendDAE.EqSystem inSystem;
4658+
input BackendDAE.Shared inShared;
4659+
input Integer inFoo;
4660+
output BackendDAE.EqSystem outSystem;
4661+
output BackendDAE.Shared outShared = inShared;
4662+
output Integer outFoo = inFoo;
4663+
algorithm
4664+
outSystem := matchcontinue(inSystem)
4665+
local
4666+
BackendDAE.Variables orderedVars;
4667+
BackendDAE.EquationArray orderedEqs;
4668+
BackendDAE.StateSets stateSets;
4669+
BackendDAE.BaseClockPartitionKind partitionKind;
4670+
4671+
case BackendDAE.EQSYSTEM(orderedVars, orderedEqs, _, _, _, stateSets, partitionKind) equation
4672+
(orderedEqs, _) = BackendEquation.traverseEquationArray_WithUpdate(orderedEqs, addTimeAsState2, inFoo);
4673+
then BackendDAE.EQSYSTEM(orderedVars, orderedEqs, NONE(), NONE(), BackendDAE.NO_MATCHING(), stateSets, partitionKind);
4674+
4675+
else inSystem;
4676+
end matchcontinue;
4677+
end addTimeAsState1;
4678+
4679+
protected function addTimeAsState2
4680+
input BackendDAE.Equation inEq;
4681+
input Integer inFoo;
4682+
output BackendDAE.Equation outEq;
4683+
output Integer outFoo = inFoo;
4684+
algorithm
4685+
(outEq, _) := BackendEquation.traverseExpsOfEquation(inEq, addTimeAsState3, inFoo);
4686+
end addTimeAsState2;
4687+
4688+
protected function addTimeAsState3
4689+
input DAE.Exp inExp;
4690+
input Integer inTuple;
4691+
output DAE.Exp outExp;
4692+
output Integer outTuple;
4693+
algorithm
4694+
(outExp, outTuple) := Expression.traverseExpTopDown(inExp, addTimeAsState4, inTuple);
4695+
end addTimeAsState3;
4696+
4697+
protected function addTimeAsState4
4698+
input DAE.Exp inExp;
4699+
input Integer inTuple;
4700+
output DAE.Exp outExp;
4701+
output Boolean cont = true;
4702+
output Integer outTuple = inTuple;
4703+
algorithm
4704+
outExp := match inExp
4705+
local
4706+
DAE.Type ty;
4707+
4708+
case DAE.CREF(componentRef=DAE.CREF_IDENT(ident="time"), ty=ty) equation
4709+
then DAE.CREF(DAE.crefTimeState, ty);
4710+
4711+
else inExp;
4712+
end match;
4713+
end addTimeAsState4;
4714+
46314715
annotation(__OpenModelica_Interface="backend");
46324716
end BackendDAEOptimize;

Compiler/BackEnd/BackendDAEUtil.mo

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7683,7 +7683,8 @@ algorithm
76837683
(ResolveLoops.solveLinearSystem, "solveLinearSystem", false),
76847684
(CommonSubExpression.CSE, "CSE", false),
76857685
(BackendDump.dumpDAE, "dumpDAE", false),
7686-
(XMLDump.dumpDAEXML, "dumpDAEXML", false)
7686+
(XMLDump.dumpDAEXML, "dumpDAEXML", false),
7687+
(BackendDAEOptimize.addTimeAsState, "addTimeAsState", false)
76877688
};
76887689

76897690
strpostOptModules := getPostOptModulesString();

Compiler/BackEnd/BackendDump.mo

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,7 @@ algorithm
14171417
outString := matchcontinue (inEquation)
14181418
local
14191419
String s1,s2,s3,s4,res;
1420-
DAE.Exp e1,e2,e,cond;
1420+
DAE.Exp e1,e2,e,cond, start, stop, iter;
14211421
list<DAE.Exp> expl;
14221422
DAE.ComponentRef cr;
14231423
BackendDAE.WhenEquation weqn;
@@ -1491,6 +1491,13 @@ algorithm
14911491
res = ifequationString(expl,eqnstrue,eqnsfalse,s3);
14921492
then
14931493
res;
1494+
case (BackendDAE.FOR_EQUATION(iter=iter, start=start, stop=stop, left=e1, right=e2))
1495+
equation
1496+
s1 = ExpressionDump.printExpStr(iter) + " in " + ExpressionDump.printExpStr(start) + " : " + ExpressionDump.printExpStr(stop);
1497+
s2 = ExpressionDump.printExpStr(e1) + "=" + ExpressionDump.printExpStr(e2);
1498+
res = stringAppendList({"for ",s1," loop \n ",s2, "; end for; "});
1499+
then
1500+
res;
14941501
end matchcontinue;
14951502
end equationString;
14961503

Compiler/BackEnd/BackendEquation.mo

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ public function traverseExpsOfEquation<T> "author: Frenkel TUD 2010-11
685685
algorithm
686686
(outEquation, outTypeA) := match(inEquation)
687687
local
688-
DAE.Exp e1, e2, e_1, e_2, cond;
688+
DAE.Exp e1, e2, e_1, e_2, cond, start, stop, iter;
689689
list<DAE.Exp> expl;
690690
DAE.Type tp;
691691
DAE.ComponentRef cr, cr1;
@@ -764,6 +764,11 @@ algorithm
764764
(eqnslst, extArg) = List.map1Fold(eqnslst, traverseExpsOfEquationList, inFunc, extArg);
765765
(eqns, extArg) = List.map1Fold(eqns, traverseExpsOfEquation, inFunc, extArg);
766766
then (BackendDAE.IF_EQUATION(expl, eqnslst, eqns, source, attr), extArg);
767+
768+
case BackendDAE.FOR_EQUATION(iter=iter,start=start,stop=stop,left=e1, right=e2, source=source, attr=attr) equation
769+
(e_1, extArg) = inFunc(e1, inTypeA);
770+
(e_2, extArg) = inFunc(e2, extArg);
771+
then (BackendDAE.FOR_EQUATION(iter,start,stop,e_1,e_2,source,attr), extArg);
767772
end match;
768773
end traverseExpsOfEquation;
769774

@@ -1840,7 +1845,7 @@ algorithm
18401845
osize := match eq
18411846
local
18421847
list<Integer> ds;
1843-
Integer size;
1848+
Integer size, start, stop;
18441849
list<BackendDAE.Equation> eqnsfalse;
18451850

18461851
case BackendDAE.EQUATION()
@@ -1869,6 +1874,10 @@ algorithm
18691874
size = equationLstSize(eqnsfalse);
18701875
then size;
18711876

1877+
case BackendDAE.FOR_EQUATION(start=DAE.ICONST(start), stop=DAE.ICONST(stop)) equation
1878+
size = stop-start+1;
1879+
then size;
1880+
18721881
else equation
18731882
Error.addInternalError("BackendEquation.equationSize failed!", sourceInfo());
18741883
then fail();
@@ -2039,6 +2048,7 @@ algorithm
20392048
case BackendDAE.WHEN_EQUATION(attr=attr) then attr;
20402049
case BackendDAE.COMPLEX_EQUATION(attr=attr) then attr;
20412050
case BackendDAE.IF_EQUATION(attr=attr) then attr;
2051+
case BackendDAE.FOR_EQUATION(attr=attr) then attr;
20422052

20432053
else equation
20442054
Error.addInternalError("./Compiler/BackEnd/BackendEquation.mo: function getEquationAttributes failed", sourceInfo());

Compiler/BackEnd/HpcOmMemory.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@ encapsulated package HpcOmMemory
19541954
//print("convertCacheToVarArrayMapping: " + intString(Util.tuple33(currentVarIndices)) + " is the start index for bool variables\n");
19551955
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(listReverse(notOptimizedVarsBool), function SimCodeUtil.addVarToArrayIndexMapping(iVarType=VARDATATYPE_BOOLEAN), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
19561956

1957-
BaseHashTable.dumpHashTable(varArrayIndexMappingHashTable);
1957+
//BaseHashTable.dumpHashTable(varArrayIndexMappingHashTable);
19581958
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(iAliasVars, function SimCodeUtil.addVarToArrayIndexMapping(iVarType=VARDATATYPE_FLOAT), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
19591959
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(iIntAliasVars, function SimCodeUtil.addVarToArrayIndexMapping(iVarType=VARDATATYPE_INTEGER), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));
19601960
((currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable)) = List.fold(iBoolAliasVars, function SimCodeUtil.addVarToArrayIndexMapping(iVarType=VARDATATYPE_BOOLEAN), (currentVarIndices, varArrayIndexMappingHashTable, varIndexMappingHashTable));

Compiler/BackEnd/HpcOmScheduler.mo

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3478,21 +3478,21 @@ algorithm
34783478
list<DAE.ElementSource> sources;
34793479
Boolean homotopySupport;
34803480
Boolean mixedSystem;
3481-
case(SimCode.SES_NONLINEAR(eqs=eqs,crefs=crefs,indexNonLinearSystem=indexNonLinearSystem,jacobianMatrix=jacobianMatrix,linearTearing=linearTearing,homotopySupport=homotopySupport,mixedSystem=mixedSystem),_)
3481+
case(SimCode.SES_NONLINEAR(SimCode.NONLINEARSYSTEM(eqs=eqs,crefs=crefs,indexNonLinearSystem=indexNonLinearSystem,jacobianMatrix=jacobianMatrix,linearTearing=linearTearing,homotopySupport=homotopySupport,mixedSystem=mixedSystem)),_)
34823482
equation
34833483
eqs = List.map1(eqs,TDS_replaceSimEqSysIndex,assIn);
34843484
oldIdx = SimCodeUtil.eqIndex(simEqIn);
34853485
newIdx = arrayGet(assIn,oldIdx);
34863486
jacobianMatrix = TDS_replaceSimEqSysIdxInJacobianMatrix(jacobianMatrix,assIn);
3487-
simEqSys = SimCode.SES_NONLINEAR(newIdx,eqs,crefs,indexNonLinearSystem,jacobianMatrix,linearTearing,homotopySupport,mixedSystem);
3487+
simEqSys = SimCode.SES_NONLINEAR(SimCode.NONLINEARSYSTEM(newIdx,eqs,crefs,indexNonLinearSystem,jacobianMatrix,linearTearing,homotopySupport,mixedSystem), NONE());
34883488
then simEqSys;
3489-
case(SimCode.SES_LINEAR(partOfMixed=partOfMixed,vars=vars,beqs=beqs,simJac=simJac,residual=eqs,jacobianMatrix=jacobianMatrix,sources=sources,indexLinearSystem=indexLinearSystem),ass)
3489+
case(SimCode.SES_LINEAR(SimCode.LINEARSYSTEM(partOfMixed=partOfMixed,vars=vars,beqs=beqs,simJac=simJac,residual=eqs,jacobianMatrix=jacobianMatrix,sources=sources,indexLinearSystem=indexLinearSystem)),ass)
34903490
equation
34913491
eqs = List.map1(eqs,TDS_replaceSimEqSysIndex,ass);
34923492
oldIdx = SimCodeUtil.eqIndex(simEqIn);
34933493
newIdx = arrayGet(ass,oldIdx);
34943494
jacobianMatrix = TDS_replaceSimEqSysIdxInJacobianMatrix(jacobianMatrix,ass);
3495-
simEqSys = SimCode.SES_LINEAR(newIdx,partOfMixed,vars,beqs,simJac,eqs,jacobianMatrix,sources,indexLinearSystem);
3495+
simEqSys = SimCode.SES_LINEAR(SimCode.LINEARSYSTEM(newIdx,partOfMixed,vars,beqs,simJac,eqs,jacobianMatrix,sources,indexLinearSystem), NONE());
34963496
then simEqSys;
34973497
case(_,ass)
34983498
equation
@@ -3525,19 +3525,19 @@ algorithm
35253525
list<DAE.ElementSource> sources;
35263526
Boolean homotopySupport;
35273527
Boolean mixedSystem;
3528-
case(SimCode.SES_NONLINEAR(index=oldIdx,eqs=eqs,crefs=crefs,indexNonLinearSystem=indexNonLinearSystem,jacobianMatrix=jacobianMatrix,linearTearing=linearTearing,homotopySupport=homotopySupport,mixedSystem=mixedSystem),(newIdx,ass))
3528+
case(SimCode.SES_NONLINEAR(SimCode.NONLINEARSYSTEM(index=oldIdx,eqs=eqs,crefs=crefs,indexNonLinearSystem=indexNonLinearSystem,jacobianMatrix=jacobianMatrix,linearTearing=linearTearing,homotopySupport=homotopySupport,mixedSystem=mixedSystem)),(newIdx,ass))
35293529
equation
35303530
(eqs,(newIdx,ass)) = List.mapFold(eqs,TDS_replaceSimEqSysIndexWithUpdate,(newIdx,ass));
35313531
(jacobianMatrix,(newIdx,ass)) = TDS_replaceSimEqSysIdxInJacobianMatrixWithUpdate(jacobianMatrix,(newIdx,ass));
35323532
ass = arrayUpdate(ass,oldIdx,newIdx);
3533-
simEqSys = SimCode.SES_NONLINEAR(newIdx,eqs,crefs,indexNonLinearSystem,jacobianMatrix,linearTearing,homotopySupport,mixedSystem);
3533+
simEqSys = SimCode.SES_NONLINEAR(SimCode.NONLINEARSYSTEM(newIdx,eqs,crefs,indexNonLinearSystem,jacobianMatrix,linearTearing,homotopySupport,mixedSystem), NONE());
35343534
then (simEqSys,(newIdx+1,ass));
3535-
case(SimCode.SES_LINEAR(index=oldIdx,partOfMixed=partOfMixed,vars=vars,beqs=beqs,simJac=simJac,residual=eqs,jacobianMatrix=jacobianMatrix,sources=sources,indexLinearSystem=indexLinearSystem),(newIdx,ass))
3535+
case(SimCode.SES_LINEAR(SimCode.LINEARSYSTEM(index=oldIdx,partOfMixed=partOfMixed,vars=vars,beqs=beqs,simJac=simJac,residual=eqs,jacobianMatrix=jacobianMatrix,sources=sources,indexLinearSystem=indexLinearSystem)),(newIdx,ass))
35363536
equation
35373537
(eqs,(newIdx,ass)) = List.mapFold(eqs,TDS_replaceSimEqSysIndexWithUpdate,(newIdx,ass));
35383538
(jacobianMatrix,(newIdx,ass)) = TDS_replaceSimEqSysIdxInJacobianMatrixWithUpdate(jacobianMatrix,(newIdx,ass));
35393539
ass = arrayUpdate(ass,oldIdx,newIdx);
3540-
simEqSys = SimCode.SES_LINEAR(newIdx,partOfMixed,vars,beqs,simJac,eqs,jacobianMatrix,sources,indexLinearSystem);
3540+
simEqSys = SimCode.SES_LINEAR(SimCode.LINEARSYSTEM(newIdx,partOfMixed,vars,beqs,simJac,eqs,jacobianMatrix,sources,indexLinearSystem), NONE());
35413541
then (simEqSys,(newIdx+1,ass));
35423542
case(SimCode.SES_MIXED(index=oldIdx,cont=cont,discVars=discVars,discEqs=eqs,indexMixedSystem=indexMixedSystem),(newIdx,ass))
35433543
equation
@@ -4033,7 +4033,7 @@ algorithm
40334033
Integer indexLinearSystem;
40344034
case({},_,_,_)
40354035
then (listReverse(simEqsFold),simEqSysIdxIn);
4036-
case((simEqSys as SimCode.SES_LINEAR(index=index,partOfMixed=partOfMixed,vars=vars,beqs=beqs,simJac=simJac,jacobianMatrix=jacobianMatrix, residual=residual,sources=sources,indexLinearSystem=indexLinearSystem))::rest,_,_,_)
4036+
case((simEqSys as SimCode.SES_LINEAR(SimCode.LINEARSYSTEM(index=index,partOfMixed=partOfMixed,vars=vars,beqs=beqs,simJac=simJac,jacobianMatrix=jacobianMatrix, residual=residual,sources=sources,indexLinearSystem=indexLinearSystem)))::rest,_,_,_)
40374037
equation
40384038
//print("the systemSimEqSys "+SimCodeUtil.dumpSimEqSystemLst(residual)+"\n");
40394039
numEqs = listLength(residual);
@@ -4042,7 +4042,7 @@ algorithm
40424042
(duplicated,_) = List.map1_2(residual,replaceExpsInSimEqSystem,repl);// replace the exps and crefs
40434043
duplicated = List.threadMap(duplicated,systSimEqSysIdcs2,SimCodeUtil.replaceSimEqSysIndex);
40444044
//print("the systemSimEqSysDupl "+SimCodeUtil.dumpSimEqSystemLst(duplicated)+"\n");
4045-
simEqSys = SimCode.SES_LINEAR(index,partOfMixed,vars,beqs,simJac,duplicated,jacobianMatrix,sources,indexLinearSystem);
4045+
simEqSys = SimCode.SES_LINEAR(SimCode.LINEARSYSTEM(index,partOfMixed,vars,beqs,simJac,duplicated,jacobianMatrix,sources,indexLinearSystem), NONE());
40464046
simEqSysIdx = simEqSysIdxIn + numEqs;
40474047
(duplicated,simEqSysIdx) = TDS_duplicateSystemOfEquations(rest,simEqSysIdx,repl,simEqSys::simEqsFold);
40484048
then (duplicated,simEqSysIdx);
@@ -4115,15 +4115,15 @@ algorithm
41154115
Option<SimCode.JacobianMatrix> jac;
41164116
Boolean homotopySupport;
41174117
Boolean mixedSystem;
4118-
case(SimCode.SES_LINEAR(index=idx,partOfMixed=pom,vars=simVars,beqs=expLst,sources=sources,simJac=simJac,residual=simEqSysLst,jacobianMatrix=jac),_)
4118+
case(SimCode.SES_LINEAR(SimCode.LINEARSYSTEM(index=idx,partOfMixed=pom,vars=simVars,beqs=expLst,sources=sources,simJac=simJac,residual=simEqSysLst,jacobianMatrix=jac)),_)
41194119
equation
41204120
(lsIdx,nlsIdx,mIdx) = idcsIn;
4121-
simEqSys = SimCode.SES_LINEAR(idx,pom,simVars,expLst,simJac,simEqSysLst,jac,sources,lsIdx);
4121+
simEqSys = SimCode.SES_LINEAR(SimCode.LINEARSYSTEM(idx,pom,simVars,expLst,simJac,simEqSysLst,jac,sources,lsIdx), NONE());
41224122
then (simEqSys,(lsIdx+1,nlsIdx,mIdx));
4123-
case(SimCode.SES_NONLINEAR(index=idx,eqs=simEqSysLst,crefs=crefs,jacobianMatrix=jac,linearTearing=lt,homotopySupport=homotopySupport,mixedSystem=mixedSystem),_)
4123+
case(SimCode.SES_NONLINEAR(SimCode.NONLINEARSYSTEM(index=idx,eqs=simEqSysLst,crefs=crefs,jacobianMatrix=jac,linearTearing=lt,homotopySupport=homotopySupport,mixedSystem=mixedSystem)),_)
41244124
equation
41254125
(lsIdx,nlsIdx,mIdx) = idcsIn;
4126-
simEqSys = SimCode.SES_NONLINEAR(idx,simEqSysLst,crefs,nlsIdx,jac,lt,homotopySupport,mixedSystem);
4126+
simEqSys = SimCode.SES_NONLINEAR(SimCode.NONLINEARSYSTEM(idx,simEqSysLst,crefs,nlsIdx,jac,lt,homotopySupport,mixedSystem), NONE());
41274127
then (simEqSys,(lsIdx,nlsIdx+1,mIdx));
41284128
case(SimCode.SES_MIXED(index=idx,cont=cont,discVars=simVars,discEqs=simEqSysLst),_)
41294129
equation
@@ -4209,23 +4209,23 @@ algorithm
42094209
(stmts,changed) = BackendVarTransform.replaceStatementLst(stmts,replIn,NONE(),{},false);
42104210
simEqSys = SimCode.SES_ALGORITHM(idx,stmts);
42114211
then (simEqSys,changed);
4212-
case(SimCode.SES_LINEAR(index=idx,partOfMixed=pom,vars=simVars,beqs=expLst,sources=sources,simJac=simJac,residual=simEqSysLst,jacobianMatrix=jac,indexLinearSystem=idxLS),_)
4212+
case(SimCode.SES_LINEAR(SimCode.LINEARSYSTEM(index=idx,partOfMixed=pom,vars=simVars,beqs=expLst,sources=sources,simJac=simJac,residual=simEqSysLst,jacobianMatrix=jac,indexLinearSystem=idxLS)),_)
42134213
equation
42144214
(simVars,bLst) = List.map1_2(simVars,replaceCrefInSimVar,replIn);
42154215
(expLst,changed) = BackendVarTransform.replaceExpList(expLst,replIn,NONE(),{},false);
42164216
changed = List.fold(bLst,boolOr,changed);
42174217
simJac = List.map1(simJac,replaceInSimJac,replIn);
4218-
simEqSys = SimCode.SES_LINEAR(idx,pom,simVars,expLst,simJac,simEqSysLst,jac,sources,idxLS);
4218+
simEqSys = SimCode.SES_LINEAR(SimCode.LINEARSYSTEM(idx,pom,simVars,expLst,simJac,simEqSysLst,jac,sources,idxLS), NONE());
42194219
then (simEqSys,changed);
4220-
case(SimCode.SES_NONLINEAR(index=idx,eqs=simEqSysLst,crefs=crefs,indexNonLinearSystem=idxNLS,linearTearing=lt,homotopySupport=homotopySupport,mixedSystem=mixedSystem),_)
4220+
case(SimCode.SES_NONLINEAR(SimCode.NONLINEARSYSTEM(index=idx,eqs=simEqSysLst,crefs=crefs,indexNonLinearSystem=idxNLS,linearTearing=lt,homotopySupport=homotopySupport,mixedSystem=mixedSystem)),_)
42214221
equation
42224222
expLst = List.map(crefs,Expression.crefExp);
42234223
(expLst,changed) = BackendVarTransform.replaceExpList(expLst,replIn,NONE(),{},false);
42244224
crefs = List.map(expLst,Expression.expCref);
42254225
(simEqSysLst,bLst) = List.map1_2(simEqSysLst,replaceExpsInSimEqSystem,replIn);
42264226
changed = changed or List.fold(bLst,boolOr,false);
42274227
print("implement Jacobian replacement for SES_NONLINEAR in HpcOmScheduler.replaceExpsInSimEqSystems!\n");
4228-
simEqSys = SimCode.SES_NONLINEAR(idx,simEqSysLst,crefs,idxNLS,NONE(),lt,homotopySupport,mixedSystem);
4228+
simEqSys = SimCode.SES_NONLINEAR(SimCode.NONLINEARSYSTEM(idx,simEqSysLst,crefs,idxNLS,NONE(),lt,homotopySupport,mixedSystem), NONE());
42294229
then (simEqSys,changed);
42304230
case(SimCode.SES_MIXED(index=idx,cont=simEqSys,discVars=simVars,discEqs=simEqSysLst,indexMixedSystem=idxMS),_)
42314231
equation

0 commit comments

Comments
 (0)