\doxysection{fourdst\+::composition\+::Composition Class Reference}
\hypertarget{classfourdst_1_1composition_1_1_composition}{}\label{classfourdst_1_1composition_1_1_composition}\index{fourdst::composition::Composition@{fourdst::composition::Composition}}


Manages a collection of chemical species and their abundances.  




{\ttfamily \#include $<$composition.\+h$>$}



Inheritance diagram for fourdst\+::composition\+::Composition\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=194pt]{classfourdst_1_1composition_1_1_composition__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for fourdst\+::composition\+::Composition\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classfourdst_1_1composition_1_1_composition__coll__graph}
\end{center}
\end{figure}
\doxysubsubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_1_1_composition_cache}{Composition\+Cache}}
\begin{DoxyCompactList}\small\item\em Caches computed properties of the composition to avoid redundant calculations. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
using \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7eace279c95ac7cccb05434320203343}{iterator}} = \mbox{\hyperlink{classfourdst_1_1composition_1_1detail_1_1_composition_iterator}{detail\+::\+Composition\+Iterator}}$<$false$>$
\item 
using \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a38bbc17eb83b6155163382b27b3818e6}{const\+\_\+iterator}} = \mbox{\hyperlink{classfourdst_1_1composition_1_1detail_1_1_composition_iterator}{detail\+::\+Composition\+Iterator}}$<$true$>$
\end{DoxyCompactItemize}
\doxysubsection*{Public Types inherited from \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract}{fourdst\+::composition\+::\+Composition\+Abstract}}}
\begin{DoxyCompactItemize}
\item 
using \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_abd12f3a9a5b6217498ff19e25ee3ddb0}{iterator}} = \mbox{\hyperlink{classfourdst_1_1composition_1_1detail_1_1_composition_iterator}{detail\+::\+Composition\+Iterator}}$<$false$>$
\item 
using \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a0bb9772bc73d637950b6cf2e8e6afeb0}{const\+\_\+iterator}} = \mbox{\hyperlink{classfourdst_1_1composition_1_1detail_1_1_composition_iterator}{detail\+::\+Composition\+Iterator}}$<$true$>$
\end{DoxyCompactItemize}
\doxysubsubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}} ()=default
\begin{DoxyCompactList}\small\item\em Default constructor. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a08c1d1fe9384c5255a6ba40e34b18315}{\texorpdfstring{$\sim$}{\string~}\+Composition}} () override=default
\begin{DoxyCompactList}\small\item\em Default destructor. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae3cc2099efd7db8eec3d9af2294b75fa}{Composition}} (const std\+::vector$<$ std\+::string $>$ \&symbols)
\begin{DoxyCompactList}\small\item\em Constructs a \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} and registers the given symbols from a vector. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_afa95dddfa88a101ad6ce261295a4460c}{Composition}} (const std\+::vector$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \&species)
\begin{DoxyCompactList}\small\item\em Constructs a \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} and registers the given species from a vector. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a2d6fbe5c8142b358641bbe7ffde51053}{Composition}} (const std\+::set$<$ std\+::string $>$ \&symbols)
\begin{DoxyCompactList}\small\item\em Constructs a \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} and registers the given symbols from a set. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7d19fb3326e51c8fc8db5e0738e97d95}{Composition}} (const std\+::set$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \&species)
\begin{DoxyCompactList}\small\item\em Constructs a \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} and registers the given species from a set. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aae910b7824058f70b96460425a637837}{Composition}} (const std\+::unordered\+\_\+set$<$ std\+::string $>$ \&symbols)
\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a8e7f19488c52c8aba1d7e488688ced7f}{Composition}} (const std\+::unordered\+\_\+set$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \&species)
\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a0b3c93ce7c9473ac4aa4c9ee04f78051}{Composition}} (const std\+::vector$<$ std\+::string $>$ \&symbols, const std\+::vector$<$ double $>$ \&molar\+Abundances)
\begin{DoxyCompactList}\small\item\em Constructs a \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} from symbols and their corresponding molar abundances. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7f0798b3f1191561b38f336406acf62a}{Composition}} (const std\+::vector$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \&species, const std\+::vector$<$ double $>$ \&molar\+Abundances)
\begin{DoxyCompactList}\small\item\em Constructs a \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} from species and their corresponding molar abundances. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ad6cdb28598267743f236d053cd5a62ae}{Composition}} (const std\+::set$<$ std\+::string $>$ \&symbols, const std\+::vector$<$ double $>$ \&molar\+Abundances)
\begin{DoxyCompactList}\small\item\em Constructs a \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} from symbols in a set and their corresponding molar abundances. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1e5e0bd7cf77d5cf260c94418612bb36}{Composition}} (const std\+::unordered\+\_\+map$<$ std\+::string, double $>$ \&symbol\+Molar\+Abundances)
\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a5d3fe0a5d2c6aeae667d4e3894b0ee3b}{Composition}} (const std\+::map$<$ std\+::string, double $>$ \&symbol\+Molar\+Abundances)
\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a321598f3b8bb4c58992d09a90ea3079b}{Composition}} (const std\+::unordered\+\_\+map$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}}, double $>$ \&species\+Molar\+Abundances)
\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a8a371588eaa38c8d54b4baec2a594fc2}{Composition}} (const std\+::map$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}}, double $>$ \&species\+Molar\+Abundances)
\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a21369a80378d4c90438a34f0e4a275ca}{Composition}} (const \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition}{Composition}} \&composition)
\begin{DoxyCompactList}\small\item\em Constructs a \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} from another \doxylink{classfourdst_1_1composition_1_1_composition}{Composition}. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a11e281872b4047e5c757923f2b0682cf}{Composition}} (const \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract}{Composition\+Abstract}} \&composition)
\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition}{Composition}} \& \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4ec1e23cfecef764cb831171fed62fc2}{operator=}} (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition}{Composition}} const \&other)
\begin{DoxyCompactList}\small\item\em Assignment operator. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition}{Composition}} \& \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_afba49b5ceeb42e0372b6118f48b4ee54}{operator=}} (const \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract}{Composition\+Abstract}} \&other)
\item 
void \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3ab4dcda0bfd1a35b169bcc57fe66725}{register\+Symbol}} (const std\+::string \&symbol)
\begin{DoxyCompactList}\small\item\em Registers a new symbol for inclusion in the composition. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a156d1198ef47deed9689949f271969e2}{register\+Symbol}} (const std\+::vector$<$ std\+::string $>$ \&symbols)
\begin{DoxyCompactList}\small\item\em Registers multiple new symbols. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a392a34c19f45d6c936cc7030e6cfaf3f}{register\+Species}} (const \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} \&species) noexcept
\begin{DoxyCompactList}\small\item\em Registers a new species by extracting its symbol. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a2846f4ea0d6075ecdaf4334741a54750}{register\+Species}} (const std\+::vector$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \&species) noexcept
\begin{DoxyCompactList}\small\item\em Registers a vector of new species. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a194f715788e7921bd611579440de2ecd}{contains}} (const \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} \&species) const noexcept override
\begin{DoxyCompactList}\small\item\em Checks if a given species is present in the composition. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ac3bfb56a2587215a59894e76d4867ede}{contains}} (const std\+::string \&symbol) const override
\begin{DoxyCompactList}\small\item\em Checks if a given symbol is present in the composition. \end{DoxyCompactList}\item 
size\+\_\+t \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a9d177d36b728442bcbd8cb66712c7c75}{size}} () const noexcept override
\begin{DoxyCompactList}\small\item\em Gets the number of registered species in the composition. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a262d7133035d4e6f45daa81827abf5e7}{set\+Molar\+Abundance}} (const std\+::string \&symbol, const double \&molar\+\_\+abundance)
\begin{DoxyCompactList}\small\item\em Sets the molar abundance for a given symbol. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ac386709ef1e872fa558b8e30fc8b4c44}{set\+Molar\+Abundance}} (const \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} \&species, const double \&molar\+\_\+abundance)
\begin{DoxyCompactList}\small\item\em Sets the molar abundance for a given isotope. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a6baa22b92a78fd43d10d4941f30c8ac2}{set\+Molar\+Abundance}} (const std\+::vector$<$ std\+::string $>$ \&symbols, const std\+::vector$<$ double $>$ \&molar\+\_\+abundances)
\begin{DoxyCompactList}\small\item\em Sets the molar abundances for a list of symbols. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae908cda3a994292e2eb767fa476b666b}{set\+Molar\+Abundance}} (const std\+::vector$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \&species, const std\+::vector$<$ double $>$ \&molar\+\_\+abundances)
\begin{DoxyCompactList}\small\item\em Sets the molar abundances for a list of isotopes. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a49b06737a50df9c25a234499a1431388}{set\+Molar\+Abundance}} (const std\+::set$<$ std\+::string $>$ \&symbols, const std\+::vector$<$ double $>$ \&molar\+\_\+abundances)
\begin{DoxyCompactList}\small\item\em Sets the molar abundances for a set of symbols. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ad7af2f8f3050969a6c5b9a9ef5fead64}{set\+Molar\+Abundance}} (const std\+::set$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \&species, const std\+::vector$<$ double $>$ \&molar\+\_\+abundances)
\begin{DoxyCompactList}\small\item\em Sets the molar abundances for a set of isotopes. \end{DoxyCompactList}\item 
std\+::set$<$ std\+::string $>$ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3ae885c28580ae15be8c16614bef3b0e}{get\+Registered\+Symbols}} () const noexcept override
\begin{DoxyCompactList}\small\item\em Gets the registered symbols. \end{DoxyCompactList}\item 
const std\+::vector$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \& \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_af4b01ec4140e278d92c18f139f69ab1f}{get\+Registered\+Species}} () const noexcept override
\begin{DoxyCompactList}\small\item\em Get a set of all species that are registered in the composition. \end{DoxyCompactList}\item 
std\+::unordered\+\_\+map$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}}, double $>$ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a9ea2b673341fdc67afeb0f0517a54c8c}{get\+Mass\+Fraction}} () const noexcept override
\begin{DoxyCompactList}\small\item\em Gets the mass fractions of all species in the composition. \end{DoxyCompactList}\item 
double \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae5d8d21632fca2b35b0898f2b205cd10}{get\+Mass\+Fraction}} (const std\+::string \&symbol) const override
\begin{DoxyCompactList}\small\item\em Gets the mass fraction for a given symbol. See the overload for species-\/based lookup for more details on how mass fractions are calculated. \end{DoxyCompactList}\item 
double \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae8fe4e7158f8317bf29b5cd0c65a9524}{get\+Mass\+Fraction}} (const \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} \&species) const override
\begin{DoxyCompactList}\small\item\em Gets the mass fraction for a given species. \end{DoxyCompactList}\item 
double \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a34f71d4d8f0297c576fd62fabd490305}{get\+Number\+Fraction}} (const std\+::string \&symbol) const override
\begin{DoxyCompactList}\small\item\em Gets the number fraction for a given symbol. See the overload for species-\/based lookup for more details on how number fractions are calculated. \end{DoxyCompactList}\item 
double \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1aa79993925f16ba3c30a376aa39161b}{get\+Number\+Fraction}} (const \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} \&species) const override
\begin{DoxyCompactList}\small\item\em Gets the number fraction for a given species. \end{DoxyCompactList}\item 
std\+::unordered\+\_\+map$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}}, double $>$ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1f87ed64a1be9a6091c852131d24e476}{get\+Number\+Fraction}} () const noexcept override
\begin{DoxyCompactList}\small\item\em Gets the number fractions of all species in the composition. \end{DoxyCompactList}\item 
double \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_add67a92d73e3a57a2bbdb52bc9ca3bfe}{get\+Molar\+Abundance}} (const std\+::string \&symbol) const override
\begin{DoxyCompactList}\small\item\em Gets the molar abundances of all species in the composition. \end{DoxyCompactList}\item 
double \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a78a43e9e77a9c1b0f27c50b9feb52449}{get\+Molar\+Abundance}} (const \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} \&species) const override
\begin{DoxyCompactList}\small\item\em Gets the molar abundance for a given species. \end{DoxyCompactList}\item 
double \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_afbbb5e51ad5ae5c0fa6bc0094195aecd}{get\+Mean\+Particle\+Mass}} () const noexcept override
\begin{DoxyCompactList}\small\item\em Compute the mean particle mass of the composition. \end{DoxyCompactList}\item 
double \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a90fc71d1fe03017ee4c7a1cac69d24fb}{get\+Electron\+Abundance}} () const noexcept override
\begin{DoxyCompactList}\small\item\em Compute the electron abundance of the composition. \end{DoxyCompactList}\item 
\mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition}{Canonical\+Composition}} \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aac5b214a3d1278e127422224cb9cee50}{get\+Canonical\+Composition}} () const
\begin{DoxyCompactList}\small\item\em Compute the canonical composition (X, Y, Z) of the composition. \end{DoxyCompactList}\item 
std\+::vector$<$ double $>$ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_af4f44aaf8b7e0d63872a70b5e2131369}{get\+Mass\+Fraction\+Vector}} () const noexcept override
\begin{DoxyCompactList}\small\item\em Get a uniform vector representation of the mass fraction stored in the composition object sorted such that the lightest species is at index 0 and the heaviest is at the last index. \end{DoxyCompactList}\item 
std\+::vector$<$ double $>$ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae4f72972cf4d1ff422d0790080e11473}{get\+Number\+Fraction\+Vector}} () const noexcept override
\begin{DoxyCompactList}\small\item\em Get a uniform vector representation of the number fractions stored in the composition object sorted such that the lightest species is at index 0 and the heaviest is at the last index. \end{DoxyCompactList}\item 
std\+::vector$<$ double $>$ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abcb391f5fca2b636127e48e681e4c3ee}{get\+Molar\+Abundance\+Vector}} () const noexcept override
\begin{DoxyCompactList}\small\item\em Get a uniform vector representation of the molar abundances stored in the composition object sorted such that the lightest species is at index 0 and the heaviest is at the last index. \end{DoxyCompactList}\item 
size\+\_\+t \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a0d94f62402bb90b5d12679faeaa8c5d7}{get\+Species\+Index}} (const std\+::string \&symbol) const override
\begin{DoxyCompactList}\small\item\em get the index in the sorted vector representation for a given symbol \end{DoxyCompactList}\item 
size\+\_\+t \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3d220b42fa06d7d3a43944ee2b8f6a5f}{get\+Species\+Index}} (const \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} \&species) const override
\begin{DoxyCompactList}\small\item\em get the index in the sorted vector representation for a given symbol \end{DoxyCompactList}\item 
\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae4f854ded38f5e6fcd157a74a57cbf0c}{get\+Species\+At\+Index}} (size\+\_\+t index) const override
\begin{DoxyCompactList}\small\item\em Get the species at a given index in the sorted vector representation. \end{DoxyCompactList}\item 
std\+::unique\+\_\+ptr$<$ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract}{Composition\+Abstract}} $>$ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a5a1f5661a329ec7bc8b7e118ff9d6c25}{clone}} () const override
\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7eace279c95ac7cccb05434320203343}{iterator}} \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a5bdb6ca3f734fae901b3d6179dbc17a0}{begin}} () override
\begin{DoxyCompactList}\small\item\em Returns an iterator to the beginning of the molar abundance map. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a38bbc17eb83b6155163382b27b3818e6}{const\+\_\+iterator}} \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae4600dc915645fc1b50c67e0218b794d}{begin}} () const override
\begin{DoxyCompactList}\small\item\em Returns a const iterator to the beginning of the molar abundance map. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1detail_1_1_composition_iterator}{detail\+::\+Composition\+Iterator}}$<$ false $>$ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aaa89050308dda5e51d4b47d18d54cb58}{end}} () override
\begin{DoxyCompactList}\small\item\em Returns an iterator to the end of the molar abundance map. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classfourdst_1_1composition_1_1detail_1_1_composition_iterator}{detail\+::\+Composition\+Iterator}}$<$ true $>$ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aabcde53961ecadfa823de5a766f0da84}{end}} () const override
\begin{DoxyCompactList}\small\item\em Returns a const iterator to the end of the molar abundance map. \end{DoxyCompactList}\item 
std\+::size\+\_\+t \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a5b3631fa33b0c6809ad652b0e31663a1}{hash}} () const override
\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract}{fourdst\+::composition\+::\+Composition\+Abstract}}}
\begin{DoxyCompactItemize}
\item 
virtual \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a83ff77f3f390bb66c978e157d9bb6394}{\texorpdfstring{$\sim$}{\string~}\+Composition\+Abstract}} ()=default
\begin{DoxyCompactList}\small\item\em Virtual destructor. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Private Types}
\begin{DoxyCompactItemize}
\item 
enum class \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aeef903d5b7d02467c6462d183ac47db8}{Species\+Index\+Lookup\+Error}} \+: uint8\+\_\+t \{ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aeef903d5b7d02467c6462d183ac47db8ac7cc0e85688b85571f30fd16a46d9891}{NO\+\_\+\+REGISTERED\+\_\+\+SPECIES}}
, \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aeef903d5b7d02467c6462d183ac47db8a3659baf2b06bba6c02bad8316d517761}{SPECIES\+\_\+\+NOT\+\_\+\+FOUND}}
 \}
