Skip to content

Commit

Permalink
moved linear solver selection to initialization method
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25751 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
niklwors committed Apr 27, 2015
1 parent 90e88f0 commit 3dab9b1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions SimulationRuntime/cpp/Solver/Kinsol/Kinsol.cpp
Expand Up @@ -153,7 +153,13 @@ void Kinsol::initialize()
idid = KINSetUserData(_kinMem, _data);
if (check_flag(&idid, (char *)"KINSetUserData", 1))
throw ModelicaSimulationError(ALGLOOP_SOLVER,"Kinsol::initialize()");


#ifdef USE_SUNDIALS_LAPACK
KINLapackDense(_kinMem, _dimSys);
#else
KINDense(_kinMem, _dimSys);
#endif //USE_SUNDIALS_LAPACK

idid = KINSetErrFile(_kinMem, NULL);
idid = KINSetNumMaxIters(_kinMem, 1000);
//idid = KINSetEtaForm(_kinMem, KIN_ETACHOICE2);
Expand Down Expand Up @@ -226,11 +232,7 @@ void Kinsol::solve()
for(int i=0;i<_dimSys;i++) // Reset Scaling
_fScale[i] = 1.0;

#ifdef USE_SUNDIALS_LAPACK
KINLapackDense(_kinMem, _dimSys);
#else
KINDense(_kinMem, _dimSys);
#endif //USE_SUNDIALS_LAPACK

solveNLS();
if(_iterationStatus == DONE)
return;
Expand Down

0 comments on commit 3dab9b1

Please sign in to comment.