ct_defs.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef CT_DEFS_H
00021 #define CT_DEFS_H
00022
00023 #include <cmath>
00024 #include "config.h"
00025
00026
00027 #include <iostream>
00028 #include <fstream>
00029 #include <vector>
00030 #include <map>
00031 #include <numeric>
00032 #include <string>
00033 #include <algorithm>
00034
00035
00036
00037
00038 namespace Cantera {
00039
00040
00041 #ifdef WIN32
00042 #define TYPENAME_KEYWORD
00043 #pragma warning(disable:4267)
00044 #else
00045
00046 #define TYPENAME_KEYWORD typename
00047 #endif
00048
00049 #undef CHEMKIN_COMPATIBILITY_MODE
00050
00051
00052 #ifndef DATA_PTR
00053 #define DATA_PTR(vec) &vec[0]
00054 #endif
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067 const doublereal Pi = 3.1415926;
00068
00069 const doublereal SqrtPi = std::sqrt(Pi);
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080 const doublereal Avogadro = 6.02214179e26;
00081
00082
00083 const doublereal GasConstant = 8314.47215;
00084
00085 const doublereal logGasConstant = 9.025752908;
00086
00087
00088 const doublereal OneAtm = 1.01325e5;
00089
00090
00091 const doublereal GasConst_cal_mol_K = 1.987;
00092
00093
00094 const doublereal Boltzmann = GasConstant / Avogadro;
00095
00096
00097 const doublereal Planck = 6.62606896e-34;
00098 const doublereal Planck_bar = 1.05457162853e-34;
00099
00100
00101 const doublereal logBoltz_Planck = 23.7599032;
00102
00103 const doublereal StefanBoltz = 5.6704004e-8;
00104
00105
00106
00107
00108 const doublereal ElectronCharge = 1.60217648740e-19;
00109 const doublereal ElectronMass = 9.1093821545e-31;
00110 const doublereal Faraday = ElectronCharge * Avogadro;
00111
00112
00113
00114
00115
00116
00117
00118 const doublereal epsilon_0 = 8.85417817e-12;
00119
00120
00121 const doublereal permeability_0 = 4.0e-7*Pi;
00122
00123
00124 const doublereal lightSpeed = 1.0/std::sqrt(epsilon_0 * permeability_0);
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135 const int TV = 100, HP = 101, SP = 102, PV = 103, TP = 104, UV = 105,
00136 ST = 106, SV = 107, UP = 108, VH = 109, TH = 110, SH = 111,
00137 PX = 112, TX = 113;
00138 const int VT = -100, PH = -101, PS = -102, VP = -103, PT = -104,
00139 VU = -105, TS = -106, VS = -107, PU = -108, HV = -109,
00140 HT = -110, HS = -111, XP = -112, XT = -113;
00141
00142
00143
00144 const doublereal OneThird = 1.0/3.0;
00145
00146 const doublereal FiveSixteenths = 5.0/16.0;
00147
00148 const doublereal SqrtTen = std::sqrt(10.0);
00149
00150 const doublereal SqrtEight = std::sqrt(8.0);
00151
00152 const doublereal SqrtTwo = std::sqrt(2.0);
00153
00154
00155 const doublereal SmallNumber = 1.e-300;
00156
00157 const doublereal BigNumber = 1.e300;
00158
00159 const doublereal MaxExp = 690.775527898;
00160
00161
00162
00163 const doublereal Undef = -999.1234;
00164
00165 const doublereal Tiny = 1.e-20;
00166
00167
00168
00169
00170
00171
00172 inline doublereal fmaxx(doublereal x, doublereal y)
00173 { return (x > y) ? x : y; }
00174
00175
00176
00177
00178
00179
00180 inline doublereal fminn(doublereal x, doublereal y)
00181 { return (x < y) ? x : y; }
00182
00183
00184
00185
00186
00187
00188
00189 typedef std::map<std::string, doublereal> compositionMap;
00190
00191 #define USE_STL_VECTOR
00192 #ifdef USE_STL_VECTOR
00193
00194 typedef std::vector<double> array_fp;
00195
00196 typedef std::vector<double> vector_fp;
00197
00198 typedef std::vector<int> array_int;
00199
00200 typedef std::vector<int> vector_int;
00201 #else
00202 typedef ct::ctvector_fp array_fp;
00203 typedef ct::ctvector_fp vector_fp;
00204 typedef ct::ctvector_int array_int;
00205 typedef ct::ctvector_int vector_int;
00206 #endif
00207
00208
00209
00210
00211 typedef vector_int group_t;
00212
00213
00214
00215
00216 typedef std::vector<group_t> grouplist_t;
00217
00218
00219 typedef doublereal* workPtr;
00220
00221 typedef const doublereal* const_workPtr;
00222
00223
00224 }
00225
00226 #endif
00227
00228
00229