\end{DoxyCompactItemize}
\doxysubsubsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
std\+::expected$<$ std\+::ptrdiff\+\_\+t, \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aeef903d5b7d02467c6462d183ac47db8}{Species\+Index\+Lookup\+Error}} $>$ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aded88f0ad4a97eaae1e356fa8428cab5}{find\+Species\+Index}} (const \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} \&species) const noexcept
\end{DoxyCompactItemize}
\doxysubsubsection*{Static Private Member Functions}
\begin{DoxyCompactItemize}
\item 
static quill\+::\+Logger \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{get\+Logger}} ()
\begin{DoxyCompactList}\small\item\em Gets the logger instance for the \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} class. This is static to ensure that all composition objects share the same logger instance. \end{DoxyCompactList}\item 
static std\+::vector$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3f013e33b8978baf81447e5bd177f38b}{symbol\+Vector\+To\+Species\+Vector}} (const std\+::vector$<$ std\+::string $>$ \&symbols)
\end{DoxyCompactItemize}
\doxysubsubsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
std\+::vector$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\+\_\+species}}
\item 
std\+::vector$<$ double $>$ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\+\_\+molar\+Abundances}}
\item 
\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_1_1_composition_cache}{Composition\+Cache}} \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\+\_\+cache}}
\begin{DoxyCompactList}\small\item\em Cache for computed properties to avoid redundant calculations. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Friends}
\begin{DoxyCompactItemize}
\item 
std\+::ostream \& \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a36c2525d21cd932065bb2bb30bc57fb4}{operator$<$$<$}} (std\+::ostream \&os, const \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition}{Composition}} \&composition)
\begin{DoxyCompactList}\small\item\em Overloaded output stream operator for \doxylink{classfourdst_1_1composition_1_1_composition}{Composition}. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Manages a collection of chemical species and their abundances. 

This class is a primary interface for defining and manipulating material compositions. In order to use the \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} class a user must first register symbols or species. Symbols are the string representation of a species (i.\+e. deuterium would be "{}\+H-\/2"{} whereas Beryllium 7 would be "{}\+Be-\/7"{}) and then set the molar abundances. Species are the data structure \doxylink{structfourdst_1_1atomic_1_1_species}{fourdst\+::atomic\+::\+Species} version. Here Deuterium would be represented by the Species \doxylink{namespacefourdst_1_1atomic_a0eac406fa90f2925ea40737380ce0d74}{fourdst\+::atomic\+::\+H\+\_\+2} whereas Beryllium 7 would be \doxylink{namespacefourdst_1_1atomic_a800b0869c767928825a71ae0d2382a95}{fourdst\+::atomic\+::\+Be\+\_\+7}. Once the symbols/species have been registered the user can then set molar abundances.

Once the \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} object has been populated the user can query mass fractions, number fractions, electron abundances, mean particle mass, molar abundance, and Canonical (X, Y, Z) composition.

\begin{DoxyNote}{Note}
This class only accepts molar abundances as input. If you wish to construct a \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} using a vector of mass fractions, those must first be converted to molar abundances. There is a helper function {\ttfamily \doxylink{namespacefourdst_1_1composition_aa90b1ef07d607c0c829bedccf381cf54}{fourdst\+::composition\+::build\+Composition\+From\+Mass\+Fractions}} which wll facilitate just that.
\end{DoxyNote}

\begin{DoxyExceptions}{Exceptions}
{\em This} & class throws various exceptions from {\ttfamily \doxylink{namespacefourdst_1_1composition_1_1exceptions}{fourdst\+::composition\+::exceptions}} for invalid operations, such as using unregistered symbols or providing invalid abundances.\\
\hline
\end{DoxyExceptions}
\begin{DoxyParagraph}{Basic Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp;}
\DoxyCodeLine{comp.registerSymbol(\textcolor{stringliteral}{"{}H-\/1"{}});}
\DoxyCodeLine{comp.registerSymbol(\textcolor{stringliteral}{"{}He-\/4"{}});}
\DoxyCodeLine{comp.setMolarAbundance(\textcolor{stringliteral}{"{}H-\/1"{}},\ 0.75);}
\DoxyCodeLine{comp.setMolarAbundance(\textcolor{stringliteral}{"{}He-\/4"{}},\ 0.25);\ \textcolor{comment}{//\ Note\ Molar\ Abundances\ do\ not\ need\ to\ sum\ to\ 1}}

\end{DoxyCode}
 
\end{DoxyParagraph}


Definition at line \mbox{\hyperlink{composition_8h_source_l00099}{99}} of file \mbox{\hyperlink{composition_8h_source}{composition.\+h}}.



\doxysubsection{Member Typedef Documentation}
\Hypertarget{classfourdst_1_1composition_1_1_composition_a38bbc17eb83b6155163382b27b3818e6}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!const\_iterator@{const\_iterator}}
\index{const\_iterator@{const\_iterator}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{const\_iterator}{const\_iterator}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a38bbc17eb83b6155163382b27b3818e6} 
using \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a38bbc17eb83b6155163382b27b3818e6}{fourdst\+::composition\+::\+Composition\+::const\+\_\+iterator}} = \mbox{\hyperlink{classfourdst_1_1composition_1_1detail_1_1_composition_iterator}{detail\+::\+Composition\+Iterator}}$<$true$>$}



Definition at line \mbox{\hyperlink{composition_8h_source_l00102}{102}} of file \mbox{\hyperlink{composition_8h_source}{composition.\+h}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a7eace279c95ac7cccb05434320203343}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!iterator@{iterator}}
\index{iterator@{iterator}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{iterator}{iterator}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a7eace279c95ac7cccb05434320203343} 
using \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7eace279c95ac7cccb05434320203343}{fourdst\+::composition\+::\+Composition\+::iterator}} = \mbox{\hyperlink{classfourdst_1_1composition_1_1detail_1_1_composition_iterator}{detail\+::\+Composition\+Iterator}}$<$false$>$}



Definition at line \mbox{\hyperlink{composition_8h_source_l00101}{101}} of file \mbox{\hyperlink{composition_8h_source}{composition.\+h}}.



\doxysubsection{Member Enumeration Documentation}
\Hypertarget{classfourdst_1_1composition_1_1_composition_aeef903d5b7d02467c6462d183ac47db8}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!SpeciesIndexLookupError@{SpeciesIndexLookupError}}
\index{SpeciesIndexLookupError@{SpeciesIndexLookupError}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{SpeciesIndexLookupError}{SpeciesIndexLookupError}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_aeef903d5b7d02467c6462d183ac47db8} 
enum class \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aeef903d5b7d02467c6462d183ac47db8}{fourdst\+::composition\+::\+Composition\+::\+Species\+Index\+Lookup\+Error}} \+: uint8\+\_\+t\hspace{0.3cm}{\ttfamily [strong]}, {\ttfamily [private]}}

