Skip to content

Commit

Permalink
Fixed some warnings in ida_solver.c and dassl.c
Browse files Browse the repository at this point in the history
  • Loading branch information
AnHeuermann authored and adrpo committed Aug 22, 2019
1 parent 3fca764 commit 17381f2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
11 changes: 5 additions & 6 deletions OMCompiler/SimulationRuntime/c/simulation/solver/dassl.c
Expand Up @@ -951,14 +951,13 @@ int jacA_sym(double *t, double *y, double *yprime, double *delta,
threadData_t *threadData = (threadData_t*)(void*)((double**)rpar)[2];

const int index = data->callback->INDEX_JAC_A;
ANALYTIC_JACOBIAN* jac = &(data->simulationInfo->analyticJacobians[index]);
unsigned int columns = jac->sizeCols;
unsigned int rows = jac->sizeRows;
unsigned int sizeTmpVars = jac->sizeTmpVars;
unsigned int i;
ANALYTIC_JACOBIAN* t_jac = &(data->simulationInfo->analyticJacobians[index]);
unsigned int columns = t_jac->sizeCols;
unsigned int rows = t_jac->sizeRows;
unsigned int sizeTmpVars = t_jac->sizeTmpVars;

unsigned int i,j;

unsigned int j;
for(i=0; i < columns; i++)
{
t_jac->seedVars[i] = 1.0;
Expand Down
13 changes: 7 additions & 6 deletions OMCompiler/SimulationRuntime/c/simulation/solver/ida_solver.c
Expand Up @@ -793,6 +793,8 @@ ida_event_update(DATA* data, threadData_t *threadData)
data->callback->functionDAE(data, threadData);
if (measure_time_flag) rt_tick(SIM_TIMER_SOLVER);
}

return 0;
}

/* main ida function to make a step */
Expand Down Expand Up @@ -1228,7 +1230,7 @@ int residualFunctionIDA(double time, N_Vector yy, N_Vector yp, N_Vector res, voi
for(i=0; i < idaData->N; i++)
{
NV_Ith_S(res, i) = data->simulationInfo->daeModeData->residualVars[i];
infoStreamPrint(LOG_SOLVER_V, 0, "%d. residual = %e", i, NV_Ith_S(res, i));
infoStreamPrint(LOG_SOLVER_V, 0, "%ld. residual = %e", i, NV_Ith_S(res, i));
}
}
else
Expand All @@ -1240,7 +1242,7 @@ int residualFunctionIDA(double time, N_Vector yy, N_Vector yp, N_Vector res, voi
for(i=0; i < idaData->N; i++)
{
NV_Ith_S(res, i) = data->localData[0]->realVars[data->modelData->nStates + i] - NV_Ith_S(yp, i);
infoStreamPrint(LOG_SOLVER_V, 0, "%d. residual = %e", i, NV_Ith_S(res, i));
infoStreamPrint(LOG_SOLVER_V, 0, "%ld. residual = %e", i, NV_Ith_S(res, i));
}
}

Expand Down Expand Up @@ -1774,7 +1776,6 @@ static int callSparseJacobian(double tt, double cj,
N_Vector tmp1, N_Vector tmp2, N_Vector tmp3)
{
TRACE_PUSH
int retVal;

IDA_SOLVER* idaData = (IDA_SOLVER*)user_data;
DATA* data = (DATA*)(((IDA_USERDATA*)idaData->simData)->data);
Expand All @@ -1786,11 +1787,11 @@ static int callSparseJacobian(double tt, double cj,

if (idaData->jacobianMethod == COLOREDSYMJAC || idaData->jacobianMethod == SYMJAC)
{
retVal = jacColoredSymbolicalSparse(tt, yy, yp, rr, Jac, cj, user_data);
jacColoredSymbolicalSparse(tt, yy, yp, rr, Jac, cj, user_data);
}
else if (idaData->jacobianMethod == COLOREDNUMJAC || idaData->jacobianMethod == NUMJAC)
{
retVal = jacoColoredNumericalSparse(tt, yy, yp, rr, Jac, cj, user_data);
jacoColoredNumericalSparse(tt, yy, yp, rr, Jac, cj, user_data);
}

/* debug */
Expand All @@ -1817,7 +1818,7 @@ static int callSparseJacobian(double tt, double cj,
if (measure_time_flag) rt_tick(SIM_TIMER_SOLVER);

TRACE_POP
return retVal;
return 0;
}

static
Expand Down

0 comments on commit 17381f2

Please sign in to comment.