6#ifndef CT_MULTINEWTON_H
7#define CT_MULTINEWTON_H
48 "Use version without MultiJac argument. "
49 "To be removed after Cantera 3.2");
50 step(x, stp, r, loglevel);
58 double boundStep(
const double* x0,
const double* step0,
128 int dampStep(
const double* x0,
const double* step0,
double* x1,
double* step1,
133 int dampStep(
const double* x0,
const double* step0,
double* x1,
double* step1,
134 double& s1,
OneDim& r,
MultiJac& jac,
int loglevel,
bool writetitle)
137 "Use version without MultiJac argument. "
138 "To be removed after Cantera 3.2");
139 return dampStep(x0, step0, x1, step1, s1, r, loglevel, writetitle);
145 "SteadyStateSystem::weightedNorm. To be removed after Cantera 3.2.");
172 "Use version without MultiJac argument. "
173 "To be removed after Cantera 3.2");
174 return solve(x0, x1, r, loglevel);
185 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.
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.
vector< double > m_stp
Work array holding the undamped Newton step or the system residual. Size m_n.
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, SteadyStateSystem &r, int loglevel, bool writetitle)
Performs a damped Newton step to solve the system of nonlinear equations.
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, SteadyStateSystem &r, int loglevel)
Find the solution to F(x) = 0 by damped Newton iteration.
double boundStep(const double *x0, const double *step0, const SteadyStateSystem &r, int loglevel)
Return the factor by which the undamped Newton step 'step0' must be multiplied in order to keep all s...
int solve(double *x0, double *x1, OneDim &r, MultiJac &jac, int loglevel)
void setOptions(int maxJacAge=5)
Set options.
void step(double *x, double *step, SteadyStateSystem &r, int loglevel)
Compute the undamped Newton step.
size_t m_n
number of variables
Container class for multiple-domain 1D problems.
double weightedNorm(const double *step) const override
Compute the weighted norm of a step vector.
Base class for representing a system of differential-algebraic equations and solving for its steady-s...
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.