Cantera  2.0
Public Member Functions | Private Attributes | List of all members
CVodeInt Class Reference

Wrapper class for 'cvode' integrator from LLNL. More...

#include <CVodeInt.h>

Inheritance diagram for CVodeInt:
[legend]
Collaboration diagram for CVodeInt:
[legend]

Public Member Functions

 CVodeInt ()
 Constructor.
 
virtual ~CVodeInt ()
 Destructor.
 
virtual void setTolerances (double reltol, size_t n, double *abstol)
 Set or reset the number of equations.
 
virtual void setTolerances (double reltol, double abstol)
 Set error tolerances.
 
virtual void setProblemType (int probtype)
 Set the problem type.
 
virtual void initialize (double t0, FuncEval &func)
 Initialize the integrator for a new problem.
 
virtual void reinitialize (double t0, FuncEval &func)
 
virtual void integrate (double tout)
 Integrate the system of equations.
 
virtual doublereal step (double tout)
 Integrate the system of equations.
 
virtual double & solution (size_t k)
 The current value of the solution of equation k.
 
virtual double * solution ()
 The current value of the solution of the system of equations.
 
virtual int nEquations () const
 The number of equations.
 
virtual int nEvals () const
 The number of function evaluations.
 
virtual void setMaxOrder (int n)
 Set the maximum integration order that will be used.
 
virtual void setMethod (MethodType t)
 Set the solution method.
 
virtual void setIterator (IterType t)
 Set the linear iterator.
 
virtual void setMaxStepSize (double hmax)
 Set the maximum step size.
 
virtual void setMinStepSize (double hmin)
 Set the minimum step size.
 
virtual void setMaxSteps (int nmax)
 
virtual void setSensitivityTolerances (doublereal reltol, doublereal abstol)
 Set the sensitivity error tolerances.
 
virtual void setBandwidth (int N_Upper, int N_Lower)
 
virtual int nSensParams ()
 
virtual double sensitivity (size_t k, size_t p)
 

Private Attributes

int m_neq
 
void * m_cvode_mem
 
double m_t0
 
void * m_y
 
void * m_abstol
 
int m_type
 
int m_itol
 
int m_method
 
int m_iter
 
int m_maxord
 
double m_reltol
 
double m_abstols
 
int m_nabs
 
double m_hmax
 
double m_hmin
 
int m_maxsteps
 
vector_fp m_ropt
 
long int * m_iopt
 
void * m_data
 

Detailed Description

Wrapper class for 'cvode' integrator from LLNL.

The unmodified cvode code is in directory ext/cvode.

See Also
FuncEval.h. Classes that use CVodeInt: ImplicitChem, ImplicitSurfChem, Reactor

Definition at line 35 of file CVodeInt.h.

Constructor & Destructor Documentation

CVodeInt ( )

Constructor.

Default settings: dense jacobian, no user-supplied Jacobian function, Newton iteration.

Definition at line 93 of file CVodeInt.cpp.

~CVodeInt ( )
virtual

Destructor.

Definition at line 116 of file CVodeInt.cpp.

Member Function Documentation

void setTolerances ( double  reltol,
size_t  n,
double *  abstol 
)
virtual

Set or reset the number of equations.

Set error tolerances.

Parameters
reltolscalar relative tolerance
nNumber of equations
abstolarray of N absolute tolerance values

Reimplemented from Integrator.

Definition at line 139 of file CVodeInt.cpp.

void setTolerances ( double  reltol,
double  abstol 
)
virtual

Set error tolerances.

Parameters
reltolscalar relative tolerance
abstolscalar absolute tolerance

Reimplemented from Integrator.

Definition at line 155 of file CVodeInt.cpp.

void setProblemType ( int  probtype)
virtual

Set the problem type.

Parameters
probtypeType of the problem

Reimplemented from Integrator.

Definition at line 162 of file CVodeInt.cpp.

void initialize ( double  t0,
FuncEval func 
)
virtual

Initialize the integrator for a new problem.

Call after all options have been set.

Parameters
t0initial time
funcRHS evaluator object for system of equations.

Reimplemented from Integrator.

Definition at line 207 of file CVodeInt.cpp.

References cvode_jac(), cvode_rhs(), DATA_PTR, FuncEval::getInitialConditions(), and FuncEval::neq().

void integrate ( double  tout)
virtual

Integrate the system of equations.

Parameters
toutIntegrate to this time. Note that this is the absolute time value, not a time interval.

Reimplemented from Integrator.

Definition at line 310 of file CVodeInt.cpp.

References Cantera::int2str().

double step ( double  tout)
virtual

Integrate the system of equations.

Parameters
toutintegrate to this time. Note that this is the absolute time value, not a time interval.

Reimplemented from Integrator.

Definition at line 320 of file CVodeInt.cpp.

References Cantera::int2str().

double & solution ( size_t  k)
virtual

The current value of the solution of equation k.

Reimplemented from Integrator.

Definition at line 130 of file CVodeInt.cpp.

double * solution ( )
virtual

The current value of the solution of the system of equations.

Reimplemented from Integrator.

Definition at line 134 of file CVodeInt.cpp.

virtual int nEquations ( ) const
inlinevirtual

The number of equations.

Reimplemented from Integrator.

Definition at line 51 of file CVodeInt.h.

int nEvals ( ) const
virtual

The number of function evaluations.

Reimplemented from Integrator.

Definition at line 331 of file CVodeInt.cpp.

virtual void setMaxOrder ( int  n)
inlinevirtual

Set the maximum integration order that will be used.

Reimplemented from Integrator.

Definition at line 55 of file CVodeInt.h.

void setMethod ( MethodType  t)
virtual

Set the solution method.

Reimplemented from Integrator.

Definition at line 167 of file CVodeInt.cpp.

References Cantera::Adams_Method, and Cantera::BDF_Method.

void setIterator ( IterType  t)
virtual

Set the linear iterator.

Reimplemented from Integrator.

Definition at line 196 of file CVodeInt.cpp.

References Cantera::Functional_Iter, and Cantera::Newton_Iter.

void setMaxStepSize ( double  hmax)
virtual

Set the maximum step size.

Reimplemented from Integrator.

Definition at line 178 of file CVodeInt.cpp.

void setMinStepSize ( double  hmin)
virtual

Set the minimum step size.

Reimplemented from Integrator.

Definition at line 184 of file CVodeInt.cpp.

virtual void setSensitivityTolerances ( doublereal  reltol,
doublereal  abstol 
)
inlinevirtualinherited

Set the sensitivity error tolerances.

Parameters
reltolscalar relative tolerance
abstolscalar absolute tolerance

Definition at line 94 of file Integrator.h.


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