\doxysection{composition.\+cpp}
\hypertarget{composition_8cpp_source}{}\label{composition_8cpp_source}\index{src/composition/lib/composition.cpp@{src/composition/lib/composition.cpp}}
\mbox{\hyperlink{composition_8cpp}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00001}00001\ \textcolor{comment}{/*\ ***********************************************************************}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00002}00002\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00003}00003\ \textcolor{comment}{//\ \ \ Copyright\ (C)\ 2025\ -\/-\/\ The\ 4D-\/STAR\ Collaboration}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00004}00004\ \textcolor{comment}{//\ \ \ File\ Author:\ Emily\ Boudreaux}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00005}00005\ \textcolor{comment}{//\ \ \ Last\ Modified:\ October\ 6,\ 2025}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00006}00006\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00007}00007\ \textcolor{comment}{//\ \ \ 4DSSE\ is\ free\ software;\ you\ can\ use\ it\ and/or\ modify}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00008}00008\ \textcolor{comment}{//\ \ \ it\ under\ the\ terms\ and\ restrictions\ the\ GNU\ General\ Library\ Public}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00009}00009\ \textcolor{comment}{//\ \ \ License\ version\ 3\ (GPLv3)\ as\ published\ by\ the\ Free\ Software\ Foundation.}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00010}00010\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00011}00011\ \textcolor{comment}{//\ \ \ 4DSSE\ is\ distributed\ in\ the\ hope\ that\ it\ will\ be\ useful,}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00012}00012\ \textcolor{comment}{//\ \ \ but\ WITHOUT\ ANY\ WARRANTY;\ without\ even\ the\ implied\ warranty\ of}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00013}00013\ \textcolor{comment}{//\ \ \ MERCHANTABILITY\ or\ FITNESS\ FOR\ A\ PARTICULAR\ PURPOSE.}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00014}00014\ \textcolor{comment}{//\ \ \ See\ the\ GNU\ Library\ General\ Public\ License\ for\ more\ details.}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00015}00015\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00016}00016\ \textcolor{comment}{//\ \ \ You\ should\ have\ received\ a\ copy\ of\ the\ GNU\ Library\ General\ Public\ License}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00017}00017\ \textcolor{comment}{//\ \ \ along\ with\ this\ software;\ if\ not,\ write\ to\ the\ Free\ Software}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00018}00018\ \textcolor{comment}{//\ \ \ Foundation,\ Inc.,\ 59\ Temple\ Place,\ Suite\ 330,\ Boston,\ MA\ 02111-\/1307\ USA}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00019}00019\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00020}00020\ \textcolor{comment}{//\ ***********************************************************************\ */}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00021}00021\ \textcolor{preprocessor}{\#include\ "{}quill/LogMacros.h"{}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00022}00022\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00023}00023\ \textcolor{preprocessor}{\#include\ <stdexcept>}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00024}00024\ \textcolor{preprocessor}{\#include\ <unordered\_map>}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00025}00025\ \textcolor{preprocessor}{\#include\ <vector>}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00026}00026\ \textcolor{preprocessor}{\#include\ <array>}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00027}00027\ \textcolor{preprocessor}{\#include\ <ranges>}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00028}00028\ \textcolor{preprocessor}{\#include\ <algorithm>}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00029}00029\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00030}00030\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00031}00031\ \textcolor{preprocessor}{\#include\ <utility>}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00032}00032\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00033}00033\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{atomic_species_8h}{fourdst/composition/atomicSpecies.h}}"{}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00034}00034\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{species_8h}{fourdst/composition/species.h}}"{}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00035}00035\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{composition_8h}{fourdst/composition/composition.h}}"{}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00036}00036\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00037}00037\ \textcolor{preprocessor}{\#include\ <numeric>}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00038}00038\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00039}00039\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{exceptions__composition_8h}{fourdst/composition/exceptions/exceptions\_composition.h}}"{}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00040}00040\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00041}00041\ \textcolor{keyword}{namespace\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00042}00042\ \ \ \ \ \textcolor{keyword}{template}<\textcolor{keyword}{typename}\ A,\ \textcolor{keyword}{typename}\ B>}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00043}00043\ \ \ \ \ std::vector<A>\ sortVectorBy(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00044}00044\ \ \ \ \ \ \ \ \ std::vector<A>\ toSort,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00045}00045\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<B>\&\ by}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00046}00046\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00047}00047\ \ \ \ \ \ \ \ \ std::vector<std::size\_t>\ indices(by.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00048}00048\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{size\_t}\ i\ =\ 0;\ i\ <\ indices.size();\ i++)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00049}00049\ \ \ \ \ \ \ \ \ \ \ \ \ indices[i]\ =\ i;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00050}00050\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00051}00051\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00052}00052\ \ \ \ \ \ \ \ \ std::ranges::sort(indices,\ [\&](\textcolor{keywordtype}{size\_t}\ a,\ \textcolor{keywordtype}{size\_t}\ b)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00053}00053\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ by[a]\ <\ by[b];}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00054}00054\ \ \ \ \ \ \ \ \ \});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00055}00055\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00056}00056\ \ \ \ \ \ \ \ \ std::vector<A>\ sorted;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00057}00057\ \ \ \ \ \ \ \ \ sorted.reserve(indices.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00058}00058\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00059}00059\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ idx:\ indices)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00060}00060\ \ \ \ \ \ \ \ \ \ \ \ \ sorted.push\_back(toSort[idx]);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00061}00061\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00062}00062\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00063}00063\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ sorted;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00064}00064\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00065}00065\ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00066}00066\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00067}00067\ \textcolor{keyword}{namespace\ }\mbox{\hyperlink{namespacefourdst_1_1composition}{fourdst::composition}}\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00068}00068\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00069}\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a1cccb94c150dd1dcde860f55fbeaf2bd}{00069}}\ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a1cccb94c150dd1dcde860f55fbeaf2bd}{CompositionEntry::CompositionEntry}}()\ :}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00070}00070\ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_ac273debdba6a1b3ac0f11698c399d38e}{m\_symbol}}(\textcolor{stringliteral}{"{}H-\/1"{}}),}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00071}00071\ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a79039cbdc76b4401eb2ce44b85467503}{m\_isotope}}(\mbox{\hyperlink{namespacefourdst}{fourdst}}::\mbox{\hyperlink{namespacefourdst_1_1atomic}{atomic}}::species.at(\textcolor{stringliteral}{"{}H-\/1"{}})),}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00072}00072\ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a391e899874cd7ef299a3ae1f64c016d2}{m\_initialized}}(false)\ \{\}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00073}00073\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00074}\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_af27b09bb4e1ee357bb657146feb6039e}{00074}}\ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a1cccb94c150dd1dcde860f55fbeaf2bd}{CompositionEntry::CompositionEntry}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00075}00075\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\&\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a50d18b4c27611fa9314dd756af54c2f0}{symbol}},}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00076}00076\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{bool}\ massFracMode}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00077}00077\ \ \ \ \ )\ :}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00078}00078\ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_ac273debdba6a1b3ac0f11698c399d38e}{m\_symbol}}(\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a50d18b4c27611fa9314dd756af54c2f0}{symbol}}),}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00079}00079\ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a79039cbdc76b4401eb2ce44b85467503}{m\_isotope}}(\mbox{\hyperlink{namespacefourdst_1_1atomic}{atomic}}::species.at(\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a50d18b4c27611fa9314dd756af54c2f0}{symbol}})),}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00080}00080\ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a1e860519bea86793413ed67c76d18c8b}{m\_massFracMode}}(massFracMode)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00081}00081\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a5885a0e33687bceb15b225a00163e9d3}{setSpecies}}(\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a50d18b4c27611fa9314dd756af54c2f0}{symbol}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00082}00082\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00083}00083\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00084}00084\ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a1cccb94c150dd1dcde860f55fbeaf2bd}{CompositionEntry::CompositionEntry}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry}{CompositionEntry}}\&\ entry)\ =\ \textcolor{keywordflow}{default};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00085}00085\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00086}\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a5885a0e33687bceb15b225a00163e9d3}{00086}}\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a5885a0e33687bceb15b225a00163e9d3}{CompositionEntry::setSpecies}}(\textcolor{keyword}{const}\ std::string\&\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a50d18b4c27611fa9314dd756af54c2f0}{symbol}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00087}00087\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a391e899874cd7ef299a3ae1f64c016d2}{m\_initialized}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00088}00088\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_entry_already_initialized_error}{exceptions::EntryAlreadyInitializedError}}(\textcolor{stringliteral}{"{}Composition\ entry\ is\ already\ initialized."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00089}00089\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00090}00090\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{fourdst::atomic::species}}.contains(\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a50d18b4c27611fa9314dd756af54c2f0}{symbol}}))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00091}00091\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_species_symbol_error}{exceptions::InvalidSpeciesSymbolError}}(\textcolor{stringliteral}{"{}Invalid\ symbol."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00092}00092\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00093}00093\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_ac273debdba6a1b3ac0f11698c399d38e}{m\_symbol}}\ =\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a50d18b4c27611fa9314dd756af54c2f0}{symbol}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00094}00094\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a79039cbdc76b4401eb2ce44b85467503}{m\_isotope}}\ =\ \mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{atomic::species}}.at(\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a50d18b4c27611fa9314dd756af54c2f0}{symbol}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00095}00095\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a391e899874cd7ef299a3ae1f64c016d2}{m\_initialized}}\ =\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00096}00096\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00097}00097\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00098}\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a50d18b4c27611fa9314dd756af54c2f0}{00098}}\ \ \ \ \ std::string\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a50d18b4c27611fa9314dd756af54c2f0}{CompositionEntry::symbol}}()\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00099}00099\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_ac273debdba6a1b3ac0f11698c399d38e}{m\_symbol}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00100}00100\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00101}00101\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00102}\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a66cb086719d7f654869bd7b0cee87ffc}{00102}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a66cb086719d7f654869bd7b0cee87ffc}{CompositionEntry::mass\_fraction}}()\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00103}00103\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a1e860519bea86793413ed67c76d18c8b}{m\_massFracMode}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00104}00104\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_mode_error}{exceptions::CompositionModeError}}(\textcolor{stringliteral}{"{}Composition\ entry\ is\ in\ number\ fraction\ mode."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00105}00105\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00106}00106\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ X\_i\ =\ (moles\_i\ /\ mass\_total)\ *\ (mass\_i\ /\ moles\_i)\ =\ m\_molesPerMass\ *\ A\_i}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00107}00107\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_acd41be41f03c819521bab28ea0d8bed2}{m\_molesPerMass}}\ *\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a79039cbdc76b4401eb2ce44b85467503}{m\_isotope}}.mass();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00108}00108\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00109}00109\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00110}\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a2d55492d285068d4a64db5602dfb1c78}{00110}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a2d55492d285068d4a64db5602dfb1c78}{CompositionEntry::number\_fraction}}()\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00111}00111\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a1e860519bea86793413ed67c76d18c8b}{m\_massFracMode}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00112}00112\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_mode_error}{exceptions::CompositionModeError}}(\textcolor{stringliteral}{"{}Composition\ entry\ is\ in\ mass\ fraction\ mode."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00113}00113\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00114}00114\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ In\ number\ fraction\ mode,\ the\ value\ is\ cached\ during\ the\ mode\ switch.}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00115}00115\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a3b056b6b923016d271f034333c96d039}{m\_cachedNumberFraction}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00116}00116\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00117}00117\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00118}\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_aed91b28f66ed3e0937905c174712c3ca}{00118}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a2d55492d285068d4a64db5602dfb1c78}{CompositionEntry::number\_fraction}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00119}00119\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ totalMolesPerMass}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00120}00120\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00121}00121\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ n\_i\ =\ (moles\_i\ /\ mass\_total)\ /\ (moles\_total\ /\ mass\_total)}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00122}00122\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (totalMolesPerMass\ ==\ 0.0)\ \textcolor{keywordflow}{return}\ 0.0;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00123}00123\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_acd41be41f03c819521bab28ea0d8bed2}{m\_molesPerMass}}\ /\ totalMolesPerMass;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00124}00124\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00125}00125\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00126}\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_ab6619d23e111905d1e3ab16ee822d96c}{00126}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_ab6619d23e111905d1e3ab16ee822d96c}{CompositionEntry::rel\_abundance}}()\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00127}00127\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_acd41be41f03c819521bab28ea0d8bed2}{m\_molesPerMass}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00128}00128\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00129}00129\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00130}\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_af49920b1168be92d517aea03a308fee1}{00130}}\ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_af49920b1168be92d517aea03a308fee1}{CompositionEntry::isotope}}()\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00131}00131\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a79039cbdc76b4401eb2ce44b85467503}{m\_isotope}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00132}00132\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00133}00133\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00134}\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a4d6df43e098e7e2e2d94ff7fb76cb4c2}{00134}}\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a4d6df43e098e7e2e2d94ff7fb76cb4c2}{CompositionEntry::setMassFraction}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00135}00135\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a66cb086719d7f654869bd7b0cee87ffc}{mass\_fraction}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00136}00136\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00137}00137\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a1e860519bea86793413ed67c76d18c8b}{m\_massFracMode}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00138}00138\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_mode_error}{exceptions::CompositionModeError}}(\textcolor{stringliteral}{"{}Composition\ entry\ is\ in\ number\ fraction\ mode."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00139}00139\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00140}00140\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Set\ the\ invariant\ from\ the\ given\ mass\ fraction}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00141}00141\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a79039cbdc76b4401eb2ce44b85467503}{m\_isotope}}.mass()\ ==\ 0.0)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00142}00142\ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_acd41be41f03c819521bab28ea0d8bed2}{m\_molesPerMass}}\ =\ 0.0;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00143}00143\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00144}00144\ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_acd41be41f03c819521bab28ea0d8bed2}{m\_molesPerMass}}\ =\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a66cb086719d7f654869bd7b0cee87ffc}{mass\_fraction}}\ /\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a79039cbdc76b4401eb2ce44b85467503}{m\_isotope}}.mass();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00145}00145\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00146}00146\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00147}00147\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00148}\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a9ec47cf4b3399128d3836c1b24b031b0}{00148}}\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a9ec47cf4b3399128d3836c1b24b031b0}{CompositionEntry::setNumberFraction}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00149}00149\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a2d55492d285068d4a64db5602dfb1c78}{number\_fraction}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00150}00150\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00151}00151\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a1e860519bea86793413ed67c76d18c8b}{m\_massFracMode}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00152}00152\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_mode_error}{exceptions::CompositionModeError}}(\textcolor{stringliteral}{"{}Composition\ entry\ is\ in\ mass\ fraction\ mode."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00153}00153\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00154}00154\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ In\ number\ fraction\ mode,\ we\ only\ cache\ the\ value.\ The\ invariant}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00155}00155\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ m\_molesPerMass\ cannot\ be\ calculated\ until\ finalize()\ provides\ global\ context.}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00156}00156\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a3b056b6b923016d271f034333c96d039}{m\_cachedNumberFraction}}\ =\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a2d55492d285068d4a64db5602dfb1c78}{number\_fraction}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00157}00157\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00158}00158\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00159}\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a3fb3f63a4e5675c6fefb662a8e3e7aa3}{00159}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a3fb3f63a4e5675c6fefb662a8e3e7aa3}{CompositionEntry::setMassFracMode}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00160}00160\ \ \ \ \ \ \ \ \ [[maybe\_unused]]\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ meanMolarMass}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00161}00161\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00162}00162\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a1e860519bea86793413ed67c76d18c8b}{m\_massFracMode}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00163}00163\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00164}00164\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00165}00165\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a1e860519bea86793413ed67c76d18c8b}{m\_massFracMode}}\ =\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00166}00166\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ The\ invariant\ m\_molesPerMass\ does\ not\ change\ when\ switching\ mode.}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00167}00167\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ The\ cached\ number\ fraction\ is\ now\ stale,\ but\ that's\ okay.}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00168}00168\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00169}00169\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00170}00170\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00171}\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a00332551f5b2f0d7f10b12a091e21fa8}{00171}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a00332551f5b2f0d7f10b12a091e21fa8}{CompositionEntry::setNumberFracMode}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00172}00172\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ totalMolesPerMass}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00173}00173\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00174}00174\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a1e860519bea86793413ed67c76d18c8b}{m\_massFracMode}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00175}00175\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00176}00176\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00177}00177\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a1e860519bea86793413ed67c76d18c8b}{m\_massFracMode}}\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00178}00178\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Calculate\ and\ cache\ the\ number\ fraction\ for\ the\ new\ mode.}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00179}00179\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a3b056b6b923016d271f034333c96d039}{m\_cachedNumberFraction}}\ =\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a2d55492d285068d4a64db5602dfb1c78}{number\_fraction}}(totalMolesPerMass);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00180}00180\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00181}00181\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00182}00182\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00183}\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a14f12b8b0178df2e32e2023bd4564ddc}{00183}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a14f12b8b0178df2e32e2023bd4564ddc}{CompositionEntry::getMassFracMode}}()\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00184}00184\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a1e860519bea86793413ed67c76d18c8b}{m\_massFracMode}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00185}00185\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00186}00186\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00187}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae3cc2099efd7db8eec3d9af2294b75fa}{00187}}\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition::Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00188}00188\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<std::string>\&\ symbols}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00189}00189\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00190}00190\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ symbol\ :\ symbols)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00191}00191\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1bc2e64f87c12befdc2bc767e7405661}{registerSymbol}}(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00192}00192\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00193}00193\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00194}00194\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00195}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a2d6fbe5c8142b358641bbe7ffde51053}{00195}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition::Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00196}00196\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::set<std::string>\&\ symbols}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00197}00197\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00198}00198\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ symbol\ :\ symbols)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00199}00199\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1bc2e64f87c12befdc2bc767e7405661}{registerSymbol}}(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00200}00200\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00201}00201\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00202}00202\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00203}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_af4d4cc5875cba931a91faee13f55594e}{00203}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition::Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00204}00204\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<std::string>\&\ symbols,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00205}00205\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<double>\&\ fractions,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00206}00206\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{bool}\ massFracMode}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00207}00207\ \ \ \ \ )\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a671f1ee8be00f4ff8c1d94fabb382380}{m\_massFracMode}}(massFracMode)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00208}00208\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (symbols.size()\ !=\ fractions.size())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00209}00209\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_CRITICAL(m\_logger,\ \textcolor{stringliteral}{"{}The\ number\ of\ symbols\ and\ fractions\ must\ be\ equal\ (got\ \{\}\ symbols\ and\ \{\}\ fractions)."{}},\ symbols.size(),\ fractions.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00210}00210\ \ \ \ \ \ \ \ \ \ \ \ \ throw\ exceptions::InvalidCompositionError(\textcolor{stringliteral}{"{}The\ number\ of\ symbols\ and\ fractions\ must\ be\ equal.\ Got\ "{}}\ +\ std::to\_string(symbols.size())\ +\ \textcolor{stringliteral}{"{}\ symbols\ and\ "{}}\ +\ std::to\_string(fractions.size())\ +\ \textcolor{stringliteral}{"{}\ fractions."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00211}00211\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00212}00212\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00213}00213\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a86982685c34db4a8f079ddafc25c594e}{validateComposition}}(fractions);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00214}00214\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00215}00215\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&symbol\ :\ symbols)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00216}00216\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1bc2e64f87c12befdc2bc767e7405661}{registerSymbol}}(symbol,\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a671f1ee8be00f4ff8c1d94fabb382380}{m\_massFracMode}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00217}00217\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00218}00218\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00219}00219\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{size\_t}\ i\ =\ 0;\ i\ <\ symbols.size();\ ++i)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00220}00220\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a671f1ee8be00f4ff8c1d94fabb382380}{m\_massFracMode}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00221}00221\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a493224656aa3ade68389250720ef09af}{setMassFraction}}(symbols[i],\ fractions[i]);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00222}00222\ \ \ \ \ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00223}00223\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7d4d748f3ee25e68751fb143717ed080}{setNumberFraction}}(symbols[i],\ fractions[i]);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00224}00224\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00225}00225\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00226}00226\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\textcolor{keyword}{const}\ \textcolor{keywordtype}{bool}\ didFinalize\ =\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a72d063a74a9d2197065884a2cea57a14}{finalize}}();\ !didFinalize)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00227}00227\ \ \ \ \ \ \ \ \ \ \ \ \ std::string\ msg\ =\ \textcolor{stringliteral}{"{}Failed\ to\ finalize\ composition\ on\ construction.\ "{}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00228}00228\ \ \ \ \ \ \ \ \ \ \ \ \ msg\ +=\ \textcolor{stringliteral}{"{}Construction\ of\ a\ composition\ object\ requires\ that\ the\ sum\ of\ the\ fractions\ vector\ be\ 1.\(\backslash\)n"{}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00229}00229\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_CRITICAL(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}\{\}"{}},\ msg);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00230}00230\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions::InvalidCompositionError}}(msg);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00231}00231\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00232}00232\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00233}00233\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00234}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a21369a80378d4c90438a34f0e4a275ca}{00234}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition::Composition}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ \&\mbox{\hyperlink{namespacefourdst_1_1composition}{composition}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00235}00235\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}}\ =\ \mbox{\hyperlink{namespacefourdst_1_1composition}{composition}}.m\_finalized;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00236}00236\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_addae4484da7d5072ab66a721dbe04ced}{m\_specificNumberDensity}}\ =\ \mbox{\hyperlink{namespacefourdst_1_1composition}{composition}}.m\_specificNumberDensity;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00237}00237\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4a36c8d22ce61023e7bea1d9417577d4}{m\_meanParticleMass}}\ =\ \mbox{\hyperlink{namespacefourdst_1_1composition}{composition}}.m\_meanParticleMass;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00238}00238\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a671f1ee8be00f4ff8c1d94fabb382380}{m\_massFracMode}}\ =\ \mbox{\hyperlink{namespacefourdst_1_1composition}{composition}}.m\_massFracMode;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00239}00239\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a39bfcb7d81d723cbd9d021abd533b4d6}{m\_registeredSymbols}}\ =\ \mbox{\hyperlink{namespacefourdst_1_1composition}{composition}}.m\_registeredSymbols;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00240}00240\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ =\ \mbox{\hyperlink{namespacefourdst_1_1composition}{composition}}.m\_compositions;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00241}00241\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00242}00242\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00243}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4ec1e23cfecef764cb831171fed62fc2}{00243}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\&\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4ec1e23cfecef764cb831171fed62fc2}{Composition::operator=}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ \&other)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00244}00244\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\textcolor{keyword}{this}\ !=\ \&other)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00245}00245\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =\ other.\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00246}00246\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_addae4484da7d5072ab66a721dbe04ced}{m\_specificNumberDensity}}\ \ \ =\ other.\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_addae4484da7d5072ab66a721dbe04ced}{m\_specificNumberDensity}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00247}00247\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4a36c8d22ce61023e7bea1d9417577d4}{m\_meanParticleMass}}\ \ \ \ \ \ \ \ =\ other.\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4a36c8d22ce61023e7bea1d9417577d4}{m\_meanParticleMass}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00248}00248\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a671f1ee8be00f4ff8c1d94fabb382380}{m\_massFracMode}}\ \ \ \ \ \ \ \ \ \ \ \ =\ other.\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a671f1ee8be00f4ff8c1d94fabb382380}{m\_massFracMode}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00249}00249\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a39bfcb7d81d723cbd9d021abd533b4d6}{m\_registeredSymbols}}\ \ \ \ \ \ \ =\ other.\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a39bfcb7d81d723cbd9d021abd533b4d6}{m\_registeredSymbols}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00250}00250\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ \ \ \ \ \ \ \ \ \ \ \ =\ other.\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00251}00251\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00252}00252\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00253}00253\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00254}00254\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00255}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1bc2e64f87c12befdc2bc767e7405661}{00255}}\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1bc2e64f87c12befdc2bc767e7405661}{Composition::registerSymbol}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00256}00256\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\&\ symbol,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00257}00257\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{bool}\ massFracMode}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00258}00258\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00259}00259\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a8fdac26e6298008aaeaa5b15f7fe244f}{isValidSymbol}}(symbol))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00260}00260\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Invalid\ symbol:\ \{\}"{}},\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00261}00261\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_symbol_error}{exceptions::InvalidSymbolError}}(\textcolor{stringliteral}{"{}Invalid\ symbol:\ "{}}\ +\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00262}00262\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00263}00263\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00264}00264\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a39bfcb7d81d723cbd9d021abd533b4d6}{m\_registeredSymbols}}.empty())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00265}00265\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a671f1ee8be00f4ff8c1d94fabb382380}{m\_massFracMode}}\ =\ massFracMode;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00266}00266\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00267}00267\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a671f1ee8be00f4ff8c1d94fabb382380}{m\_massFracMode}}\ !=\ massFracMode)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00268}00268\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ is\ in\ \{\}\ fraction\ mode.\ Cannot\ register\ symbol\ (\{\})\ in\ \{\}\ fraction\ mode."{}},\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a671f1ee8be00f4ff8c1d94fabb382380}{m\_massFracMode}}\ ?\ \textcolor{stringliteral}{"{}mass"{}}\ :\ \textcolor{stringliteral}{"{}number"{}},\ symbol,\ massFracMode\ ?\ \textcolor{stringliteral}{"{}mass"{}}\ :\ \textcolor{stringliteral}{"{}number"{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00269}00269\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_mode_error}{exceptions::CompositionModeError}}(\textcolor{stringliteral}{"{}Composition\ mode\ mismatch."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00270}00270\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00271}00271\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00272}00272\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00273}00273\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a39bfcb7d81d723cbd9d021abd533b4d6}{m\_registeredSymbols}}.contains(symbol))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00274}00274\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_WARNING(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Symbol\ \{\}\ is\ already\ registered."{}},\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00275}00275\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00276}00276\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00277}00277\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00278}00278\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a39bfcb7d81d723cbd9d021abd533b4d6}{m\_registeredSymbols}}.insert(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00279}00279\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}[symbol]\ =\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry}{CompositionEntry}}(symbol,\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a671f1ee8be00f4ff8c1d94fabb382380}{m\_massFracMode}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00280}00280\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}}\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00281}00281\ \ \ \ \ \ \ \ \ LOG\_TRACE\_L3(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Registered\ symbol:\ \{\}"{}},\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00282}00282\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00283}00283\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00284}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a9b422156600823276a9606bfa07ad4db}{00284}}\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1bc2e64f87c12befdc2bc767e7405661}{Composition::registerSymbol}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00285}00285\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<std::string>\&\ symbols,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00286}00286\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{bool}\ massFracMode}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00287}00287\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00288}00288\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ symbol\ :\ symbols)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00289}00289\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1bc2e64f87c12befdc2bc767e7405661}{registerSymbol}}(symbol,\ massFracMode);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00290}00290\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00291}00291\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00292}00292\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00293}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4ce00f73cc133bb1bac2b030b93ab480}{00293}}\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4ce00f73cc133bb1bac2b030b93ab480}{Composition::registerSpecies}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00294}00294\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \&species,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00295}00295\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{bool}\ massFracMode}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00296}00296\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00297}00297\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1bc2e64f87c12befdc2bc767e7405661}{registerSymbol}}(std::string(species.\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species_a1fcc01fc978b34ba2531117f10be6741}{name}}()),\ massFracMode);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00298}00298\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00299}00299\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00300}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a057f2bf2e86bcc3c649c0ddf18cf3826}{00300}}\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4ce00f73cc133bb1bac2b030b93ab480}{Composition::registerSpecies}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00301}00301\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<atomic::Species>\ \&species,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00302}00302\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{bool}\ massFracMode}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00303}00303\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00304}00304\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ s\ :\ species)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00305}00305\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4ce00f73cc133bb1bac2b030b93ab480}{registerSpecies}}(s,\ massFracMode);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00306}00306\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00307}00307\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00308}00308\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00309}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3f10f38878ba4be121d6d77a8b1f4d7a}{00309}}\ \ \ \ \ std::set<std::string>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3f10f38878ba4be121d6d77a8b1f4d7a}{Composition::getRegisteredSymbols}}()\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00310}00310\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a39bfcb7d81d723cbd9d021abd533b4d6}{m\_registeredSymbols}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00311}00311\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00312}00312\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00313}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_af61ebe73a8b5926eb23037bb078fa87a}{00313}}\ \ \ \ \ std::set<atomic::Species>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_af61ebe73a8b5926eb23037bb078fa87a}{Composition::getRegisteredSpecies}}()\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00314}00314\ \ \ \ \ \ \ \ \ std::set<atomic::Species>\ result;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00315}00315\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ entry\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::values)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00316}00316\ \ \ \ \ \ \ \ \ \ \ \ \ result.insert(entry.isotope());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00317}00317\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00318}00318\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ result;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00319}00319\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00320}00320\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00321}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a8fdac26e6298008aaeaa5b15f7fe244f}{00321}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a8fdac26e6298008aaeaa5b15f7fe244f}{Composition::isValidSymbol}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00322}00322\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\&\ symbol}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00323}00323\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00324}00324\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{atomic::species}}.contains(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00325}00325\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00326}00326\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00327}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a86982685c34db4a8f079ddafc25c594e}{00327}}\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a86982685c34db4a8f079ddafc25c594e}{Composition::validateComposition}}(\textcolor{keyword}{const}\ std::vector<double>\&\ fractions)\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00328}00328\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_addf03ba8b988970d341884d487aa94d5}{isValidComposition}}(fractions))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00329}00329\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Invalid\ composition."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00330}00330\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions::InvalidCompositionError}}(\textcolor{stringliteral}{"{}Invalid\ composition."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00331}00331\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00332}00332\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00333}00333\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00334}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_addf03ba8b988970d341884d487aa94d5}{00334}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_addf03ba8b988970d341884d487aa94d5}{Composition::isValidComposition}}(\textcolor{keyword}{const}\ std::vector<double>\&\ fractions)\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00335}00335\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ sum\ =\ std::accumulate(fractions.begin(),\ fractions.end(),\ 0.0);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00336}00336\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (sum\ <\ 0.999999\ ||\ sum\ >\ 1.000001)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00337}00337\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}The\ sum\ of\ fractions\ must\ be\ equal\ to\ 1\ (expected\ 1,\ got\ \{\})."{}},\ sum);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00338}00338\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00339}00339\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00340}00340\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00341}00341\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00342}00342\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00343}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a493224656aa3ade68389250720ef09af}{00343}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a493224656aa3ade68389250720ef09af}{Composition::setMassFraction}}(\textcolor{keyword}{const}\ std::string\&\ symbol,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\&\ mass\_fraction)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00344}00344\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a39bfcb7d81d723cbd9d021abd533b4d6}{m\_registeredSymbols}}.contains(symbol))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00345}00345\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Symbol\ \{\}\ is\ not\ registered."{}},\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00346}00346\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions::UnregisteredSymbolError}}(\textcolor{stringliteral}{"{}Symbol\ ("{}}\ +\ symbol\ +\ \textcolor{stringliteral}{"{})\ is\ not\ registered."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00347}00347\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00348}00348\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a671f1ee8be00f4ff8c1d94fabb382380}{m\_massFracMode}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00349}00349\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ is\ in\ number\ fraction\ mode."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00350}00350\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_mode_error}{exceptions::CompositionModeError}}(\textcolor{stringliteral}{"{}Composition\ is\ in\ number\ fraction\ mode."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00351}00351\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00352}00352\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (mass\_fraction\ <\ 0.0\ ||\ mass\_fraction\ >\ 1.0)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00353}00353\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Mass\ fraction\ must\ be\ between\ 0\ and\ 1\ for\ symbol\ \{\}.\ Currently\ it\ is\ \{\}."{}},\ symbol,\ mass\_fraction);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00354}00354\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions::InvalidCompositionError}}(\textcolor{stringliteral}{"{}Mass\ fraction\ must\ be\ between\ 0\ and\ 1."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00355}00355\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00356}00356\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}}\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00357}00357\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ old\_mass\_fraction\ =\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.at(symbol).mass\_fraction();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00358}00358\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.at(symbol).setMassFraction(mass\_fraction);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00359}00359\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ old\_mass\_fraction;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00360}00360\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00361}00361\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00362}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a66ce1012c12b0a83629eb09d451b68e3}{00362}}\ \ \ \ \ std::vector<double>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a493224656aa3ade68389250720ef09af}{Composition::setMassFraction}}(\textcolor{keyword}{const}\ std::vector<std::string>\&\ symbols,\ \textcolor{keyword}{const}\ std::vector<double>\&\ mass\_fractions)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00363}00363\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (symbols.size()\ !=\ mass\_fractions.size())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00364}00364\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions::InvalidCompositionError}}(\textcolor{stringliteral}{"{}The\ number\ of\ symbols\ and\ mass\ fractions\ must\ be\ equal."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00365}00365\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00366}00366\ \ \ \ \ \ \ \ \ std::vector<double>\ old\_mass\_fractions;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00367}00367\ \ \ \ \ \ \ \ \ old\_mass\_fractions.reserve(symbols.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00368}00368\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{size\_t}\ i\ =\ 0;\ i\ <\ symbols.size();\ ++i)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00369}00369\ \ \ \ \ \ \ \ \ \ \ \ \ old\_mass\_fractions.push\_back(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a493224656aa3ade68389250720ef09af}{setMassFraction}}(symbols[i],\ mass\_fractions[i]));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00370}00370\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00371}00371\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ old\_mass\_fractions;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00372}00372\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00373}00373\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00374}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7d4d748f3ee25e68751fb143717ed080}{00374}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7d4d748f3ee25e68751fb143717ed080}{Composition::setNumberFraction}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00375}00375\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\&\ symbol,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00376}00376\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\&\ number\_fraction}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00377}00377\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00378}00378\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a39bfcb7d81d723cbd9d021abd533b4d6}{m\_registeredSymbols}}.contains(symbol))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00379}00379\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Symbol\ \{\}\ is\ not\ registered."{}},\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00380}00380\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions::UnregisteredSymbolError}}(\textcolor{stringliteral}{"{}Symbol\ ("{}}\ +\ symbol\ +\ \textcolor{stringliteral}{"{})\ is\ not\ registered."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00381}00381\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00382}00382\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a671f1ee8be00f4ff8c1d94fabb382380}{m\_massFracMode}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00383}00383\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ is\ in\ mass\ fraction\ mode."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00384}00384\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_mode_error}{exceptions::CompositionModeError}}(\textcolor{stringliteral}{"{}Composition\ is\ in\ mass\ fraction\ mode."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00385}00385\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00386}00386\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (number\_fraction\ <\ 0.0\ ||\ number\_fraction\ >\ 1.0)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00387}00387\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Number\ fraction\ must\ be\ between\ 0\ and\ 1\ for\ symbol\ \{\}.\ Currently\ it\ is\ \{\}."{}},\ symbol,\ number\_fraction);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00388}00388\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions::InvalidCompositionError}}(\textcolor{stringliteral}{"{}Number\ fraction\ must\ be\ between\ 0\ and\ 1."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00389}00389\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00390}00390\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}}\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00391}00391\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ old\_number\_fraction\ =\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.at(symbol).number\_fraction();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00392}00392\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.at(symbol).setNumberFraction(number\_fraction);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00393}00393\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ old\_number\_fraction;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00394}00394\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00395}00395\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00396}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a48014a0a725ebd91ad1193c063b5b26f}{00396}}\ \ \ \ \ std::vector<double>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7d4d748f3ee25e68751fb143717ed080}{Composition::setNumberFraction}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00397}00397\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<std::string>\&\ symbols,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00398}00398\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<double>\&\ number\_fractions}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00399}00399\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00400}00400\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (symbols.size()\ !=\ number\_fractions.size())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00401}00401\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions::InvalidCompositionError}}(\textcolor{stringliteral}{"{}The\ number\ of\ symbols\ and\ number\ fractions\ must\ be\ equal."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00402}00402\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00403}00403\ \ \ \ \ \ \ \ \ std::vector<double>\ old\_number\_fractions;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00404}00404\ \ \ \ \ \ \ \ \ old\_number\_fractions.reserve(symbols.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00405}00405\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{size\_t}\ i\ =\ 0;\ i\ <\ symbols.size();\ ++i)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00406}00406\ \ \ \ \ \ \ \ \ \ \ \ \ old\_number\_fractions.push\_back(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7d4d748f3ee25e68751fb143717ed080}{setNumberFraction}}(symbols[i],\ number\_fractions[i]));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00407}00407\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00408}00408\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ old\_number\_fractions;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00409}00409\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00410}00410\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00411}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa6c94269a5d16349c98860f3015b734a}{00411}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a493224656aa3ade68389250720ef09af}{Composition::setMassFraction}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00412}00412\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \&species,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00413}00413\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ \&mass\_fraction}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00414}00414\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00415}00415\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a493224656aa3ade68389250720ef09af}{setMassFraction}}(std::string(species.\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species_a1fcc01fc978b34ba2531117f10be6741}{name}}()),\ mass\_fraction);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00416}00416\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00417}00417\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00418}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abbae020d46c74708a7974c1ca755bb62}{00418}}\ \ \ \ \ std::vector<double>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a493224656aa3ade68389250720ef09af}{Composition::setMassFraction}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00419}00419\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<atomic::Species>\ \&species,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00420}00420\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<double>\ \&mass\_fractions}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00421}00421\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00422}00422\ \ \ \ \ \ \ \ \ std::vector<std::string>\ symbols;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00423}00423\ \ \ \ \ \ \ \ \ symbols.reserve(species.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00424}00424\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ s\ :\ species)\ symbols.emplace\_back(s.name());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00425}00425\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a493224656aa3ade68389250720ef09af}{setMassFraction}}(symbols,\ mass\_fractions);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00426}00426\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00427}00427\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00428}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aaa822bb48a948d101fef759ffbefe31b}{00428}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7d4d748f3ee25e68751fb143717ed080}{Composition::setNumberFraction}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00429}00429\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \&species,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00430}00430\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ \&number\_fraction}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00431}00431\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00432}00432\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7d4d748f3ee25e68751fb143717ed080}{setNumberFraction}}(std::string(species.\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species_a1fcc01fc978b34ba2531117f10be6741}{name}}()),\ number\_fraction);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00433}00433\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00434}00434\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00435}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_adc068778a1ef33cad67f5ca028b49bb8}{00435}}\ \ \ \ \ std::vector<double>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7d4d748f3ee25e68751fb143717ed080}{Composition::setNumberFraction}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00436}00436\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<atomic::Species>\ \&species,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00437}00437\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<double>\ \&number\_fractions}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00438}00438\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00439}00439\ \ \ \ \ \ \ \ \ std::vector<std::string>\ symbols;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00440}00440\ \ \ \ \ \ \ \ \ symbols.reserve(species.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00441}00441\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}(\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ s\ :\ species)\ symbols.push\_back(std::string(s.name()));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00442}00442\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7d4d748f3ee25e68751fb143717ed080}{setNumberFraction}}(symbols,\ number\_fractions);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00443}00443\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00444}00444\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00445}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a72d063a74a9d2197065884a2cea57a14}{00445}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a72d063a74a9d2197065884a2cea57a14}{Composition::finalize}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{bool}\ norm)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00446}00446\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_addae4484da7d5072ab66a721dbe04ced}{m\_specificNumberDensity}}\ =\ 0.0;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00447}00447\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4a36c8d22ce61023e7bea1d9417577d4}{m\_meanParticleMass}}\ =\ 0.0;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00448}00448\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}}\ =\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a671f1ee8be00f4ff8c1d94fabb382380}{m\_massFracMode}}\ ?\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a869dbae3db9d09c57b2df56a813a55fb}{finalizeMassFracMode}}(norm)\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a461ab4e9cb5975cf865db5f16f03ddfe}{finalizeNumberFracMode}}(norm);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00449}00449\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.clear();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00450}00450\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00451}00451\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00452}00452\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00453}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a869dbae3db9d09c57b2df56a813a55fb}{00453}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a869dbae3db9d09c57b2df56a813a55fb}{Composition::finalizeMassFracMode}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{bool}\ norm)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00454}00454\ \ \ \ \ \ \ \ \ std::vector<double>\ mass\_fractions;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00455}00455\ \ \ \ \ \ \ \ \ mass\_fractions.reserve(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00456}00456\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&entry:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::values)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00457}00457\ \ \ \ \ \ \ \ \ \ \ \ \ mass\_fractions.push\_back(entry.mass\_fraction());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00458}00458\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00459}00459\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00460}00460\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{double}\ sum\ =\ std::accumulate(mass\_fractions.begin(),\ mass\_fractions.end(),\ 0.0);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00461}00461\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (norm\ \&\&\ sum\ >\ 0)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00462}00462\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{auto}\&\ [symbol,\ entry]\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00463}00463\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a493224656aa3ade68389250720ef09af}{setMassFraction}}(symbol,\ entry.mass\_fraction()\ /\ sum);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00464}00464\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00465}00465\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Recalculate\ fractions\ vector\ after\ normalization\ for\ validation}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00466}00466\ \ \ \ \ \ \ \ \ \ \ \ \ mass\_fractions.clear();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00467}00467\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&entry:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::values)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00468}00468\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ mass\_fractions.push\_back(entry.mass\_fraction());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00469}00469\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00470}00470\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00471}00471\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00472}00472\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{try}\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00473}00473\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a86982685c34db4a8f079ddafc25c594e}{validateComposition}}(mass\_fractions);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00474}00474\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{catch}\ ([[maybe\_unused]]\ \textcolor{keyword}{const}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions::InvalidCompositionError}}\&\ e)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00475}00475\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ is\ invalid\ after\ mass\ frac\ finalization\ (Total\ mass\ \{\})."{}},\ sum);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00476}00476\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00477}00477\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00478}00478\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00479}00479\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&entry:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::values)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00480}00480\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_addae4484da7d5072ab66a721dbe04ced}{m\_specificNumberDensity}}\ +=\ entry.rel\_abundance();\ \textcolor{comment}{//\ rel\_abundance\ is\ now\ consistently\ moles/mass}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00481}00481\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00482}00482\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00483}00483\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_addae4484da7d5072ab66a721dbe04ced}{m\_specificNumberDensity}}\ >\ 0)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00484}00484\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4a36c8d22ce61023e7bea1d9417577d4}{m\_meanParticleMass}}\ =\ 1.0\ /\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_addae4484da7d5072ab66a721dbe04ced}{m\_specificNumberDensity}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00485}00485\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00486}00486\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00487}00487\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00488}00488\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00489}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a461ab4e9cb5975cf865db5f16f03ddfe}{00489}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a461ab4e9cb5975cf865db5f16f03ddfe}{Composition::finalizeNumberFracMode}}(\textcolor{keyword}{const}\ \textcolor{keywordtype}{bool}\ norm)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00490}00490\ \ \ \ \ \ \ \ \ std::vector<double>\ number\_fractions;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00491}00491\ \ \ \ \ \ \ \ \ number\_fractions.reserve(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00492}00492\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&entry:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::values)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00493}00493\ \ \ \ \ \ \ \ \ \ \ \ \ number\_fractions.push\_back(entry.number\_fraction());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00494}00494\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00495}00495\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00496}00496\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{double}\ sum\ =\ std::accumulate(number\_fractions.begin(),\ number\_fractions.end(),\ 0.0);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00497}00497\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (norm\ \&\&\ sum\ >\ 0)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00498}00498\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{auto}\&\ [symbol,\ entry]\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00499}00499\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7d4d748f3ee25e68751fb143717ed080}{setNumberFraction}}(symbol,\ entry.number\_fraction()\ /\ sum);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00500}00500\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00501}00501\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Recalculate\ fractions\ vector\ after\ normalization\ for\ validation}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00502}00502\ \ \ \ \ \ \ \ \ \ \ \ \ number\_fractions.clear();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00503}00503\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&entry:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::values)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00504}00504\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ number\_fractions.push\_back(entry.number\_fraction());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00505}00505\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00506}00506\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00507}00507\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00508}00508\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{try}\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00509}00509\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a86982685c34db4a8f079ddafc25c594e}{validateComposition}}(number\_fractions);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00510}00510\ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{catch}\ ([[maybe\_unused]]\ \textcolor{keyword}{const}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions::InvalidCompositionError}}\&\ e)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00511}00511\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ is\ invalid\ after\ number\ frac\ finalization\ (Total\ number\ frac\ \{\})."{}},\ sum);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00512}00512\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00513}00513\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00514}00514\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00515}00515\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Calculate\ mean\ particle\ mass\ <A>\ =\ sum(n\_i\ *\ A\_i)}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00516}00516\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&entry:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::values)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00517}00517\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4a36c8d22ce61023e7bea1d9417577d4}{m\_meanParticleMass}}\ +=\ entry.number\_fraction()\ *\ entry.isotope().mass();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00518}00518\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00519}00519\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00520}00520\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{auto}\ \&entry:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::values)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00521}00521\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ X\_i\ =\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4a36c8d22ce61023e7bea1d9417577d4}{m\_meanParticleMass}}\ >\ 0)\ ?\ (entry.number\_fraction()\ *\ entry.isotope().mass()\ /\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4a36c8d22ce61023e7bea1d9417577d4}{m\_meanParticleMass}})\ :\ 0.0;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00522}00522\ \ \ \ \ \ \ \ \ \ \ \ \ entry.m\_massFracMode\ =\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00523}00523\ \ \ \ \ \ \ \ \ \ \ \ \ entry.setMassFraction(X\_i);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00524}00524\ \ \ \ \ \ \ \ \ \ \ \ \ entry.m\_massFracMode\ =\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00525}00525\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00526}00526\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00527}00527\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4a36c8d22ce61023e7bea1d9417577d4}{m\_meanParticleMass}}\ >\ 0)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00528}00528\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_addae4484da7d5072ab66a721dbe04ced}{m\_specificNumberDensity}}\ =\ 1.0\ /\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4a36c8d22ce61023e7bea1d9417577d4}{m\_meanParticleMass}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00529}00529\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00530}00530\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00531}00531\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00532}00532\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00533}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3aead72892606725a4149a5f65bd31ec}{00533}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3aead72892606725a4149a5f65bd31ec}{Composition::mix}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\&\ other,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ fraction)\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00534}00534\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}}\ ||\ !other.\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00535}00535\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Compositions\ have\ not\ both\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()\ on\ both\ compositions\ before\ mixing."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00536}00536\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error}{exceptions::CompositionNotFinalizedError}}(\textcolor{stringliteral}{"{}Compositions\ have\ not\ been\ finalized\ (Hint:\ Consider\ running\ .finalize()\ on\ both\ compositions\ before\ mixing)."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00537}00537\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00538}00538\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00539}00539\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (fraction\ <\ 0.0\ ||\ fraction\ >\ 1.0)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00540}00540\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Mixing\ fraction\ must\ be\ between\ 0\ and\ 1.\ Currently\ it\ is\ \{\}."{}},\ fraction);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00541}00541\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions::InvalidCompositionError}}(\textcolor{stringliteral}{"{}Mixing\ fraction\ must\ be\ between\ 0\ and\ 1.\ Currently\ it\ is\ "{}}\ +\ std::to\_string(fraction)\ +\ \textcolor{stringliteral}{"{}."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00542}00542\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00543}00543\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00544}00544\ \ \ \ \ \ \ \ \ std::set<std::string>\ mixedSymbols\ =\ other.\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3f10f38878ba4be121d6d77a8b1f4d7a}{getRegisteredSymbols}}();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00545}00545\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Get\ the\ union\ of\ the\ two\ sets\ of\ symbols\ to\ ensure\ all\ species\ are\ included\ in\ the\ new\ composition.}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00546}00546\ \ \ \ \ \ \ \ \ mixedSymbols.insert(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a39bfcb7d81d723cbd9d021abd533b4d6}{m\_registeredSymbols}}.begin(),\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a39bfcb7d81d723cbd9d021abd533b4d6}{m\_registeredSymbols}}.end());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00547}00547\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00548}00548\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ mixedComposition(mixedSymbols);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00549}00549\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ symbol\ :\ mixedSymbols)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00550}00550\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{double}\ otherMassFrac\ =\ 0.0;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00551}00551\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00552}00552\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ thisMassFrac\ =\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ac01ae1967c266d8187bc6e104c8a0d19}{hasSymbol}}(symbol)\ ?\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aae07019ab6e02394e6ea353e0b98a417}{getMassFraction}}(symbol)\ :\ 0.0;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00553}00553\ \ \ \ \ \ \ \ \ \ \ \ \ otherMassFrac\ =\ other.\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ac01ae1967c266d8187bc6e104c8a0d19}{hasSymbol}}(symbol)\ ?\ other.\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aae07019ab6e02394e6ea353e0b98a417}{getMassFraction}}(symbol)\ :\ 0.0;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00554}00554\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00555}00555\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ The\ mixing\ formula\ is\ a\ linear\ interpolation\ of\ mass\ fractions.}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00556}00556\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{double}\ massFraction\ =\ fraction\ *\ thisMassFrac\ +\ otherMassFrac\ *\ (1-\/fraction);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00557}00557\ \ \ \ \ \ \ \ \ \ \ \ \ mixedComposition.\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a493224656aa3ade68389250720ef09af}{setMassFraction}}(symbol,\ massFraction);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00558}00558\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00559}00559\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\textcolor{keyword}{const}\ \textcolor{keywordtype}{bool}\ didFinalize\ =\ mixedComposition.\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a72d063a74a9d2197065884a2cea57a14}{finalize}}();\ !didFinalize)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00560}00560\ \ \ \ \ \ \ \ \ \ \ \ \ std::string\ msg\ =\ \textcolor{stringliteral}{"{}Failed\ to\ finalize\ mixed\ composition.\ "{}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00561}00561\ \ \ \ \ \ \ \ \ \ \ \ \ msg\ +=\ \textcolor{stringliteral}{"{}This\ likely\ indicates\ an\ issue\ with\ the\ input\ compositions\ not\ summing\ to\ 1.\(\backslash\)n"{}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00562}00562\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_CRITICAL(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}\{\}"{}},\ msg);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00563}00563\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions::InvalidCompositionError}}(msg);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00564}00564\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00565}00565\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ mixedComposition;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00566}00566\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00567}00567\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00568}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae5d8d21632fca2b35b0898f2b205cd10}{00568}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aae07019ab6e02394e6ea353e0b98a417}{Composition::getMassFraction}}(\textcolor{keyword}{const}\ std::string\&\ symbol)\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00569}00569\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00570}00570\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00571}00571\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error}{exceptions::CompositionNotFinalizedError}}(\textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00572}00572\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00573}00573\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.contains(symbol))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00574}00574\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Symbol\ \{\}\ is\ not\ in\ the\ composition."{}},\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00575}00575\ \ \ \ \ \ \ \ \ \ \ \ \ std::string\ currentSymbols;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00576}00576\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ count\ =\ 0;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00577}00577\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ sym\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::keys)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00578}00578\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ currentSymbols\ +=\ sym;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00579}00579\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (count\ <\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.size()\ -\/\ 2)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00580}00580\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ currentSymbols\ +=\ \textcolor{stringliteral}{"{},\ "{}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00581}00581\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (count\ ==\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.size()\ -\/\ 2)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00582}00582\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ currentSymbols\ +=\ \textcolor{stringliteral}{"{},\ and\ "{}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00583}00583\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00584}00584\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ count++;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00585}00585\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00586}00586\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions::UnregisteredSymbolError}}(\textcolor{stringliteral}{"{}Symbol("{}}\ +\ symbol\ +\ \textcolor{stringliteral}{"{})\ is\ not\ in\ the\ current\ composition.\ Current\ composition\ has\ symbols:\ "{}}\ +\ currentSymbols\ +\ \textcolor{stringliteral}{"{}."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00587}00587\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00588}00588\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a671f1ee8be00f4ff8c1d94fabb382380}{m\_massFracMode}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00589}00589\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.at(symbol).mass\_fraction();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00590}00590\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00591}00591\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00592}00592\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.at(symbol).mass\_fraction();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00593}00593\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00594}00594\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00595}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aeae9d6d3f742cd8b59b58abcb228a44d}{00595}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aae07019ab6e02394e6ea353e0b98a417}{Composition::getMassFraction}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00596}00596\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \&species}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00597}00597\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00598}00598\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aae07019ab6e02394e6ea353e0b98a417}{getMassFraction}}(std::string(species.\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species_a1fcc01fc978b34ba2531117f10be6741}{name}}()));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00599}00599\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00600}00600\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00601}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aae07019ab6e02394e6ea353e0b98a417}{00601}}\ \ \ \ \ std::unordered\_map<std::string,\ double>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aae07019ab6e02394e6ea353e0b98a417}{Composition::getMassFraction}}()\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00602}00602\ \ \ \ \ \ \ \ \ std::unordered\_map<std::string,\ double>\ mass\_fractions;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00603}00603\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&symbol:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::keys)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00604}00604\ \ \ \ \ \ \ \ \ \ \ \ \ mass\_fractions[symbol]\ =\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aae07019ab6e02394e6ea353e0b98a417}{getMassFraction}}(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00605}00605\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00606}00606\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ mass\_fractions;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00607}00607\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00608}00608\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00609}00609\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00610}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a34f71d4d8f0297c576fd62fabd490305}{00610}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae46fb8c3020dadd69080a7acd2054ea1}{Composition::getNumberFraction}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00611}00611\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\&\ symbol}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00612}00612\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00613}00613\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00614}00614\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00615}00615\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error}{exceptions::CompositionNotFinalizedError}}(\textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00616}00616\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00617}00617\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.contains(symbol))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00618}00618\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Symbol\ \{\}\ is\ not\ in\ the\ composition."{}},\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00619}00619\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error}{exceptions::CompositionNotFinalizedError}}(\textcolor{stringliteral}{"{}Symbol\ "{}}\ +\ symbol\ +\ \textcolor{stringliteral}{"{}\ is\ not\ in\ the\ composition."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00620}00620\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00621}00621\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a671f1ee8be00f4ff8c1d94fabb382380}{m\_massFracMode}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00622}00622\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.at(symbol).number\_fraction();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00623}00623\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00624}00624\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.at(symbol).number\_fraction(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_addae4484da7d5072ab66a721dbe04ced}{m\_specificNumberDensity}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00625}00625\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00626}00626\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00627}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a178d7393ee8b5d496925dcd901c03d23}{00627}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae46fb8c3020dadd69080a7acd2054ea1}{Composition::getNumberFraction}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00628}00628\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \&species}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00629}00629\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00630}00630\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae46fb8c3020dadd69080a7acd2054ea1}{getNumberFraction}}(std::string(species.\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species_a1fcc01fc978b34ba2531117f10be6741}{name}}()));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00631}00631\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00632}00632\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00633}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae46fb8c3020dadd69080a7acd2054ea1}{00633}}\ \ \ \ \ std::unordered\_map<std::string,\ double>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae46fb8c3020dadd69080a7acd2054ea1}{Composition::getNumberFraction}}()\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00634}00634\ \ \ \ \ \ \ \ \ std::unordered\_map<std::string,\ double>\ number\_fractions;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00635}00635\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&symbol:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::keys)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00636}00636\ \ \ \ \ \ \ \ \ \ \ \ \ number\_fractions[symbol]\ =\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae46fb8c3020dadd69080a7acd2054ea1}{getNumberFraction}}(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00637}00637\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00638}00638\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ number\_fractions;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00639}00639\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00640}00640\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00641}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_add67a92d73e3a57a2bbdb52bc9ca3bfe}{00641}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_add67a92d73e3a57a2bbdb52bc9ca3bfe}{Composition::getMolarAbundance}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00642}00642\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&symbol}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00643}00643\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00644}00644\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00645}00645\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00646}00646\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error}{exceptions::CompositionNotFinalizedError}}(\textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00647}00647\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00648}00648\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.contains(symbol))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00649}00649\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Symbol\ \{\}\ is\ not\ in\ the\ composition."{}},\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00650}00650\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions::UnregisteredSymbolError}}(\textcolor{stringliteral}{"{}Symbol\ "{}}\ +\ symbol\ +\ \textcolor{stringliteral}{"{}\ is\ not\ in\ the\ composition."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00651}00651\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00652}00652\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aae07019ab6e02394e6ea353e0b98a417}{getMassFraction}}(symbol)\ /\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.at(symbol).isotope().mass();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00653}00653\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00654}00654\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00655}00655\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00656}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a28c70279d36826e0e1026da3fa892ffc}{00656}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_add67a92d73e3a57a2bbdb52bc9ca3bfe}{Composition::getMolarAbundance}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00657}00657\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \&species}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00658}00658\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00659}00659\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_add67a92d73e3a57a2bbdb52bc9ca3bfe}{getMolarAbundance}}(std::string(species.\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species_a1fcc01fc978b34ba2531117f10be6741}{name}}()));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00660}00660\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00661}00661\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00662}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a092d3536b04167ea2e6e3a3b1446c377}{00662}}\ \ \ \ \ std::pair<CompositionEntry,\ GlobalComposition>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1138c86f7ccd39594601c2ec63ad89e9}{Composition::getComposition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00663}00663\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\&\ symbol}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00664}00664\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00665}00665\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00666}00666\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00667}00667\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error}{exceptions::CompositionNotFinalizedError}}(\textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00668}00668\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00669}00669\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.contains(symbol))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00670}00670\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Symbol\ \{\}\ is\ not\ in\ the\ composition."{}},\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00671}00671\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions::UnregisteredSymbolError}}(\textcolor{stringliteral}{"{}Symbol\ "{}}\ +\ symbol\ +\ \textcolor{stringliteral}{"{}\ is\ not\ in\ the\ composition."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00672}00672\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00673}00673\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.at(symbol),\ \{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_addae4484da7d5072ab66a721dbe04ced}{m\_specificNumberDensity}},\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4a36c8d22ce61023e7bea1d9417577d4}{m\_meanParticleMass}}\}\};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00674}00674\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00675}00675\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00676}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_afe5f1086027044c84ff35a366b2e8e2d}{00676}}\ \ \ \ \ std::pair<CompositionEntry,\ GlobalComposition>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1138c86f7ccd39594601c2ec63ad89e9}{Composition::getComposition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00677}00677\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \&species}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00678}00678\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00679}00679\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1138c86f7ccd39594601c2ec63ad89e9}{getComposition}}(std::string(species.\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species_a1fcc01fc978b34ba2531117f10be6741}{name}}()));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00680}00680\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00681}00681\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00682}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1138c86f7ccd39594601c2ec63ad89e9}{00682}}\ \ \ \ \ std::pair<std::unordered\_map<std::string,\ CompositionEntry>,\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_global_composition}{GlobalComposition}}>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1138c86f7ccd39594601c2ec63ad89e9}{Composition::getComposition}}()\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00683}00683\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00684}00684\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00685}00685\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error}{exceptions::CompositionNotFinalizedError}}(\textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00686}00686\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00687}00687\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}},\ \{\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_addae4484da7d5072ab66a721dbe04ced}{m\_specificNumberDensity}},\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4a36c8d22ce61023e7bea1d9417577d4}{m\_meanParticleMass}}\}\};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00688}00688\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00689}00689\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00690}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a796386824d1358527fed7c6b537935d8}{00690}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a796386824d1358527fed7c6b537935d8}{Composition::getMeanParticleMass}}()\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00691}00691\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00692}00692\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00693}00693\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error}{exceptions::CompositionNotFinalizedError}}(\textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00694}00694\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00695}00695\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4a36c8d22ce61023e7bea1d9417577d4}{m\_meanParticleMass}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00696}00696\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00697}00697\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00698}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_af7dd8f7d69727acfacf1bf58c4083a27}{00698}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_af7dd8f7d69727acfacf1bf58c4083a27}{Composition::getMeanAtomicNumber}}()\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00699}00699\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00700}00700\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ must\ be\ finalized\ before\ getting\ the\ mean\ atomic\ mass\ number.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00701}00701\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error}{exceptions::CompositionNotFinalizedError}}(\textcolor{stringliteral}{"{}Composition\ not\ finalized.\ Cannot\ retrieve\ mean\ atomic\ mass\ number.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00702}00702\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00703}00703\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00704}00704\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{double}\ zSum\ =\ 0.0;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00705}00705\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00706}00706\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&val:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::values)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00707}00707\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Sum\ of\ (X\_i\ *\ Z\_i\ /\ A\_i)}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00708}00708\ \ \ \ \ \ \ \ \ \ \ \ \ zSum\ +=\ (val.mass\_fraction()\ *\ val.m\_isotope.z())/val.m\_isotope.a();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00709}00709\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00710}00710\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00711}00711\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ <Z>\ =\ <A>\ *\ sum(X\_i\ *\ Z\_i\ /\ A\_i)}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00712}00712\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ mean\_A\ =\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4a36c8d22ce61023e7bea1d9417577d4}{m\_meanParticleMass}}\ *\ zSum;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00713}00713\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ mean\_A;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00714}00714\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00715}00715\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00716}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a62dcfcf8f824d6af7903a9a9c3d5721e}{00716}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a62dcfcf8f824d6af7903a9a9c3d5721e}{Composition::getElectronAbundance}}()\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00717}00717\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00718}00718\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ must\ be\ finalized\ before\ getting\ the\ electron\ abundance.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00719}00719\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error}{exceptions::CompositionNotFinalizedError}}(\textcolor{stringliteral}{"{}Composition\ not\ finalized.\ Cannot\ retrieve\ electron\ abundance.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00720}00720\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00721}00721\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00722}00722\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.Ye.has\_value())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00723}00723\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.Ye.value();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00724}00724\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00725}00725\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00726}00726\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{double}\ Ye\ =\ 0.0;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00727}00727\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&val:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::values)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00728}00728\ \ \ \ \ \ \ \ \ \ \ \ \ Ye\ +=\ (val.mass\_fraction()\ *\ val.m\_isotope.z())/val.m\_isotope.a();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00729}00729\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00730}00730\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.Ye\ =\ Ye;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00731}00731\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ Ye;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00732}00732\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00733}00733\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00734}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a17635cd21744c7cf86cb1eb75152c816}{00734}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a17635cd21744c7cf86cb1eb75152c816}{Composition::subset}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00735}00735\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<std::string>\&\ symbols,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00736}00736\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\&\ method}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00737}00737\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00738}00738\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\textcolor{keyword}{const}\ std::array<std::string,\ 2>\ methods\ =\ \{\textcolor{stringliteral}{"{}norm"{}},\ \textcolor{stringliteral}{"{}none"{}}\};\ std::ranges::find(methods,\ method)\ ==\ methods.end())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00739}00739\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\ errorMessage\ =\ \textcolor{stringliteral}{"{}Invalid\ method:\ "{}}\ +\ method\ +\ \textcolor{stringliteral}{"{}.\ Valid\ methods\ are\ 'norm'\ and\ 'none'."{}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00740}00740\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Invalid\ method:\ \{\}.\ Valid\ methods\ are\ norm\ and\ none."{}},\ method);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00741}00741\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_mixing_mode}{exceptions::InvalidMixingMode}}(errorMessage);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00742}00742\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00743}00743\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00744}00744\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ subsetComposition;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00745}00745\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ symbol\ :\ symbols)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00746}00746\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.contains(symbol))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00747}00747\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Symbol\ \{\}\ is\ not\ in\ the\ composition."{}},\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00748}00748\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions::UnregisteredSymbolError}}(\textcolor{stringliteral}{"{}Symbol\ "{}}\ +\ symbol\ +\ \textcolor{stringliteral}{"{}\ is\ not\ in\ the\ composition."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00749}00749\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00750}00750\ \ \ \ \ \ \ \ \ \ \ \ \ subsetComposition.\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1bc2e64f87c12befdc2bc767e7405661}{registerSymbol}}(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00751}00751\ \ \ \ \ \ \ \ \ \ \ \ \ subsetComposition.\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a493224656aa3ade68389250720ef09af}{setMassFraction}}(symbol,\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.at(symbol).mass\_fraction());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00752}00752\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00753}00753\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (method\ ==\ \textcolor{stringliteral}{"{}norm"{}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00754}00754\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\textcolor{keyword}{const}\ \textcolor{keywordtype}{bool}\ isNorm\ =\ subsetComposition.\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a72d063a74a9d2197065884a2cea57a14}{finalize}}(\textcolor{keyword}{true});\ !isNorm)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00755}00755\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Subset\ composition\ is\ invalid.\ (Unable\ to\ finalize\ with\ normalization)."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00756}00756\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_failed_to_finalize_composition_error}{exceptions::FailedToFinalizeCompositionError}}(\textcolor{stringliteral}{"{}Subset\ composition\ is\ invalid.\ (Unable\ to\ finalize\ with\ normalization)."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00757}00757\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00758}00758\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00759}00759\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ subsetComposition;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00760}00760\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00761}00761\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00762}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a0af981ed1074b26c237cf6cf35f82c9e}{00762}}\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a0af981ed1074b26c237cf6cf35f82c9e}{Composition::setCompositionMode}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00763}00763\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{bool}\ massFracMode}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00764}00764\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00765}00765\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00766}00766\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Mode\ cannot\ be\ set\ unless\ composition\ is\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00767}00767\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error}{exceptions::CompositionNotFinalizedError}}(\textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Mode\ cannot\ be\ set\ unless\ composition\ is\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00768}00768\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00769}00769\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00770}00770\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{bool}\ okay;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00771}00771\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{auto}\ \&entry:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::values)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00772}00772\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (massFracMode)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00773}00773\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ okay\ =\ entry.setMassFracMode(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4a36c8d22ce61023e7bea1d9417577d4}{m\_meanParticleMass}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00774}00774\ \ \ \ \ \ \ \ \ \ \ \ \ \}\ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00775}00775\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ okay\ =\ entry.setNumberFracMode(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_addae4484da7d5072ab66a721dbe04ced}{m\_specificNumberDensity}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00776}00776\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00777}00777\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!okay)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00778}00778\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ mode\ could\ not\ be\ set\ due\ to\ some\ unknown\ error."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00779}00779\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::runtime\_error(\textcolor{stringliteral}{"{}Composition\ mode\ could\ not\ be\ set\ due\ to\ an\ unknown\ error."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00780}00780\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00781}00781\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00782}00782\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a671f1ee8be00f4ff8c1d94fabb382380}{m\_massFracMode}}\ =\ massFracMode;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00783}00783\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00784}00784\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00785}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ac75dbc8377556c835455991c7c7fe206}{00785}}\ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition}{CanonicalComposition}}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ac75dbc8377556c835455991c7c7fe206}{Composition::getCanonicalComposition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00786}00786\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{bool}\ harsh}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00787}00787\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00788}00788\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00789}00789\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00790}00790\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error}{exceptions::CompositionNotFinalizedError}}(\textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00791}00791\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00792}00792\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.canonicalComp.has\_value())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00793}00793\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.canonicalComp.value();\ \textcolor{comment}{//\ Short\ circuit\ if\ we\ have\ cached\ the\ canonical\ composition}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00794}00794\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00795}00795\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition}{CanonicalComposition}}\ canonicalComposition;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00796}00796\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::array<std::string,\ 7>\ canonicalH\ =\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00797}00797\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}H-\/1"{}},\ \textcolor{stringliteral}{"{}H-\/2"{}},\ \textcolor{stringliteral}{"{}H-\/3"{}},\ \textcolor{stringliteral}{"{}H-\/4"{}},\ \textcolor{stringliteral}{"{}H-\/5"{}},\ \textcolor{stringliteral}{"{}H-\/6"{}},\ \textcolor{stringliteral}{"{}H-\/7"{}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00798}00798\ \ \ \ \ \ \ \ \ \};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00799}00799\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::array<std::string,\ 8>\ canonicalHe\ =\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00800}00800\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{stringliteral}{"{}He-\/3"{}},\ \textcolor{stringliteral}{"{}He-\/4"{}},\ \textcolor{stringliteral}{"{}He-\/5"{}},\ \textcolor{stringliteral}{"{}He-\/6"{}},\ \textcolor{stringliteral}{"{}He-\/7"{}},\ \textcolor{stringliteral}{"{}He-\/8"{}},\ \textcolor{stringliteral}{"{}He-\/9"{}},\ \textcolor{stringliteral}{"{}He-\/10"{}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00801}00801\ \ \ \ \ \ \ \ \ \};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00802}00802\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ symbol\ :\ canonicalH)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00803}00803\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ac01ae1967c266d8187bc6e104c8a0d19}{hasSymbol}}(symbol))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00804}00804\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ canonicalComposition.\mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition_abe5b01574242f8eaabd00c3d653291f7}{X}}\ +=\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aae07019ab6e02394e6ea353e0b98a417}{getMassFraction}}(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00805}00805\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00806}00806\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00807}00807\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ symbol\ :\ canonicalHe)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00808}00808\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ac01ae1967c266d8187bc6e104c8a0d19}{hasSymbol}}(symbol))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00809}00809\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ canonicalComposition.\mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition_a93927bfccc5d2b3906565d092ed4f7f4}{Y}}\ +=\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aae07019ab6e02394e6ea353e0b98a417}{getMassFraction}}(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00810}00810\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00811}00811\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00812}00812\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00813}00813\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ symbol\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3f10f38878ba4be121d6d77a8b1f4d7a}{getRegisteredSymbols}}())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00814}00814\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{bool}\ isHSymbol\ =\ std::ranges::find(canonicalH,\ symbol)\ !=\ std::end(canonicalH);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00815}00815\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ ReSharper\ disable\ once\ CppTooWideScopeInitStatement}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00816}00816\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{bool}\ isHeSymbol\ =\ std::ranges::find(canonicalHe,\ symbol)\ !=\ std::end(canonicalHe);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00817}00817\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00818}00818\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (isHSymbol\ ||\ isHeSymbol)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00819}00819\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{continue};\ \textcolor{comment}{//\ Skip\ canonical\ H\ and\ He\ symbols}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00820}00820\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00821}00821\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00822}00822\ \ \ \ \ \ \ \ \ \ \ \ \ canonicalComposition.\mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition_ae1981f5ddd36abd17a4a69fa1f43de18}{Z}}\ +=\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aae07019ab6e02394e6ea353e0b98a417}{getMassFraction}}(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00823}00823\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00824}00824\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00825}00825\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ ReSharper\ disable\ once\ CppTooWideScopeInitStatement}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00826}00826\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ Z\ =\ 1.0\ -\/\ (canonicalComposition.\mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition_abe5b01574242f8eaabd00c3d653291f7}{X}}\ +\ canonicalComposition.\mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition_a93927bfccc5d2b3906565d092ed4f7f4}{Y}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00827}00827\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (std::abs(Z\ -\/\ canonicalComposition.\mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition_ae1981f5ddd36abd17a4a69fa1f43de18}{Z}})\ >\ 1e-\/6)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00828}00828\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!harsh)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00829}00829\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_WARNING(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Validation\ composition\ Z\ (X-\/Y\ =\ \{\})\ is\ different\ than\ canonical\ composition\ Z\ (\{\})\ (∑a\_i\ where\ a\_i\ !=\ H/He)."{}},\ Z,\ canonicalComposition.\mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition_ae1981f5ddd36abd17a4a69fa1f43de18}{Z}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00830}00830\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00831}00831\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{else}\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00832}00832\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Validation\ composition\ Z\ (X-\/Y\ =\ \{\})\ is\ different\ than\ canonical\ composition\ Z\ (\{\})\ (∑a\_i\ where\ a\_i\ !=\ H/He)."{}},\ Z,\ canonicalComposition.\mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition_ae1981f5ddd36abd17a4a69fa1f43de18}{Z}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00833}00833\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::runtime\_error(\textcolor{stringliteral}{"{}Validation\ composition\ Z\ (X-\/Y\ =\ "{}}\ +\ std::to\_string(Z)\ +\ \textcolor{stringliteral}{"{})\ is\ different\ than\ canonical\ composition\ Z\ ("{}}\ +\ std::to\_string(canonicalComposition.\mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition_ae1981f5ddd36abd17a4a69fa1f43de18}{Z}})\ +\ \textcolor{stringliteral}{"{})\ (∑a\_i\ where\ a\_i\ !=\ H/He)."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00834}00834\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00835}00835\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00836}00836\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.canonicalComp\ =\ canonicalComposition;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00837}00837\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ canonicalComposition;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00838}00838\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00839}00839\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00840}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a85169b763138ab72047e43e07af978fb}{00840}}\ \ \ \ \ std::vector<double>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a85169b763138ab72047e43e07af978fb}{Composition::getMassFractionVector}}()\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00841}00841\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00842}00842\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00843}00843\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error}{exceptions::CompositionNotFinalizedError}}(\textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00844}00844\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00845}00845\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.massFractions.has\_value())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00846}00846\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.massFractions.value();\ \textcolor{comment}{//\ Short\ circuit\ if\ we\ have\ cached\ the\ mass\ fractions}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00847}00847\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00848}00848\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00849}00849\ \ \ \ \ \ \ \ \ std::vector<double>\ massFractionVector;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00850}00850\ \ \ \ \ \ \ \ \ std::vector<double>\ speciesMass;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00851}00851\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00852}00852\ \ \ \ \ \ \ \ \ massFractionVector.reserve(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00853}00853\ \ \ \ \ \ \ \ \ speciesMass.reserve(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00854}00854\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00855}00855\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&entry:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::values)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00856}00856\ \ \ \ \ \ \ \ \ \ \ \ \ massFractionVector.push\_back(entry.mass\_fraction());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00857}00857\ \ \ \ \ \ \ \ \ \ \ \ \ speciesMass.push\_back(entry.isotope().mass());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00858}00858\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00859}00859\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00860}00860\ \ \ \ \ \ \ \ \ std::vector<double>\ massFractions\ =\ sortVectorBy(massFractionVector,\ speciesMass);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00861}00861\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.massFractions\ =\ massFractions;\ \textcolor{comment}{//\ Cache\ the\ result}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00862}00862\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ massFractions;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00863}00863\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00864}00864\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00865}00865\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00866}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a49d2eba540f28324c6b7145a5b6cabfd}{00866}}\ \ \ \ \ std::vector<double>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a49d2eba540f28324c6b7145a5b6cabfd}{Composition::getNumberFractionVector}}()\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00867}00867\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00868}00868\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00869}00869\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error}{exceptions::CompositionNotFinalizedError}}(\textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00870}00870\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00871}00871\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.numberFractions.has\_value())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00872}00872\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.numberFractions.value();\ \textcolor{comment}{//\ Short\ circuit\ if\ we\ have\ cached\ the\ number\ fractions}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00873}00873\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00874}00874\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00875}00875\ \ \ \ \ \ \ \ \ std::vector<double>\ numberFractionVector;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00876}00876\ \ \ \ \ \ \ \ \ std::vector<double>\ speciesMass;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00877}00877\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00878}00878\ \ \ \ \ \ \ \ \ numberFractionVector.reserve(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00879}00879\ \ \ \ \ \ \ \ \ speciesMass.reserve(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00880}00880\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00881}00881\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&entry:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::values)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00882}00882\ \ \ \ \ \ \ \ \ \ \ \ \ numberFractionVector.push\_back(entry.number\_fraction());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00883}00883\ \ \ \ \ \ \ \ \ \ \ \ \ speciesMass.push\_back(entry.isotope().mass());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00884}00884\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00885}00885\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00886}00886\ \ \ \ \ \ \ \ \ std::vector<double>\ numberFractions\ =\ sortVectorBy(numberFractionVector,\ speciesMass);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00887}00887\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.numberFractions\ =\ numberFractions;\ \textcolor{comment}{//\ Cache\ the\ result}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00888}00888\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ numberFractions;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00889}00889\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00890}00890\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00891}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abed665c07c42b40682da453576621399}{00891}}\ \ \ \ \ std::vector<double>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abed665c07c42b40682da453576621399}{Composition::getMolarAbundanceVector}}()\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00892}00892\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00893}00893\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00894}00894\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error}{exceptions::CompositionNotFinalizedError}}(\textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00895}00895\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00896}00896\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.molarAbundances.has\_value())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00897}00897\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.molarAbundances.value();\ \textcolor{comment}{//\ Short\ circuit\ if\ we\ have\ cached\ the\ molar\ abundances}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00898}00898\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00899}00899\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00900}00900\ \ \ \ \ \ \ \ \ std::vector<double>\ molarAbundanceVector;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00901}00901\ \ \ \ \ \ \ \ \ std::vector<double>\ speciesMass;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00902}00902\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00903}00903\ \ \ \ \ \ \ \ \ molarAbundanceVector.reserve(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00904}00904\ \ \ \ \ \ \ \ \ speciesMass.reserve(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00905}00905\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00906}00906\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&entry:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::values)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00907}00907\ \ \ \ \ \ \ \ \ \ \ \ \ molarAbundanceVector.push\_back(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_add67a92d73e3a57a2bbdb52bc9ca3bfe}{getMolarAbundance}}(entry.isotope()));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00908}00908\ \ \ \ \ \ \ \ \ \ \ \ \ speciesMass.push\_back(entry.isotope().mass());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00909}00909\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00910}00910\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00911}00911\ \ \ \ \ \ \ \ \ std::vector<double>\ molarAbundances\ =\ sortVectorBy(molarAbundanceVector,\ speciesMass);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00912}00912\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.molarAbundances\ =\ molarAbundances;\ \textcolor{comment}{//\ Cache\ the\ result}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00913}00913\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ molarAbundances;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00914}00914\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00915}00915\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00916}00916\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00917}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a0d94f62402bb90b5d12679faeaa8c5d7}{00917}}\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a0d94f62402bb90b5d12679faeaa8c5d7}{Composition::getSpeciesIndex}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00918}00918\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&symbol}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00919}00919\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00920}00920\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00921}00921\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00922}00922\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error}{exceptions::CompositionNotFinalizedError}}(\textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00923}00923\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00924}00924\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.contains(symbol))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00925}00925\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Symbol\ \{\}\ is\ not\ in\ the\ composition."{}},\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00926}00926\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions::UnregisteredSymbolError}}(\textcolor{stringliteral}{"{}Symbol\ "{}}\ +\ symbol\ +\ \textcolor{stringliteral}{"{}\ is\ not\ in\ the\ composition."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00927}00927\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00928}00928\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.sortedSymbols.has\_value())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00929}00929\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::distance(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00930}00930\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.sortedSymbols-\/>begin(),}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00931}00931\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::ranges::find(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00932}00932\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.sortedSymbols.value().begin(),}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00933}00933\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.sortedSymbols.value().end(),}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00934}00934\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ symbol}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00935}00935\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ )}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00936}00936\ \ \ \ \ \ \ \ \ \ \ \ \ );}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00937}00937\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00938}00938\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00939}00939\ \ \ \ \ \ \ \ \ std::vector<std::string>\ symbols;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00940}00940\ \ \ \ \ \ \ \ \ std::vector<double>\ speciesMass;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00941}00941\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00942}00942\ \ \ \ \ \ \ \ \ symbols.reserve(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00943}00943\ \ \ \ \ \ \ \ \ speciesMass.reserve(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00944}00944\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00945}00945\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&entry:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::values)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00946}00946\ \ \ \ \ \ \ \ \ \ \ \ \ symbols.emplace\_back(entry.isotope().name());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00947}00947\ \ \ \ \ \ \ \ \ \ \ \ \ speciesMass.push\_back(entry.isotope().mass());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00948}00948\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00949}00949\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00950}00950\ \ \ \ \ \ \ \ \ std::vector<std::string>\ sortedSymbols\ =\ sortVectorBy(symbols,\ speciesMass);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00951}00951\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.sortedSymbols\ =\ sortedSymbols;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00952}00952\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::distance(sortedSymbols.begin(),\ std::ranges::find(sortedSymbols,\ symbol));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00953}00953\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00954}00954\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00955}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3d220b42fa06d7d3a43944ee2b8f6a5f}{00955}}\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a0d94f62402bb90b5d12679faeaa8c5d7}{Composition::getSpeciesIndex}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00956}00956\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \&species}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00957}00957\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00958}00958\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00959}00959\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00960}00960\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error}{exceptions::CompositionNotFinalizedError}}(\textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00961}00961\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00962}00962\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.contains(\textcolor{keyword}{static\_cast<}std::string\textcolor{keyword}{>}(species.\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species_a1fcc01fc978b34ba2531117f10be6741}{name}}())))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00963}00963\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Species\ \{\}\ is\ not\ in\ the\ composition."{}},\ species.\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species_a1fcc01fc978b34ba2531117f10be6741}{name}}());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00964}00964\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{exceptions::UnregisteredSymbolError}}(\textcolor{stringliteral}{"{}Species\ "{}}\ +\ std::string(species.\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species_a1fcc01fc978b34ba2531117f10be6741}{name}}())\ +\ \textcolor{stringliteral}{"{}\ is\ not\ in\ the\ composition."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00965}00965\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00966}00966\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.sortedSpecies.has\_value())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00967}00967\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::distance(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00968}00968\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.sortedSpecies-\/>begin(),}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00969}00969\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ std::ranges::find(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00970}00970\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.sortedSpecies.value().begin(),}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00971}00971\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.sortedSpecies.value().end(),}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00972}00972\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ species}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00973}00973\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ )}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00974}00974\ \ \ \ \ \ \ \ \ \ \ \ \ );}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00975}00975\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00976}00976\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00977}00977\ \ \ \ \ \ \ \ \ std::vector<atomic::Species>\ speciesVector;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00978}00978\ \ \ \ \ \ \ \ \ std::vector<double>\ speciesMass;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00979}00979\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00980}00980\ \ \ \ \ \ \ \ \ speciesVector.reserve(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00981}00981\ \ \ \ \ \ \ \ \ speciesMass.reserve(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00982}00982\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00983}00983\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&entry:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::values)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00984}00984\ \ \ \ \ \ \ \ \ \ \ \ \ speciesVector.emplace\_back(entry.isotope());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00985}00985\ \ \ \ \ \ \ \ \ \ \ \ \ speciesMass.push\_back(entry.isotope().mass());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00986}00986\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00987}00987\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00988}00988\ \ \ \ \ \ \ \ \ std::vector<atomic::Species>\ sortedSpecies\ =\ sortVectorBy(speciesVector,\ speciesMass);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00989}00989\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.sortedSpecies\ =\ sortedSpecies;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00990}00990\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::distance(sortedSpecies.begin(),\ std::ranges::find(sortedSpecies,\ species));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00991}00991\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00992}00992\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00993}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae4f854ded38f5e6fcd157a74a57cbf0c}{00993}}\ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae4f854ded38f5e6fcd157a74a57cbf0c}{Composition::getSpeciesAtIndex}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00994}00994\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ index}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00995}00995\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00996}00996\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00997}00997\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00998}00998\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error}{exceptions::CompositionNotFinalizedError}}(\textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00999}00999\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01000}01000\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (index\ >=\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.size())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01001}01001\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Index\ \{\}\ is\ out\ of\ bounds\ for\ composition\ of\ size\ \{\}."{}},\ index,\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01002}01002\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::out\_of\_range(\textcolor{stringliteral}{"{}Index\ "{}}\ +\ std::to\_string(index)\ +\ \textcolor{stringliteral}{"{}\ is\ out\ of\ bounds\ for\ composition\ of\ size\ "{}}\ +\ std::to\_string(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.size())\ +\ \textcolor{stringliteral}{"{}."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01003}01003\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01004}01004\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.sortedSpecies.has\_value())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01005}01005\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.sortedSpecies.value().at(index);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01006}01006\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01007}01007\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01008}01008\ \ \ \ \ \ \ \ \ std::vector<atomic::Species>\ speciesVector;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01009}01009\ \ \ \ \ \ \ \ \ std::vector<double>\ speciesMass;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01010}01010\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01011}01011\ \ \ \ \ \ \ \ \ speciesVector.reserve(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01012}01012\ \ \ \ \ \ \ \ \ speciesMass.reserve(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01013}01013\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01014}01014\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&entry:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::values)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01015}01015\ \ \ \ \ \ \ \ \ \ \ \ \ speciesVector.emplace\_back(entry.isotope());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01016}01016\ \ \ \ \ \ \ \ \ \ \ \ \ speciesMass.push\_back(entry.isotope().mass());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01017}01017\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01018}01018\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01019}01019\ \ \ \ \ \ \ \ \ std::vector<atomic::Species>\ sortedSymbols\ =\ sortVectorBy(speciesVector,\ speciesMass);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01020}01020\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ sortedSymbols.at(index);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01021}01021\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01022}01022\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01023}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ac01ae1967c266d8187bc6e104c8a0d19}{01023}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ac01ae1967c266d8187bc6e104c8a0d19}{Composition::hasSymbol}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01024}01024\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\&\ symbol}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01025}01025\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01026}01026\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.contains(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01027}01027\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01028}01028\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01029}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a55dfadad6cf5fb249356edad1733a813}{01029}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a55dfadad6cf5fb249356edad1733a813}{Composition::hasSpecies}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{fourdst::atomic::Species}}\ \&species)\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01030}01030\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&entry:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}\ |\ std::views::values)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01031}01031\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (entry.isotope()\ ==\ species)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01032}01032\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01033}01033\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01034}01034\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01035}01035\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01036}01036\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01037}01037\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01038}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7efe2cd3a69b743bf2086941b6dfd965}{01038}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7efe2cd3a69b743bf2086941b6dfd965}{Composition::contains}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01039}01039\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \&isotope}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01040}01040\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01041}01041\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ Check\ if\ the\ isotope's\ symbol\ is\ in\ the\ composition}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01042}01042\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa00cbc0933d8a22bb900ac21a338e5ac}{m\_finalized}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01043}01043\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab6c66f35e1fb05dd24aacaf90e115c5e}{m\_logger}},\ \textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01044}01044\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error}{exceptions::CompositionNotFinalizedError}}(\textcolor{stringliteral}{"{}Composition\ has\ not\ been\ finalized.\ Hint:\ Consider\ running\ .finalize()."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01045}01045\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01046}01046\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ symbol\ =\ \textcolor{keyword}{static\_cast<}std::string\textcolor{keyword}{>}(isotope.\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species_a1fcc01fc978b34ba2531117f10be6741}{name}}());\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa7f2753b10e85ae3bbf0c3d600a973db}{m\_compositions}}.contains(symbol))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01047}01047\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{true};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01048}01048\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01049}01049\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{false};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01050}01050\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01051}01051\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01053}01053\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01054}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a24a3bdeb8e8e55b54ecdee6dcb0d9561}{01054}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a24a3bdeb8e8e55b54ecdee6dcb0d9561}{Composition::operator+}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01055}01055\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\&\ other}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01056}01056\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01057}01057\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3aead72892606725a4149a5f65bd31ec}{mix}}(other,\ 0.5);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01058}01058\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01059}01059\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01060}\mbox{\hyperlink{structfourdst_1_1composition_1_1_global_composition_a3c072a749c3648607771ac9105181f26}{01060}}\ \ \ \ \ std::ostream\&\ \mbox{\hyperlink{namespacefourdst_1_1composition_a8468dde1b148c0583b8a9f85b8d0ce9a}{operator<<}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01061}01061\ \ \ \ \ \ \ \ \ std::ostream\&\ os,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01062}01062\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_global_composition}{GlobalComposition}}\&\ comp}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01063}01063\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01064}01064\ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}Global\ Composition:\ \(\backslash\)n"{}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01065}01065\ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}\(\backslash\)tSpecific\ Number\ Density:\ "{}}\ <<\ comp.\mbox{\hyperlink{structfourdst_1_1composition_1_1_global_composition_a0df6ecfe28d13cbffd0abcbfec9aee41}{specificNumberDensity}}\ <<\ \textcolor{stringliteral}{"{}\(\backslash\)n"{}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01066}01066\ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}\(\backslash\)tMean\ Particle\ Mass:\ "{}}\ <<\ comp.\mbox{\hyperlink{structfourdst_1_1composition_1_1_global_composition_a9c35810d965841a755da9ce4644a2f1b}{meanParticleMass}}\ <<\ \textcolor{stringliteral}{"{}\(\backslash\)n"{}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01067}01067\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ os;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01068}01068\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01069}01069\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01070}\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_ae7a6a113fc5914248eff5629716d6eb2}{01070}}\ \ \ \ \ std::ostream\&\ \mbox{\hyperlink{namespacefourdst_1_1composition_a8468dde1b148c0583b8a9f85b8d0ce9a}{operator<<}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01071}01071\ \ \ \ \ \ \ \ \ std::ostream\&\ os,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01072}01072\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a1cccb94c150dd1dcde860f55fbeaf2bd}{CompositionEntry}}\&\ entry}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01073}01073\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01074}01074\ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}<"{}}\ <<\ entry.\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_ac273debdba6a1b3ac0f11698c399d38e}{m\_symbol}}\ <<\ \textcolor{stringliteral}{"{}\ :\ m\_frac\ =\ "{}}\ <<\ entry.\mbox{\hyperlink{structfourdst_1_1composition_1_1_composition_entry_a66cb086719d7f654869bd7b0cee87ffc}{mass\_fraction}}()\ <<\ \textcolor{stringliteral}{"{}>"{}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01075}01075\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ os;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01076}01076\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01077}01077\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01078}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a36c2525d21cd932065bb2bb30bc57fb4}{01078}}\ \ \ \ \ std::ostream\&\ \mbox{\hyperlink{namespacefourdst_1_1composition_a8468dde1b148c0583b8a9f85b8d0ce9a}{operator<<}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01079}01079\ \ \ \ \ \ \ \ \ std::ostream\&\ os,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01080}01080\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\&\ \mbox{\hyperlink{namespacefourdst_1_1composition}{composition}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01081}01081\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01082}01082\ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}Composition(finalized:\ "{}}\ <<\ (\mbox{\hyperlink{namespacefourdst_1_1composition}{composition}}.m\_finalized\ ?\ \textcolor{stringliteral}{"{}true"{}}\ :\ \textcolor{stringliteral}{"{}false"{}})\ <<\ \textcolor{stringliteral}{"{},\ "{}}\ ;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01083}01083\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ count\ =\ 0;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01084}01084\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&entry:\ \mbox{\hyperlink{namespacefourdst_1_1composition}{composition}}.m\_compositions\ |\ std::views::values)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01085}01085\ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ entry;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01086}01086\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (count\ <\ \mbox{\hyperlink{namespacefourdst_1_1composition}{composition}}.m\_compositions.size()\ -\/\ 1)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01087}01087\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{},\ "{}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01088}01088\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01089}01089\ \ \ \ \ \ \ \ \ \ \ \ \ count++;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01090}01090\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01091}01091\ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{})"{}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01092}01092\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ os;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01093}01093\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01094}01094\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l01095}01095\ \}\ \textcolor{comment}{//\ namespace\ fourdst::composition}}

\end{DoxyCode}
