5#include <unordered_map>
22 const std::vector<atomic::Species>& activeSpecies
26 [[nodiscard]]
bool contains(
const std::string &symbol)
const override;
28 [[nodiscard]]
const std::vector<atomic::Species>&
getRegisteredSpecies() const noexcept override;
31 [[nodiscard]]
size_t size() const noexcept override;
36 [[nodiscard]]
double getMassFraction(const std::
string &symbol) const override;
50 [[nodiscard]]
size_t getSpeciesIndex(const std::
string &symbol) const override;
62 [[nodiscard]]
size_t hash() const override;
Abstract base class for chemical composition representations.
CompositionDecorator(std::unique_ptr< CompositionAbstract > decorator)
bool contains(const atomic::Species &species) const noexcept override
Check if the composition contains the given species.
size_t hash() const override
std::vector< atomic::Species > m_activeSpecies
std::unordered_map< atomic::Species, double > getMassFraction() const noexcept override
Get the mass fraction for all registered symbols.
std::unordered_map< atomic::Species, double > getNumberFraction() const noexcept override
Get the number fraction for all registered symbols.
double getMolarAbundance(const std::string &symbol) const override
Get the molar abundance for a given symbol.
std::unique_ptr< CompositionAbstract > clone() const override
double getElectronAbundance() const noexcept override
Get the electron abundance of the composition.
double getMeanParticleMass() const noexcept override
Get the mean particle mass of the composition.
const std::vector< atomic::Species > & getRegisteredSpecies() const noexcept override
Get all registered atomic species in the composition.
size_t size() const noexcept override
size_t getSpeciesIndex(const std::string &symbol) const override
Get the index of a species by symbol.
std::vector< double > getMassFractionVector() const noexcept override
Get the mass fraction as a vector.
MaskedComposition(const CompositionAbstract &baseComposition, const std::vector< atomic::Species > &activeSpecies)
std::set< std::string > getRegisteredSymbols() const noexcept override
Get all registered chemical symbols in the composition.
iterator begin() override
std::vector< double > m_molarAbundances
std::vector< double > getMolarAbundanceVector() const noexcept override
Get the molar abundance as a vector.
atomic::Species getSpeciesAtIndex(size_t index) const override
Get the species at a given index.
detail::CompositionIterator< true > const_iterator
std::vector< double > getNumberFractionVector() const noexcept override
Get the number fraction as a vector.
detail::CompositionIterator< false > iterator
Contains canonical information about atomic species and elements used by 4D-STAR.
Utilities and types for representing and manipulating chemical compositions.
Represents an atomic species (isotope) with its fundamental physical properties.