Skip to content

Commit

Permalink
Fix for trying without adaptive homotopy
Browse files Browse the repository at this point in the history
Do not override lambda with 0 (has to be 1).

Belonging to [master]:
  - OpenModelica/OMCompiler#2171
  • Loading branch information
ptaeuber authored and OpenModelica-Hudson committed Feb 7, 2018
1 parent 3418ccf commit 5cf25d1
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -193,10 +193,10 @@ int allocateHomotopyData(int size, void** voiddata)
data->gradFx = (double*) calloc(size,sizeof(double));

/* damped newton */
data->x = (double*) calloc(size,sizeof(double));
data->x0 = (double*) calloc(size,sizeof(double));
data->x = (double*) calloc((size+1),sizeof(double));
data->x0 = (double*) calloc((size+1),sizeof(double));
data->xStart = (double*) calloc(size,sizeof(double));
data->x1 = (double*) calloc(size,sizeof(double));
data->x1 = (double*) calloc((size+1),sizeof(double));
data->finit = (double*) calloc(size,sizeof(double));
data->fx0 = (double*) calloc(size,sizeof(double));
data->fJac = (double*) calloc((size*(size+1)),sizeof(double));
Expand Down Expand Up @@ -910,6 +910,8 @@ static int wrapper_fvec(DATA_HOMOTOPY* solverData, double* x, double* f)
void *dataAndThreadData[2] = {solverData->data, solverData->threadData};
int iflag = 0;

if ((solverData->data)->simulationInfo->nonlinearSystemData[solverData->sysNumber].homotopySupport && !solverData->initHomotopy && (solverData->data)->simulationInfo->nonlinearSystemData[solverData->sysNumber].size > solverData->n)
x[solverData->n] = 1.0;
/*TODO: change input to residualFunc from data to systemData */
(solverData->data)->simulationInfo->nonlinearSystemData[solverData->sysNumber].residualFunc(dataAndThreadData, x, f, &iflag);
solverData->numberOfFunctionEvaluations++;
Expand Down

0 comments on commit 5cf25d1

Please sign in to comment.