Cantera
3.1.0a1
|
Newton iterator for multi-domain, one-dimensional problems. More...
#include <MultiNewton.h>
Newton iterator for multi-domain, one-dimensional problems.
Used by class OneDim.
Definition at line 23 of file MultiNewton.h.
Public Member Functions | |
MultiNewton (int sz) | |
MultiNewton (const MultiNewton &)=delete | |
MultiNewton & | operator= (const MultiNewton &)=delete |
size_t | size () |
void | step (double *x, double *step, OneDim &r, MultiJac &jac, int loglevel) |
Compute the undamped Newton step. More... | |
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 solution components in all domains between their specified lower and upper bounds. More... | |
int | dampStep (const double *x0, const double *step0, double *x1, double *step1, double &s1, OneDim &r, MultiJac &jac, int loglevel, bool writetitle) |
On entry, step0 must contain an undamped Newton step for the solution x0. More... | |
double | norm2 (const double *x, const double *step, OneDim &r) const |
Compute the weighted 2-norm of step . More... | |
int | solve (double *x0, double *x1, OneDim &r, MultiJac &jac, int loglevel) |
Find the solution to F(X) = 0 by damped Newton iteration. More... | |
void | setOptions (int maxJacAge=5) |
Set options. More... | |
void | resize (size_t points) |
Change the problem size. More... | |
Protected Attributes | |
vector< double > | m_x |
Work arrays of size m_n used in solve(). More... | |
vector< double > | m_stp |
vector< double > | m_stp1 |
int | m_maxAge = 5 |
size_t | m_n |
number of variables More... | |
double | m_elapsed = 0.0 |
Compute the undamped Newton step.
The residual function is evaluated at x
, but the Jacobian is not recomputed.
Definition at line 157 of file MultiNewton.cpp.
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 solution components in all domains between their specified lower and upper bounds.
Definition at line 190 of file MultiNewton.cpp.
int dampStep | ( | const double * | x0, |
const double * | step0, | ||
double * | x1, | ||
double * | step1, | ||
double & | s1, | ||
OneDim & | r, | ||
MultiJac & | jac, | ||
int | loglevel, | ||
bool | writetitle | ||
) |
On entry, step0 must contain an undamped Newton step for the solution x0.
This method attempts to find a damping coefficient such that the next undamped step would have a norm smaller than that of step0. If successful, the new solution after taking the damped step is returned in x1, and the undamped step at x1 is returned in step1.
Definition at line 202 of file MultiNewton.cpp.
double norm2 | ( | const double * | x, |
const double * | step, | ||
OneDim & | r | ||
) | const |
Compute the weighted 2-norm of step
.
Definition at line 145 of file MultiNewton.cpp.
Find the solution to F(X) = 0 by damped Newton iteration.
On entry, x0 contains an initial estimate of the solution. On successful return, x1 contains the converged solution.
Definition at line 283 of file MultiNewton.cpp.
|
inline |
Set options.
Definition at line 68 of file MultiNewton.h.
void resize | ( | size_t | points | ) |
Change the problem size.
Definition at line 137 of file MultiNewton.cpp.
|
protected |
Work arrays of size m_n used in solve().
Definition at line 77 of file MultiNewton.h.
|
protected |
number of variables
Definition at line 82 of file MultiNewton.h.