Changed the duplMyselfAsThermoPhase function to be a const function

(trying to keep a unified view of what are const and non-const
functions within the ThermoPhase classes)
This commit is contained in:
Harry Moffat 2007-06-01 15:31:02 +00:00
parent 3ea77c5187
commit 9773c9b23b
17 changed files with 16 additions and 19 deletions

View file

@ -202,7 +202,7 @@ namespace Cantera {
* duplicate the current object. It uses the copy constructor
* defined above.
*/
ThermoPhase* DebyeHuckel::duplMyselfAsThermoPhase() {
ThermoPhase* DebyeHuckel::duplMyselfAsThermoPhase() const {
DebyeHuckel* mtp = new DebyeHuckel(*this);
return (ThermoPhase *) mtp;
}

View file

@ -639,7 +639,7 @@ namespace Cantera {
virtual ~DebyeHuckel();
//! Duplicator from the ThermoPhase parent class
ThermoPhase *duplMyselfAsThermoPhase();
ThermoPhase *duplMyselfAsThermoPhase() const;
/**
*

View file

@ -380,7 +380,7 @@ namespace Cantera {
* duplicate the current object. It uses the copy constructor
* defined above.
*/
ThermoPhase* HMWSoln::duplMyselfAsThermoPhase() {
ThermoPhase* HMWSoln::duplMyselfAsThermoPhase() const {
HMWSoln* mtp = new HMWSoln(*this);
return (ThermoPhase *) mtp;
}

View file

@ -108,7 +108,7 @@ namespace Cantera {
virtual ~HMWSoln();
ThermoPhase *duplMyselfAsThermoPhase();
ThermoPhase *duplMyselfAsThermoPhase() const;
/**
*

View file

@ -106,7 +106,7 @@ namespace Cantera {
/**
*
*/
ThermoPhase* IdealMolalSoln::duplMyselfAsThermoPhase() {
ThermoPhase* IdealMolalSoln::duplMyselfAsThermoPhase() const {
IdealMolalSoln* mtp = new IdealMolalSoln(*this);
return (ThermoPhase *) mtp;
}

View file

@ -130,7 +130,7 @@ namespace Cantera {
*
* @return It returns a ThermoPhase pointer.
*/
ThermoPhase *duplMyselfAsThermoPhase();
ThermoPhase *duplMyselfAsThermoPhase() const;
/**
*

View file

@ -113,7 +113,7 @@ namespace Cantera {
* not the copy constructor, because it has to be
* a virtual function)
*/
ThermoPhase* IdealSolidSolnPhase::duplMyselfAsThermoPhase() {
ThermoPhase* IdealSolidSolnPhase::duplMyselfAsThermoPhase() const {
IdealSolidSolnPhase *ii = new IdealSolidSolnPhase(*this);
return (ThermoPhase*) ii;
}

View file

@ -155,7 +155,7 @@ namespace Cantera {
* not the copy constructor, because it has to be
* a virtual function)
*/
virtual ThermoPhase* duplMyselfAsThermoPhase();
virtual ThermoPhase* duplMyselfAsThermoPhase() const;
//! Destructor
virtual ~IdealSolidSolnPhase() {}

View file

@ -107,7 +107,7 @@ namespace Cantera {
* a pointer to ThermoPhase.
*/
ThermoPhase*
MolalityVPSSTP::duplMyselfAsThermoPhase() {
MolalityVPSSTP::duplMyselfAsThermoPhase() const {
MolalityVPSSTP* mtp = new MolalityVPSSTP(*this);
return (ThermoPhase *) mtp;
}

View file

@ -202,7 +202,7 @@ namespace Cantera {
* inherited from ThermoPhase even if the application only has
* a pointer to ThermoPhase to work with.
*/
virtual ThermoPhase *duplMyselfAsThermoPhase();
virtual ThermoPhase *duplMyselfAsThermoPhase() const;
/**
*

View file

@ -80,7 +80,6 @@ namespace Cantera {
}
void State::setMoleFractions(const doublereal* x) {
int k;
doublereal sum = 0.0, norm = 0.0;
sum = dot(x, x + m_kk, m_molwts.begin());
doublereal rsum = 1.0/sum;
@ -126,7 +125,6 @@ namespace Cantera {
void State::setMassFractions(const doublereal* y) {
doublereal norm = 0.0, sum = 0.0;
int k;
//cblas_dcopy(m_kk, y, 1, m_y.begin(), 1);
norm = accumulate(y, y + m_kk, 0.0);
copy(y, y + m_kk, m_y.begin());
@ -148,7 +146,6 @@ namespace Cantera {
}
void State::setMassFractions_NoNorm(const doublereal* y) {
int k;
doublereal sum = 0.0;
copy(y, y + m_kk, m_y.begin());
transform(m_y.begin(), m_y.end(), m_rmolwts.begin(), m_ym.begin(),

View file

@ -115,7 +115,7 @@ namespace Cantera {
* Currently, this is not fully implemented. If called, an
* exception will be called by the ThermoPhase copy constructor.
*/
ThermoPhase *ThermoPhase::duplMyselfAsThermoPhase() {
ThermoPhase *ThermoPhase::duplMyselfAsThermoPhase() const {
ThermoPhase* tp = new ThermoPhase(*this);
return tp;
}

View file

@ -275,7 +275,7 @@ namespace Cantera {
* Currently, this is not fully implemented. If called, an
* exception will be called.
*/
virtual ThermoPhase *duplMyselfAsThermoPhase();
virtual ThermoPhase *duplMyselfAsThermoPhase() const;
/**
*

View file

@ -115,7 +115,7 @@ namespace Cantera {
* Duplication function.
* This calls the copy constructor for this object.
*/
ThermoPhase* VPStandardStateTP::duplMyselfAsThermoPhase() {
ThermoPhase* VPStandardStateTP::duplMyselfAsThermoPhase() const {
VPStandardStateTP* vptp = new VPStandardStateTP(*this);
return (ThermoPhase *) vptp;
}

View file

@ -117,7 +117,7 @@ namespace Cantera {
/*
* Duplication routine
*/
virtual ThermoPhase *duplMyselfAsThermoPhase();
virtual ThermoPhase *duplMyselfAsThermoPhase() const;
//@}

View file

@ -99,7 +99,7 @@ namespace Cantera {
}
ThermoPhase *WaterSSTP::duplMyselfAsThermoPhase() {
ThermoPhase *WaterSSTP::duplMyselfAsThermoPhase() const {
WaterSSTP* wtp = new WaterSSTP(*this);
return (ThermoPhase *) wtp;
}

View file

@ -162,7 +162,7 @@ namespace Cantera {
virtual ~WaterSSTP();
//! Duplicator from a ThermoPhase object
ThermoPhase *duplMyselfAsThermoPhase();
ThermoPhase *duplMyselfAsThermoPhase() const;
/**
*