Skip to content

Commit

Permalink
revert Cpp Newton solver to version f23c496
Browse files Browse the repository at this point in the history
This was the last version before the introduction of the Broyden method.
The basic Newton method turned out to work more reliably.
  • Loading branch information
rfranke committed Oct 19, 2015
1 parent 8505a24 commit 9c388fa
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 478 deletions.
63 changes: 9 additions & 54 deletions SimulationRuntime/cpp/Include/Solver/Newton/Newton.h
Expand Up @@ -13,11 +13,7 @@
#include <Solver/Newton/NewtonSettings.h>

#include <Core/Utils/extension/logger.hpp>
#if defined(__vxworks)
//#include <klu.h>
#else
//#include <Solver/KLU/klu.h>
#endif


/*****************************************************************************/
/**
Expand Down Expand Up @@ -75,6 +71,7 @@ class Newton : public IAlgLoopSolver
/// Encapsulation of determination of Jacobian
void calcJacobian();


// Member variables
//---------------------------------------------------------------
INonLinSolverSettings
Expand All @@ -87,62 +84,20 @@ class Newton : public IAlgLoopSolver
_iterationStatus; ///< Output - Denotes the status of iteration

long int
_dimSys, ///< Temp - Number of unknowns (=dimension of system of equations)
_lwork,
_iONE;
_dimSys; ///< Temp - Number of unknowns (=dimension of system of equations)

bool
_firstCall; ///< Temp - Denotes the first call to the solver, init() is called

double
*_y, ///< Temp - Unknowns
*_yHelp,
*_fnew, ///< Temp - Residuals
*_fold, ///< Temp - Residuals
*_fHelp,
*_delta_s, ///< Temp - Auxillary variables
*_delta_b, ///< Temp - Auxillary variables
*_f, ///< Temp - Residuals
*_yHelp, ///< Temp - Auxillary variables
*_fHelp, ///< Temp - Auxillary variables
*_jac, ///< Temp - Jacobian
*_jacHelpMat1,
*_jacHelpMat2,
*_jacHelpVec1,
*_jacHelpVec2,
*_work;

int
_broydenMethod;

double _fNormTol,
_dONE,
_dZERO,
_dMINUSONE;


*_y_old,
*_y_new,
* _zeroVec;
long int *_iHelp;

char
_N,
_T;

bool _sparse;


int _dim;
//klu_symbolic* _kluSymbolic ;
//klu_numeric* _kluNumeric ;
//klu_common* _kluCommon ;
int* _Ai;
int* _Ap;
double* _Ax;
int _nonzeros;

long int* _ihelpArray;
double * _zeroVec;
double * _f ;




double* _identity;
};
/** @} */ // end of solverNewton

0 comments on commit 9c388fa

Please sign in to comment.