\begin{DoxyEnumFields}[2]{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{NO\_REGISTERED\_SPECIES@{NO\_REGISTERED\_SPECIES}!fourdst::composition::Composition@{fourdst::composition::Composition}}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!NO\_REGISTERED\_SPECIES@{NO\_REGISTERED\_SPECIES}}}\Hypertarget{classfourdst_1_1composition_1_1_composition_aeef903d5b7d02467c6462d183ac47db8ac7cc0e85688b85571f30fd16a46d9891}\label{classfourdst_1_1composition_1_1_composition_aeef903d5b7d02467c6462d183ac47db8ac7cc0e85688b85571f30fd16a46d9891} 
NO\+\_\+\+REGISTERED\+\_\+\+SPECIES&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{SPECIES\_NOT\_FOUND@{SPECIES\_NOT\_FOUND}!fourdst::composition::Composition@{fourdst::composition::Composition}}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!SPECIES\_NOT\_FOUND@{SPECIES\_NOT\_FOUND}}}\Hypertarget{classfourdst_1_1composition_1_1_composition_aeef903d5b7d02467c6462d183ac47db8a3659baf2b06bba6c02bad8316d517761}\label{classfourdst_1_1composition_1_1_composition_aeef903d5b7d02467c6462d183ac47db8a3659baf2b06bba6c02bad8316d517761} 
SPECIES\+\_\+\+NOT\+\_\+\+FOUND&\\
\hline

\end{DoxyEnumFields}


Definition at line \mbox{\hyperlink{composition_8h_source_l00146}{146}} of file \mbox{\hyperlink{composition_8h_source}{composition.\+h}}.



\doxysubsection{Constructor \& Destructor Documentation}
\Hypertarget{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!Composition@{Composition}}
\index{Composition@{Composition}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{Composition()}{Composition()}\hspace{0.1cm}{\footnotesize\ttfamily [1/16]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88} 
fourdst\+::composition\+::\+Composition\+::\+Composition (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [default]}}



Default constructor. 

Creates an empty \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} object. No symbols or species are registered initially; however, the user can register symbols or species later using the provided methods. \Hypertarget{classfourdst_1_1composition_1_1_composition_a08c1d1fe9384c5255a6ba40e34b18315}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!````~Composition@{\texorpdfstring{$\sim$}{\string~}Composition}}
\index{````~Composition@{\texorpdfstring{$\sim$}{\string~}Composition}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{\texorpdfstring{$\sim$}{\string~}Composition()}{\string~Composition()}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a08c1d1fe9384c5255a6ba40e34b18315} 
fourdst\+::composition\+::\+Composition\+::\texorpdfstring{$\sim$}{\string~}\+Composition (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [default]}}



Default destructor. 

\Hypertarget{classfourdst_1_1composition_1_1_composition_ae3cc2099efd7db8eec3d9af2294b75fa}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!Composition@{Composition}}
\index{Composition@{Composition}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{Composition()}{Composition()}\hspace{0.1cm}{\footnotesize\ttfamily [2/16]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_ae3cc2099efd7db8eec3d9af2294b75fa} 
fourdst\+::composition\+::\+Composition\+::\+Composition (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ std\+::string $>$ \&}]{symbols}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [explicit]}}



Constructs a \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} and registers the given symbols from a vector. 


\begin{DoxyParams}{Parameters}
{\em symbols} & The symbols to register. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unknown_symbol_error}{exceptions\+::\+Unknown\+Symbol\+Error}} & if any symbol is invalid. Symbols are invalid if they are not registered at compile time in the atomic species database ({\ttfamily \doxylink{species_8h}{fourdst/atomic/species.\+h}}). \\
\hline
\end{DoxyExceptions}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{std::vector<std::string>\ symbols\ =\ \{\textcolor{stringliteral}{"{}H-\/1"{}},\ \textcolor{stringliteral}{"{}O-\/16"{}}\};}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp(symbols);}

\end{DoxyCode}
 
\end{DoxyParagraph}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00081}{81}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_afa95dddfa88a101ad6ce261295a4460c}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!Composition@{Composition}}
\index{Composition@{Composition}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{Composition()}{Composition()}\hspace{0.1cm}{\footnotesize\ttfamily [3/16]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_afa95dddfa88a101ad6ce261295a4460c} 
fourdst\+::composition\+::\+Composition\+::\+Composition (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \&}]{species}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [explicit]}}



Constructs a \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} and registers the given species from a vector. 


\begin{DoxyParams}{Parameters}
{\em species} & The species to register. \\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{std::vector<fourdst::atomic::Species>\ species\ =\ \{\mbox{\hyperlink{namespacefourdst_1_1atomic_a6766bc834fd656df51bdcf22f7d97877}{fourdst::atomic::H\_1}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_af2588b97ce949e37c193d6a3e5cb84a0}{fourdst::atomic::O\_16}}\};}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp(species);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
Because species are strongly typed, this constructor does not need to check if the species is valid. that is to say that the compiler will only allow valid species to be passed in. Therefore, this constructor is marked noexcept and may therefore be slightly more performant than the symbol-\/based constructor. 
\end{DoxyNote}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00085}{85}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a2d6fbe5c8142b358641bbe7ffde51053}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!Composition@{Composition}}
\index{Composition@{Composition}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{Composition()}{Composition()}\hspace{0.1cm}{\footnotesize\ttfamily [4/16]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a2d6fbe5c8142b358641bbe7ffde51053} 
fourdst\+::composition\+::\+Composition\+::\+Composition (\begin{DoxyParamCaption}\item[{const std\+::set$<$ std\+::string $>$ \&}]{symbols}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [explicit]}}



Constructs a \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} and registers the given symbols from a set. 


\begin{DoxyParams}{Parameters}
{\em symbols} & The symbols to register. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unknown_symbol_error}{exceptions\+::\+Unknown\+Symbol\+Error}} & if any symbol is invalid. Symbols are invalid if they are not registered at compile time in the atomic species database ({\ttfamily \doxylink{species_8h}{fourdst/atomic/species.\+h}}). \\
\hline
\end{DoxyExceptions}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{std::set<std::string>\ symbols\ =\ \{\textcolor{stringliteral}{"{}H-\/1"{}},\ \textcolor{stringliteral}{"{}O-\/16"{}}\};}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp(symbols);}

\end{DoxyCode}

\end{DoxyParagraph}
Constructors without molar abundances /// These all delegate to the ctor /// vector$<$\+Species$>$ /// 

Definition at line \mbox{\hyperlink{composition_8cpp_source_l00065}{65}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a7d19fb3326e51c8fc8db5e0738e97d95}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!Composition@{Composition}}
\index{Composition@{Composition}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{Composition()}{Composition()}\hspace{0.1cm}{\footnotesize\ttfamily [5/16]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a7d19fb3326e51c8fc8db5e0738e97d95} 
fourdst\+::composition\+::\+Composition\+::\+Composition (\begin{DoxyParamCaption}\item[{const std\+::set$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \&}]{species}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [explicit]}}



Constructs a \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} and registers the given species from a set. 


\begin{DoxyParams}{Parameters}
{\em species} & The species to register. \\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{std::set<fourdst::atomic::Species>\ species\ =\ \{\mbox{\hyperlink{namespacefourdst_1_1atomic_a6766bc834fd656df51bdcf22f7d97877}{fourdst::atomic::H\_1}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_af2588b97ce949e37c193d6a3e5cb84a0}{fourdst::atomic::O\_16}}\};}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp(species);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
Because species are strongly typed, this constructor does not need to check if the species is valid. that is to say that the compiler will only allow valid species to be passed in. Therefore, this constructor is marked noexcept and may therefore be slightly more performant than the symbol-\/based constructor. 
\end{DoxyNote}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00069}{69}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_aae910b7824058f70b96460425a637837}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!Composition@{Composition}}
\index{Composition@{Composition}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{Composition()}{Composition()}\hspace{0.1cm}{\footnotesize\ttfamily [6/16]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_aae910b7824058f70b96460425a637837} 
fourdst\+::composition\+::\+Composition\+::\+Composition (\begin{DoxyParamCaption}\item[{const std\+::unordered\+\_\+set$<$ std\+::string $>$ \&}]{symbols}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [explicit]}}



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00073}{73}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a8e7f19488c52c8aba1d7e488688ced7f}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!Composition@{Composition}}
\index{Composition@{Composition}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{Composition()}{Composition()}\hspace{0.1cm}{\footnotesize\ttfamily [7/16]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a8e7f19488c52c8aba1d7e488688ced7f} 
fourdst\+::composition\+::\+Composition\+::\+Composition (\begin{DoxyParamCaption}\item[{const std\+::unordered\+\_\+set$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \&}]{species}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [explicit]}}



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00077}{77}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a0b3c93ce7c9473ac4aa4c9ee04f78051}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!Composition@{Composition}}
\index{Composition@{Composition}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{Composition()}{Composition()}\hspace{0.1cm}{\footnotesize\ttfamily [8/16]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a0b3c93ce7c9473ac4aa4c9ee04f78051} 
fourdst\+::composition\+::\+Composition\+::\+Composition (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ std\+::string $>$ \&}]{symbols}{, }\item[{const std\+::vector$<$ double $>$ \&}]{molar\+Abundances}{}\end{DoxyParamCaption})}



Constructs a \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} from symbols and their corresponding molar abundances. 


\begin{DoxyParams}{Parameters}
{\em symbols} & The symbols to register. \\
\hline
{\em molar\+Abundances} & The corresponding molar abundances for each symbol. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unknown_symbol_error}{exceptions\+::\+Unknown\+Symbol\+Error}} & if any symbol is invalid. Symbols are invalid if they are not registered at compile time in the atomic species database ({\ttfamily \doxylink{species_8h}{fourdst/atomic/species.\+h}}). \\
\hline
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions\+::\+Invalid\+Composition\+Error}} & if the number of symbols does not match the number of molar abundances. \\
\hline
\end{DoxyExceptions}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{std::vector<std::string>\ symbols\ =\ \{\textcolor{stringliteral}{"{}H-\/1"{}},\ \textcolor{stringliteral}{"{}O-\/16"{}}\};}
\DoxyCodeLine{std::vector<double>\ molarAbundances\ =\ \{1.03,\ 0.6\};}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp(symbols,\ molarAbundances);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
Molar abundances do not need to sum to 1.\+0, they are an absolute quantity.
\end{DoxyNote}
Constructors with molar abundances /// These all delegate to the ctor /// vector$<$\+Species, vector$<$double$>$$>$ /// 

Definition at line \mbox{\hyperlink{composition_8cpp_source_l00105}{105}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a7f0798b3f1191561b38f336406acf62a}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!Composition@{Composition}}
\index{Composition@{Composition}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{Composition()}{Composition()}\hspace{0.1cm}{\footnotesize\ttfamily [9/16]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a7f0798b3f1191561b38f336406acf62a} 
fourdst\+::composition\+::\+Composition\+::\+Composition (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \&}]{species}{, }\item[{const std\+::vector$<$ double $>$ \&}]{molar\+Abundances}{}\end{DoxyParamCaption})}



Constructs a \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} from species and their corresponding molar abundances. 


\begin{DoxyParams}{Parameters}
{\em species} & The species to register. \\
\hline
{\em molar\+Abundances} & The corresponding molar abundances for each species. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions\+::\+Invalid\+Composition\+Error}} & if the number of species does not match the number of molar abundances. \\
\hline
\end{DoxyExceptions}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{std::vector<fourdst::atomic::Species>\ species\ =\ \{\mbox{\hyperlink{namespacefourdst_1_1atomic_a6766bc834fd656df51bdcf22f7d97877}{fourdst::atomic::H\_1}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_af2588b97ce949e37c193d6a3e5cb84a0}{fourdst::atomic::O\_16}}\};}
\DoxyCodeLine{std::vector<double>\ molarAbundances\ =\ \{1.03,\ 0.6\};}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp(species,\ molarAbundances);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
Molar abundances do not need to sum to 1.\+0, they are an absolute quantity. 
\end{DoxyNote}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00144}{144}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_ad6cdb28598267743f236d053cd5a62ae}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!Composition@{Composition}}
\index{Composition@{Composition}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{Composition()}{Composition()}\hspace{0.1cm}{\footnotesize\ttfamily [10/16]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_ad6cdb28598267743f236d053cd5a62ae} 
fourdst\+::composition\+::\+Composition\+::\+Composition (\begin{DoxyParamCaption}\item[{const std\+::set$<$ std\+::string $>$ \&}]{symbols}{, }\item[{const std\+::vector$<$ double $>$ \&}]{molar\+Abundances}{}\end{DoxyParamCaption})}



Constructs a \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} from symbols in a set and their corresponding molar abundances. 


\begin{DoxyParams}{Parameters}
{\em symbols} & The symbols to register. \\
\hline
{\em molar\+Abundances} & The corresponding molar abundances for each symbol. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unknown_symbol_error}{exceptions\+::\+Unknown\+Symbol\+Error}} & if any symbol is invalid. Symbols are invalid if they are not registered at compile time in the atomic species database ({\ttfamily \doxylink{species_8h}{fourdst/atomic/species.\+h}}). \\
\hline
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions\+::\+Invalid\+Composition\+Error}} & if the number of symbols does not match the number of molar abundances. \\
\hline
\end{DoxyExceptions}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{std::set<std::string>\ symbols\ =\ \{\textcolor{stringliteral}{"{}H-\/1"{}},\ \textcolor{stringliteral}{"{}O-\/16"{}}\};}
\DoxyCodeLine{std::vector<double>\ molarAbundances\ =\ \{1.03,\ 0.6\};}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp(symbols,\ molarAbundances);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
Molar abundances do not need to sum to 1.\+0, they are an absolute quantity. 
\end{DoxyNote}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00110}{110}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a1e5e0bd7cf77d5cf260c94418612bb36}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!Composition@{Composition}}
\index{Composition@{Composition}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{Composition()}{Composition()}\hspace{0.1cm}{\footnotesize\ttfamily [11/16]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a1e5e0bd7cf77d5cf260c94418612bb36} 
fourdst\+::composition\+::\+Composition\+::\+Composition (\begin{DoxyParamCaption}\item[{const std\+::unordered\+\_\+map$<$ std\+::string, double $>$ \&}]{symbol\+Molar\+Abundances}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [explicit]}}



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00116}{116}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a5d3fe0a5d2c6aeae667d4e3894b0ee3b}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!Composition@{Composition}}
\index{Composition@{Composition}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{Composition()}{Composition()}\hspace{0.1cm}{\footnotesize\ttfamily [12/16]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a5d3fe0a5d2c6aeae667d4e3894b0ee3b} 
fourdst\+::composition\+::\+Composition\+::\+Composition (\begin{DoxyParamCaption}\item[{const std\+::map$<$ std\+::string, double $>$ \&}]{symbol\+Molar\+Abundances}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [explicit]}}



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00123}{123}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a321598f3b8bb4c58992d09a90ea3079b}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!Composition@{Composition}}
\index{Composition@{Composition}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{Composition()}{Composition()}\hspace{0.1cm}{\footnotesize\ttfamily [13/16]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a321598f3b8bb4c58992d09a90ea3079b} 
fourdst\+::composition\+::\+Composition\+::\+Composition (\begin{DoxyParamCaption}\item[{const std\+::unordered\+\_\+map$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}}, double $>$ \&}]{species\+Molar\+Abundances}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [explicit]}}



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00130}{130}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a8a371588eaa38c8d54b4baec2a594fc2}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!Composition@{Composition}}
\index{Composition@{Composition}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{Composition()}{Composition()}\hspace{0.1cm}{\footnotesize\ttfamily [14/16]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a8a371588eaa38c8d54b4baec2a594fc2} 
fourdst\+::composition\+::\+Composition\+::\+Composition (\begin{DoxyParamCaption}\item[{const std\+::map$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}}, double $>$ \&}]{species\+Molar\+Abundances}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [explicit]}}



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00137}{137}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a21369a80378d4c90438a34f0e4a275ca}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!Composition@{Composition}}
\index{Composition@{Composition}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{Composition()}{Composition()}\hspace{0.1cm}{\footnotesize\ttfamily [15/16]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a21369a80378d4c90438a34f0e4a275ca} 
fourdst\+::composition\+::\+Composition\+::\+Composition (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition}{Composition}} \&}]{composition}{}\end{DoxyParamCaption})}



Constructs a \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} from another \doxylink{classfourdst_1_1composition_1_1_composition}{Composition}. 

Copy and conversion constructors ///.


\begin{DoxyParams}{Parameters}
{\em composition} & The \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} to copy. \\
\hline
\end{DoxyParams}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00192}{192}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a11e281872b4047e5c757923f2b0682cf}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!Composition@{Composition}}
\index{Composition@{Composition}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{Composition()}{Composition()}\hspace{0.1cm}{\footnotesize\ttfamily [16/16]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a11e281872b4047e5c757923f2b0682cf} 
fourdst\+::composition\+::\+Composition\+::\+Composition (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract}{Composition\+Abstract}} \&}]{composition}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [explicit]}}



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00197}{197}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.



\doxysubsection{Member Function Documentation}
\Hypertarget{classfourdst_1_1composition_1_1_composition_ae4600dc915645fc1b50c67e0218b794d}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!begin@{begin}}
\index{begin@{begin}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{begin()}{begin()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_ae4600dc915645fc1b50c67e0218b794d} 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a38bbc17eb83b6155163382b27b3818e6}{const\+\_\+iterator}} fourdst\+::composition\+::\+Composition\+::begin (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}}



Returns a const iterator to the beginning of the molar abundance map. 

\begin{DoxyReturn}{Returns}
A const iterator to the beginning.
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp(\{\textcolor{stringliteral}{"{}H-\/1"{}},\ \textcolor{stringliteral}{"{}He-\/4"{}},\ \textcolor{stringliteral}{"{}C-\/12"{}}\},\ \{1.02,\ 0.56,\ 0.02\});}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ [sp,\ y]\ :\ comp)\ \{}
\DoxyCodeLine{\ \ \ \ \ std::cout\ <<\ \textcolor{stringliteral}{"{}Species:\ "{}}\ <<\ sp\ <<\ \textcolor{stringliteral}{"{},\ Molar\ Abundance:\ "{}}\ <<\ y\ <<\ std::endl;}
\DoxyCodeLine{\}}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
Because we store molar abundances as a sorted map, keyed by species. And Because the \texorpdfstring{$<$}{<} and \texorpdfstring{$>$}{>} operators for species are defined based on their atomic mass. When iterating over the molar abundance map, species will be seen in order from lightest to heaviest. 
\end{DoxyNote}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a0a1845dab0dbf23399233cac7aeb05c1}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8h_source_l00808}{808}} of file \mbox{\hyperlink{composition_8h_source}{composition.\+h}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a5bdb6ca3f734fae901b3d6179dbc17a0}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!begin@{begin}}
\index{begin@{begin}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{begin()}{begin()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a5bdb6ca3f734fae901b3d6179dbc17a0} 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7eace279c95ac7cccb05434320203343}{iterator}} fourdst\+::composition\+::\+Composition\+::begin (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}}



Returns an iterator to the beginning of the molar abundance map. 

\begin{DoxyReturn}{Returns}
An iterator to the beginning.
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp(\{\textcolor{stringliteral}{"{}H-\/1"{}},\ \textcolor{stringliteral}{"{}He-\/4"{}},\ \textcolor{stringliteral}{"{}C-\/12"{}}\},\ \{1.02,\ 0.56,\ 0.02\});}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ [sp,\ y]\ :\ comp)\ \{}
\DoxyCodeLine{\ \ \ \ \ std::cout\ <<\ \textcolor{stringliteral}{"{}Species:\ "{}}\ <<\ sp\ <<\ \textcolor{stringliteral}{"{},\ Molar\ Abundance:\ "{}}\ <<\ y\ <<\ std::endl;}
\DoxyCodeLine{\}}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
Because we store molar abundances as a sorted map, keyed by species. And Because the \texorpdfstring{$<$}{<} and \texorpdfstring{$>$}{>} operators for species are defined based on their atomic mass. When iterating over the molar abundance map, species will be seen in order from lightest to heaviest. 
\end{DoxyNote}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a643f2e1f843d8a6f81c9382278916fe5}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8h_source_l00787}{787}} of file \mbox{\hyperlink{composition_8h_source}{composition.\+h}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a5a1f5661a329ec7bc8b7e118ff9d6c25}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!clone@{clone}}
\index{clone@{clone}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{clone()}{clone()}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a5a1f5661a329ec7bc8b7e118ff9d6c25} 
std\+::unique\+\_\+ptr$<$ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract}{Composition\+Abstract}} $>$ fourdst\+::composition\+::\+Composition\+::clone (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}}



Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a81d5a4da267e24662ae90c6a29f3d0a1}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00226}{226}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a194f715788e7921bd611579440de2ecd}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!contains@{contains}}
\index{contains@{contains}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{contains()}{contains()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a194f715788e7921bd611579440de2ecd} 
bool fourdst\+::composition\+::\+Composition\+::contains (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} \&}]{species}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}, {\ttfamily [noexcept]}}



Checks if a given species is present in the composition. 


\begin{DoxyParams}{Parameters}
{\em species} & The isotope to check for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
True if the species is in the composition, false otherwise. 
\end{DoxyReturn}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a2e6c4d27d2b295b6be87c6964cac1e1e}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00693}{693}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_ac3bfb56a2587215a59894e76d4867ede}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!contains@{contains}}
\index{contains@{contains}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{contains()}{contains()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_ac3bfb56a2587215a59894e76d4867ede} 
bool fourdst\+::composition\+::\+Composition\+::contains (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{symbol}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}}



Checks if a given symbol is present in the composition. 


\begin{DoxyParams}{Parameters}
{\em symbol} & The symbol to check for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
True if the symbol is in the composition, false otherwise. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unknown_symbol_error}{exceptions\+::\+Unknown\+Symbol\+Error}} & if the symbol is not in the atomic species database. \\
\hline
\end{DoxyExceptions}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a6fe83824aefb045d8a5399e8ac9852f9}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00699}{699}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_aabcde53961ecadfa823de5a766f0da84}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!end@{end}}
\index{end@{end}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{end()}{end()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_aabcde53961ecadfa823de5a766f0da84} 
\mbox{\hyperlink{classfourdst_1_1composition_1_1detail_1_1_composition_iterator}{detail\+::\+Composition\+Iterator}}$<$ true $>$ fourdst\+::composition\+::\+Composition\+::end (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}}



Returns a const iterator to the end of the molar abundance map. 

