Simbody  3.5
SimTK::CPodes Class Reference

This is a straightforward translation of the Sundials CPODES C interface into C++. More...

Public Types

enum  ODEType {
  UnspecifiedODEType =0,
  ExplicitODE,
  ImplicitODE
}
 
enum  LinearMultistepMethod {
  UnspecifiedLinearMultistepMethod =0,
  BDF,
  Adams
}
 
enum  NonlinearSystemIterationType {
  UnspecifiedNonlinearSystemIterationType =0,
  Newton,
  Functional
}
 
enum  ToleranceType {
  UnspecifiedToleranceType =0,
  ScalarScalar,
  ScalarVector,
  WeightFunction
}
 
enum  ProjectionNorm {
  UnspecifiedProjectionNorm =0,
  L2Norm,
  ErrorNorm
}
 
enum  ConstraintLinearity {
  UnspecifiedConstraintLinearity =0,
  Linear,
  Nonlinear
}
 
enum  ProjectionFactorizationType {
  UnspecifiedProjectionFactorizationType =0,
  ProjectWithLU,
  ProjectWithQR,
  ProjectWithSchurComplement,
  ProjectWithQRPivot
}
 
enum  StepMode {
  UnspecifiedStepMode =0,
  Normal,
  OneStep,
  NormalTstop,
  OneStepTstop
}
 

Public Member Functions

 CPodes (ODEType ode=UnspecifiedODEType, LinearMultistepMethod lmm=UnspecifiedLinearMultistepMethod, NonlinearSystemIterationType nls=UnspecifiedNonlinearSystemIterationType)
 
 ~CPodes ()
 
int init (CPodesSystem &sys, Real t0, const Vector &y0, const Vector &yp0, ToleranceType tt, Real reltol, void *abstol)
 
int reInit (CPodesSystem &sys, Real t0, const Vector &y0, const Vector &yp0, ToleranceType tt, Real reltol, void *abstol)
 
int projInit (ProjectionNorm, ConstraintLinearity, const Vector &ctol)
 
int projDefine ()
 
int quadInit (const Vector &q0)
 
int quadReInit (const Vector &q0)
 
int rootInit (int nrtfn)
 
int setErrHandlerFn ()
 
int setEwtFn ()
 
int dlsSetJacFn (void *jac, void *jac_data)
 
int dlsProjSetJacFn (void *jacP, void *jacP_data)
 
int step (Real tout, Real *tret, Vector &y_inout, Vector &yp_inout, StepMode=Normal)
 
int setErrFile (FILE *errfp)
 
int setMaxOrd (int maxord)
 
int setMaxNumSteps (int mxsteps)
 
int setMaxHnilWarns (int mxhnil)
 
int setStabLimDet (bool stldet)
 
int setInitStep (Real hin)
 
int setMinStep (Real hmin)
 
int setMaxStep (Real hmax)
 
int setStopTime (Real tstop)
 
int setMaxErrTestFails (int maxnef)
 
int setMaxNonlinIters (int maxcor)
 
int setMaxConvFails (int maxncf)
 
int setNonlinConvCoef (Real nlscoef)
 
int setProjUpdateErrEst (bool proj_err)
 
int setProjFrequency (int proj_freq)
 
int setProjTestCnstr (bool test_cnstr)
 
int setProjLsetupFreq (int proj_lset_freq)
 
int setProjNonlinConvCoef (Real prjcoef)
 
int setQuadErrCon (bool errconQ, int tol_typeQ, Real reltolQ, void *abstolQ)
 
int setTolerances (int tol_type, Real reltol, void *abstol)
 
int setRootDirection (Array_< int > &rootdir)
 
int getDky (Real t, int k, Vector &dky)
 
int getQuad (Real t, Vector &yQout)
 
int getQuadDky (Real t, int k, Vector &dky)
 
int getWorkSpace (int *lenrw, int *leniw)
 
int getNumSteps (int *nsteps)
 
int getNumFctEvals (int *nfevals)
 
int getNumLinSolvSetups (int *nlinsetups)
 
int getNumErrTestFails (int *netfails)
 
int getLastOrder (int *qlast)
 
int getCurrentOrder (int *qcur)
 
int getNumStabLimOrderReds (int *nslred)
 
int getActualInitStep (Real *hinused)
 
int getLastStep (Real *hlast)
 
int getCurrentStep (Real *hcur)
 
int getCurrentTime (Real *tcur)
 
int getTolScaleFactor (Real *tolsfac)
 
int getErrWeights (Vector &eweight)
 
int getEstLocalErrors (Vector &ele)
 
int getNumGEvals (int *ngevals)
 
int getRootInfo (int *rootsfound)
 
int getRootWindow (Real *tLo, Real *tHi)
 
int getIntegratorStats (int *nsteps, int *nfevals, int *nlinsetups, int *netfails, int *qlast, int *qcur, Real *hinused, Real *hlast, Real *hcur, Real *tcur)
 
int getNumNonlinSolvIters (int *nniters)
 
int getNumNonlinSolvConvFails (int *nncfails)
 
