Skip to content

Commit

Permalink
fix in kinsol of cpp runtime for kinsol vectors
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@22645 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
niklwors committed Oct 7, 2014
1 parent 880e772 commit 21de29f
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions SimulationRuntime/cpp/Solver/Kinsol/Kinsol.cpp
Expand Up @@ -24,6 +24,12 @@ Kinsol::Kinsol(IAlgLoop* algLoop, INonLinSolverSettings* settings)
, _currentIterateNorm (100.0)
, _firstCall (true)
, _iterationStatus (CONTINUE)
,_Kin_y(NULL)
,_Kin_y0(NULL)
,_Kin_yScale(NULL)
,_Kin_fScale(NULL)
,_kinMem(NULL)

{
_data = ((void*)this);
}
Expand All @@ -41,12 +47,16 @@ Kinsol::~Kinsol()
if(_fHelp) delete [] _fHelp;
if(_zeroVec) delete [] _zeroVec;
if(_currentIterate) delete [] _currentIterate;
N_VDestroy_Serial(_Kin_y);
N_VDestroy_Serial(_Kin_y0);
N_VDestroy_Serial(_Kin_yScale);
N_VDestroy_Serial(_Kin_fScale);

KINFree(&_kinMem);
if(_Kin_y)
N_VDestroy_Serial(_Kin_y);
if(_Kin_y0)
N_VDestroy_Serial(_Kin_y0);
if(_Kin_yScale)
N_VDestroy_Serial(_Kin_yScale);
if(_Kin_fScale)
N_VDestroy_Serial(_Kin_fScale);
if(_kinMem)
KINFree(&_kinMem);
}

void Kinsol::initialize()
Expand Down

0 comments on commit 21de29f

Please sign in to comment.