[Kinetics] simplify naming of CustomPyRate

This commit is contained in:
Ingmar Schoegl
2021-02-26 23:04:07 -06:00
committed by Ray Speth
parent 6d8a900a31
commit 8f2d1813f5
6 changed files with 16 additions and 16 deletions

View File

@@ -244,13 +244,13 @@ class CustomPyReaction : public Reaction
public:
CustomPyReaction();
CustomPyReaction(const Composition& reactants, const Composition& products,
const CustomPyRxnRate& rate);
const CustomPyRate& rate);
virtual std::string type() const {
return "custom-Python";
}
CustomPyRxnRate rate;
CustomPyRate rate;
};
//! Modifications to an InterfaceReaction rate based on a surface species

View File

@@ -438,11 +438,11 @@ protected:
* @warning This class is an experimental part of the %Cantera API and
* may be changed or removed without notice.
*/
class CustomPyRxnRate
class CustomPyRate
{
public:
//! Constructor.
CustomPyRxnRate();
CustomPyRate();
// set custom rate
/**

View File

@@ -312,8 +312,8 @@ cdef extern from "cantera/kinetics/Reaction.h" namespace "Cantera":
double temperatureExponent()
double activationEnergy_R()
cdef cppclass CxxCustomPyRxnRate "Cantera::CustomPyRxnRate":
CxxCustomPyRxnRate()
cdef cppclass CxxCustomPyRate "Cantera::CustomPyRate":
CxxCustomPyRate()
void setRateFunction(CxxFunc1*) except +translate_exception
double updateRC(double, double)
@@ -401,7 +401,7 @@ cdef extern from "cantera/kinetics/Reaction.h" namespace "Cantera":
cdef cppclass CxxCustomPyReaction "Cantera::CustomPyReaction" (CxxReaction):
CxxCustomPyReaction()
CxxCustomPyRxnRate rate
CxxCustomPyRate rate
cdef cppclass CxxCoverageDependency "Cantera::CoverageDependency":
CxxCoverageDependency(double, double, double)
@@ -1026,7 +1026,7 @@ cdef class Arrhenius:
cdef Reaction reaction # parent reaction, to prevent garbage collection
cdef class CustomRate:
cdef CxxCustomPyRxnRate* rate
cdef CxxCustomPyRate* rate
cdef Func1 _rate_func
cdef Reaction reaction # parent reaction, to prevent garbage collection

View File

@@ -418,7 +418,7 @@ cdef class CustomRate:
def __cinit__(self, k=None, init=True):
if init:
self.rate = new CxxCustomPyRxnRate()
self.rate = new CxxCustomPyRate()
self.reaction = None
self._rate_func = None
self.set_rate_function(k)
@@ -455,7 +455,7 @@ cdef class CustomRate:
return self.rate.updateRC(logT, recipT)
cdef wrapCustomRate(CxxCustomPyRxnRate* rate, Reaction reaction):
cdef wrapCustomRate(CxxCustomPyRate* rate, Reaction reaction):
r = CustomRate(init=False)
r.rate = rate
r.reaction = reaction

View File

@@ -267,7 +267,7 @@ CustomPyReaction::CustomPyReaction()
CustomPyReaction::CustomPyReaction(const Composition& reactants_,
const Composition& products_,
const CustomPyRxnRate& rate_)
const CustomPyRate& rate_)
: Reaction(CUSTOMPY_RXN, reactants_, products_)
, rate(rate_)
{
@@ -820,7 +820,7 @@ void setupCustomPyReaction(CustomPyReaction& R, const AnyMap& node,
const Kinetics& kin)
{
setupReaction(R, node, kin);
R.rate = CustomPyRxnRate();
R.rate = CustomPyRate();
}
void setupInterfaceReaction(InterfaceReaction& R, const XML_Node& rxn_node)

View File

@@ -159,20 +159,20 @@ ChebyshevRate::ChebyshevRate(double Tmin, double Tmax, double Pmin, double Pmax,
}
}
CustomPyRxnRate::CustomPyRxnRate() : m_ratefunc(0) {}
CustomPyRate::CustomPyRate() : m_ratefunc(0) {}
void CustomPyRxnRate::setRateFunction(Func1* f) {
void CustomPyRate::setRateFunction(Func1* f) {
m_ratefunc = f;
}
double CustomPyRxnRate::updateLog(double logT, double recipT) const {
double CustomPyRate::updateLog(double logT, double recipT) const {
if (m_ratefunc) {
return std::log( m_ratefunc->eval(1./recipT) );
}
return 1.;
}
double CustomPyRxnRate::updateRC(double logT, double recipT) const {
double CustomPyRate::updateRC(double logT, double recipT) const {
if (m_ratefunc) {
return m_ratefunc->eval(1./recipT);
}