[Thermo] Add index-based accessor for Species objects

This commit is contained in:
Ray Speth 2015-03-10 14:17:13 -04:00
parent 882a4986da
commit bde0f1466d
2 changed files with 8 additions and 0 deletions

View file

@ -781,6 +781,9 @@ public:
//! Return the Species object for the named species.
shared_ptr<Species> species(const std::string& name) const;
//! Return the Species object for species whose index is *k*.
shared_ptr<Species> species(size_t k) const;
//! Set behavior when adding a species containing undefined elements to just
//! skip the species.
void ignoreUndefinedElements();

View file

@ -971,6 +971,11 @@ shared_ptr<Species> Phase::species(const std::string& name) const
return getValue(m_species, name);
}
shared_ptr<Species> Phase::species(size_t k) const
{
return species(m_speciesNames[k]);
}
void Phase::ignoreUndefinedElements() {
m_undefinedElementBehavior = UndefElement::ignore;
}