From 63da219947045af20f303c92367db489617d80a5 Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Sun, 6 Oct 2019 20:18:20 -0500 Subject: [PATCH] [Thermo] deprecate name/id support in Phase::speciesIndex --- include/cantera/thermo/Phase.h | 14 +++++--------- src/thermo/Phase.cpp | 5 +++++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/cantera/thermo/Phase.h b/include/cantera/thermo/Phase.h index 5365a3b41..86288ebfe 100644 --- a/include/cantera/thermo/Phase.h +++ b/include/cantera/thermo/Phase.h @@ -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 diff --git a/src/thermo/Phase.cpp b/src/thermo/Phase.cpp index e662fbded..3e827e980 100644 --- a/src/thermo/Phase.cpp +++ b/src/thermo/Phase.cpp @@ -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;