\begin{DoxyReturn}{Returns}
A const iterator to the end.
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp(\{\textcolor{stringliteral}{"{}H-\/1"{}},\ \textcolor{stringliteral}{"{}He-\/4"{}},\ \textcolor{stringliteral}{"{}C-\/12"{}}\},\ \{1.02,\ 0.56,\ 0.02\});}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ [sp,\ y]\ :\ comp)\ \{}
\DoxyCodeLine{\ \ \ \ \ std::cout\ <<\ \textcolor{stringliteral}{"{}Species:\ "{}}\ <<\ sp\ <<\ \textcolor{stringliteral}{"{},\ Molar\ Abundance:\ "{}}\ <<\ y\ <<\ std::endl;}
\DoxyCodeLine{\}}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
Because we store molar abundances as a sorted map, keyed by species. And Because the \texorpdfstring{$<$}{<} and \texorpdfstring{$>$}{>} operators for species are defined based on their atomic mass. When iterating over the molar abundance map, species will be seen in order from lightest to heaviest. 
\end{DoxyNote}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a9ac49da6e4df7bee8aa7974e8fec8181}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8h_source_l00850}{850}} of file \mbox{\hyperlink{composition_8h_source}{composition.\+h}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_aaa89050308dda5e51d4b47d18d54cb58}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!end@{end}}
\index{end@{end}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{end()}{end()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_aaa89050308dda5e51d4b47d18d54cb58} 
\mbox{\hyperlink{classfourdst_1_1composition_1_1detail_1_1_composition_iterator}{detail\+::\+Composition\+Iterator}}$<$ false $>$ fourdst\+::composition\+::\+Composition\+::end (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}}



Returns an iterator to the end of the molar abundance map. 

\begin{DoxyReturn}{Returns}
An iterator to the end.
\end{DoxyReturn}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp(\{\textcolor{stringliteral}{"{}H-\/1"{}},\ \textcolor{stringliteral}{"{}He-\/4"{}},\ \textcolor{stringliteral}{"{}C-\/12"{}}\},\ \{1.02,\ 0.56,\ 0.02\});}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ [sp,\ y]\ :\ comp)\ \{}
\DoxyCodeLine{\ \ \ \ \ std::cout\ <<\ \textcolor{stringliteral}{"{}Species:\ "{}}\ <<\ sp\ <<\ \textcolor{stringliteral}{"{},\ Molar\ Abundance:\ "{}}\ <<\ y\ <<\ std::endl;}
\DoxyCodeLine{\}}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
Because we store molar abundances as a sorted map, keyed by species. And Because the \texorpdfstring{$<$}{<} and \texorpdfstring{$>$}{>} operators for species are defined based on their atomic mass. When iterating over the molar abundance map, species will be seen in order from lightest to heaviest. 
\end{DoxyNote}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a9f903ec8d0444c7ed9178c09de902176}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8h_source_l00829}{829}} of file \mbox{\hyperlink{composition_8h_source}{composition.\+h}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_aded88f0ad4a97eaae1e356fa8428cab5}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!findSpeciesIndex@{findSpeciesIndex}}
\index{findSpeciesIndex@{findSpeciesIndex}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{findSpeciesIndex()}{findSpeciesIndex()}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_aded88f0ad4a97eaae1e356fa8428cab5} 
std\+::expected$<$ std\+::ptrdiff\+\_\+t, \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aeef903d5b7d02467c6462d183ac47db8}{Composition\+::\+Species\+Index\+Lookup\+Error}} $>$ fourdst\+::composition\+::\+Composition\+::find\+Species\+Index (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} \&}]{species}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [private]}, {\ttfamily [noexcept]}}



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00713}{713}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_aac5b214a3d1278e127422224cb9cee50}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getCanonicalComposition@{getCanonicalComposition}}
\index{getCanonicalComposition@{getCanonicalComposition}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getCanonicalComposition()}{getCanonicalComposition()}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_aac5b214a3d1278e127422224cb9cee50} 
\mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition}{Canonical\+Composition}} fourdst\+::composition\+::\+Composition\+::get\+Canonical\+Composition (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}}



Compute the canonical composition (X, Y, Z) of the composition. 

The canonical composition is defined as\+:
\begin{DoxyItemize}
\item X\+: mass fraction of hydrogen ( $\sum_{i=1}^{7}X_{^{i}H}$)
\item Y\+: mass fraction of helium ( $\sum_{i=3}^{10}X_{^{i}He}$)
\item Z\+: mass fraction of all other elements (Everything else)
\end{DoxyItemize}

The canonical composition is computed by summing the mass fractions of all registered species in the composition according to their element type.

\begin{DoxyReturn}{Returns}
A \doxylink{structfourdst_1_1composition_1_1_canonical_composition}{Canonical\+Composition} struct containing the X, Y, and Z values.
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions\+::\+Invalid\+Composition\+Error}} & if, after constructing the canonical composition, the sum X + Y + Z is not approximately equal to 1.\+0 (within a tolerance of 1e-\/16) \\
\hline
\end{DoxyExceptions}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00552}{552}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a90fc71d1fe03017ee4c7a1cac69d24fb}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getElectronAbundance@{getElectronAbundance}}
\index{getElectronAbundance@{getElectronAbundance}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getElectronAbundance()}{getElectronAbundance()}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a90fc71d1fe03017ee4c7a1cac69d24fb} 
double fourdst\+::composition\+::\+Composition\+::get\+Electron\+Abundance (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}, {\ttfamily [noexcept]}}



Compute the electron abundance of the composition. 

The electron abundance is calculated using the formula\+:   \[Y_e = \sum_i (Y_i \cdot Z_i)
\] where\+:
\begin{DoxyItemize}
\item $Y_i$ is the molar abundance of species i.
\item $Z_i$ is the atomic number (number of protons) of species i.
\end{DoxyItemize}

\begin{DoxyReturn}{Returns}
Ye (electron abundance). 
\end{DoxyReturn}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_ad0fcf2e51cca02c4224241828335db1a}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00543}{543}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getLogger@{getLogger}}
\index{getLogger@{getLogger}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getLogger()}{getLogger()}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e} 
static quill\+::\+Logger \texorpdfstring{$\ast$}{*} fourdst\+::composition\+::\+Composition\+::get\+Logger (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}, {\ttfamily [private]}}



Gets the logger instance for the \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} class. This is static to ensure that all composition objects share the same logger instance. 

\begin{DoxyReturn}{Returns}
pointer to the logger instance. 
\end{DoxyReturn}


Definition at line \mbox{\hyperlink{composition_8h_source_l00156}{156}} of file \mbox{\hyperlink{composition_8h_source}{composition.\+h}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a9ea2b673341fdc67afeb0f0517a54c8c}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getMassFraction@{getMassFraction}}
\index{getMassFraction@{getMassFraction}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getMassFraction()}{getMassFraction()}\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a9ea2b673341fdc67afeb0f0517a54c8c} 
std\+::unordered\+\_\+map$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}}, double $>$ fourdst\+::composition\+::\+Composition\+::get\+Mass\+Fraction (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}, {\ttfamily [noexcept]}}



Gets the mass fractions of all species in the composition. 

\begin{DoxyReturn}{Returns}
An unordered map of symbols to their mass fractions.
\end{DoxyReturn}
\begin{DoxyNote}{Note}
This method will construct a new unordered map each time it is called. 
\end{DoxyNote}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a3e3248162611754ca4c54b9979f6664d}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00460}{460}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_ae8fe4e7158f8317bf29b5cd0c65a9524}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getMassFraction@{getMassFraction}}
\index{getMassFraction@{getMassFraction}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getMassFraction()}{getMassFraction()}\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_ae8fe4e7158f8317bf29b5cd0c65a9524} 
double fourdst\+::composition\+::\+Composition\+::get\+Mass\+Fraction (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} \&}]{species}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}}



Gets the mass fraction for a given species. 

The mass fraction X\+\_\+i for a species is calculated using the formula\+:   \[X_i = \frac{(Y_i \cdot A_i)}{\sum_j (Y_j \cdot A_j)}
\] where\+:
\begin{DoxyItemize}
\item $Y_i$ is the molar abundance of species i.
\item $A_i$ is the atomic mass of species i.
\item The denominator sums over all species j in the composition.
\end{DoxyItemize}

This formula ensures that the mass fractions of all species sum to 1.\+0.


\begin{DoxyParams}{Parameters}
{\em species} & The species to get the mass fraction for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The mass fraction for the given isotope. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions\+::\+Unregistered\+Symbol\+Error}} & if the isotope is not registered in the composition. \\
\hline
\end{DoxyExceptions}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a0396f17ba252d053c0126323a76e9142}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00440}{440}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_ae5d8d21632fca2b35b0898f2b205cd10}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getMassFraction@{getMassFraction}}
\index{getMassFraction@{getMassFraction}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getMassFraction()}{getMassFraction()}\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_ae5d8d21632fca2b35b0898f2b205cd10} 
double fourdst\+::composition\+::\+Composition\+::get\+Mass\+Fraction (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{symbol}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}}



Gets the mass fraction for a given symbol. See the overload for species-\/based lookup for more details on how mass fractions are calculated. 


\begin{DoxyParams}{Parameters}
{\em symbol} & The symbol to get the mass fraction for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The mass fraction for the given symbol. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unknown_symbol_error}{exceptions\+::\+Unknown\+Symbol\+Error}} & if the symbol is not in the atomic species database. \\
\hline
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions\+::\+Unregistered\+Symbol\+Error}} & if the symbol is not in the composition. \\
\hline
\end{DoxyExceptions}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a0ebe22344f785e5db693e04b9b598a5a}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00432}{432}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_af4f44aaf8b7e0d63872a70b5e2131369}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getMassFractionVector@{getMassFractionVector}}
\index{getMassFractionVector@{getMassFractionVector}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getMassFractionVector()}{getMassFractionVector()}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_af4f44aaf8b7e0d63872a70b5e2131369} 
std\+::vector$<$ double $>$ fourdst\+::composition\+::\+Composition\+::get\+Mass\+Fraction\+Vector (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}, {\ttfamily [noexcept]}}



Get a uniform vector representation of the mass fraction stored in the composition object sorted such that the lightest species is at index 0 and the heaviest is at the last index. 

This is primarily useful for external libraries which need to ensure that vector representation uniformity is maintained \begin{DoxyReturn}{Returns}
the vector of mass fractions sorted by species mass (lightest to heaviest). 
\end{DoxyReturn}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a752af872347c612bf3b43b1711c2cfc0}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00596}{596}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_afbbb5e51ad5ae5c0fa6bc0094195aecd}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getMeanParticleMass@{getMeanParticleMass}}
\index{getMeanParticleMass@{getMeanParticleMass}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getMeanParticleMass()}{getMeanParticleMass()}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_afbbb5e51ad5ae5c0fa6bc0094195aecd} 
double fourdst\+::composition\+::\+Composition\+::get\+Mean\+Particle\+Mass (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}, {\ttfamily [noexcept]}}



Compute the mean particle mass of the composition. 

The mean particle mass is calculated using the formula\+:   \[\bar{A} = \frac{\sum_i (Y_i \cdot A_i)}{\sum_j Y_j}
\] where\+:
\begin{DoxyItemize}
\item $Y_i$ is the molar abundance of species i.
\item $A_i$ is the atomic mass of species i.
\item The sums run over all species i in the composition.
\end{DoxyItemize}

\begin{DoxyReturn}{Returns}
Mean particle mass in atomic mass units (g/mol). 
\end{DoxyReturn}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_afedcef16ed403b95ce7f1e6756aa46e8}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00530}{530}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a78a43e9e77a9c1b0f27c50b9feb52449}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getMolarAbundance@{getMolarAbundance}}
\index{getMolarAbundance@{getMolarAbundance}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getMolarAbundance()}{getMolarAbundance()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a78a43e9e77a9c1b0f27c50b9feb52449} 
double fourdst\+::composition\+::\+Composition\+::get\+Molar\+Abundance (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} \&}]{species}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}}



Gets the molar abundance for a given species. 


\begin{DoxyParams}{Parameters}
{\em species} & The species to get the molar abundance for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The molar abundance for the given isotope. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions\+::\+Unregistered\+Symbol\+Error}} & if the isotope is not registered in the composition.\\
\hline
\end{DoxyExceptions}
\begin{DoxyNote}{Note}
These are the most performant quantities to retrieve since they are stored directly in the composition object and require no computation. 
\end{DoxyNote}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_adf861bd58e80025b021af2949b41d126}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00515}{515}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_add67a92d73e3a57a2bbdb52bc9ca3bfe}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getMolarAbundance@{getMolarAbundance}}
\index{getMolarAbundance@{getMolarAbundance}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getMolarAbundance()}{getMolarAbundance()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_add67a92d73e3a57a2bbdb52bc9ca3bfe} 
double fourdst\+::composition\+::\+Composition\+::get\+Molar\+Abundance (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{symbol}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}}



