added some 'const's
This commit is contained in:
parent
a9375b30c1
commit
0b4bde2ae0
6 changed files with 26 additions and 26 deletions
|
|
@ -35,12 +35,12 @@ namespace Cantera {
|
|||
|
||||
static void getSpeciesThermoTypes(XML_Node* node,
|
||||
int& has_nasa, int& has_shomate, int& has_simple) {
|
||||
XML_Node& sparray = *node;
|
||||
const XML_Node& sparray = *node;
|
||||
vector<XML_Node*> sp;
|
||||
sparray.getChildren("species",sp);
|
||||
int ns = sp.size();
|
||||
for (int n = 0; n < ns; n++) {
|
||||
XML_Node& th = sp[n]->child("thermo");
|
||||
const XML_Node& th = sp[n]->child("thermo");
|
||||
if (th.hasChild("NASA")) has_nasa = 1;
|
||||
if (th.hasChild("Shomate")) has_shomate = 1;
|
||||
if (th.hasChild("const_cp")) has_simple = 1;
|
||||
|
|
|
|||
|
|
@ -90,11 +90,11 @@ namespace Cantera {
|
|||
void setIndex(int m) { m_index = m; }
|
||||
|
||||
|
||||
void saveSpeciesData(XML_Node* data) {
|
||||
void saveSpeciesData(const XML_Node* data) {
|
||||
m_speciesData = data;
|
||||
}
|
||||
|
||||
XML_Node* speciesData() { return m_speciesData; }
|
||||
const XML_Node* speciesData() { return m_speciesData; }
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -634,7 +634,7 @@ namespace Cantera {
|
|||
/// Pointer to the species thermodynamic property manager
|
||||
SpeciesThermo* m_spthermo;
|
||||
|
||||
XML_Node* m_speciesData;
|
||||
const XML_Node* m_speciesData;
|
||||
|
||||
/// Index number
|
||||
int m_index;
|
||||
|
|
|
|||
|
|
@ -71,24 +71,24 @@ namespace ctml {
|
|||
string val,
|
||||
string type="");
|
||||
|
||||
void getFloatArray(XML_Node& node,
|
||||
void getFloatArray(const XML_Node& node,
|
||||
vector_fp& v, bool convert=true);
|
||||
|
||||
void getStringArray(XML_Node& node, vector<string>& v);
|
||||
void getMap(XML_Node& node, map<string, string>& m);
|
||||
void getPairs(XML_Node& node, vector<string>& key, vector<string>& val);
|
||||
void getStringArray(const XML_Node& node, vector<string>& v);
|
||||
void getMap(const XML_Node& node, map<string, string>& m);
|
||||
void getPairs(const XML_Node& node, vector<string>& key, vector<string>& val);
|
||||
|
||||
void getIntegers(XML_Node& node, map<string,int>& v);
|
||||
void getFloats(XML_Node& node, map<string,double>& v, bool convert=true);
|
||||
doublereal getFloat(XML_Node& parent, string name, string type="");
|
||||
void getStrings(XML_Node& node, map<string,string>& v);
|
||||
void getFunction(XML_Node& node, string& type, doublereal& xmin,
|
||||
void getIntegers(const XML_Node& node, map<string,int>& v);
|
||||
void getFloats(const XML_Node& node, map<string,double>& v, bool convert=true);
|
||||
doublereal getFloat(const XML_Node& parent, string name, string type="");
|
||||
void getStrings(const XML_Node& node, map<string,string>& v);
|
||||
void getFunction(const XML_Node& node, string& type, doublereal& xmin,
|
||||
doublereal& xmax, vector_fp& coeffs);
|
||||
XML_Node* getByTitle(XML_Node& node, string title);
|
||||
void getString(XML_Node& node, string title, string& val,
|
||||
string& type);
|
||||
|
||||
string getString(XML_Node& parent, string name);
|
||||
string getString(const XML_Node& parent, string name);
|
||||
|
||||
// these are defined in ct2ctml.cpp
|
||||
void get_CTML_Tree(XML_Node*, string file);
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ namespace Cantera {
|
|||
sz += domain(m).nComponents();
|
||||
}
|
||||
else {
|
||||
XML_Node& node = *d;
|
||||
const XML_Node& node = *d;
|
||||
xd.push_back(d);
|
||||
np = intValue(node["points"]);
|
||||
nv = intValue(node["components"]);
|
||||
|
|
|
|||
|
|
@ -1039,12 +1039,12 @@ namespace Cantera {
|
|||
s.close();
|
||||
int k;
|
||||
|
||||
XML_Node* f = root.findID(id);
|
||||
const XML_Node* f = root.findID(id);
|
||||
if (!f) {
|
||||
throw CanteraError("StFlow::restore","No solution with id = "+id);
|
||||
}
|
||||
|
||||
XML_Node& flow = f->child("flowfield");
|
||||
const XML_Node& flow = f->child("flowfield");
|
||||
f = &flow;
|
||||
|
||||
//if (f->name() != "flowfield") {
|
||||
|
|
@ -1056,7 +1056,7 @@ namespace Cantera {
|
|||
f->getChildren("string",str);
|
||||
int nstr = str.size();
|
||||
for (int istr = 0; istr < nstr; istr++) {
|
||||
XML_Node& nd = *str[istr];
|
||||
const XML_Node& nd = *str[istr];
|
||||
writelog(nd["title"]+": "+nd.value()+"\n");
|
||||
}
|
||||
|
||||
|
|
@ -1069,7 +1069,7 @@ namespace Cantera {
|
|||
string nm;
|
||||
bool readgrid = false, wrote_header = false;
|
||||
for (n = 0; n < nd; n++) {
|
||||
XML_Node& fa = *d[n];
|
||||
const XML_Node& fa = *d[n];
|
||||
nm = fa["title"];
|
||||
if (nm == "z") {
|
||||
getFloatArray(fa,x,false);
|
||||
|
|
@ -1103,7 +1103,7 @@ namespace Cantera {
|
|||
|
||||
writelog("Importing datasets:\n");
|
||||
for (n = 0; n < nd; n++) {
|
||||
XML_Node& fa = *d[n];
|
||||
const XML_Node& fa = *d[n];
|
||||
nm = fa["title"];
|
||||
getFloatArray(fa,x,false);
|
||||
if (nm == "u") {
|
||||
|
|
@ -1184,7 +1184,7 @@ namespace Cantera {
|
|||
|
||||
|
||||
|
||||
void StFlow::restore(XML_Node& dom, doublereal* soln) {
|
||||
void StFlow::restore(const XML_Node& dom, doublereal* soln) {
|
||||
|
||||
vector<string> ignored;
|
||||
int nsp = m_thermo->nSpecies();
|
||||
|
|
@ -1194,7 +1194,7 @@ namespace Cantera {
|
|||
dom.getChildren("string",str);
|
||||
int nstr = str.size();
|
||||
for (int istr = 0; istr < nstr; istr++) {
|
||||
XML_Node& nd = *str[istr];
|
||||
const XML_Node& nd = *str[istr];
|
||||
writelog(nd["title"]+": "+nd.value()+"\n");
|
||||
}
|
||||
|
||||
|
|
@ -1212,7 +1212,7 @@ namespace Cantera {
|
|||
string nm;
|
||||
bool readgrid = false, wrote_header = false;
|
||||
for (n = 0; n < nd; n++) {
|
||||
XML_Node& fa = *d[n];
|
||||
const XML_Node& fa = *d[n];
|
||||
nm = fa["title"];
|
||||
if (nm == "z") {
|
||||
getFloatArray(fa,x,false);
|
||||
|
|
@ -1232,7 +1232,7 @@ namespace Cantera {
|
|||
|
||||
writelog("Importing datasets:\n");
|
||||
for (n = 0; n < nd; n++) {
|
||||
XML_Node& fa = *d[n];
|
||||
const XML_Node& fa = *d[n];
|
||||
nm = fa["title"];
|
||||
getFloatArray(fa,x,false);
|
||||
if (nm == "u") {
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ namespace Cantera {
|
|||
void restore(int job, string fname, string id, int& size_z,
|
||||
doublereal* z, int& size_soln, doublereal* soln);
|
||||
|
||||
virtual void restore(XML_Node& dom, doublereal* soln);
|
||||
virtual void restore(const XML_Node& dom, doublereal* soln);
|
||||
|
||||
// overloaded in subclasses
|
||||
virtual string flowType() { return "<none>"; }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue