mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
Removed 'using namespace std' from all header files
This commit is contained in:
@@ -142,8 +142,8 @@ extern "C" {
|
||||
|
||||
int DLL_EXPORT func_write(int i, size_t lennm, const char* arg, char* nm) {
|
||||
try {
|
||||
string a = string(arg);
|
||||
string w = _func(i)->write(a);
|
||||
std::string a = std::string(arg);
|
||||
std::string w = _func(i)->write(a);
|
||||
size_t ws = w.size();
|
||||
size_t lout = (lennm > ws ? ws : lennm);
|
||||
std::copy(w.c_str(), w.c_str() + lout, nm);
|
||||
|
||||
@@ -177,7 +177,7 @@ extern "C" {
|
||||
if (r->type() >= ReactorType)
|
||||
return ((Reactor*)r)->nSensParams();
|
||||
else {
|
||||
cout << "type problem..." << r->type() << endl;
|
||||
std::cout << "type problem..." << r->type() << std::endl;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <cantera/kernel/plots.h>
|
||||
|
||||
using namespace Cantera;
|
||||
using namespace std;
|
||||
|
||||
// Save the temperature, density, pressure, and mole fractions at one
|
||||
// time
|
||||
|
||||
@@ -8,7 +8,5 @@
|
||||
#include "kernel/FlowReactor.h"
|
||||
#include "kernel/ConstPressureReactor.h"
|
||||
|
||||
using namespace CanteraZeroD;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ const double Undef = -999.123;
|
||||
//const double DERR = -999.999;
|
||||
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
void reportError();
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "cantera/kernel/logger.h"
|
||||
|
||||
#include <iostream>
|
||||
//using namespace std;
|
||||
|
||||
static std::string ss = "disp(' ";
|
||||
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
#include <string>
|
||||
#include "cantera/kernel/logger.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
static std::string ss = "print \"\"\" ";
|
||||
|
||||
namespace Cantera {
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
//using namespace std;
|
||||
|
||||
#include "ckr_defs.h"
|
||||
#include "Element.h"
|
||||
@@ -53,17 +52,17 @@ namespace ckr {
|
||||
|
||||
bool readElementSection(elementList& elements);
|
||||
bool readSpeciesSection(speciesList& species);
|
||||
bool readThermoSection(vector<string>& names,
|
||||
speciesTable& speciesData, vector_fp& temp,
|
||||
int& optionFlag, ostream& log);
|
||||
bool readReactionSection(const vector<string>& speciesNames,
|
||||
vector<string>& elementNames,
|
||||
bool readThermoSection(std::vector<std::string>& names,
|
||||
speciesTable& speciesData, vector_fp& temp,
|
||||
int& optionFlag, std::ostream& log);
|
||||
bool readReactionSection(const std::vector<std::string>& speciesNames,
|
||||
std::vector<std::string>& elementNames,
|
||||
reactionList& reactions, ReactionUnits& units);
|
||||
bool advanceToKeyword(const std::string& kw, const std::string& stop);
|
||||
bool verbose;
|
||||
bool debug;
|
||||
|
||||
bool readNASA9ThermoSection(std::vector<string>& names,
|
||||
bool readNASA9ThermoSection(std::vector<std::string>& names,
|
||||
speciesTable& species, vector_fp& temp,
|
||||
int& optionFlag, std::ostream& log);
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
namespace ckr {
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
namespace ckr {
|
||||
|
||||
@@ -22,7 +21,7 @@ namespace ckr {
|
||||
*/
|
||||
class Constituent {
|
||||
public:
|
||||
string name; //!< The name of the object.
|
||||
std::string name; //!< The name of the object.
|
||||
double number; //!< The number of units (molecules, etc.).
|
||||
};
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace ckr {
|
||||
|
||||
/**
|
||||
@@ -41,7 +39,7 @@ public:
|
||||
|
||||
|
||||
/// Construct a new empty Element object
|
||||
Element(const string& nm, double wt) :
|
||||
Element(const std::string& nm, double wt) :
|
||||
name(nm),
|
||||
atomicWeight(wt),
|
||||
valid(0),
|
||||
@@ -54,12 +52,12 @@ public:
|
||||
/// Destructor
|
||||
~Element() {}
|
||||
|
||||
string name; //!< Element name
|
||||
std::string name; //!< Element name
|
||||
double atomicWeight; //!< Atomic weight in amu
|
||||
int valid; //!< flag returned by validation routines
|
||||
int index; //!< index number
|
||||
bool weightFromDB; //!< true if atomic weight is not specified
|
||||
string comment; //!< comment in input file
|
||||
std::string comment; //!< comment in input file
|
||||
|
||||
|
||||
/**
|
||||
@@ -72,11 +70,11 @@ public:
|
||||
bool operator!=(const Element& e) const {
|
||||
return !(*this == e);
|
||||
}
|
||||
friend ostream& operator<<(ostream& s, const Element& e) {
|
||||
friend std::ostream& operator<<(std::ostream& s, const Element& e) {
|
||||
s << e.name;
|
||||
if (!e.weightFromDB) s << "/" << e.atomicWeight << "/";
|
||||
if (e.comment != "")
|
||||
s << " !" << e.comment << endl;
|
||||
s << " !" << e.comment << std::endl;
|
||||
else
|
||||
s << " ";
|
||||
return s;
|
||||
@@ -84,7 +82,7 @@ public:
|
||||
};
|
||||
|
||||
/// a list (vector) of Elements
|
||||
typedef vector<Element> elementList;
|
||||
typedef std::vector<Element> elementList;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -59,10 +59,10 @@ namespace ckr {
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Reaction::write(ostream& s) const {
|
||||
void Reaction::write(std::ostream& s) const {
|
||||
int nl = static_cast<int>(lines.size());
|
||||
for (int nn = 0; nn < nl; nn++) {
|
||||
s << lines[nn] << endl;
|
||||
s << lines[nn] << std::endl;
|
||||
}
|
||||
// int nr = reactants.size();
|
||||
// int np = products.size();
|
||||
@@ -126,8 +126,8 @@ bool Reaction::operator==(const Reaction& r) const {
|
||||
if (int(r.reactants.size()) != nr ||
|
||||
int(r.products.size()) != np || r.thirdBody != thirdBody) return false;
|
||||
|
||||
string nm;
|
||||
map<string, double> coeffs;
|
||||
std::string nm;
|
||||
std::map<std::string, double> coeffs;
|
||||
for (int ir = 0; ir < nr; ir++) {
|
||||
coeffs[reactants[ir].name] = -reactants[ir].number;
|
||||
}
|
||||
@@ -145,7 +145,7 @@ bool Reaction::operator==(const Reaction& r) const {
|
||||
coeffs[nm] /= products[jp].number;
|
||||
}
|
||||
int nc = static_cast<int>(coeffs.size());
|
||||
vector<double> ratios;
|
||||
std::vector<double> ratios;
|
||||
getMapValues(coeffs, ratios);
|
||||
|
||||
if (!isReversible && ratios[0] < 0.0) return false;
|
||||
|
||||
@@ -12,13 +12,11 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
using namespace std;
|
||||
|
||||
#include "ckr_defs.h"
|
||||
#include "ckr_utils.h"
|
||||
#include "RxnSpecies.h"
|
||||
|
||||
|
||||
namespace ckr {
|
||||
|
||||
|
||||
@@ -183,7 +181,7 @@ namespace ckr {
|
||||
* third body collision partners, or a species name if only
|
||||
* one species does.
|
||||
*/
|
||||
string thirdBody;
|
||||
std::string thirdBody;
|
||||
|
||||
/// Reaction number.
|
||||
int number;
|
||||
@@ -192,21 +190,21 @@ namespace ckr {
|
||||
* list of species that participate as reactants,
|
||||
* and their stoichiometric coefficients
|
||||
*/
|
||||
vector<RxnSpecies> reactants;
|
||||
std::vector<RxnSpecies> reactants;
|
||||
|
||||
mutable map<string, double> fwdOrder;
|
||||
mutable std::map<std::string, double> fwdOrder;
|
||||
|
||||
/**
|
||||
* list of species that participate as products,
|
||||
* and their stoichiometric coefficients
|
||||
*/
|
||||
vector<RxnSpecies> products;
|
||||
std::vector<RxnSpecies> products;
|
||||
|
||||
|
||||
/**
|
||||
* map from species names to enhanced third-body collision efficiencies
|
||||
*/
|
||||
mutable map<string, double> e3b;
|
||||
mutable std::map<std::string, double> e3b;
|
||||
|
||||
/**
|
||||
* Forward rate coefficient. For falloff reactions, this is the
|
||||
@@ -231,39 +229,31 @@ namespace ckr {
|
||||
/**
|
||||
* auxiliary data not handled elsewhere.
|
||||
*/
|
||||
mutable map<string, auxdata> otherAuxData;
|
||||
mutable std::map<std::string, auxdata> otherAuxData;
|
||||
|
||||
/**
|
||||
* input file lines
|
||||
*/
|
||||
vector<string> lines;
|
||||
std::vector<std::string> lines;
|
||||
|
||||
/**
|
||||
* comments
|
||||
*/
|
||||
vector<string> comment;
|
||||
std::vector<std::string> comment;
|
||||
|
||||
// methods
|
||||
|
||||
double stoichCoefficient(const string& s) const;
|
||||
double stoichCoefficient(const std::string& s) const;
|
||||
bool operator==(const Reaction& r) const;
|
||||
void write(ostream& s) const;
|
||||
void write(std::ostream& s) const;
|
||||
|
||||
};
|
||||
|
||||
/// a list of Reaction objects
|
||||
typedef vector<Reaction> reactionList;
|
||||
typedef std::vector<Reaction> reactionList;
|
||||
|
||||
Reaction forwardReaction(const Reaction& rxn);
|
||||
Reaction reverseReaction(const Reaction& rxn);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,12 +13,10 @@
|
||||
#include <vector>
|
||||
//#include "Cantera.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace ckr {
|
||||
|
||||
typedef vector_int group_t;
|
||||
typedef vector<group_t> grouplist_t;
|
||||
typedef vector_int group_t;
|
||||
typedef std::vector<group_t> grouplist_t;
|
||||
|
||||
|
||||
/**
|
||||
@@ -29,7 +27,7 @@ class RxnSpecies {
|
||||
public:
|
||||
RxnSpecies() :
|
||||
number(0) {}
|
||||
string name; //!< The name of the object.
|
||||
std::string name; //!< The name of the object.
|
||||
double number; //!< The number of units (molecules, etc.).
|
||||
grouplist_t groups;
|
||||
};
|
||||
|
||||
@@ -55,19 +55,18 @@ namespace ckr {
|
||||
int thermoFormatType;
|
||||
|
||||
//! Species Name
|
||||
string name;
|
||||
string id; //!< ID tag from 'date' field in input
|
||||
string phase; //!< Phase string. Usually "G", "L", or "S".
|
||||
std::string name;
|
||||
std::string id; //!< ID tag from 'date' field in input
|
||||
std::string phase; //!< Phase string. Usually "G", "L", or "S".
|
||||
double tlow; //!< Min temperature for thermo data fit
|
||||
double tmid; //!< Mid temperature for thermo data fit
|
||||
double thigh; //!< Max temperature for thermo data fit
|
||||
|
||||
|
||||
/// list of Constituent objects defining elemental composition
|
||||
vector<Constituent> elements;
|
||||
std::vector<Constituent> elements;
|
||||
|
||||
/// map from element symbols to atom numbers
|
||||
mutable map<string, double> comp;
|
||||
mutable std::map<std::string, double> comp;
|
||||
|
||||
/// polynomial coefficients for the lower temperature range
|
||||
vector_fp lowCoeffs;
|
||||
@@ -88,7 +87,7 @@ namespace ckr {
|
||||
/// position in the list of species in the input file
|
||||
int index;
|
||||
|
||||
string m_commentsRef;
|
||||
std::string m_commentsRef;
|
||||
|
||||
private:
|
||||
//! Delete private data
|
||||
@@ -96,10 +95,10 @@ namespace ckr {
|
||||
};
|
||||
|
||||
//! Shorthand for a list of Species
|
||||
typedef vector<Species> speciesList;
|
||||
typedef std::vector<Species> speciesList;
|
||||
|
||||
//! A map from species names to Species objects
|
||||
typedef map<string, Species> speciesTable;
|
||||
typedef std::map<std::string, Species> speciesTable;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
//using namespace std;
|
||||
|
||||
//#include "../ctvector.h"
|
||||
|
||||
|
||||
@@ -13,39 +13,30 @@
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace ckr {
|
||||
|
||||
/**
|
||||
*
|
||||
* Fill vector 'keys' with the keys of map 'mp'
|
||||
*
|
||||
*/
|
||||
|
||||
template<class K, class V>
|
||||
void getMapKeys(const map<K,V>& mp, vector<K>& keys) {
|
||||
void getMapKeys(const std::map<K,V>& mp, std::vector<K>& keys) {
|
||||
keys.clear();
|
||||
typename map<K,V>::const_iterator i = mp.begin();
|
||||
typename std::map<K,V>::const_iterator i = mp.begin();
|
||||
for (; i != mp.end(); ++i) keys.push_back(i->first);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Fill vector 'values' with the values of map 'mp'
|
||||
*
|
||||
*/
|
||||
|
||||
template<class K, class V>
|
||||
void getMapValues(const map<K,V>& mp, vector<V>& values) {
|
||||
void getMapValues(const std::map<K,V>& mp, std::vector<V>& values) {
|
||||
values.clear();
|
||||
typename map<K,V>::const_iterator i = mp.begin();
|
||||
typename std::map<K,V>::const_iterator i = mp.begin();
|
||||
for (; i != mp.end(); ++i) values.push_back(i->second);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Template to compare two objects a and b, possibly of different
|
||||
@@ -109,10 +100,10 @@ inline bool valid(L& list) {
|
||||
|
||||
|
||||
/// Remove all white space from string s.
|
||||
void removeWhiteSpace(string& s);
|
||||
void removeWhiteSpace(std::string& s);
|
||||
|
||||
void getTokens(string& begin,
|
||||
int n, vector<string>& toks, char delim=' ');
|
||||
void getTokens(std::string& begin,
|
||||
int n, std::vector<std::string>& toks, char delim=' ');
|
||||
|
||||
|
||||
/**
|
||||
@@ -123,15 +114,13 @@ void getTokens(string& begin,
|
||||
* in string s2 matches any character at that position.
|
||||
*
|
||||
* Example: if s1 = "elements", then match(s1, "ELEM") would return true.
|
||||
*
|
||||
*/
|
||||
|
||||
bool match(const string& s1, const string& s2);
|
||||
bool match(const std::string& s1, const std::string& s2);
|
||||
|
||||
/**
|
||||
* Check whether string 'word' begins with a Chemkin keyword.
|
||||
*/
|
||||
inline bool isKeyword(string word)
|
||||
inline bool isKeyword(std::string word)
|
||||
{
|
||||
return (match(word, "ELEM") ||
|
||||
match(word, "SPEC") ||
|
||||
@@ -141,8 +130,8 @@ inline bool isKeyword(string word)
|
||||
}
|
||||
|
||||
|
||||
bool extractSlashData(string& s, string& name, string& data);
|
||||
string capitalize(const string& word);
|
||||
bool extractSlashData(std::string& s, std::string& name, std::string& data);
|
||||
std::string capitalize(const std::string& word);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
//using namespace std;
|
||||
|
||||
#include "Species.h"
|
||||
#include "Reaction.h"
|
||||
@@ -20,7 +19,7 @@
|
||||
//#include "Cantera.h"
|
||||
|
||||
namespace ckr {
|
||||
std::string newTask(string msg);
|
||||
std::string newTask(std::string msg);
|
||||
bool writeFalloff(int type, const vector_fp& c, std::ostream& log);
|
||||
bool writeRateCoeff(const RateCoeff& k, std::ostream& log);
|
||||
void printReactionEquation(std::ostream& f, const Reaction& r);
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
#include "ct_defs.h"
|
||||
|
||||
//using namespace std;
|
||||
namespace Cantera {
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
namespace Cantera {
|
||||
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
#include <cstdlib>
|
||||
#include <iomanip>
|
||||
|
||||
using std::string;
|
||||
using std::endl;
|
||||
using std::setw;
|
||||
|
||||
namespace Cantera {
|
||||
|
||||
// Base Constructor
|
||||
@@ -470,8 +474,8 @@ namespace Cantera {
|
||||
std::vector<double> ubar(kk, 0.0);
|
||||
std::vector<double> cpbar(kk, 0.0);
|
||||
std::vector<double> vbar(kk, 0.0);
|
||||
vector<std::string> pNames;
|
||||
vector<double*> data;
|
||||
std::vector<std::string> pNames;
|
||||
std::vector<double*> data;
|
||||
|
||||
getMoleFractions(DATA_PTR(x));
|
||||
pNames.push_back("X");
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
#ifndef CT_AQUEOUSTRAN_H
|
||||
#define CT_AQUEOUSTRAN_H
|
||||
|
||||
using namespace std;
|
||||
|
||||
// Cantera includes
|
||||
#include "TransportBase.h"
|
||||
#include "DenseMatrix.h"
|
||||
@@ -342,21 +340,21 @@ namespace Cantera {
|
||||
vector_fp m_mw;
|
||||
|
||||
// polynomial fits
|
||||
vector<vector<int> > m_poly;
|
||||
std::vector<std::vector<int> > m_poly;
|
||||
|
||||
//! Polynomial coefficients of the viscosity
|
||||
/*!
|
||||
* These express the temperature dependendence of the pures
|
||||
* species viscosities.
|
||||
*/
|
||||
vector<vector_fp> m_visccoeffs;
|
||||
std::vector<vector_fp> m_visccoeffs;
|
||||
|
||||
//! Polynomial coefficients of the conductivities
|
||||
/*!
|
||||
* These express the temperature dependendence of the pures
|
||||
* species conductivities
|
||||
*/
|
||||
vector<vector_fp> m_condcoeffs;
|
||||
std::vector<vector_fp> m_condcoeffs;
|
||||
|
||||
//! Polynomial coefficients of the binary diffusion coefficients
|
||||
/*!
|
||||
@@ -364,7 +362,7 @@ namespace Cantera {
|
||||
* binary diffusivities. An overall pressure dependence is then
|
||||
* added.
|
||||
*/
|
||||
vector<vector_fp> m_diffcoeffs;
|
||||
std::vector<vector_fp> m_diffcoeffs;
|
||||
|
||||
|
||||
//! Internal value of the gradient of the mole fraction vector
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
#include <numeric>
|
||||
#include <algorithm>
|
||||
|
||||
using namespace std;
|
||||
|
||||
// Cantera includes
|
||||
#include "TransportBase.h"
|
||||
#include "DenseMatrix.h"
|
||||
@@ -422,7 +420,7 @@ namespace Cantera {
|
||||
* binary diffusivities. An overall pressure dependence is then
|
||||
* added.
|
||||
*/
|
||||
vector<vector_fp> m_diffcoeffs;
|
||||
std::vector<vector_fp> m_diffcoeffs;
|
||||
|
||||
//! Internal value of the gradient of the mole fraction vector
|
||||
/*!
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
#include <numeric>
|
||||
#include <algorithm>
|
||||
|
||||
using namespace std;
|
||||
|
||||
// Cantera includes
|
||||
#include "TransportBase.h"
|
||||
#include "DenseMatrix.h"
|
||||
@@ -138,9 +136,9 @@ namespace Cantera {
|
||||
vector_fp m_mw;
|
||||
|
||||
// polynomial fits
|
||||
vector<vector_fp> m_visccoeffs;
|
||||
vector<vector_fp> m_condcoeffs;
|
||||
vector<vector_fp> m_diffcoeffs;
|
||||
std::vector<vector_fp> m_visccoeffs;
|
||||
std::vector<vector_fp> m_condcoeffs;
|
||||
std::vector<vector_fp> m_diffcoeffs;
|
||||
vector_fp m_polytempvec;
|
||||
|
||||
// property values
|
||||
@@ -151,11 +149,11 @@ namespace Cantera {
|
||||
|
||||
array_fp m_molefracs;
|
||||
|
||||
vector<vector<int> > m_poly;
|
||||
vector<vector_fp > m_astar_poly;
|
||||
vector<vector_fp > m_bstar_poly;
|
||||
vector<vector_fp > m_cstar_poly;
|
||||
vector<vector_fp > m_om22_poly;
|
||||
std::vector<std::vector<int> > m_poly;
|
||||
std::vector<vector_fp > m_astar_poly;
|
||||
std::vector<vector_fp > m_bstar_poly;
|
||||
std::vector<vector_fp > m_cstar_poly;
|
||||
std::vector<vector_fp > m_om22_poly;
|
||||
DenseMatrix m_astar;
|
||||
DenseMatrix m_bstar;
|
||||
DenseMatrix m_cstar;
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
#include <numeric>
|
||||
#include <algorithm>
|
||||
|
||||
using namespace std;
|
||||
|
||||
// Cantera includes
|
||||
#include "TransportBase.h"
|
||||
#include "DenseMatrix.h"
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
#include <numeric>
|
||||
#include <algorithm>
|
||||
|
||||
using namespace std;
|
||||
|
||||
// Cantera includes
|
||||
#include "TransportBase.h"
|
||||
#include "DenseMatrix.h"
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <cantera/Cantera.h>
|
||||
#include <cantera/onedim.h>
|
||||
using namespace Cantera;
|
||||
using namespace std;
|
||||
|
||||
/// Namespace for the boundary value problem package.
|
||||
namespace BVP {
|
||||
|
||||
@@ -311,7 +311,7 @@ double CarbonDioxide::Psat(){
|
||||
|
||||
double log, sum=0,P;
|
||||
if ((T < Tmn) || (T > Tc)) {
|
||||
cout << " error in Psat " << TempError << endl;
|
||||
std::cout << " error in Psat " << TempError << std::endl;
|
||||
set_Err(TempError); // Error("CarbonDioxide::Psat",TempError,T);
|
||||
}
|
||||
for (int i=1;i<=8;i++)
|
||||
@@ -332,7 +332,7 @@ double CarbonDioxide::Psat(){
|
||||
double CarbonDioxide::ldens() {
|
||||
double xx=1-(T/Tc), sum=0;
|
||||
if ((T < Tmn) || (T > Tc)) {
|
||||
cout << " error in ldens " << TempError << endl;
|
||||
std::cout << " error in ldens " << TempError << std::endl;
|
||||
set_Err(TempError);
|
||||
}
|
||||
for(int i=1;i<=6;i++)
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include <fstream>
|
||||
#include <stdio.h>
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace tpx {
|
||||
|
||||
static string fp2str(double x, string fmt="%g") {
|
||||
|
||||
@@ -21,19 +21,18 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
namespace tpx {
|
||||
|
||||
class TPX_Error {
|
||||
public:
|
||||
TPX_Error(string p, string e) {
|
||||
TPX_Error(std::string p, std::string e) {
|
||||
ErrorMessage = e;
|
||||
ErrorProcedure = p;
|
||||
}
|
||||
virtual ~TPX_Error(){}
|
||||
static string ErrorMessage;
|
||||
static string ErrorProcedure;
|
||||
static std::string ErrorMessage;
|
||||
static std::string ErrorProcedure;
|
||||
};
|
||||
|
||||
|
||||
@@ -70,7 +69,7 @@ namespace tpx {
|
||||
|
||||
const double Undef = 999.1234;
|
||||
|
||||
string errorMsg(int flag);
|
||||
std::string errorMsg(int flag);
|
||||
|
||||
class Substance {
|
||||
public:
|
||||
@@ -200,8 +199,8 @@ namespace tpx {
|
||||
int Err;
|
||||
double m_energy_offset;
|
||||
double m_entropy_offset;
|
||||
string m_name;
|
||||
string m_formula;
|
||||
std::string m_name;
|
||||
std::string m_formula;
|
||||
|
||||
// virtual double Xm(int k) { return 1.0;}
|
||||
//virtual int Species() { return 1;}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "subs.h"
|
||||
#include "utils.h"
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace tpx {
|
||||
|
||||
static string lowercase(string s) {
|
||||
|
||||
@@ -27,9 +27,9 @@ void makeEquilDataLabels(const G& gas, V& names) {
|
||||
}
|
||||
|
||||
template<class G, class A>
|
||||
void plotEquilSoln(string fname, string fmt, string title, const G& gas,
|
||||
const A& soln) {
|
||||
vector<string> names;
|
||||
void plotEquilSoln(std::string fname, std::string fmt, std::string title,
|
||||
const G& gas, const A& soln) {
|
||||
std::vector<std::string> names;
|
||||
makeEquilDataLabels(gas, names);
|
||||
writePlotFile(fname, fmt, title, names, soln);
|
||||
}
|
||||
@@ -46,10 +46,10 @@ void plotEquilSoln(string fname, string fmt, string title, const G& gas,
|
||||
|
||||
int equil_example1(int job) {
|
||||
|
||||
cout << "Chemical equilibrium." << endl;
|
||||
std::cout << "Chemical equilibrium." << std::endl;
|
||||
if (job > 0) {
|
||||
cout << "Equilibrium composition and pressure for a "
|
||||
<< "range of temperatures at constant density." << endl;
|
||||
std::cout << "Equilibrium composition and pressure for a "
|
||||
<< "range of temperatures at constant density." << std::endl;
|
||||
}
|
||||
if (job <= 1) return 0;
|
||||
|
||||
@@ -82,14 +82,14 @@ int equil_example1(int job) {
|
||||
}
|
||||
|
||||
// make a Tecplot data file and an Excel spreadsheet
|
||||
string plotTitle = "equilibrium example 1: "
|
||||
"chemical equilibrium";
|
||||
std::string plotTitle = "equilibrium example 1: "
|
||||
"chemical equilibrium";
|
||||
plotEquilSoln("eq1.dat", "TEC", plotTitle, gas, output);
|
||||
plotEquilSoln("eq1.csv", "XL", plotTitle, gas, output);
|
||||
|
||||
cout << "Output files:" << endl
|
||||
<< " eq1.csv (Excel CSV file)" << endl
|
||||
<< " eq1.dat (Tecplot data file)" << endl;
|
||||
std::cout << "Output files:" << std::endl
|
||||
<< " eq1.csv (Excel CSV file)" << std::endl
|
||||
<< " eq1.dat (Tecplot data file)" << std::endl;
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <cantera/kernel/plots.h>
|
||||
|
||||
using namespace Cantera;
|
||||
using namespace std;
|
||||
|
||||
// Save the temperature, density, pressure, and mole fractions at one
|
||||
// time
|
||||
@@ -45,8 +44,9 @@ void makeDataLabels(const G& gas, V& names) {
|
||||
}
|
||||
|
||||
template<class G, class A>
|
||||
void plotSoln(string fname, string fmt, string title, const G& gas, const A& soln) {
|
||||
vector<string> names;
|
||||
void plotSoln(std::string fname, std::string fmt, std::string title,
|
||||
const G& gas, const A& soln) {
|
||||
std::vector<std::string> names;
|
||||
makeDataLabels(gas, names);
|
||||
writePlotFile(fname, fmt, title, names, soln);
|
||||
}
|
||||
|
||||
@@ -24,12 +24,12 @@ int kinetics_example2(int job) {
|
||||
|
||||
try {
|
||||
|
||||
cout << "Ignition simulation using class GRI30." << endl;
|
||||
std::cout << "Ignition simulation using class GRI30." << std::endl;
|
||||
|
||||
if (job >= 1) {
|
||||
cout << "Constant-pressure ignition of a "
|
||||
<< "hydrogen/oxygen/nitrogen"
|
||||
" mixture \nbeginning at T = 1001 K and P = 1 atm." << endl;
|
||||
std::cout <<
|
||||
"Constant-pressure ignition of a hydrogen/oxygen/nitrogen"
|
||||
" mixture \nbeginning at T = 1001 K and P = 1 atm." << std::endl;
|
||||
}
|
||||
if (job < 2) return 0;
|
||||
|
||||
@@ -83,24 +83,24 @@ int kinetics_example2(int job) {
|
||||
}
|
||||
|
||||
// make a Tecplot data file and an Excel spreadsheet
|
||||
string plotTitle = "kinetics example 2: constant-pressure ignition";
|
||||
std::string plotTitle = "kinetics example 2: constant-pressure ignition";
|
||||
plotSoln("kin2.dat", "TEC", plotTitle, gas, soln);
|
||||
plotSoln("kin2.csv", "XL", plotTitle, gas, soln);
|
||||
|
||||
|
||||
// print final temperature
|
||||
cout << " Tfinal = " << r.temperature() << endl;
|
||||
cout << "Output files:" << endl
|
||||
<< " kin2.csv (Excel CSV file)" << endl
|
||||
<< " kin2.dat (Tecplot data file)" << endl;
|
||||
std::cout << " Tfinal = " << r.temperature() << std::endl;
|
||||
std::cout << "Output files:" << std::endl
|
||||
<< " kin2.csv (Excel CSV file)" << std::endl
|
||||
<< " kin2.dat (Tecplot data file)" << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// handle exceptions thrown by Cantera
|
||||
catch (CanteraError) {
|
||||
showErrors(cout);
|
||||
cout << " terminating... " << endl;
|
||||
showErrors(std::cout);
|
||||
std::cout << " terminating... " << std::endl;
|
||||
appdelete();
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include "example_utils.h"
|
||||
|
||||
using namespace Cantera;
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
|
||||
// Kinetics example. This is written as a function so that one
|
||||
// driver program can run multiple examples.
|
||||
@@ -29,7 +31,7 @@ int kinetics_example3(int job) {
|
||||
try {
|
||||
|
||||
cout << "Ignition simulation using class IdealGasMix "
|
||||
<< "with file gri30.cti."
|
||||
<< "with file gri30.cti."
|
||||
<< endl;
|
||||
|
||||
if (job >= 1) {
|
||||
@@ -88,7 +90,7 @@ int kinetics_example3(int job) {
|
||||
}
|
||||
|
||||
// make a Tecplot data file and an Excel spreadsheet
|
||||
string plotTitle = "kinetics example 3: constant-pressure ignition";
|
||||
std::string plotTitle = "kinetics example 3: constant-pressure ignition";
|
||||
plotSoln("kin3.dat", "TEC", plotTitle, gas, soln);
|
||||
plotSoln("kin3.csv", "XL", plotTitle, gas, soln);
|
||||
|
||||
|
||||
@@ -13,11 +13,13 @@
|
||||
#include <cantera/IdealGasMix.h>
|
||||
|
||||
// #include <iostream>
|
||||
// using namespace std;
|
||||
|
||||
using namespace Cantera;
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
|
||||
void writeRxnPathDiagram(double time, ReactionPathBuilder& b,
|
||||
IdealGasMix& gas, ostream& logfile, ostream& outfile) {
|
||||
IdealGasMix& gas, std::ostream& logfile, std::ostream& outfile) {
|
||||
|
||||
// create a new empty diagram
|
||||
ReactionPathDiagram d;
|
||||
@@ -122,8 +124,8 @@ int rxnpath_example1(int job) {
|
||||
|
||||
// create a reaction path diagram builder
|
||||
ReactionPathBuilder b;
|
||||
ofstream rplog("rp1.log"); // log file
|
||||
ofstream rplot("rp1.dot"); // output file
|
||||
std::ofstream rplog("rp1.log"); // log file
|
||||
std::ofstream rplot("rp1.dot"); // output file
|
||||
b.init(rplog, gas); // initialize
|
||||
|
||||
// main loop
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include <cantera/IdealGasMix.h>
|
||||
|
||||
using namespace Cantera;
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
|
||||
template<class G, class V>
|
||||
void makeTransportDataLabels(const G& gas, V& names) {
|
||||
@@ -25,9 +27,9 @@ void makeTransportDataLabels(const G& gas, V& names) {
|
||||
}
|
||||
|
||||
template<class G, class A>
|
||||
void plotTransportSoln(string fname, string fmt, string title, const G& gas,
|
||||
const A& soln) {
|
||||
vector<string> names;
|
||||
void plotTransportSoln(std::string fname, std::string fmt, std::string title,
|
||||
const G& gas, const A& soln) {
|
||||
std::vector<std::string> names;
|
||||
makeTransportDataLabels(gas, names);
|
||||
writePlotFile(fname, fmt, title, names, soln);
|
||||
}
|
||||
@@ -75,8 +77,8 @@ int transport_example1(int job) {
|
||||
}
|
||||
|
||||
// make a Tecplot data file and an Excel spreadsheet
|
||||
string plotTitle = "transport example 1: "
|
||||
"mixture-averaged transport properties";
|
||||
std::string plotTitle = "transport example 1: "
|
||||
"mixture-averaged transport properties";
|
||||
plotTransportSoln("tr1.dat", "TEC", plotTitle, gas, output);
|
||||
plotTransportSoln("tr1.csv", "XL", plotTitle, gas, output);
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#include <cantera/IdealGasMix.h>
|
||||
|
||||
using namespace Cantera;
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
|
||||
template<class G, class V>
|
||||
void makeTransportDataLabels(const G& gas, V& names) {
|
||||
@@ -26,9 +28,9 @@ void makeTransportDataLabels(const G& gas, V& names) {
|
||||
}
|
||||
|
||||
template<class G, class A>
|
||||
void plotTransportSoln(string fname, string fmt, string title, const G& gas,
|
||||
const A& soln) {
|
||||
vector<string> names;
|
||||
void plotTransportSoln(std::string fname, std::string fmt, std::string title,
|
||||
const G& gas, const A& soln) {
|
||||
std::vector<std::string> names;
|
||||
makeTransportDataLabels(gas, names);
|
||||
writePlotFile(fname, fmt, title, names, soln);
|
||||
}
|
||||
@@ -77,8 +79,8 @@ int transport_example2(int job) {
|
||||
}
|
||||
|
||||
// make a Tecplot data file and an Excel spreadsheet
|
||||
string plotTitle = "transport example 2: "
|
||||
"multicomponent transport properties";
|
||||
std::string plotTitle = "transport example 2: "
|
||||
"multicomponent transport properties";
|
||||
plotTransportSoln("tr2.dat", "TEC", plotTitle, gas, output);
|
||||
plotTransportSoln("tr2.csv", "XL", plotTitle, gas, output);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user