<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:a84c7b72c2aee46b94492d404855dd3e0"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the registered symbols. <br/></td></tr>
<trclass="memdesc:a3dee7b5e1f54920de9eab99f95a516ec"><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:ad20bd541dd7c45274a2e586e6a0519a7"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the mass fractions of all species in the composition. <br/></td></tr>
<trclass="memdesc:a7f6a6edf02b55eeecf147c3f1f7f55e7"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the mass fraction for a given symbol. <br/></td></tr>
<trclass="memdesc:aa3ba0c742872384cff3ed03789c0a17d"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the mass fraction for a given isotope. <br/></td></tr>
<trclass="memdesc:a84fea38bc1c005e483910285f6800e15"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the number fraction for a given symbol. <br/></td></tr>
<trclass="memdesc:aa0ce4143a267e96ab7967538c76acdc3"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the number fraction for a given isotope. <br/></td></tr>
<trclass="memdesc:a7731df9b30f8c8f13231f7e1a17b105c"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the number fractions of all species in the composition. <br/></td></tr>
<trclass="memdesc:a67a2ed844f3aee3d9cc1a3cb996eb56f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the molar abundance (X_i / A_i) for a given symbol. <br/></td></tr>
<trclass="memdesc:a84d6552e2b762fabb7bddf68b05c4022"><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:a66401fed7054172e9b1a2687e5cc8eff"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Compute the mean particle mass of the composition. <br/></td></tr>
<trclass="memdesc:a98199f435cb553f5cf4f8e520fdb8a7a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Compute the mean atomic number 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:a72a368f27094b03fdd9896844e075c94"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Checks if a symbol is registered in the composition. <br/></td></tr>
<trclass="memdesc:acb08478f7032ecc13cb02283a18187e9"><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:acdbdf980297580e885ce3f124164315f"><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:a2a41242de5d49b005e0b608e79e2f2d9"><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:a84d62b971bee83d944d2792c6850bc0b"><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:a1204a6421205feaaed13937aefa158ba"><tdclass="mdescLeft"> </td><tdclass="mdescRight">get the index in the sorted vector representation for a given symbol <br/></td></tr>
<trclass="memdesc:ad49012cd6d78558d80198cc06ec164b1"><tdclass="mdescLeft"> </td><tdclass="mdescRight">get the index in the sorted vector representation for a given symbol <br/></td></tr>
<trclass="memdesc:aa534a01f24074cc9edd7f41df228eb50"><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="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: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="#ad20bd541dd7c45274a2e586e6a0519a7"title="Gets the mass fractions of all species in the composition.">getMassFraction()</a></code>, <code><aclass="el"href="#a66401fed7054172e9b1a2687e5cc8eff"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#l00233">composition.cpp:233</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#l00312">composition.cpp:312</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#l00414">composition.cpp:414</a></div></div>
<divclass="ttc"id="aclassfourdst_1_1composition_1_1_composition_html_ad20bd541dd7c45274a2e586e6a0519a7"><divclass="ttname"><ahref="#ad20bd541dd7c45274a2e586e6a0519a7">fourdst::composition::Composition::getMassFraction</a></div><divclass="ttdeci">std::unordered_map< std::string, double > getMassFraction() const</div><divclass="ttdoc">Gets the mass fractions of all species in the composition.</div><divclass="ttdef"><b>Definition</b><ahref="composition_8cpp_source.html#l00559">composition.cpp:559</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_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#l00363">composition.cpp:363</a></div></div>
<divclass="ttc"id="aclassfourdst_1_1composition_1_1_composition_html_a84fea38bc1c005e483910285f6800e15"><divclass="ttname"><ahref="#a84fea38bc1c005e483910285f6800e15">fourdst::composition::Composition::getNumberFraction</a></div><divclass="ttdeci">double getNumberFraction(const std::string &symbol) const</div><divclass="ttdoc">Gets the number fraction for a given symbol.</div><divclass="ttdef"><b>Definition</b><ahref="composition_8cpp_source.html#l00568">composition.cpp:568</a></div></div>
<pclass="definition">Definition at line <aclass="el"href="composition_8h_source.html#l00258">258</a> of file <aclass="el"href="composition_8h_source.html">composition.h</a>.</p>
</div><h2class="groupheader">Constructor & Destructor Documentation</h2>
<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#l00258">composition.h:258</a></div></div>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00176">176</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#l00182">182</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#l00188">188</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#l00210">210</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#l00821">821</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#l00829">829</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#l00906">906</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#l00837">837</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#l00845">845</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#l00414">414</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#l00427">427</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#l00464">464</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#l00715">715</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#l00630">630</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#l00625">625</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#l00613">613</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#l00559">559</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#l00555">555</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#l00528">528</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>
</table>
</dd>
</dl>
<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>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#l00646">646</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#l00638">638</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#l00609">609</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#l00596">596</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>
</table>
</dd>
</dl>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00803">803</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#l00588">588</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#l00584">584</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#l00568">568</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>
</table>
</dd>
</dl>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00783">783</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#l00280">280</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#l00276">276</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#l00873">873</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>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<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="#a84d62b971bee83d944d2792c6850bc0b"title="Get a uniform vector representation of the molar abundances stored in the composition object sorted s...">getMolarAbundanceVector()</a>, <aclass="el"href="#acdbdf980297580e885ce3f124164315f"title="Get a uniform vector representation of the mass fraction stored in the composition object sorted such...">getMassFractionVector()</a>, or <aclass="el"href="#a2a41242de5d49b005e0b608e79e2f2d9"title="Get a uniform vector representation of the number fractions stored in the composition object sorted s...">getNumberFractionVector()</a></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"><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#l00848">848</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>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<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="#a84d62b971bee83d944d2792c6850bc0b"title="Get a uniform vector representation of the molar abundances stored in the composition object sorted s...">getMolarAbundanceVector()</a>, <aclass="el"href="#acdbdf980297580e885ce3f124164315f"title="Get a uniform vector representation of the mass fraction stored in the composition object sorted such...">getMassFractionVector()</a>, or <aclass="el"href="#a2a41242de5d49b005e0b608e79e2f2d9"title="Get a uniform vector representation of the number fractions stored in the composition object sorted s...">getNumberFractionVector()</a></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"><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#l00823">823</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#l00902">902</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#l00295">295</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#l00308">308</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#l00498">498</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#l00921">921</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#l00219">219</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#l00266">composition.cpp:266</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="ttdef"><b>Definition</b><ahref="species_8h_source.html#l03581">species.h:3581</a></div></div>
<pclass="definition">Definition at line <aclass="el"href="composition_8cpp_source.html#l00266">266</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#l00270">270</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#l00233">233</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#l00260">260</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#l00694">694</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#l00349">349</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#l00312">312</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#l00353">353</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#l00335">335</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#l00400">400</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#l00363">363</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#l00404">404</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#l00386">386</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#l00665">665</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#l00288">288</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#l00937">937</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#l00270">270</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#l00260">260</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#l00264">264</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#l00262">262</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#l00261">261</a> of file <aclass="el"href="composition_8h_source.html">composition.h</a>.</p>
<p>True if mass fraction mode, false if number fraction mode. </p>
<pclass="definition">Definition at line <aclass="el"href="composition_8h_source.html#l00267">267</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#l00266">266</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#l00269">269</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#l00265">265</a> of file <aclass="el"href="composition_8h_source.html">composition.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<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>