Cantera  3.1.0a1
Integrator Class Reference

Abstract base class for ODE system integrators. More...

#include <Integrator.h>

Inheritance diagram for Integrator:
[legend]

Detailed Description

Abstract base class for ODE system integrators.

Definition at line 43 of file Integrator.h.

Public Member Functions

 Integrator ()
 Default Constructor. More...
 
virtual ~Integrator ()
 Destructor. More...
 
virtual void setTolerances (double reltol, size_t n, double *abstol)
 Set error tolerances. More...
 
virtual void setTolerances (double reltol, double abstol)
 Set error tolerances. More...
 
virtual void setSensitivityTolerances (double reltol, double abstol)
 Set the sensitivity error tolerances. More...
 
virtual void setLinearSolverType (const string &linSolverType)
 Set the linear solver type. More...
 
virtual void setPreconditioner (shared_ptr< PreconditionerBase > preconditioner)
 Set preconditioner used by the linear solver. More...
 
virtual void preconditionerSolve (size_t stateSize, double *rhs, double *output)
 Solve a linear system Ax=b where A is the preconditioner. More...
 
virtual PreconditionerSide preconditionerSide ()
 Return the side of the system on which the preconditioner is applied. More...
 
virtual shared_ptr< PreconditionerBasepreconditioner ()
 Return preconditioner reference to object. More...
 
virtual string linearSolverType () const
 Return the integrator problem type. More...
 
virtual void initialize (double t0, FuncEval &func)
 Initialize the integrator for a new problem. More...
 
virtual void reinitialize (double t0, FuncEval &func)
 
virtual void integrate (double tout)
 Integrate the system of equations. More...
 
virtual double step (double tout)
 Integrate the system of equations. More...
 
virtual double & solution (size_t k)
 The current value of the solution of equation k. More...
 
virtual double * solution ()
 The current value of the solution of the system of equations. More...
 
virtual double * derivative (double tout, int n)
 n-th derivative of the output function at time tout. More...
 
virtual int lastOrder () const
 Order used during the last solution step. More...
 
virtual int nEquations () const
 The number of equations. More...
 
virtual int nEvals () const
 The number of function evaluations. More...
 
virtual int maxOrder () const
 
virtual void setMaxOrder (int n)
 Set the maximum integration order that will be used. More...
 
virtual void setMethod (MethodType t)
 Set the solution method. More...
 
virtual void setMaxStepSize (double hmax)
 Set the maximum step size. More...
 
virtual void setMinStepSize (double hmin)
 Set the minimum step size. More...
 
virtual void setMaxErrTestFails (int n)
 Set the maximum permissible number of error test failures. More...
 
virtual void setMaxSteps (int nmax)
 Set the maximum number of time-steps the integrator can take before reaching the next output time. More...
 
virtual int maxSteps ()
 Returns the maximum number of time-steps the integrator can take before reaching the next output time. More...
 
virtual void setBandwidth (int N_Upper, int N_Lower)
 
virtual int nSensParams ()
 
virtual double sensitivity (size_t k, size_t p)
 
virtual AnyMap solverStats () const
 Get solver stats from integrator. More...
 
virtual int maxNonlinIterations () const
 
virtual void setMaxNonlinIterations (int n)
 
virtual int maxNonlinConvFailures () const
 
virtual void setMaxNonlinConvFailures (int n)
 
virtual bool algebraicInErrorTest () const
 
virtual void includeAlgebraicInErrorTest (bool yesno)
 

Protected Attributes

shared_ptr< PreconditionerBasem_preconditioner
 Pointer to preconditioner object used in integration which is set by setPreconditioner and initialized inside of ReactorNet::initialize() More...
 
PreconditionerSide m_prec_side = PreconditionerSide::NO_PRECONDITION
 Type of preconditioning used in applyOptions. More...
 

Private Member Functions

void warn (const string &msg) const
 

Private Attributes

double m_dummy
 

Constructor & Destructor Documentation

◆ Integrator()

Integrator ( )
inline

Default Constructor.

Definition at line 47 of file Integrator.h.

◆ ~Integrator()

virtual ~Integrator ( )
inlinevirtual

Destructor.

Definition at line 51 of file Integrator.h.

Member Function Documentation

◆ setTolerances() [1/2]

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

Set error tolerances.

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

Reimplemented in IdasIntegrator, and CVodesIntegrator.

Definition at line 60 of file Integrator.h.

◆ setTolerances() [2/2]

virtual void setTolerances ( double  reltol,
double  abstol 
)
inlinevirtual

Set error tolerances.

Parameters
reltolscalar relative tolerance
abstolscalar absolute tolerance

Reimplemented in IdasIntegrator, and CVodesIntegrator.

Definition at line 70 of file Integrator.h.

◆ setSensitivityTolerances()

virtual void setSensitivityTolerances ( double  reltol,
double  abstol 
)
inlinevirtual

Set the sensitivity error tolerances.

Parameters
reltolscalar relative tolerance
abstolscalar absolute tolerance

Reimplemented in IdasIntegrator, and CVodesIntegrator.

Definition at line 79 of file Integrator.h.

◆ setLinearSolverType()

virtual void setLinearSolverType ( const string &  linSolverType)
inlinevirtual

Set the linear solver type.

Parameters
linSolverTypeType of the linear solver

Reimplemented in CVodesIntegrator, and IdasIntegrator.

Definition at line 86 of file Integrator.h.

◆ setPreconditioner()

virtual void setPreconditioner ( shared_ptr< PreconditionerBase preconditioner)
inlinevirtual

Set preconditioner used by the linear solver.

Parameters
preconditionerpreconditioner object used for the linear solver

Definition at line 94 of file Integrator.h.

◆ preconditionerSolve()

virtual void preconditionerSolve ( size_t  stateSize,
double *  rhs,
double *  output 
)
inlinevirtual

Solve a linear system Ax=b where A is the preconditioner.

Parameters
[in]stateSizelength of the rhs and output vectors
[in]rhsright hand side vector used in linear system
[out]outputoutput vector for solution

Definition at line 116 of file Integrator.h.

◆ preconditionerSide()

virtual PreconditionerSide preconditionerSide ( )
inlinevirtual

Return the side of the system on which the preconditioner is applied.

Definition at line 121 of file Integrator.h.

◆ preconditioner()

virtual shared_ptr<PreconditionerBase> preconditioner ( )
inlinevirtual

Return preconditioner reference to object.

Definition at line 126 of file Integrator.h.

◆ linearSolverType()

virtual string linearSolverType ( ) const
inlinevirtual

Return the integrator problem type.

Reimplemented in CVodesIntegrator.

Definition at line 131 of file Integrator.h.

◆ initialize()

virtual void initialize ( double  t0,
FuncEval func 
)
inlinevirtual

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 in IdasIntegrator, and CVodesIntegrator.

Definition at line 142 of file Integrator.h.

◆ integrate()

virtual void integrate ( double  tout)
inlinevirtual

Integrate the system of equations.

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

Reimplemented in IdasIntegrator, and CVodesIntegrator.

Definition at line 155 of file Integrator.h.

◆ step()

virtual double step ( double  tout)
inlinevirtual

Integrate the system of equations.

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

Reimplemented in IdasIntegrator, and CVodesIntegrator.

Definition at line 164 of file Integrator.h.

◆ solution() [1/2]

virtual double& solution ( size_t  k)
inlinevirtual

The current value of the solution of equation k.

Reimplemented in IdasIntegrator, and CVodesIntegrator.

Definition at line 170 of file Integrator.h.

◆ solution() [2/2]

virtual double* solution ( )
inlinevirtual

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

Reimplemented in IdasIntegrator, and CVodesIntegrator.

Definition at line 176 of file Integrator.h.

◆ derivative()

virtual double* derivative ( double  tout,
int  n 
)
inlinevirtual

n-th derivative of the output function at time tout.

Reimplemented in CVodesIntegrator.

Definition at line 182 of file Integrator.h.

◆ lastOrder()

virtual int lastOrder ( ) const
inlinevirtual

Order used during the last solution step.

Reimplemented in CVodesIntegrator.

Definition at line 188 of file Integrator.h.

◆ nEquations()

virtual int nEquations ( ) const
inlinevirtual

The number of equations.

Reimplemented in IdasIntegrator, and CVodesIntegrator.

Definition at line 194 of file Integrator.h.

◆ nEvals()

virtual int nEvals ( ) const
inlinevirtual

The number of function evaluations.

Reimplemented in CVodesIntegrator.

Definition at line 200 of file Integrator.h.

◆ setMaxOrder()

virtual void setMaxOrder ( int  n)
inlinevirtual

Set the maximum integration order that will be used.

Reimplemented in IdasIntegrator, and CVodesIntegrator.

Definition at line 211 of file Integrator.h.

◆ setMethod()

virtual void setMethod ( MethodType  t)
inlinevirtual

Set the solution method.

Reimplemented in IdasIntegrator, and CVodesIntegrator.

Definition at line 216 of file Integrator.h.

◆ setMaxStepSize()

virtual void setMaxStepSize ( double  hmax)
inlinevirtual

Set the maximum step size.

Reimplemented in IdasIntegrator, and CVodesIntegrator.

Definition at line 221 of file Integrator.h.

◆ setMinStepSize()

virtual void setMinStepSize ( double  hmin)
inlinevirtual

Set the minimum step size.

Reimplemented in CVodesIntegrator.

Definition at line 226 of file Integrator.h.

◆ setMaxErrTestFails()

virtual void setMaxErrTestFails ( int  n)
inlinevirtual

Set the maximum permissible number of error test failures.

Reimplemented in IdasIntegrator, and CVodesIntegrator.

Definition at line 231 of file Integrator.h.

◆ setMaxSteps()

virtual void setMaxSteps ( int  nmax)
inlinevirtual

Set the maximum number of time-steps the integrator can take before reaching the next output time.

Parameters
nmaxThe maximum number of steps, setting this value to zero disables this option.

Reimplemented in IdasIntegrator, and CVodesIntegrator.

Definition at line 239 of file Integrator.h.

◆ maxSteps()

virtual int maxSteps ( )
inlinevirtual

Returns the maximum number of time-steps the integrator can take before reaching the next output time.

Reimplemented in IdasIntegrator, and CVodesIntegrator.

Definition at line 245 of file Integrator.h.

◆ solverStats()

virtual AnyMap solverStats ( ) const
inlinevirtual

Get solver stats from integrator.

Reimplemented in IdasIntegrator, and CVodesIntegrator.

Definition at line 265 of file Integrator.h.

Member Data Documentation

◆ m_preconditioner

shared_ptr<PreconditionerBase> m_preconditioner
protected

Pointer to preconditioner object used in integration which is set by setPreconditioner and initialized inside of ReactorNet::initialize()

Definition at line 299 of file Integrator.h.

◆ m_prec_side

PreconditionerSide m_prec_side = PreconditionerSide::NO_PRECONDITION
protected

Type of preconditioning used in applyOptions.

Definition at line 301 of file Integrator.h.


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