Change to the function getElementPotentials(). It now returns a

boolean to indicate whether the object has element potentials or not.
This commit is contained in:
Harry Moffat
2006-10-20 21:19:35 +00:00
parent 7a5c817597
commit ea76725720
2 changed files with 10 additions and 5 deletions

View File

@@ -178,7 +178,8 @@ namespace Cantera {
// Newton iteration
for (int n = 0; n < 50; n++) {
dt = (h - enthalpy_mass())/cp_mass();
double h0 = enthalpy_mass();
dt = (h - h0)/cp_mass();
// limit step size to 100 K
if (dt > 100.0) dt = 100.0;
else if (dt < -100.0) dt = -100.0;

View File

@@ -751,16 +751,18 @@ namespace Cantera {
err("setToEquilState");
}
// called by function 'equilibrate' in ChemEquil.h to transfer
// the element potentials to this object
// Called by function 'equilibrate' in ChemEquil.h to transfer
// the element potentials to this object after every successful
// equilibration routine.
void setElementPotentials(const vector_fp& lambda) {
m_lambda = lambda;
m_hasElementPotentials = true;
}
void getElementPotentials(doublereal* lambda) {
if (m_hasElementPotentials)
bool getElementPotentials(doublereal* lambda) {
if (m_hasElementPotentials)
copy(m_lambda.begin(), m_lambda.end(), lambda);
return (m_hasElementPotentials);
}
//@}
@@ -1015,6 +1017,8 @@ namespace Cantera {
/// Index number
int m_index;
doublereal m_phi;
/// Vector of element potentials.
/// -> length equal to number of elements
vector_fp m_lambda;
bool m_hasElementPotentials;