| Cantera 3.0.0

Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
Integrator Class Reference
ODE and DAE Function Utilities

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 50 of file Integrator.h.

## Public Member Functions
| Integrator ()
| Default Constructor.
virtual | ~Integrator ()
| Destructor.
virtual void | setTolerances (double reltol, size_t n, double *abstol)
| Set error tolerances.
virtual void | setTolerances (double reltol, double abstol)
| Set error tolerances.
virtual void | setSensitivityTolerances (double reltol, double abstol)
| Set the sensitivity error tolerances.
virtual void | setProblemType (int probtype)
| Set the problem type.
virtual void | setLinearSolverType (const string &linSolverType)
| Set the linear solver type.
virtual void | setPreconditioner (shared_ptr< PreconditionerBase > preconditioner)
| Set preconditioner used by the linear solver.
virtual void | preconditionerSolve (size_t stateSize, double *rhs, double *output)
| Solve a linear system Ax=b where A is the preconditioner.
virtual PreconditionerSide | preconditionerSide ()
| Return the side of the system on which the preconditioner is applied.
virtual shared_ptr< PreconditionerBase > | preconditioner ()
| Return preconditioner reference to object.
virtual string | linearSolverType () const
| Return the integrator 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 double | 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 double * | derivative (double tout, int n)
| n-th derivative of the output function at time tout.
virtual int | lastOrder () const
| Order used during the last solution step.
virtual int | nEquations () const
| The number of equations.
virtual int | nEvals () const
| The number of function evaluations.
virtual int | maxOrder () const
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 | setMaxStepSize (double hmax)
| Set the maximum step size.
virtual void | setMinStepSize (double hmin)
| Set the minimum step size.
virtual void | setMaxErrTestFails (int n)
| Set the maximum permissible number of error test failures.
virtual void | setMaxSteps (int nmax)
| Set the maximum number of time-steps the integrator can take before reaching the next output time.
virtual int | maxSteps ()
| Returns the maximum number of time-steps the integrator can take before reaching the next output time.
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.
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< PreconditionerBase > | m_preconditioner
| Pointer to preconditioner object used in integration which is set by setPreconditioner and initialized inside of ReactorNet::initialize()
PreconditionerSide | m_prec_side = PreconditionerSide::NO_PRECONDITION
| Type of preconditioning used in applyOptions.

## 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 54 of file Integrator.h.

## ◆ ~Integrator()

virtual ~Integrator | ( |  | ) |
| inline virtual

Destructor.

Definition at line 58 of file Integrator.h.

## Member Function Documentation

## ◆ setTolerances() [1/2]

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

Set error tolerances.

Parameters

  reltol | scalar relative tolerance
  n | Number of equations
  abstol | array of N absolute tolerance values

Reimplemented in CVodesIntegrator, and IdasIntegrator.

Definition at line 67 of file Integrator.h.

## ◆ setTolerances() [2/2]

virtual void setTolerances | ( | double | reltol,
|  | double | abstol
| ) |  |
| inline virtual

Set error tolerances.

Parameters

  reltol | scalar relative tolerance
  abstol | scalar absolute tolerance

Reimplemented in CVodesIntegrator, and IdasIntegrator.

Definition at line 77 of file Integrator.h.

## ◆ setSensitivityTolerances()

virtual void setSensitivityTolerances | ( | double | reltol,
|  | double | abstol
| ) |  |
| inline virtual

Set the sensitivity error tolerances.

Parameters

  reltol | scalar relative tolerance
  abstol | scalar absolute tolerance

Reimplemented in CVodesIntegrator, and IdasIntegrator.

Definition at line 86 of file Integrator.h.

## ◆ setProblemType()

virtual void setProblemType | ( | int | probtype | ) |
| inline virtual

Set the problem type.

Parameters

  probtype | Type of the problem

Deprecated:
  This function is to be removed along with the integer constants used in conditionals to set the problem type currently. This includes DENSE, JAC, NOJAC, BAND, and DIAG

Reimplemented in CVodesIntegrator.

Definition at line 97 of file Integrator.h.

## ◆ setLinearSolverType()

virtual void setLinearSolverType | ( | const string & | linSolverType | ) |
| inline virtual

Set the linear solver type.

Parameters

  linSolverType | Type of the linear solver

Reimplemented in IdasIntegrator, and CVodesIntegrator.

Definition at line 107 of file Integrator.h.

## ◆ setPreconditioner()

virtual void setPreconditioner | ( | shared_ptr< PreconditionerBase > | preconditioner | ) |
| inline virtual

Set preconditioner used by the linear solver.

Parameters

  preconditioner | preconditioner object used for the linear solver

Definition at line 115 of file Integrator.h.

## ◆ preconditionerSolve()

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

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

Parameters

  [in] | stateSize | length of the rhs and output vectors
  [in] | rhs | right hand side vector used in linear system
  [out] | output | output vector for solution

Definition at line 137 of file Integrator.h.

## ◆ preconditionerSide()

virtual PreconditionerSide preconditionerSide | ( |  | ) |
| inline virtual

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

Definition at line 142 of file Integrator.h.

## ◆ preconditioner()

virtual shared_ptr< PreconditionerBase > preconditioner | ( |  | ) |
| inline virtual

Return preconditioner reference to object.

Definition at line 147 of file Integrator.h.

## ◆ linearSolverType()

virtual string linearSolverType | ( |  | ) | const
| inline virtual

Return the integrator problem type.

Reimplemented in CVodesIntegrator.

Definition at line 152 of file Integrator.h.

## ◆ initialize()

virtual void initialize | ( | double | t0,
|  | FuncEval & | func
| ) |  |
| inline virtual

Initialize the integrator for a new problem.

Call after all options have been set.

Parameters

  t0 | initial time
  func | RHS evaluator object for system of equations.

Reimplemented in CVodesIntegrator, and IdasIntegrator.

Definition at line 163 of file Integrator.h.

## ◆ reinitialize()

virtual void reinitialize | ( | double | t0,
|  | FuncEval & | func
| ) |  |
| inline virtual

Definition at line 167 of file Integrator.h.

## ◆ integrate()

virtual void integrate | ( | double | tout | ) |
| inline virtual

Integrate the system of equations.

Parameters

  tout | Integrate to this time. Note that this is the absolute time value, not a time interval.

Reimplemented in CVodesIntegrator, and IdasIntegrator.

Definition at line 176 of file Integrator.h.

## ◆ step()

virtual double step | ( | double | tout | ) |
| inline virtual

Integrate the system of equations.

Parameters

  tout | integrate to this time. Note that this is the absolute time value, not a time interval.

Reimplemented in CVodesIntegrator, and IdasIntegrator.

Definition at line 185 of file Integrator.h.

## ◆ solution() [1/2]

virtual double & solution | ( | size_t | k | ) |
| inline virtual

The current value of the solution of equation k.

Reimplemented in CVodesIntegrator, and IdasIntegrator.

Definition at line 191 of file Integrator.h.

## ◆ solution() [2/2]

virtual double * solution | ( |  | ) |
| inline virtual

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

Reimplemented in CVodesIntegrator, and IdasIntegrator.

Definition at line 197 of file Integrator.h.

## ◆ derivative()

virtual double * derivative | ( | double | tout,
|  | int | n
| ) |  |
| inline virtual

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

Reimplemented in CVodesIntegrator.

Definition at line 203 of file Integrator.h.

## ◆ lastOrder()

virtual int lastOrder | ( |  | ) | const
| inline virtual

Order used during the last solution step.

Reimplemented in CVodesIntegrator.

Definition at line 209 of file Integrator.h.

## ◆ nEquations()

virtual int nEquations | ( |  | ) | const
| inline virtual

The number of equations.

Reimplemented in CVodesIntegrator, and IdasIntegrator.

Definition at line 215 of file Integrator.h.

## ◆ nEvals()

virtual int nEvals | ( |  | ) | const
| inline virtual

The number of function evaluations.

Reimplemented in CVodesIntegrator.

Definition at line 221 of file Integrator.h.

## ◆ maxOrder()

virtual int maxOrder | ( |  | ) | const
| inline virtual

Definition at line 226 of file Integrator.h.

## ◆ setMaxOrder()

virtual void setMaxOrder | ( | int | n | ) |
| inline virtual

Set the maximum integration order that will be used.

Reimplemented in CVodesIntegrator, and IdasIntegrator.

Definition at line 232 of file Integrator.h.

## ◆ setMethod()

virtual void setMethod | ( | MethodType | t | ) |
| inline virtual

Set the solution method.

Reimplemented in CVodesIntegrator, and IdasIntegrator.

Definition at line 237 of file Integrator.h.

## ◆ setMaxStepSize()

virtual void setMaxStepSize | ( | double | hmax | ) |
| inline virtual

Set the maximum step size.

Reimplemented in CVodesIntegrator, and IdasIntegrator.

Definition at line 242 of file Integrator.h.

## ◆ setMinStepSize()

virtual void setMinStepSize | ( | double | hmin | ) |
| inline virtual

Set the minimum step size.

Reimplemented in CVodesIntegrator.

Definition at line 247 of file Integrator.h.

## ◆ setMaxErrTestFails()

virtual void setMaxErrTestFails | ( | int | n | ) |
| inline virtual

Set the maximum permissible number of error test failures.

Reimplemented in CVodesIntegrator, and IdasIntegrator.

Definition at line 252 of file Integrator.h.

## ◆ setMaxSteps()

virtual void setMaxSteps | ( | int | nmax | ) |
| inline virtual

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

Parameters

  nmax | The maximum number of steps, setting this value to zero disables this option.

Reimplemented in CVodesIntegrator, and IdasIntegrator.

Definition at line 260 of file Integrator.h.

## ◆ maxSteps()

virtual int maxSteps | ( |  | ) |
| inline virtual

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

Reimplemented in CVodesIntegrator, and IdasIntegrator.

Definition at line 266 of file Integrator.h.

## ◆ setBandwidth()

virtual void setBandwidth | ( | int | N_Upper,
|  | int | N_Lower
| ) |  |
| inline virtual

Definition at line 271 of file Integrator.h.

## ◆ nSensParams()

virtual int nSensParams | ( |  | ) |
| inline virtual

Definition at line 275 of file Integrator.h.

## ◆ sensitivity()

virtual double sensitivity | ( | size_t | k,
|  | size_t | p
| ) |  |
| inline virtual

Definition at line 280 of file Integrator.h.

## ◆ solverStats()

virtual AnyMap solverStats | ( |  | ) | const
| inline virtual

Get solver stats from integrator.

Reimplemented in CVodesIntegrator, and IdasIntegrator.

Definition at line 286 of file Integrator.h.

## ◆ maxNonlinIterations()

virtual int maxNonlinIterations | ( |  | ) | const
| inline virtual

Definition at line 292 of file Integrator.h.

## ◆ setMaxNonlinIterations()

virtual void setMaxNonlinIterations | ( | int | n | ) |
| inline virtual

Definition at line 296 of file Integrator.h.

## ◆ maxNonlinConvFailures()

virtual int maxNonlinConvFailures | ( |  | ) | const
| inline virtual

Definition at line 300 of file Integrator.h.

## ◆ setMaxNonlinConvFailures()

virtual void setMaxNonlinConvFailures | ( | int | n | ) |
| inline virtual

Definition at line 304 of file Integrator.h.

## ◆ algebraicInErrorTest()

virtual bool algebraicInErrorTest | ( |  | ) | const
| inline virtual

Definition at line 308 of file Integrator.h.

## ◆ includeAlgebraicInErrorTest()

virtual void includeAlgebraicInErrorTest | ( | bool | yesno | ) |
| inline virtual

Definition at line 312 of file Integrator.h.

## ◆ warn()

void warn | ( | const string & | msg | ) | const
| inline private

Definition at line 327 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 320 of file Integrator.h.

## ◆ m_prec_side

PreconditionerSide m_prec_side = PreconditionerSide::NO_PRECONDITION
| protected

Type of preconditioning used in applyOptions.

Definition at line 322 of file Integrator.h.

## ◆ m_dummy

double m_dummy
| private

Definition at line 326 of file Integrator.h.

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

- Integrator.h