38 m_jac_trips.emplace_back(
static_cast<int>(row),
static_cast<int>(col), value);
56 Eigen::VectorXd diag = Eigen::Map<Eigen::VectorXi>(mask,
m_dim).cast<
double>();
57 m_matrix -= rdt * diag.matrix().asDiagonal();
63 Eigen::SparseMatrix<double> jacobian_mat(
m_dim,
m_dim);
70 Eigen::IOFormat HeavyFmt(Eigen::FullPrecision, 0,
", ",
";\n",
"[",
"]",
"[",
"]");
71 ss << Eigen::MatrixXd(
m_matrix).format(HeavyFmt);
void setValue(size_t row, size_t col, double value) override
Set a value at the specified row and column of the jacobian triplet vector.
void initialize(size_t networkSize) override
Called during setup for any processes that need to be completed prior to setup functions used in sund...
vector< Eigen::Triplet< double > > m_jac_trips
Vector of triples representing the jacobian used in preconditioning.
Eigen::SparseMatrix< double > m_identity
Storage of appropriately sized identity matrix for making the preconditioner.
void printPreconditioner() override
Print preconditioner contents.
void updatePreconditioner() override
Transform Jacobian vector and write into preconditioner, P = (I - gamma * J)
void updateTransient(double rdt, int *mask) override
Update the diagonal terms in the Jacobian by using the transient mask .
void printJacobian()
Print jacobian contents.
void reset() override
Reset parameters as needed.
Eigen::SparseMatrix< double > m_matrix
Container that is the sparse preconditioner.
size_t m_dim
Dimension of the system.
double m_gamma
gamma value used in M = I - gamma*J
virtual void factorize()
Factorize the system matrix.
bool m_init
bool saying whether or not the system is initialized
This file contains definitions for utility functions and text for modules, inputfiles and logging,...
Eigen::SparseMatrix< double > jacobian()
Return underlying Jacobian matrix.
void writelog(const string &fmt, const Args &... args)
Write a formatted message to the screen.
Namespace for the Cantera kernel.