12 std::string get_cantera_version()
14 return std::string(CANTERA_VERSION);
17 int get_sundials_version()
19 return CT_SUNDIALS_VERSION;
25 virtual void write(
const std::string& s) {
27 static const size_t N = 999;
28 for (
size_t i = 0; i < s.size(); i+=N) {
29 PySys_WriteStdout(
"%s", s.substr(i, N).c_str());
35 PySys_WriteStdout(
"%s",
"\n");
39 virtual void error(
const std::string& msg) {
40 std::string err =
"raise Exception('''"+msg+
"''')";
41 PyRun_SimpleString(err.c_str());
47 void CxxArray2D_set(
Cantera::Array2D& array,
size_t i,
size_t j,
double value)
53 #define ARRAY_FUNC(PREFIX, CLASS_NAME, FUNC_NAME) \
54 void PREFIX ## _ ## FUNC_NAME(Cantera::CLASS_NAME* object, double* data) \
55 { object->FUNC_NAME(data); }
58 #define ARRAY_FUNC2(PREFIX, CLASS_NAME, FUNC_NAME) \
59 void PREFIX ## _ ## FUNC_NAME(Cantera::CLASS_NAME* object, size_t dim, double* data) \
60 { object->FUNC_NAME(dim, data); }
63 #define THERMO_1D(FUNC_NAME) ARRAY_FUNC(thermo, ThermoPhase, FUNC_NAME)
64 #define KIN_1D(FUNC_NAME) ARRAY_FUNC(kin, Kinetics, FUNC_NAME)
65 #define TRANSPORT_1D(FUNC_NAME) ARRAY_FUNC(tran, Transport, FUNC_NAME)
66 #define TRANSPORT_2D(FUNC_NAME) ARRAY_FUNC2(tran, Transport, FUNC_NAME)
68 THERMO_1D(getMassFractions)
69 THERMO_1D(setMassFractions)
70 THERMO_1D(getMoleFractions)
71 THERMO_1D(setMoleFractions)
72 THERMO_1D(getConcentrations)
73 THERMO_1D(setConcentrations)
75 THERMO_1D(getMolecularWeights)
77 THERMO_1D(getChemPotentials)
78 THERMO_1D(getElectrochemPotentials)
79 THERMO_1D(getPartialMolarEnthalpies)
80 THERMO_1D(getPartialMolarEntropies)
81 THERMO_1D(getPartialMolarIntEnergies)
82 THERMO_1D(getPartialMolarCp)
83 THERMO_1D(getPartialMolarVolumes)
84 THERMO_1D(getEnthalpy_RT)
85 THERMO_1D(getEntropy_R)
86 THERMO_1D(getIntEnergy_RT)
87 THERMO_1D(getGibbs_RT)
89 THERMO_1D(getActivities)
90 THERMO_1D(getActivityCoefficients)
92 KIN_1D(getFwdRatesOfProgress)
93 KIN_1D(getRevRatesOfProgress)
94 KIN_1D(getNetRatesOfProgress)
96 KIN_1D(getEquilibriumConstants)
97 KIN_1D(getFwdRateConstants)
98 KIN_1D(getRevRateConstants)
100 KIN_1D(getDeltaEnthalpy)
101 KIN_1D(getDeltaGibbs)
102 KIN_1D(getDeltaEntropy)
103 KIN_1D(getDeltaSSEnthalpy)
104 KIN_1D(getDeltaSSGibbs)
105 KIN_1D(getDeltaSSEntropy)
107 KIN_1D(getCreationRates)
108 KIN_1D(getDestructionRates)
109 KIN_1D(getNetProductionRates)
111 TRANSPORT_1D(getMixDiffCoeffs)
112 TRANSPORT_1D(getMixDiffCoeffsMass)
113 TRANSPORT_1D(getMixDiffCoeffsMole)
114 TRANSPORT_1D(getThermalDiffCoeffs)
115 TRANSPORT_1D(getSpeciesViscosities)
116 TRANSPORT_1D(getMobilities)
118 TRANSPORT_2D(getMultiDiffCoeffs)
119 TRANSPORT_2D(getBinaryDiffCoeffs)