Cantera  3.1.0a1
Loading...
Searching...
No Matches
MultiNewton Class Reference

Newton iterator for multi-domain, one-dimensional problems. More...

#include <MultiNewton.h>

Detailed Description

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
 
MultiNewtonoperator= (const MultiNewton &)=delete
 
size_t size ()
 
void step (double *x, double *step, OneDim &r, MultiJac &jac, int loglevel)
 Compute the undamped Newton step.
 
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.
 
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.
 
double norm2 (const double *x, const double *step, OneDim &r) const
 Compute the weighted 2-norm of step.
 
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.
 
void resize (size_t points)
 Change the problem size.
 

Protected Attributes

vector< double > m_x
 Work arrays of size m_n used in solve().
 
vector< double > m_stp
 
vector< double > m_stp1
 
int m_maxAge = 5
 
size_t m_n
 number of variables
 
double m_elapsed = 0.0
 

Constructor & Destructor Documentation

◆ MultiNewton()

MultiNewton ( int  sz)

Definition at line 132 of file MultiNewton.cpp.

◆ ~MultiNewton()

virtual ~MultiNewton ( )
inlinevirtual

Definition at line 27 of file MultiNewton.h.

Member Function Documentation

◆ size()

size_t size ( )
inline

Definition at line 31 of file MultiNewton.h.

◆ step()

void step ( double *  x,
double *  step,
OneDim r,
MultiJac jac,
int  loglevel 
)

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.

◆ boundStep()

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.

◆ dampStep()

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.

◆ norm2()

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.

◆ solve()

int solve ( double *  x0,
double *  x1,
OneDim r,
MultiJac jac,
int  loglevel 
)

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.

◆ setOptions()

void setOptions ( int  maxJacAge = 5)
inline

Set options.

Definition at line 68 of file MultiNewton.h.

◆ resize()

void resize ( size_t  points)

Change the problem size.

Definition at line 137 of file MultiNewton.cpp.

Member Data Documentation

◆ m_x

vector<double> m_x
protected

Work arrays of size m_n used in solve().

Definition at line 77 of file MultiNewton.h.

◆ m_stp

vector<double> m_stp
protected

Definition at line 77 of file MultiNewton.h.

◆ m_stp1

vector<double> m_stp1
protected

Definition at line 77 of file MultiNewton.h.

◆ m_maxAge

int m_maxAge = 5
protected

Definition at line 79 of file MultiNewton.h.

◆ m_n

size_t m_n
protected

number of variables

Definition at line 82 of file MultiNewton.h.

◆ m_elapsed

double m_elapsed = 0.0
protected

Definition at line 84 of file MultiNewton.h.


The documentation for this class was generated from the following files: