6#ifndef CT_MULTINEWTON_H
7#define CT_MULTINEWTON_H
47 "Use version without MultiJac argument. "
48 "To be removed after Cantera 3.2");
49 step(x, stp, r, loglevel);
57 double boundStep(
const double* x0,
const double* step0,
58 const OneDim& r,
int loglevel);
124 int dampStep(
const double* x0,
const double* step0,
double* x1,
double* step1,
125 double& s1,
OneDim& r,
int loglevel,
bool writetitle);
129 int dampStep(
const double* x0,
const double* step0,
double* x1,
double* step1,
130 double& s1,
OneDim& r,
MultiJac& jac,
int loglevel,
bool writetitle)
133 "Use version without MultiJac argument. "
134 "To be removed after Cantera 3.2");
135 return dampStep(x0, step0, x1, step1, s1, r, loglevel, writetitle);
157 int solve(
double* x0,
double* x1,
OneDim& r,
int loglevel);
163 "Use version without MultiJac argument. "
164 "To be removed after Cantera 3.2");
165 return solve(x0, x1, r, loglevel);
176 void resize(
size_t points);
Class MultiJac evaluates the Jacobian of a system of equations defined by a residual function supplie...
Newton iterator for multi-domain, one-dimensional problems.
double m_dampFactor
Factor by which the damping coefficient is reduced in each iteration.
int solve(double *x0, double *x1, OneDim &r, int loglevel)
Find the solution to F(x) = 0 by damped Newton iteration.
size_t size()
Get the number of variables in the system.
void resize(size_t points)
Change the problem size.
vector< double > m_x
Work array holding the system state after the last successful step. Size m_n.
double norm2(const double *x, const double *step, OneDim &r) const
Compute the weighted 2-norm of step.
double m_elapsed
Elapsed CPU time spent computing the Jacobian.
vector< double > m_stp1
Work array holding the damped Newton step. Size m_n.
void step(double *x, double *step, OneDim &r, int loglevel)
Compute the undamped Newton step.
vector< double > m_stp
Work array holding the undamped Newton step or the system residual. Size m_n.
int dampStep(const double *x0, const double *step0, double *x1, double *step1, double &s1, OneDim &r, int loglevel, bool writetitle)
Performs a damped Newton step to solve the system of nonlinear equations.
void step(double *x, double *stp, OneDim &r, MultiJac &jac, int loglevel)
size_t m_maxDampIter
Maximum number of damping iterations.
int dampStep(const double *x0, const double *step0, double *x1, double *step1, double &s1, OneDim &r, MultiJac &jac, int loglevel, bool writetitle)
int m_maxAge
Maximum allowable Jacobian age before it is recomputed.
int solve(double *x0, double *x1, OneDim &r, MultiJac &jac, int loglevel)
void setOptions(int maxJacAge=5)
Set options.
double boundStep(const double *x0, const double *step0, const OneDim &r, int loglevel)
Return the factor by which the undamped Newton step 'step0' must be multiplied in order to keep all s...
size_t m_n
number of variables
Container class for multiple-domain 1D problems.
Namespace for the Cantera kernel.
void warn_deprecated(const string &source, const AnyBase &node, const string &message)
A deprecation warning for syntax in an input file.