int getNonlinSolvStats (int *nniters, int *nncfails)
 
int getProjNumProj (int *nproj)
 
int getProjNumCnstrEvals (int *nce)
 
int getProjNumLinSolvSetups (int *nsetupsP)
 
int getProjNumFailures (int *nprf)
 
int getProjStats (int *nproj, int *nce, int *nsetupsP, int *nprf)
 
int getQuadNumFunEvals (int *nqevals)
 
int getQuadErrWeights (Vector &eQweight)
 
char * getReturnFlagName (int flag)
 
int dlsGetWorkSpace (int *lenrwLS, int *leniwLS)
 
int dlsGetNumJacEvals (int *njevals)
 
int dlsGetNumFctEvals (int *nfevalsLS)
 
int dlsGetLastFlag (int *flag)
 
char * dlsGetReturnFlagName (int flag)
 
int dlsProjGetNumJacEvals (int *njPevals)
 
int dlsProjGetNumFctEvals (int *ncevalsLS)
 
int lapackDense (int N)
 
int lapackBand (int N, int mupper, int mlower)
 
int lapackDenseProj (int Nc, int Ny, ProjectionFactorizationType)
 

Static Public Attributes

static const int Success = 0
 
static const int TstopReturn = 1
 
static const int RootReturn = 2
 
static const int Warning = 99
 
static const int TooMuchWork = -1
 
static const int TooClose = -27
 
static const int RecoverableError = 9999
 
static const int UnrecoverableError = -9999
 

Friends

class CPodesRep
 

Detailed Description

This is a straightforward translation of the Sundials CPODES C interface into C++.

The class CPodes represents a single instance of a CPODES integrator, and handles the associated memory internally. Methods here are identical to the corresponding CPODES functions (with the "CPode" prefix removed) but are const-correct and use SimTK Vector & Real rather than Sundials N_Vector and realtype.

Member Enumeration Documentation

Enumerator
UnspecifiedODEType 
ExplicitODE 
ImplicitODE 
Enumerator
UnspecifiedLinearMultistepMethod 
BDF 
Adams 
Enumerator
UnspecifiedNonlinearSystemIterationType 
Newton 
Functional 
Enumerator
UnspecifiedToleranceType 
ScalarScalar 
ScalarVector 
WeightFunction 
Enumerator
UnspecifiedProjectionNorm 
L2Norm 
ErrorNorm 
Enumerator
UnspecifiedConstraintLinearity 
Linear 
Nonlinear 
Enumerator
UnspecifiedProjectionFactorizationType 
ProjectWithLU 
ProjectWithQR 
ProjectWithSchurComplement 
ProjectWithQRPivot 
Enumerator
UnspecifiedStepMode 
Normal 
OneStep 
NormalTstop 
OneStepTstop 

Constructor & Destructor Documentation

SimTK::CPodes::~CPodes ( )

Member Function Documentation

int SimTK::CPodes::init ( CPodesSystem sys,
Real  t0,
const Vector y0,
const Vector yp0,
ToleranceType  tt,
Real  reltol,
void *  abstol 
)
int SimTK::CPodes::reInit ( CPodesSystem sys,
Real  t0,
const Vector y0,
const Vector yp0,
ToleranceType  tt,
Real  reltol,
void *  abstol 
)
int SimTK::CPodes::projInit ( ProjectionNorm  ,
ConstraintLinearity  ,
const Vector ctol 
)
int SimTK::CPodes::projDefine ( )
int SimTK::CPodes::quadInit ( const Vector q0)
int SimTK::CPodes::quadReInit ( const Vector q0)
int SimTK::CPodes::rootInit ( int  nrtfn)
int SimTK::CPodes::setErrHandlerFn ( )
int SimTK::CPodes::setEwtFn ( )
int SimTK::CPodes::dlsSetJacFn ( void *  jac,
void *  jac_data 
)
int SimTK::CPodes::dlsProjSetJacFn ( void *  jacP,
void *  jacP_data 
)
int SimTK::CPodes::step ( Real  tout,
Real tret,
Vector y_inout,
Vector yp_inout,
StepMode  = Normal 
)
int SimTK::CPodes::setErrFile ( FILE *  errfp)
int SimTK::CPodes::setMaxOrd ( int  maxord)
int SimTK::CPodes::setMaxNumSteps ( int  mxsteps)
int SimTK::CPodes::setMaxHnilWarns ( int  mxhnil)
int SimTK::CPodes::setStabLimDet ( bool  stldet)
int SimTK::CPodes::setInitStep ( Real  hin)
int SimTK::CPodes::setMinStep ( Real  hmin)
int SimTK::CPodes::setMaxStep ( Real  hmax)
int SimTK::CPodes::setStopTime ( Real  tstop)
int SimTK::CPodes::setMaxErrTestFails ( int  maxnef)
int SimTK::CPodes::setMaxNonlinIters ( int  maxcor)
int SimTK::CPodes::setMaxConvFails ( int  maxncf)
int SimTK::CPodes::setNonlinConvCoef ( Real  nlscoef)
int SimTK::CPodes::setProjUpdateErrEst ( bool  proj_err)
int SimTK::CPodes::setProjFrequency ( int  proj_freq)
int SimTK::CPodes::setProjTestCnstr ( bool  test_cnstr)
int SimTK::CPodes::setProjLsetupFreq ( int  proj_lset_freq)
int SimTK::CPodes::setProjNonlinConvCoef ( Real  prjcoef)
int SimTK::CPodes::setQuadErrCon ( bool  errconQ,
int  tol_typeQ,
Real  reltolQ,
void *  abstolQ 
)
int SimTK::CPodes::setTolerances ( int  tol_type,
Real  reltol,
void *  abstol 
)
int SimTK::CPodes::setRootDirection ( Array_< int > &  rootdir)
int SimTK::CPodes::getDky ( Real  t,
int  k,
Vector dky 
)
int SimTK::CPodes::getQuad ( Real  t,
Vector yQout 
)
int SimTK::CPodes::getQuadDky ( Real  t,
int  k,
Vector dky 
)
int SimTK::CPodes::getWorkSpace ( int *  lenrw,
int *  leniw 
)
int SimTK::CPodes::getNumSteps ( int *  nsteps)
int SimTK::CPodes::getNumFctEvals ( int *  nfevals)
int SimTK::CPodes::getNumLinSolvSetups ( int *  nlinsetups)
int SimTK::CPodes::getNumErrTestFails ( int *  netfails)
int SimTK::CPodes::getLastOrder ( int *  qlast)
int SimTK::CPodes::getCurrentOrder ( int *  qcur)
int SimTK::CPodes::getNumStabLimOrderReds ( int *  nslred)
int SimTK::CPodes::getActualInitStep ( Real hinused)
int SimTK::CPodes::getLastStep ( Real hlast)
int SimTK::CPodes::getCurrentStep ( Real hcur)
int SimTK::CPodes::getCurrentTime ( Real tcur)
int SimTK::CPodes::getTolScaleFactor ( Real tolsfac)
int SimTK::CPodes::getErrWeights ( Vector eweight)
int SimTK::CPodes::getEstLocalErrors ( Vector ele)
int SimTK::CPodes::getNumGEvals ( int *  ngevals)
int SimTK::CPodes::getRootInfo ( int *  rootsfound)
int SimTK::CPodes::getRootWindow ( Real tLo,
Real tHi 
)
int SimTK::CPodes::getIntegratorStats ( int *  nsteps,
int *  nfevals,
int *  nlinsetups,
int *  netfails,
int *  qlast,
int *  qcur,
Real hinused,
Real hlast,
Real hcur,
Real tcur 
)
int SimTK::CPodes::getNumNonlinSolvIters ( int *  nniters)
int SimTK::CPodes::getNumNonlinSolvConvFails ( int *  nncfails)
int SimTK::CPodes::getNonlinSolvStats ( int *  nniters,
int *  nncfails 
)
int SimTK::CPodes::getProjNumProj ( int *  nproj)
int SimTK::CPodes::getProjNumCnstrEvals ( int *  nce)
int SimTK::CPodes::getProjNumLinSolvSetups ( int *  nsetupsP)
int SimTK::CPodes::getProjNumFailures ( int *  nprf)
int SimTK::CPodes::getProjStats ( int *  nproj,
int *  nce,
int *  nsetupsP,
int *  nprf 
)
int SimTK::CPodes::getQuadNumFunEvals ( int *  nqevals)
int SimTK::CPodes::getQuadErrWeights ( Vector eQweight)
char* SimTK::CPodes::getReturnFlagName ( int  flag)
int SimTK::CPodes::dlsGetWorkSpace ( int *  lenrwLS,
int *  leniwLS 
)
int SimTK::CPodes::dlsGetNumJacEvals ( int *  njevals)
int SimTK::CPodes::dlsGetNumFctEvals ( int *  nfevalsLS)
int SimTK::CPodes::dlsGetLastFlag ( int *  flag)
char* SimTK::CPodes::dlsGetReturnFlagName ( int  flag)
int SimTK::CPodes::dlsProjGetNumJacEvals ( int *  njPevals)
int SimTK::CPodes::dlsProjGetNumFctEvals ( int *  ncevalsLS)
int SimTK::CPodes::lapackDense ( int  N)
int SimTK::CPodes::lapackBand ( int  N,
int  mupper,
int  mlower 
)
int SimTK::CPodes::lapackDenseProj ( int  Nc,
int  Ny,
ProjectionFactorizationType   
)

Friends And Related Function Documentation

friend class CPodesRep
friend

Member Data Documentation

const int SimTK::CPodes::Success = 0
static
const int SimTK::CPodes::TstopReturn = 1
static
const int SimTK::CPodes::RootReturn = 2
static
const int SimTK::CPodes::Warning = 99
static
const int SimTK::CPodes::TooMuchWork = -1
static
const int SimTK::CPodes::TooClose = -27
static
const int SimTK::CPodes::RecoverableError = 9999
static
const int SimTK::CPodes::UnrecoverableError = -9999
static

The documentation for this class was generated from the following file: