@@ -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