Cantera 2.6.0

Public Member Functions | Protected Attributes | List of all members
MultiJac Class Reference
One-Dimensional Reacting Flows

Class MultiJac evaluates the Jacobian of a system of equations defined by a residual function supplied by an instance of class OneDim. More...

`#include <MultiJac.h>`

Inheritance diagram for MultiJac:
[legend]
Collaboration diagram for MultiJac:
[legend]

## Public Member Functions
| MultiJac (OneDim &r)
void | eval (doublereal *x0, doublereal *resid0, double rdt)
| Evaluate the Jacobian at x0. More...
doublereal | elapsedTime () const
| Elapsed CPU time spent computing the Jacobian. More...
int | nEvals () const
| Number of Jacobian evaluations. More...
int | age () const
| Number of times 'incrementAge' has been called since the last evaluation. More...
void | incrementAge ()
| Increment the Jacobian age. More...
void | updateTransient (doublereal rdt, integer *mask)
void | setAge (int age)
| Set the Jacobian age. More...
vector_int & | transientMask ()
void | incrementDiagonal (int j, doublereal d)
Public Member Functions inherited from BandMatrix
| BandMatrix ()
| Base Constructor. More...
| BandMatrix (size_t n, size_t kl, size_t ku, doublereal v=0.0)
| Creates a banded matrix and sets all elements to zero. More...
| BandMatrix (const BandMatrix &y)
BandMatrix & | operator= (const BandMatrix &y)
void | resize (size_t n, size_t kl, size_t ku, doublereal v=0.0)
| Resize the matrix problem. More...
void | bfill (doublereal v=0.0)
| Fill or zero the matrix. More...
doublereal & | operator() (size_t i, size_t j)
| Index into the (i,j) element. More...
doublereal | operator() (size_t i, size_t j) const
| Constant Index into the (i,j) element. More...
doublereal & | value (size_t i, size_t j)
| Return a changeable reference to element (i,j). More...
doublereal | value (size_t i, size_t j) const
| Return the value of element (i,j). More...
size_t | index (size_t i, size_t j) const
| Returns the location in the internal 1D array corresponding to the (i,j) element in the banded array. More...
doublereal | _value (size_t i, size_t j) const
| Return the value of the (i,j) element for (i,j) within the bandwidth. More...
virtual size_t | nRows () const
| Return the number of rows in the matrix. More...
size_t | nColumns () const
| Number of columns. More...
size_t | nSubDiagonals () const
| Number of subdiagonals. More...
size_t | nSuperDiagonals () const
| Number of superdiagonals. More...
size_t | ldim () const
| Return the number of rows of storage needed for the band storage. More...
virtual void | mult (const doublereal *b, doublereal *prod) const
| Multiply A*b and write result to `prod`. More...
virtual void | leftMult (const doublereal *const b, doublereal *const prod) const
| Multiply b*A and write result to prod. More...
int | factor ()
| Perform an LU decomposition, the LAPACK routine DGBTRF is used. More...
int | solve (const doublereal *const b, doublereal *const x)
| Solve the matrix problem Ax = b. More...
int | solve (doublereal *b, size_t nrhs=1, size_t ldb=0)
| Solve the matrix problem Ax = b. More...
virtual vector_fp::iterator | begin ()
| Returns an iterator for the start of the band storage data. More...
vector_fp::iterator | end ()
| Returns an iterator for the end of the band storage data. More...
vector_fp::const_iterator | begin () const
| Returns a const iterator for the start of the band storage data. More...
vector_fp::const_iterator | end () const
| Returns a const iterator for the end of the band storage data. More...
virtual void | zero ()
| Zero the matrix elements. More...
virtual doublereal | rcond (doublereal a1norm)
| Returns an estimate of the inverse of the condition number for the matrix. More...
virtual int | factorAlgorithm () const
| Returns the factor algorithm used. More...
virtual doublereal | oneNorm () const
| Returns the one norm of the matrix. More...
virtual doublereal * | ptrColumn (size_t j)
| Return a pointer to the top of column j. More...
virtual doublereal *const * | colPts ()
| Return a vector of const pointers to the columns. More...
virtual size_t | checkRows (doublereal &valueSmall) const
| Check to see if we have any zero rows in the Jacobian. More...
virtual size_t | checkColumns (doublereal &valueSmall) const
| Check to see if we have any zero columns in the Jacobian. More...
int | info () const
| LAPACK "info" flag after last factor/solve operation. More...
Public Member Functions inherited from GeneralMatrix
| GeneralMatrix ()
| Base Constructor. More...
virtual void | zero ()=0
| Zero the matrix elements. More...
virtual void | mult (const doublereal *b, doublereal *prod) const =0
| Multiply A*b and write result to prod. More...
virtual void | leftMult (const doublereal *const b, doublereal *const prod) const =0
| Multiply b*A and write result to prod. More...
virtual int | factor ()=0
| Factors the A matrix, overwriting A. More...
virtual int | factorQR ()
| Factors the A matrix using the QR algorithm, overwriting A. More...
virtual doublereal | rcondQR ()
| Returns an estimate of the inverse of the condition number for the matrix. More...
virtual doublereal | rcond (doublereal a1norm)=0
| Returns an estimate of the inverse of the condition number for the matrix. More...
virtual void | useFactorAlgorithm (int fAlgorithm)
| Change the way the matrix is factored. More...
virtual int | factorAlgorithm () const =0
| Return the factor algorithm used. More...
virtual doublereal | oneNorm () const =0
| Calculate the one norm of the matrix. More...
virtual size_t | nRows () const =0
| Return the number of rows in the matrix. More...
virtual void | clearFactorFlag ()
| clear the factored flag More...
virtual int | solve (doublereal *b, size_t nrhs=1, size_t ldb=0)=0
| Solves the Ax = b system returning x in the b spot. More...
virtual bool | factored () const
| true if the current factorization is up to date with the matrix More...
virtual doublereal * | ptrColumn (size_t j)=0
| Return a pointer to the top of column j, columns are assumed to be contiguous in memory. More...
virtual doublereal & | operator() (size_t i, size_t j)=0
| Index into the (i,j) element. More...
virtual doublereal | operator() (size_t i, size_t j) const =0
| Constant Index into the (i,j) element. More...
virtual vector_fp::iterator | begin ()=0
| Return an iterator pointing to the first element. More...
virtual vector_fp::const_iterator | begin () const =0
| Return a const iterator pointing to the first element. More...
virtual doublereal *const * | colPts ()=0
| Return a vector of const pointers to the columns. More...
virtual size_t | checkRows (doublereal &valueSmall) const =0
| Check to see if we have any zero rows in the Jacobian. More...
virtual size_t | checkColumns (doublereal &valueSmall) const =0
| Check to see if we have any zero columns in the Jacobian. More...

## Protected Attributes
OneDim * | m_resid
| Residual evaluator for this Jacobian. More...
vector_fp | m_r1
doublereal | m_rtol
doublereal | m_atol
doublereal | m_elapsed
vector_fp | m_ssdiag
vector_int | m_mask
int | m_nevals
int | m_age
size_t | m_size
size_t | m_points
Protected Attributes inherited from BandMatrix
vector_fp | data
| Matrix data. More...
vector_fp | ludata
| Factorized data. More...
size_t | m_n
| Number of rows and columns of the matrix. More...
size_t | m_kl
| Number of subdiagonals of the matrix. More...
size_t | m_ku
| Number of super diagonals of the matrix. More...
doublereal | m_zero
| value of zero More...
std::unique_ptr< PivData > | m_ipiv
| Pivot vector. More...
std::vector< doublereal * > | m_colPtrs
| Vector of column pointers. More...
std::vector< double * > | m_lu_col_ptrs
vector_int | iwork_
| Extra work array needed - size = n. More...
vector_fp | work_
| Extra dp work array needed - size = 3n. More...
int | m_info
Protected Attributes inherited from GeneralMatrix
int | m_factored
| Indicates whether the matrix is factored. More...

## Detailed Description

Class MultiJac evaluates the Jacobian of a system of equations defined by a residual function supplied by an instance of class OneDim.

The residual function may consist of several linked 1D domains, with different variables in each domain.

Definition at line 22 of file MultiJac.h.

## Constructor & Destructor Documentation

## ◆ MultiJac()

MultiJac | ( | OneDim & | r | ) |

Definition at line 14 of file MultiJac.cpp.

## Member Function Documentation

## ◆ eval()

void eval | ( | doublereal * | x0,
|  | doublereal * | resid0,
|  | double | rdt
| ) |  |

Evaluate the Jacobian at x0.

The unperturbed residual function is resid0, which must be supplied on input. The third parameter 'rdt' is the reciprocal of the time step. If zero, the steady-state Jacobian is evaluated.

Definition at line 43 of file MultiJac.cpp.

References Cantera::npos.

Referenced by MultiNewton::solve().

## ◆ elapsedTime()

doublereal elapsedTime | ( |  | ) | const
| inline

Elapsed CPU time spent computing the Jacobian.

Definition at line 36 of file MultiJac.h.

## ◆ nEvals()

int nEvals | ( |  | ) | const
| inline

Number of Jacobian evaluations.

Definition at line 41 of file MultiJac.h.

Referenced by MultiNewton::solve().

## ◆ age()

int age | ( |  | ) | const
| inline

Number of times 'incrementAge' has been called since the last evaluation.

Definition at line 46 of file MultiJac.h.

Referenced by MultiJac::setAge(), and MultiNewton::solve().

## ◆ incrementAge()

void incrementAge | ( |  | ) |
| inline

Increment the Jacobian age.

Definition at line 51 of file MultiJac.h.

Referenced by MultiNewton::solve().

## ◆ updateTransient()

void updateTransient | ( | doublereal | rdt,
|  | integer * | mask
| ) |  |

Definition at line 30 of file MultiJac.cpp.

## ◆ setAge()

void setAge | ( | int | age | ) |
| inline

Set the Jacobian age.

Definition at line 58 of file MultiJac.h.

References MultiJac::age().

Referenced by Domain1D::needJacUpdate(), and MultiNewton::solve().

## ◆ transientMask()

vector_int & transientMask | ( |  | ) |
| inline

Definition at line 62 of file MultiJac.h.

## ◆ incrementDiagonal()

void incrementDiagonal | ( | int | j,
|  | doublereal | d
| ) |  |

Definition at line 37 of file MultiJac.cpp.

## Member Data Documentation

## ◆ m_resid

OneDim* m_resid
| protected

Residual evaluator for this Jacobian.

This is a pointer to the residual evaluator. This object isn't owned by this Jacobian object.

Definition at line 74 of file MultiJac.h.

## ◆ m_r1

vector_fp m_r1
| protected

Definition at line 76 of file MultiJac.h.

## ◆ m_rtol

doublereal m_rtol
| protected

Definition at line 77 of file MultiJac.h.

## ◆ m_atol

doublereal m_atol
| protected

Definition at line 77 of file MultiJac.h.

## ◆ m_elapsed

doublereal m_elapsed
| protected

Definition at line 78 of file MultiJac.h.

## ◆ m_ssdiag

vector_fp m_ssdiag
| protected

Definition at line 79 of file MultiJac.h.

## ◆ m_mask

vector_int m_mask
| protected

Definition at line 80 of file MultiJac.h.

## ◆ m_nevals

int m_nevals
| protected

Definition at line 81 of file MultiJac.h.

## ◆ m_age

int m_age
| protected

Definition at line 82 of file MultiJac.h.

## ◆ m_size

size_t m_size
| protected

Definition at line 83 of file MultiJac.h.

## ◆ m_points

size_t m_points
| protected

Definition at line 84 of file MultiJac.h.

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

- MultiJac.h
- MultiJac.cpp