Skip to content

Commit

Permalink
added flag to suppress algebraic vars from error test (daeMode)
Browse files Browse the repository at this point in the history
  • Loading branch information
Willi Braun authored and OpenModelica-Hudson committed Jun 23, 2016
1 parent e740f2d commit 84d5741
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
9 changes: 6 additions & 3 deletions SimulationRuntime/c/simulation/solver/ida_solver.c
Expand Up @@ -402,9 +402,12 @@ ida_solver_initial(DATA* data, threadData_t *threadData, SOLVER_INFO* solverInfo
/* configure algebraic variables as such */
if (idaData->daeMode)
{
flag = IDASetSuppressAlg(idaData->ida_mem, TRUE);
if (checkIDAflag(flag)){
throwStreamPrint(threadData, "##IDA## Suppress algebraic variables in the local error test failed");
if (omc_flag[FLAG_IDA_SUPPRESS_ALG])
{
flag = IDASetSuppressAlg(idaData->ida_mem, TRUE);
if (checkIDAflag(flag)){
throwStreamPrint(threadData, "##IDA## Suppress algebraic variables in the local error test failed");
}
}

for(i=0; i<idaData->N; ++i)
Expand Down
5 changes: 5 additions & 0 deletions SimulationRuntime/c/util/simulation_options.c
Expand Up @@ -47,6 +47,7 @@ const char *FLAG_NAME[FLAG_MAX+1] = {
/* FLAG_HELP */ "help",
/* FLAG_IDA_LS */ "idaLS",
/* FLAG_IDAS */ "idaSensitivity",
/* FLAG_IDA_SUPPRESS_ALG */ "idaSupressAlg",
/* FLAG_IGNORE_HIDERESULT */ "ignoreHideResult",
/* FLAG_IIF */ "iif",
/* FLAG_IIM */ "iim",
Expand Down Expand Up @@ -120,6 +121,7 @@ const char *FLAG_DESC[FLAG_MAX+1] = {
/* FLAG_HELP */ "get detailed information that specifies the command-line flag",
/* FLAG_IDA_LS */ "selects the linear solver used by ida",
/* FLAG_IDAS */ "flag to add sensitivity information to the result files",
/* FLAG_IDA_SUPPRESS_ALG */ "flag to to suppress algebraic variables in the local error of ida solver in daeMode",
/* FLAG_IGNORE_HIDERESULT */ "ignore HideResult=true annotation",
/* FLAG_IIF */ "value specifies an external file for the initialization of the model",
/* FLAG_IIM */ "value specifies the initialization method",
Expand Down Expand Up @@ -219,6 +221,8 @@ const char *FLAG_DETAILED_DESC[FLAG_MAX+1] = {
" * spgmr - sparse iterative linear solver based on transpose free quasi-minimal residual method, convergance is not guaranteed, sundials method\n",
/* FLAG_IDAS */
" Enables sensitivity analysis with respect to parameters if the model is compiled with omc flag --calculateSensitivities.",
/* FLAG_IDA_SUPPRESS_ALG */
" flag to to suppress algebraic variables in the local error of ida solver in daeMode",
/* FLAG_IGNORE_HIDERESULT */
" Emits also variables with HideResult=true annotation.",
/* FLAG_IIF */
Expand Down Expand Up @@ -385,6 +389,7 @@ const int FLAG_TYPE[FLAG_MAX] = {
/* FLAG_HELP */ FLAG_TYPE_OPTION,
/* FLAG_IDA_LS */ FLAG_TYPE_OPTION,
/* FLAG_IDAS */ FLAG_TYPE_FLAG,
/* FLAG_IDA_SUPPRESS_ALG */ FLAG_TYPE_FLAG,
/* FLAG_IGNORE_HIDERESULT */ FLAG_TYPE_FLAG,
/* FLAG_IIF */ FLAG_TYPE_OPTION,
/* FLAG_IIM */ FLAG_TYPE_OPTION,
Expand Down
1 change: 1 addition & 0 deletions SimulationRuntime/c/util/simulation_options.h
Expand Up @@ -55,6 +55,7 @@ enum _FLAG
FLAG_HELP,
FLAG_IDA_LS,
FLAG_IDAS,
FLAG_IDA_SUPPRESS_ALG,
FLAG_IGNORE_HIDERESULT,
FLAG_IIF,
FLAG_IIM,
Expand Down

0 comments on commit 84d5741

Please sign in to comment.