Eliminated some shadowing of member variables by function arguments

This commit is contained in:
Ray Speth 2013-02-14 01:03:19 +00:00
parent 70b08a6891
commit 4e3a79394b
25 changed files with 256 additions and 261 deletions

View file

@ -82,8 +82,8 @@ public:
}
virtual void install(const std::string& name, size_t index, int type,
const doublereal* c, doublereal minTemp, doublereal maxTemp,
doublereal refPressure) {
const doublereal* c, doublereal minTemp_, doublereal maxTemp_,
doublereal refPressure_) {
m_be = c[1];
m_nFreqs = int(c[0]);
for (size_t n = 0; n < m_nFreqs; n++) {
@ -91,9 +91,9 @@ public:
}
m_index = index;
m_lowT = minTemp;
m_highT = maxTemp;
m_Pref = refPressure;
m_lowT = minTemp_;
m_highT = maxTemp_;
m_Pref = refPressure_;
}

View file

@ -732,9 +732,9 @@ public:
private:
GibbsExcessVPSSTP* geThermo;
// Temporary vectors that I don't want to allocate every time the function is called
mutable vector_fp y;
mutable vector_fp dlnActCoeff_NeutralMolecule;
mutable vector_fp dX_NeutralMolecule;
mutable vector_fp y_;
mutable vector_fp dlnActCoeff_NeutralMolecule_;
mutable vector_fp dX_NeutralMolecule_;
//! If true then we own the underlying neutral Molecule Phase
/*!

View file

@ -142,17 +142,17 @@ public:
* - c[2] = \f$ S_k^o(T_0, p_{ref}) \f$ (J/kmol K)
* - c[3] = \f$ {Cp}_k^o(T_0, p_{ref}) \f$ (J(kmol K)
*
* @param minTemp minimum temperature for which this parameterization
* @param minTemp_ minimum temperature for which this parameterization
* is valid.
* @param maxTemp maximum temperature for which this parameterization
* @param maxTemp_ maximum temperature for which this parameterization
* is valid.
* @param refPressure standard-state pressure for this
* @param refPressure_ standard-state pressure for this
* parameterization.
*
* @see ConstCpPoly
*/
virtual void install(const std::string& name, size_t index, int type, const doublereal* c,
doublereal minTemp, doublereal maxTemp, doublereal refPressure) {
doublereal minTemp_, doublereal maxTemp_, doublereal refPressure_) {
m_logt0.push_back(log(c[0]));
m_t0.push_back(c[0]);
@ -162,8 +162,8 @@ public:
m_index.push_back(index);
m_loc[index] = m_nspData;
m_nspData++;
doublereal tlow = minTemp;
doublereal thigh = maxTemp;
doublereal tlow = minTemp_;
doublereal thigh = maxTemp_;
if (tlow > m_tlow_max) {
m_tlow_max = tlow;
@ -180,17 +180,17 @@ public:
m_thigh[index] = thigh;
if (m_p0 < 0.0) {
m_p0 = refPressure;
} else if (fabs(m_p0 - refPressure) > 0.1) {
m_p0 = refPressure_;
} else if (fabs(m_p0 - refPressure_) > 0.1) {
std::string logmsg = " WARNING SimpleThermo: New Species, " + name +
", has a different reference pressure, "
+ fp2str(refPressure) + ", than existing reference pressure, " + fp2str(m_p0) + "\n";
+ fp2str(refPressure_) + ", than existing reference pressure, " + fp2str(m_p0) + "\n";
writelog(logmsg);
logmsg = " This is now a fatal error\n";
writelog(logmsg);
throw CanteraError("install()", "Species have different reference pressures");
}
m_p0 = refPressure;
m_p0 = refPressure_;
}
//! Install a new species thermodynamic property
@ -325,16 +325,16 @@ public:
* @param c Vector of coefficients used to set the
* parameters for the standard state.
* For the SimpleThermo object, there are 4 coefficients.
* @param minTemp output - Minimum temperature
* @param maxTemp output - Maximum temperature
* @param refPressure output - reference pressure (Pa).
* @param minTemp_ output - Minimum temperature
* @param maxTemp_ output - Maximum temperature
* @param refPressure_ output - reference pressure (Pa).
*
*/
virtual void reportParams(size_t index, int& type,
doublereal* const c,
doublereal& minTemp,
doublereal& maxTemp,
doublereal& refPressure) const {
doublereal& minTemp_,
doublereal& maxTemp_,
doublereal& refPressure_) const {
type = reportType(index);
size_t loc = m_loc[index];
if (type == SIMPLE) {
@ -342,9 +342,9 @@ public:
c[1] = m_h0_R[loc] * GasConstant;
c[2] = m_s0_R[loc] * GasConstant;
c[3] = m_cp0_R[loc] * GasConstant;
minTemp = m_tlow[loc];
maxTemp = m_thigh[loc];
refPressure = m_p0;
minTemp_ = m_tlow[loc];
maxTemp_ = m_thigh[loc];
refPressure_ = m_p0;
}
}

View file

@ -278,18 +278,18 @@ template<class T1, class T2>
void
SpeciesThermoDuo<T1, T2>::install(const std::string& name, size_t sp, int type,
const doublereal* c,
doublereal minTemp,
doublereal maxTemp,
doublereal refPressure)
doublereal minTemp_,
doublereal maxTemp_,
doublereal refPressure_)
{
m_p0 = refPressure;
m_p0 = refPressure_;
if (type == m_thermo1.ID) {
m_thermo1.install(name, sp, 0, c, minTemp, maxTemp,
refPressure);
m_thermo1.install(name, sp, 0, c, minTemp_, maxTemp_,
refPressure_);
speciesToType[sp] = m_thermo1.ID;
} else if (type == m_thermo2.ID) {
m_thermo2.install(name, sp, 0, c, minTemp, maxTemp,
refPressure);
m_thermo2.install(name, sp, 0, c, minTemp_, maxTemp_,
refPressure_);
speciesToType[sp] = m_thermo2.ID;
} else {
throw UnknownSpeciesThermo("SpeciesThermoDuo:install",type);
@ -320,17 +320,17 @@ template<class T1, class T2>
void
SpeciesThermoDuo<T1, T2>::reportParams(size_t index, int& type,
doublereal* const c,
doublereal& minTemp,
doublereal& maxTemp,
doublereal& refPressure) const
doublereal& minTemp_,
doublereal& maxTemp_,
doublereal& refPressure_) const
{
int ctype = reportType(index);
if (ctype == m_thermo1.ID) {
m_thermo1.reportParams(index, type, c, minTemp, maxTemp,
refPressure);
m_thermo1.reportParams(index, type, c, minTemp_, maxTemp_,
refPressure_);
} else if (ctype == m_thermo2.ID) {
m_thermo2.reportParams(index, type, c, minTemp, maxTemp,
refPressure);
m_thermo2.reportParams(index, type, c, minTemp_, maxTemp_,
refPressure_);
} else {
throw CanteraError(" ", "confused");
}

View file

@ -58,11 +58,11 @@ public:
* energy to SI units.
* @param units activation energy units
*/
doublereal actEnergyToSI(const std::string& units) {
if (m_act_u.find(units) != m_act_u.end()) {
return m_act_u[units];
doublereal actEnergyToSI(const std::string& units_) {
if (m_act_u.find(units_) != m_act_u.end()) {
return m_act_u[units_];
} else {
return toSI(units);
return toSI(units_);
}
}
@ -75,16 +75,16 @@ public:
*
* @param units String containing the units description
*/
doublereal toSI(const std::string& units) {
doublereal toSI(const std::string& units_) {
// if dimensionless, return 1.0
if (units == "") {
if (units_ == "") {
return 1.0;
}
doublereal f = 1.0, fctr;
int tsize;
std::string u = units, tok, tsub;
std::string u = units_, tok, tsub;
std::string::size_type k;
char action = '-';

View file

@ -368,20 +368,20 @@ XML_Node::XML_Node(const char* cnm) :
* @param parent Pointer to the parent for this node in the tree.
* A value of zero 0 indicates this is the top of the tree.
*/
XML_Node::XML_Node(const std::string& nm, XML_Node* const parent) :
XML_Node::XML_Node(const std::string& nm, XML_Node* const parent_) :
m_name(nm),
m_value(""),
m_parent(parent),
m_parent(parent_),
m_root(0),
m_locked(false),
m_nchildren(0),
m_iscomment(false),
m_linenum(0)
{
if (!parent) {
if (!parent_) {
m_root = this;
} else {
m_root = &(parent->root());
m_root = &(parent_->root());
}
}
@ -554,10 +554,10 @@ XML_Node& XML_Node::addChild(const char* cstring)
* @param value Value of the XML_Node - string
* @return Returns a reference to the created child XML_Node object
*/
XML_Node& XML_Node::addChild(const std::string& name, const std::string& value)
XML_Node& XML_Node::addChild(const std::string& name_, const std::string& value_)
{
XML_Node& c = addChild(name);
c.addValue(value);
XML_Node& c = addChild(name_);
c.addValue(value_);
return c;
}
@ -576,11 +576,11 @@ XML_Node& XML_Node::addChild(const std::string& name, const std::string& value)
*
* @return Returns a reference to the created child XML_Node object
*/
XML_Node& XML_Node::addChild(const std::string& name, const doublereal value,
XML_Node& XML_Node::addChild(const std::string& name_, const doublereal value_,
const std::string& fmt)
{
XML_Node& c = addChild(name);
c.addValue(value, fmt);
XML_Node& c = addChild(name_);
c.addValue(value_, fmt);
return c;
}
@ -703,9 +703,9 @@ std::string XML_Node::operator()(const std::string& loc) const
* @param attrib String name for the attribute to be assigned
* @param value String value that the attribute will have
*/
void XML_Node::addAttribute(const std::string& attrib, const std::string& value)
void XML_Node::addAttribute(const std::string& attrib_, const std::string& value_)
{
m_attribs[attrib] = value;
m_attribs[attrib_] = value_;
}
// Add or modify an attribute to the double, value
@ -718,10 +718,10 @@ void XML_Node::addAttribute(const std::string& attrib, const std::string& value)
* @param fmt Format of the printf string conversion of the double.
* Default is "%g".
*/
void XML_Node::addAttribute(const std::string& attrib,
const doublereal value, const std::string& fmt)
void XML_Node::addAttribute(const std::string& attrib_,
const doublereal value_, const std::string& fmt)
{
m_attribs[attrib] = fp2str(value, fmt);
m_attribs[attrib_] = fp2str(value_, fmt);
}
// The operator[] is overloaded to provide a lookup capability
@ -1037,17 +1037,17 @@ XML_Node* XML_Node::findNameIDIndex(const std::string& nameTarget,
* This algorithm does a lateral search of first generation children
* first before diving deeper into each tree branch.
*/
XML_Node* XML_Node::findID(const std::string& id, const int depth) const
XML_Node* XML_Node::findID(const std::string& id_, const int depth) const
{
if (hasAttrib("id")) {
if (attrib("id") == id) {
if (attrib("id") == id_) {
return const_cast<XML_Node*>(this);
}
}
if (depth > 0) {
XML_Node* r = 0;
for (size_t i = 0; i < nChildren(); i++) {
r = m_children[i]->findID(id, depth-1);
r = m_children[i]->findID(id_, depth-1);
if (r != 0) {
return r;
}
@ -1170,10 +1170,10 @@ void XML_Node::build(std::istream& f)
XML_Reader r(f);
string nm, nm2, val;
XML_Node* node = this;
map<string, string> attribs;
map<string, string> node_attribs;
while (!f.eof()) {
attribs.clear();
nm = r.readTag(attribs);
node_attribs.clear();
nm = r.readTag(node_attribs);
if (nm == "EOF") {
break;
@ -1186,7 +1186,7 @@ void XML_Node::build(std::istream& f)
nm2 = nm.substr(0,nm.size()-1);
node = &node->addChild(nm2);
node->addValue("");
node->attribs() = attribs;
node->attribs() = node_attribs;
node->setLineNumber(lnum);
node = node->parent();
} else if (nm[0] != '/') {
@ -1194,7 +1194,7 @@ void XML_Node::build(std::istream& f)
node = &node->addChild(nm);
val = r.readValue();
node->addValue(val);
node->attribs() = attribs;
node->attribs() = node_attribs;
node->setLineNumber(lnum);
} else if (nm.substr(0,2) == "--") {
if (nm.substr(nm.size()-2,2) == "--") {
@ -1335,11 +1335,11 @@ void XML_Node::unlock()
* with the matching name
*/
void XML_Node::getChildren(const std::string& nm,
std::vector<XML_Node*>& children) const
std::vector<XML_Node*>& children_) const
{
for (size_t i = 0; i < nChildren(); i++) {
if (child(i).name() == nm) {
children.push_back(&child(i));
children_.push_back(&child(i));
}
}
}
@ -1535,11 +1535,11 @@ XML_Node& XML_Node::root() const
return *m_root;
}
void XML_Node::setRoot(const XML_Node& root)
void XML_Node::setRoot(const XML_Node& newRoot)
{
m_root = const_cast<XML_Node*>(&root);
m_root = const_cast<XML_Node*>(&newRoot);
for (size_t i = 0; i < m_nchildren; i++) {
m_children[i]->setRoot(root);
m_children[i]->setRoot(newRoot);
}
}

View file

@ -53,7 +53,7 @@ DebyeHuckel::DebyeHuckel() :
}
DebyeHuckel::DebyeHuckel(const std::string& inputFile,
const std::string& id) :
const std::string& id_) :
MolalityVPSSTP(),
m_formDH(DHFORM_DILUTE_LIMIT),
m_formGC(2),
@ -72,10 +72,10 @@ DebyeHuckel::DebyeHuckel(const std::string& inputFile,
m_npActCoeff[0] = 0.1127;
m_npActCoeff[1] = -0.01049;
m_npActCoeff[2] = 1.545E-3;
initThermoFile(inputFile, id);
initThermoFile(inputFile, id_);
}
DebyeHuckel::DebyeHuckel(XML_Node& phaseRoot, const std::string& id) :
DebyeHuckel::DebyeHuckel(XML_Node& phaseRoot, const std::string& id_) :
MolalityVPSSTP(),
m_formDH(DHFORM_DILUTE_LIMIT),
m_formGC(2),
@ -94,7 +94,7 @@ DebyeHuckel::DebyeHuckel(XML_Node& phaseRoot, const std::string& id) :
m_npActCoeff[0] = 0.1127;
m_npActCoeff[1] = -0.01049;
m_npActCoeff[2] = 1.545E-3;
importPhase(*findXMLPhase(&phaseRoot, id), this);
importPhase(*findXMLPhase(&phaseRoot, id_), this);
}
DebyeHuckel::DebyeHuckel(const DebyeHuckel& b) :
@ -623,11 +623,11 @@ static int interp_est(const std::string& estString)
}
void DebyeHuckel::
initThermoXML(XML_Node& phaseNode, const std::string& id)
initThermoXML(XML_Node& phaseNode, const std::string& id_)
{
if (id.size() > 0) {
if (id_.size() > 0) {
std::string idp = phaseNode.id();
if (idp != id) {
if (idp != id_) {
throw CanteraError("DebyeHuckel::initThermoXML",
"phasenode and Id are incompatible");
}

View file

@ -412,7 +412,7 @@ addElement(const XML_Node& e)
*/
void Elements::
addUniqueElement(const std::string& symbol,
doublereal weight, int atomicNumber, doublereal entropy298,
doublereal weight, int atomicNumber_, doublereal entropy298,
int elem_type)
{
if (weight == -12345.0) {
@ -442,7 +442,7 @@ addUniqueElement(const std::string& symbol,
}
m_atomicWeights.push_back(weight);
m_elementNames.push_back(symbol);
m_atomicNumbers.push_back(atomicNumber);
m_atomicNumbers.push_back(atomicNumber_);
m_entropy298.push_back(entropy298);
if (symbol == "E") {
m_elem_type.push_back(CT_ELEM_TYPE_ELECTRONCHARGE);

View file

@ -32,18 +32,18 @@ FixedChemPotSSTP::FixedChemPotSSTP() :
{
}
FixedChemPotSSTP::FixedChemPotSSTP(const std::string& infile, std::string id) :
FixedChemPotSSTP::FixedChemPotSSTP(const std::string& infile, std::string id_) :
SingleSpeciesTP(),
chemPot_(0.0)
{
XML_Node* root = get_XML_File(infile);
if (id == "-") {
id = "";
if (id_ == "-") {
id_ = "";
}
XML_Node* xphase = get_XML_NameID("phase", std::string("#")+id, root);
XML_Node* xphase = get_XML_NameID("phase", std::string("#")+id_, root);
if (!xphase) {
throw CanteraError("FixedChemPotSSTP::FixedChemPotSSTP",
"Couldn't find phase name in file:" + id);
"Couldn't find phase name in file:" + id_);
}
// Check the model name to ensure we have compatibility
const XML_Node& th = xphase->child("thermo");
@ -54,14 +54,13 @@ FixedChemPotSSTP::FixedChemPotSSTP(const std::string& infile, std::string id) :
}
importPhase(*xphase, this);
}
FixedChemPotSSTP::FixedChemPotSSTP(XML_Node& xmlphase, const std::string& id) :
FixedChemPotSSTP::FixedChemPotSSTP(XML_Node& xmlphase, const std::string& id_) :
SingleSpeciesTP(),
chemPot_(0.0)
{
if (id != "") {
if (id_ != "") {
std::string idxml = xmlphase["id"];
if (id != idxml) {
if (id_ != idxml) {
throw CanteraError("FixedChemPotSSTP::FixedChemPotSSTP",
"id's don't match");
}
@ -313,7 +312,7 @@ void FixedChemPotSSTP::initThermo()
SingleSpeciesTP::initThermo();
}
void FixedChemPotSSTP::initThermoXML(XML_Node& phaseNode, const std::string& id)
void FixedChemPotSSTP::initThermoXML(XML_Node& phaseNode, const std::string& id_)
{
/*
* Find the Thermo XML node
@ -331,7 +330,7 @@ void FixedChemPotSSTP::initThermoXML(XML_Node& phaseNode, const std::string& id)
double val = ctml::getFloatDefaultUnits(tnode, "chemicalPotential", "J/kmol");
chemPot_ = val;
}
SingleSpeciesTP::initThermoXML(phaseNode, id);
SingleSpeciesTP::initThermoXML(phaseNode, id_);
}
void FixedChemPotSSTP::setParameters(int n, doublereal* const c)

View file

@ -107,16 +107,16 @@ void GeneralSpeciesThermo::install(const std::string& name,
size_t index,
int type,
const doublereal* c,
doublereal minTemp,
doublereal maxTemp,
doublereal refPressure)
doublereal minTemp_,
doublereal maxTemp_,
doublereal refPressure_)
{
/*
* Resize the arrays if necessary, filling the empty
* slots with the zero pointer.
*/
if (minTemp <= 0.0) {
if (minTemp_ <= 0.0) {
throw CanteraError("Error in GeneralSpeciesThermo.cpp",
" Cannot take 0 tmin as input. \n\n");
}
@ -133,39 +133,39 @@ void GeneralSpeciesThermo::install(const std::string& name,
switch (type) {
case NASA1:
m_sp[index] = new NasaPoly1(index, minTemp, maxTemp,
refPressure, c);
m_sp[index] = new NasaPoly1(index, minTemp_, maxTemp_,
refPressure_, c);
break;
case SHOMATE1:
m_sp[index] = new ShomatePoly(index, minTemp, maxTemp,
refPressure, c);
m_sp[index] = new ShomatePoly(index, minTemp_, maxTemp_,
refPressure_, c);
break;
case CONSTANT_CP:
case SIMPLE:
m_sp[index] = new ConstCpPoly(index, minTemp, maxTemp,
refPressure, c);
m_sp[index] = new ConstCpPoly(index, minTemp_, maxTemp_,
refPressure_, c);
break;
case MU0_INTERP:
m_sp[index] = new Mu0Poly(index, minTemp, maxTemp,
refPressure, c);
m_sp[index] = new Mu0Poly(index, minTemp_, maxTemp_,
refPressure_, c);
break;
case SHOMATE2:
m_sp[index] = new ShomatePoly2(index, minTemp, maxTemp,
refPressure, c);
m_sp[index] = new ShomatePoly2(index, minTemp_, maxTemp_,
refPressure_, c);
break;
case NASA2:
m_sp[index] = new NasaPoly2(index, minTemp, maxTemp,
refPressure, c);
m_sp[index] = new NasaPoly2(index, minTemp_, maxTemp_,
refPressure_, c);
break;
case STAT:
m_sp[index] = new StatMech(index, minTemp, maxTemp,
refPressure, c, name);
m_sp[index] = new StatMech(index, minTemp_, maxTemp_,
refPressure_, c, name);
break;
case ADSORBATE:
m_sp[index] = new Adsorbate(index, minTemp, maxTemp,
refPressure, c);
m_sp[index] = new Adsorbate(index, minTemp_, maxTemp_,
refPressure_, c);
break;
default:
throw UnknownSpeciesThermoModel(
@ -177,8 +177,8 @@ void GeneralSpeciesThermo::install(const std::string& name,
cout << "Null m_sp... index = " << index << endl;
cout << "type = " << type << endl;
}
m_tlow_max = max(minTemp, m_tlow_max);
m_thigh_min = min(maxTemp, m_thigh_min);
m_tlow_max = max(minTemp_, m_tlow_max);
m_thigh_min = min(maxTemp_, m_thigh_min);
}
// Install a new species thermodynamic property
@ -212,11 +212,8 @@ void GeneralSpeciesThermo::install_STIT(SpeciesThermoInterpType* stit_ptr)
/*
* Calculate max and min
*/
double minTemp = stit_ptr->minTemp();
double maxTemp = stit_ptr->maxTemp();
m_tlow_max = max(minTemp, m_tlow_max);
m_thigh_min = min(maxTemp, m_thigh_min);
m_tlow_max = max(stit_ptr->minTemp(), m_tlow_max);
m_thigh_min = min(stit_ptr->maxTemp(), m_thigh_min);
}
@ -285,13 +282,13 @@ int GeneralSpeciesThermo::reportType(size_t index) const
*/
void GeneralSpeciesThermo::
reportParams(size_t index, int& type, doublereal* const c,
doublereal& minTemp, doublereal& maxTemp, doublereal& refPressure) const
doublereal& minTemp_, doublereal& maxTemp_, doublereal& refPressure_) const
{
SpeciesThermoInterpType* sp = m_sp[index];
size_t n;
if (sp) {
sp->reportParameters(n, type, minTemp, maxTemp,
refPressure, c);
sp->reportParameters(n, type, minTemp_, maxTemp_,
refPressure_, c);
if (n != index) {
throw CanteraError("GeneralSpeciesThermo::reportParams",
"Internal error encountered");

View file

@ -81,7 +81,7 @@ HMWSoln::HMWSoln() :
}
}
HMWSoln::HMWSoln(const std::string& inputFile, const std::string& id) :
HMWSoln::HMWSoln(const std::string& inputFile, const std::string& id_) :
MolalityVPSSTP(),
m_formPitzer(PITZERFORM_BASE),
m_formPitzerTemp(PITZER_TEMP_CONSTANT),
@ -129,10 +129,10 @@ HMWSoln::HMWSoln(const std::string& inputFile, const std::string& id) :
elambda[i] = 0.0;
elambda1[i] = 0.0;
}
initThermoFile(inputFile, id);
initThermoFile(inputFile, id_);
}
HMWSoln::HMWSoln(XML_Node& phaseRoot, const std::string& id) :
HMWSoln::HMWSoln(XML_Node& phaseRoot, const std::string& id_) :
MolalityVPSSTP(),
m_formPitzer(PITZERFORM_BASE),
m_formPitzerTemp(PITZER_TEMP_CONSTANT),
@ -180,7 +180,7 @@ HMWSoln::HMWSoln(XML_Node& phaseRoot, const std::string& id) :
elambda[i] = 0.0;
elambda1[i] = 0.0;
}
importPhase(*findXMLPhase(&phaseRoot, id), this);
importPhase(*findXMLPhase(&phaseRoot, id_), this);
}
HMWSoln::HMWSoln(const HMWSoln& b) :

View file

@ -1136,12 +1136,12 @@ void HMWSoln::constructPhaseXML(XML_Node& phaseNode, std::string id)
}
void HMWSoln::
initThermoXML(XML_Node& phaseNode, const std::string& id)
initThermoXML(XML_Node& phaseNode, const std::string& id_)
{
string stemp;
if (id.size() > 0) {
if (id_.size() > 0) {
string idp = phaseNode.id();
if (idp != id) {
if (idp != id_) {
throw CanteraError("HMWSoln::initThermoXML",
"phasenode and Id are incompatible");
}
@ -1609,7 +1609,7 @@ initThermoXML(XML_Node& phaseNode, const std::string& id)
calcMCCutoffParams_();
setMoleFSolventMin(1.0E-5);
MolalityVPSSTP::initThermoXML(phaseNode, id);
MolalityVPSSTP::initThermoXML(phaseNode, id_);
/*
* Lastly calculate the charge balance and then add stuff until the charges compensate
*/

View file

@ -109,11 +109,11 @@ doublereal IdealGasPhase::cv_tr(doublereal atomicity) const
int dum = 0;
int type = 0;
doublereal c[12];
doublereal minTemp;
doublereal maxTemp;
doublereal refPressure;
doublereal minTemp_;
doublereal maxTemp_;
doublereal refPressure_;
m_spthermo->reportParams(dum, type, c, minTemp, maxTemp, refPressure);
m_spthermo->reportParams(dum, type, c, minTemp_, maxTemp_, refPressure_);
if (type != 111) {
throw CanteraError("Error in IdealGasPhase.cpp", "cv_tr only supported for StatMech!. \n\n");
@ -140,13 +140,13 @@ doublereal IdealGasPhase::cv_vib(const int k, const doublereal T) const
int dum = 0;
int type = 0;
doublereal c[12];
doublereal minTemp;
doublereal maxTemp;
doublereal refPressure;
doublereal minTemp_;
doublereal maxTemp_;
doublereal refPressure_;
c[0] = temperature();
m_spthermo->reportParams(dum, type, c, minTemp, maxTemp, refPressure);
m_spthermo->reportParams(dum, type, c, minTemp_, maxTemp_, refPressure_);
// basic sanity check
if (type != 111) {

View file

@ -111,7 +111,7 @@ IdealMolalSoln::IdealMolalSoln(const std::string& inputFile,
initThermoFile(inputFile, id);
}
IdealMolalSoln::IdealMolalSoln(XML_Node& root, const std::string& id) :
IdealMolalSoln::IdealMolalSoln(XML_Node& root, const std::string& id_) :
MolalityVPSSTP(),
m_formGC(2),
IMS_typeCutoff_(0),
@ -130,7 +130,7 @@ IdealMolalSoln::IdealMolalSoln(XML_Node& root, const std::string& id) :
IMS_agCut_(0.0),
IMS_bgCut_(0.0)
{
importPhase(*findXMLPhase(&root, id), this);
importPhase(*findXMLPhase(&root, id_), this);
}
IdealMolalSoln::~IdealMolalSoln()
@ -508,7 +508,7 @@ void IdealMolalSoln::initThermo()
MolalityVPSSTP::initThermo();
}
void IdealMolalSoln::initThermoXML(XML_Node& phaseNode, const std::string& id)
void IdealMolalSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_)
{
/*
* Find the Thermo XML node
@ -523,9 +523,9 @@ void IdealMolalSoln::initThermoXML(XML_Node& phaseNode, const std::string& id)
*/
initThermo();
if (id.size() > 0) {
if (id_.size() > 0) {
std::string idp = phaseNode.id();
if (idp != id) {
if (idp != id_) {
throw CanteraError("IdealMolalSoln::initThermo",
"phasenode and Id are incompatible");
}
@ -666,7 +666,7 @@ void IdealMolalSoln::initThermoXML(XML_Node& phaseNode, const std::string& id)
calcIMSCutoffParams_();
}
MolalityVPSSTP::initThermoXML(phaseNode, id);
MolalityVPSSTP::initThermoXML(phaseNode, id_);
setMoleFSolventMin(1.0E-5);

View file

@ -35,7 +35,7 @@ IdealSolidSolnPhase::IdealSolidSolnPhase(int formGC) :
}
IdealSolidSolnPhase::IdealSolidSolnPhase(const std::string& inputFile,
const std::string& id, int formGC) :
const std::string& id_, int formGC) :
ThermoPhase(),
m_formGC(formGC),
m_Pref(OneAtm),
@ -46,10 +46,10 @@ IdealSolidSolnPhase::IdealSolidSolnPhase(const std::string& inputFile,
throw CanteraError(" IdealSolidSolnPhase Constructor",
" Illegal value of formGC");
}
initThermoFile(inputFile, id);
initThermoFile(inputFile, id_);
}
IdealSolidSolnPhase::IdealSolidSolnPhase(XML_Node& root, const std::string& id,
IdealSolidSolnPhase::IdealSolidSolnPhase(XML_Node& root, const std::string& id_,
int formGC) :
ThermoPhase(),
m_formGC(formGC),
@ -61,7 +61,7 @@ IdealSolidSolnPhase::IdealSolidSolnPhase(XML_Node& root, const std::string& id,
throw CanteraError(" IdealSolidSolnPhase Constructor",
" Illegal value of formGC");
}
importPhase(*findXMLPhase(&root, id), this);
importPhase(*findXMLPhase(&root, id_), this);
}
IdealSolidSolnPhase::IdealSolidSolnPhase(const IdealSolidSolnPhase& b)
@ -556,12 +556,12 @@ void IdealSolidSolnPhase::initThermo()
{
}
void IdealSolidSolnPhase::initThermoXML(XML_Node& phaseNode, const std::string& id)
void IdealSolidSolnPhase::initThermoXML(XML_Node& phaseNode, const std::string& id_)
{
string subname = "IdealSolidSolnPhase::initThermoXML";
if (id.size() > 0) {
if (id_.size() > 0) {
string idp = phaseNode.id();
if (idp != id) {
if (idp != id_) {
throw CanteraError(subname.c_str(),
"phasenode and Id are incompatible");
}
@ -633,7 +633,7 @@ void IdealSolidSolnPhase::initThermoXML(XML_Node& phaseNode, const std::string&
* Call the base initThermo, which handles setting the initial
* state.
*/
ThermoPhase::initThermoXML(phaseNode, id);
ThermoPhase::initThermoXML(phaseNode, id_);
}
void IdealSolidSolnPhase::

View file

@ -31,19 +31,19 @@ IdealSolnGasVPSS::IdealSolnGasVPSS() :
{
}
IdealSolnGasVPSS::IdealSolnGasVPSS(const std::string& infile, std::string id) :
IdealSolnGasVPSS::IdealSolnGasVPSS(const std::string& infile, std::string id_) :
VPStandardStateTP(),
m_idealGas(0),
m_formGC(0)
{
XML_Node* root = get_XML_File(infile);
if (id == "-") {
id = "";
if (id_ == "-") {
id_ = "";
}
XML_Node* xphase = get_XML_NameID("phase", std::string("#")+id, root);
XML_Node* xphase = get_XML_NameID("phase", std::string("#")+id_, root);
if (!xphase) {
throw CanteraError("newPhase",
"Couldn't find phase named \"" + id + "\" in file, " + infile);
"Couldn't find phase named \"" + id_ + "\" in file, " + infile);
}
importPhase(*xphase, this);
}
@ -372,7 +372,7 @@ void IdealSolnGasVPSS::initLengths()
m_pp.resize(m_kk, 0.0);
}
void IdealSolnGasVPSS::initThermoXML(XML_Node& phaseNode, const std::string& id)
void IdealSolnGasVPSS::initThermoXML(XML_Node& phaseNode, const std::string& id_)
{
IdealSolnGasVPSS::initLengths();
@ -421,7 +421,7 @@ void IdealSolnGasVPSS::initThermoXML(XML_Node& phaseNode, const std::string& id)
}
}
VPStandardStateTP::initThermoXML(phaseNode, id);
VPStandardStateTP::initThermoXML(phaseNode, id_);
}
void IdealSolnGasVPSS::setParametersFromXML(const XML_Node& thermoNode)

View file

@ -50,7 +50,7 @@ IonsFromNeutralVPSSTP::IonsFromNeutralVPSSTP() :
}
IonsFromNeutralVPSSTP::IonsFromNeutralVPSSTP(const std::string& inputFile,
const std::string& id,
const std::string& id_,
ThermoPhase* neutralPhase) :
GibbsExcessVPSSTP(),
ionSolnType_(cIonSolnType_SINGLEANION),
@ -69,7 +69,7 @@ IonsFromNeutralVPSSTP::IonsFromNeutralVPSSTP(const std::string& inputFile,
if (neutralPhase) {
IOwnNThermoPhase_ = false;
}
constructPhaseFile(inputFile, id);
constructPhaseFile(inputFile, id_);
geThermo = dynamic_cast<GibbsExcessVPSSTP*>(neutralMoleculePhase_);
//y.resize(numNeutralMoleculeSpecies_,0.0);
//size_t numNeutMolSpec = geThermo->nSpecies();
@ -78,7 +78,7 @@ IonsFromNeutralVPSSTP::IonsFromNeutralVPSSTP(const std::string& inputFile,
}
IonsFromNeutralVPSSTP::IonsFromNeutralVPSSTP(XML_Node& phaseRoot,
const std::string& id, ThermoPhase* neutralPhase) :
const std::string& id_, ThermoPhase* neutralPhase) :
GibbsExcessVPSSTP(),
ionSolnType_(cIonSolnType_SINGLEANION),
numNeutralMoleculeSpecies_(0),
@ -97,12 +97,12 @@ IonsFromNeutralVPSSTP::IonsFromNeutralVPSSTP(XML_Node& phaseRoot,
if (neutralPhase) {
IOwnNThermoPhase_ = false;
}
constructPhaseXML(phaseRoot, id);
constructPhaseXML(phaseRoot, id_);
geThermo = dynamic_cast<GibbsExcessVPSSTP*>(neutralMoleculePhase_);
y.resize(numNeutralMoleculeSpecies_,0.0);
y_.resize(numNeutralMoleculeSpecies_,0.0);
size_t numNeutMolSpec = geThermo->nSpecies();
dlnActCoeff_NeutralMolecule.resize(numNeutMolSpec);
dX_NeutralMolecule.resize(numNeutMolSpec);
dlnActCoeff_NeutralMolecule_.resize(numNeutMolSpec);
dX_NeutralMolecule_.resize(numNeutMolSpec);
}
IonsFromNeutralVPSSTP::IonsFromNeutralVPSSTP(const IonsFromNeutralVPSSTP& b) :
@ -170,9 +170,9 @@ operator=(const IonsFromNeutralVPSSTP& b)
passThroughList_ = b.passThroughList_;
numPassThroughSpecies_ = b.numPassThroughSpecies_;
y = b.y;
dlnActCoeff_NeutralMolecule = b.dlnActCoeff_NeutralMolecule;
dX_NeutralMolecule = b.dX_NeutralMolecule;
y_ = b.y_;
dlnActCoeff_NeutralMolecule_ = b.dlnActCoeff_NeutralMolecule_;
dX_NeutralMolecule_ = b.dX_NeutralMolecule_;
IOwnNThermoPhase_ = b.IOwnNThermoPhase_;
moleFractionsTmp_ = b.moleFractionsTmp_;
@ -201,7 +201,7 @@ IonsFromNeutralVPSSTP::duplMyselfAsThermoPhase() const
return new IonsFromNeutralVPSSTP(*this);
}
void IonsFromNeutralVPSSTP::constructPhaseFile(std::string inputFile, std::string id)
void IonsFromNeutralVPSSTP::constructPhaseFile(std::string inputFile, std::string id_)
{
if (inputFile.size() == 0) {
@ -221,23 +221,23 @@ void IonsFromNeutralVPSSTP::constructPhaseFile(std::string inputFile, std::strin
XML_Node& phaseNode_XML = xml();
XML_Node* fxml = new XML_Node();
fxml->build(fin);
XML_Node* fxml_phase = findXMLPhase(fxml, id);
XML_Node* fxml_phase = findXMLPhase(fxml, id_);
if (!fxml_phase) {
throw CanteraError("MargulesVPSSTP:constructPhaseFile",
"ERROR: Can not find phase named " +
id + " in file named " + inputFile);
id_ + " in file named " + inputFile);
}
fxml_phase->copy(&phaseNode_XML);
constructPhaseXML(*fxml_phase, id);
constructPhaseXML(*fxml_phase, id_);
delete fxml;
}
void IonsFromNeutralVPSSTP::constructPhaseXML(XML_Node& phaseNode, std::string id)
void IonsFromNeutralVPSSTP::constructPhaseXML(XML_Node& phaseNode, std::string id_)
{
string stemp;
if (id.size() > 0) {
if (id_.size() > 0) {
string idp = phaseNode.id();
if (idp != id) {
if (idp != id_) {
throw CanteraError("IonsFromNeutralVPSSTP::constructPhaseXML",
"phasenode and Id are incompatible");
}
@ -728,7 +728,7 @@ void IonsFromNeutralVPSSTP::getNeutralMoleculeMoleGrads(const doublereal* const
//! Zero the vector we are trying to find.
for (size_t k = 0; k < numNeutralMoleculeSpecies_; k++) {
y[k] = 0.0;
y_[k] = 0.0;
dy[k] = 0.0;
}
@ -753,7 +753,7 @@ void IonsFromNeutralVPSSTP::getNeutralMoleculeMoleGrads(const doublereal* const
AssertTrace(fmij != 0.0);
const doublereal temp = 1.0/fmij;
dy[jNeut] += dx[icat] * temp;
y[jNeut] += moleFractions_[icat] * temp;
y_[jNeut] += moleFractions_[icat] * temp;
}
}
@ -763,7 +763,7 @@ void IonsFromNeutralVPSSTP::getNeutralMoleculeMoleGrads(const doublereal* const
fmij = fm_neutralMolec_ions_[ icat + jNeut * m_kk];
const doublereal temp = 1.0/fmij;
dy[jNeut] += dx[icat] * temp;
y[jNeut] += moleFractions_[icat] * temp;
y_[jNeut] += moleFractions_[icat] * temp;
}
#ifdef DEBUG_MODE_NOT
//check dy sum to zero
@ -794,12 +794,12 @@ void IonsFromNeutralVPSSTP::getNeutralMoleculeMoleGrads(const doublereal* const
sumy = 0.0;
sumdy = 0.0;
for (size_t k = 0; k < numNeutralMoleculeSpecies_; k++) {
sumy += y[k];
sumy += y_[k];
sumdy += dy[k];
}
sumy = 1.0 / sumy;
for (size_t k = 0; k < numNeutralMoleculeSpecies_; k++) {
dy[k] = dy[k] * sumy - y[k]*sumdy*sumy*sumy;
dy[k] = dy[k] * sumy - y_[k]*sumdy*sumy*sumy;
}
break;
@ -894,9 +894,9 @@ void IonsFromNeutralVPSSTP::initLengths()
dlnActCoeffdlnN_diag_NeutralMolecule_.resize(numNeutralMoleculeSpecies_);
dlnActCoeffdlnN_NeutralMolecule_.resize(numNeutralMoleculeSpecies_, numNeutralMoleculeSpecies_, 0.0);
y.resize(numNeutralMoleculeSpecies_, 0.0);
dlnActCoeff_NeutralMolecule.resize(numNeutralMoleculeSpecies_, 0.0);
dX_NeutralMolecule.resize(numNeutralMoleculeSpecies_, 0.0);
y_.resize(numNeutralMoleculeSpecies_, 0.0);
dlnActCoeff_NeutralMolecule_.resize(numNeutralMoleculeSpecies_, 0.0);
dX_NeutralMolecule_.resize(numNeutralMoleculeSpecies_, 0.0);
}
@ -934,13 +934,12 @@ static double factorOverlap(const std::vector<std::string>& elnamesVN ,
}
return fMax;
}
void IonsFromNeutralVPSSTP::initThermoXML(XML_Node& phaseNode, const std::string& id)
void IonsFromNeutralVPSSTP::initThermoXML(XML_Node& phaseNode, const std::string& id_)
{
string stemp;
if (id.size() > 0) {
if (id_.size() > 0) {
string idp = phaseNode.id();
if (idp != id) {
if (idp != id_) {
throw CanteraError("IonsFromNeutralVPSSTP::initThermoXML",
"phasenode and Id are incompatible");
}
@ -1129,7 +1128,7 @@ void IonsFromNeutralVPSSTP::initThermoXML(XML_Node& phaseNode, const std::string
/*
* This includes the setStateFromXML calls
*/
GibbsExcessVPSSTP::initThermoXML(phaseNode, id);
GibbsExcessVPSSTP::initThermoXML(phaseNode, id_);
/*
* There is one extra step here. We assure ourselves that we
@ -1205,11 +1204,11 @@ void IonsFromNeutralVPSSTP::getdlnActCoeffds(const doublereal dTds, const double
// static vector_fp dX_NeutralMolecule(numNeutMolSpec);
getNeutralMoleculeMoleGrads(DATA_PTR(dXds),DATA_PTR(dX_NeutralMolecule));
getNeutralMoleculeMoleGrads(DATA_PTR(dXds),DATA_PTR(dX_NeutralMolecule_));
// All mole fractions returned to normal
geThermo->getdlnActCoeffds(dTds, DATA_PTR(dX_NeutralMolecule), DATA_PTR(dlnActCoeff_NeutralMolecule));
geThermo->getdlnActCoeffds(dTds, DATA_PTR(dX_NeutralMolecule_), DATA_PTR(dlnActCoeff_NeutralMolecule_));
switch (ionSolnType_) {
case cIonSolnType_PASSTHROUGH:
@ -1222,7 +1221,7 @@ void IonsFromNeutralVPSSTP::getdlnActCoeffds(const doublereal dTds, const double
icat = cationList_[k];
jNeut = fm_invert_ionForNeutral[icat];
fmij = fm_neutralMolec_ions_[icat + jNeut * m_kk];
dlnActCoeffds[icat] = dlnActCoeff_NeutralMolecule[jNeut]/fmij;
dlnActCoeffds[icat] = dlnActCoeff_NeutralMolecule_[jNeut]/fmij;
}
// Do the anion list
@ -1234,7 +1233,7 @@ void IonsFromNeutralVPSSTP::getdlnActCoeffds(const doublereal dTds, const double
for (size_t k = 0; k < numPassThroughSpecies_; k++) {
icat = passThroughList_[k];
jNeut = fm_invert_ionForNeutral[icat];
dlnActCoeffds[icat] = dlnActCoeff_NeutralMolecule[jNeut];
dlnActCoeffds[icat] = dlnActCoeff_NeutralMolecule_[jNeut];
}
break;

View file

@ -62,14 +62,14 @@ LatticePhase::~LatticePhase()
{
}
LatticePhase::LatticePhase(const std::string& inputFile, const std::string& id)
LatticePhase::LatticePhase(const std::string& inputFile, const std::string& id_)
{
initThermoFile(inputFile, id);
initThermoFile(inputFile, id_);
}
LatticePhase::LatticePhase(XML_Node& phaseRef, const std::string& id)
LatticePhase::LatticePhase(XML_Node& phaseRef, const std::string& id_)
{
importPhase(*findXMLPhase(&phaseRef, id), this);
importPhase(*findXMLPhase(&phaseRef, id_), this);
}
ThermoPhase* LatticePhase::duplMyselfAsThermoPhase() const
@ -341,10 +341,10 @@ void LatticePhase::initThermo()
ThermoPhase::initThermo();
}
void LatticePhase::initThermoXML(XML_Node& phaseNode, const std::string& id)
void LatticePhase::initThermoXML(XML_Node& phaseNode, const std::string& id_)
{
std::string idattrib = phaseNode.id();
if (!id.empty() && id != idattrib) {
if (!id_.empty() && id_ != idattrib) {
throw CanteraError("LatticePhase::initThermoXML",
"ids don't match");
}
@ -391,7 +391,7 @@ void LatticePhase::initThermoXML(XML_Node& phaseNode, const std::string& id)
* Call the base initThermo, which handles setting the initial
* state.
*/
ThermoPhase::initThermoXML(phaseNode, id);
ThermoPhase::initThermoXML(phaseNode, id_);
}
void LatticePhase::_updateThermo() const

View file

@ -29,22 +29,22 @@ MargulesVPSSTP::MargulesVPSSTP() :
{
}
MargulesVPSSTP::MargulesVPSSTP(const std::string& inputFile, const std::string& id) :
MargulesVPSSTP::MargulesVPSSTP(const std::string& inputFile, const std::string& id_) :
GibbsExcessVPSSTP(),
numBinaryInteractions_(0),
formMargules_(0),
formTempModel_(0)
{
initThermoFile(inputFile, id);
initThermoFile(inputFile, id_);
}
MargulesVPSSTP::MargulesVPSSTP(XML_Node& phaseRoot, const std::string& id) :
MargulesVPSSTP::MargulesVPSSTP(XML_Node& phaseRoot, const std::string& id_) :
GibbsExcessVPSSTP(),
numBinaryInteractions_(0),
formMargules_(0),
formTempModel_(0)
{
importPhase(*findXMLPhase(&phaseRoot, id), this);
importPhase(*findXMLPhase(&phaseRoot, id_), this);
}
MargulesVPSSTP::MargulesVPSSTP(const MargulesVPSSTP& b) :
@ -386,13 +386,13 @@ void MargulesVPSSTP::initLengths()
dlnActCoeffdlnN_.resize(m_kk, m_kk);
}
void MargulesVPSSTP::initThermoXML(XML_Node& phaseNode, const std::string& id)
void MargulesVPSSTP::initThermoXML(XML_Node& phaseNode, const std::string& id_)
{
string stemp;
string subname = "MargulesVPSSTP::initThermoXML";
if ((int) id.size() > 0) {
if ((int) id_.size() > 0) {
string idp = phaseNode.id();
if (idp != id) {
if (idp != id_) {
throw CanteraError(subname, "phasenode and Id are incompatible");
}
}
@ -450,7 +450,7 @@ void MargulesVPSSTP::initThermoXML(XML_Node& phaseNode, const std::string& id)
/*
* Go down the chain
*/
GibbsExcessVPSSTP::initThermoXML(phaseNode, id);
GibbsExcessVPSSTP::initThermoXML(phaseNode, id_);
}

View file

@ -33,7 +33,7 @@ MetalSHEelectrons::MetalSHEelectrons():
{
}
MetalSHEelectrons::MetalSHEelectrons(const std::string& infile, std::string id) :
MetalSHEelectrons::MetalSHEelectrons(const std::string& infile, std::string id_) :
SingleSpeciesTP(),
xdef_(0)
{
@ -44,13 +44,13 @@ MetalSHEelectrons::MetalSHEelectrons(const std::string& infile, std::string id)
} else {
root = get_XML_File(infile);
}
if (id == "-") {
id = "";
if (id_ == "-") {
id_ = "";
}
XML_Node* xphase = get_XML_NameID("phase", std::string("#")+id, root);
XML_Node* xphase = get_XML_NameID("phase", std::string("#")+id_, root);
if (!xphase) {
throw CanteraError("MetalSHEelectrons::MetalSHEelectrons",
"Couldn't find phase name in file:" + id);
"Couldn't find phase name in file:" + id_);
}
// Check the model name to ensure we have compatibility
const XML_Node& th = xphase->child("thermo");
@ -62,13 +62,13 @@ MetalSHEelectrons::MetalSHEelectrons(const std::string& infile, std::string id)
importPhase(*xphase, this);
}
MetalSHEelectrons::MetalSHEelectrons(XML_Node& xmlphase, const std::string& id) :
MetalSHEelectrons::MetalSHEelectrons(XML_Node& xmlphase, const std::string& id_) :
SingleSpeciesTP(),
xdef_(0)
{
if (id != "") {
if (id_ != "") {
std::string idxml = xmlphase["id"];
if (id != idxml) {
if (id_ != idxml) {
throw CanteraError("MetalSHEelectrons::MetalSHEelectrons",
"id's don't match");
}
@ -236,7 +236,7 @@ void MetalSHEelectrons::initThermo()
SingleSpeciesTP::initThermo();
}
void MetalSHEelectrons::initThermoXML(XML_Node& phaseNode, const std::string& id)
void MetalSHEelectrons::initThermoXML(XML_Node& phaseNode, const std::string& id_)
{
/*
* Find the Thermo XML node
@ -251,7 +251,7 @@ void MetalSHEelectrons::initThermoXML(XML_Node& phaseNode, const std::string& id
dens = ctml::getFloatDefaultUnits(tnode, "density", "kg/m3");
}
setDensity(dens);
SingleSpeciesTP::initThermoXML(phaseNode, id);
SingleSpeciesTP::initThermoXML(phaseNode, id_);
}
XML_Node* MetalSHEelectrons::makeDefaultXMLTree()

View file

@ -36,17 +36,17 @@ MineralEQ3::MineralEQ3():
{
}
MineralEQ3::MineralEQ3(const std::string& infile, std::string id) :
MineralEQ3::MineralEQ3(const std::string& infile, std::string id_) :
StoichSubstanceSSTP()
{
XML_Node* root = get_XML_File(infile);
if (id == "-") {
id = "";
if (id_ == "-") {
id_ = "";
}
XML_Node* xphase = get_XML_NameID("phase", std::string("#")+id, root);
XML_Node* xphase = get_XML_NameID("phase", std::string("#")+id_, root);
if (!xphase) {
throw CanteraError("MineralEQ3::MineralEQ3",
"Couldn't find phase name in file:" + id);
"Couldn't find phase name in file:" + id_);
}
// Check the model name to ensure we have compatibility
const XML_Node& th = xphase->child("thermo");
@ -58,12 +58,12 @@ MineralEQ3::MineralEQ3(const std::string& infile, std::string id) :
importPhase(*xphase, this);
}
MineralEQ3::MineralEQ3(XML_Node& xmlphase, const std::string& id) :
MineralEQ3::MineralEQ3(XML_Node& xmlphase, const std::string& id_) :
StoichSubstanceSSTP()
{
if (id != "") {
if (id_ != "") {
std::string idxml = xmlphase["id"];
if (id != idxml) {
if (id_ != idxml) {
throw CanteraError("MineralEQ3::MineralEQ3",
"id's don't match");
}
@ -251,7 +251,7 @@ void MineralEQ3::getParameters(int& n, doublereal* const c) const
c[0] = rho;
}
void MineralEQ3::initThermoXML(XML_Node& phaseNode, const std::string& id)
void MineralEQ3::initThermoXML(XML_Node& phaseNode, const std::string& id_)
{
/*
* Find the Thermo XML node

View file

@ -32,23 +32,23 @@ MixedSolventElectrolyte::MixedSolventElectrolyte() :
}
MixedSolventElectrolyte::MixedSolventElectrolyte(const std::string& inputFile,
const std::string& id) :
const std::string& id_) :
MolarityIonicVPSSTP(),
numBinaryInteractions_(0),
formMargules_(0),
formTempModel_(0)
{
initThermoFile(inputFile, id);
initThermoFile(inputFile, id_);
}
MixedSolventElectrolyte::MixedSolventElectrolyte(XML_Node& phaseRoot,
const std::string& id) :
const std::string& id_) :
MolarityIonicVPSSTP(),
numBinaryInteractions_(0),
formMargules_(0),
formTempModel_(0)
{
importPhase(*findXMLPhase(&phaseRoot, id), this);
importPhase(*findXMLPhase(&phaseRoot, id_), this);
}
MixedSolventElectrolyte::MixedSolventElectrolyte(const MixedSolventElectrolyte& b) :
@ -392,14 +392,14 @@ void MixedSolventElectrolyte::initLengths()
dlnActCoeffdlnN_.resize(m_kk, m_kk);
}
void MixedSolventElectrolyte::initThermoXML(XML_Node& phaseNode, const std::string& id)
void MixedSolventElectrolyte::initThermoXML(XML_Node& phaseNode, const std::string& id_)
{
string subname = "MixedSolventElectrolyte::initThermoXML";
string stemp;
if ((int) id.size() > 0) {
if ((int) id_.size() > 0) {
string idp = phaseNode.id();
if (idp != id) {
if (idp != id_) {
throw CanteraError(subname, "phasenode and Id are incompatible");
}
}
@ -414,7 +414,7 @@ void MixedSolventElectrolyte::initThermoXML(XML_Node& phaseNode, const std::stri
XML_Node& thermoNode = phaseNode.child("thermo");
string mStringa = thermoNode.attrib("model");
string mString = lowercase(mStringa);
if (mString != "MixedSolventElectrolyte") {
if (mString != "mixedsolventelectrolyte") {
throw CanteraError(subname, "Unknown thermo model: " + mStringa);
}
@ -452,7 +452,7 @@ void MixedSolventElectrolyte::initThermoXML(XML_Node& phaseNode, const std::stri
/*
* Go down the chain
*/
MolarityIonicVPSSTP::initThermoXML(phaseNode, id);
MolarityIonicVPSSTP::initThermoXML(phaseNode, id_);
}

View file

@ -532,14 +532,14 @@ void PDSS::err(const std::string& msg) const
void PDSS::reportParams(size_t& kindex, int& type,
doublereal* const c,
doublereal& minTemp,
doublereal& maxTemp,
doublereal& refPressure) const
doublereal& minTemp_,
doublereal& maxTemp_,
doublereal& refPressure_) const
{
kindex = m_spindex;
type = m_pdssType;
minTemp = m_minTemp;
maxTemp = m_maxTemp;
refPressure = m_p0;
minTemp_ = m_minTemp;
maxTemp_ = m_maxTemp;
refPressure_ = m_p0;
}
}

View file

@ -1272,14 +1272,14 @@ void PDSS_HKFT::convertDGFormation()
*/
void PDSS_HKFT::reportParams(size_t& kindex, int& type,
doublereal* const c,
doublereal& minTemp,
doublereal& maxTemp,
doublereal& refPressure) const
doublereal& minTemp_,
doublereal& maxTemp_,
doublereal& refPressure_) const
{
// Fill in the first part
PDSS::reportParams(kindex, type, c, minTemp, maxTemp,
refPressure);
PDSS::reportParams(kindex, type, c, minTemp_, maxTemp_,
refPressure_);
c[0] = m_deltaG_formation_tr_pr;

View file

@ -834,11 +834,11 @@ size_t Phase::addUniqueElementAfterFreeze(const std::string& symbol,
}
void Phase::addSpecies(const std::string& name, const doublereal* comp,
doublereal charge, doublereal size)
doublereal charge_, doublereal size)
{
freezeElements();
m_speciesNames.push_back(name);
m_speciesCharge.push_back(charge);
m_speciesCharge.push_back(charge_);
m_speciesSize.push_back(size);
size_t ne = nElements();
// Create a changeable copy of the element composition. We now change
@ -849,11 +849,11 @@ void Phase::addSpecies(const std::string& name, const doublereal* comp,
}
double wt = 0.0;
const vector_fp& aw = atomicWeights();
if (charge != 0.0) {
if (charge_ != 0.0) {
size_t eindex = elementIndex("E");
if (eindex != npos) {
doublereal ecomp = compNew[eindex];
if (fabs(charge + ecomp) > 0.001) {
if (fabs(charge_ + ecomp) > 0.001) {
if (ecomp != 0.0) {
throw CanteraError("Phase::addSpecies",
"Input charge and element E compositions differ "
@ -861,7 +861,7 @@ void Phase::addSpecies(const std::string& name, const doublereal* comp,
} else {
// Just fix up the element E composition based on the input
// species charge
compNew[eindex] = -charge;
compNew[eindex] = -charge_;
}
}
} else {
@ -870,7 +870,7 @@ void Phase::addSpecies(const std::string& name, const doublereal* comp,
ne = nElements();
eindex = elementIndex("E");
compNew.resize(ne);
compNew[ne - 1] = - charge;
compNew[ne - 1] = - charge_;
}
}
for (size_t m = 0; m < ne; m++) {
@ -882,7 +882,7 @@ void Phase::addSpecies(const std::string& name, const doublereal* comp,
}
void Phase::addUniqueSpecies(const std::string& name, const doublereal* comp,
doublereal charge, doublereal size)
doublereal charge_, doublereal size)
{
for (size_t k = 0; k < m_kk; k++) {
if (m_speciesNames[k] == name) {
@ -894,7 +894,7 @@ void Phase::addUniqueSpecies(const std::string& name, const doublereal* comp,
"compositions: " + name);
}
}
if (charge != m_speciesCharge[k]) {
if (charge_ != m_speciesCharge[k]) {
throw CanteraError("addUniqueSpecies",
"Duplicate species have different "
"charges: " + name);
@ -907,7 +907,7 @@ void Phase::addUniqueSpecies(const std::string& name, const doublereal* comp,
return;
}
}
addSpecies(name, comp, charge, size);
addSpecies(name, comp, charge_, size);
}
void Phase::freezeSpecies()