Cantera
3.1.0a1
|
PreconditionerBase serves as an abstract type to extend different preconditioners. More...
#include <PreconditionerBase.h>
PreconditionerBase serves as an abstract type to extend different preconditioners.
Definition at line 30 of file PreconditionerBase.h.
Public Member Functions | |
virtual void | setValue (size_t row, size_t col, double value) |
Set a value at the specified row and column of the jacobian triplet vector. More... | |
virtual void | stateAdjustment (vector< double > &state) |
Adjust the state vector based on the preconditioner, e.g., Adaptive preconditioning uses a strictly positive composition when preconditioning which is handled by this function. More... | |
string | preconditionerSide () const |
Get preconditioner application side for CVODES. More... | |
virtual void | setPreconditionerSide (const string &preconSide) |
virtual void | solve (const size_t stateSize, double *rhs_vector, double *output) |
Solve a linear system Ax=b where A is the preconditioner. More... | |
virtual void | setup () |
Perform preconditioner specific post-reactor setup operations such as factorize. More... | |
virtual void | reset () |
Reset preconditioner parameters as needed. More... | |
virtual void | initialize (size_t networkSize) |
Called during setup for any processes that need to be completed prior to setup functions used in sundials. More... | |
virtual void | printPreconditioner () |
Print preconditioner contents. More... | |
virtual void | updatePreconditioner () |
Transform Jacobian vector and write into preconditioner, P = (I - gamma * J) More... | |
virtual void | setGamma (double gamma) |
Set gamma used in preconditioning. More... | |
virtual double | gamma () |
Get gamma used in preconditioning. More... | |
virtual void | setAbsoluteTolerance (double atol) |
Set the absolute tolerance in the solver outside of the network initialization. More... | |
Protected Attributes | |
size_t | m_dim |
Dimension of the preconditioner. More... | |
double | m_gamma = 1.0 |
gamma value used in M = I - gamma*J More... | |
bool | m_init = false |
bool saying whether or not the preconditioner is initialized More... | |
double | m_atol = 0 |
Absolute tolerance of the ODE solver. More... | |
string | m_precon_side = "none" |
|
inlinevirtual |
Set a value at the specified row and column of the jacobian triplet vector.
row | row in the jacobian matrix |
col | column in the jacobian matrix |
value | value of the element at row and col |
Reimplemented in AdaptivePreconditioner.
Definition at line 41 of file PreconditionerBase.h.
|
inlinevirtual |
Adjust the state vector based on the preconditioner, e.g., Adaptive preconditioning uses a strictly positive composition when preconditioning which is handled by this function.
state | a vector containing the state to be updated |
Reimplemented in AdaptivePreconditioner.
Definition at line 49 of file PreconditionerBase.h.
|
inline |
Get preconditioner application side for CVODES.
Definition at line 54 of file PreconditionerBase.h.
|
inlinevirtual |
Solve a linear system Ax=b where A is the preconditioner.
[in] | stateSize | length of the rhs and output vectors |
[in] | rhs_vector | right hand side vector used in linear system |
[out] | output | output vector for solution |
Reimplemented in AdaptivePreconditioner.
Definition at line 66 of file PreconditionerBase.h.
|
inlinevirtual |
Perform preconditioner specific post-reactor setup operations such as factorize.
Reimplemented in AdaptivePreconditioner.
Definition at line 71 of file PreconditionerBase.h.
|
inlinevirtual |
Reset preconditioner parameters as needed.
Reimplemented in AdaptivePreconditioner.
Definition at line 76 of file PreconditionerBase.h.
|
inlinevirtual |
Called during setup for any processes that need to be completed prior to setup functions used in sundials.
networkSize | the number of variables in the associated reactor network |
Reimplemented in AdaptivePreconditioner.
Definition at line 83 of file PreconditionerBase.h.
|
inlinevirtual |
Print preconditioner contents.
Reimplemented in AdaptivePreconditioner.
Definition at line 88 of file PreconditionerBase.h.
|
inlinevirtual |
Transform Jacobian vector and write into preconditioner, P = (I - gamma * J)
Reimplemented in AdaptivePreconditioner.
Definition at line 94 of file PreconditionerBase.h.
|
inlinevirtual |
Set gamma used in preconditioning.
gamma | used in M = I - gamma*J |
Definition at line 100 of file PreconditionerBase.h.
|
inlinevirtual |
Get gamma used in preconditioning.
Definition at line 105 of file PreconditionerBase.h.
|
inlinevirtual |
Set the absolute tolerance in the solver outside of the network initialization.
atol | the specified tolerance |
Definition at line 111 of file PreconditionerBase.h.
|
protected |
Dimension of the preconditioner.
Definition at line 117 of file PreconditionerBase.h.
|
protected |
gamma value used in M = I - gamma*J
Definition at line 120 of file PreconditionerBase.h.
|
protected |
bool saying whether or not the preconditioner is initialized
Definition at line 123 of file PreconditionerBase.h.
|
protected |
Absolute tolerance of the ODE solver.
Definition at line 126 of file PreconditionerBase.h.