Skip to content

Commit

Permalink
Merge pull request #3 from vruge/master
Browse files Browse the repository at this point in the history
fixed symEuler
  • Loading branch information
sjoelund committed May 6, 2015
2 parents 506ac54 + 9bc4e2e commit e2edb49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Compiler/BackEnd/BackendDAEOptimize.mo
Expand Up @@ -4128,7 +4128,7 @@ ToDo: remove me
input BackendDAE.BackendDAE inDAE;
output BackendDAE.BackendDAE outDAE;
algorithm
outDAE := if Flags.getConfigBool(Flags.SYM_EULER) then symEulerWork(inDAE, false) else inDAE;
outDAE := if Flags.getConfigBool(Flags.SYM_EULER) then symEulerWork(BackendDAEUtil.copyBackendDAE(inDAE), false) else inDAE;

end symEulerInit;

Expand All @@ -4148,7 +4148,7 @@ algorithm
// make dt
cref := ComponentReference.makeCrefIdent("$TMP$OMC$DT", DAE.T_REAL_DEFAULT, {});
tmpv := BackendVariable.makeVar(cref);
tmpv := BackendVariable.setVarKind(tmpv, BackendDAE.PARAM());
//tmpv := BackendVariable.setVarKind(tmpv, BackendDAE.PARAM());
tmpv := BackendVariable.setBindExp(tmpv, SOME(DAE.RCONST(0.0)));
shared := BackendVariable.addKnVarDAE(tmpv, shared);

Expand Down Expand Up @@ -4230,6 +4230,7 @@ algorithm
for cr in crlst loop
cref := ComponentReference.crefPrefixDer(cr);
v := BackendVariable.makeVar(cref);
v := BackendVariable.setBindExp(v, SOME(DAE.RCONST(0.0)));
outShared := BackendVariable.addKnVarDAE(v, outShared);
end for;
end symEulerDerVars;
Expand Down
4 changes: 2 additions & 2 deletions Compiler/BackEnd/Initialization.mo
Expand Up @@ -110,7 +110,7 @@ protected
algorithm
try
// inline all when equations, if active with body else with lhs=pre(lhs)
dae := inlineWhenForInitialization(inDAE);
dae := inlineWhenForInitialization(BackendDAEOptimize.symEulerInit(inDAE));
// fcall2(Flags.DUMP_INITIAL_SYSTEM, BackendDump.dumpBackendDAE, dae, "inlineWhenForInitialization");

(initVars, outPrimaryParameters, outAllPrimaryParameters) := selectInitializationVariablesDAE(dae);
Expand Down Expand Up @@ -201,7 +201,7 @@ algorithm
initdae := BackendDAEUtil.mapEqSystem(initdae, solveInitialSystemEqSystem);

// transform and optimize DAE
pastOptModules := BackendDAEUtil.getPostOptModules(SOME({"constantLinearSystem", "symEulerInit", "tearingSystem", "calculateStrongComponentJacobians", "solveSimpleEquations"}));
pastOptModules := BackendDAEUtil.getPostOptModules(SOME({"constantLinearSystem", "tearingSystem", "calculateStrongComponentJacobians", "solveSimpleEquations"}));
matchingAlgorithm := BackendDAEUtil.getMatchingAlgorithm(NONE());
daeHandler := BackendDAEUtil.getIndexReductionMethod(NONE());

Expand Down

0 comments on commit e2edb49

Please sign in to comment.