<areahref="class_composition_abstract.html"title="Abstract base class for chemical composition representations."alt="CompositionAbstract"shape="rect"coords="0,0,197,24"/>
<trclass="memdesc:a72d063a74a9d2197065884a2cea57a14"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Finalizes the composition, making it ready for querying. <br/></td></tr>
<trclass="memdesc:ae3cc2099efd7db8eec3d9af2294b75fa"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Constructs a <aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a> and registers the given symbols. <br/></td></tr>
<trclass="memdesc:a2d6fbe5c8142b358641bbe7ffde51053"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Constructs a <aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a> and registers the given symbols from a set. <br/></td></tr>
<trclass="memdesc:af4d4cc5875cba931a91faee13f55594e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Constructs and finalizes a <aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a> with the given symbols and fractions. <br/></td></tr>
<trclass="memdesc:a21369a80378d4c90438a34f0e4a275ca"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Constructs a <aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a> from another <aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a>. <br/></td></tr>
<trclass="memdesc:a1bc2e64f87c12befdc2bc767e7405661"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Registers a new symbol for inclusion in the composition. <br/></td></tr>
<trclass="memdesc:a9b422156600823276a9606bfa07ad4db"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Registers multiple new symbols. <br/></td></tr>
<trclass="memdesc:a4ce00f73cc133bb1bac2b030b93ab480"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Registers a new species by extracting its symbol. <br/></td></tr>
<trclass="memdesc:a057f2bf2e86bcc3c649c0ddf18cf3826"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Registers a vector of new species. <br/></td></tr>
<trclass="memdesc:a3f10f38878ba4be121d6d77a8b1f4d7a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the registered symbols. <br/></td></tr>
<trclass="memdesc:af61ebe73a8b5926eb23037bb078fa87a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Get a set of all species that are registered in the composition. <br/></td></tr>
<trclass="memdesc:a493224656aa3ade68389250720ef09af"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the mass fraction for a given symbol. <br/></td></tr>
<trclass="memdesc:a66ce1012c12b0a83629eb09d451b68e3"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the mass fraction for multiple symbols. <br/></td></tr>
<trclass="memdesc:aa6c94269a5d16349c98860f3015b734a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the mass fraction for a given species. <br/></td></tr>
<trclass="memdesc:abbae020d46c74708a7974c1ca755bb62"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the mass fraction for multiple species. <br/></td></tr>
<trclass="memdesc:a7d4d748f3ee25e68751fb143717ed080"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the number fraction for a given symbol. <br/></td></tr>
<trclass="memdesc:a48014a0a725ebd91ad1193c063b5b26f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the number fraction for multiple symbols. <br/></td></tr>
<trclass="memdesc:aaa822bb48a948d101fef759ffbefe31b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the number fraction for a given species. <br/></td></tr>
<trclass="memdesc:adc068778a1ef33cad67f5ca028b49bb8"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the number fraction for multiple species. <br/></td></tr>
<trclass="memdesc:a3aead72892606725a4149a5f65bd31ec"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Mixes this composition with another to produce a new composition. <br/></td></tr>
<trclass="memdesc:aae07019ab6e02394e6ea353e0b98a417"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the mass fractions of all species in the composition. <br/></td></tr>
<trclass="memdesc:ae5d8d21632fca2b35b0898f2b205cd10"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the mass fraction for a given symbol. <br/></td></tr>
<trclass="memdesc:aeae9d6d3f742cd8b59b58abcb228a44d"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the mass fraction for a given isotope. <br/></td></tr>
<trclass="memdesc:a34f71d4d8f0297c576fd62fabd490305"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the number fraction for a given symbol. <br/></td></tr>
<trclass="memdesc:a178d7393ee8b5d496925dcd901c03d23"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the number fraction for a given isotope. <br/></td></tr>
<trclass="memdesc:ae46fb8c3020dadd69080a7acd2054ea1"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the number fractions of all species in the composition. <br/></td></tr>
<trclass="memdesc:add67a92d73e3a57a2bbdb52bc9ca3bfe"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the molar abundance (X_i / A_i) for a given symbol. <br/></td></tr>
<trclass="memdesc:a28c70279d36826e0e1026da3fa892ffc"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the molar abundance for a given isotope. <br/></td></tr>
<trclass="memdesc:a092d3536b04167ea2e6e3a3b1446c377"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the composition entry and global composition data for a given symbol. <br/></td></tr>
<trclass="memdesc:afe5f1086027044c84ff35a366b2e8e2d"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the composition entry and global composition data for a given species. <br/></td></tr>
<trclass="memdesc:a1138c86f7ccd39594601c2ec63ad89e9"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets all composition entries and the global composition data. <br/></td></tr>
<trclass="memdesc:a796386824d1358527fed7c6b537935d8"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Compute the mean particle mass of the composition. <br/></td></tr>
<trclass="memdesc:af7dd8f7d69727acfacf1bf58c4083a27"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Compute the mean atomic number of the composition. <br/></td></tr>
<trclass="memdesc:a62dcfcf8f824d6af7903a9a9c3d5721e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Compute the electron abundance of the composition. <br/></td></tr>
<trclass="memdesc:a17635cd21744c7cf86cb1eb75152c816"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Creates a new <aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a> object containing a subset of species from this one. <br/></td></tr>
<trclass="memdesc:ac01ae1967c266d8187bc6e104c8a0d19"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Checks if a symbol is registered in the composition. <br/></td></tr>
<trclass="memdesc:a55dfadad6cf5fb249356edad1733a813"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Checks if a species is registered in the composition. <br/></td></tr>
<trclass="memdesc:a7efe2cd3a69b743bf2086941b6dfd965"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Checks if a given isotope is present in the composition. <br/></td></tr>
<trclass="memdesc:a0af981ed1074b26c237cf6cf35f82c9e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the composition mode (mass fraction vs. number fraction). <br/></td></tr>
<trclass="memdesc:ac75dbc8377556c835455991c7c7fe206"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the current canonical composition (X, Y, Z). <br/></td></tr>
<trclass="memdesc:a85169b763138ab72047e43e07af978fb"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Get a uniform vector representation of the mass fraction stored in the composition object sorted such that the lightest species is at index 0 and the heaviest is at the last index. <br/></td></tr>
<trclass="memdesc:a49d2eba540f28324c6b7145a5b6cabfd"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Get a uniform vector representation of the number fractions stored in the composition object sorted such that the lightest species is at index 0 and the heaviest is at the last index. <br/></td></tr>
<trclass="memdesc:abed665c07c42b40682da453576621399"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Get a uniform vector representation of the molar abundances stored in the composition object sorted such that the lightest species is at index 0 and the heaviest is at the last index. <br/></td></tr>
<trclass="memdesc:a0d94f62402bb90b5d12679faeaa8c5d7"><tdclass="mdescLeft"> </td><tdclass="mdescRight">get the index in the sorted vector representation for a given symbol <br/></td></tr>
<trclass="memdesc:a3d220b42fa06d7d3a43944ee2b8f6a5f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">get the index in the sorted vector representation for a given symbol <br/></td></tr>
<trclass="memdesc:ae4f854ded38f5e6fcd157a74a57cbf0c"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Get the species at a given index in the sorted vector representation. <br/></td></tr>
<trclass="memdesc:a24a3bdeb8e8e55b54ecdee6dcb0d9561"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Overloads the + operator to mix two compositions with a 50/50 fraction. <br/></td></tr>
<trclass="memdesc:ab1701644ff1c83c220dc04eb58d1621b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns an iterator to the beginning of the composition map. <br/></td></tr>
<trclass="memdesc:adf41a833e8b704daf4f581fca5c8cb9b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns a const iterator to the beginning of the composition map. <br/></td></tr>
<trclass="memdesc:adeaf6f1213e78cb1fe8a8317f0a8adc2"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns an iterator to the end of the composition map. <br/></td></tr>
<trclass="memdesc:aed2f5676f8f742199f01e4d1e9664bdd"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Returns a const iterator to the end of the composition map. <br/></td></tr>
<trclass="inherit_header pub_methods_class_composition_abstract"><tdcolspan="2"onclick="javascript:dynsection.toggleInherit('pub_methods_class_composition_abstract')"><imgsrc="closed.png"alt="-"/> Public Member Functions inherited from <aclass="el"href="class_composition_abstract.html">CompositionAbstract</a></td></tr>
<trclass="memdesc:addf03ba8b988970d341884d487aa94d5"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Checks if the given fractions are valid (sum to ~1.0). <br/></td></tr>
<trclass="memdesc:a86982685c34db4a8f079ddafc25c594e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Validates the given fractions, throwing an exception on failure. <br/></td></tr>
<trclass="memdesc:a869dbae3db9d09c57b2df56a813a55fb"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Finalizes the composition in mass fraction mode. <br/></td></tr>
<trclass="memdesc:a461ab4e9cb5975cf865db5f16f03ddfe"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Finalizes the composition in number fraction mode. <br/></td></tr>
<trclass="memdesc:a8fdac26e6298008aaeaa5b15f7fe244f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Checks if the given symbol is valid by checking against the global species database. <br/></td></tr>
<trclass="memdesc:aa00cbc0933d8a22bb900ac21a338e5ac"><tdclass="mdescLeft"> </td><tdclass="mdescRight">True if the composition is finalized. <br/></td></tr>
<trclass="memdesc:addae4484da7d5072ab66a721dbe04ced"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The specific number density of the composition (\sum_{i} X_i m_i. Where X_i is the number fraction of the ith species and m_i is the mass of the ith species). <br/></td></tr>
<trclass="memdesc:a4a36c8d22ce61023e7bea1d9417577d4"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The mean particle mass of the composition (\sum_{i} \frac{n_i}{m_i}. where n_i is the number fraction of the ith species and m_i is the mass of the ith species). <br/></td></tr>
<trclass="memdesc:a671f1ee8be00f4ff8c1d94fabb382380"><tdclass="mdescLeft"> </td><tdclass="mdescRight">True if mass fraction mode, false if number fraction mode. <br/></td></tr>
<trclass="memdesc:a02cd9d9608da082a200fdfa86d14bf5d"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Cache for computed properties to avoid redundant calculations. <br/></td></tr>
<trclass="memdesc:a36c2525d21cd932065bb2bb30bc57fb4"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Overloaded output stream operator for <aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a>. <br/></td></tr>
<divclass="textblock"><p>Manages a collection of chemical species and their abundances. </p>
<p>This class is a primary interface for defining and manipulating material compositions. It can operate in two modes: mass fraction or number fraction.</p>
<p><b>Key Rules and Workflow:</b></p><oltype="1">
<li><b>Registration:</b> Before setting an abundance for a species, its symbol (e.g., "He-4") must be registered using <code><aclass="el"href="#a1bc2e64f87c12befdc2bc767e7405661"title="Registers a new symbol for inclusion in the composition.">registerSymbol()</a></code> or <code><aclass="el"href="#a4ce00f73cc133bb1bac2b030b93ab480"title="Registers a new species by extracting its symbol.">registerSpecies()</a></code>. All registered species must conform to the same abundance mode (mass or number fraction).</li>
<li><b>Setting Abundances:</b> Use <code><aclass="el"href="#a493224656aa3ade68389250720ef09af"title="Sets the mass fraction for a given symbol.">setMassFraction()</a></code> or <code><aclass="el"href="#a7d4d748f3ee25e68751fb143717ed080"title="Sets the number fraction for a given symbol.">setNumberFraction()</a></code> to define the composition.</li>
<li><b>Finalization:</b> Before querying any compositional data (e.g., <code><aclass="el"href="#aae07019ab6e02394e6ea353e0b98a417"title="Gets the mass fractions of all species in the composition.">getMassFraction()</a></code>, <code><aclass="el"href="#a796386824d1358527fed7c6b537935d8"title="Compute the mean particle mass of the composition.">getMeanParticleMass()</a></code>), the composition must be <b>finalized</b> by calling <code><aclass="el"href="#a72d063a74a9d2197065884a2cea57a14"title="Finalizes the composition, making it ready for querying.">finalize()</a></code>. This step validates the composition (abundances sum to ~1.0) and computes global properties.</li>
<li><b>Modification:</b> Any modification to abundances after finalization will un-finalize the composition, requiring another call to <code><aclass="el"href="#a72d063a74a9d2197065884a2cea57a14"title="Finalizes the composition, making it ready for querying.">finalize()</a></code> before data can be retrieved again.</li>
<li><b>Construction:</b> A pre-finalized composition can be created by providing symbols and valid, normalized abundances to the constructor.</li>
</ol>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname">This</td><td>class throws various exceptions from <code><aclass="el"href="namespacefourdst_1_1composition_1_1exceptions.html">fourdst::composition::exceptions</a></code> for invalid operations, such as using unregistered symbols, providing invalid abundances, or accessing data from a non-finalized composition.</td></tr>
<divclass="ttc"id="aclassfourdst_1_1composition_1_1_composition_html_a1bc2e64f87c12befdc2bc767e7405661"><divclass="ttname"><ahref="#a1bc2e64f87c12befdc2bc767e7405661">fourdst::composition::Composition::registerSymbol</a></div><divclass="ttdeci">void registerSymbol(const std::string &symbol, bool massFracMode=true)</div><divclass="ttdoc">Registers a new symbol for inclusion in the composition.</div><divclass="ttdef"><b>Definition</b><ahref="composition_8cpp_source.html#l00255">composition.cpp:255</a></div></div>
<divclass="ttc"id="aclassfourdst_1_1composition_1_1_composition_html_a493224656aa3ade68389250720ef09af"><divclass="ttname"><ahref="#a493224656aa3ade68389250720ef09af">fourdst::composition::Composition::setMassFraction</a></div><divclass="ttdeci">double setMassFraction(const std::string &symbol, const double &mass_fraction)</div><divclass="ttdoc">Sets the mass fraction for a given symbol.</div><divclass="ttdef"><b>Definition</b><ahref="composition_8cpp_source.html#l00343">composition.cpp:343</a></div></div>
<divclass="ttc"id="aclassfourdst_1_1composition_1_1_composition_html_a72d063a74a9d2197065884a2cea57a14"><divclass="ttname"><ahref="#a72d063a74a9d2197065884a2cea57a14">fourdst::composition::Composition::finalize</a></div><divclass="ttdeci">bool finalize(bool norm=false)</div><divclass="ttdoc">Finalizes the composition, making it ready for querying.</div><divclass="ttdef"><b>Definition</b><ahref="composition_8cpp_source.html#l00445">composition.cpp:445</a></div></div>
<divclass="ttc"id="aclassfourdst_1_1composition_1_1_composition_html_aae07019ab6e02394e6ea353e0b98a417"><divclass="ttname"><ahref="#aae07019ab6e02394e6ea353e0b98a417">fourdst::composition::Composition::getMassFraction</a></div><divclass="ttdeci">std::unordered_map< std::string, double > getMassFraction() const override</div><divclass="ttdoc">Gets the mass fractions of all species in the composition.</div><divclass="ttdef"><b>Definition</b><ahref="composition_8cpp_source.html#l00601">composition.cpp:601</a></div></div>
<divclass="line">comp.<aclass="code hl_function"href="#a1bc2e64f87c12befdc2bc767e7405661">registerSymbol</a>(<spanclass="stringliteral">"H-1"</span>, <spanclass="keyword">false</span>); <spanclass="comment">// Register in number fraction mode</span></div>
<divclass="ttc"id="aclassfourdst_1_1composition_1_1_composition_html_a34f71d4d8f0297c576fd62fabd490305"><divclass="ttname"><ahref="#a34f71d4d8f0297c576fd62fabd490305">fourdst::composition::Composition::getNumberFraction</a></div><divclass="ttdeci">double getNumberFraction(const std::string &symbol) const override</div><divclass="ttdoc">Gets the number fraction for a given symbol.</div><divclass="ttdef"><b>Definition</b><ahref="composition_8cpp_source.html#l00610">composition.cpp:610</a></div></div>
<divclass="ttc"id="aclassfourdst_1_1composition_1_1_composition_html_a7d4d748f3ee25e68751fb143717ed080"><divclass="ttname"><ahref="#a7d4d748f3ee25e68751fb143717ed080">fourdst::composition::Composition::setNumberFraction</a></div><divclass="ttdeci">double setNumberFraction(const std::string &symbol, const double &number_fraction)</div><divclass="ttdoc">Sets the number fraction for a given symbol.</div><divclass="ttdef"><b>Definition</b><ahref="composition_8cpp_source.html#l00374">composition.cpp:374</a></div></div>
<pclass="definition">Definition at line <aclass="el"href="composition_8h_source.html#l00255">255</a> of file <aclass="el"href="composition_8h_source.html">composition.h</a>.</p>
<p>Constructs a <aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a> and registers the given symbols. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">symbols</td><td>The symbols to register. The composition will be in mass fraction mode by default. </td></tr>
</table>
</dd>
</dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_invalid_symbol_error.html"title="Exception thrown when a symbol used in a composition is invalid.">exceptions::InvalidSymbolError</a></td><td>if any symbol is invalid. </td></tr>
<divclass="ttc"id="aclassfourdst_1_1composition_1_1_composition_html"><divclass="ttname"><ahref="classfourdst_1_1composition_1_1_composition.html">fourdst::composition::Composition</a></div><divclass="ttdoc">Manages a collection of chemical species and their abundances.</div><divclass="ttdef"><b>Definition</b><ahref="composition_8h_source.html#l00255">composition.h:255</a></div></div>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00187">187</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Constructs a <aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a> and registers the given symbols from a set. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">symbols</td><td>The symbols to register. The composition will be in mass fraction mode by default. </td></tr>
</table>
</dd>
</dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_invalid_symbol_error.html"title="Exception thrown when a symbol used in a composition is invalid.">exceptions::InvalidSymbolError</a></td><td>if any symbol is invalid. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00195">195</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Constructs and finalizes a <aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a> with the given symbols and fractions. </p>
<p>This constructor provides a convenient way to create a fully-formed, finalized composition in one step. The provided fractions must be valid and sum to 1.0. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">symbols</td><td>The symbols to initialize the composition with. </td></tr>
<tr><tdclass="paramname">fractions</td><td>The fractions (mass or number) corresponding to the symbols. </td></tr>
<tr><tdclass="paramname">massFracMode</td><td>True if <code>fractions</code> are mass fractions, false if they are number fractions. [Default: true] </td></tr>
</table>
</dd>
</dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error.html"title="Exception thrown when a composition is in an invalid or inconsistent state.">exceptions::InvalidCompositionError</a></td><td>if the number of symbols and fractions do not match, or if the fractions do not sum to ~1.0. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_invalid_symbol_error.html"title="Exception thrown when a symbol used in a composition is invalid.">exceptions::InvalidSymbolError</a></td><td>if any symbol is invalid. </td></tr>
</table>
</dd>
</dl>
<dlclass="section post"><dt>Postcondition</dt><dd>The composition is immediately finalized. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00203">203</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Constructs a <aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a> from another <aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a>. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">composition</td><td>The <aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a> to copy. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00234">234</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8h_source.html#l00864">864</a> of file <aclass="el"href="composition_8h_source.html">composition.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8h_source.html#l00872">872</a> of file <aclass="el"href="composition_8h_source.html">composition.h</a>.</p>
<p>Checks if a given isotope is present in the composition. </p>
<dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">isotope</td><td>The isotope to check for. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>True if the isotope is in the composition, false otherwise. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l01038">1038</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8h_source.html#l00880">880</a> of file <aclass="el"href="composition_8h_source.html">composition.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8h_source.html#l00888">888</a> of file <aclass="el"href="composition_8h_source.html">composition.h</a>.</p>
<p>Finalizes the composition, making it ready for querying. </p>
<p>This method checks if the sum of all fractions (mass or number) is approximately 1.0. It also computes global properties like mean particle mass. This <b>must</b> be called before any <code>get...</code> method can be used. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">norm</td><td>If true, the composition will be normalized to sum to 1 before validation. [Default: false] </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>True if the composition is valid and successfully finalized, false otherwise. </dd></dl>
<dlclass="section post"><dt>Postcondition</dt><dd>If successful, <code>m_finalized</code> is true and global properties are computed. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00445">445</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00453">453</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00489">489</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Gets the current canonical composition (X, Y, Z). </p>
<p>Calculates the total mass fractions for H, He, and metals. </p><dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">harsh</td><td>If true, this will throw an error if <code>1 - (X + Y)</code> is not equal to the directly summed <code>Z</code> (within a tolerance). If false, it will only log a warning. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The <code><aclass="el"href="structfourdst_1_1composition_1_1_canonical_composition.html"title="Represents the canonical (X, Y, Z) composition of stellar material.">CanonicalComposition</a></code> struct. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<tr><tdclass="paramname">std::runtime_error</td><td>if <code>harsh</code> is true and the canonical composition is not self-consistent. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00785">785</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Gets all composition entries and the global composition data. </p>
<dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<dlclass="section return"><dt>Returns</dt><dd>A pair containing an unordered map of all CompositionEntries and the <aclass="el"href="structfourdst_1_1composition_1_1_global_composition.html"title="Represents global properties of a finalized composition.">GlobalComposition</a>. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00682">682</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Gets the composition entry and global composition data for a given species. </p>
<dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">species</td><td>The species to get the composition for. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A pair containing the <aclass="el"href="structfourdst_1_1composition_1_1_composition_entry.html"title="Represents a single entry (an isotope) within a composition.">CompositionEntry</a> and <aclass="el"href="structfourdst_1_1composition_1_1_global_composition.html"title="Represents global properties of a finalized composition.">GlobalComposition</a> for the given species. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error.html"title="Exception thrown when a symbol is used that has not been registered.">exceptions::UnregisteredSymbolError</a></td><td>if the species is not in the composition. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00676">676</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Gets the composition entry and global composition data for a given symbol. </p>
<dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">symbol</td><td>The symbol to get the composition for. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A pair containing the <aclass="el"href="structfourdst_1_1composition_1_1_composition_entry.html"title="Represents a single entry (an isotope) within a composition.">CompositionEntry</a> and <aclass="el"href="structfourdst_1_1composition_1_1_global_composition.html"title="Represents global properties of a finalized composition.">GlobalComposition</a> for the given symbol. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error.html"title="Exception thrown when a symbol is used that has not been registered.">exceptions::UnregisteredSymbolError</a></td><td>if the symbol is not in the composition. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00662">662</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Compute the electron abundance of the composition. </p>
<p>Ye is defined as the sum over all species of (Z_i * X_i / A_i), where Z_i is the atomic number, X_i is the mass fraction, and A_i is the atomic mass of species i. </p><dlclass="section return"><dt>Returns</dt><dd>Ye (electron abundance). </dd></dl>
<dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00716">716</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Gets the mass fractions of all species in the composition. </p>
<dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<dlclass="section return"><dt>Returns</dt><dd>An unordered map of symbols to their mass fractions. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00601">601</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Gets the mass fraction for a given isotope. </p>
<dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">species</td><td>The isotope to get the mass fraction for. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The mass fraction for the given isotope. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error.html"title="Exception thrown when a symbol is used that has not been registered.">exceptions::UnregisteredSymbolError</a></td><td>if the isotope is not registered in the composition. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00595">595</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Gets the mass fraction for a given symbol. </p>
<dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">symbol</td><td>The symbol to get the mass fraction for. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The mass fraction for the given symbol. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error.html"title="Exception thrown when a symbol is used that has not been registered.">exceptions::UnregisteredSymbolError</a></td><td>if the symbol is not in the composition. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00568">568</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Get a uniform vector representation of the mass fraction stored in the composition object sorted such that the lightest species is at index 0 and the heaviest is at the last index. </p>
<p>This is primarily useful for external libraries which need to ensure that vector representation uniformity is maintained </p><dlclass="section return"><dt>Returns</dt><dd>the vector of mass fractions sorted by species mass (lightest to heaviest). </dd></dl>
<dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00840">840</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Compute the mean atomic number of the composition. </p>
<dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<dlclass="section return"><dt>Returns</dt><dd>Mean atomic number <Z>. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00698">698</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Compute the mean particle mass of the composition. </p>
<dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<dlclass="section return"><dt>Returns</dt><dd>Mean particle mass in atomic mass units (g/mol). </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00690">690</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Gets the molar abundance for a given isotope. </p>
<dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">species</td><td>The isotope to get the molar abundance for. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The molar abundance for the given isotope. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error.html"title="Exception thrown when a symbol is used that has not been registered.">exceptions::UnregisteredSymbolError</a></td><td>if the isotope is not registered in the composition. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00656">656</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Gets the molar abundance (X_i / A_i) for a given symbol. </p>
<dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">symbol</td><td>The symbol to get the molar abundance for. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The molar abundance for the given symbol. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error.html"title="Exception thrown when a symbol is used that has not been registered.">exceptions::UnregisteredSymbolError</a></td><td>if the symbol is not in the composition. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00641">641</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Get a uniform vector representation of the molar abundances stored in the composition object sorted such that the lightest species is at index 0 and the heaviest is at the last index. </p>
<p>This is primarily useful for external libraries which need to ensure that vector representation uniformity is maintained </p><dlclass="section return"><dt>Returns</dt><dd>the vector of molar abundances sorted by species mass (lightest to heaviest). </dd></dl>
<dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00891">891</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Gets the number fractions of all species in the composition. </p>
<dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<dlclass="section return"><dt>Returns</dt><dd>An unordered map of symbols to their number fractions. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00633">633</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Gets the number fraction for a given isotope. </p>
<dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">species</td><td>The isotope to get the number fraction for. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The number fraction for the given isotope. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error.html"title="Exception thrown when a symbol is used that has not been registered.">exceptions::UnregisteredSymbolError</a></td><td>if the isotope is not registered in the composition. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00627">627</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Gets the number fraction for a given symbol. </p>
<dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">symbol</td><td>The symbol to get the number fraction for. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The number fraction for the given symbol. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error.html"title="Exception thrown when a symbol is used that has not been registered.">exceptions::UnregisteredSymbolError</a></td><td>if the symbol is not in the composition. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00610">610</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Get a uniform vector representation of the number fractions stored in the composition object sorted such that the lightest species is at index 0 and the heaviest is at the last index. </p>
<p>This is primarily useful for external libraries which need to ensure that vector representation uniformity is maintained </p><dlclass="section return"><dt>Returns</dt><dd>the vector of number fractions sorted by species mass (lightest to heaviest). </dd></dl>
<dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00866">866</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Get a set of all species that are registered in the composition. </p>
<dlclass="section return"><dt>Returns</dt><dd>A set of <code><aclass="el"href="structfourdst_1_1atomic_1_1_species.html"title="Represents an atomic species (isotope) with its fundamental physical properties.">atomic::Species</a></code> objects registered in the composition. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00313">313</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00309">309</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Get the species at a given index in the sorted vector representation. </p>
<p>This is primarily useful for external libraries which need to ensure that vector representation uniformity is maintained </p><dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">index</td><td>The index in the sorted vector representation for which to return the species. Must be in [0, N-1] where N is the number of registered species. </td></tr>
</table>
</dd>
</dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<tr><tdclass="paramname">std::out_of_range</td><td>if the index is out of range. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The species at the given index in the sorted vector representation. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00993">993</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>get the index in the sorted vector representation for a given symbol </p>
<p>This is primarily useful for external libraries which need to ensure that vector representation uniformity is maintained </p><dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd>
<dd>
symbol must be registered in the composition </dd></dl>
<tr><tdclass="paramname">species</td><td>the species to look up the index for. Note that this is the index species data will be at if you were to call <aclass="el"href="#abed665c07c42b40682da453576621399"title="Get a uniform vector representation of the molar abundances stored in the composition object sorted s...">getMolarAbundanceVector()</a>, <aclass="el"href="#a85169b763138ab72047e43e07af978fb"title="Get a uniform vector representation of the mass fraction stored in the composition object sorted such...">getMassFractionVector()</a>, or <aclass="el"href="#a49d2eba540f28324c6b7145a5b6cabfd"title="Get a uniform vector representation of the number fractions stored in the composition object sorted s...">getNumberFractionVector()</a></td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error.html"title="Exception thrown when a symbol is used that has not been registered.">exceptions::UnregisteredSymbolError</a></td><td>if the symbol is not registered in the composition </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The index of the symbol in the sorted vector representation. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00955">955</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>get the index in the sorted vector representation for a given symbol </p>
<p>This is primarily useful for external libraries which need to ensure that vector representation uniformity is maintained </p><dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized. </dd>
<dd>
symbol must be registered in the composition </dd></dl>
<tr><tdclass="paramname">symbol</td><td>the symbol to look up the index for. Note that this is the index species data will be at if you were to call <aclass="el"href="#abed665c07c42b40682da453576621399"title="Get a uniform vector representation of the molar abundances stored in the composition object sorted s...">getMolarAbundanceVector()</a>, <aclass="el"href="#a85169b763138ab72047e43e07af978fb"title="Get a uniform vector representation of the mass fraction stored in the composition object sorted such...">getMassFractionVector()</a>, or <aclass="el"href="#a49d2eba540f28324c6b7145a5b6cabfd"title="Get a uniform vector representation of the number fractions stored in the composition object sorted s...">getNumberFractionVector()</a></td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error.html"title="Exception thrown when a symbol is used that has not been registered.">exceptions::UnregisteredSymbolError</a></td><td>if the symbol is not registered in the composition </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The index of the symbol in the sorted vector representation. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00917">917</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l01029">1029</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l01023">1023</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00334">334</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00321">321</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Mixes this composition with another to produce a new composition. </p>
<p>The mixing is performed linearly on the mass fractions. The formula for each species is: <code>new_X_i = fraction * this_X_i + (1 - fraction) * other_X_i</code>. The resulting composition is automatically finalized. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">other</td><td>The other composition to mix with. </td></tr>
<tr><tdclass="paramname">fraction</td><td>The mixing fraction. A value of 1.0 means the new composition is 100% <code>this</code>, 0.0 means 100% <code>other</code>. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A new, finalized <code><aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a></code> object representing the mixture. </dd></dl>
<dlclass="section pre"><dt>Precondition</dt><dd>Both <code>this</code> and <code>other</code> compositions must be finalized. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if either composition is not finalized. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error.html"title="Exception thrown when a composition is in an invalid or inconsistent state.">exceptions::InvalidCompositionError</a></td><td>if the fraction is not between 0 and 1. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00533">533</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<dlclass="section pre"><dt>Precondition</dt><dd>Both compositions must be finalized. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname">See</td><td><code><aclass="el"href="#a3aead72892606725a4149a5f65bd31ec"title="Mixes this composition with another to produce a new composition.">mix()</a></code> for exceptions. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l01054">1054</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<tr><tdclass="paramname">other</td><td>The <aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a> to assign from. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A reference to this <aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a>. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00243">243</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Registers a new species by extracting its symbol. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">species</td><td>The species to register. </td></tr>
<tr><tdclass="paramname">massFracMode</td><td>True for mass fraction mode, false for number fraction mode. </td></tr>
</table>
</dd>
</dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_invalid_symbol_error.html"title="Exception thrown when a symbol used in a composition is invalid.">exceptions::InvalidSymbolError</a></td><td>if the species' symbol is invalid. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_mode_error.html"title="Exception thrown due to a conflict in composition modes at the entry level.">exceptions::CompositionModeError</a></td><td>if the mode conflicts. </td></tr>
</table>
</dd>
</dl>
<dlclass="section user"><dt>Usage Example:</dt><dd><divclass="fragment"><divclass="line"><spanclass="preprocessor">#include "<aclass="code"href="species_8h.html">fourdst/composition/species.h</a>"</span><spanclass="comment">// Assuming species like H1 are defined here</span></div>
<divclass="ttc"id="aclassfourdst_1_1composition_1_1_composition_html_a4ce00f73cc133bb1bac2b030b93ab480"><divclass="ttname"><ahref="#a4ce00f73cc133bb1bac2b030b93ab480">fourdst::composition::Composition::registerSpecies</a></div><divclass="ttdeci">void registerSpecies(const fourdst::atomic::Species &species, bool massFracMode=true)</div><divclass="ttdoc">Registers a new species by extracting its symbol.</div><divclass="ttdef"><b>Definition</b><ahref="composition_8cpp_source.html#l00293">composition.cpp:293</a></div></div>
<divclass="ttc"id="anamespacefourdst_1_1atomic_html_a3f619cc8f8b2cd718a4082c6adb0de90"><divclass="ttname"><ahref="namespacefourdst_1_1atomic.html#a3f619cc8f8b2cd718a4082c6adb0de90">fourdst::atomic::species</a></div><divclass="ttdeci">static const std::unordered_map< std::string, const Species &> species</div><divclass="ttdoc">Map of species names to their corresponding Species objects.</div><divclass="ttdef"><b>Definition</b><ahref="species_8h_source.html#l03579">species.h:3579</a></div></div>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00293">293</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<tr><tdclass="paramname">species</td><td>The vector of species to register. </td></tr>
<tr><tdclass="paramname">massFracMode</td><td>True for mass fraction mode, false for number fraction mode. </td></tr>
</table>
</dd>
</dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_invalid_symbol_error.html"title="Exception thrown when a symbol used in a composition is invalid.">exceptions::InvalidSymbolError</a></td><td>if any species' symbol is invalid. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_mode_error.html"title="Exception thrown due to a conflict in composition modes at the entry level.">exceptions::CompositionModeError</a></td><td>if the mode conflicts. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00300">300</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Registers a new symbol for inclusion in the composition. </p>
<p>A symbol must be registered before its abundance can be set. The first registration sets the mode (mass/number fraction) for the entire composition. </p><dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">symbol</td><td>The symbol to register (e.g., "Fe-56"). </td></tr>
<tr><tdclass="paramname">massFracMode</td><td>True for mass fraction mode, false for number fraction mode. This is only effective for the first symbol registered. </td></tr>
</table>
</dd>
</dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_invalid_symbol_error.html"title="Exception thrown when a symbol used in a composition is invalid.">exceptions::InvalidSymbolError</a></td><td>if the symbol is not in the atomic species database. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_mode_error.html"title="Exception thrown due to a conflict in composition modes at the entry level.">exceptions::CompositionModeError</a></td><td>if attempting to register with a mode that conflicts with the existing mode. </td></tr>
<divclass="line">comp.<aclass="code hl_function"href="#a1bc2e64f87c12befdc2bc767e7405661">registerSymbol</a>(<spanclass="stringliteral">"H-1"</span>); <spanclass="comment">// Now in mass fraction mode</span></div>
<divclass="line">comp.<aclass="code hl_function"href="#a1bc2e64f87c12befdc2bc767e7405661">registerSymbol</a>(<spanclass="stringliteral">"He-4"</span>); <spanclass="comment">// Must also be mass fraction mode</span></div>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00255">255</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<tr><tdclass="paramname">symbols</td><td>The symbols to register. </td></tr>
<tr><tdclass="paramname">massFracMode</td><td>True for mass fraction mode, false for number fraction mode. </td></tr>
</table>
</dd>
</dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_invalid_symbol_error.html"title="Exception thrown when a symbol used in a composition is invalid.">exceptions::InvalidSymbolError</a></td><td>if any symbol is invalid. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_mode_error.html"title="Exception thrown due to a conflict in composition modes at the entry level.">exceptions::CompositionModeError</a></td><td>if the mode conflicts with an already set mode. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00284">284</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Sets the composition mode (mass fraction vs. number fraction). </p>
<p>This function converts all entries in the composition to the specified mode. </p><dlclass="section pre"><dt>Precondition</dt><dd>The composition must be finalized before the mode can be switched. </dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">massFracMode</td><td>True to switch to mass fraction mode, false for number fraction mode. </td></tr>
</table>
</dd>
</dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_not_finalized_error.html"title="Exception thrown when an operation is attempted on a composition that has not been finalized.">exceptions::CompositionNotFinalizedError</a></td><td>if the composition is not finalized. </td></tr>
<tr><tdclass="paramname">std::runtime_error</td><td>if the conversion fails for an unknown reason. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00762">762</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Sets the mass fraction for a given species. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">species</td><td>The species to set the mass fraction for. </td></tr>
<tr><tdclass="paramname">mass_fraction</td><td>The mass fraction to set. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The previous mass fraction that was set for the species. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error.html"title="Exception thrown when a symbol is used that has not been registered.">exceptions::UnregisteredSymbolError</a></td><td>if the species is not registered. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_mode_error.html"title="Exception thrown due to a conflict in composition modes at the entry level.">exceptions::CompositionModeError</a></td><td>if the composition is in number fraction mode. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error.html"title="Exception thrown when a composition is in an invalid or inconsistent state.">exceptions::InvalidCompositionError</a></td><td>if the mass fraction is not between 0 and 1. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00411">411</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Sets the mass fraction for a given symbol. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">symbol</td><td>The symbol to set the mass fraction for. </td></tr>
<tr><tdclass="paramname">mass_fraction</td><td>The mass fraction to set (must be in [0, 1]). </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The previous mass fraction that was set for the symbol. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error.html"title="Exception thrown when a symbol is used that has not been registered.">exceptions::UnregisteredSymbolError</a></td><td>if the symbol is not registered. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_mode_error.html"title="Exception thrown due to a conflict in composition modes at the entry level.">exceptions::CompositionModeError</a></td><td>if the composition is in number fraction mode. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error.html"title="Exception thrown when a composition is in an invalid or inconsistent state.">exceptions::InvalidCompositionError</a></td><td>if the mass fraction is not between 0 and 1. </td></tr>
</table>
</dd>
</dl>
<dlclass="section post"><dt>Postcondition</dt><dd>The composition is marked as not finalized. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00343">343</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00418">418</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Sets the mass fraction for multiple symbols. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">symbols</td><td>The symbols to set the mass fractions for. </td></tr>
<tr><tdclass="paramname">mass_fractions</td><td>The mass fractions corresponding to the symbols. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A vector of the previous mass fractions that were set. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error.html"title="Exception thrown when a composition is in an invalid or inconsistent state.">exceptions::InvalidCompositionError</a></td><td>if symbol and fraction counts differ. </td></tr>
<tr><tdclass="paramname">See</td><td><code>setMassFraction(const std::string&, const double&)</code> for other exceptions. </td></tr>
</table>
</dd>
</dl>
<dlclass="section post"><dt>Postcondition</dt><dd>The composition is marked as not finalized. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00362">362</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Sets the number fraction for a given species. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">species</td><td>The species to set the number fraction for. </td></tr>
<tr><tdclass="paramname">number_fraction</td><td>The number fraction to set for the species. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The previous number fraction that was set for the species. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error.html"title="Exception thrown when a symbol is used that has not been registered.">exceptions::UnregisteredSymbolError</a></td><td>if the species is not registered. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_mode_error.html"title="Exception thrown due to a conflict in composition modes at the entry level.">exceptions::CompositionModeError</a></td><td>if the composition is in mass fraction mode. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error.html"title="Exception thrown when a composition is in an invalid or inconsistent state.">exceptions::InvalidCompositionError</a></td><td>if the number fraction is not between 0 and 1. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00428">428</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Sets the number fraction for a given symbol. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">symbol</td><td>The symbol to set the number fraction for. </td></tr>
<tr><tdclass="paramname">number_fraction</td><td>The number fraction to set (must be in [0, 1]). </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The previous number fraction that was set. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error.html"title="Exception thrown when a symbol is used that has not been registered.">exceptions::UnregisteredSymbolError</a></td><td>if the symbol is not registered. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_composition_mode_error.html"title="Exception thrown due to a conflict in composition modes at the entry level.">exceptions::CompositionModeError</a></td><td>if the composition is in mass fraction mode. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error.html"title="Exception thrown when a composition is in an invalid or inconsistent state.">exceptions::InvalidCompositionError</a></td><td>if the number fraction is not between 0 and 1. </td></tr>
</table>
</dd>
</dl>
<dlclass="section post"><dt>Postcondition</dt><dd>The composition is marked as not finalized. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00374">374</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00435">435</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Sets the number fraction for multiple symbols. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">symbols</td><td>The symbols to set the number fractions for. </td></tr>
<tr><tdclass="paramname">number_fractions</td><td>The number fractions corresponding to the symbols. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A vector of the previous number fractions that were set. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error.html"title="Exception thrown when a composition is in an invalid or inconsistent state.">exceptions::InvalidCompositionError</a></td><td>if symbol and fraction counts differ. </td></tr>
<tr><tdclass="paramname">See</td><td><code>setNumberFraction(const std::string&, const double&)</code> for other exceptions. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00396">396</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Creates a new <aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a> object containing a subset of species from this one. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">symbols</td><td>The symbols to include in the subset. </td></tr>
<tr><tdclass="paramname">method</td><td>The method for handling the abundances of the new subset. Can be "norm" (normalize abundances to sum to 1) or "none" (keep original abundances). </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A new <code><aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a></code> object containing the subset. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error.html"title="Exception thrown when a symbol is used that has not been registered.">exceptions::UnregisteredSymbolError</a></td><td>if any requested symbol is not in the original composition. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_invalid_mixing_mode.html"title="Exception thrown for an invalid or unsupported mixing mode.">exceptions::InvalidMixingMode</a></td><td>if an invalid method is provided. </td></tr>
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_failed_to_finalize_composition_error.html"title="Exception thrown when the finalization process of a composition fails.">exceptions::FailedToFinalizeCompositionError</a></td><td>if normalization fails. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00734">734</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Validates the given fractions, throwing an exception on failure. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">fractions</td><td>The fractions to validate. </td></tr>
</table>
</dd>
</dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error.html"title="Exception thrown when a composition is in an invalid or inconsistent state.">exceptions::InvalidCompositionError</a></td><td>if the fractions are invalid. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00327">327</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Overloaded output stream operator for <aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a>. </p>
<tr><tdclass="paramname">composition</td><td>The <aclass="el"href="classfourdst_1_1composition_1_1_composition.html"title="Manages a collection of chemical species and their abundances.">Composition</a> to output. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l01078">1078</a> of file <aclass="el"href="composition_8cpp_source.html">composition.cpp</a>.</p>
<p>Cache for computed properties to avoid redundant calculations. </p>
<pclass="definition">Definition at line <aclass="el"href="composition_8h_source.html#l00297">297</a> of file <aclass="el"href="composition_8h_source.html">composition.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8h_source.html#l00295">295</a> of file <aclass="el"href="composition_8h_source.html">composition.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8h_source.html#l00285">285</a> of file <aclass="el"href="composition_8h_source.html">composition.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8h_source.html#l00289">289</a> of file <aclass="el"href="composition_8h_source.html">composition.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8h_source.html#l00287">287</a> of file <aclass="el"href="composition_8h_source.html">composition.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8h_source.html#l00286">286</a> of file <aclass="el"href="composition_8h_source.html">composition.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8h_source.html#l00292">292</a> of file <aclass="el"href="composition_8h_source.html">composition.h</a>.</p>
<p>The mean particle mass of the composition (\sum_{i} \frac{n_i}{m_i}. where n_i is the number fraction of the ith species and m_i is the mass of the ith species). </p>
<pclass="definition">Definition at line <aclass="el"href="composition_8h_source.html#l00291">291</a> of file <aclass="el"href="composition_8h_source.html">composition.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="composition_8h_source.html#l00294">294</a> of file <aclass="el"href="composition_8h_source.html">composition.h</a>.</p>
<p>The specific number density of the composition (\sum_{i} X_i m_i. Where X_i is the number fraction of the ith species and m_i is the mass of the ith species). </p>
<pclass="definition">Definition at line <aclass="el"href="composition_8h_source.html#l00290">290</a> of file <aclass="el"href="composition_8h_source.html">composition.h</a>.</p>
<liclass="footer">Generated by <ahref="https://www.doxygen.org/index.html"><imgclass="footer"src="doxygen.svg"width="104"height="31"alt="doxygen"/></a> 1.13.2 </li>