8 #ifndef CT_DAE_Solver_H
9 #define CT_DAE_Solver_H
24 virtual ~Jacobian() {}
25 virtual bool supplied() {
28 virtual bool isBanded() {
31 virtual int lowerBandWidth() {
34 virtual int upperBandWidth() {
39 class BandedJacobian :
public Jacobian
42 BandedJacobian(
int ml,
int mu) {
46 virtual bool supplied() {
49 virtual bool isBanded() {
52 virtual int lowerBandWidth() {
55 virtual int upperBandWidth() {
62 const int cDirect = 0;
63 const int cKrylov = 1;
88 warn(
"setTolerances");
96 warn(
"setTolerances");
107 virtual void setLinearSolverType(
int solverType) {
108 warn(
"setLinearSolverType");
111 virtual void setDenseLinearSolver() {
112 warn(
"setDenseLinearSolver");
115 virtual void setBandedLinearSolver(
int m_upper,
int m_lower) {
116 warn(
"setBandedLinearSolver");
118 virtual void setMaxStepSize(doublereal dtmax) {
119 warn(
"setMaxStepSize");
121 virtual void setMaxOrder(
int n) {
124 virtual void setMaxNumSteps(
int n) {
125 warn(
"setMaxNumSteps");
127 virtual void setInitialStepSize(doublereal h0) {
128 warn(
"setInitialStepSize");
130 virtual void setStopTime(doublereal tstop) {
133 virtual void setMaxErrTestFailures(
int n) {
134 warn(
"setMaxErrTestFailures");
136 virtual void setMaxNonlinIterations(
int n) {
137 warn(
"setMaxNonlinIterations");
139 virtual void setMaxNonlinConvFailures(
int n) {
140 warn(
"setMaxNonlinConvFailures");
142 virtual void inclAlgebraicInErrorTest(
bool yesno) {
143 warn(
"inclAlgebraicInErrorTest");
156 warn(
"correctInitial_Y_given_Yp");
176 warn(
"correctInitial_YaYp_given_Yd");
182 virtual int solve(doublereal tout) {
190 virtual doublereal
step(doublereal tout) {
203 virtual void init(doublereal t0) {}
209 warn(
"setInputParameter");
216 warn(
"getOutputParameter");
226 virtual const doublereal* solutionVector()
const {
227 warn(
"solutionVector");
237 virtual const doublereal* derivativeVector()
const {
238 warn(
"derivativeVector");
246 ResidJacEval& m_resid;
254 void warn(
const std::string& msg)
const {
255 writelog(
">>>> Warning: method "+msg+
" of base class "
256 +
"DAE_Solver called. Nothing done.\n");
270 DAE_Solver*
newDAE_Solver(
const std::string& itype, ResidJacEval& f);
integer m_neq
Number of total equations in the system.
virtual int nEquations() const
Return the number of equations in the equation system.
virtual void setTolerances(doublereal reltol, doublereal *abstol)
Set error tolerances.
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 doublereal derivative(int k) const
the current value of the derivative of solution component k.
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 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.
int nEquations() const
Number of equations.
void writelog(const std::string &msg)
Write a message to the screen.
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.