An initial implementation of a string function that returns

the eosType(). This is something that we've been lacking.
This commit is contained in:
Harry Moffat 2009-12-08 17:33:06 +00:00
parent 47aba7b3fd
commit 0e85b295cc
2 changed files with 30 additions and 0 deletions

View file

@ -218,6 +218,26 @@ namespace Cantera {
return th;
}
// Translate the eosType id into a string
/*
* Returns a string representation of the eosType id for a phase.
* @param ieos eosType id of the phase. This is unique for the phase
* @param length maximum length of the return string. Defaults to 100
*
* @return returns a string representation.
*/
std::string eosTypeString(int ieos, int length)
{
std::string ss = "UnknownPhaseType";
// bool found = false;
for (int n = 0; n < ntypes; n++) {
if (_itypes[n] == ieos) {
ss = _types[n];
//found = true;
}
}
return ss;
}
/*

View file

@ -143,6 +143,16 @@ namespace Cantera {
return f->newThermoPhase(model);
}
//! Translate the eosType id into a string
/*!
* Returns a string representation of the eosType id for a phase.
* @param ieos eosType id of the phase. This is unique for the phase
* @param length maximum length of the return string. Defaults to 100
*
* @return returns a string representation.
*/
std::string eosTypeString(int ieos, int length = 100);
/*!
* This routine first looks up the