Gets the molar abundances of all species in the composition. 


\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unknown_symbol_error}{exceptions\+::\+Unknown\+Symbol\+Error}} & if any symbol is not in the atomic species database. \\
\hline
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions\+::\+Unregistered\+Symbol\+Error}} & if any symbol is not in the composition. \\
\hline
\end{DoxyExceptions}
\begin{DoxyReturn}{Returns}
The molar abundance of the symbol.
\end{DoxyReturn}
\begin{DoxyNote}{Note}
These are the most performant quantities to retrieve since they are stored directly in the composition object and require no computation. This overload is slightly less performant than the species-\/based overload since it needs to validate the symbol exists in the atomic species database. 
\end{DoxyNote}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a29613d8197cee96f764aeeaa3b7286f8}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00504}{504}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_abcb391f5fca2b636127e48e681e4c3ee}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getMolarAbundanceVector@{getMolarAbundanceVector}}
\index{getMolarAbundanceVector@{getMolarAbundanceVector}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getMolarAbundanceVector()}{getMolarAbundanceVector()}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_abcb391f5fca2b636127e48e681e4c3ee} 
std\+::vector$<$ double $>$ fourdst\+::composition\+::\+Composition\+::get\+Molar\+Abundance\+Vector (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}, {\ttfamily [noexcept]}}



Get a uniform vector representation of the molar abundances stored in the composition object sorted such that the lightest species is at index 0 and the heaviest is at the last index. 

This is primarily useful for external libraries which need to ensure that vector representation uniformity is maintained \begin{DoxyReturn}{Returns}
the vector of molar abundances sorted by species mass (lightest to heaviest). 
\end{DoxyReturn}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a657c12d36b2f44e44c32e86d5296c063}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00631}{631}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a1f87ed64a1be9a6091c852131d24e476}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getNumberFraction@{getNumberFraction}}
\index{getNumberFraction@{getNumberFraction}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getNumberFraction()}{getNumberFraction()}\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a1f87ed64a1be9a6091c852131d24e476} 
std\+::unordered\+\_\+map$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}}, double $>$ fourdst\+::composition\+::\+Composition\+::get\+Number\+Fraction (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}, {\ttfamily [noexcept]}}



Gets the number fractions of all species in the composition. 

\begin{DoxyReturn}{Returns}
An unordered map of symbols to their number fractions.
\end{DoxyReturn}
\begin{DoxyNote}{Note}
This method will construct a new unordered map each time it is called. 
\end{DoxyNote}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a65bae043ffbf4514b2593ccb63c6e265}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00496}{496}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a1aa79993925f16ba3c30a376aa39161b}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getNumberFraction@{getNumberFraction}}
\index{getNumberFraction@{getNumberFraction}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getNumberFraction()}{getNumberFraction()}\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a1aa79993925f16ba3c30a376aa39161b} 
double fourdst\+::composition\+::\+Composition\+::get\+Number\+Fraction (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} \&}]{species}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}}



Gets the number fraction for a given species. 

The number fraction Y\+\_\+i for a species is calculated using the formula\+:   \[X_i = \frac{Y_i}{\sum_j Y_j}
\] where\+:
\begin{DoxyItemize}
\item $Y_i$ is the molar abundance of species i.
\item The denominator sums over all species j in the composition.
\end{DoxyItemize}

This formula ensures that the number fractions of all species sum to 1.\+0.


\begin{DoxyParams}{Parameters}
{\em species} & The species to get the number fraction for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The number fraction for the given isotope. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions\+::\+Unregistered\+Symbol\+Error}} & if the isotope is not registered in the composition. \\
\hline
\end{DoxyExceptions}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a71b351d6e69cf0d7e7c43409e1b13c4c}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00479}{479}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a34f71d4d8f0297c576fd62fabd490305}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getNumberFraction@{getNumberFraction}}
\index{getNumberFraction@{getNumberFraction}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getNumberFraction()}{getNumberFraction()}\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a34f71d4d8f0297c576fd62fabd490305} 
double fourdst\+::composition\+::\+Composition\+::get\+Number\+Fraction (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{symbol}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}}



Gets the number fraction for a given symbol. See the overload for species-\/based lookup for more details on how number fractions are calculated. 


\begin{DoxyParams}{Parameters}
{\em symbol} & The symbol to get the number fraction for. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The number fraction for the given symbol. 
\end{DoxyReturn}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unknown_symbol_error}{exceptions\+::\+Unknown\+Symbol\+Error}} & if the symbol is not in the atomic species database. \\
\hline
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions\+::\+Unregistered\+Symbol\+Error}} & if the symbol is not in the composition. \\
\hline
\end{DoxyExceptions}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_af490daa6942717605093b4fca3e676b8}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00469}{469}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_ae4f72972cf4d1ff422d0790080e11473}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getNumberFractionVector@{getNumberFractionVector}}
\index{getNumberFractionVector@{getNumberFractionVector}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getNumberFractionVector()}{getNumberFractionVector()}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_ae4f72972cf4d1ff422d0790080e11473} 
std\+::vector$<$ double $>$ fourdst\+::composition\+::\+Composition\+::get\+Number\+Fraction\+Vector (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}, {\ttfamily [noexcept]}}



Get a uniform vector representation of the number fractions stored in the composition object sorted such that the lightest species is at index 0 and the heaviest is at the last index. 

This is primarily useful for external libraries which need to ensure that vector representation uniformity is maintained \begin{DoxyReturn}{Returns}
the vector of number fractions sorted by species mass (lightest to heaviest). 
\end{DoxyReturn}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a83343286d738d101635b2a7f5b7d96ef}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00614}{614}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_af4b01ec4140e278d92c18f139f69ab1f}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getRegisteredSpecies@{getRegisteredSpecies}}
\index{getRegisteredSpecies@{getRegisteredSpecies}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getRegisteredSpecies()}{getRegisteredSpecies()}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_af4b01ec4140e278d92c18f139f69ab1f} 
const std\+::vector$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \& fourdst\+::composition\+::\+Composition\+::get\+Registered\+Species (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}, {\ttfamily [noexcept]}}



Get a set of all species that are registered in the composition. 

\begin{DoxyReturn}{Returns}
A set of {\ttfamily \doxylink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} objects registered in the composition.
\end{DoxyReturn}
\begin{DoxyNote}{Note}
This will return a constant reference to the internal m\+\_\+registered\+Species set, therefore the return value of this method will only be valid as long as the \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} object is valid (i.\+e. it cannot outlive the \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} object it was called on). 
\end{DoxyNote}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_ad17ae8649860ef4f7a949e7c9143c0ec}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00312}{312}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a3ae885c28580ae15be8c16614bef3b0e}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getRegisteredSymbols@{getRegisteredSymbols}}
\index{getRegisteredSymbols@{getRegisteredSymbols}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getRegisteredSymbols()}{getRegisteredSymbols()}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a3ae885c28580ae15be8c16614bef3b0e} 
std\+::set$<$ std\+::string $>$ fourdst\+::composition\+::\+Composition\+::get\+Registered\+Symbols (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}, {\ttfamily [noexcept]}}



Gets the registered symbols. 

\begin{DoxyReturn}{Returns}
A set of registered symbols.
\end{DoxyReturn}
\begin{DoxyNote}{Note}
This method will construct a new set each time it is called. If you need just need access to the registered species, consider using {\ttfamily \doxylink{classfourdst_1_1composition_1_1_composition_af4b01ec4140e278d92c18f139f69ab1f}{get\+Registered\+Species()}} instead which returns a constant reference to the internal set. 
\end{DoxyNote}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a94c2cadeae32ab19cee42fc1670c4c6c}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00304}{304}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_ae4f854ded38f5e6fcd157a74a57cbf0c}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getSpeciesAtIndex@{getSpeciesAtIndex}}
\index{getSpeciesAtIndex@{getSpeciesAtIndex}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getSpeciesAtIndex()}{getSpeciesAtIndex()}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_ae4f854ded38f5e6fcd157a74a57cbf0c} 
\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} fourdst\+::composition\+::\+Composition\+::get\+Species\+At\+Index (\begin{DoxyParamCaption}\item[{size\+\_\+t}]{index}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}}



Get the species at a given index in the sorted vector representation. 

This is primarily useful for external libraries which need to ensure that vector representation uniformity is maintained 
\begin{DoxyParams}{Parameters}
{\em index} & The index in the sorted vector representation for which to return the species. Must be in \mbox{[}0, N-\/1\mbox{]} where N is the number of registered species. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em std\+::out\+\_\+of\+\_\+range} & if the index is out of range. \\
\hline
\end{DoxyExceptions}
\begin{DoxyReturn}{Returns}
The species at the given index in the sorted vector representation. 
\end{DoxyReturn}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a43138cbf3d399e8f278db742fe1b02a7}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00668}{668}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a3d220b42fa06d7d3a43944ee2b8f6a5f}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getSpeciesIndex@{getSpeciesIndex}}
\index{getSpeciesIndex@{getSpeciesIndex}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getSpeciesIndex()}{getSpeciesIndex()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a3d220b42fa06d7d3a43944ee2b8f6a5f} 
size\+\_\+t fourdst\+::composition\+::\+Composition\+::get\+Species\+Index (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} \&}]{species}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}}



get the index in the sorted vector representation for a given symbol 

This is primarily useful for external libraries which need to ensure that vector representation uniformity is maintained 
\begin{DoxyParams}{Parameters}
{\em species} & the species to look up the index for. Note that this is the index species data will be at if you were to call \doxylink{classfourdst_1_1composition_1_1_composition_abcb391f5fca2b636127e48e681e4c3ee}{get\+Molar\+Abundance\+Vector()}, \doxylink{classfourdst_1_1composition_1_1_composition_af4f44aaf8b7e0d63872a70b5e2131369}{get\+Mass\+Fraction\+Vector()}, or \doxylink{classfourdst_1_1composition_1_1_composition_ae4f72972cf4d1ff422d0790080e11473}{get\+Number\+Fraction\+Vector()} \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions\+::\+Unregistered\+Symbol\+Error}} & if the symbol is not registered in the composition \\
\hline
\end{DoxyExceptions}
\begin{DoxyReturn}{Returns}
The index of the symbol in the sorted vector representation. 
\end{DoxyReturn}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a5d04b801f152f7955b392710275105bc}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00650}{650}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a0d94f62402bb90b5d12679faeaa8c5d7}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!getSpeciesIndex@{getSpeciesIndex}}
\index{getSpeciesIndex@{getSpeciesIndex}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{getSpeciesIndex()}{getSpeciesIndex()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a0d94f62402bb90b5d12679faeaa8c5d7} 
size\+\_\+t fourdst\+::composition\+::\+Composition\+::get\+Species\+Index (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{symbol}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}}



get the index in the sorted vector representation for a given symbol 

This is primarily useful for external libraries which need to ensure that vector representation uniformity is maintained 
\begin{DoxyParams}{Parameters}
{\em symbol} & the symbol to look up the index for. Note that this is the index species data will be at if you were to call \doxylink{classfourdst_1_1composition_1_1_composition_abcb391f5fca2b636127e48e681e4c3ee}{get\+Molar\+Abundance\+Vector()}, \doxylink{classfourdst_1_1composition_1_1_composition_af4f44aaf8b7e0d63872a70b5e2131369}{get\+Mass\+Fraction\+Vector()}, or \doxylink{classfourdst_1_1composition_1_1_composition_ae4f72972cf4d1ff422d0790080e11473}{get\+Number\+Fraction\+Vector()} \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unknown_symbol_error}{exceptions\+::\+Unknown\+Symbol\+Error}} & if the symbol is not in the atomic species database. \\
\hline
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions\+::\+Unregistered\+Symbol\+Error}} & if the symbol is not registered in the composition \\
\hline
\end{DoxyExceptions}
\begin{DoxyReturn}{Returns}
The index of the symbol in the sorted vector representation. 
\end{DoxyReturn}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_aebf28eab9c902a285589fe2ab7f3060f}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00639}{639}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a5b3631fa33b0c6809ad652b0e31663a1}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!hash@{hash}}
\index{hash@{hash}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{hash()}{hash()}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a5b3631fa33b0c6809ad652b0e31663a1} 
std\+::size\+\_\+t fourdst\+::composition\+::\+Composition\+::hash (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}}



Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a2d5472a63e2dbfc94d7e4617b5660e23}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00684}{684}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a4ec1e23cfecef764cb831171fed62fc2}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!operator=@{operator=}}
\index{operator=@{operator=}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{operator=()}{operator=()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a4ec1e23cfecef764cb831171fed62fc2} 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition}{Composition}} \& fourdst\+::composition\+::\+Composition\+::operator= (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition}{Composition}} const \&}]{other}{}\end{DoxyParamCaption})}



Assignment operator. 


\begin{DoxyParams}{Parameters}
{\em other} & The \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} to assign from. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A reference to this \doxylink{classfourdst_1_1composition_1_1_composition}{Composition}. 
\end{DoxyReturn}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00204}{204}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_afba49b5ceeb42e0372b6118f48b4ee54}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!operator=@{operator=}}
\index{operator=@{operator=}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{operator=()}{operator=()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_afba49b5ceeb42e0372b6118f48b4ee54} 
\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition}{Composition}} \& fourdst\+::composition\+::\+Composition\+::operator= (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract}{Composition\+Abstract}} \&}]{other}{}\end{DoxyParamCaption})}



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00215}{215}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a392a34c19f45d6c936cc7030e6cfaf3f}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!registerSpecies@{registerSpecies}}
\index{registerSpecies@{registerSpecies}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{registerSpecies()}{registerSpecies()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a392a34c19f45d6c936cc7030e6cfaf3f} 
void fourdst\+::composition\+::\+Composition\+::register\+Species (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} \&}]{species}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [noexcept]}}



Registers a new species by extracting its symbol. 


\begin{DoxyParams}{Parameters}
{\em species} & The species to register. \\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ "{}fourdst/composition/species.h"{}}}
\DoxyCodeLine{}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp;}
\DoxyCodeLine{comp.registerSpecies(\mbox{\hyperlink{namespacefourdst_1_1atomic_a21ab5363d81d491f5230e8d90a149f31}{fourdst::atomic::C\_12}});}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
Because species are strongly typed, this method does not need to check if the species is valid. that is to say that the compiler will only allow valid species to be passed in. Therefore, this method is marked noexcept and may therefore be slightly more performant than the symbol-\/based method.

upon registering a species, its molar abundance is initialized to 0.\+0.

All species are in the {\ttfamily \doxylink{species_8h}{fourdst/atomic/species.\+h}} header file. These can be accessed directly through their fully qualified names (e.\+g., {\ttfamily \doxylink{namespacefourdst_1_1atomic_a21ab5363d81d491f5230e8d90a149f31}{fourdst\+::atomic\+::\+C\+\_\+12}} for Carbon-\/12). Alternatively, these can also be accessed through a string-\/indexed map located in {\ttfamily \doxylink{species_8h}{fourdst/atomic/species.\+h}} called {\ttfamily \doxylink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{fourdst\+::atomic\+::species}} ( e.\+g., {\ttfamily fourdst\+::atomic\+::species.\+at("{}\+C-\/12"{})} for Carbon-\/12). 
\end{DoxyNote}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00251}{251}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a2846f4ea0d6075ecdaf4334741a54750}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!registerSpecies@{registerSpecies}}
\index{registerSpecies@{registerSpecies}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{registerSpecies()}{registerSpecies()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a2846f4ea0d6075ecdaf4334741a54750} 
void fourdst\+::composition\+::\+Composition\+::register\+Species (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \&}]{species}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [noexcept]}}



Registers a vector of new species. 


\begin{DoxyParams}{Parameters}
{\em species} & The vector of species to register. \\
\hline
\end{DoxyParams}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ "{}fourdst/composition/species.h"{}}}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp;}
\DoxyCodeLine{std::vector<fourdst::atomic::Species>\ my\_species\ =\ \{\ ...\ \};}
\DoxyCodeLine{comp.registerSpecies(my\_species);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
upon registering a species, its molar abundance is initialized to 0.\+0. Therefore, registering a vector of species will initialize all their molar abundances to 0.\+0.

All species are in the {\ttfamily \doxylink{species_8h}{fourdst/atomic/species.\+h}} header file. These can be accessed directly through their fully qualified names (e.\+g., {\ttfamily \doxylink{namespacefourdst_1_1atomic_a21ab5363d81d491f5230e8d90a149f31}{fourdst\+::atomic\+::\+C\+\_\+12}} for Carbon-\/12). Alternatively, these can also be accessed through a string-\/indexed map located in {\ttfamily \doxylink{species_8h}{fourdst/atomic/species.\+h}} called {\ttfamily \doxylink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{fourdst\+::atomic\+::species}} ( e.\+g., {\ttfamily fourdst\+::atomic\+::species.\+at("{}\+C-\/12"{})} for Carbon-\/12). 
\end{DoxyNote}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00262}{262}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a3ab4dcda0bfd1a35b169bcc57fe66725}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!registerSymbol@{registerSymbol}}
\index{registerSymbol@{registerSymbol}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{registerSymbol()}{registerSymbol()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a3ab4dcda0bfd1a35b169bcc57fe66725} 
void fourdst\+::composition\+::\+Composition\+::register\+Symbol (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{symbol}{}\end{DoxyParamCaption})}



Registers a new symbol for inclusion in the composition. 

A symbol must be registered before its abundance can be set. 
\begin{DoxyParams}{Parameters}
{\em symbol} & The symbol to register (e.\+g., "{}\+Fe-\/56"{}). \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unknown_symbol_error}{exceptions\+::\+Unknown\+Symbol\+Error}} & if the symbol is not in the atomic species database. \\
\hline
\end{DoxyExceptions}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp;}
\DoxyCodeLine{comp.registerSymbol(\textcolor{stringliteral}{"{}H-\/1"{}});}
\DoxyCodeLine{comp.registerSymbol(\textcolor{stringliteral}{"{}He-\/4"{}});}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
upon registering a symbol, its molar abundance is initialized to 0.\+0. 
\end{DoxyNote}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00234}{234}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a156d1198ef47deed9689949f271969e2}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!registerSymbol@{registerSymbol}}
\index{registerSymbol@{registerSymbol}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{registerSymbol()}{registerSymbol()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a156d1198ef47deed9689949f271969e2} 
void fourdst\+::composition\+::\+Composition\+::register\+Symbol (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ std\+::string $>$ \&}]{symbols}{}\end{DoxyParamCaption})}



Registers multiple new symbols. 


\begin{DoxyParams}{Parameters}
{\em symbols} & The symbols to register. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unknown_symbol_error}{exceptions\+::\+Unknown\+Symbol\+Error}} & if any symbol is invalid. \\
\hline
\end{DoxyExceptions}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{std::vector<std::string>\ symbols\ =\ \{\textcolor{stringliteral}{"{}H-\/1"{}},\ \textcolor{stringliteral}{"{}O-\/16"{}}\};}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp;}
\DoxyCodeLine{comp.registerSymbol(symbols);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
upon registering a symbol, its molar abundance is initialized to 0.\+0. Therefore, registering a vector of symbols will initialize all their molar abundances to 0.\+0. 
\end{DoxyNote}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00245}{245}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_ac386709ef1e872fa558b8e30fc8b4c44}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!setMolarAbundance@{setMolarAbundance}}
\index{setMolarAbundance@{setMolarAbundance}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{setMolarAbundance()}{setMolarAbundance()}\hspace{0.1cm}{\footnotesize\ttfamily [1/6]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_ac386709ef1e872fa558b8e30fc8b4c44} 
void fourdst\+::composition\+::\+Composition\+::set\+Molar\+Abundance (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} \&}]{species}{, }\item[{const double \&}]{molar\+\_\+abundance}{}\end{DoxyParamCaption})}



Sets the molar abundance for a given isotope. 


\begin{DoxyParams}{Parameters}
{\em species} & The isotope to set the molar abundance for. \\
\hline
{\em molar\+\_\+abundance} & The molar abundance to set.\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions\+::\+Unregistered\+Symbol\+Error}} & if the isotope is not registered in the composition. \\
\hline
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions\+::\+Invalid\+Composition\+Error}} & if the molar abundance is negative.\\
\hline
\end{DoxyExceptions}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ "{}fourdst/composition/species.h"{}}}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp(\{\mbox{\hyperlink{namespacefourdst_1_1atomic_a6766bc834fd656df51bdcf22f7d97877}{fourdst::atomic::H\_1}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_ab665e3014e2a805624227350699f141a}{fourdst::atomic::He\_4}}\});}
\DoxyCodeLine{comp.setMolarAbundance(\mbox{\hyperlink{namespacefourdst_1_1atomic_a6766bc834fd656df51bdcf22f7d97877}{fourdst::atomic::H\_1}},\ 1.0);}
\DoxyCodeLine{comp.setMolarAbundance(\mbox{\hyperlink{namespacefourdst_1_1atomic_ab665e3014e2a805624227350699f141a}{fourdst::atomic::He\_4}},\ 0.5);}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
Since this method does not need to validate the species exists in the database, it will generally be slightly more performant than the symbol-\/based method. 
\end{DoxyNote}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00333}{333}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_ad7af2f8f3050969a6c5b9a9ef5fead64}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!setMolarAbundance@{setMolarAbundance}}
\index{setMolarAbundance@{setMolarAbundance}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{setMolarAbundance()}{setMolarAbundance()}\hspace{0.1cm}{\footnotesize\ttfamily [2/6]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_ad7af2f8f3050969a6c5b9a9ef5fead64} 
void fourdst\+::composition\+::\+Composition\+::set\+Molar\+Abundance (\begin{DoxyParamCaption}\item[{const std\+::set$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \&}]{species}{, }\item[{const std\+::vector$<$ double $>$ \&}]{molar\+\_\+abundances}{}\end{DoxyParamCaption})}



Sets the molar abundances for a set of isotopes. 


\begin{DoxyParams}{Parameters}
{\em species} & The isotopes to set the molar abundances for. \\
\hline
{\em molar\+\_\+abundances} & The molar abundances to set.\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions\+::\+Unregistered\+Symbol\+Error}} & if any isotope is not registered in the composition. \\
\hline
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions\+::\+Invalid\+Composition\+Error}} & if any molar abundance is negative.\\
\hline
\end{DoxyExceptions}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ "{}fourdst/composition/species.h"{}}}
\DoxyCodeLine{std::set<fourdst::atomic::Species>\ species\ =\ \{\mbox{\hyperlink{namespacefourdst_1_1atomic_a6766bc834fd656df51bdcf22f7d97877}{fourdst::atomic::H\_1}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_ab665e3014e2a805624227350699f141a}{fourdst::atomic::He\_4}}\};}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp(species);}
\DoxyCodeLine{comp.setMolarAbundance(species,\ \{1.0,\ 0.5\});}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
Since this method does not need to validate the species exists in the database, it will generally be slightly more performant than the symbol-\/based method. 
\end{DoxyNote}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00373}{373}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a49b06737a50df9c25a234499a1431388}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!setMolarAbundance@{setMolarAbundance}}
\index{setMolarAbundance@{setMolarAbundance}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{setMolarAbundance()}{setMolarAbundance()}\hspace{0.1cm}{\footnotesize\ttfamily [3/6]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a49b06737a50df9c25a234499a1431388} 
void fourdst\+::composition\+::\+Composition\+::set\+Molar\+Abundance (\begin{DoxyParamCaption}\item[{const std\+::set$<$ std\+::string $>$ \&}]{symbols}{, }\item[{const std\+::vector$<$ double $>$ \&}]{molar\+\_\+abundances}{}\end{DoxyParamCaption})}



