Cantera  3.1.0a1

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]

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 23 of file MultiJac.h.

Public Member Functions

 MultiJac (OneDim &r)
 
void eval (double *x0, double *resid0, double rdt)
 Evaluate the Jacobian at x0. More...
 
double 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 (double rdt, integer *mask)
 
void setAge (int age)
 Set the Jacobian age. More...
 
vector< int > & transientMask ()
 
void incrementDiagonal (int j, double d)
 
- Public Member Functions inherited from BandMatrix
 BandMatrix ()
 Base Constructor. More...
 
 BandMatrix (size_t n, size_t kl, size_t ku, double v=0.0)
 Creates a banded matrix and sets all elements to zero. More...
 
 BandMatrix (const BandMatrix &y)
 
BandMatrixoperator= (const BandMatrix &y)
 
void resize (size_t n, size_t kl, size_t ku, double v=0.0)
 Resize the matrix problem. More...
 
void bfill (double v=0.0)
 Fill or zero the matrix. More...
 
double & operator() (size_t i, size_t j) override
 Index into the (i,j) element. More...
 
double operator() (size_t i, size_t j) const override
 Constant Index into the (i,j) element. More...
 
double & value (size_t i, size_t j)
 Return a changeable reference to element (i,j). More...
 
double 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...
 
double _value (size_t i, size_t j) const
 Return the value of the (i,j) element for (i,j) within the bandwidth. More...
 
size_t nRows () const override
 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...
 
void mult (const double *b, double *prod) const override
 Multiply A*b and write result to prod. More...
 
void leftMult (const double *const b, double *const prod) const override
 Multiply b*A and write result to prod. More...
 
int factor () override
 Perform an LU decomposition, the LAPACK routine DGBTRF is used. More...
 
int solve (const double *const b, double *const x)
 Solve the matrix problem Ax = b. More...
 
int solve (double *b, size_t nrhs=1, size_t ldb=0) override
 Solve the matrix problem Ax = b. More...
 
void zero () override
 Zero the matrix elements. More...
 
double rcond (double a1norm) override
 Returns an estimate of the inverse of the condition number for the matrix. More...
 
int factorAlgorithm () const override
 Returns the factor algorithm used. More...
 
double oneNorm () const override
 Returns the one norm of the matrix. More...
 
double * ptrColumn (size_t j) override
 Return a pointer to the top of column j. More...
 
double *const * colPts () override
 Return a vector of const pointers to the columns. More...
 
size_t checkRows (double &valueSmall) const override
 Check to see if we have any zero rows in the Jacobian. More...
 
size_t checkColumns (double &valueSmall) const override
 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 ()=default
 Base Constructor. More...
 
virtual int factorQR ()
 Factors the A matrix using the QR algorithm, overwriting A. More...
 
virtual double rcondQR ()
 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 void clearFactorFlag ()
 clear the factored flag More...
 
virtual bool factored () const
 true if the current factorization is up to date with the matrix More...
 

Protected Attributes

OneDimm_resid
 Residual evaluator for this Jacobian. More...
 
vector< double > m_r1
 
double m_rtol = 1e-5
 
double m_atol = sqrt(std::numeric_limits<double>::epsilon())
 
double m_elapsed = 0.0
 
vector< double > m_ssdiag
 
vector< int > m_mask
 
int m_nevals = 0
 
int m_age = 100000
 
size_t m_size
 
size_t m_points
 
- Protected Attributes inherited from BandMatrix
vector< double > data
 Matrix data. More...
 
vector< double > ludata
 Factorized data. More...
 
size_t m_n = 0
 Number of rows and columns of the matrix. More...
 
size_t m_kl = 0
 Number of subdiagonals of the matrix. More...
 
size_t m_ku = 0
 Number of super diagonals of the matrix. More...
 
double m_zero = 0
 value of zero More...
 
unique_ptr< PivData > m_ipiv
 Pivot vector. More...
 
vector< double * > m_colPtrs
 Vector of column pointers. More...
 
vector< double * > m_lu_col_ptrs
 
vector< int > iwork_
 Extra work array needed - size = n. More...
 
vector< double > work_
 Extra dp work array needed - size = 3n. More...
 
int m_info = 0
 
- Protected Attributes inherited from GeneralMatrix
int m_factored = false
 Indicates whether the matrix is factored. More...
 

Member Function Documentation

◆ eval()

void eval ( double *  x0,
double *  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 36 of file MultiJac.cpp.

◆ elapsedTime()

double elapsedTime ( ) const
inline

Elapsed CPU time spent computing the Jacobian.

Definition at line 37 of file MultiJac.h.

◆ nEvals()

int nEvals ( ) const
inline

Number of Jacobian evaluations.

Definition at line 42 of file MultiJac.h.

◆ age()

int age ( ) const
inline

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

Definition at line 47 of file MultiJac.h.

◆ incrementAge()

void incrementAge ( )
inline

Increment the Jacobian age.

Definition at line 52 of file MultiJac.h.

◆ setAge()

void setAge ( int  age)
inline

Set the Jacobian age.

Definition at line 59 of file MultiJac.h.

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 75 of file MultiJac.h.


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