6#ifndef CT_MULTINEWTON_H
7#define CT_MULTINEWTON_H
47 double boundStep(
const double* x0,
const double* step0,
48 const OneDim& r,
int loglevel);
113 int dampStep(
const double* x0,
const double* step0,
double* x1,
double* step1,
114 double& s1,
OneDim& r,
MultiJac& jac,
int loglevel,
bool writetitle);
143 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.
void step(double *x, double *step, OneDim &r, MultiJac &jac, int loglevel)
Compute the undamped Newton step.
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.
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)
Performs a damped Newton step to solve the system of nonlinear equations.
int m_maxAge
Maximum allowable Jacobian age before it is recomputed.
int solve(double *x0, double *x1, OneDim &r, MultiJac &jac, int loglevel)
Find the solution to F(x) = 0 by damped Newton iteration.
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.