Sets the molar abundances for a set of symbols. 


\begin{DoxyParams}{Parameters}
{\em symbols} & The symbols to set the molar abundances for. \\
\hline
{\em molar\+\_\+abundances} & The molar abundances to set.\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unknown_symbol_error}{exceptions\+::\+Unknown\+Symbol\+Error}} & if any symbol is not in the atomic species database. \\
\hline
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions\+::\+Unregistered\+Symbol\+Error}} & if any symbol is not in the composition. \\
\hline
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions\+::\+Invalid\+Composition\+Error}} & if any molar abundance is negative.\\
\hline
\end{DoxyExceptions}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{std::set<std::string>\ symbols\ =\ \{\textcolor{stringliteral}{"{}H-\/1"{}},\ \textcolor{stringliteral}{"{}He-\/4"{}}\};}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp(symbols);}
\DoxyCodeLine{comp.setMolarAbundance(symbols,\ \{1.0,\ 0.5\});}

\end{DoxyCode}
 
\end{DoxyParagraph}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00366}{366}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a262d7133035d4e6f45daa81827abf5e7}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!setMolarAbundance@{setMolarAbundance}}
\index{setMolarAbundance@{setMolarAbundance}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{setMolarAbundance()}{setMolarAbundance()}\hspace{0.1cm}{\footnotesize\ttfamily [4/6]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a262d7133035d4e6f45daa81827abf5e7} 
void fourdst\+::composition\+::\+Composition\+::set\+Molar\+Abundance (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{symbol}{, }\item[{const double \&}]{molar\+\_\+abundance}{}\end{DoxyParamCaption})}



Sets the molar abundance for a given symbol. 


\begin{DoxyParams}{Parameters}
{\em symbol} & The symbol to set the molar abundance for. \\
\hline
{\em molar\+\_\+abundance} & The molar abundance to set.\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unknown_symbol_error}{exceptions\+::\+Unknown\+Symbol\+Error}} & if the symbol is not in the atomic species database. \\
\hline
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions\+::\+Unregistered\+Symbol\+Error}} & if the symbol is not in the composition. \\
\hline
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions\+::\+Invalid\+Composition\+Error}} & if the molar abundance is negative.\\
\hline
\end{DoxyExceptions}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp(\{\textcolor{stringliteral}{"{}H-\/1"{}},\ \textcolor{stringliteral}{"{}He-\/4"{}}\});}
\DoxyCodeLine{comp.setMolarAbundance(\textcolor{stringliteral}{"{}H-\/1"{}},\ 1.0);}
\DoxyCodeLine{comp.setMolarAbundance(\textcolor{stringliteral}{"{}He-\/4"{}},\ 0.5);}

\end{DoxyCode}
 
\end{DoxyParagraph}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00321}{321}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_ae908cda3a994292e2eb767fa476b666b}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!setMolarAbundance@{setMolarAbundance}}
\index{setMolarAbundance@{setMolarAbundance}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{setMolarAbundance()}{setMolarAbundance()}\hspace{0.1cm}{\footnotesize\ttfamily [5/6]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_ae908cda3a994292e2eb767fa476b666b} 
void fourdst\+::composition\+::\+Composition\+::set\+Molar\+Abundance (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \&}]{species}{, }\item[{const std\+::vector$<$ double $>$ \&}]{molar\+\_\+abundances}{}\end{DoxyParamCaption})}



Sets the molar abundances for a list of isotopes. 


\begin{DoxyParams}{Parameters}
{\em species} & The isotopes to set the molar abundances for. \\
\hline
{\em molar\+\_\+abundances} & The molar abundances to set.\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions\+::\+Unregistered\+Symbol\+Error}} & if any isotope is not registered in the composition. \\
\hline
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions\+::\+Invalid\+Composition\+Error}} & if any molar abundance is negative.\\
\hline
\end{DoxyExceptions}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ "{}fourdst/composition/species.h"{}}}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp(\{\mbox{\hyperlink{namespacefourdst_1_1atomic_a6766bc834fd656df51bdcf22f7d97877}{fourdst::atomic::H\_1}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_ab665e3014e2a805624227350699f141a}{fourdst::atomic::He\_4}}\});}
\DoxyCodeLine{comp.setMolarAbundance(\{\mbox{\hyperlink{namespacefourdst_1_1atomic_a6766bc834fd656df51bdcf22f7d97877}{fourdst::atomic::H\_1}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_ab665e3014e2a805624227350699f141a}{fourdst::atomic::He\_4}}\},\ \{1.0,\ 0.5\});}

\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
Since this method does not need to validate the species exists in the database, it will generally be slightly more performant than the symbol-\/based method. 
\end{DoxyNote}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00380}{380}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a6baa22b92a78fd43d10d4941f30c8ac2}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!setMolarAbundance@{setMolarAbundance}}
\index{setMolarAbundance@{setMolarAbundance}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{setMolarAbundance()}{setMolarAbundance()}\hspace{0.1cm}{\footnotesize\ttfamily [6/6]}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a6baa22b92a78fd43d10d4941f30c8ac2} 
void fourdst\+::composition\+::\+Composition\+::set\+Molar\+Abundance (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ std\+::string $>$ \&}]{symbols}{, }\item[{const std\+::vector$<$ double $>$ \&}]{molar\+\_\+abundances}{}\end{DoxyParamCaption})}



Sets the molar abundances for a list of symbols. 


\begin{DoxyParams}{Parameters}
{\em symbols} & The symbols to set the molar abundances for. \\
\hline
{\em molar\+\_\+abundances} & The molar abundances to set.\\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unknown_symbol_error}{exceptions\+::\+Unknown\+Symbol\+Error}} & if any symbol is not in the atomic species database. \\
\hline
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions\+::\+Unregistered\+Symbol\+Error}} & if any symbol is not in the composition. \\
\hline
{\em \doxylink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions\+::\+Invalid\+Composition\+Error}} & if any molar abundance is negative.\\
\hline
\end{DoxyExceptions}
\begin{DoxyParagraph}{Example\+:}

\begin{DoxyCode}{0}
\DoxyCodeLine{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ comp(\{\textcolor{stringliteral}{"{}H-\/1"{}},\ \textcolor{stringliteral}{"{}He-\/4"{}}\});}
\DoxyCodeLine{comp.setMolarAbundance(\{\textcolor{stringliteral}{"{}H-\/1"{}},\ \textcolor{stringliteral}{"{}He-\/4"{}}\},\ \{1.0,\ 0.5\});}

\end{DoxyCode}

\end{DoxyParagraph}
\DoxyHorRuler{0}
 Methods which set multiple molar abundances \hypertarget{classfourdst_1_1composition_1_1_composition_autotoc_md10}{}\doxysubsubsection{\texorpdfstring{delegate to vector$<$\+Species$>$, vector$<$double$>$}{delegate to vector$<$\+Species$>$, vector$<$double$>$}}\label{classfourdst_1_1composition_1_1_composition_autotoc_md10}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00359}{359}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a9d177d36b728442bcbd8cb66712c7c75}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!size@{size}}
\index{size@{size}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{size()}{size()}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a9d177d36b728442bcbd8cb66712c7c75} 
size\+\_\+t fourdst\+::composition\+::\+Composition\+::size (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [nodiscard]}, {\ttfamily [override]}, {\ttfamily [virtual]}, {\ttfamily [noexcept]}}



Gets the number of registered species in the composition. 

\begin{DoxyReturn}{Returns}
The number of registered species. 
\end{DoxyReturn}


Implements \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_af7ec2eaa16a0c78d19728e32469cec06}{fourdst\+::composition\+::\+Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00709}{709}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a3f013e33b8978baf81447e5bd177f38b}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!symbolVectorToSpeciesVector@{symbolVectorToSpeciesVector}}
\index{symbolVectorToSpeciesVector@{symbolVectorToSpeciesVector}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{symbolVectorToSpeciesVector()}{symbolVectorToSpeciesVector()}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a3f013e33b8978baf81447e5bd177f38b} 
std\+::vector$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ fourdst\+::composition\+::\+Composition\+::symbol\+Vector\+To\+Species\+Vector (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ std\+::string $>$ \&}]{symbols}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}, {\ttfamily [nodiscard]}, {\ttfamily [private]}}



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00725}{725}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.



\doxysubsection{Friends And Related Symbol Documentation}
\Hypertarget{classfourdst_1_1composition_1_1_composition_a36c2525d21cd932065bb2bb30bc57fb4}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!operator$<$$<$@{operator$<$$<$}}
\index{operator$<$$<$@{operator$<$$<$}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{operator$<$$<$}{operator<<}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a36c2525d21cd932065bb2bb30bc57fb4} 
std\+::ostream \& operator$<$$<$ (\begin{DoxyParamCaption}\item[{std\+::ostream \&}]{os}{, }\item[{const \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition}{Composition}} \&}]{composition}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [friend]}}



Overloaded output stream operator for \doxylink{classfourdst_1_1composition_1_1_composition}{Composition}. 


\begin{DoxyParams}{Parameters}
{\em os} & The output stream. \\
\hline
{\em composition} & The \doxylink{classfourdst_1_1composition_1_1_composition}{Composition} to output. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The output stream. 
\end{DoxyReturn}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00746}{746}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.



\doxysubsection{Member Data Documentation}
\Hypertarget{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!m\_cache@{m\_cache}}
\index{m\_cache@{m\_cache}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{m\_cache}{m\_cache}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d} 
\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_1_1_composition_cache}{Composition\+Cache}} fourdst\+::composition\+::\+Composition\+::m\+\_\+cache\hspace{0.3cm}{\ttfamily [mutable]}, {\ttfamily [private]}}



Cache for computed properties to avoid redundant calculations. 



Definition at line \mbox{\hyperlink{composition_8h_source_l00167}{167}} of file \mbox{\hyperlink{composition_8h_source}{composition.\+h}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!m\_molarAbundances@{m\_molarAbundances}}
\index{m\_molarAbundances@{m\_molarAbundances}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{m\_molarAbundances}{m\_molarAbundances}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479} 
std\+::vector$<$double$>$ fourdst\+::composition\+::\+Composition\+::m\+\_\+molar\+Abundances\hspace{0.3cm}{\ttfamily [private]}}



Definition at line \mbox{\hyperlink{composition_8h_source_l00165}{165}} of file \mbox{\hyperlink{composition_8h_source}{composition.\+h}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}\index{fourdst::composition::Composition@{fourdst::composition::Composition}!m\_species@{m\_species}}
\index{m\_species@{m\_species}!fourdst::composition::Composition@{fourdst::composition::Composition}}
\doxysubsubsection{\texorpdfstring{m\_species}{m\_species}}
{\footnotesize\ttfamily \label{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27} 
std\+::vector$<$\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}}$>$ fourdst\+::composition\+::\+Composition\+::m\+\_\+species\hspace{0.3cm}{\ttfamily [private]}}



Definition at line \mbox{\hyperlink{composition_8h_source_l00164}{164}} of file \mbox{\hyperlink{composition_8h_source}{composition.\+h}}.



The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
src/composition/include/fourdst/composition/\mbox{\hyperlink{composition_8h}{composition.\+h}}\item 
src/composition/lib/\mbox{\hyperlink{composition_8cpp}{composition.\+cpp}}\end{DoxyCompactItemize}
