Skip to content

Commit

Permalink
add initial step size flag to ida solver
Browse files Browse the repository at this point in the history
  • Loading branch information
Willi Braun authored and OpenModelica-Hudson committed Jun 3, 2016
1 parent c40d6c4 commit 9e077fe
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions SimulationRuntime/c/simulation/solver/ida_solver.c
Expand Up @@ -413,6 +413,26 @@ ida_solver_initial(DATA* data, threadData_t *threadData, SOLVER_INFO* solverInfo
}
}

/* define initial step size */
if (omc_flag[FLAG_INITIAL_STEP_SIZE])
{
double initialStepSize = atof(omc_flagValue[FLAG_INITIAL_STEP_SIZE]);

assertStreamPrint(threadData, initialStepSize >= DASSL_STEP_EPS, "Selected initial step size %e is too small.", initialStepSize);

flag = IDASetInitStep(idaData->ida_mem, initialStepSize);
if (checkIDAflag(flag)){
throwStreamPrint(threadData, "##IDA## Set intial step size failed!");
}
infoStreamPrint(LOG_SOLVER, 0, "initial step size: %g", initialStepSize);
}
else
{
infoStreamPrint(LOG_SOLVER, 0, "initial step size is set automatically.");
}



/* configure the sensitivities part */
idaData->idaSmode = omc_flag[FLAG_IDAS] ? 1 : 0;

Expand Down

0 comments on commit 9e077fe

Please sign in to comment.