Fixed an error where the users data was changed before it was used.

Eliminated some deprecations which were not sanctioned.

Worked on Cantera.mak. There is a problem with scons eliminating $ from strings.
This commit is contained in:
Harry Moffat 2013-09-06 22:52:59 +00:00
parent cfa4493b51
commit 5720d7cf90
63 changed files with 67 additions and 148 deletions

View file

@ -67,11 +67,9 @@ public:
return (SpeciesThermoInterpType*) np;
}
//! @deprecated Not a member of the base class
virtual void install(const std::string& name, size_t index, int type,
const doublereal* c, doublereal minTemp_, doublereal maxTemp_,
doublereal refPressure_) {
warn_deprecated("Adsorbate::install", "Not a member of the base class.");
m_be = c[1];
m_nFreqs = int(c[0]);
for (size_t n = 0; n < m_nFreqs; n++) {
@ -98,12 +96,10 @@ public:
s_R[m_index] = h_RT[m_index] - _free_energy_RT(temp);
}
//! @deprecated
void reportParameters(size_t& n, int& type,
doublereal& tlow, doublereal& thigh,
doublereal& pref,
doublereal* const coeffs) const {
warn_deprecated("AdsorbateThermo::reportParameters");
n = m_index;
type = ADSORBATE;
tlow = m_lowT;

View file

@ -289,10 +289,8 @@ public:
*
* @param n number of parameters
* @param c array of \a n coefficients
* @deprecated Use setDensity()
*/
virtual void setParameters(int n, doublereal* const c) {
warn_deprecated("ConstDensityThermo::setParamters");
setDensity(c[0]);
}
@ -303,10 +301,8 @@ public:
*
* @param n number of parameters
* @param c array of \a n coefficients
* @deprecated Use density()
*/
virtual void getParameters(int& n, doublereal* const c) const {
warn_deprecated("ConstDensityThermo::getParameters");
double d = density();
c[0] = d;
n = 1;

View file

@ -904,7 +904,6 @@ public:
* @param k species index. Defaults to 0.
* @param sizeUA output int containing the size of the vector.
* Currently, this is equal to 6.
* @deprecated
*/
virtual void getUnitsStandardConc(double* uA, int k = 0,
int sizeUA = 6) const;
@ -1074,7 +1073,6 @@ public:
*
* @param n number of parameters
* @param c array of \a n coefficients
* @deprecated Unimplemented
*/
virtual void setParameters(int n, doublereal* const c);
@ -1085,7 +1083,6 @@ public:
*
* @param n number of parameters
* @param c array of \a n coefficients
* @deprecated Unimplemented
*/
virtual void getParameters(int& n, doublereal* const c) const;

View file

@ -110,8 +110,6 @@ class XML_Node;
* in a particular instantiation of the class.
*
* @ingroup phases
* @deprecated The functionality of this class was merged into class Phase in
* Cantera 2.0. This class will be removed in Cantera 2.2.
*/
class Elements
{

View file

@ -350,7 +350,6 @@ public:
* @param k species index. Defaults to 0.
* @param sizeUA output int containing the size of the vector.
* Currently, this is equal to 6.
* @deprecated
*/
virtual void getUnitsStandardConc(doublereal* uA, int k = 0,
int sizeUA = 6) const;
@ -543,7 +542,6 @@ public:
* @param n number of parameters = 1
* @param c array of \a n coefficients
* c[0] = density of phase [ kg/m3 ]
* @deprecated Use setChemicalPotential()
*/
virtual void setParameters(int n, doublereal* const c);
@ -557,7 +555,6 @@ public:
* For this phase:
* - n = 1
* - c[0] = density of phase [ kg/m3 ]
* @deprecated Use getChemPotentials()
*/
virtual void getParameters(int& n, doublereal* const c) const;

View file

@ -117,7 +117,6 @@ public:
virtual doublereal refPressure(size_t k=npos) const;
virtual int reportType(size_t index) const;
//! @deprecated
virtual void reportParams(size_t index, int& type,
doublereal* const c,
doublereal& minTemp,

View file

@ -261,7 +261,6 @@ public:
* @param k species index. Defaults to 0.
* @param sizeUA output int containing the size of the vector.
* Currently, this is equal to 6.
* @deprecated
*/
virtual void getUnitsStandardConc(double* uA, int k = 0,
int sizeUA = 6) const;
@ -487,7 +486,6 @@ protected:
//! utility routine to check mole fraction sum
/*!
* @param x vector of mole fractions.
* @deprecated
*/
double checkMFSum(const doublereal* const x) const;
@ -518,12 +516,12 @@ protected:
//! Storage for the current derivative values of the
//! gradients with respect to logarithm of the mole fraction of the
//! log of the activity coefficients of the species @deprecated
//! log of the activity coefficients of the species
mutable std::vector<doublereal> dlnActCoeffdlnN_diag_;
//! Storage for the current derivative values of the
//! gradients with respect to logarithm of the mole fraction of the
//! log of the activity coefficients of the species @deprecated
//! log of the activity coefficients of the species
mutable std::vector<doublereal> dlnActCoeffdlnX_diag_;
//! Storage for the current derivative values of the gradients with respect to logarithm of the species mole number of the

View file

@ -1302,7 +1302,6 @@ public:
*
* @param testProb Hard -coded test problem to instantiate.
* Current valid values are 1.
* @deprecated To be refactored into a standalone test
*/
HMWSoln(int testProb);
@ -1740,7 +1739,6 @@ public:
* @param k species index. Defaults to 0.
* @param sizeUA output int containing the size of the vector.
* Currently, this is equal to 6.
* @deprecated
*/
virtual void getUnitsStandardConc(double* uA, int k = 0,
int sizeUA = 6) const;
@ -1904,7 +1902,6 @@ public:
*
* @param n number of parameters
* @param c array of \a n coefficients
* @deprecated Unimplemented
*/
virtual void setParameters(int n, doublereal* const c);
@ -1915,7 +1912,6 @@ public:
*
* @param n number of parameters
* @param c array of \a n coefficients
* @deprecated Unimplemented
*/
virtual void getParameters(int& n, doublereal* const c) const;

View file

@ -436,7 +436,6 @@ public:
* @param k species index. Defaults to 0.
* @param sizeUA output int containing the size of the vector.
* Currently, this is equal to 6.
* @deprecated
*/
virtual void getUnitsStandardConc(double* uA, int k = 0,
int sizeUA = 6) const;
@ -609,7 +608,6 @@ public:
* these depends on the subclass.
* @param n number of parameters
* @param c array of <I>n</I> coefficients
* @deprecated Unimplemented
*/
virtual void setParameters(int n, doublereal* const c);
@ -619,7 +617,6 @@ public:
*
* @param n number of parameters (output)
* @param c array of <I>n</I> coefficients
* * @deprecated Unimplemented
*/
virtual void getParameters(int& n, doublereal* const c) const;

View file

@ -460,7 +460,6 @@ public:
* kmol/m3 holds for standard concentration units. For
* cIdealSolidSolnPhase0 type, the standard concentration is
* unitless.
* @deprecated
*/
virtual void getUnitsStandardConc(double* uA, int k = 0,
int sizeUA = 6) const;

View file

@ -208,7 +208,6 @@ public:
* @param k species index. Defaults to 0.
* @param sizeUA output int containing the size of the vector.
* Currently, this is equal to 6.
* @deprecated
*/
virtual void getUnitsStandardConc(double* uA, int k = 0,
int sizeUA = 6) const;

View file

@ -853,7 +853,6 @@ public:
* @param n number of parameters. Must be one
* @param c array of \a n coefficients
* c[0] = The bulk lattice density (kmol m-3)
* @deprecated Use setMolarDensity()
*/
virtual void setParameters(int n, doublereal* const c);
@ -867,7 +866,6 @@ public:
* For this phase:
* - n = 1
* - c[0] = molar density of phase [ kmol/m^3 ]
* @deprecated Use molarDensity()
*/
virtual void getParameters(int& n, doublereal* const c) const;

View file

@ -300,7 +300,6 @@ public:
* @param testProb Hard-coded value. Only the value of 1 is used. It's
* for a LiKCl system test to predict the eutectic and
* liquidus correctly.
* @deprecated To be refactored into a standalone test
*/
MargulesVPSSTP(int testProb);

View file

@ -362,7 +362,6 @@ public:
* @param k species index. Defaults to 0.
* @param sizeUA output int containing the size of the vector.
* Currently, this is equal to 6.
* @deprecated
*/
virtual void getUnitsStandardConc(doublereal* uA, int k = 0,
int sizeUA = 6) const;
@ -465,7 +464,6 @@ public:
* @param n number of parameters
* @param c array of \a n coefficients
* c[0] = density of phase [ kg/m3 ]
* @deprecated Use setDensity()
*/
virtual void setParameters(int n, doublereal* const c);
@ -479,7 +477,6 @@ public:
* For this phase:
* - n = 1
* - c[0] = density of phase [ kg/m3 ]
* @deprecated Use density()
*/
virtual void getParameters(int& n, doublereal* const c) const;

View file

@ -280,7 +280,6 @@ public:
* @param k species index. Defaults to 0.
* @param sizeUA output int containing the size of the vector.
* Currently, this is equal to 6.
* @deprecated
*/
virtual void getUnitsStandardConc(doublereal* uA, int k = 0,
int sizeUA = 6) const;
@ -397,7 +396,6 @@ public:
* @param n number of parameters
* @param c array of \a n coefficients
* c[0] = density of phase [ kg/m3 ]
* @deprecated Use setDensity()
*/
virtual void setParameters(int n, doublereal* const c);
@ -411,7 +409,6 @@ public:
* For this phase:
* - n = 1
* - c[0] = density of phase [ kg/m3 ]
* @deprecated use density()
*/
virtual void getParameters(int& n, doublereal* const c) const;

View file

@ -295,7 +295,6 @@ public:
* @param testProb Hard-coded value. Only the value of 1 is used. It's
* for a LiKCl system -> test to predict the eutectic and
* liquidus correctly.
* @deprecated To be refactored into a standalone test
*/
MixedSolventElectrolyte(int testProb);

View file

@ -460,7 +460,6 @@ public:
* @param k species index. Defaults to 0.
* @param sizeUA output int containing the size of the vector.
* Currently, this is equal to 6.
* @deprecated
*/
virtual void getUnitsStandardConc(double* uA, int k = 0,
int sizeUA = 6) const;

View file

@ -140,7 +140,6 @@ public:
doublereal* cp_R,
doublereal* h_RT,
doublereal* s_R) const ;
//! @deprecated
virtual void reportParameters(size_t& n, int& type,
doublereal& tlow, doublereal& thigh,
doublereal& pref,

View file

@ -169,7 +169,6 @@ public:
* coeffs[1] is min temperature
* coeffs[2] is max temperature
* coeffs[3+i] from i =0,9 are the coefficients themselves
* @deprecated
*/
virtual void reportParameters(size_t& n, int& type,
doublereal& tlow, doublereal& thigh,
@ -180,7 +179,6 @@ public:
/*!
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
* @deprecated
*/
virtual void modifyParameters(doublereal* coeffs);

View file

@ -162,12 +162,10 @@ public:
updateProperties(tPoly, cp_R, h_RT, s_R);
}
//! @deprecated
virtual void reportParameters(size_t& n, int& type,
doublereal& tlow, doublereal& thigh,
doublereal& pref,
doublereal* const coeffs) const {
warn_deprecated("NasaPoly1::reportParameters");
n = m_index;
type = NASA1;
tlow = m_lowT;
@ -184,10 +182,8 @@ public:
/*!
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
* @deprecated
*/
virtual void modifyParameters(doublereal* coeffs) {
warn_deprecated("NasaPoly1::modifyParameters");
m_coeff[0] = coeffs[5];
m_coeff[1] = coeffs[6];
for (int i = 0; i < 5; i++) {

View file

@ -532,7 +532,6 @@ public:
* @param minTemp output - Minimum temperature
* @param maxTemp output - Maximum temperature
* @param refPressure output - reference pressure (Pa).
* @deprecated
*/
virtual void reportParams(size_t& kindex, int& type, doublereal* const c,
doublereal& minTemp, doublereal& maxTemp,

View file

@ -109,7 +109,6 @@ public:
* Note this is just an extra routine to check the arithmetic
*
* @return returns the species standard state enthalpy in J kmol-1
* @deprecated
*/
doublereal enthalpy_mole2() const;
#endif
@ -229,7 +228,6 @@ public:
* @param minTemp output - Minimum temperature
* @param maxTemp output - Maximum temperature
* @param refPressure output - reference pressure (Pa).
* @deprecated
*/
virtual void reportParams(size_t& kindex, int& type, doublereal* const c,
doublereal& minTemp, doublereal& maxTemp,
@ -258,7 +256,6 @@ private:
//! between the reference state at Tr, Pr and T,P
/*!
* This is an extra routine that was added to check the arithmetic
* @deprecated
*/
doublereal deltaH() const;
#endif

View file

@ -368,7 +368,6 @@ public:
* @param testProb Hard-coded value. Only the value of 1 is used. It's
* for a LiKCl system -> test to predict the eutectic and
* liquidus correctly.
* @deprecated unimplemented
*/
PhaseCombo_Interaction(int testProb);

View file

@ -292,7 +292,6 @@ public:
* @param testProb Hard-coded value. Only the value of 1 is used. It's
* for a LiKCl system -> test to predict the eutectic and
* liquidus correctly.
* @deprecated To be refactored into a standalone test
*/
RedlichKisterVPSSTP(int testProb);

View file

@ -65,7 +65,6 @@ public:
*
* @param testProb Hard -coded test problem to instantiate.
* Current valid values are 1.
* @deprecated To be refactored into a standalone test
*/
RedlichKwongMFTP(int testProb);
@ -305,7 +304,6 @@ public:
* @param k species index. Defaults to 0.
* @param sizeUA output int containing the size of the vector.
* Currently, this is equal to 6.
* @deprecated
*/
virtual void getUnitsStandardConc(double* uA, int k = 0, int sizeUA = 6) const;

View file

@ -244,7 +244,6 @@ public:
* @param minTemp_ output - Minimum temperature
* @param maxTemp_ output - Maximum temperature
* @param refPressure_ output - reference pressure (Pa).
* @deprecated
*/
virtual void reportParams(size_t index, int& type,
doublereal* const c,

View file

@ -567,15 +567,11 @@ public:
* these depends on the subclass.
* @param n number of parameters
* @param c array of n coefficients
* @deprecated Unimplemented
*/
virtual void setParameters(int n, doublereal* const c) {
warn_deprecated("SingleSpeciesTP::setParameters");
}
//! @deprecated Unimplemented
virtual void getParameters(int& n, doublereal* const c) const {
warn_deprecated("SingleSpeciesTP::getParameters");
}
/**

View file

@ -302,7 +302,6 @@ public:
* @param minTemp output - Minimum temperature
* @param maxTemp output - Maximum temperature
* @param refPressure output - reference pressure (Pa).
* @deprecated
*/
virtual void reportParams(size_t index, int& type,
doublereal* const c,

View file

@ -253,7 +253,6 @@ public:
* @param refPressure output - reference pressure (Pa).
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
* @deprecated
*/
virtual void reportParameters(size_t& index, int& type,
doublereal& minTemp, doublereal& maxTemp,
@ -264,7 +263,6 @@ public:
/*!
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
* @deprecated
*/
virtual void modifyParameters(doublereal* coeffs) {}

View file

@ -101,7 +101,6 @@ public:
virtual int reportType(size_t k) const;
//! @deprecated
virtual void reportParams(size_t index, int& type,
doublereal* const c,
doublereal& minTemp,

View file

@ -189,7 +189,6 @@ public:
* uA[3] = Pa(pressure) units - default = 0;
* uA[4] = Temperature units - default = 0;
* uA[5] = time units - default = 0
* @deprecated
*/
virtual void getUnitsStandardConc(double* uA, int k = 0,
int sizeUA = 6) const;
@ -355,10 +354,8 @@ public:
virtual void initThermo();
//! @deprecated Use setDensity()
virtual void setParameters(int n, double* const c);
//! @deprecated Use density()
virtual void getParameters(int& n, double* const c) const;
virtual void setParametersFromXML(const XML_Node& eosdata);

View file

@ -342,7 +342,6 @@ public:
* @param k species index. Defaults to 0.
* @param sizeUA output int containing the size of the vector.
* Currently, this is equal to 6.
* @deprecated
*/
virtual void getUnitsStandardConc(doublereal* uA, int k = 0,
int sizeUA = 6) const;
@ -439,7 +438,6 @@ public:
* @param n number of parameters
* @param c array of \a n coefficients
* c[0] = density of phase [ kg/m3 ]
* @deprecated Use setDensity()
*/
virtual void setParameters(int n, doublereal* const c);
@ -453,7 +451,6 @@ public:
* For this phase:
* - n = 1
* - c[0] = density of phase [ kg/m3 ]
* @deprecated Use density()
*/
virtual void getParameters(int& n, doublereal* const c) const;
@ -532,7 +529,6 @@ public:
virtual void initThermoXML(XML_Node& phaseNode, const std::string& id);
//! @deprecated Use setDensity()
void setParameters(int n, doublereal* const c);
};

View file

@ -345,7 +345,6 @@ public:
* @param n number of parameters. Must be one
* @param c array of \a n coefficients
* c[0] = The site density (kmol m-2)
* @deprecated use setSiteDensity()
*/
virtual void setParameters(int n, doublereal* const c);

View file

@ -525,7 +525,6 @@ public:
* @param k species index. Defaults to 0.
* @param sizeUA output int containing the size of the vector.
* Currently, this is equal to 6.
* @deprecated
*/
virtual void getUnitsStandardConc(double* uA, int k = 0,
int sizeUA = 6) const;
@ -1452,10 +1451,8 @@ public:
*
* @param n number of parameters
* @param c array of \a n coefficients
* @deprecated Use methods specific to the derived class
*/
virtual void setParameters(int n, doublereal* const c) {
warn_deprecated("ThermoPhase::setParameters");
}
@ -1466,10 +1463,8 @@ public:
*
* @param n number of parameters
* @param c array of \a n coefficients
* @deprecated Use methods specific to the derived class
*/
virtual void getParameters(int& n, doublereal* const c) const {
warn_deprecated("ThermoPhase::getParameters");
}

View file

@ -365,9 +365,7 @@ public:
virtual const vector_fp& getStandardVolumes() const;
//! Return a reference to a vector of the species standard molar volumes
//! @deprecated Use getStandardVolumes()
const vector_fp& standardVolumes() const {
warn_deprecated("VPSSMgr::standardVolumes");
return m_Vss;
}

View file

@ -29,7 +29,7 @@ CANTERA_INSTALL_ROOT=@ct_installroot@
CANTERA_CORE_INCLUDES=-I$(CANTERA_INSTALL_ROOT)/include
CANTERA_EXTRA_INCLUDES=@mak_extra_includes@
CANTERA_EXTRA_INCLUDES=@mak_extra_includes@
# Required Cantera libraries
CANTERA_CORE_LIBS=@mak_threadflags@ -L$(CANTERA_INSTALL_ROOT)/lib @mak_corelibs@
@ -67,9 +67,11 @@ CANTERA_SUNDIALS_LIBS=@mak_sundials_libdir@ @mak_sundials_libs@
CANTERA_have_blas_lapack_dir=@mak_have_blas_lapack_dir@
ifeq ($(CANTERA_have_blas_lapack_dir), 1)
CANTERA_BLAS_LAPACK_LIBS=-L@blas_lapack_dir@ @mak_blas_lapack_libs@
CANTERA_BLAS_LAPACK_LIBS=@blas_lapack_dir@ @mak_blas_lapack_libs@
CANTERA_BLAS_LAPACK_LIBS_DEP= @mak_blas_lapack_libs_dep@
else
CANTERA_BLAS_LAPACK_LIBS=@mak_blas_lapack_libs@
CANTERA_BLAS_LAPACK_LIBS_DEP=$(CANTERA_INSTALL_DIR)/lib/libctlapack.a $(CANTERA_INSTALL_DIR)/lib/libctblas.a
endif
###############################################################################

View file

@ -85,10 +85,10 @@ localenv['mak_have_blas_lapack_dir'] = '1' if localenv['blas_lapack_dir'] else '
if localenv['blas_lapack_dir']:
localenv['mak_blas_lapack_libs'] = ' '.join('-l%s' % s for s in localenv['blas_lapack_libs'])
elif not env['single_library']:
localenv['mak_blas_lapack_libs'] = ('-L' + '$inst_libdir' + ' -lctlapack -lctblas')
else:
localenv['mak_blas_lapack_libs'] = ''
localenv['mak_blas_lapack_libs'] = ('-L' + '$(CANTERA_INSTALL_ROOT)/lib' + ' -lctlapack -lctblas')
localenv['mak_blas_lapack_libs_dep'] = ( '$' + '(CANTERA_INSTALL_ROOT)' + '/lib' + 'ctlapack' + '.a' + ' $(CANTERA_INSTALL_ROOT)/lib/libctblas.a')
print 'blas = ', localenv['mak_blas_lapack_libs_dep']
if 'Accelerate' in localenv['FRAMEWORKS']:
localenv['mak_blas_lapack_libs'] += ' -framework Accelerate'
@ -111,7 +111,9 @@ if not localenv['build_with_f2c']:
else:
localenv['mak_syslibs'] = ''
print 'making Cantera.mak'
mak = build(localenv.SubstFile('Cantera.mak', 'Cantera.mak.in'))
print 'posted making Cantera.mak'
install('$inst_incdir', mak)
# Generate cantera.pc for use with pkg-config

View file

@ -20,6 +20,7 @@ import SCons.Errors
# Do the substitution
def _subst_file(target, source, env, pattern, replace):
# Read file
#print 'CALLING SUBST_FILE'
f = open(source, "rU")
try:
contents = f.read()
@ -32,7 +33,7 @@ def _subst_file(target, source, env, pattern, replace):
if not SCons.Util.is_String(value):
raise SCons.Errors.UserError("Substitution must be a string.")
return value
#print 'pattern = ' , pattern
contents = re.sub(pattern, subfn, contents)
# Write file
@ -59,6 +60,7 @@ def _subst_keys(source, pattern):
keys.append(key)
return ''
re.sub(pattern, subfn, contents)
return keys
@ -73,7 +75,17 @@ def _subst_value(env, key):
# env.subst already returns a string even if it is stored as a number
# such as env['HAVE_XYZ'] = 1
return env.subst("${%s}" % key)
#print 'key = ', key
#print ' straight env = ', env[key]
#print ' str of the thing = ', str(env[key])
#print ' subst(${}) of the thing = ', env.subst("${%s}" % key)
#print ' %s of the thing = ', "%s" % str(env[key])
aa = env[key]
if aa == []:
aa = ''
return aa
#return str(env[key])
#return env.subst("${%s}" % key)
# Builder related functions
@ -84,6 +96,7 @@ def _subst_action(target, source, env):
# Substitute in the files
pattern = env["SUBST_PATTERN"]
replace = env["SUBST_REPLACE"]
#print 'SUBSTITUTE: ', pattern, ' for ', replace
for (t, s) in zip(target, source):
_subst_file(str(t), str(s), env, pattern, replace)
@ -113,6 +126,7 @@ def _subst_emitter(target, source, env):
d = dict()
for key in keys:
value = _subst_value(env, key)
# print 'key = ', key, ' -> value = ', value
if not value is None:
d[key] = value

View file

@ -15,7 +15,22 @@ using namespace std;
namespace VCSnonideal
{
//====================================================================================================================
// Utility function that evaluates whether a phase can be popped into existence
/*
* A phase can be popped iff the stoichiometric coefficients for the
* component species, whose concentrations will be lowered during the
* process, are positive by at least a small degree.
*
* If one of the phase species is a zeroed component, then the phase can
* be popped if the component increases in mole number as the phase moles
* are increased.
*
* @param iphasePop id of the phase, which is currently zeroed,
*
* @return Returns true if the phase can come into existence
* and false otherwise.
*/
bool VCS_SOLVE::vcs_popPhasePossible(const size_t iphasePop) const
{
vcs_VolPhase* Vphase = m_VolPhaseList[iphasePop];
@ -31,7 +46,8 @@ bool VCS_SOLVE::vcs_popPhasePossible(const size_t iphasePop) const
/*
* Loop through all of the species in the phase. We say the phase
* can be popped, if there is one species in the phase that can be
* popped.
* popped. This does not mean that the phase will be popped or that it
* leads to a lower Gibbs free energy.
*/
for (size_t k = 0; k < Vphase->nSpecies(); k++) {
size_t kspec = Vphase->spGlobalIndexVCS(k);
@ -45,13 +61,18 @@ bool VCS_SOLVE::vcs_popPhasePossible(const size_t iphasePop) const
size_t irxn = kspec - m_numComponents;
if (kspec >= m_numComponents) {
bool iPopPossible = true;
/*
* Note one case is if the component is a member of the popping phase.
* This component will be zeroed and the logic here will negate the current
* species from causing a positive if this component is consumed.
*/
for (size_t j = 0; j < m_numComponents; ++j) {
if (m_elType[j] == VCS_ELEM_TYPE_ABSPOS) {
double stoicC = m_stoichCoeffRxnMatrix[irxn][j];
if (stoicC != 0.0) {
double negChangeComp = - stoicC * 1.0;
double negChangeComp = - stoicC;
if (negChangeComp > 0.0) {
// TODO: We may have to come up with a tolerance here
// If there is no component to give, then the species can't be created
if (m_molNumSpecies_old[j] <= VCS_DELETE_ELEMENTABS_CUTOFF*0.5) {
iPopPossible = false;
}
@ -59,12 +80,13 @@ bool VCS_SOLVE::vcs_popPhasePossible(const size_t iphasePop) const
}
}
}
// We are here when the species can be popped because all its needed components have positive mole numbers
if (iPopPossible) {
return true;
}
} else {
/*
* We are here when the species in the phase is a component. Its mole number is zero.
* We are here when the species, k, in the phase is a component. Its mole number is zero.
* We loop through the regular reaction looking for a reaction that can pop the
* component.
*/
@ -74,6 +96,7 @@ bool VCS_SOLVE::vcs_popPhasePossible(const size_t iphasePop) const
// First, if the component is a product of the reaction
if (m_stoichCoeffRxnMatrix[jrxn][kspec] > 0.0) {
foundJrxn = true;
// We can do the reaction if all other reactant components have positive mole fractions
for (size_t kcomp = 0; kcomp < m_numComponents; kcomp++) {
if (m_stoichCoeffRxnMatrix[jrxn][kcomp] < 0.0) {
if (m_molNumSpecies_old[kcomp] <= VCS_DELETE_ELEMENTABS_CUTOFF*0.5) {
@ -94,6 +117,7 @@ bool VCS_SOLVE::vcs_popPhasePossible(const size_t iphasePop) const
foundJrxn = false;
continue;
}
// We can do the backwards reaction if all of the product components species are positive
for (size_t kcomp = 0; kcomp < m_numComponents; kcomp++) {
if (m_stoichCoeffRxnMatrix[jrxn][kcomp] > 0.0) {
if (m_molNumSpecies_old[kcomp] <= VCS_DELETE_ELEMENTABS_CUTOFF*0.5) {
@ -111,7 +135,7 @@ bool VCS_SOLVE::vcs_popPhasePossible(const size_t iphasePop) const
}
return false;
}
//=====================================================================================================
int VCS_SOLVE::vcs_phasePopDeterminePossibleList()
{
int nfound = 0;
@ -126,7 +150,7 @@ int VCS_SOLVE::vcs_phasePopDeterminePossibleList()
* For zeroed components it lists the phases, which are currently zeroed,
* which have a species with a positive stoichiometric value wrt the component.
* Therefore, we could pop the component species and pop that phase at the same time
* if we considered no other factors than keeping the component mole number positve.
* if we considered no other factors than keeping the component mole number positive.
*
* It does not count species with positive stoichiometric values if that species
* already has a positive mole number. The phase is already popped.
@ -238,7 +262,7 @@ int VCS_SOLVE::vcs_phasePopDeterminePossibleList()
return nfound;
}
//========================================================================================================
size_t VCS_SOLVE::vcs_popPhaseID(std::vector<size_t> & phasePopPhaseIDs)
{
size_t iphasePop = npos;
@ -565,7 +589,7 @@ int VCS_SOLVE::vcs_popPhaseRxnStepSizes(const size_t iphasePop)
return 0;
}
//====================================================================================================================
double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph)
{
/*
@ -897,5 +921,5 @@ double VCS_SOLVE::vcs_phaseStabilityTest(const size_t iph)
#endif
return funcPhaseStability;
}
//====================================================================================================================
}

View file

@ -30,8 +30,6 @@ AqueousKinetics::AqueousKinetics(thermo_t* thermo) :
m_temp(0.0),
m_finalized(false)
{
warn_deprecated("AqueousKinetics",
"Unfinished implementation of this class will be removed.");
if (thermo != 0) {
addPhase(*thermo);
}

View file

@ -1126,12 +1126,10 @@ initThermoXML(XML_Node& phaseNode, const std::string& id_)
void DebyeHuckel::setParameters(int n, doublereal* const c)
{
warn_deprecated("DebyeHuckel::setParameters");
}
void DebyeHuckel::getParameters(int& n, doublereal* const c) const
{
warn_deprecated("DebyeHuckel::getParameters");
}
void DebyeHuckel::setParametersFromXML(const XML_Node& eosdata)

View file

@ -328,13 +328,11 @@ void FixedChemPotSSTP::initThermoXML(XML_Node& phaseNode, const std::string& id_
void FixedChemPotSSTP::setParameters(int n, doublereal* const c)
{
warn_deprecated("FixedChemPotSSTP::setParameters");
chemPot_ = c[0];
}
void FixedChemPotSSTP::getParameters(int& n, doublereal* const c) const
{
warn_deprecated("FixedChemPotSSTP::getParameters");
n = 1;
c[0] = chemPot_;
}

View file

@ -246,7 +246,6 @@ void GeneralSpeciesThermo::
reportParams(size_t index, int& type, doublereal* const c,
doublereal& minTemp_, doublereal& maxTemp_, doublereal& refPressure_) const
{
warn_deprecated("GeneralSpeciesThermo::reportParams");
SpeciesThermoInterpType* sp = m_sp[index];
size_t n;
if (sp) {

View file

@ -1008,12 +1008,10 @@ void HMWSoln::getPartialMolarCp(doublereal* cpbar) const
void HMWSoln::setParameters(int n, doublereal* const c)
{
warn_deprecated("HMWSoln::setParameters");
}
void HMWSoln::getParameters(int& n, doublereal* const c) const
{
warn_deprecated("HMWSoln::getParameters");
}
void HMWSoln::setParametersFromXML(const XML_Node& eosdata)

View file

@ -673,12 +673,10 @@ void IdealMolalSoln::initThermoXML(XML_Node& phaseNode, const std::string& id_)
void IdealMolalSoln::setParameters(int n, doublereal* const c)
{
warn_deprecated("IdealMolalSoln::setParameters");
}
void IdealMolalSoln::getParameters(int& n, doublereal* const c) const
{
warn_deprecated("IdealMolalSoln::getParameters");
}
void IdealMolalSoln::setParametersFromXML(const XML_Node& eosdata)

View file

@ -402,14 +402,12 @@ void LatticePhase::_updateThermo() const
void LatticePhase::setParameters(int n, doublereal* const c)
{
warn_deprecated("LatticePhase::setParameters");
m_site_density = c[0];
setMolarDensity(m_site_density);
}
void LatticePhase::getParameters(int& n, doublereal* const c) const
{
warn_deprecated("LatticePhase::getParameters");
double d = molarDensity();
c[0] = d;
n = 1;

View file

@ -303,14 +303,12 @@ XML_Node* MetalSHEelectrons::makeDefaultXMLTree()
void MetalSHEelectrons::setParameters(int n, doublereal* const c)
{
warn_deprecated("MetalSHEelectrons::setParameters");
doublereal rho = c[0];
setDensity(rho);
}
void MetalSHEelectrons::getParameters(int& n, doublereal* const c) const
{
warn_deprecated("MetalSHEelectrons::getParameters");
doublereal rho = density();
n = 1;
c[0] = rho;

View file

@ -234,14 +234,12 @@ void MineralEQ3::initThermo()
void MineralEQ3::setParameters(int n, doublereal* const c)
{
warn_deprecated("MineralEQ3::setParameters");
doublereal rho = c[0];
setDensity(rho);
}
void MineralEQ3::getParameters(int& n, doublereal* const c) const
{
warn_deprecated("MineralEQ3::getParameters");
doublereal rho = density();
n = 1;
c[0] = rho;

View file

@ -102,7 +102,6 @@ void Mu0Poly::reportParameters(size_t& n, int& type,
doublereal& pref,
doublereal* const coeffs) const
{
warn_deprecated("Mu0Poly::reportParameters");
n = m_index;
type = MU0_INTERP;
tlow = m_lowT;

View file

@ -110,7 +110,6 @@ void Nasa9Poly1::reportParameters(size_t& n, int& type,
doublereal& pref,
doublereal* const coeffs) const
{
warn_deprecated("Nasa9Poly1::reportParameters");
n = m_index;
type = NASA9;
tlow = m_lowT;
@ -126,7 +125,6 @@ void Nasa9Poly1::reportParameters(size_t& n, int& type,
void Nasa9Poly1::modifyParameters(doublereal* coeffs)
{
warn_deprecated("Nasa9Poly1::modifyParameters");
for (int i = 0; i < 9; i++) {
m_coeff[i] = coeffs[i];
}

View file

@ -170,7 +170,6 @@ void Nasa9PolyMultiTempRegion::reportParameters(size_t& n, int& type,
doublereal& pref,
doublereal* const coeffs) const
{
warn_deprecated("Nasa9PolyMultiTempRegion::reportParameters");
n = m_index;
type = NASA9MULTITEMP;
tlow = m_lowT;
@ -196,7 +195,6 @@ void Nasa9PolyMultiTempRegion::reportParameters(size_t& n, int& type,
void Nasa9PolyMultiTempRegion::modifyParameters(doublereal* coeffs)
{
warn_deprecated("Nasa9PolyMultiTempRegion::modifyParameters");
int index = 3;
for (size_t iReg = 0; iReg < m_numTempRegions; iReg++) {
m_regionPts[iReg]->modifyParameters(coeffs + index);

View file

@ -175,7 +175,6 @@ public:
* coeffs[index] = minTempZone
* coeffs[index+1] = maxTempZone
* coeffs[index+2+i] from i =0,9 are the coefficients themselves
* @deprecated
*/
virtual void reportParameters(size_t& n, int& type,
doublereal& tlow, doublereal& thigh,
@ -186,7 +185,6 @@ public:
/*!
* @param coeffs Vector of coefficients used to set the
* parameters for the standard state.
* @deprecated
*/
virtual void modifyParameters(doublereal* coeffs);

View file

@ -151,12 +151,10 @@ public:
}
}
//! @deprecated
void reportParameters(size_t& n, int& type,
doublereal& tlow, doublereal& thigh,
doublereal& pref,
doublereal* const coeffs) const {
warn_deprecated("NasaPoly2::reportParameters");
n = m_index;
type = NASA2;
tlow = m_lowT;

View file

@ -82,12 +82,12 @@ void NasaThermo::install(const std::string& name, size_t index, int type,
vector_fp chigh(c+8, c+15);
vector_fp clow(c+1, c+8);
doublereal maxError = checkContinuity(name, tmid, &clow[0], &chigh[0]);
if (maxError > 1e-6) {
fixDiscontinuities(tlow, tmid, thigh, &clow[0], &chigh[0]);
AssertThrowMsg(checkContinuity(name, tmid, &clow[0], &chigh[0]) < 1e-12,
"NasaThermo::install", "Polynomials still not continuous");
}
checkContinuity(name, tmid, &clow[0], &chigh[0]);
//if (maxError > 1e-6) {
// fixDiscontinuities(tlow, tmid, thigh, &clow[0], &chigh[0]);
// AssertThrowMsg(checkContinuity(name, tmid, &clow[0], &chigh[0]) < 1e-12,
// "NasaThermo::install", "Polynomials still not continuous");
//}
m_high[igrp-1].push_back(NasaPoly1(index, tmid, thigh,
ref_pressure, &chigh[0]));
@ -179,7 +179,6 @@ void NasaThermo::reportParams(size_t index, int& type,
doublereal& maxTemp,
doublereal& refPressure) const
{
warn_deprecated("NasaThermo::reportParams");
type = reportType(index);
if (type == NASA) {
size_t grp = m_group_map[index];

View file

@ -138,7 +138,6 @@ public:
* @param minTemp output - Minimum temperature
* @param maxTemp output - Maximum temperature
* @param refPressure output - reference pressure (Pa).
* @deprecated
*/
virtual void reportParams(size_t index, int& type,
doublereal* const c,

View file

@ -1167,7 +1167,6 @@ void PDSS_HKFT::reportParams(size_t& kindex, int& type,
doublereal& maxTemp_,
doublereal& refPressure_) const
{
warn_deprecated("PDSS_HKFT::reportParams");
// Fill in the first part
PDSS::reportParams(kindex, type, c, minTemp_, maxTemp_,
refPressure_);

View file

@ -192,12 +192,10 @@ public:
updateProperties(tPoly, cp_R, h_RT, s_R);
}
//! @deprecated
virtual void reportParameters(size_t& n, int& type,
doublereal& tlow, doublereal& thigh,
doublereal& pref,
doublereal* const coeffs) const {
warn_deprecated("ShomatePoly::reportParameters");
n = m_index;
type = SHOMATE;
tlow = m_lowT;
@ -214,7 +212,6 @@ public:
* parameters for the standard state.
*/
virtual void modifyParameters(doublereal* coeffs) {
warn_deprecated("ShomatePoly::modifyParameters");
if (m_coeff.size() != 7) {
throw CanteraError("modifyParameters",
"modifying something that hasn't been initialized");
@ -440,12 +437,10 @@ public:
}
}
//! @deprecated
virtual void reportParameters(size_t& n, int& type,
doublereal& tlow, doublereal& thigh,
doublereal& pref,
doublereal* const coeffs) const {
warn_deprecated("ShomatePoly2::reportParameters");
n = m_index;
type = SHOMATE2;
tlow = m_lowT;
@ -464,7 +459,6 @@ public:
* parameters for the standard state.
*/
virtual void modifyParameters(doublereal* coeffs) {
warn_deprecated("ShomatePoly2::modifyParameters");
delete msp_low;
delete msp_high;
std::copy(coeffs, coeffs + 15, m_coeff.begin());

View file

@ -289,13 +289,11 @@ public:
return SHOMATE;
}
//! @deprecated
virtual void reportParams(size_t index, int& type,
doublereal* const c,
doublereal& minTemp,
doublereal& maxTemp,
doublereal& refPressure) const {
warn_deprecated("ShomateThermo::reportParams");
type = reportType(index);
if (type == SHOMATE) {
size_t grp = m_group_map[index];

View file

@ -159,7 +159,6 @@ void STITbyPDSS::reportParameters(size_t& index, int& type,
doublereal& refPressure,
doublereal* const coeffs) const
{
warn_deprecated("STITbyPDSS::reportParameters");
index = m_index;
type = PDSS_TYPE;
minTemp = m_vpssmgr_ptr->minTemp(m_index);

View file

@ -609,7 +609,6 @@ void StatMech::reportParameters(size_t& n, int& type,
doublereal& pref,
doublereal* const coeffs) const
{
warn_deprecated("StatMech::reportParameters");
species* s;
n = m_index;

View file

@ -246,14 +246,12 @@ void StoichSubstance::getCp_R_ref(doublereal* cprt) const
void StoichSubstance::setParameters(int n, double* const c)
{
warn_deprecated("StoichSubstance::setParameters");
double rho = c[0];
setDensity(rho);
}
void StoichSubstance::getParameters(int& n, double* const c) const
{
warn_deprecated("StoichSubstance::getParameters");
double rho = density();
c[0] = rho;
}

View file

@ -255,14 +255,12 @@ void StoichSubstanceSSTP::initThermoXML(XML_Node& phaseNode, const std::string&
void StoichSubstanceSSTP::setParameters(int n, doublereal* const c)
{
warn_deprecated("StoichSubstanceSSTP::setParameters");
doublereal rho = c[0];
setDensity(rho);
}
void StoichSubstanceSSTP::getParameters(int& n, doublereal* const c) const
{
warn_deprecated("StoichSubstanceSSTP::getParameters");
doublereal rho = density();
n = 1;
c[0] = rho;
@ -364,7 +362,6 @@ void electrodeElectron::initThermoXML(XML_Node& phaseNode, const std::string& id
void electrodeElectron::setParameters(int n, doublereal* const c)
{
warn_deprecated("electrodeElectron::setParameters");
doublereal rho = 10.0;
setDensity(rho);
}

View file

@ -185,7 +185,6 @@ doublereal SurfPhase::logStandardConc(size_t k) const
void SurfPhase::setParameters(int n, doublereal* const c)
{
warn_deprecated("SurfPhase::setParameters");
if (n != 1) {
throw CanteraError("SurfPhase::setParameters",
"Bad value for number of parameter");