Simbody  3.7
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

◆ ODEType

Enumerator
UnspecifiedODEType 
ExplicitODE 
ImplicitODE 

◆ LinearMultistepMethod

Enumerator
UnspecifiedLinearMultistepMethod 
BDF 
Adams 

◆ NonlinearSystemIterationType

Enumerator
UnspecifiedNonlinearSystemIterationType 
Newton 
Functional 

◆ ToleranceType

Enumerator
UnspecifiedToleranceType 
ScalarScalar 
ScalarVector 
WeightFunction 

◆ ProjectionNorm

Enumerator
UnspecifiedProjectionNorm 
L2Norm 
ErrorNorm 

◆ ConstraintLinearity

Enumerator
UnspecifiedConstraintLinearity 
Linear 
Nonlinear 

◆ ProjectionFactorizationType

Enumerator
UnspecifiedProjectionFactorizationType 
ProjectWithLU 
ProjectWithQR 
ProjectWithSchurComplement 
ProjectWithQRPivot 

◆ StepMode

Enumerator
UnspecifiedStepMode 
Normal 
OneStep 
NormalTstop 
OneStepTstop 

Constructor & Destructor Documentation

◆ CPodes()

◆ ~CPodes()

SimTK::CPodes::~CPodes ( )

Member Function Documentation

◆ init()

int SimTK::CPodes::init ( CPodesSystem sys,
Real  t0,
const Vector y0,
const Vector yp0,
ToleranceType  tt,
Real  reltol,
void *  abstol 
)

◆ reInit()

int SimTK::CPodes::reInit ( CPodesSystem sys,
Real  t0,
const Vector y0,
const Vector yp0,
ToleranceType  tt,
Real  reltol,
void *  abstol 
)

◆ projInit()

int SimTK::CPodes::projInit ( ProjectionNorm  ,
ConstraintLinearity  ,
const Vector ctol 
)

◆ projDefine()

int SimTK::CPodes::projDefine ( )

◆ quadInit()

int SimTK::CPodes::quadInit ( const Vector q0)

◆ quadReInit()

int SimTK::CPodes::quadReInit ( const Vector q0)

◆ rootInit()

int SimTK::CPodes::rootInit ( int  nrtfn)

◆ setErrHandlerFn()

int SimTK::CPodes::setErrHandlerFn ( )

◆ setEwtFn()

int SimTK::CPodes::setEwtFn ( )

◆ dlsSetJacFn()

int SimTK::CPodes::dlsSetJacFn ( void *  jac,
void *  jac_data 
)

◆ dlsProjSetJacFn()

int SimTK::CPodes::dlsProjSetJacFn ( void *  jacP,
void *  jacP_data 
)

◆ step()

int SimTK::CPodes::step ( Real  tout,
Real tret,
Vector y_inout,
Vector yp_inout,
StepMode  = Normal 
)

◆ setErrFile()

int SimTK::CPodes::setErrFile ( FILE *  errfp)

◆ setMaxOrd()

int SimTK::CPodes::setMaxOrd ( int  maxord)

◆ setMaxNumSteps()

int SimTK::CPodes::setMaxNumSteps ( int  mxsteps)

◆ setMaxHnilWarns()

int SimTK::CPodes::setMaxHnilWarns ( int  mxhnil)

◆ setStabLimDet()

int SimTK::CPodes::setStabLimDet ( bool  stldet)

◆ setInitStep()

int SimTK::CPodes::setInitStep ( Real  hin)

◆ setMinStep()

int SimTK::CPodes::setMinStep ( Real  hmin)

◆ setMaxStep()

int SimTK::CPodes::setMaxStep ( Real  hmax)

◆ setStopTime()

int SimTK::CPodes::setStopTime ( Real  tstop)

◆ setMaxErrTestFails()

int SimTK::CPodes::setMaxErrTestFails ( int  maxnef)

◆ setMaxNonlinIters()

int SimTK::CPodes::setMaxNonlinIters ( int  maxcor)

◆ setMaxConvFails()

int SimTK::CPodes::setMaxConvFails ( int  maxncf)

◆ setNonlinConvCoef()

int SimTK::CPodes::setNonlinConvCoef ( Real  nlscoef)

◆ setProjUpdateErrEst()

int SimTK::CPodes::setProjUpdateErrEst ( bool  proj_err)

◆ setProjFrequency()

int SimTK::CPodes::setProjFrequency ( int  proj_freq)

◆ setProjTestCnstr()

int SimTK::CPodes::setProjTestCnstr ( bool  test_cnstr)

◆ setProjLsetupFreq()

int SimTK::CPodes::setProjLsetupFreq ( int  proj_lset_freq)

◆ setProjNonlinConvCoef()

int SimTK::CPodes::setProjNonlinConvCoef ( Real  prjcoef)

◆ setQuadErrCon()

int SimTK::CPodes::setQuadErrCon ( bool  errconQ,
int  tol_typeQ,
Real  reltolQ,
void *  abstolQ 
)

◆ setTolerances()

int SimTK::CPodes::setTolerances ( int  tol_type,
Real  reltol,
void *  abstol 
)

◆ setRootDirection()

int SimTK::CPodes::setRootDirection ( Array_< int > &  rootdir)

◆ getDky()

int SimTK::CPodes::getDky ( Real  t,
int  k,
Vector dky 
)

◆ getQuad()

int SimTK::CPodes::getQuad ( Real  t,
Vector yQout 
)

◆ getQuadDky()

int SimTK::CPodes::getQuadDky ( Real  t,
int  k,
Vector dky 
)

◆ getWorkSpace()

int SimTK::CPodes::getWorkSpace ( int *  lenrw,
int *  leniw 
)

◆ getNumSteps()

int SimTK::CPodes::getNumSteps ( int *  nsteps)

◆ getNumFctEvals()

int SimTK::CPodes::getNumFctEvals ( int *  nfevals)

◆ getNumLinSolvSetups()

int SimTK::CPodes::getNumLinSolvSetups ( int *  nlinsetups)

◆ getNumErrTestFails()

int SimTK::CPodes::getNumErrTestFails ( int *  netfails)

◆ getLastOrder()

int SimTK::CPodes::getLastOrder ( int *  qlast)

◆ getCurrentOrder()

int SimTK::CPodes::getCurrentOrder ( int *  qcur)

◆ getNumStabLimOrderReds()

int SimTK::CPodes::getNumStabLimOrderReds ( int *  nslred)

◆ getActualInitStep()

int SimTK::CPodes::getActualInitStep ( Real hinused)

◆ getLastStep()

int SimTK::CPodes::getLastStep ( Real hlast)

◆ getCurrentStep()

int SimTK::CPodes::getCurrentStep ( Real hcur)

◆ getCurrentTime()

int SimTK::CPodes::getCurrentTime ( Real tcur)

◆ getTolScaleFactor()

int SimTK::CPodes::getTolScaleFactor ( Real tolsfac)

◆ getErrWeights()

int SimTK::CPodes::getErrWeights ( Vector eweight)

◆ getEstLocalErrors()

int SimTK::CPodes::getEstLocalErrors ( Vector ele)

◆ getNumGEvals()

int SimTK::CPodes::getNumGEvals ( int *  ngevals)

◆ getRootInfo()

int SimTK::CPodes::getRootInfo ( int *  rootsfound)

◆ getRootWindow()

int SimTK::CPodes::getRootWindow ( Real tLo,
Real tHi 
)

◆ getIntegratorStats()

int SimTK::CPodes::getIntegratorStats ( int *  nsteps,
int *  nfevals,
int *  nlinsetups,
int *  netfails,
int *  qlast,
int *  qcur,
Real hinused,
Real hlast,
Real hcur,
Real tcur 
)

◆ getNumNonlinSolvIters()

int SimTK::CPodes::getNumNonlinSolvIters ( int *  nniters)

◆ getNumNonlinSolvConvFails()

int SimTK::CPodes::getNumNonlinSolvConvFails ( int *  nncfails)

◆ getNonlinSolvStats()

int SimTK::CPodes::getNonlinSolvStats ( int *  nniters,
int *  nncfails 
)

◆ getProjNumProj()

int SimTK::CPodes::getProjNumProj ( int *  nproj)

◆ getProjNumCnstrEvals()

int SimTK::CPodes::getProjNumCnstrEvals ( int *  nce)

◆ getProjNumLinSolvSetups()

int SimTK::CPodes::getProjNumLinSolvSetups ( int *  nsetupsP)

◆ getProjNumFailures()

int SimTK::CPodes::getProjNumFailures ( int *  nprf)

◆ getProjStats()

int SimTK::CPodes::getProjStats ( int *  nproj,
int *  nce,
int *  nsetupsP,
int *  nprf 
)

◆ getQuadNumFunEvals()

int SimTK::CPodes::getQuadNumFunEvals ( int *  nqevals)

◆ getQuadErrWeights()

int SimTK::CPodes::getQuadErrWeights ( Vector eQweight)

◆ getReturnFlagName()

char* SimTK::CPodes::getReturnFlagName ( int  flag)

◆ dlsGetWorkSpace()

int SimTK::CPodes::dlsGetWorkSpace ( int *  lenrwLS,
int *  leniwLS 
)

◆ dlsGetNumJacEvals()

int SimTK::CPodes::dlsGetNumJacEvals ( int *  njevals)

◆ dlsGetNumFctEvals()

int SimTK::CPodes::dlsGetNumFctEvals ( int *  nfevalsLS)

◆ dlsGetLastFlag()

int SimTK::CPodes::dlsGetLastFlag ( int *  flag)

◆ dlsGetReturnFlagName()

char* SimTK::CPodes::dlsGetReturnFlagName ( int  flag)

◆ dlsProjGetNumJacEvals()

int SimTK::CPodes::dlsProjGetNumJacEvals ( int *  njPevals)

◆ dlsProjGetNumFctEvals()

int SimTK::CPodes::dlsProjGetNumFctEvals ( int *  ncevalsLS)

◆ lapackDense()

int SimTK::CPodes::lapackDense ( int  N)

◆ lapackBand()

int SimTK::CPodes::lapackBand ( int  N,
int  mupper,
int  mlower 
)

◆ lapackDenseProj()

int SimTK::CPodes::lapackDenseProj ( int  Nc,
int  Ny,
ProjectionFactorizationType   
)

Friends And Related Function Documentation

◆ CPodesRep

friend class CPodesRep
friend

Member Data Documentation

◆ Success

const int SimTK::CPodes::Success = 0
static

◆ TstopReturn

const int SimTK::CPodes::TstopReturn = 1
static

◆ RootReturn

const int SimTK::CPodes::RootReturn = 2
static

◆ Warning

const int SimTK::CPodes::Warning = 99
static

◆ TooMuchWork

const int SimTK::CPodes::TooMuchWork = -1
static

◆ TooClose

const int SimTK::CPodes::TooClose = -27
static

◆ RecoverableError

const int SimTK::CPodes::RecoverableError = 9999
static

◆ UnrecoverableError

const int SimTK::CPodes::UnrecoverableError = -9999
static

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