4#ifndef PY_KINETICS_UTILS_H
5#define PY_KINETICS_UTILS_H
8#include "cantera/numerics/eigen_sparse.h"
12inline size_t sparseTriplets(
const Eigen::SparseMatrix<double>& mat,
13 int* rows,
int* cols,
double* data,
size_t length)
16 for (
int i = 0; i < mat.outerSize(); i++) {
17 for (Eigen::SparseMatrix<double>::InnerIterator it(mat, i); it; ++it) {
19 rows[count] = it.row();
20 cols[count] = it.col();
21 data[count] = it.value();
28 "Output arrays have insufficient length. Required size is {}, "
29 "while provided length is {}.", count, length);
35inline void sparseCscData(
const Eigen::SparseMatrix<double>& mat,
36 double* value,
int* inner,
int* outer)
38 if (!mat.isCompressed()) {
40 "Invalid input: Eigen matrix is not compressed.");
43 const double* valuePtr = mat.valuePtr();
44 const int* innerPtr = mat.innerIndexPtr();
45 for (
size_t i = 0; i < mat.nonZeros(); ++i) {
46 value[i] = valuePtr[i];
47 inner[i] = innerPtr[i];
50 const int* outerPtr = mat.outerIndexPtr();
51 for (
size_t i = 0; i < mat.outerSize() + 1; ++i) {
52 outer[i] = outerPtr[i];
56#define KIN_1D(FUNC_NAME) ARRAY_FUNC(kin, Kinetics, FUNC_NAME)
58KIN_1D(getFwdRatesOfProgress)
59KIN_1D(getRevRatesOfProgress)
60KIN_1D(getNetRatesOfProgress)
62KIN_1D(getFwdRateConstants_ddT)
63KIN_1D(getFwdRateConstants_ddP)
64KIN_1D(getFwdRateConstants_ddC)
66KIN_1D(getFwdRatesOfProgress_ddT)
67KIN_1D(getRevRatesOfProgress_ddT)
68KIN_1D(getNetRatesOfProgress_ddT)
70KIN_1D(getFwdRatesOfProgress_ddP)
71KIN_1D(getRevRatesOfProgress_ddP)
72KIN_1D(getNetRatesOfProgress_ddP)
74KIN_1D(getFwdRatesOfProgress_ddC)
75KIN_1D(getRevRatesOfProgress_ddC)
76KIN_1D(getNetRatesOfProgress_ddC)
78KIN_1D(getEquilibriumConstants)
79KIN_1D(getFwdRateConstants)
80KIN_1D(getRevRateConstants)
82KIN_1D(getDeltaEnthalpy)
84KIN_1D(getDeltaEntropy)
85KIN_1D(getDeltaSSEnthalpy)
86KIN_1D(getDeltaSSGibbs)
87KIN_1D(getDeltaSSEntropy)
89KIN_1D(getThirdBodyConcentrations)
91KIN_1D(getCreationRates)
92KIN_1D(getDestructionRates)
93KIN_1D(getNetProductionRates)
95KIN_1D(getCreationRates_ddT)
96KIN_1D(getDestructionRates_ddT)
97KIN_1D(getNetProductionRates_ddT)
99KIN_1D(getCreationRates_ddP)
100KIN_1D(getDestructionRates_ddP)
101KIN_1D(getNetProductionRates_ddP)
103KIN_1D(getCreationRates_ddC)
104KIN_1D(getDestructionRates_ddC)
105KIN_1D(getNetProductionRates_ddC)
Base class for kinetics managers and also contains the kineticsmgr module documentation (see Kinetics...
Base class for exceptions thrown by Cantera classes.