Skip to content

Commit

Permalink
[Janitor mode] Fix tabs
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@19708 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
OpenModelica-Hudson committed Mar 24, 2014
1 parent a03fe4e commit 15c63b4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
20 changes: 10 additions & 10 deletions SimulationRuntime/c/simulation/solver/nonlinearSolverHybrd.c
Expand Up @@ -699,18 +699,18 @@ int solveHybrd(DATA *data, int sysNumber)
nfunc_evals += solverData->nfev;
if(ACTIVE_STREAM(LOG_NLS))
{
/* output solution */
infoStreamPrint(LOG_NLS, 1, "solution for %s at t=%g", modelInfoXmlGetEquation(&data->modelData.modelDataXml,eqSystemNumber).name, data->localData[0]->timeValue);
for(i=0; i<solverData->n; ++i)
{
infoStreamPrint(LOG_NLS, 0, "[%ld] %s = %g", i+1, modelInfoXmlGetEquation(&data->modelData.modelDataXml,eqSystemNumber).vars[i]->name, solverData->x[i]);
}
/* output solution */
infoStreamPrint(LOG_NLS, 1, "solution for %s at t=%g", modelInfoXmlGetEquation(&data->modelData.modelDataXml,eqSystemNumber).name, data->localData[0]->timeValue);
for(i=0; i<solverData->n; ++i)
{
infoStreamPrint(LOG_NLS, 0, "[%ld] %s = %g", i+1, modelInfoXmlGetEquation(&data->modelData.modelDataXml,eqSystemNumber).vars[i]->name, solverData->x[i]);
}
messageClose(LOG_NLS);
}else if (ACTIVE_STREAM(LOG_NLS_V)){
infoStreamPrint(LOG_NLS_V, 1, "system solved");
infoStreamPrint(LOG_NLS_V, 0, "%d retries\n%d restarts", retries, retries2+retries3);
messageClose(LOG_NLS_V);
printStatus(data, solverData, eqSystemNumber, &nfunc_evals, &xerror, &xerror_scaled, LOG_NLS_V);
infoStreamPrint(LOG_NLS_V, 1, "system solved");
infoStreamPrint(LOG_NLS_V, 0, "%d retries\n%d restarts", retries, retries2+retries3);
messageClose(LOG_NLS_V);
printStatus(data, solverData, eqSystemNumber, &nfunc_evals, &xerror, &xerror_scaled, LOG_NLS_V);
}
scaling = solverData->useXScaling;
if(scaling)
Expand Down
40 changes: 20 additions & 20 deletions SimulationRuntime/c/simulation/solver/nonlinearSystem.c
Expand Up @@ -291,26 +291,26 @@ int check_nonlinear_solution(DATA *data, int printFailingSystems, int sysNumber)
{
warningStreamPrint(LOG_NLS, 1, "proper start-values for some of the following iteration variables might help");
}
for(j=0; j<modelInfoXmlGetEquation(&data->modelData.modelDataXml, (nonlinsys[i]).equationIndex).numVar; ++j) {
int done=0;
long k;
const MODEL_DATA *mData = &(data->modelData);
for(k=0; k<mData->nVariablesReal && !done; ++k)
{
if(!strcmp(mData->realVarsData[k].info.name, modelInfoXmlGetEquation(&data->modelData.modelDataXml, (nonlinsys[i]).equationIndex).vars[j]->name))
{
done = 1;
warningStreamPrint(LOG_NLS, 0, "[%ld] Real %s(start=%g, nominal=%g)", j+1,
mData->realVarsData[k].info.name,
mData->realVarsData[k].attribute.start,
mData->realVarsData[k].attribute.nominal);
}
}
if (!done)
{
warningStreamPrint(LOG_NLS, 0, "[%ld] Real %s(start=?, nominal=?)", j+1, modelInfoXmlGetEquation(&data->modelData.modelDataXml, (nonlinsys[i]).equationIndex).vars[j]->name);
}
}
for(j=0; j<modelInfoXmlGetEquation(&data->modelData.modelDataXml, (nonlinsys[i]).equationIndex).numVar; ++j) {
int done=0;
long k;
const MODEL_DATA *mData = &(data->modelData);
for(k=0; k<mData->nVariablesReal && !done; ++k)
{
if(!strcmp(mData->realVarsData[k].info.name, modelInfoXmlGetEquation(&data->modelData.modelDataXml, (nonlinsys[i]).equationIndex).vars[j]->name))
{
done = 1;
warningStreamPrint(LOG_NLS, 0, "[%ld] Real %s(start=%g, nominal=%g)", j+1,
mData->realVarsData[k].info.name,
mData->realVarsData[k].attribute.start,
mData->realVarsData[k].attribute.nominal);
}
}
if (!done)
{
warningStreamPrint(LOG_NLS, 0, "[%ld] Real %s(start=?, nominal=?)", j+1, modelInfoXmlGetEquation(&data->modelData.modelDataXml, (nonlinsys[i]).equationIndex).vars[j]->name);
}
}
if (ACTIVE_WARNING_STREAM(LOG_NLS)) messageClose(LOG_NLS);
return 1;
}
Expand Down

0 comments on commit 15c63b4

Please sign in to comment.