Fixed size_t conversion warnings related to class Adsorbate

This commit is contained in:
Ray Speth 2012-06-05 19:56:46 +00:00
parent 6cddd8a87a
commit 2806907060
2 changed files with 8 additions and 8 deletions

View file

@ -49,7 +49,7 @@ public:
* @param thigh output - Maximum temperature * @param thigh output - Maximum temperature
* @param pref output - reference pressure (Pa). * @param pref output - reference pressure (Pa).
*/ */
Adsorbate(int n, doublereal tlow, doublereal thigh, doublereal pref, Adsorbate(size_t n, doublereal tlow, doublereal thigh, doublereal pref,
const doublereal* coeffs) : m_lowT(tlow), const doublereal* coeffs) : m_lowT(tlow),
m_highT(thigh), m_highT(thigh),
m_index(n) { m_index(n) {
@ -81,7 +81,7 @@ public:
return (SpeciesThermoInterpType*) np; return (SpeciesThermoInterpType*) np;
} }
virtual void install(std::string name, int index, int type, virtual void install(std::string name, size_t index, int type,
const doublereal* c, doublereal minTemp, doublereal maxTemp, const doublereal* c, doublereal minTemp, doublereal maxTemp,
doublereal refPressure) { doublereal refPressure) {
m_be = c[1]; m_be = c[1];
@ -174,7 +174,7 @@ public:
tlow = m_lowT; tlow = m_lowT;
thigh = m_highT; thigh = m_highT;
pref = m_Pref; pref = m_Pref;
coeffs[0] = m_nFreqs; coeffs[0] = static_cast<double>(m_nFreqs);
coeffs[1] = m_be; coeffs[1] = m_be;
for (size_t i = 2; i < m_nFreqs+2; i++) { for (size_t i = 2; i < m_nFreqs+2; i++) {
coeffs[i] = m_freq[i-2]; coeffs[i] = m_freq[i-2];
@ -189,7 +189,7 @@ protected:
//! Reference state pressure //! Reference state pressure
doublereal m_Pref; doublereal m_Pref;
//! species index //! species index
int m_index; size_t m_index;
size_t m_nFreqs; size_t m_nFreqs;
//! array of vib frequencies //! array of vib frequencies
vector_fp m_freq; vector_fp m_freq;

View file

@ -677,12 +677,12 @@ static void installNasa9ThermoFromXML(std::string speciesName,
* @param tp Vector of XML Nodes that make up the parameterization * @param tp Vector of XML Nodes that make up the parameterization
*/ */
static void installAdsorbateThermoFromXML(std::string speciesName, static void installAdsorbateThermoFromXML(std::string speciesName,
SpeciesThermo& sp, int k, SpeciesThermo& sp, size_t k,
const XML_Node& f) const XML_Node& f)
{ {
vector_fp freqs; vector_fp freqs;
doublereal tmin, tmax, pref = OneAtm; doublereal tmin, tmax, pref = OneAtm;
int nfreq = 0; size_t nfreq = 0;
tmin = fpValue(f["Tmin"]); tmin = fpValue(f["Tmin"]);
tmax = fpValue(f["Tmax"]); tmax = fpValue(f["Tmax"]);
if (f.hasAttrib("P0")) { if (f.hasAttrib("P0")) {
@ -699,11 +699,11 @@ static void installAdsorbateThermoFromXML(std::string speciesName,
getFloatArray(f.child("floatArray"), freqs, false); getFloatArray(f.child("floatArray"), freqs, false);
nfreq = freqs.size(); nfreq = freqs.size();
} }
for (int n = 0; n < nfreq; n++) { for (size_t n = 0; n < nfreq; n++) {
freqs[n] *= 3.0e10; freqs[n] *= 3.0e10;
} }
vector_fp coeffs(nfreq + 2); vector_fp coeffs(nfreq + 2);
coeffs[0] = nfreq; coeffs[0] = static_cast<double>(nfreq);
coeffs[1] = getFloat(f, "binding_energy", "toSI"); coeffs[1] = getFloat(f, "binding_energy", "toSI");
copy(freqs.begin(), freqs.end(), coeffs.begin() + 2); copy(freqs.begin(), freqs.end(), coeffs.begin() + 2);
(&sp)->install(speciesName, k, ADSORBATE, &coeffs[0], tmin, tmax, pref); (&sp)->install(speciesName, k, ADSORBATE, &coeffs[0], tmin, tmax, pref);