PreconditionerBase Class Reference#
PreconditionerBase serves as an abstract type to extend different preconditioners. More...
#include <PreconditionerBase.h>
Detailed Description
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. | |
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. | |
string | preconditionerSide () const |
Get preconditioner application side for CVODES. | |
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. | |
virtual void | setup () |
Perform preconditioner specific post-reactor setup operations such as factorize. | |
virtual void | reset () |
Reset preconditioner parameters as needed. | |
virtual void | initialize (size_t networkSize) |
Called during setup for any processes that need to be completed prior to setup functions used in sundials. | |
virtual void | printPreconditioner () |
Print preconditioner contents. | |
virtual void | updatePreconditioner () |
Transform Jacobian vector and write into preconditioner, P = (I - gamma * J) | |
virtual void | setGamma (double gamma) |
Set gamma used in preconditioning. | |
virtual double | gamma () |
Get gamma used in preconditioning. | |
virtual void | setAbsoluteTolerance (double atol) |
Set the absolute tolerance in the solver outside of the network initialization. | |
Protected Attributes | |
size_t | m_dim |
Dimension of the preconditioner. | |
double | m_gamma = 1.0 |
gamma value used in M = I - gamma*J | |
bool | m_init = false |
bool saying whether or not the preconditioner is initialized | |
double | m_atol = 0 |
Absolute tolerance of the ODE solver. | |
string | m_precon_side = "none" |
Constructor & Destructor Documentation
◆ PreconditionerBase()
|
inline |
Definition at line 33 of file PreconditionerBase.h.
◆ ~PreconditionerBase()
|
inlinevirtual |
Definition at line 35 of file PreconditionerBase.h.
Member Function Documentation
◆ setValue()
|
inlinevirtual |
Set a value at the specified row and column of the jacobian triplet vector.
- Parameters
-
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.
◆ stateAdjustment()
|
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.
- Parameters
-
state a vector containing the state to be updated
Reimplemented in AdaptivePreconditioner.
Definition at line 49 of file PreconditionerBase.h.
◆ preconditionerSide()
|
inline |
Get preconditioner application side for CVODES.
Definition at line 54 of file PreconditionerBase.h.
◆ setPreconditionerSide()
|
inlinevirtual |
Definition at line 58 of file PreconditionerBase.h.
◆ solve()
|
inlinevirtual |
Solve a linear system Ax=b where A is the preconditioner.
- Parameters
-
[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.
◆ setup()
|
inlinevirtual |
Perform preconditioner specific post-reactor setup operations such as factorize.
Reimplemented in AdaptivePreconditioner.
Definition at line 71 of file PreconditionerBase.h.
◆ reset()
|
inlinevirtual |
Reset preconditioner parameters as needed.
Reimplemented in AdaptivePreconditioner.
Definition at line 76 of file PreconditionerBase.h.
◆ initialize()
|
inlinevirtual |
Called during setup for any processes that need to be completed prior to setup functions used in sundials.
- Parameters
-
networkSize the number of variables in the associated reactor network
Reimplemented in AdaptivePreconditioner.
Definition at line 83 of file PreconditionerBase.h.
◆ printPreconditioner()
|
inlinevirtual |
Print preconditioner contents.
Reimplemented in AdaptivePreconditioner.
Definition at line 88 of file PreconditionerBase.h.
◆ updatePreconditioner()
|
inlinevirtual |
Transform Jacobian vector and write into preconditioner, P = (I - gamma * J)
Reimplemented in AdaptivePreconditioner.
Definition at line 94 of file PreconditionerBase.h.
◆ setGamma()
|
inlinevirtual |
Set gamma used in preconditioning.
- Parameters
-
gamma used in M = I - gamma*J
Definition at line 100 of file PreconditionerBase.h.
◆ gamma()
|
inlinevirtual |
Get gamma used in preconditioning.
Definition at line 105 of file PreconditionerBase.h.
◆ setAbsoluteTolerance()
|
inlinevirtual |
Set the absolute tolerance in the solver outside of the network initialization.
- Parameters
-
atol the specified tolerance
Definition at line 111 of file PreconditionerBase.h.
Member Data Documentation
◆ m_dim
|
protected |
Dimension of the preconditioner.
Definition at line 117 of file PreconditionerBase.h.
◆ m_gamma
|
protected |
gamma value used in M = I - gamma*J
Definition at line 120 of file PreconditionerBase.h.
◆ m_init
|
protected |
bool saying whether or not the preconditioner is initialized
Definition at line 123 of file PreconditionerBase.h.
◆ m_atol
|
protected |
Absolute tolerance of the ODE solver.
Definition at line 126 of file PreconditionerBase.h.
◆ m_precon_side
|
protected |
Definition at line 128 of file PreconditionerBase.h.
The documentation for this class was generated from the following file:
Generated by 1.9.7