changed from using ctvector to using std::vector. Required replacing v.begin() in many places by &v[0]. Macro DATA_PTR(v) defined for readability.

This commit is contained in:
Dave Goodwin 2006-04-29 10:45:49 +00:00
parent f5ffa16a48
commit 642553148d
5 changed files with 24 additions and 26 deletions

View file

@ -211,13 +211,13 @@ namespace Cantera {
m_molalities[k] *= tmp;
}
}
setMoleFractions(m_molalities.begin());
setMoleFractions(DATA_PTR(m_molalities));
/*
* Essentially we don't trust the input: We calculate
* the molalities from the mole fractions that we
* just obtained.
*/
getMolalities(m_molalities.begin());
getMolalities(DATA_PTR(m_molalities));
}
/*
@ -235,7 +235,7 @@ namespace Cantera {
* Get a vector of mole fractions
*/
vector_fp mf(kk, 0.0);
getMoleFractions(mf.begin());
getMoleFractions(DATA_PTR(mf));
double xmolS = mf[m_indexSolvent];
double xmolSmin = max(xmolS, m_xmolSolventMIN);
compositionMap::iterator p;
@ -300,13 +300,13 @@ namespace Cantera {
for (int k = 0; k < kk; k++) {
mf[k] *= sum;
}
setMoleFractions(mf.begin());
setMoleFractions(DATA_PTR(mf));
/*
* After we formally set the mole fractions, we
* calculate the molalities again and store it in
* this object.
*/
getMolalities(m_molalities.begin());
getMolalities(DATA_PTR(m_molalities));
}
/*
@ -330,7 +330,7 @@ namespace Cantera {
* species.
*/
void MolalityVPSSTP::updateMolalities() const {
getMolalities(m_molalities.begin());
getMolalities(DATA_PTR(m_molalities));
}
@ -405,7 +405,7 @@ namespace Cantera {
*/
doublereal MolalityVPSSTP::osmoticCoefficient() const {
vector_fp act(m_kk);
getActivities(act.begin());
getActivities(DATA_PTR(act));
double sum = 0;
for (int k = 0; k < m_kk; k++) {
if (k != m_indexSolvent) {

View file

@ -3,10 +3,9 @@
*
* Header file for a derived class of ThermoPhase that handles
* variable pressure standard state methods for calculating
* thermodynamic properties that are further based upon
* activities based on the molality scale.
* These include most of the
* methods for calculating liquid electrolyte thermodynamics.
* thermodynamic properties that are further based upon activities
* based on the molality scale. These include most of the methods for
* calculating liquid electrolyte thermodynamics.
*/
/*
* Copywrite (2005) Sandia Corporation. Under the terms of
@ -31,12 +30,11 @@ namespace Cantera {
*/
/**
* MolalityVPSSTP is a derived class of ThermoPhase that handles
* MolalityVPSSTP is a derived class of ThermoPhase that handles
* variable pressure standard state methods for calculating
* thermodynamic properties that are further based upon
* activities based on the molality scale.
* These include most of the
* methods for calculating liquid electrolyte thermodynamics.
* thermodynamic properties that are further based upon activities
* based on the molality scale. These include most of the methods
* for calculating liquid electrolyte thermodynamics.
*/
class MolalityVPSSTP : public VPStandardStateTP {

View file

@ -546,8 +546,8 @@ namespace Cantera {
void SingleSpeciesTP::_updateThermo() const {
doublereal tnow = temperature();
if (m_tlast != tnow) {
m_spthermo->update(tnow, m_cp0_R.begin(), m_h0_RT.begin(),
m_s0_R.begin());
m_spthermo->update(tnow, DATA_PTR(m_cp0_R), DATA_PTR(m_h0_RT),
DATA_PTR(m_s0_R));
m_tlast = tnow;
}
}

View file

@ -285,8 +285,8 @@ namespace Cantera {
void VPStandardStateTP::_updateRefStateThermo() const {
doublereal tnow = temperature();
if (m_tlast != tnow) {
m_spthermo->update(tnow, m_cp0_R.begin(), m_h0_RT.begin(),
m_s0_R.begin());
m_spthermo->update(tnow, DATA_PTR(m_cp0_R), DATA_PTR(m_h0_RT),
DATA_PTR(m_s0_R));
m_tlast = tnow;
for (int k = 0; k < m_kk; k++) {
m_g0_RT[k] = m_h0_RT[k] - m_s0_R[k];

View file

@ -35,13 +35,12 @@ namespace Cantera {
* In addition support for the molality unit scale is provided.
*
* Currently, it really is just a shell. The ThermoPhase object
* itself is based around the general concepts of
* itself is based around the general concepts of
* VPStandardStateTP. Therefore, there really isn't much going
* on here.
* However, this may change. The ThermoPhase object itself
* could change. Additionally, this object may revolve around
* the molality unit scale in the near future. We will have to see
* how things fare.
* on here. However, this may change. The ThermoPhase object
* itself could change. Additionally, this object may revolve
* around the molality unit scale in the near future. We will
* have to see how things fare.
*/
class VPStandardStateTP : public ThermoPhase {
@ -56,6 +55,7 @@ namespace Cantera {
/// Assignment operator
VPStandardStateTP& operator=(const VPStandardStateTP &);
/// Destructor.
virtual ~VPStandardStateTP();