took out namespaces from headers
This commit is contained in:
parent
d1bc1e273c
commit
2d5f8c4a45
12 changed files with 50 additions and 70 deletions
|
|
@ -22,7 +22,6 @@
|
|||
#include "ckr_utils.h"
|
||||
#include "writelog.h"
|
||||
#include <cstdio>
|
||||
//#include "../stringUtils.h"
|
||||
#include <cstdlib>
|
||||
|
||||
using namespace std;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
#include <fstream>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
//using namespace std;
|
||||
|
||||
#include "ckr_defs.h"
|
||||
#include "Element.h"
|
||||
|
|
@ -58,17 +57,17 @@ namespace ckr {
|
|||
|
||||
bool readElementSection(elementList& elements);
|
||||
bool readSpeciesSection(speciesList& species);
|
||||
bool readThermoSection(vector<string>& names,
|
||||
bool readThermoSection(std::vector<std::string>& names,
|
||||
speciesTable& speciesData, vector_fp& temp,
|
||||
int& optionFlag, ostream& log);
|
||||
bool readReactionSection(const vector<string>& speciesNames,
|
||||
vector<string>& elementNames,
|
||||
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);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,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.).
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@
|
|||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <ostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace ckr {
|
||||
|
||||
|
|
@ -41,7 +41,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 +54,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 +72,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,18 +84,10 @@ public:
|
|||
};
|
||||
|
||||
/// a list (vector) of Elements
|
||||
typedef vector<Element> elementList;
|
||||
typedef std::vector<Element> elementList;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@
|
|||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace ckr {
|
||||
|
||||
Reaction forwardReaction(const Reaction& rxn) {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
using namespace std;
|
||||
#include <ostream>
|
||||
|
||||
#include "ckr_defs.h"
|
||||
#include "ckr_utils.h"
|
||||
|
|
@ -183,7 +183,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 +192,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,28 +231,28 @@ 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);
|
||||
|
|
|
|||
|
|
@ -11,15 +11,11 @@
|
|||
|
||||
#include <string>
|
||||
#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;
|
||||
|
||||
/**
|
||||
* A class for species in a reaction.
|
||||
|
|
@ -29,7 +25,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;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -58,19 +58,19 @@ 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;
|
||||
|
|
@ -91,7 +91,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
|
||||
|
|
@ -99,10 +99,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,9 +14,6 @@
|
|||
#include <string>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
//using namespace std;
|
||||
|
||||
//#include "../ctvector.h"
|
||||
|
||||
/// the namespace for the CKReader packaage
|
||||
namespace ckr {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
using namespace std;
|
||||
|
||||
#ifdef WIN32
|
||||
#define TYPENAME_KEYWORD
|
||||
|
|
@ -35,9 +34,9 @@ namespace ckr {
|
|||
*/
|
||||
|
||||
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_KEYWORD map<K,V>::const_iterator i = mp.begin();
|
||||
TYPENAME_KEYWORD std::map<K,V>::const_iterator i = mp.begin();
|
||||
for (; i != mp.end(); ++i) keys.push_back(i->first);
|
||||
}
|
||||
|
||||
|
|
@ -49,9 +48,9 @@ void getMapKeys(const map<K,V>& mp, vector<K>& keys) {
|
|||
*/
|
||||
|
||||
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_KEYWORD map<K,V>::const_iterator i = mp.begin();
|
||||
TYPENAME_KEYWORD std::map<K,V>::const_iterator i = mp.begin();
|
||||
for (; i != mp.end(); ++i) values.push_back(i->second);
|
||||
}
|
||||
|
||||
|
|
@ -120,10 +119,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=' ');
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -137,12 +136,12 @@ void getTokens(string& begin,
|
|||
*
|
||||
*/
|
||||
|
||||
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") ||
|
||||
|
|
@ -152,8 +151,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,15 +12,13 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
//using namespace std;
|
||||
|
||||
#include "Species.h"
|
||||
#include "Reaction.h"
|
||||
|
||||
//#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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue