[Thermo] deprecate name/id support in Phase::speciesIndex
This commit is contained in:
parent
7c08e17f08
commit
63da219947
2 changed files with 10 additions and 9 deletions
|
|
@ -68,15 +68,11 @@ class Solution;
|
|||
* operate on a state vector, which is in general of length (2 + nSpecies()).
|
||||
* The first two entries of the state vector are temperature and density.
|
||||
*
|
||||
* A species name may be referred to via three methods:
|
||||
*
|
||||
* - "speciesName"
|
||||
* - "PhaseId:speciesName"
|
||||
* - "phaseName:speciesName"
|
||||
* .
|
||||
*
|
||||
* The first two methods of naming may not yield a unique species within
|
||||
* complicated assemblies of %Cantera Phases.
|
||||
* A species name is referred to via "speciesName", which is unique within a
|
||||
* given phase. Note that within multiphase mixtures ("MultiPhase"), both a
|
||||
* phase name/index as well as species name are required to access information
|
||||
* about a species in a particular phase. For surfaces, the species names are
|
||||
* unique among the phases.
|
||||
*
|
||||
* @todo
|
||||
* - Make the concept of saving state vectors more general, so that it can
|
||||
|
|
|
|||
|
|
@ -214,6 +214,11 @@ size_t Phase::speciesIndex(const std::string& nameStr) const
|
|||
std::string pn;
|
||||
std::string sn = parseSpeciesName(nameStr, pn);
|
||||
if (pn == "" || pn == m_name || pn == m_id) {
|
||||
warn_deprecated("Phase::speciesIndex()",
|
||||
"Retrieval of species indices via "
|
||||
"'PhaseId:speciesName' or 'phaseName:"
|
||||
"speciesName to be removed "
|
||||
"after Cantera 2.5.");
|
||||
it = m_speciesIndices.find(nameStr);
|
||||
if (it != m_speciesIndices.end()) {
|
||||
return it->second;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue