Skip to content

Commit ea65ba6

Browse files
author
Ingmar Schoegl
committed
[Thermo] deprecate name/id support in Phase::speciesIndex
1 parent 55fe223 commit ea65ba6

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

include/cantera/thermo/Phase.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,11 @@ namespace Cantera
6666
* operate on a state vector, which is in general of length (2 + nSpecies()).
6767
* The first two entries of the state vector are temperature and density.
6868
*
69-
* A species name may be referred to via three methods:
70-
*
71-
* - "speciesName"
72-
* - "PhaseId:speciesName"
73-
* - "phaseName:speciesName"
74-
* .
75-
*
76-
* The first two methods of naming may not yield a unique species within
77-
* complicated assemblies of %Cantera Phases.
69+
* A species name is referred to via "speciesName", which is unique within a
70+
* given phase. Note that within multiphase mixtures ("MultiPhase"), both a
71+
* phase name/index as well as species name are required to access information
72+
* about a species in a particular phase. For surfaces, the species names are
73+
* unique among the phases.
7874
*
7975
* @todo
8076
* - Make the concept of saving state vectors more general, so that it can

src/thermo/Phase.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,11 @@ size_t Phase::speciesIndex(const std::string& nameStr) const
206206
std::string pn;
207207
std::string sn = parseSpeciesName(nameStr, pn);
208208
if (pn == "" || pn == m_name || pn == m_id) {
209+
warn_deprecated("Phase::speciesIndex()",
210+
"Retrieval of species indices via "
211+
"'PhaseId:speciesName' or 'phaseName:"
212+
"speciesName to be removed "
213+
"after Cantera 2.5.");
209214
it = m_speciesIndices.find(nameStr);
210215
if (it != m_speciesIndices.end()) {
211216
return it->second;

0 commit comments

Comments
 (0)