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

Commit

Permalink
fix in Kinsol of cpp runtime for sundials 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
niklwors authored and OpenModelica-Hudson committed Mar 2, 2017
1 parent c4ab684 commit 9d93410
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
9 changes: 7 additions & 2 deletions SimulationRuntime/cpp/Include/Solver/Kinsol/KinsolLapack.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@
int KINLapackCompletePivoting(void *kinmem, int N);
static int KINLapackCompletePivotingInit(KINMem kin_mem);
static int KINLapackCompletePivotingSetup(KINMem kin_mem);
#if SUNDIALS_MAJOR_VERSION > 2 || (SUNDIALS_MAJOR_VERSION == 2 && SUNDIALS_MINOR_VERSION > 5)
#if (SUNDIALS_MAJOR_VERSION == 2 && SUNDIALS_MINOR_VERSION > 6)
static int KINLapackCompletePivotingSolve(KINMem kin_mem, N_Vector x, N_Vector b, realtype *sJpnorm, realtype *sFdotJp);
static int KINLapackCompletePivotingFree(KINMem kin_mem);
#elif (SUNDIALS_MAJOR_VERSION == 2 && SUNDIALS_MINOR_VERSION > 5 && SUNDIALS_MINOR_VERSION < 7)
static int KINLapackCompletePivotingSolve(KINMem kin_mem, N_Vector x, N_Vector b, realtype *sJpnorm, realtype *sFdotJp);
static void KINLapackCompletePivotingFree(KINMem kin_mem);
#else
static int KINLapackCompletePivotingSolve(KINMem kin_mem, N_Vector x, N_Vector b, realtype *res_norm);
#endif
static void KINLapackCompletePivotingFree(KINMem kin_mem);
#endif

static int calcJacobian(KINMem kin_mem);

struct linSysData
Expand Down
11 changes: 11 additions & 0 deletions SimulationRuntime/cpp/Solver/Kinsol/KinsolLapack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,15 @@ static int KINLapackCompletePivotingSetup(KINMem kin_mem)
* \return Return_Description
* \details Details
*/




#if(SUNDIALS_MAJOR_VERSION == 2 && SUNDIALS_MINOR_VERSION > 6)
static int KINLapackCompletePivotingFree(KINMem kin_mem)
#else
static void KINLapackCompletePivotingFree(KINMem kin_mem)
#endif
{
linSysData* data = (linSysData*)kin_mem->kin_lmem;

Expand All @@ -94,6 +102,9 @@ static void KINLapackCompletePivotingFree(KINMem kin_mem)
delete [] data->ihelpArray;
delete [] data->jhelpArray;
delete data;
#if (SUNDIALS_MAJOR_VERSION == 2 && SUNDIALS_MINOR_VERSION > 6)
return 0;
#endif
}
/**\brief Brief callback function to solve linear system
* \param [in] kin_mem Parameter_Description
Expand Down

0 comments on commit 9d93410

Please sign in to comment.