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

Commit

Permalink
[DAEmode] use IDA when the model is compiled in DAEmode
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - #2258
  • Loading branch information
Willi Braun authored and OpenModelica-Hudson committed Mar 7, 2018
1 parent 47aed5e commit fbf28bf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions SimulationRuntime/c/simulation/simulation_runtime.cpp
Expand Up @@ -453,6 +453,11 @@ int startNonInteractiveSimulation(int argc, char**argv, DATA* data, threadData_t
infoStreamPrint(LOG_SOLVER, 0, "overwrite solver method: %s [from command line]", data->simulationInfo->solverMethod);
}
}
/* if daeMode is turned on than use also the ida solver */
if (omc_flag[FLAG_DAE_MODE] && std::string("ida") != data->simulationInfo->solverMethod) {
data->simulationInfo->solverMethod = std::string("ida").c_str();
infoStreamPrint(LOG_SIMULATION, 0, "overwrite solver method: %s [DAEmode works only with IDA solver]", data->simulationInfo->solverMethod);
}

// Create a result file
const char *result_file = omc_flagValue[FLAG_R];
Expand Down Expand Up @@ -903,6 +908,12 @@ int initRuntimeAndSimulation(int argc, char**argv, DATA *data, threadData_t *thr
infoStreamPrint(LOG_STDOUT, 0, "Tolerance for steady state detection changed to %g", steadyStateTol);
}

/* if compiled with the new DAE mode the simulation
* works only in daeMode and the ida solver */
if (compiledInDAEMode == 3){
omc_flag[FLAG_DAE_MODE] = 1;
}

rt_tick(SIM_TIMER_INIT_XML);
read_input_xml(data->modelData, data->simulationInfo);
rt_accumulate(SIM_TIMER_INIT_XML);
Expand Down

0 comments on commit fbf28bf

Please sign in to comment.