\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=188pt]{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 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_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_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}{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 
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\+::set$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \& \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a33db253ca50431b5166d43412ff18f71}{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 
auto \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab1701644ff1c83c220dc04eb58d1621b}{begin}} ()
\begin{DoxyCompactList}\small\item\em Returns an iterator to the beginning of the molar abundance map. \end{DoxyCompactList}\item 
auto \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_adf41a833e8b704daf4f581fca5c8cb9b}{begin}} () const
\begin{DoxyCompactList}\small\item\em Returns a const iterator to the beginning of the molar abundance map. \end{DoxyCompactList}\item 
auto \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_adeaf6f1213e78cb1fe8a8317f0a8adc2}{end}} ()
\begin{DoxyCompactList}\small\item\em Returns an iterator to the end of the molar abundance map. \end{DoxyCompactList}\item 
auto \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aed2f5676f8f742199f01e4d1e9664bdd}{end}} () const
\begin{DoxyCompactList}\small\item\em Returns a const iterator to the end of the molar abundance map. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions inherited from \mbox{\hyperlink{class_composition_abstract}{Composition\+Abstract}}}
\begin{DoxyCompactItemize}
\item 
virtual \mbox{\hyperlink{class_composition_abstract_aaae3d6215b7433cb9871664852a95d1b}{\texorpdfstring{$\sim$}{\string~}\+Composition\+Abstract}} ()=default
\begin{DoxyCompactList}\small\item\em Virtual destructor. \end{DoxyCompactList}\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}\end{DoxyCompactItemize}
\doxysubsubsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
std\+::set$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}} $>$ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a452b0affb86dc971a96c80d01f4fcb2b}{m\+\_\+registered\+Species}}
\begin{DoxyCompactList}\small\item\em Set of registered species in the composition. \end{DoxyCompactList}\item 
std\+::map$<$ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}}, double $>$ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa05a640e0ea80142682bf4ee30a93c7f}{m\+\_\+molar\+Abundances}}
\begin{DoxyCompactList}\small\item\em Map of species to their molar abundances. \end{DoxyCompactList}\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_l00097}{97}} 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/9]}}
{\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/9]}}
{\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_l00084}{84}} 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/9]}}
{\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_l00100}{100}} 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/9]}}
{\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}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00092}{92}} 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/9]}}
{\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_l00108}{108}} 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 [6/9]}}
{\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}


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_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 [7/9]}}
{\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_l00131}{131}} 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 [8/9]}}
{\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_l00146}{146}} 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 [9/9]}}
{\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}. 


\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_l00161}{161}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.



\doxysubsection{Member Function Documentation}
\Hypertarget{classfourdst_1_1composition_1_1_composition_ab1701644ff1c83c220dc04eb58d1621b}\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_ab1701644ff1c83c220dc04eb58d1621b} 
auto fourdst\+::composition\+::\+Composition\+::begin (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



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}


Definition at line \mbox{\hyperlink{composition_8h_source_l00753}{753}} of file \mbox{\hyperlink{composition_8h_source}{composition.\+h}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_adf41a833e8b704daf4f581fca5c8cb9b}\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_adf41a833e8b704daf4f581fca5c8cb9b} 
auto fourdst\+::composition\+::\+Composition\+::begin (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [nodiscard]}}



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}


Definition at line \mbox{\hyperlink{composition_8h_source_l00774}{774}} of file \mbox{\hyperlink{composition_8h_source}{composition.\+h}}.

\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{class_composition_abstract_af42050fabc3c888d77f0fc98f08bc80a}{Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00509}{509}} 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{class_composition_abstract_aebd1997d8b3a59356f587c234b290796}{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_adeaf6f1213e78cb1fe8a8317f0a8adc2}\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_adeaf6f1213e78cb1fe8a8317f0a8adc2} 
auto fourdst\+::composition\+::\+Composition\+::end (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



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}


Definition at line \mbox{\hyperlink{composition_8h_source_l00795}{795}} of file \mbox{\hyperlink{composition_8h_source}{composition.\+h}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_aed2f5676f8f742199f01e4d1e9664bdd}\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_aed2f5676f8f742199f01e4d1e9664bdd} 
auto fourdst\+::composition\+::\+Composition\+::end (\begin{DoxyParamCaption}{}{}\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [nodiscard]}}



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}


Definition at line \mbox{\hyperlink{composition_8h_source_l00816}{816}} of file \mbox{\hyperlink{composition_8h_source}{composition.\+h}}.

\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_l00330}{330}} 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{class_composition_abstract_a86b60205094ed72435ee84abf9498e21}{Composition\+Abstract}}.



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_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_l00144}{144}} 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{class_composition_abstract_afb72c61da511b7963382804a0e87a54a}{Composition\+Abstract}}.



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_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{class_composition_abstract_a401e8298ed93b7963624e8a17eb17b55}{Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00235}{235}} 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{class_composition_abstract_ae0044d30efddccacc9fe7c8e58003066}{Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00227}{227}} 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{class_composition_abstract_a82583ffa3c08297cda6c3957a6a7dbc6}{Composition\+Abstract}}.



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_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{class_composition_abstract_a85bf97a30ecadd0750bece4442f4deff}{Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00311}{311}} 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{class_composition_abstract_a4cfc9e37370caae275c0f801b700e37b}{Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00302}{302}} 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{class_composition_abstract_a71fb459bf4375af2fe33c8a7c0747ce0}{Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00291}{291}} 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{class_composition_abstract_a1ad7a33d17db32b2c9ce0a30cd6628f9}{Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00416}{416}} 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{class_composition_abstract_a506ef92e69f99ad02598c8d178df1c31}{Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00283}{283}} 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{class_composition_abstract_a27d1d91203adb736454aa9b9936fc8c3}{Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00270}{270}} 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{class_composition_abstract_ae6026b1335230c6dfbd897ec8dfda295}{Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00260}{260}} 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{class_composition_abstract_a883ea47508557952b9f15432bf0be376}{Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00395}{395}} of file \mbox{\hyperlink{composition_8cpp_source}{composition.\+cpp}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_a33db253ca50431b5166d43412ff18f71}\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_a33db253ca50431b5166d43412ff18f71} 
const std\+::set$<$ \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{class_composition_abstract_ae6e7152d69fc5f5a128f8cb2cfce1587}{Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00222}{222}} 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_a33db253ca50431b5166d43412ff18f71}{get\+Registered\+Species()}} instead which returns a constant reference to the internal set. 
\end{DoxyNote}


Implements \mbox{\hyperlink{class_composition_abstract_a5a4362dc0d77659b75d528a0e884ed7b}{Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00214}{214}} 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{class_composition_abstract_aaee3651c1672b2763181e966e4525ba6}{Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00483}{483}} 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{class_composition_abstract_ab41311a8c20a9556d087a604da735767}{Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00449}{449}} 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{class_composition_abstract_a1e5195debe590960aa064289733958ba}{Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00438}{438}} 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=()}}
{\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_l00168}{168}} 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_l00197}{197}} 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_l00206}{206}} 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_l00178}{178}} 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_l00189}{189}} 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_l00541}{541}} 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_l00582}{582}} 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_l00573}{573}} 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_l00529}{529}} 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_l00564}{564}} 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}


Definition at line \mbox{\hyperlink{composition_8cpp_source_l00555}{555}} 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{class_composition_abstract_a230f58ef18a9816c1d13c287eaf3ba05}{Composition\+Abstract}}.



Definition at line \mbox{\hyperlink{composition_8cpp_source_l00525}{525}} 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_l00593}{593}} 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_l00152}{152}} of file \mbox{\hyperlink{composition_8h_source}{composition.\+h}}.

\Hypertarget{classfourdst_1_1composition_1_1_composition_aa05a640e0ea80142682bf4ee30a93c7f}\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_aa05a640e0ea80142682bf4ee30a93c7f} 
std\+::map$<$\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic\+::\+Species}}, double$>$ fourdst\+::composition\+::\+Composition\+::m\+\_\+molar\+Abundances\hspace{0.3cm}{\ttfamily [private]}}



Map of species to their molar abundances. 



Definition at line \mbox{\hyperlink{composition_8h_source_l00150}{150}} of file \mbox{\hyperlink{composition_8h_source}{composition.\+h}}.

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



Set of registered species in the composition. 



Definition at line \mbox{\hyperlink{composition_8h_source_l00149}{149}} 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}
