solaris port
std:: additions
This commit is contained in:
parent
10609920f7
commit
f7eedd6855
7 changed files with 104 additions and 104 deletions
|
|
@ -32,7 +32,7 @@ namespace Cantera {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for 'functor' classes that evaluate a function of
|
* Base class for 'functor' classes that evaluate a function of
|
||||||
* one variable.
|
* one variable.
|
||||||
*/
|
*/
|
||||||
class Func1 {
|
class Func1 {
|
||||||
public:
|
public:
|
||||||
|
|
@ -47,26 +47,26 @@ namespace Cantera {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Gaussian.
|
* A Gaussian.
|
||||||
* \f[
|
* \f[
|
||||||
* f(t) = A e^{-[(t - t_0)/\tau]^2}
|
* f(t) = A e^{-[(t - t_0)/\tau]^2}
|
||||||
* \f]
|
* \f]
|
||||||
* where \f[ \tau = \frac{fwhm}{2\sqrt{\ln 2}} \f]
|
* where \f[ \tau = \frac{fwhm}{2\sqrt{\ln 2}} \f]
|
||||||
* @param A peak value
|
* @param A peak value
|
||||||
* @param t0 offset
|
* @param t0 offset
|
||||||
* @param fwhm full width at half max
|
* @param fwhm full width at half max
|
||||||
*/
|
*/
|
||||||
class Gaussian : public Func1 {
|
class Gaussian : public Func1 {
|
||||||
public:
|
public:
|
||||||
Gaussian(double A, double t0, double fwhm) {
|
Gaussian(double A, double t0, double fwhm) {
|
||||||
m_A = A;
|
m_A = A;
|
||||||
m_t0 = t0;
|
m_t0 = t0;
|
||||||
m_tau = fwhm/(2.0*sqrt(log(2.0)));
|
m_tau = fwhm/(2.0*std::sqrt(std::log(2.0)));
|
||||||
}
|
}
|
||||||
virtual ~Gaussian() {}
|
virtual ~Gaussian() {}
|
||||||
virtual doublereal eval(doublereal t) {
|
virtual doublereal eval(doublereal t) {
|
||||||
doublereal x = (t - m_t0)/m_tau;
|
doublereal x = (t - m_t0)/m_tau;
|
||||||
return m_A*exp(-x*x);
|
return m_A*std::exp(-x*x);
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
doublereal m_A, m_t0, m_tau;
|
doublereal m_A, m_t0, m_tau;
|
||||||
|
|
@ -75,14 +75,14 @@ namespace Cantera {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Polynomial of degree n.
|
* Polynomial of degree n.
|
||||||
*/
|
*/
|
||||||
class Poly1 : public Func1 {
|
class Poly1 : public Func1 {
|
||||||
public:
|
public:
|
||||||
Poly1(int n, doublereal* c) {
|
Poly1(int n, doublereal* c) {
|
||||||
m_n = n+1;
|
m_n = n+1;
|
||||||
m_c.resize(n+1);
|
m_c.resize(n+1);
|
||||||
copy(c, c+m_n, m_c.begin());
|
std::copy(c, c+m_n, m_c.begin());
|
||||||
}
|
}
|
||||||
virtual ~Poly1() {}
|
virtual ~Poly1() {}
|
||||||
|
|
||||||
|
|
@ -104,23 +104,23 @@ namespace Cantera {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fourier cosine/sine series.
|
* Fourier cosine/sine series.
|
||||||
*
|
*
|
||||||
* \f[
|
* \f[
|
||||||
* f(t) = \frac{A_0}{2} +
|
* f(t) = \frac{A_0}{2} +
|
||||||
* \sum_{n=1}^N A_n \cos (n \omega t) + B_n \sin (n \omega t)
|
* \sum_{n=1}^N A_n \cos (n \omega t) + B_n \sin (n \omega t)
|
||||||
* \f]
|
* \f]
|
||||||
*/
|
*/
|
||||||
class Fourier1 : public Func1 {
|
class Fourier1 : public Func1 {
|
||||||
public:
|
public:
|
||||||
Fourier1(int n, doublereal omega, doublereal a0,
|
Fourier1(int n, doublereal omega, doublereal a0,
|
||||||
doublereal* a, doublereal* b) {
|
doublereal* a, doublereal* b) {
|
||||||
m_n = n;
|
m_n = n;
|
||||||
m_omega = omega;
|
m_omega = omega;
|
||||||
m_a0_2 = 0.5*a0;
|
m_a0_2 = 0.5*a0;
|
||||||
m_ccos.resize(n);
|
m_ccos.resize(n);
|
||||||
m_csin.resize(n);
|
m_csin.resize(n);
|
||||||
copy(a, a+n, m_ccos.begin());
|
std::copy(a, a+n, m_ccos.begin());
|
||||||
copy(b, b+n, m_csin.begin());
|
std::copy(b, b+n, m_csin.begin());
|
||||||
}
|
}
|
||||||
virtual ~Fourier1() {}
|
virtual ~Fourier1() {}
|
||||||
|
|
||||||
|
|
@ -129,8 +129,8 @@ namespace Cantera {
|
||||||
doublereal sum = m_a0_2;
|
doublereal sum = m_a0_2;
|
||||||
for (n = 0; n < m_n; n++) {
|
for (n = 0; n < m_n; n++) {
|
||||||
nn = n + 1;
|
nn = n + 1;
|
||||||
sum += m_ccos[n]*cos(m_omega*nn*t)
|
sum += m_ccos[n]*std::cos(m_omega*nn*t)
|
||||||
+ m_csin[n]*sin(m_omega*nn*t);
|
+ m_csin[n]*std::sin(m_omega*nn*t);
|
||||||
}
|
}
|
||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
|
@ -169,7 +169,7 @@ namespace Cantera {
|
||||||
int n;
|
int n;
|
||||||
doublereal sum = 0.0;
|
doublereal sum = 0.0;
|
||||||
for (n = 0; n < m_n; n++) {
|
for (n = 0; n < m_n; n++) {
|
||||||
sum += m_A[n]*pow(t,m_b[n])*exp(-m_E[n]/t);
|
sum += m_A[n]*std::pow(t,m_b[n])*std::exp(-m_E[n]/t);
|
||||||
}
|
}
|
||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
|
@ -201,7 +201,7 @@ namespace Cantera {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sum of two functions.
|
* Sum of two functions.
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ namespace Cantera {
|
||||||
m_logp_ref(0.0),
|
m_logp_ref(0.0),
|
||||||
m_logc_ref(0.0),
|
m_logc_ref(0.0),
|
||||||
m_logStandConc(0.0),
|
m_logStandConc(0.0),
|
||||||
m_ROP_ok(false),
|
m_ROP_ok(false),
|
||||||
m_temp(0.0)
|
m_temp(0.0)
|
||||||
{}
|
{}
|
||||||
virtual ~GasKineticsData(){}
|
virtual ~GasKineticsData(){}
|
||||||
|
|
@ -107,9 +107,9 @@ namespace Cantera {
|
||||||
* must be dimensioned at least as large as the total number
|
* must be dimensioned at least as large as the total number
|
||||||
* of reactions.
|
* of reactions.
|
||||||
*/
|
*/
|
||||||
virtual void getFwdRatesOfProgress(doublereal* fwdROP) {
|
virtual void getFwdRatesOfProgress(doublereal* fwdROP) {
|
||||||
updateROP();
|
updateROP();
|
||||||
copy(m_kdata->m_ropf.begin(), m_kdata->m_ropf.end(), fwdROP);
|
std::copy(m_kdata->m_ropf.begin(), m_kdata->m_ropf.end(), fwdROP);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Reverse rates of progress.
|
* Reverse rates of progress.
|
||||||
|
|
@ -117,9 +117,9 @@ namespace Cantera {
|
||||||
* must be dimensioned at least as large as the total number
|
* must be dimensioned at least as large as the total number
|
||||||
* of reactions.
|
* of reactions.
|
||||||
*/
|
*/
|
||||||
virtual void getRevRatesOfProgress(doublereal* revROP) {
|
virtual void getRevRatesOfProgress(doublereal* revROP) {
|
||||||
updateROP();
|
updateROP();
|
||||||
copy(m_kdata->m_ropr.begin(), m_kdata->m_ropr.end(), revROP);
|
std::copy(m_kdata->m_ropr.begin(), m_kdata->m_ropr.end(), revROP);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Net rates of progress. Return the net (forward - reverse)
|
* Net rates of progress. Return the net (forward - reverse)
|
||||||
|
|
@ -127,9 +127,9 @@ namespace Cantera {
|
||||||
* dimensioned at least as large as the total number of
|
* dimensioned at least as large as the total number of
|
||||||
* reactions.
|
* reactions.
|
||||||
*/
|
*/
|
||||||
virtual void getNetRatesOfProgress(doublereal* netROP) {
|
virtual void getNetRatesOfProgress(doublereal* netROP) {
|
||||||
updateROP();
|
updateROP();
|
||||||
copy(m_kdata->m_ropnet.begin(), m_kdata->m_ropnet.end(), netROP);
|
std::copy(m_kdata->m_ropnet.begin(), m_kdata->m_ropnet.end(), netROP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -138,7 +138,7 @@ namespace Cantera {
|
||||||
* the reactions in concentration units in array kc, which
|
* the reactions in concentration units in array kc, which
|
||||||
* must be dimensioned at least as large as the total number
|
* must be dimensioned at least as large as the total number
|
||||||
* of reactions.
|
* of reactions.
|
||||||
*/
|
*/
|
||||||
virtual void getEquilibriumConstants(doublereal* kc);
|
virtual void getEquilibriumConstants(doublereal* kc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -172,7 +172,7 @@ namespace Cantera {
|
||||||
virtual void getDeltaEntropy(doublereal* deltaS);
|
virtual void getDeltaEntropy(doublereal* deltaS);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the vector of values for the reaction
|
* Return the vector of values for the reaction
|
||||||
* standard state gibbs free energy change.
|
* standard state gibbs free energy change.
|
||||||
* These values don't depend upon the concentration
|
* These values don't depend upon the concentration
|
||||||
* of the solution.
|
* of the solution.
|
||||||
|
|
@ -212,40 +212,40 @@ namespace Cantera {
|
||||||
* net production rates (creation - destruction) in array
|
* net production rates (creation - destruction) in array
|
||||||
* wdot, which must be dimensioned at least as large as the
|
* wdot, which must be dimensioned at least as large as the
|
||||||
* total number of species.
|
* total number of species.
|
||||||
*/
|
*/
|
||||||
virtual void getNetProductionRates(doublereal* net) {
|
virtual void getNetProductionRates(doublereal* net) {
|
||||||
updateROP();
|
updateROP();
|
||||||
#ifdef HWMECH
|
#ifdef HWMECH
|
||||||
get_wdot(&m_kdata->m_ropnet[0], net);
|
get_wdot(&m_kdata->m_ropnet[0], net);
|
||||||
#else
|
#else
|
||||||
m_rxnstoich->getNetProductionRates(m_kk, &m_kdata->m_ropnet[0], net);
|
m_rxnstoich->getNetProductionRates(m_kk, &m_kdata->m_ropnet[0], net);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Species creation rates [kmol/m^3]. Return the species
|
* Species creation rates [kmol/m^3]. Return the species
|
||||||
* creation rates in array cdot, which must be
|
* creation rates in array cdot, which must be
|
||||||
* dimensioned at least as large as the total number of
|
* dimensioned at least as large as the total number of
|
||||||
* species.
|
* species.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
virtual void getCreationRates(doublereal* cdot) {
|
virtual void getCreationRates(doublereal* cdot) {
|
||||||
updateROP();
|
updateROP();
|
||||||
m_rxnstoich->getCreationRates(m_kk, &m_kdata->m_ropf[0],
|
m_rxnstoich->getCreationRates(m_kk, &m_kdata->m_ropf[0],
|
||||||
&m_kdata->m_ropr[0], cdot);
|
&m_kdata->m_ropr[0], cdot);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Species destruction rates [kmol/m^3]. Return the species
|
* Species destruction rates [kmol/m^3]. Return the species
|
||||||
* destruction rates in array ddot, which must be
|
* destruction rates in array ddot, which must be
|
||||||
* dimensioned at least as large as the total number of
|
* dimensioned at least as large as the total number of
|
||||||
* species.
|
* species.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
virtual void getDestructionRates(doublereal* ddot) {
|
virtual void getDestructionRates(doublereal* ddot) {
|
||||||
updateROP();
|
updateROP();
|
||||||
m_rxnstoich->getDestructionRates(m_kk, &m_kdata->m_ropf[0],
|
m_rxnstoich->getDestructionRates(m_kk, &m_kdata->m_ropf[0],
|
||||||
&m_kdata->m_ropr[0], ddot);
|
&m_kdata->m_ropr[0], ddot);
|
||||||
// fill(ddot, ddot + m_kk, 0.0);
|
// fill(ddot, ddot + m_kk, 0.0);
|
||||||
//m_revProductStoich.incrementSpecies(
|
//m_revProductStoich.incrementSpecies(
|
||||||
// m_kdata->m_ropr.begin(), ddot);
|
// m_kdata->m_ropr.begin(), ddot);
|
||||||
|
|
@ -278,7 +278,7 @@ namespace Cantera {
|
||||||
* for reaction i is always zero.
|
* for reaction i is always zero.
|
||||||
*/
|
*/
|
||||||
virtual bool isReversible(int i) {
|
virtual bool isReversible(int i) {
|
||||||
if (find(m_revindex.begin(), m_revindex.end(), i)
|
if (std::find(m_revindex.begin(), m_revindex.end(), i)
|
||||||
< m_revindex.end()) return true;
|
< m_revindex.end()) return true;
|
||||||
else return false;
|
else return false;
|
||||||
}
|
}
|
||||||
|
|
@ -299,7 +299,7 @@ namespace Cantera {
|
||||||
* for irreversible reactions if the default for
|
* for irreversible reactions if the default for
|
||||||
* doIrreversible is overridden.
|
* doIrreversible is overridden.
|
||||||
*/
|
*/
|
||||||
virtual void getRevRateConstants(doublereal *krev,
|
virtual void getRevRateConstants(doublereal *krev,
|
||||||
bool doIrreversible = false);
|
bool doIrreversible = false);
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
@ -319,7 +319,7 @@ namespace Cantera {
|
||||||
|
|
||||||
virtual void init();
|
virtual void init();
|
||||||
|
|
||||||
/// Add a reaction to the mechanism.
|
/// Add a reaction to the mechanism.
|
||||||
void addReaction(const ReactionData& r);
|
void addReaction(const ReactionData& r);
|
||||||
|
|
||||||
virtual void finalize();
|
virtual void finalize();
|
||||||
|
|
@ -350,16 +350,16 @@ namespace Cantera {
|
||||||
doublereal m_dt_threshold;
|
doublereal m_dt_threshold;
|
||||||
|
|
||||||
Rate1<Arrhenius> m_falloff_low_rates;
|
Rate1<Arrhenius> m_falloff_low_rates;
|
||||||
Rate1<Arrhenius> m_falloff_high_rates;
|
Rate1<Arrhenius> m_falloff_high_rates;
|
||||||
Rate1<Arrhenius> m_rates;
|
Rate1<Arrhenius> m_rates;
|
||||||
|
|
||||||
mutable std::map<int, std::pair<int, int> > m_index;
|
mutable std::map<int, std::pair<int, int> > m_index;
|
||||||
|
|
||||||
FalloffMgr m_falloffn;
|
FalloffMgr m_falloffn;
|
||||||
|
|
||||||
ThirdBodyMgr<Enhanced3BConc> m_3b_concm;
|
ThirdBodyMgr<Enhanced3BConc> m_3b_concm;
|
||||||
ThirdBodyMgr<Enhanced3BConc> m_falloff_concm;
|
ThirdBodyMgr<Enhanced3BConc> m_falloff_concm;
|
||||||
|
|
||||||
std::vector<int> m_irrev;
|
std::vector<int> m_irrev;
|
||||||
|
|
||||||
ReactionStoichMgr* m_rxnstoich;
|
ReactionStoichMgr* m_rxnstoich;
|
||||||
|
|
@ -403,8 +403,8 @@ namespace Cantera {
|
||||||
void addElementaryReaction(const ReactionData& r);
|
void addElementaryReaction(const ReactionData& r);
|
||||||
void addThreeBodyReaction(const ReactionData& r);
|
void addThreeBodyReaction(const ReactionData& r);
|
||||||
void addFalloffReaction(const ReactionData& r);
|
void addFalloffReaction(const ReactionData& r);
|
||||||
|
|
||||||
void installReagents(const ReactionData& r);
|
void installReagents(const ReactionData& r);
|
||||||
|
|
||||||
void installGroups(int irxn, const std::vector<grouplist_t>& r,
|
void installGroups(int irxn, const std::vector<grouplist_t>& r,
|
||||||
const std::vector<grouplist_t>& p);
|
const std::vector<grouplist_t>& p);
|
||||||
|
|
|
||||||
|
|
@ -36,12 +36,12 @@ namespace Cantera {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds mechanism-specific data.
|
* Holds mechanism-specific data.
|
||||||
*/
|
*/
|
||||||
class InterfaceKineticsData {
|
class InterfaceKineticsData {
|
||||||
public:
|
public:
|
||||||
InterfaceKineticsData() :
|
InterfaceKineticsData() :
|
||||||
m_ROP_ok(false),
|
m_ROP_ok(false),
|
||||||
m_temp(0.0), m_logtemp(0.0)
|
m_temp(0.0), m_logtemp(0.0)
|
||||||
{}
|
{}
|
||||||
virtual ~InterfaceKineticsData(){}
|
virtual ~InterfaceKineticsData(){}
|
||||||
|
|
@ -67,7 +67,7 @@ namespace Cantera {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param thermo The optional parameter may be used to initialize
|
* @param thermo The optional parameter may be used to initialize
|
||||||
* the object with one ThermoPhase object.
|
* the object with one ThermoPhase object.
|
||||||
|
|
@ -88,22 +88,22 @@ namespace Cantera {
|
||||||
///
|
///
|
||||||
/// @name Reaction Rates Of Progress
|
/// @name Reaction Rates Of Progress
|
||||||
///
|
///
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
|
|
||||||
virtual void getFwdRatesOfProgress(doublereal* fwdROP) {
|
virtual void getFwdRatesOfProgress(doublereal* fwdROP) {
|
||||||
updateROP();
|
updateROP();
|
||||||
copy(m_kdata->m_ropf.begin(), m_kdata->m_ropf.end(), fwdROP);
|
std::copy(m_kdata->m_ropf.begin(), m_kdata->m_ropf.end(), fwdROP);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void getRevRatesOfProgress(doublereal* revROP) {
|
virtual void getRevRatesOfProgress(doublereal* revROP) {
|
||||||
updateROP();
|
updateROP();
|
||||||
copy(m_kdata->m_ropr.begin(), m_kdata->m_ropr.end(), revROP);
|
std::copy(m_kdata->m_ropr.begin(), m_kdata->m_ropr.end(), revROP);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void getNetRatesOfProgress(doublereal* netROP) {
|
virtual void getNetRatesOfProgress(doublereal* netROP) {
|
||||||
updateROP();
|
updateROP();
|
||||||
copy(m_kdata->m_ropnet.begin(), m_kdata->m_ropnet.end(), netROP);
|
std::copy(m_kdata->m_ropnet.begin(), m_kdata->m_ropnet.end(), netROP);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void getEquilibriumConstants(doublereal* kc);
|
virtual void getEquilibriumConstants(doublereal* kc);
|
||||||
|
|
@ -132,7 +132,7 @@ namespace Cantera {
|
||||||
virtual void getDeltaEntropy(doublereal* deltaS);
|
virtual void getDeltaEntropy(doublereal* deltaS);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the vector of values for the reaction
|
* Return the vector of values for the reaction
|
||||||
* standard state gibbs free energy change.
|
* standard state gibbs free energy change.
|
||||||
* These values don't depend upon the concentration
|
* These values don't depend upon the concentration
|
||||||
* of the solution.
|
* of the solution.
|
||||||
|
|
@ -169,31 +169,31 @@ namespace Cantera {
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Species creation rates [kmol/m^2/s]. Return the species
|
* Species creation rates [kmol/m^2/s]. Return the species
|
||||||
* creation rates in array cdot, which must be
|
* creation rates in array cdot, which must be
|
||||||
* dimensioned at least as large as the total number of
|
* dimensioned at least as large as the total number of
|
||||||
* species in all phases of the kinetics
|
* species in all phases of the kinetics
|
||||||
* model
|
* model
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
virtual void getCreationRates(doublereal* cdot) {
|
virtual void getCreationRates(doublereal* cdot) {
|
||||||
updateROP();
|
updateROP();
|
||||||
m_rxnstoich.getCreationRates(m_kk, &m_kdata->m_ropf[0],
|
m_rxnstoich.getCreationRates(m_kk, &m_kdata->m_ropf[0],
|
||||||
&m_kdata->m_ropr[0], cdot);
|
&m_kdata->m_ropr[0], cdot);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Species destruction rates [kmol/m^2/s]. Return the species
|
* Species destruction rates [kmol/m^2/s]. Return the species
|
||||||
* destruction rates in array ddot, which must be
|
* destruction rates in array ddot, which must be
|
||||||
* dimensioned at least as large as the total number of
|
* dimensioned at least as large as the total number of
|
||||||
* species in all phases of the kinetics
|
* species in all phases of the kinetics
|
||||||
* model
|
* model
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
virtual void getDestructionRates(doublereal* ddot) {
|
virtual void getDestructionRates(doublereal* ddot) {
|
||||||
updateROP();
|
updateROP();
|
||||||
m_rxnstoich.getDestructionRates(m_kk, &m_kdata->m_ropf[0],
|
m_rxnstoich.getDestructionRates(m_kk, &m_kdata->m_ropf[0],
|
||||||
&m_kdata->m_ropr[0], ddot);
|
&m_kdata->m_ropr[0], ddot);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -202,12 +202,12 @@ namespace Cantera {
|
||||||
* wdot, which must be dimensioned at least as large as the
|
* wdot, which must be dimensioned at least as large as the
|
||||||
* total number of species in all phases of the kinetics
|
* total number of species in all phases of the kinetics
|
||||||
* model
|
* model
|
||||||
*/
|
*/
|
||||||
virtual void getNetProductionRates(doublereal* net) {
|
virtual void getNetProductionRates(doublereal* net) {
|
||||||
updateROP();
|
updateROP();
|
||||||
m_rxnstoich.getNetProductionRates(m_kk,
|
m_rxnstoich.getNetProductionRates(m_kk,
|
||||||
&m_kdata->m_ropnet[0],
|
&m_kdata->m_ropnet[0],
|
||||||
net);
|
net);
|
||||||
}
|
}
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
@ -218,7 +218,7 @@ namespace Cantera {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stoichiometric coefficient of species k as a reactant in
|
* Stoichiometric coefficient of species k as a reactant in
|
||||||
* reaction i.
|
* reaction i.
|
||||||
*/
|
*/
|
||||||
virtual doublereal reactantStoichCoeff(int k, int i) const {
|
virtual doublereal reactantStoichCoeff(int k, int i) const {
|
||||||
return m_rrxn[k][i];
|
return m_rrxn[k][i];
|
||||||
|
|
@ -226,7 +226,7 @@ namespace Cantera {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stoichiometric coefficient of species k as a product in
|
* Stoichiometric coefficient of species k as a product in
|
||||||
* reaction i.
|
* reaction i.
|
||||||
*/
|
*/
|
||||||
virtual doublereal productStoichCoeff(int k, int i) const {
|
virtual doublereal productStoichCoeff(int k, int i) const {
|
||||||
return m_prxn[k][i];
|
return m_prxn[k][i];
|
||||||
|
|
@ -247,7 +247,7 @@ namespace Cantera {
|
||||||
* for reaction i is always zero.
|
* for reaction i is always zero.
|
||||||
*/
|
*/
|
||||||
virtual bool isReversible(int i) {
|
virtual bool isReversible(int i) {
|
||||||
if (find(m_revindex.begin(), m_revindex.end(), i)
|
if (std::find(m_revindex.begin(), m_revindex.end(), i)
|
||||||
< m_revindex.end()) return true;
|
< m_revindex.end()) return true;
|
||||||
else return false;
|
else return false;
|
||||||
}
|
}
|
||||||
|
|
@ -261,7 +261,7 @@ namespace Cantera {
|
||||||
|
|
||||||
|
|
||||||
virtual void getFwdRateConstants(doublereal* kfwd);
|
virtual void getFwdRateConstants(doublereal* kfwd);
|
||||||
virtual void getRevRateConstants(doublereal* krev,
|
virtual void getRevRateConstants(doublereal* krev,
|
||||||
bool doIrreversible = false);
|
bool doIrreversible = false);
|
||||||
virtual void getActivationEnergies(doublereal *E);
|
virtual void getActivationEnergies(doublereal *E);
|
||||||
|
|
||||||
|
|
@ -277,7 +277,7 @@ namespace Cantera {
|
||||||
* any reactions are actually added to the mechanism.
|
* any reactions are actually added to the mechanism.
|
||||||
* This function calculates m_kk the number of species in all
|
* This function calculates m_kk the number of species in all
|
||||||
* phases participating in the reaction mechanism. We don't know
|
* phases participating in the reaction mechanism. We don't know
|
||||||
* m_kk previously, before all phases have been added.
|
* m_kk previously, before all phases have been added.
|
||||||
*/
|
*/
|
||||||
virtual void init();
|
virtual void init();
|
||||||
|
|
||||||
|
|
@ -289,7 +289,7 @@ namespace Cantera {
|
||||||
/**
|
/**
|
||||||
* Finish adding reactions and prepare for use. This function
|
* Finish adding reactions and prepare for use. This function
|
||||||
* must be called after all reactions are entered into the mechanism
|
* must be called after all reactions are entered into the mechanism
|
||||||
* and before the mechanism is used to calculate reaction rates.
|
* and before the mechanism is used to calculate reaction rates.
|
||||||
*/
|
*/
|
||||||
virtual void finalize();
|
virtual void finalize();
|
||||||
virtual bool ready() const;
|
virtual bool ready() const;
|
||||||
|
|
@ -320,7 +320,7 @@ namespace Cantera {
|
||||||
int m_kk;
|
int m_kk;
|
||||||
vector_int m_revindex;
|
vector_int m_revindex;
|
||||||
|
|
||||||
Rate1<SurfaceArrhenius> m_rates;
|
Rate1<SurfaceArrhenius> m_rates;
|
||||||
bool m_redo_rates;
|
bool m_redo_rates;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -348,7 +348,7 @@ namespace Cantera {
|
||||||
/**
|
/**
|
||||||
* m_rrxn is a vector of maps. m_rrxn has a length
|
* m_rrxn is a vector of maps. m_rrxn has a length
|
||||||
* equal to the total number of species in the kinetics
|
* equal to the total number of species in the kinetics
|
||||||
* object. For each species, there exists a map, with the
|
* object. For each species, there exists a map, with the
|
||||||
* reaction number being the key, and the
|
* reaction number being the key, and the
|
||||||
* reactant stoichiometric coefficient being the value.
|
* reactant stoichiometric coefficient being the value.
|
||||||
* HKM -> mutable because search sometimes creates extra
|
* HKM -> mutable because search sometimes creates extra
|
||||||
|
|
@ -359,7 +359,7 @@ namespace Cantera {
|
||||||
/**
|
/**
|
||||||
* m_rrxn is a vector of maps. m_rrxn has a length
|
* m_rrxn is a vector of maps. m_rrxn has a length
|
||||||
* equal to the total number of species in the kinetics
|
* equal to the total number of species in the kinetics
|
||||||
* object. For each species, there exists a map, with the
|
* object. For each species, there exists a map, with the
|
||||||
* reaction number being the key, and the
|
* reaction number being the key, and the
|
||||||
* product stoichiometric coefficient being the value.
|
* product stoichiometric coefficient being the value.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ namespace Cantera {
|
||||||
m_Pref (pref),
|
m_Pref (pref),
|
||||||
m_index (n) {
|
m_index (n) {
|
||||||
m_coeff.resize(7);
|
m_coeff.resize(7);
|
||||||
copy(coeffs, coeffs + 7, m_coeff.begin());
|
std::copy(coeffs, coeffs + 7, m_coeff.begin());
|
||||||
}
|
}
|
||||||
|
|
||||||
ShomatePoly(const ShomatePoly& b) :
|
ShomatePoly(const ShomatePoly& b) :
|
||||||
|
|
@ -58,7 +58,7 @@ namespace Cantera {
|
||||||
m_Pref (b.m_Pref),
|
m_Pref (b.m_Pref),
|
||||||
m_coeff (array_fp(7)),
|
m_coeff (array_fp(7)),
|
||||||
m_index (b.m_index) {
|
m_index (b.m_index) {
|
||||||
copy(b.m_coeff.begin(),
|
std::copy(b.m_coeff.begin(),
|
||||||
b.m_coeff.begin() + 7,
|
b.m_coeff.begin() + 7,
|
||||||
m_coeff.begin());
|
m_coeff.begin());
|
||||||
}
|
}
|
||||||
|
|
@ -69,7 +69,7 @@ namespace Cantera {
|
||||||
m_highT = b.m_highT;
|
m_highT = b.m_highT;
|
||||||
m_Pref = b.m_Pref;
|
m_Pref = b.m_Pref;
|
||||||
m_index = b.m_index;
|
m_index = b.m_index;
|
||||||
copy(b.m_coeff.begin(),
|
std::copy(b.m_coeff.begin(),
|
||||||
b.m_coeff.begin() + 7,
|
b.m_coeff.begin() + 7,
|
||||||
m_coeff.begin());
|
m_coeff.begin());
|
||||||
}
|
}
|
||||||
|
|
@ -148,7 +148,7 @@ namespace Cantera {
|
||||||
tPoly[1] = tt * tt;
|
tPoly[1] = tt * tt;
|
||||||
tPoly[2] = tPoly[1] * tt;
|
tPoly[2] = tPoly[1] * tt;
|
||||||
tPoly[3] = 1.0/tPoly[1];
|
tPoly[3] = 1.0/tPoly[1];
|
||||||
tPoly[4] = log(tt);
|
tPoly[4] = std::log(tt);
|
||||||
tPoly[5] = 1.0/GasConstant;
|
tPoly[5] = 1.0/GasConstant;
|
||||||
tPoly[6] = 1.0/(GasConstant * temp);
|
tPoly[6] = 1.0/(GasConstant * temp);
|
||||||
updateProperties(tPoly, cp_R, h_RT, s_R);
|
updateProperties(tPoly, cp_R, h_RT, s_R);
|
||||||
|
|
@ -204,7 +204,7 @@ namespace Cantera {
|
||||||
msp_high(0),
|
msp_high(0),
|
||||||
m_index (n) {
|
m_index (n) {
|
||||||
m_coeff.resize(15);
|
m_coeff.resize(15);
|
||||||
copy(coeffs, coeffs + 15, m_coeff.begin());
|
std::copy(coeffs, coeffs + 15, m_coeff.begin());
|
||||||
m_midT = coeffs[0];
|
m_midT = coeffs[0];
|
||||||
msp_low = new ShomatePoly(n, tlow, m_midT, pref, coeffs+1);
|
msp_low = new ShomatePoly(n, tlow, m_midT, pref, coeffs+1);
|
||||||
msp_high = new ShomatePoly(n, m_midT, thigh, pref, coeffs+8);
|
msp_high = new ShomatePoly(n, m_midT, thigh, pref, coeffs+8);
|
||||||
|
|
@ -219,7 +219,7 @@ namespace Cantera {
|
||||||
msp_high(0),
|
msp_high(0),
|
||||||
m_coeff (array_fp(15)),
|
m_coeff (array_fp(15)),
|
||||||
m_index (b.m_index) {
|
m_index (b.m_index) {
|
||||||
copy(b.m_coeff.begin(),
|
std::copy(b.m_coeff.begin(),
|
||||||
b.m_coeff.begin() + 15,
|
b.m_coeff.begin() + 15,
|
||||||
m_coeff.begin());
|
m_coeff.begin());
|
||||||
msp_low = new ShomatePoly(m_index, m_lowT, m_midT,
|
msp_low = new ShomatePoly(m_index, m_lowT, m_midT,
|
||||||
|
|
@ -235,7 +235,7 @@ namespace Cantera {
|
||||||
m_highT = b.m_highT;
|
m_highT = b.m_highT;
|
||||||
m_Pref = b.m_Pref;
|
m_Pref = b.m_Pref;
|
||||||
m_index = b.m_index;
|
m_index = b.m_index;
|
||||||
copy(b.m_coeff.begin(),
|
std::copy(b.m_coeff.begin(),
|
||||||
b.m_coeff.begin() + 15,
|
b.m_coeff.begin() + 15,
|
||||||
m_coeff.begin());
|
m_coeff.begin());
|
||||||
if (msp_low) delete msp_low;
|
if (msp_low) delete msp_low;
|
||||||
|
|
@ -274,7 +274,7 @@ namespace Cantera {
|
||||||
* m_t[1] = tt*tt;
|
* m_t[1] = tt*tt;
|
||||||
* m_t[2] = m_t[1]*tt;
|
* m_t[2] = m_t[1]*tt;
|
||||||
* m_t[3] = 1.0/m_t[1];
|
* m_t[3] = 1.0/m_t[1];
|
||||||
* m_t[4] = log(tt);
|
* m_t[4] = std::log(tt);
|
||||||
* m_t[5] = 1.0/GasConstant;
|
* m_t[5] = 1.0/GasConstant;
|
||||||
* m_t[6] = 1.0/(GasConstant * T);
|
* m_t[6] = 1.0/(GasConstant * T);
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
namespace Cantera {
|
namespace Cantera {
|
||||||
|
|
||||||
const doublereal Pi = 3.1415926;
|
const doublereal Pi = 3.1415926;
|
||||||
const doublereal SqrtPi = sqrt(Pi);
|
const doublereal SqrtPi = std::sqrt(Pi);
|
||||||
|
|
||||||
// use kg-moles, rather than g-moles.
|
// use kg-moles, rather than g-moles.
|
||||||
// Note: this constant is a relic of old versions,
|
// Note: this constant is a relic of old versions,
|
||||||
|
|
@ -111,8 +111,8 @@ namespace Cantera {
|
||||||
|
|
||||||
const doublereal OneThird = 1.0/3.0;
|
const doublereal OneThird = 1.0/3.0;
|
||||||
const doublereal FiveSixteenths = 5.0/16.0;
|
const doublereal FiveSixteenths = 5.0/16.0;
|
||||||
const doublereal SqrtTen = sqrt(10.0);
|
const doublereal SqrtTen = std::sqrt(10.0);
|
||||||
const doublereal SqrtEight = sqrt(8.0);
|
const doublereal SqrtEight = std::sqrt(8.0);
|
||||||
|
|
||||||
const doublereal SmallNumber = 1.e-300;
|
const doublereal SmallNumber = 1.e-300;
|
||||||
const doublereal BigNumber = 1.e300;
|
const doublereal BigNumber = 1.e300;
|
||||||
|
|
@ -175,7 +175,7 @@ namespace Cantera {
|
||||||
|
|
||||||
// template<class A, class B>
|
// template<class A, class B>
|
||||||
//inline doublereal operator*(const vector<A>& u, const vector<B>& v) {
|
//inline doublereal operator*(const vector<A>& u, const vector<B>& v) {
|
||||||
// return inner_product(u.begin(), u.end(), v.begin(), 0.0);
|
// return std::inner_product(u.begin(), u.end(), v.begin(), 0.0);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,7 @@ namespace Cantera {
|
||||||
inline doublereal sum_xlogx(InputIter begin, InputIter end) {
|
inline doublereal sum_xlogx(InputIter begin, InputIter end) {
|
||||||
doublereal sum = 0.0;
|
doublereal sum = 0.0;
|
||||||
for (; begin != end; ++begin) {
|
for (; begin != end; ++begin) {
|
||||||
sum += (*begin) * log(*begin + Tiny);
|
sum += (*begin) * std::log(*begin + Tiny);
|
||||||
}
|
}
|
||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
|
@ -247,7 +247,7 @@ namespace Cantera {
|
||||||
InputIter2 Q_begin) {
|
InputIter2 Q_begin) {
|
||||||
doublereal sum = 0.0;
|
doublereal sum = 0.0;
|
||||||
for (; begin != end; ++begin, ++Q_begin) {
|
for (; begin != end; ++begin, ++Q_begin) {
|
||||||
sum += (*begin) * log(*Q_begin + Tiny);
|
sum += (*begin) * std::log(*Q_begin + Tiny);
|
||||||
}
|
}
|
||||||
return sum;
|
return sum;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,10 +79,10 @@ namespace Cantera {
|
||||||
void setLineNumber(int n) {m_linenum = n;}
|
void setLineNumber(int n) {m_linenum = n;}
|
||||||
int lineNumber() const {return m_linenum;}
|
int lineNumber() const {return m_linenum;}
|
||||||
doublereal fp_value() const {
|
doublereal fp_value() const {
|
||||||
return atof(m_value.c_str());
|
return std::atof(m_value.c_str());
|
||||||
}
|
}
|
||||||
integer int_value() const {
|
integer int_value() const {
|
||||||
return atoi(m_value.c_str());
|
return std::atoi(m_value.c_str());
|
||||||
}
|
}
|
||||||
std::string operator()() const { return m_value; }
|
std::string operator()() const { return m_value; }
|
||||||
std::string operator()(std::string loc) const { return value(loc); }
|
std::string operator()(std::string loc) const { return value(loc); }
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue