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:
parent
3ea77c5187
commit
9773c9b23b
17 changed files with 16 additions and 19 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -639,7 +639,7 @@ namespace Cantera {
|
|||
virtual ~DebyeHuckel();
|
||||
|
||||
//! Duplicator from the ThermoPhase parent class
|
||||
ThermoPhase *duplMyselfAsThermoPhase();
|
||||
ThermoPhase *duplMyselfAsThermoPhase() const;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ namespace Cantera {
|
|||
virtual ~HMWSoln();
|
||||
|
||||
|
||||
ThermoPhase *duplMyselfAsThermoPhase();
|
||||
ThermoPhase *duplMyselfAsThermoPhase() const;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ namespace Cantera {
|
|||
/**
|
||||
*
|
||||
*/
|
||||
ThermoPhase* IdealMolalSoln::duplMyselfAsThermoPhase() {
|
||||
ThermoPhase* IdealMolalSoln::duplMyselfAsThermoPhase() const {
|
||||
IdealMolalSoln* mtp = new IdealMolalSoln(*this);
|
||||
return (ThermoPhase *) mtp;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ namespace Cantera {
|
|||
*
|
||||
* @return It returns a ThermoPhase pointer.
|
||||
*/
|
||||
ThermoPhase *duplMyselfAsThermoPhase();
|
||||
ThermoPhase *duplMyselfAsThermoPhase() const;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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() {}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ namespace Cantera {
|
|||
* a pointer to ThermoPhase.
|
||||
*/
|
||||
ThermoPhase*
|
||||
MolalityVPSSTP::duplMyselfAsThermoPhase() {
|
||||
MolalityVPSSTP::duplMyselfAsThermoPhase() const {
|
||||
MolalityVPSSTP* mtp = new MolalityVPSSTP(*this);
|
||||
return (ThermoPhase *) mtp;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ namespace Cantera {
|
|||
/*
|
||||
* Duplication routine
|
||||
*/
|
||||
virtual ThermoPhase *duplMyselfAsThermoPhase();
|
||||
virtual ThermoPhase *duplMyselfAsThermoPhase() const;
|
||||
|
||||
//@}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ namespace Cantera {
|
|||
}
|
||||
|
||||
|
||||
ThermoPhase *WaterSSTP::duplMyselfAsThermoPhase() {
|
||||
ThermoPhase *WaterSSTP::duplMyselfAsThermoPhase() const {
|
||||
WaterSSTP* wtp = new WaterSSTP(*this);
|
||||
return (ThermoPhase *) wtp;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ namespace Cantera {
|
|||
virtual ~WaterSSTP();
|
||||
|
||||
//! Duplicator from a ThermoPhase object
|
||||
ThermoPhase *duplMyselfAsThermoPhase();
|
||||
ThermoPhase *duplMyselfAsThermoPhase() const;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue