@@ -104,6 +104,7 @@ import ResolveLoops;
104104import SCode ;
105105import Sorting ;
106106import StateMachineFeatures ;
107+ import SymbolicImplicitSolver ;
107108import SymbolicJacobian ;
108109import SynchronousFeatures ;
109110import System ;
@@ -486,6 +487,15 @@ algorithm
486487 outSystem := BackendDAE . EQSYSTEM (vars, eqns, m, mt, matching, inSystem. stateSets, inSystem. partitionKind, removedEqs);
487488end copyEqSystem;
488489
490+ public function copyEqSystems
491+ input BackendDAE . EqSystems inSystems;
492+ output BackendDAE . EqSystems outSystems = {};
493+ algorithm
494+ for e in inSystems loop
495+ outSystems := copyEqSystem(e) :: outSystems;
496+ end for ;
497+ end copyEqSystems;
498+
489499public function mergeEqSystems
490500 input BackendDAE . EqSystem System1 ;
491501 input output BackendDAE . EqSystem System2 ;
@@ -1305,7 +1315,7 @@ protected
13051315 BackendDAE . Variables v;
13061316algorithm
13071317 BackendDAE . EQSYSTEM (orderedVars = v,m= SOME (m)) := syst;
1308- if Flags . getConfigBool (Flags . SYM_EULER ) then
1318+ if ( Flags . getConfigEnum (Flags . SYM_SOLVER ) > 0 ) then
13091319 (_,statevarindx_lst) := BackendVariable . getAllAlgStateVarIndexFromVariables(v);
13101320 else
13111321 (_,statevarindx_lst) := BackendVariable . getAllStateVarIndexFromVariables(v);
@@ -1675,7 +1685,11 @@ algorithm
16751685 case syst as BackendDAE . EQSYSTEM ( orderedEqs= ordererdEqs, orderedVars= v,
16761686 matching= BackendDAE . MATCHING (ass1= ass1, ass2= ass2) )
16771687 algorithm
1678- (_, statevarindx_lst) := BackendVariable . getAllStateVarIndexFromVariables(v);
1688+ if (Flags . getConfigEnum(Flags . SYM_SOLVER ) > 0 ) then
1689+ (_,statevarindx_lst) := BackendVariable . getAllAlgStateVarIndexFromVariables(v);
1690+ else
1691+ (_,statevarindx_lst) := BackendVariable . getAllStateVarIndexFromVariables(v);
1692+ end if ;
16791693 indx_lst_v := BackendVariable . getVarIndexFromVariables(iVars, v);
16801694
16811695 indx_lst_v := listAppend(indx_lst_v, statevarindx_lst) "overestimate" ;
@@ -2981,6 +2995,9 @@ algorithm
29812995 case (BackendDAE . VAR (varKind = BackendDAE . VARIABLE ())::rest,i::irest,_,_)
29822996 guard not AvlSetInt . hasKey(vars, i)
29832997 then incidenceRowExp1(rest,irest,AvlSetInt . add(vars, i),diffindex);
2998+ case (BackendDAE . VAR (varKind = BackendDAE . ALG_STATE ())::rest,i::irest,_,_)
2999+ guard not AvlSetInt . hasKey(vars, i)
3000+ then incidenceRowExp1(rest,irest,AvlSetInt . add(vars, i),diffindex);
29843001 case (BackendDAE . VAR (varKind = BackendDAE . DISCRETE ())::rest,i::irest,_,_)
29853002 guard not AvlSetInt . hasKey(vars, i)
29863003 then incidenceRowExp1(rest,irest,AvlSetInt . add(vars, i),diffindex);
@@ -6770,6 +6787,7 @@ public function getSolvedSystem "Run the equation system pipeline."
67706787 input Option < list< String >> strPostOptModules = NONE ();
67716788 output BackendDAE . BackendDAE outSimDAE;
67726789 output BackendDAE . BackendDAE outInitDAE;
6790+ output Option < BackendDAE . InlineData > outInlineData;
67736791 output Boolean outUseHomotopy "true if homotopy(...) is used during initialization" ;
67746792 output Option < BackendDAE . BackendDAE > outInitDAE_lambda0;
67756793 output list< BackendDAE . Equation > outRemovedInitialEquationLst;
@@ -6781,6 +6799,7 @@ protected
67816799 list< tuple< BackendDAEFunc . optimizationModule, String >> postOptModules;
67826800 tuple< BackendDAEFunc . StructurallySingularSystemHandlerFunc , String , BackendDAEFunc . stateDeselectionFunc, String > daeHandler;
67836801 tuple< BackendDAEFunc . matchingAlgorithmFunc, String > matchingAlgorithm;
6802+ BackendDAE . InlineData inlineData;
67846803algorithm
67856804 preOptModules := getPreOptModules(strPreOptModules);
67866805 postOptModules := getPostOptModules(strPostOptModules);
@@ -6833,6 +6852,9 @@ algorithm
68336852 simDAE := BackendDAEOptimize . addInitialStmtsToAlgorithms(simDAE);
68346853 simDAE := Initialization . removeInitializationStuff(simDAE);
68356854
6855+ // generate inline solver
6856+ outInlineData := SymbolicImplicitSolver . symSolver(simDAE);
6857+
68366858 // post-optimization phase
68376859 outSimDAE := postOptimizeDAE(simDAE, postOptModules, matchingAlgorithm, daeHandler);
68386860
@@ -7398,7 +7420,6 @@ protected function allPostOptimizationModules
73987420 (BackendDAEOptimize . inlineFunctionInLoops, "forceInlineFunctionInLoops" ), // before simplifyComplexFunction
73997421 (BackendDAEOptimize . simplifyComplexFunction, "simplifyComplexFunction" ),
74007422 (ExpressionSolve . solveSimpleEquations, "solveSimpleEquations" ),
7401- (BackendDAEOptimize . symEuler, "symEuler" ),
74027423 (ResolveLoops . reshuffling_post, "reshufflePost" ),
74037424 (DynamicOptimization . reduceDynamicOptimization, "reduceDynamicOptimization" ), // before tearing
74047425 (Tearing . tearingSystem, "tearingSystem" ),
@@ -7573,10 +7594,6 @@ algorithm
75737594 enabledModules := deprecatedDebugFlag(Flags . ADD_SCALED_VARS , enabledModules, "addScaledVars_states" , "postOptModules+" );
75747595 enabledModules := deprecatedDebugFlag(Flags . ADD_SCALED_VARS_INPUT , enabledModules, "addScaledVars_inputs" , "postOptModules+" );
75757596
7576- if Flags . getConfigBool(Flags . SYM_EULER ) then
7577- enabledModules := "symEuler" ::enabledModules;
7578- end if ;
7579-
75807597 if Flags . getConfigInt(Flags . SIMPLIFY_LOOPS ) > 0 then
75817598 enabledModules := "simplifyLoops" ::enabledModules;
75827599 end if ;
@@ -8346,7 +8363,8 @@ algorithm
83468363 backendDAEType,
83478364 {},
83488365 ei,
8349- emptyPartitionsInfo());
8366+ emptyPartitionsInfo()
8367+ );
83508368end createEmptyShared;
83518369
83528370public function emptyPartitionsInfo
0 commit comments