10 #ifndef PRECONDITIONERBASE_H
11 #define PRECONDITIONERBASE_H
41 virtual void setValue(
size_t row,
size_t col,
double value) {
58 virtual void setPreconditionerSide(
const string& preconSide) {
59 m_precon_side = preconSide;
66 virtual void solve(
const size_t stateSize,
double* rhs_vector,
double* output) {
128 string m_precon_side =
"none";
An error indicating that an unimplemented function has been called.
PreconditionerBase serves as an abstract type to extend different preconditioners.
virtual double gamma()
Get gamma used in preconditioning.
virtual void setGamma(double gamma)
Set gamma used in preconditioning.
size_t m_dim
Dimension of the preconditioner.
string preconditionerSide() const
Get preconditioner application side for CVODES.
virtual void setup()
Perform preconditioner specific post-reactor setup operations such as factorize.
double m_gamma
gamma value used in M = I - gamma*J
virtual void printPreconditioner()
Print preconditioner contents.
virtual void solve(const size_t stateSize, double *rhs_vector, double *output)
Solve a linear system Ax=b where A is the preconditioner.
virtual void reset()
Reset preconditioner parameters as needed.
virtual void stateAdjustment(vector< double > &state)
Adjust the state vector based on the preconditioner, e.g., Adaptive preconditioning uses a strictly p...
bool m_init
bool saying whether or not the preconditioner is initialized
virtual void initialize(size_t networkSize)
Called during setup for any processes that need to be completed prior to setup functions used in sund...
double m_atol
Absolute tolerance of the ODE solver.
virtual void setAbsoluteTolerance(double atol)
Set the absolute tolerance in the solver outside of the network initialization.
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.
virtual void updatePreconditioner()
Transform Jacobian vector and write into preconditioner, P = (I - gamma * J)
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
Namespace for the Cantera kernel.
PreconditionerSide
Specifies the side of the system on which the preconditioner is applied.
@ LEFT_PRECONDITION
No preconditioning.
@ BOTH_PRECONDITION
Right side preconditioning.
@ RIGHT_PRECONDITION
Left side preconditioning.