Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

Commit

Permalink
[BE] adjust daeMode flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Willi Braun authored and OpenModelica-Hudson committed Dec 13, 2018
1 parent 23e4c45 commit 53a0dfd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Compiler/Script/CevalScriptBackend.mo
Expand Up @@ -468,7 +468,7 @@ algorithm
GlobalScript.SIMULATION_OPTIONS(startTime, stopTime, numberOfIntervals, stepSize, tolerance, method, _, options, outputFormat, variableFilter, cflags, simflags) := inSimOpt;
if UseOtimica then
method := DAE.SCONST("optimization");
elseif Flags.getConfigEnum(Flags.DAE_MODE) > 1 then
elseif Flags.getConfigBool(Flags.DAE_MODE) then
method := DAE.SCONST("ida");
end if;
numberOfIntervals := if UseOtimica then DAE.ICONST(50) else numberOfIntervals;
Expand Down Expand Up @@ -3331,7 +3331,7 @@ protected function callTranslateModel
output String outFileDir;
output list<tuple<String,Values.Value>> resultValues;
algorithm
if Flags.getConfigEnum(Flags.DAE_MODE) > 1 then
if Flags.getConfigBool(Flags.DAE_MODE) then
(outCache, outStringLst, outFileDir, resultValues) :=
SimCodeMain.translateModelDAEMode(inCache,inEnv,className,inFileNamePrefix,
inSimSettingsOpt,Absyn.FUNCTIONARGS({},{}));
Expand Down
4 changes: 2 additions & 2 deletions Compiler/Template/CodegenC.tpl
Expand Up @@ -1162,7 +1162,7 @@ template simulationFile(SimCode simCode, String guid, String isModelExchangeFMU)
data.modelData = &modelData;
data.simulationInfo = &simInfo;
measure_time_flag = <% if profileHtml() then "5" else if profileSome() then "1" else if profileAll() then "2" else "0" /* Would be good if this was not a global variable...*/ %>;
compiledInDAEMode = <%intSub(Flags.getConfigEnum(Flags.DAE_MODE), 1)%>;
compiledInDAEMode = <% if Flags.getConfigBool(Flags.DAE_MODE) then 1 else 0%>;
compiledWithSymSolver = <% intSub(Flags.getConfigEnum(Flags.SYM_SOLVER), 0) %>;
<%mainInit%>
<%mainTop(mainBody,"https://trac.openmodelica.org/OpenModelica/newticket")%>
Expand All @@ -1189,7 +1189,7 @@ end simulationFile;
template simulationFileHeader(String fileNamePrefix)
"Generates header part of simulation file."
::=
let daeHeader = if intGt(Flags.getConfigEnum(Flags.DAE_MODE), 1) then '#include "<%fileNamePrefix%>_16dae.h"'
let daeHeader = if Flags.getConfigBool(Flags.DAE_MODE) then '#include "<%fileNamePrefix%>_16dae.h"'
<<
#include "<%fileNamePrefix%>_model.h"
<%daeHeader%>
Expand Down
10 changes: 3 additions & 7 deletions Compiler/Util/Flags.mo
Expand Up @@ -1336,13 +1336,9 @@ constant ConfigFlag CT_STATE_MACHINES = CONFIG_FLAG(94, "ctStateMachines",
Util.gettext("Experimental: Enable continuous-time state machine prototype"));

constant ConfigFlag DAE_MODE = CONFIG_FLAG(95, "daeMode",
NONE(), EXTERNAL(), ENUM_FLAG(1, {("none", 1), ("all",2), ("dynamic",3), ("new",4)}),
SOME(STRING_OPTION({"none", "all", "dynamic"})),
Util.gettext("Generates additional code for DAE mode, where the equations are not causelized, when one of the following option is selected:\n"+
"all : In this mode all equations are passed to the integrator.\n"+
"dynamic : In this mode only the equation for the dynamic part of the system are passed to the integrator."+
"new : This option enables the new daeMode. Currently alpha development status.\n")
);
NONE(), EXTERNAL(), BOOL_FLAG(false), NONE(),
Util.gettext("Generates code to simulate models in DAE mode. The whole system is passed directly to the DAE solver"+
"SUNDIALS/IDA and no algebraic solver are involed for the simulation process."));

constant ConfigFlag INLINE_METHOD = CONFIG_FLAG(96, "inlineMethod",
NONE(), EXTERNAL(), ENUM_FLAG(1, {("replace",1), ("append",2)}),
Expand Down

0 comments on commit 53a0dfd

Please sign in to comment.