Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor tweaks for 2.6 beta #1212

Merged
merged 1 commit into from
Mar 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions include/cantera/kinetics/Kinetics.h
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,9 @@ class Kinetics
* on rate constants are considered for the evaluation of derivatives.
* - `rtol-delta` (double) ... relative tolerance used to perturb properties
* when calculating numerical derivatives. The default value is 1e-8.
*
* @warning The calculation of derivatives is an experimental part of the
* %Cantera API and may be changed or removed without notice.
*/
//! @{

Expand Down Expand Up @@ -642,6 +645,9 @@ class Kinetics
* Calculate derivatives for forward rate constants with respect to molar
* concentration at constant temperature, pressure and mole fractions.
* @param dkfwd[out] Output vector of derivatives. Length: nReactions().
*
* @warning This method is an experimental part of the %Cantera API and
* may be changed or removed without notice.
*/
virtual void getFwdRateConstants_ddC(double* dkfwd)
{
Expand Down Expand Up @@ -675,6 +681,9 @@ class Kinetics
* Calculate derivatives for forward rates-of-progress with respect to molar
* concentration at constant temperature, pressure and mole fractions.
* @param drop[out] Output vector of derivatives. Length: nReactions().
*
* @warning This method is an experimental part of the %Cantera API and
* may be changed or removed without notice.
*/
virtual void getFwdRatesOfProgress_ddC(double* drop)
{
Expand All @@ -689,6 +698,9 @@ class Kinetics
* The method returns a matrix with nReactions rows and nTotalSpecies columns.
* For a derivative with respect to \f$X_i$, all other \f$X_j$ are held constant,
* rather than enforcing \f$\sum X_j = 1$.
*
* @warning This method is an experimental part of the %Cantera API and
* may be changed or removed without notice.
*/
virtual Eigen::SparseMatrix<double> fwdRatesOfProgress_ddX()
{
Expand Down Expand Up @@ -722,6 +734,9 @@ class Kinetics
* Calculate derivatives for reverse rates-of-progress with respect to molar
* concentration at constant temperature, pressure and mole fractions.
* @param drop[out] Output vector of derivatives. Length: nReactions().
*
* @warning This method is an experimental part of the %Cantera API and
* may be changed or removed without notice.
*/
virtual void getRevRatesOfProgress_ddC(double* drop)
{
Expand All @@ -736,6 +751,9 @@ class Kinetics
* The method returns a matrix with nReactions rows and nTotalSpecies columns.
* For a derivative with respect to \f$X_i$, all other \f$X_j$ are held constant,
* rather than enforcing \f$\sum X_j = 1$.
*
* @warning This method is an experimental part of the %Cantera API and
* may be changed or removed without notice.
*/
virtual Eigen::SparseMatrix<double> revRatesOfProgress_ddX()
{
Expand Down Expand Up @@ -769,6 +787,9 @@ class Kinetics
* Calculate derivatives for net rates-of-progress with respect to molar
* concentration at constant temperature, pressure and mole fractions.
* @param drop[out] Output vector of derivatives. Length: nReactions().
*
* @warning This method is an experimental part of the %Cantera API and
* may be changed or removed without notice.
*/
virtual void getNetRatesOfProgress_ddC(double* drop)
{
Expand All @@ -783,6 +804,9 @@ class Kinetics
* The method returns a matrix with nReactions rows and nTotalSpecies columns.
* For a derivative with respect to \f$X_i$, all other \f$X_j$ are held constant,
* rather than enforcing \f$\sum X_j = 1$.
*
* @warning This method is an experimental part of the %Cantera API and
* may be changed or removed without notice.
*/
virtual Eigen::SparseMatrix<double> netRatesOfProgress_ddX()
{
Expand All @@ -808,6 +832,9 @@ class Kinetics
* Calculate derivatives for species creation rates with respect to molar
* concentration at constant temperature, pressure and mole fractions.
* @param dwdot[out] Output vector of derivatives. Length: m_kk.
*
* @warning This method is an experimental part of the %Cantera API and
* may be changed or removed without notice.
*/
void getCreationRates_ddC(double* dwdot);

Expand All @@ -818,6 +845,9 @@ class Kinetics
* The method returns a matrix with nTotalSpecies rows and nTotalSpecies columns.
* For a derivative with respect to \f$X_i$, all other \f$X_j$ are held constant,
* rather than enforcing \f$\sum X_j = 1$.
*
* @warning This method is an experimental part of the %Cantera API and
* may be changed or removed without notice.
*/
Eigen::SparseMatrix<double> creationRates_ddX();

Expand All @@ -839,6 +869,9 @@ class Kinetics
* Calculate derivatives for species destruction rates with respect to molar
* concentration at constant temperature, pressure and mole fractions.
* @param dwdot[out] Output vector of derivatives. Length: m_kk.
*
* @warning This method is an experimental part of the %Cantera API and
* may be changed or removed without notice.
*/
void getDestructionRates_ddC(double* dwdot);

Expand All @@ -849,6 +882,9 @@ class Kinetics
* The method returns a matrix with nTotalSpecies rows and nTotalSpecies columns.
* For a derivative with respect to \f$X_i$, all other \f$X_j$ are held constant,
* rather than enforcing \f$\sum X_j = 1$.
*
* @warning This method is an experimental part of the %Cantera API and
* may be changed or removed without notice.
*/
Eigen::SparseMatrix<double> destructionRates_ddX();

Expand All @@ -870,6 +906,9 @@ class Kinetics
* Calculate derivatives for species net production rates with respect to molar
* concentration at constant temperature, pressure and mole fractions.
* @param dwdot[out] Output vector of derivatives. Length: m_kk.
*
* @warning This method is an experimental part of the %Cantera API and
* may be changed or removed without notice.
*/
void getNetProductionRates_ddC(double* dwdot);

Expand All @@ -880,6 +919,9 @@ class Kinetics
* The method returns a matrix with nTotalSpecies rows and nTotalSpecies columns.
* For a derivative with respect to \f$X_i$, all other \f$X_j$ are held constant,
* rather than enforcing \f$\sum X_j = 1$.
*
* @warning This method is an experimental part of the %Cantera API and
* may be changed or removed without notice.
*/
Eigen::SparseMatrix<double> netProductionRates_ddX();

Expand Down
39 changes: 39 additions & 0 deletions interfaces/cython/cantera/kinetics.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,9 @@ cdef class Kinetics(_SolutionBase):
"""
Calculate derivatives for forward rate constants with respect to molar
concentration at constant temperature, pressure and mole fractions.

**Warning:** this property is an experimental part of the Cantera API and
may be changed or removed without notice.
"""
def __get__(self):
return get_reaction_array(self, kin_getFwdRateConstants_ddC)
Expand All @@ -570,6 +573,9 @@ cdef class Kinetics(_SolutionBase):
"""
Calculate derivatives for forward rates-of-progress with respect to molar
concentration at constant temperature, pressure and mole fractions.

**Warning:** this property is an experimental part of the Cantera API and
may be changed or removed without notice.
"""
def __get__(self):
return get_reaction_array(self, kin_getFwdRatesOfProgress_ddC)
Expand All @@ -582,6 +588,9 @@ cdef class Kinetics(_SolutionBase):

Note that for derivatives with respect to :math:`X_i`, all other :math:`X_j`
are held constant, rather than enforcing :math:`\sum X_j = 1`.

**Warning:** this property is an experimental part of the Cantera API and
may be changed or removed without notice.
"""
def __get__(self):
if _USE_SPARSE:
Expand Down Expand Up @@ -610,6 +619,9 @@ cdef class Kinetics(_SolutionBase):
"""
Calculate derivatives for reverse rates-of-progress with respect to molar
concentration at constant temperature, pressure and mole fractions.

**Warning:** this property is an experimental part of the Cantera API and
may be changed or removed without notice.
"""
def __get__(self):
return get_reaction_array(self, kin_getRevRatesOfProgress_ddC)
Expand All @@ -622,6 +634,9 @@ cdef class Kinetics(_SolutionBase):

Note that for derivatives with respect to :math:`X_i`, all other :math:`X_j`
are held constant, rather than enforcing :math:`\sum X_j = 1`.

**Warning:** this property is an experimental part of the Cantera API and
may be changed or removed without notice.
"""
def __get__(self):
if _USE_SPARSE:
Expand Down Expand Up @@ -650,6 +665,9 @@ cdef class Kinetics(_SolutionBase):
"""
Calculate derivatives for net rates-of-progress with respect to molar
concentration at constant temperature, pressure and mole fractions.

**Warning:** this property is an experimental part of the Cantera API and
may be changed or removed without notice.
"""
def __get__(self):
return get_reaction_array(self, kin_getNetRatesOfProgress_ddC)
Expand All @@ -662,6 +680,9 @@ cdef class Kinetics(_SolutionBase):

Note that for derivatives with respect to :math:`X_i`, all other :math:`X_j`
are held constant, rather than enforcing :math:`\sum X_j = 1`.

**Warning:** this property is an experimental part of the Cantera API and
may be changed or removed without notice.
"""
def __get__(self):
if _USE_SPARSE:
Expand Down Expand Up @@ -690,6 +711,9 @@ cdef class Kinetics(_SolutionBase):
"""
Calculate derivatives of species creation rates with respect to molar
concentration at constant temperature, pressure and mole fractions.

**Warning:** this property is an experimental part of the Cantera API and
may be changed or removed without notice.
"""
def __get__(self):
return get_species_array(self, kin_getCreationRates_ddC)
Expand All @@ -702,6 +726,9 @@ cdef class Kinetics(_SolutionBase):

Note that for derivatives with respect to :math:`X_i`, all other :math:`X_j`
are held constant, rather than enforcing :math:`\sum X_j = 1`.

**Warning:** this property is an experimental part of the Cantera API and
may be changed or removed without notice.
"""
def __get__(self):
if _USE_SPARSE:
Expand Down Expand Up @@ -730,6 +757,9 @@ cdef class Kinetics(_SolutionBase):
"""
Calculate derivatives of species destruction rates with respect to molar
concentration at constant temperature, pressure and mole fractions.

**Warning:** this property is an experimental part of the Cantera API and
may be changed or removed without notice.
"""
def __get__(self):
return get_species_array(self, kin_getDestructionRates_ddC)
Expand All @@ -742,6 +772,9 @@ cdef class Kinetics(_SolutionBase):

Note that for derivatives with respect to :math:`X_i`, all other :math:`X_j`
are held constant, rather than enforcing :math:`\sum X_j = 1`.

**Warning:** this property is an experimental part of the Cantera API and
may be changed or removed without notice.
"""
def __get__(self):
if _USE_SPARSE:
Expand Down Expand Up @@ -770,6 +803,9 @@ cdef class Kinetics(_SolutionBase):
"""
Calculate derivatives of species net production rates with respect to molar
density at constant temperature, pressure and mole fractions.

**Warning:** this property is an experimental part of the Cantera API and
may be changed or removed without notice.
"""
def __get__(self):
return get_species_array(self, kin_getNetProductionRates_ddC)
Expand All @@ -782,6 +818,9 @@ cdef class Kinetics(_SolutionBase):

Note that for derivatives with respect to :math:`X_i`, all other :math:`X_j`
are held constant, rather than enforcing :math:`\sum X_j = 1`.

**Warning:** this property is an experimental part of the Cantera API and
may be changed or removed without notice.
"""
def __get__(self):
if _USE_SPARSE:
Expand Down