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() {
37class 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() {
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");
266DAE_Solver*
newDAE_Solver(
const std::string& itype, ResidJacEval& f);
Dense, Square (not sparse) matrices.
virtual doublereal step(doublereal tout)
Take one internal step.
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.
virtual void init(doublereal t0)
initialize.
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 setTolerances(doublereal reltol, doublereal *abstol)
Set error tolerances.
int nEquations() const
Number of equations.
integer m_neq
Number of total equations in the system.
virtual int solve(doublereal tout)
Solve the system of equations up to time tout.
virtual doublereal solution(int k) const
the current value of solution component k.
virtual void setInputParameter(int flag, doublereal value)
Set a solver-specific input parameter.
void setJacobian(Jacobian &jac)
Specify a Jacobian evaluator.
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.
virtual doublereal getOutputParameter(int flag) const
Get the value of a solver-specific output parameter.
Wrappers for the function evaluators for Nonlinear solvers and Time steppers.
virtual int nEquations() const
Return the number of equations in the equation system.
This file contains definitions for utility functions and text for modules, inputfiles,...
void writelog(const std::string &fmt, const Args &... args)
Write a formatted message to the screen.
Namespace for the Cantera kernel.
DAE_Solver * newDAE_Solver(const std::string &itype, ResidJacEval &f)
Factor method for choosing a DAE solver.