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

Commit

Permalink
Fix success messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaeuber authored and OpenModelica-Hudson committed Aug 24, 2017
1 parent 4522d13 commit 3ade197
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ static int symbolic_initialization(DATA *data, threadData_t *threadData)
FILE *pFile = NULL;
long i;
MODEL_DATA *mData = data->modelData;
int solvedWithHomotopy = 0;

#if !defined(OMC_NDELAY_EXPRESSIONS) || OMC_NDELAY_EXPRESSIONS>0
/* initial sample and delay before initial the system */
Expand All @@ -200,7 +201,6 @@ static int symbolic_initialization(DATA *data, threadData_t *threadData)
if (data->callback->useHomotopy == 0 || init_lambda_steps < 2){
data->simulationInfo->lambda = 1.0;
data->callback->functionInitialEquations(data, threadData);
infoStreamPrint(LOG_STDOUT, 0, "The initialization finished successfully without homotopy method.");

/* If there is homotopy in the model and global homotopy is activated
and homotopy on first try is deactivated,
Expand All @@ -215,7 +215,6 @@ static int symbolic_initialization(DATA *data, threadData_t *threadData)
infoStreamPrint(LOG_INIT, 0, "Try to solve the initialization problem without homotopy first.");
data->callback->functionInitialEquations(data, threadData);
init_lambda_steps = 0;
infoStreamPrint(LOG_STDOUT, 0, "The initialization finished successfully without homotopy method.");

/* catch */
#ifndef OMC_EMCC
Expand Down Expand Up @@ -277,7 +276,7 @@ static int symbolic_initialization(DATA *data, threadData_t *threadData)
check_mixed_solutions(data, 0))
break;
}
infoStreamPrint(LOG_STDOUT, 0, "The initialization finished successfully with homotopy method.");
solvedWithHomotopy = 1;
messageClose(LOG_INIT);
}

Expand All @@ -291,6 +290,9 @@ static int symbolic_initialization(DATA *data, threadData_t *threadData)
/* check for over-determined systems */
retVal = data->callback->functionRemovedInitialEquations(data, threadData);

if (!retVal)
infoStreamPrint(LOG_STDOUT, 0, "The initialization finished successfully %s homotopy method.", solvedWithHomotopy ? "with" : "without");

TRACE_POP
return retVal;
}
Expand Down
4 changes: 3 additions & 1 deletion SimulationRuntime/c/simulation/solver/solver_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,9 @@ int solver_main(DATA* data, threadData_t *threadData, const char* init_initMetho
{
freeSolverData(data, &solverInfo);
}
infoStreamPrint(LOG_STDOUT, 0, "The simulation finished successfully.");

if (!retVal)
infoStreamPrint(LOG_STDOUT, 0, "The simulation finished successfully.");

TRACE_POP
return retVal;
Expand Down

0 comments on commit 3ade197

Please sign in to comment.