Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
DAE_Solver Class Reference

Wrapper for DAE solvers. More...

#include <DAE_Solver.h>

Inherited by IDA_Solver.

Collaboration diagram for DAE_Solver:
[legend]

Public Member Functions

 DAE_Solver (ResidJacEval &f)
 
virtual void setTolerances (doublereal reltol, doublereal *abstol)
 Set error tolerances. More...
 
virtual void setTolerances (doublereal reltol, doublereal abstol)
 Set error tolerances. More...
 
void setJacobian (Jacobian &jac)
 Specify a Jacobian evaluator. More...
 
virtual void setLinearSolverType (int solverType)
 
virtual void setDenseLinearSolver ()
 
virtual void setBandedLinearSolver (int m_upper, int m_lower)
 
virtual void setMaxStepSize (doublereal dtmax)
 
virtual void setMaxOrder (int n)
 
virtual void setMaxNumSteps (int n)
 
virtual void setInitialStepSize (doublereal h0)
 
virtual void setStopTime (doublereal tstop)
 
virtual void setMaxErrTestFailures (int n)
 
virtual void setMaxNonlinIterations (int n)
 
virtual void setMaxNonlinConvFailures (int n)
 
virtual void inclAlgebraicInErrorTest (bool yesno)
 
virtual void correctInitial_Y_given_Yp (doublereal *y, doublereal *yp, doublereal tout)
 Calculate consistent value of the starting solution given the starting solution derivatives. More...
 
virtual void correctInitial_YaYp_given_Yd (doublereal *y, doublereal *yp, doublereal tout)
 Calculate consistent value of the algebraic constraints and derivatives at the start of the problem. More...
 
virtual int solve (doublereal tout)
 Solve the system of equations up to time tout. More...
 
virtual doublereal step (doublereal tout)
 Take one internal step. More...
 
int nEquations () const
 Number of equations. More...
 
virtual void init (doublereal t0)
 initialize. More...
 
virtual void setInputParameter (int flag, doublereal value)
 Set a solver-specific input parameter. More...
 
virtual doublereal getOutputParameter (int flag) const
 Get the value of a solver-specific output parameter. More...
 
virtual doublereal solution (int k) const
 the current value of solution component k. More...
 
virtual const doublereal * solutionVector () const
 
virtual doublereal derivative (int k) const
 the current value of the derivative of solution component k. More...
 
virtual const doublereal * derivativeVector () const
 

Protected Attributes

doublereal m_dummy
 
ResidJacEvalm_resid
 
integer m_neq
 Number of total equations in the system. More...
 
doublereal m_time
 

Private Member Functions

void warn (const std::string &msg) const
 

Detailed Description

Wrapper for DAE solvers.

Definition at line 70 of file DAE_Solver.h.

Member Function Documentation

virtual void setTolerances ( doublereal  reltol,
doublereal *  abstol 
)
inlinevirtual

Set error tolerances.

This version specifies a scalar relative tolerance, and a vector absolute tolerance.

Definition at line 86 of file DAE_Solver.h.

virtual void setTolerances ( doublereal  reltol,
doublereal  abstol 
)
inlinevirtual

Set error tolerances.

This version specifies a scalar relative tolerance, and a scalar absolute tolerance.

Definition at line 95 of file DAE_Solver.h.

void setJacobian ( Jacobian &  jac)
inline

Specify a Jacobian evaluator.

If this method is not called, the Jacobian will be computed by finite difference.

Definition at line 103 of file DAE_Solver.h.

virtual void correctInitial_Y_given_Yp ( doublereal *  y,
doublereal *  yp,
doublereal  tout 
)
inlinevirtual

Calculate consistent value of the starting solution given the starting solution derivatives.

This method may be called if the initial conditions do not satisfy the residual equation F = 0. Given the derivatives of all variables, this method computes the initial y values.

Definition at line 154 of file DAE_Solver.h.

virtual void correctInitial_YaYp_given_Yd ( doublereal *  y,
doublereal *  yp,
doublereal  tout 
)
inlinevirtual

Calculate consistent value of the algebraic constraints and derivatives at the start of the problem.

This method may be called if the initial conditions do not satisfy the residual equation F = 0. Given the initial values of all differential variables, it computes the initial values of all algebraic variables and the initial derivatives of all differential variables.

Parameters
yCalculated value of the solution vector after the procedure ends
ypCalculated value of the solution derivative after the procedure
toutThe first value of t at which a soluton will be requested (from IDASolve). (This is needed here to determine the direction of integration and rough scale in the independent variable t.

Definition at line 174 of file DAE_Solver.h.

virtual int solve ( doublereal  tout)
inlinevirtual

Solve the system of equations up to time tout.

Definition at line 182 of file DAE_Solver.h.

virtual doublereal step ( doublereal  tout)
inlinevirtual

Take one internal step.

Definition at line 190 of file DAE_Solver.h.

int nEquations ( ) const
inline

Number of equations.

Definition at line 196 of file DAE_Solver.h.

References ResidJacEval::nEquations().

virtual void init ( doublereal  t0)
inlinevirtual

initialize.

Base class method does nothing.

Definition at line 203 of file DAE_Solver.h.

virtual void setInputParameter ( int  flag,
doublereal  value 
)
inlinevirtual

Set a solver-specific input parameter.

Definition at line 208 of file DAE_Solver.h.

virtual doublereal getOutputParameter ( int  flag) const
inlinevirtual

Get the value of a solver-specific output parameter.

Definition at line 215 of file DAE_Solver.h.

virtual doublereal solution ( int  k) const
inlinevirtual

the current value of solution component k.

Definition at line 221 of file DAE_Solver.h.

virtual doublereal derivative ( int  k) const
inlinevirtual

the current value of the derivative of solution component k.

Definition at line 232 of file DAE_Solver.h.

Member Data Documentation

integer m_neq
protected

Number of total equations in the system.

Definition at line 249 of file DAE_Solver.h.


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