9 #ifndef CT_DAE_Solver_H 10 #define CT_DAE_Solver_H 22 virtual ~Jacobian() {}
23 virtual bool supplied() {
26 virtual bool isBanded() {
29 virtual int lowerBandWidth() {
32 virtual int upperBandWidth() {
37 class BandedJacobian :
public Jacobian
40 BandedJacobian(
int ml,
int mu) {
44 virtual bool supplied() {
47 virtual bool isBanded() {
50 virtual int lowerBandWidth() {
53 virtual int upperBandWidth() {
60 const int cDirect = 0;
61 const int cKrylov = 1;
92 warn(
"setTolerances");
100 warn(
"setTolerances");
111 virtual void setLinearSolverType(
int solverType) {
112 warn(
"setLinearSolverType");
115 virtual void setDenseLinearSolver() {
116 warn(
"setDenseLinearSolver");
119 virtual void setBandedLinearSolver(
int m_upper,
int m_lower) {
120 warn(
"setBandedLinearSolver");
122 virtual void setMaxStepSize(doublereal dtmax) {
123 warn(
"setMaxStepSize");
125 virtual void setMaxOrder(
int n) {
128 virtual void setMaxNumSteps(
int n) {
129 warn(
"setMaxNumSteps");
131 virtual void setInitialStepSize(doublereal h0) {
132 warn(
"setInitialStepSize");
134 virtual void setStopTime(doublereal tstop) {
137 virtual void setMaxErrTestFailures(
int n) {
138 warn(
"setMaxErrTestFailures");
140 virtual void setMaxNonlinIterations(
int n) {
141 warn(
"setMaxNonlinIterations");
143 virtual void setMaxNonlinConvFailures(
int n) {
144 warn(
"setMaxNonlinConvFailures");
146 virtual void inclAlgebraicInErrorTest(
bool yesno) {
147 warn(
"inclAlgebraicInErrorTest");
159 warn(
"correctInitial_Y_given_Yp");
178 warn(
"correctInitial_YaYp_given_Yd");
184 virtual int solve(doublereal tout) {
192 virtual doublereal
step(doublereal tout) {
205 virtual void init(doublereal t0) {}
211 warn(
"setInputParameter");
218 warn(
"getOutputParameter");
228 virtual const doublereal* solutionVector()
const {
229 warn(
"solutionVector");
239 virtual const doublereal* derivativeVector()
const {
240 warn(
"derivativeVector");
246 ResidJacEval& m_resid;
253 void warn(
const std::string& msg)
const {
254 writelog(
">>>> Warning: method "+msg+
" of base class " 255 +
"DAE_Solver called. Nothing done.\n");
266 DAE_Solver*
newDAE_Solver(
const std::string& itype, ResidJacEval& f);
int nEquations() const
Number of equations.
integer m_neq
Number of total equations in the system.
virtual doublereal derivative(int k) const
the current value of the derivative of solution component k.
virtual void setTolerances(doublereal reltol, doublereal *abstol)
Set error tolerances.
void writelog(const std::string &fmt, const Args &... args)
Write a formatted message to the screen.
This file contains definitions for utility functions and text for modules, inputfiles, logs, textlogs, (see Input File Handling, Diagnostic Output, and Writing messages to the screen).
virtual void correctInitial_Y_given_Yp(doublereal *y, doublereal *yp, doublereal tout)
Calculate consistent value of the starting solution given the starting solution derivatives.
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...
Wrappers for the function evaluators for Nonlinear solvers and Time steppers.
virtual int nEquations() const
Return the number of equations in the equation system.
virtual void init(doublereal t0)
initialize.
Dense, Square (not sparse) matrices.
virtual doublereal solution(int k) const
the current value of solution component k.
DAE_Solver * newDAE_Solver(const std::string &itype, ResidJacEval &f)
Factor method for choosing a DAE solver.
virtual doublereal step(doublereal tout)
Take one internal step.
virtual doublereal getOutputParameter(int flag) const
Get the value of a solver-specific output parameter.
virtual void setTolerances(doublereal reltol, doublereal abstol)
Set error tolerances.
void setJacobian(Jacobian &jac)
Specify a Jacobian evaluator.
Namespace for the Cantera kernel.
virtual int solve(doublereal tout)
Solve the system of equations up to time tout.
virtual void setInputParameter(int flag, doublereal value)
Set a solver-specific input parameter.