7#include <unordered_map>
57 [[nodiscard]]
virtual bool contains(
const std::string& symbol)
const = 0;
59 [[nodiscard]]
virtual size_t size() const noexcept = 0;
90 [[nodiscard]] virtual
double getMassFraction(const std::
string& symbol) const = 0;
185 [[nodiscard]] virtual std::
size_t hash() const = 0;
Abstract base class for chemical composition representations.
detail::CompositionIterator< true > const_iterator
virtual double getMolarAbundance(const std::string &symbol) const =0
Get the molar abundance for a given symbol.
virtual std::size_t hash() const =0
virtual bool contains(const fourdst::atomic::Species &species) const noexcept=0
Check if the composition contains the given species.
virtual std::unordered_map< fourdst::atomic::Species, double > getMassFraction() const noexcept=0
Get the mass fraction for all registered symbols.
virtual atomic::Species getSpeciesAtIndex(size_t index) const =0
Get the species at a given index.
virtual iterator begin()=0
virtual std::vector< double > getMolarAbundanceVector() const noexcept=0
Get the molar abundance as a vector.
virtual std::unordered_map< fourdst::atomic::Species, double > getNumberFraction() const noexcept=0
Get the number fraction for all registered symbols.
virtual bool contains(const std::string &symbol) const =0
Check if the composition contains the given species.
virtual std::vector< double > getMassFractionVector() const noexcept=0
Get the mass fraction as a vector.
virtual std::unique_ptr< CompositionAbstract > clone() const =0
virtual std::vector< double > getNumberFractionVector() const noexcept=0
Get the number fraction as a vector.
virtual ~CompositionAbstract()=default
Virtual destructor.
virtual std::set< std::string > getRegisteredSymbols() const noexcept=0
Get all registered chemical symbols in the composition.
detail::CompositionIterator< false > iterator
virtual double getElectronAbundance() const noexcept=0
Get the electron abundance of the composition.
virtual const std::vector< atomic::Species > & getRegisteredSpecies() const noexcept=0
Get all registered atomic species in the composition.
virtual size_t getSpeciesIndex(const std::string &symbol) const =0
Get the index of a species by symbol.
virtual size_t size() const noexcept=0
virtual double getMeanParticleMass() const noexcept=0
Get the mean particle mass of the composition.
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.