Made several routines const that should be const

getUnitStandardConc
 and in Phase::nDim and getMolecularWeight()
This commit is contained in:
Harry Moffat 2007-06-13 00:08:35 +00:00
parent badc82daf3
commit cb1dc5917c
18 changed files with 27 additions and 27 deletions

View file

@ -547,7 +547,7 @@ namespace Cantera {
* uA[4] = Temperature units - default = 0;
* uA[5] = time units - default = 0
*/
void DebyeHuckel::getUnitsStandardConc(double *uA, int k, int sizeUA) {
void DebyeHuckel::getUnitsStandardConc(double *uA, int k, int sizeUA) const {
for (int i = 0; i < sizeUA; i++) {
if (i == 0) uA[0] = 1.0;
if (i == 1) uA[1] = -nDim();

View file

@ -956,7 +956,7 @@ namespace Cantera {
* Currently, this is equal to 6.
*/
virtual void getUnitsStandardConc(double *uA, int k = 0,
int sizeUA = 6);
int sizeUA = 6) const;
//! Get the array of non-dimensional activities at
//! the current solution temperature, pressure, and solution concentration.

View file

@ -779,7 +779,7 @@ namespace Cantera {
* uA[4] = Temperature units - default = 0;
* uA[5] = time units - default = 0
*/
void HMWSoln::getUnitsStandardConc(double *uA, int k, int sizeUA) {
void HMWSoln::getUnitsStandardConc(double *uA, int k, int sizeUA) const {
for (int i = 0; i < sizeUA; i++) {
if (i == 0) uA[0] = 1.0;
if (i == 1) uA[1] = -nDim();

View file

@ -1014,7 +1014,7 @@ namespace Cantera {
* uA[5] = time units - default = 0
*/
virtual void getUnitsStandardConc(double *uA, int k = 0,
int sizeUA = 6);
int sizeUA = 6) const;
/**
* Get the array of non-dimensional molality-based activities at

View file

@ -444,7 +444,7 @@ namespace Cantera {
* uA[4] = Temperature units - default = 0;
* uA[5] = time units - default = 0
*/
void IdealMolalSoln::getUnitsStandardConc(double *uA, int k, int sizeUA) {
void IdealMolalSoln::getUnitsStandardConc(double *uA, int k, int sizeUA) const {
int eos = eosType();
if (eos == 0) {
for (int i = 0; i < sizeUA; i++) {

View file

@ -468,7 +468,7 @@ namespace Cantera {
* Currently, this is equal to 6.
*/
virtual void getUnitsStandardConc(double *uA, int k = 0,
int sizeUA = 6);
int sizeUA = 6) const;
/*!
* Get the array of non-dimensional activities at

View file

@ -578,7 +578,7 @@ namespace Cantera {
* unitless.
*/
void IdealSolidSolnPhase::
getUnitsStandardConc(double *uA, int, int sizeUA) {
getUnitsStandardConc(double *uA, int, int sizeUA) const {
int eos = eosType();
if (eos == cIdealSolidSolnPhase0) {
for (int i = 0; i < sizeUA; i++) {

View file

@ -534,7 +534,7 @@ namespace Cantera {
* unitless.
*/
virtual void getUnitsStandardConc(double *uA, int k = 0,
int sizeUA = 6);
int sizeUA = 6) const;
//! Get the array of species activity coefficients

View file

@ -485,7 +485,7 @@ namespace Cantera {
* uA[4] = Temperature units - default = 0;
* uA[5] = time units - default = 0
*/
void MolalityVPSSTP::getUnitsStandardConc(double *uA, int k, int sizeUA) {
void MolalityVPSSTP::getUnitsStandardConc(double *uA, int k, int sizeUA) const {
for (int i = 0; i < sizeUA; i++) {
if (i == 0) uA[0] = 1.0;
if (i == 1) uA[1] = -nDim();

View file

@ -473,7 +473,7 @@ namespace Cantera {
* Currently, this is equal to 6.
*/
virtual void getUnitsStandardConc(double *uA, int k = 0,
int sizeUA = 6);
int sizeUA = 6) const;
//! Get the array of non-dimensional activities (molality

View file

@ -230,7 +230,7 @@ namespace Cantera {
/*
* Copy the vector of molecular weights into vector weights.
*/
void Phase::getMolecularWeights(vector_fp& weights) {
void Phase::getMolecularWeights(vector_fp& weights) const {
const array_fp& mw = Constituents::molecularWeights();
if (weights.size() < mw.size()) weights.resize(mw.size());
copy(mw.begin(), mw.end(), weights.begin());
@ -240,7 +240,7 @@ namespace Cantera {
* Copy the vector of molecular weights into array weights.
* @deprecated
*/
void Phase::getMolecularWeights(int iwt, doublereal* weights) {
void Phase::getMolecularWeights(int iwt, doublereal* weights) const {
const array_fp& mw = Constituents::molecularWeights();
copy(mw.begin(), mw.end(), weights);
}
@ -248,7 +248,7 @@ namespace Cantera {
/*
* Copy the vector of molecular weights into array weights.
*/
void Phase::getMolecularWeights(doublereal* weights) {
void Phase::getMolecularWeights(doublereal* weights) const {
const array_fp& mw = Constituents::molecularWeights();
copy(mw.begin(), mw.end(), weights);
}
@ -257,7 +257,7 @@ namespace Cantera {
* Return a const reference to the internal vector of
* molecular weights.
*/
const array_fp& Phase::molecularWeights() {
const array_fp& Phase::molecularWeights() const {
return Constituents::molecularWeights();
}
@ -265,7 +265,7 @@ namespace Cantera {
/**
* Get the mole fractions by name.
*/
void Phase::getMoleFractionsByName(compositionMap& x) {
void Phase::getMoleFractionsByName(compositionMap& x) const {
x.clear();
int kk = nSpecies();
for (int k = 0; k < kk; k++) {

View file

@ -364,7 +364,7 @@ namespace Cantera {
*
* @param weights Output vector of molecular weights (kg/kmol)
*/
void getMolecularWeights(vector_fp& weights);
void getMolecularWeights(vector_fp& weights) const;
/**
* Copy the vector of molecular weights into array weights.
@ -374,20 +374,20 @@ namespace Cantera {
*
* @deprecated
*/
void getMolecularWeights(int iwt, doublereal* weights);
void getMolecularWeights(int iwt, doublereal* weights) const;
/**
* Copy the vector of molecular weights into array weights.
*
* @param weights Output array of molecular weights (kg/kmol)
*/
void getMolecularWeights(doublereal* weights);
void getMolecularWeights(doublereal* weights) const;
/**
* Return a const reference to the internal vector of
* molecular weights.
*/
const array_fp& molecularWeights();
const array_fp& molecularWeights() const;
/**
* Get the mole fractions by name.
@ -395,7 +395,7 @@ namespace Cantera {
* @param x Output composition map containing the
* species mole fractions.
*/
void getMoleFractionsByName(compositionMap& x);
void getMoleFractionsByName(compositionMap& x) const;
//! Return the mole fraction of a single species
/*!
@ -435,7 +435,7 @@ namespace Cantera {
doublereal chargeDensity() const;
/// Returns the number of spatial dimensions (1, 2, or 3)
int nDim() {return m_ndim;}
int nDim() const {return m_ndim;}
//! Set the number of spatial dimensions (1, 2, or 3)
/*!

View file

@ -117,7 +117,7 @@ namespace Cantera {
}
void StoichSubstance::
getUnitsStandardConc(double *uA, int k, int sizeUA) {
getUnitsStandardConc(double *uA, int k, int sizeUA) const {
for (int i = 0; i < sizeUA; i++) {
uA[i] = 0.0;
}

View file

@ -252,7 +252,7 @@ namespace Cantera {
* uA[5] = time units - default = 0
*/
virtual void getUnitsStandardConc(double *uA, int k = 0,
int sizeUA = 6);
int sizeUA = 6) const;
//@}

View file

@ -225,7 +225,7 @@ namespace Cantera {
* uA[5] = time units - default = 0
*/
void StoichSubstanceSSTP::
getUnitsStandardConc(double *uA, int k, int sizeUA) {
getUnitsStandardConc(double *uA, int k, int sizeUA) const {
for (int i = 0; i < 6; i++) {
uA[i] = 0;
}

View file

@ -360,7 +360,7 @@ namespace Cantera {
* Currently, this is equal to 6.
*/
virtual void getUnitsStandardConc(double *uA, int k = 0,
int sizeUA = 6);
int sizeUA = 6) const;
//@}
/// @name Partial Molar Properties of the Solution

View file

@ -298,7 +298,7 @@ namespace Cantera {
* uA[4] = Temperature units - default = 0;
* uA[5] = time units - default = 0
*/
void ThermoPhase::getUnitsStandardConc(double *uA, int k, int sizeUA) {
void ThermoPhase::getUnitsStandardConc(double *uA, int k, int sizeUA) const {
for (int i = 0; i < sizeUA; i++) {
if (i == 0) uA[0] = 1.0;
if (i == 1) uA[1] = -nDim();

View file

@ -576,7 +576,7 @@ namespace Cantera {
* Currently, this is equal to 6.
*/
virtual void getUnitsStandardConc(double *uA, int k = 0,
int sizeUA = 6);
int sizeUA = 6) const;
//! Get the array of non-dimensional activities at
//! the current solution temperature, pressure, and solution concentration.