<ahref="classgridfire_1_1_multiscale_partitioning_engine_view-members.html">List of all members</a></div>
<divclass="headertitle"><divclass="title">gridfire::MultiscalePartitioningEngineView Class Reference<spanclass="mlabels"><spanclass="mlabel final">final</span></span></div></div>
</div><!--header-->
<divclass="contents">
<p>An engine view that partitions the reaction network into multiple groups based on timescales.
<areahref="classgridfire_1_1_dynamic_engine.html"title="Abstract class for engines supporting Jacobian and stoichiometry operations."alt="gridfire::DynamicEngine"shape="rect"coords="0,56,246,80"/>
<areahref="classgridfire_1_1_engine.html"title="Abstract base class for a reaction network engine."alt="gridfire::Engine"shape="rect"coords="0,0,246,24"/>
<trclass="memdesc:"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Functor for solving QSE abundances using Eigen's nonlinear optimization. <ahref="structgridfire_1_1_multiscale_partitioning_engine_view_1_1_eigen_functor.html#details">More...</a><br/></td></tr>
<trclass="memdesc:a0df457c0f0f6f403a295335c84fd828f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Constructs a <aclass="el"href="classgridfire_1_1_multiscale_partitioning_engine_view.html"title="An engine view that partitions the reaction network into multiple groups based on timescales.">MultiscalePartitioningEngineView</a>. <br/></td></tr>
<trclass="memdesc:a696f74f5135bbd62169b6577f92fee80"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the list of species in the network. <br/></td></tr>
<trclass="memdesc:a716d7357e944e8394d8b8e0b5e7625eb"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Calculates the right-hand side (dY/dt) and energy generation. <br/></td></tr>
<trclass="memdesc:acdf5ad8765290ea2b78170235aea391d"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Generates the Jacobian matrix for the current state. <br/></td></tr>
<trclass="memitem:ac961484383e86d9712a424728e068633"id="r_ac961484383e86d9712a424728e068633"><tdclass="memItemLeft"align="right"valign="top">double </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="#ac961484383e86d9712a424728e068633">getJacobianMatrixEntry</a> (int i_full, int j_full) const override</td></tr>
<trclass="memdesc:ac961484383e86d9712a424728e068633"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets an entry from the previously generated Jacobian matrix. <br/></td></tr>
<trclass="memdesc:abe76a46784b1ebc8ad67a9eec40d369a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Generates the stoichiometry matrix for the network. <br/></td></tr>
<trclass="memitem:a510b920dea726aef859ac1f6d051807e"id="r_a510b920dea726aef859ac1f6d051807e"><tdclass="memItemLeft"align="right"valign="top">int </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="#a510b920dea726aef859ac1f6d051807e">getStoichiometryMatrixEntry</a> (int speciesIndex, int reactionIndex) const override</td></tr>
<trclass="memdesc:a510b920dea726aef859ac1f6d051807e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets an entry from the stoichiometry matrix. <br/></td></tr>
<trclass="memdesc:a79eb9c108d694a27ec913ed0143aa044"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Calculates the molar reaction flow for a given reaction. <br/></td></tr>
<trclass="memdesc:ad751f2c1306895ee74a61f2071ca96eb"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the set of logical reactions in the network. <br/></td></tr>
<trclass="memdesc:acb5fa7f03cd89b8c1b6b9ffdf3abb12e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the set of logical reactions in the network. <br/></td></tr>
<trclass="memdesc:a560612347bbd5b7b380e990624d01105"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Computes timescales for all species in the network. <br/></td></tr>
<trclass="memdesc:aa38c367ef3c74d012ccd10521cd5a727"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Computes destruction timescales for all species in the network. <br/></td></tr>
<trclass="memdesc:a6bee75b5a6e508e6eebf83f0d48c50b8"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Updates the internal state of the engine, performing partitioning and QSE equilibration. <br/></td></tr>
<trclass="memdesc:ae7847959fc5af2b83f5446dd73567b46"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Checks if the engine's internal state is stale relative to the provided conditions. <br/></td></tr>
<trclass="memdesc:a1a0c0a0ade632eb10f0eecab828a059f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Sets the electron screening model. <br/></td></tr>
<trclass="memdesc:a7bfb4e6fec2f337a1dea69e3d4f1fc82"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the current electron screening model. <br/></td></tr>
<trclass="memdesc:af13e764c118a6cc51847384e9c70e05b"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Analyzes the connectivity of timescale pools. <br/></td></tr>
<trclass="memdesc:a7d26945df5395b9317552a3989c42d1c"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Partitions the network into dynamic and algebraic (QSE) groups based on timescales. <br/></td></tr>
<trclass="memdesc:a98b11ffe498846f5a3a72f08504346b7"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Partitions the network based on timescales from a <code><aclass="el"href="structgridfire_1_1_net_in.html">NetIn</a></code> struct. <br/></td></tr>
<trclass="memdesc:acff59a15abac30eee16e9fa7b355fb18"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Exports the network to a DOT file for visualization. <br/></td></tr>
<trclass="memdesc:a91d32b7197fcb27ee697d5bfde960f3f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the index of a species in the full network. <br/></td></tr>
<trclass="memdesc:aada497e8df74a295fdf5df7d7cdf64e0"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Maps a <code><aclass="el"href="structgridfire_1_1_net_in.html">NetIn</a></code> struct to a molar abundance vector for the full network. <br/></td></tr>
<trclass="memdesc:a05730ced13ac5331060ca011f0da6235"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Primes the engine with a specific species. <br/></td></tr>
<trclass="memdesc:a3c82e4e082d1c82b1b090ac9847c7c5e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the fast species in the network. <br/></td></tr>
<trclass="memdesc:a1e04e8cb8c84b1bd033ac599accf0888"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Gets the dynamic species in the network. <br/></td></tr>
<trclass="memdesc:a4bc879246c6fbd8633b05052858df51d"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Equilibrates the network by partitioning and solving for QSE abundances. <br/></td></tr>
<trclass="memdesc:a1b17f94386882ea1524147782b7a1ddc"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Equilibrates the network using QSE from a <code><aclass="el"href="structgridfire_1_1_net_in.html">NetIn</a></code> struct. <br/></td></tr>
<trclass="inherit_header pub_methods_classgridfire_1_1_dynamic_engine"><tdcolspan="2"onclick="javascript:dynsection.toggleInherit('pub_methods_classgridfire_1_1_dynamic_engine')"><imgsrc="closed.png"alt="-"/> Public Member Functions inherited from <aclass="el"href="classgridfire_1_1_dynamic_engine.html">gridfire::DynamicEngine</a></td></tr>
<trclass="inherit_header pub_methods_classgridfire_1_1_engine"><tdcolspan="2"onclick="javascript:dynsection.toggleInherit('pub_methods_classgridfire_1_1_engine')"><imgsrc="closed.png"alt="-"/> Public Member Functions inherited from <aclass="el"href="classgridfire_1_1_engine.html">gridfire::Engine</a></td></tr>
<trclass="inherit_header pub_methods_classgridfire_1_1_engine_view"><tdcolspan="2"onclick="javascript:dynsection.toggleInherit('pub_methods_classgridfire_1_1_engine_view')"><imgsrc="closed.png"alt="-"/> Public Member Functions inherited from <aclass="el"href="classgridfire_1_1_engine_view.html">gridfire::EngineView< DynamicEngine ></a></td></tr>
<trclass="memdesc:a34b5fdb2078e748edfbe6846ecadd681"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Type alias for a QSE partition. <br/></td></tr>
<trclass="memdesc:ad4d29ee55f89384807616d1068797067"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Partitions the network by timescale. <br/></td></tr>
<trclass="memdesc:aae0865e361dfeb23984d70409fdd9f39"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Builds a connectivity graph from a set of fast reaction indices. <br/></td></tr>
<trclass="memdesc:aa55ed182301d216264daae3e6dfd8917"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Validates candidate QSE groups using flux analysis. <br/></td></tr>
<trclass="memdesc:a3c5fcb8e3396d74359fd601554c9ffa9"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Solves for the QSE abundances of the algebraic species in a given state. <br/></td></tr>
<trclass="memdesc:a54ca8004fbd8d6d3ea6f67efeb5dbc8d"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Identifies the pool with the slowest mean timescale. <br/></td></tr>
<trclass="memdesc:ae3875c61dc916c0982ed122c2e272d94"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Builds a connectivity graph from a species pool. <br/></td></tr>
<trclass="memdesc:ac206840057bac65b7f7738e6dfd1047a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Constructs candidate QSE groups from connected timescale pools. <br/></td></tr>
<trclass="memdesc:a0437c51f94bf834a11adf481b2afad93"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The base engine to which this view delegates calculations. <br/></td></tr>
<trclass="memdesc:a1b4aa04a1e641204e4fd82361b0e39c6"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The list of identified equilibrium groups. <br/></td></tr>
<trclass="memdesc:aec6126b5c4a397d090790d7b75f9f70f"><tdclass="mdescLeft"> </td><tdclass="mdescRight">The simplified set of species presented to the solver (the "slow" species). <br/></td></tr>
<trclass="memdesc:a38b4f0373c3bd81503889650c0bb69bb"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Indices mapping the dynamic species back to the base engine's full species list. <br/></td></tr>
<trclass="memdesc:a4656c05b8235dbf4ec698b03a716a8c8"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Species that are treated as algebraic (in QSE) in the QSE groups. <br/></td></tr>
<trclass="memdesc:a53862719dd73f98bc69eecde090cf655"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Indices of algebraic species in the full network. <br/></td></tr>
<trclass="memdesc:a57d97b11e80fa78ab5f509fce1f156b8"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Indices of all species considered active in the current partition (dynamic + algebraic). <br/></td></tr>
<trclass="memdesc:a445d7447f2cf18f755fc8b8b288e68cb"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Indices of all reactions involving only active species. <br/></td></tr>
<trclass="memdesc:a707e46d2f72993c206210f81b35b884e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Cache for QSE abundances based on T9, rho, and Y. <br/></td></tr>
<trclass="memdesc:aa81057b96cf46986151a5e8ef99a017a"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Statistics for the QSE abundance cache. <br/></td></tr>
<divclass="textblock"><p>An engine view that partitions the reaction network into multiple groups based on timescales. </p>
<p>@purpose This class is designed to accelerate the integration of stiff nuclear reaction networks. It identifies species that react on very short timescales ("fast" species) and treats them as being in Quasi-Steady-State Equilibrium (QSE). Their abundances are solved for algebraically, removing their stiff differential equations from the system. The remaining "slow" or "dynamic" species are integrated normally. This significantly improves the stability and performance of the solver.</p>
<p>@how The core logic resides in the <code><aclass="el"href="#a7d26945df5395b9317552a3989c42d1c"title="Partitions the network into dynamic and algebraic (QSE) groups based on timescales.">partitionNetwork()</a></code> and <code><aclass="el"href="#a4bc879246c6fbd8633b05052858df51d"title="Equilibrates the network by partitioning and solving for QSE abundances.">equilibrateNetwork()</a></code> methods. The partitioning process involves:</p><oltype="1">
<li><b>Timescale Analysis:</b> Using <code>getSpeciesDestructionTimescales</code> from the base engine, all species are sorted by their characteristic timescales.</li>
<li><b>Gap Detection:</b> The sorted list of timescales is scanned for large gaps (e.g., several orders of magnitude) to create distinct "timescale pools".</li>
<li><b>Connectivity Analysis:</b> Each pool is analyzed for internal reaction connectivity to form cohesive groups.</li>
<li><b>Flux Validation:</b> Candidate QSE groups are validated by comparing the total reaction flux <em>within</em> the group to the flux <em>leaving</em> the group. A high internal-to-external flux ratio indicates a valid QSE group.</li>
<li><b>QSE Solve:</b> For valid QSE groups, <code>solveQSEAbundances</code> uses a Levenberg-Marquardt nonlinear solver (<code>Eigen::LevenbergMarquardt</code>) to find the equilibrium abundances of the "algebraic" species, holding the "seed" species constant.</li>
</ol>
<p>All calculations are cached using <code><aclass="el"href="structgridfire_1_1_q_s_e_cache_key.html"title="Key struct for the QSE abundance cache.">QSECacheKey</a></code> to avoid re-partitioning and re-solving for similar thermodynamic conditions.</p>
<dlclass="section user"><dt>Usage Example:</dt><dd><divclass="fragment"><divclass="line"><spanclass="comment">// 1. Create a base engine (e.g., GraphEngine)</span></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html">gridfire::GraphEngine</a></div><divclass="ttdoc">A reaction network engine that uses a graph-based representation.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8h_source.html#l00100">engine_graph.h:100</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_multiscale_partitioning_engine_view_html"><divclass="ttname"><ahref="classgridfire_1_1_multiscale_partitioning_engine_view.html">gridfire::MultiscalePartitioningEngineView</a></div><divclass="ttdoc">An engine view that partitions the reaction network into multiple groups based on timescales.</div><divclass="ttdef"><b>Definition</b><ahref="engine__multiscale_8h_source.html#l00174">engine_multiscale.h:174</a></div></div>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8h_source.html#l00174">174</a> of file <aclass="el"href="engine__multiscale_8h_source.html">engine_multiscale.h</a>.</p>
<p>A QSE partition is a tuple containing the fast species, their indices, the slow species, and their indices. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8h_source.html#l00181">181</a> of file <aclass="el"href="engine__multiscale_8h_source.html">engine_multiscale.h</a>.</p>
</div>
</div>
<h2class="groupheader">Constructor & Destructor Documentation</h2>
<p>Constructs a <aclass="el"href="classgridfire_1_1_multiscale_partitioning_engine_view.html"title="An engine view that partitions the reaction network into multiple groups based on timescales.">MultiscalePartitioningEngineView</a>. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">baseEngine</td><td>The underlying <aclass="el"href="classgridfire_1_1_graph_engine.html"title="A reaction network engine that uses a graph-based representation.">GraphEngine</a> to which this view delegates calculations. It must be a <code><aclass="el"href="classgridfire_1_1_graph_engine.html"title="A reaction network engine that uses a graph-based representation.">GraphEngine</a></code> and not a more general <code><aclass="el"href="classgridfire_1_1_dynamic_engine.html"title="Abstract class for engines supporting Jacobian and stoichiometry operations.">DynamicEngine</a></code> because this view relies on its specific implementation details. </td></tr>
</table>
</dd>
</dl>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00153">153</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
</div>
</div>
<h2class="groupheader">Member Function Documentation</h2>
<p>Analyzes the connectivity of timescale pools. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">timescale_pools</td><td>A vector of vectors of species indices, where each inner vector represents a timescale pool. </td></tr>
<tr><tdclass="paramname">Y</td><td>Vector of current molar abundances for the full network. </td></tr>
<tr><tdclass="paramname">T9</td><td>Temperature in units of 10^9 K. </td></tr>
<tr><tdclass="paramname">rho</td><td>Density in g/cm^3. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A vector of vectors of species indices, where each inner vector represents a single connected component.</dd></dl>
<p>@purpose To merge timescale pools that are strongly connected by reactions, forming cohesive groups for QSE analysis.</p>
<p>@how For each pool, it builds a reaction connectivity graph using <code>buildConnectivityGraph</code>. It then finds the connected components within that graph using a Breadth-First Search (BFS). The resulting components from all pools are collected and returned. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00416">416</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Builds a connectivity graph from a set of fast reaction indices. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">fast_reaction_indices</td><td>A set of indices for reactions considered "fast". </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>An unordered map representing the adjacency list of the connectivity graph, where keys are species indices and values are vectors of connected species indices.</dd></dl>
<p>@purpose To represent the reaction pathways among a subset of reactions.</p>
<p>@how It iterates through the specified fast reactions. For each reaction, it creates a two-way edge in the graph between every reactant and every product, signifying that mass can flow between them. </p>
<p>Builds a connectivity graph from a species pool. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">species_pool</td><td>A vector of species indices representing a species pool. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>An unordered map representing the adjacency list of the connectivity graph.</dd></dl>
<p>@purpose To find reaction connections within a specific group of species.</p>
<p>@how It iterates through all reactions in the base engine. If a reaction involves at least two distinct species from the input <code>species_pool</code> (one as a reactant and one as a product), it adds edges between all reactants and products from that reaction that are also in the pool. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l01344">1344</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Calculates the molar reaction flow for a given reaction. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">reaction</td><td>The reaction for which to calculate the flow. </td></tr>
<tr><tdclass="paramname">Y_full</td><td>Vector of current molar abundances for the full network. </td></tr>
<tr><tdclass="paramname">T9</td><td>Temperature in units of 10^9 K. </td></tr>
<tr><tdclass="paramname">rho</td><td>Density in g/cm^3. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Molar flow rate for the reaction (e.g., mol/g/s).</dd></dl>
<p>@purpose To compute the net rate of a single reaction.</p>
<p>@how It first checks the QSE cache. On a hit, it retrieves the cached equilibrium abundances for the algebraic species. It creates a mutable copy of <code>Y_full</code>, overwrites the algebraic species abundances with the cached equilibrium values, and then calls the base engine's <code>calculateMolarReactionFlow</code> with this modified abundance vector.</p>
<dlclass="section pre"><dt>Precondition</dt><dd>The engine must have a valid QSE cache entry for the given state. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname">StaleEngineError</td><td>If the QSE cache misses. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00253">253</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Calculates the right-hand side (dY/dt) and energy generation. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">Y_full</td><td>Vector of current molar abundances for all species in the base engine. </td></tr>
<tr><tdclass="paramname">T9</td><td>Temperature in units of 10^9 K. </td></tr>
<tr><tdclass="paramname">rho</td><td>Density in g/cm^3. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A <code>std::expected</code> containing <code><aclass="el"href="structgridfire_1_1_step_derivatives.html"title="Structure holding derivatives and energy generation for a network step.">StepDerivatives</a><double></code> on success, or a <code>StaleEngineError</code> if the engine's QSE cache does not contain a solution for the given state.</dd></dl>
<p>@purpose To compute the time derivatives for the ODE solver. This implementation modifies the derivatives from the base engine to enforce the QSE condition.</p>
<p>@how It first performs a lookup in the QSE abundance cache (<code>m_qse_abundance_cache</code>). If a cache hit occurs, it calls the base engine's <code>calculateRHSAndEnergy</code>. It then manually sets the time derivatives (<code>dydt</code>) of all identified algebraic species to zero, effectively removing their differential equations from the system being solved.</p>
<dlclass="section pre"><dt>Precondition</dt><dd>The engine must have been updated via <code><aclass="el"href="#a6bee75b5a6e508e6eebf83f0d48c50b8"title="Updates the internal state of the engine, performing partitioning and QSE equilibration.">update()</a></code> or <code><aclass="el"href="#a4bc879246c6fbd8633b05052858df51d"title="Equilibrates the network by partitioning and solving for QSE abundances.">equilibrateNetwork()</a></code> for the current thermodynamic conditions, so that a valid entry exists in the QSE cache. </dd></dl>
<dlclass="section post"><dt>Postcondition</dt><dd>The returned derivatives will have <code>dydt=0</code> for all algebraic species.</dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname">StaleEngineError</td><td>If the QSE cache does not contain an entry for the given (T9, rho, Y_full). This indicates <code><aclass="el"href="#a6bee75b5a6e508e6eebf83f0d48c50b8"title="Updates the internal state of the engine, performing partitioning and QSE equilibration.">update()</a></code> was not called recently enough. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00161">161</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Constructs candidate QSE groups from connected timescale pools. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">candidate_pools</td><td>A vector of vectors of species indices, where each inner vector represents a connected pool of species with similar fast timescales. </td></tr>
<tr><tdclass="paramname">Y</td><td>Vector of current molar abundances. </td></tr>
<tr><tdclass="paramname">T9</td><td>Temperature in units of 10^9 K. </td></tr>
<tr><tdclass="paramname">rho</td><td>Density in g/cm^3. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A vector of <code><aclass="el"href="structgridfire_1_1_multiscale_partitioning_engine_view_1_1_q_s_e_group.html"title="Struct representing a QSE group.">QSEGroup</a></code> structs, ready for flux validation.</dd></dl>
<p>@how For each input pool, it identifies "bridge" reactions that connect the pool to species outside the pool. The reactants of these bridge reactions that are <em>not</em> in the pool are identified as "seed" species. The original pool members are the "algebraic" species. It then bundles the seed and algebraic species into a <code><aclass="el"href="structgridfire_1_1_multiscale_partitioning_engine_view_1_1_q_s_e_group.html"title="Struct representing a QSE group.">QSEGroup</a></code> struct.</p>
<dlclass="section pre"><dt>Precondition</dt><dd>The <code>candidate_pools</code> should be connected components from <code>analyzeTimescalePoolConnectivity</code>. </dd></dl>
<dlclass="section post"><dt>Postcondition</dt><dd>A list of candidate <code><aclass="el"href="structgridfire_1_1_multiscale_partitioning_engine_view_1_1_q_s_e_group.html"title="Struct representing a QSE group.">QSEGroup</a></code> objects is returned. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l01405">1405</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>@purpose A convenience overload for <code>equilibrateNetwork</code>.</p>
<p>@how It unpacks the <code>netIn</code> struct into <code>Y</code>, <code>T9</code>, and <code>rho</code> and then calls the primary <code>equilibrateNetwork</code> method. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00834">834</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Equilibrates the network by partitioning and solving for QSE abundances. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">Y</td><td>Vector of current molar abundances for the full network. </td></tr>
<tr><tdclass="paramname">T9</td><td>Temperature in units of 10^9 K. </td></tr>
<tr><tdclass="paramname">rho</td><td>Density in g/cm^3. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A new composition object with the equilibrated abundances.</dd></dl>
<p>@purpose A convenience method to run the full QSE analysis and get an equilibrated composition object as a result.</p>
<p>@how It first calls <code><aclass="el"href="#a7d26945df5395b9317552a3989c42d1c"title="Partitions the network into dynamic and algebraic (QSE) groups based on timescales.">partitionNetwork()</a></code> with the given state to define the QSE groups. Then, it calls <code><aclass="el"href="#a3c5fcb8e3396d74359fd601554c9ffa9"title="Solves for the QSE abundances of the algebraic species in a given state.">solveQSEAbundances()</a></code> to compute the new equilibrium abundances for the algebraic species. Finally, it packs the resulting full abundance vector into a new <code>fourdst::composition::Composition</code> object and returns it.</p>
<dlclass="section pre"><dt>Precondition</dt><dd>The input state (Y, T9, rho) must be a valid physical state. </dd></dl>
<dlclass="section post"><dt>Postcondition</dt><dd>The engine's internal partition is updated. A new composition object is returned. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00797">797</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Exports the network to a DOT file for visualization. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">filename</td><td>The name of the DOT file to create. </td></tr>
<tr><tdclass="paramname">Y</td><td>Vector of current molar abundances for the full network. </td></tr>
<tr><tdclass="paramname">T9</td><td>Temperature in units of 10^9 K. </td></tr>
<tr><tdclass="paramname">rho</td><td>Density in g/cm^3.</td></tr>
</table>
</dd>
</dl>
<p>@purpose To visualize the partitioned network graph.</p>
<p>@how This method delegates the DOT file export to the base engine. It does not currently add any partitioning information to the output graph. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00558">558</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Generates the Jacobian matrix for the current state. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">Y_full</td><td>Vector of current molar abundances. </td></tr>
<tr><tdclass="paramname">T9</td><td>Temperature in units of 10^9 K. </td></tr>
<tr><tdclass="paramname">rho</td><td>Density in g/cm^3.</td></tr>
</table>
</dd>
</dl>
<p>@purpose To compute the Jacobian matrix required by implicit ODE solvers.</p>
<p>@how It first performs a QSE cache lookup. On a hit, it delegates the full Jacobian calculation to the base engine. While this view could theoretically return a modified, sparser Jacobian reflecting the QSE constraints, the current implementation returns the full Jacobian from the base engine. The solver is expected to handle the algebraic constraints (e.g., via <code>dydt=0</code> from <code>calculateRHSAndEnergy</code>).</p>
<dlclass="section pre"><dt>Precondition</dt><dd>The engine must have a valid QSE cache entry for the given state. </dd></dl>
<dlclass="section post"><dt>Postcondition</dt><dd>The base engine's internal Jacobian is updated.</dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname"><aclass="el"href="classgridfire_1_1exceptions_1_1_stale_engine_error.html">exceptions::StaleEngineError</a></td><td>If the QSE cache misses, as it cannot proceed without a valid partition. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00204">204</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Generates the stoichiometry matrix for the network. </p>
<p>@purpose To prepare the stoichiometry matrix for later queries.</p>
<p>@how This method delegates directly to the base engine's <code><aclass="el"href="#abe76a46784b1ebc8ad67a9eec40d369a"title="Generates the stoichiometry matrix for the network.">generateStoichiometryMatrix()</a></code>. The stoichiometry is based on the full, unpartitioned network. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00242">242</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00412">412</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>A const reference to the vector of species identified as "dynamic" or "slow".</dd></dl>
<p>@purpose To allow external queries of the partitioning results.</p>
<p>@how It returns a const reference to the <code>m_dynamic_species</code> member vector.</p>
<dlclass="section pre"><dt>Precondition</dt><dd><code><aclass="el"href="#a7d26945df5395b9317552a3989c42d1c"title="Partitions the network into dynamic and algebraic (QSE) groups based on timescales.">partitionNetwork()</a></code> must have been called. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00789">789</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>A vector of species identified as "fast" or "algebraic" by the partitioning.</dd></dl>
<p>@purpose To allow external queries of the partitioning results.</p>
<p>@how It returns a copy of the <code>m_algebraic_species</code> member vector.</p>
<dlclass="section pre"><dt>Precondition</dt><dd><code><aclass="el"href="#a7d26945df5395b9317552a3989c42d1c"title="Partitions the network into dynamic and algebraic (QSE) groups based on timescales.">partitionNetwork()</a></code> must have been called. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00776">776</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Gets an entry from the previously generated Jacobian matrix. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">i_full</td><td>Row index (species index) in the full network. </td></tr>
<tr><tdclass="paramname">j_full</td><td>Column index (species index) in the full network. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Value of the Jacobian matrix at (i_full, j_full).</dd></dl>
<p>@purpose To provide Jacobian entries to an implicit solver.</p>
<p>@how This method directly delegates to the base engine's <code>getJacobianMatrixEntry</code>. It does not currently modify the Jacobian to reflect the QSE algebraic constraints, as these are handled by setting <code>dY/dt = 0</code> in <code>calculateRHSAndEnergy</code>.</p>
<dlclass="section pre"><dt>Precondition</dt><dd><code><aclass="el"href="#acdf5ad8765290ea2b78170235aea391d"title="Generates the Jacobian matrix for the current state.">generateJacobianMatrix()</a></code> must have been called for the current state. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00228">228</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Gets the set of logical reactions in the network. </p>
<dlclass="section return"><dt>Returns</dt><dd>A const reference to the <code><aclass="el"href="namespacegridfire_1_1reaction.html#aa86f08712565f278adacc7cd2361eb31"title="A set of logical reactions.">LogicalReactionSet</a></code> from the base engine, containing all reactions in the full network. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00286">286</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd>A const reference to the vector of <code>Species</code> objects representing all species in the underlying base engine. This view does not alter the species list itself, only how their abundances are evolved. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00157">157</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Gets the current electron screening model. </p>
<dlclass="section return"><dt>Returns</dt><dd>The currently active screening model type.</dd></dl>
<p>@how This method delegates directly to the base engine's <code><aclass="el"href="#a7bfb4e6fec2f337a1dea69e3d4f1fc82"title="Gets the current electron screening model.">getScreeningModel()</a></code>. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00408">408</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Computes destruction timescales for all species in the network. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">Y</td><td>Vector of current molar abundances for the full network. </td></tr>
<tr><tdclass="paramname">T9</td><td>Temperature in units of 10^9 K. </td></tr>
<tr><tdclass="paramname">rho</td><td>Density in g/cm^3. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A <code>std::expected</code> containing a map from <code>Species</code> to their characteristic destruction timescales (s) on success, or a <code>StaleEngineError</code> on failure.</dd></dl>
<p>@purpose To get the timescale for species destruction, which is used as the primary metric for network partitioning.</p>
<p>@how It delegates the calculation to the base engine. For any species identified as algebraic (in QSE), it manually sets their timescale to 0.0.</p>
<dlclass="section pre"><dt>Precondition</dt><dd>The engine must have a valid QSE cache entry for the given state. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname">StaleEngineError</td><td>If the QSE cache misses. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00326">326</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Gets the index of a species in the full network. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">species</td><td>The species to get the index of. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The index of the species in the base engine's network.</dd></dl>
<p>@how This method delegates directly to the base engine's <code><aclass="el"href="#a91d32b7197fcb27ee697d5bfde960f3f"title="Gets the index of a species in the full network.">getSpeciesIndex()</a></code>. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00846">846</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Computes timescales for all species in the network. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">Y</td><td>Vector of current molar abundances for the full network. </td></tr>
<tr><tdclass="paramname">T9</td><td>Temperature in units of 10^9 K. </td></tr>
<tr><tdclass="paramname">rho</td><td>Density in g/cm^3. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A <code>std::expected</code> containing a map from <code>Species</code> to their characteristic timescales (s) on success, or a <code>StaleEngineError</code> on failure.</dd></dl>
<p>@purpose To get the characteristic timescale <code>Y / (dY/dt)</code> for each species.</p>
<p>@how It delegates the calculation to the base engine. For any species identified as algebraic (in QSE), it manually sets their timescale to 0.0 to signify that they equilibrate instantaneously on the timescale of the solver.</p>
<dlclass="section pre"><dt>Precondition</dt><dd>The engine must have a valid QSE cache entry for the given state. </dd></dl>
<dlclass="exception"><dt>Exceptions</dt><dd>
<tableclass="exception">
<tr><tdclass="paramname">StaleEngineError</td><td>If the QSE cache misses. </td></tr>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00295">295</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Gets an entry from the stoichiometry matrix. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">speciesIndex</td><td>Index of the species in the full network. </td></tr>
<tr><tdclass="paramname">reactionIndex</td><td>Index of the reaction in the full network. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>Stoichiometric coefficient for the species in the reaction.</dd></dl>
<p>@purpose To query the stoichiometric relationship between a species and a reaction.</p>
<p>@how This method delegates directly to the base engine's <code><aclass="el"href="#a510b920dea726aef859ac1f6d051807e"title="Gets an entry from the stoichiometry matrix.">getStoichiometryMatrixEntry()</a></code>.</p>
<dlclass="section pre"><dt>Precondition</dt><dd><code><aclass="el"href="#abe76a46784b1ebc8ad67a9eec40d369a"title="Generates the stoichiometry matrix for the network.">generateStoichiometryMatrix()</a></code> must have been called. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00246">246</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Identifies the pool with the slowest mean timescale. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">pools</td><td>A vector of vectors of species indices, where each inner vector represents a timescale pool. </td></tr>
<tr><tdclass="paramname">Y</td><td>Vector of current molar abundances for the full network. </td></tr>
<tr><tdclass="paramname">T9</td><td>Temperature in units of 10^9 K. </td></tr>
<tr><tdclass="paramname">rho</td><td>Density in g/cm^3. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The index of the pool with the largest (slowest) mean destruction timescale.</dd></dl>
<p>@purpose To identify the core set of dynamic species that will not be part of any QSE group.</p>
<p>@how It calculates the geometric mean of the destruction timescales for all species in each pool and returns the index of the pool with the maximum mean timescale. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l01291">1291</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Checks if the engine's internal state is stale relative to the provided conditions. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">netIn</td><td>A struct containing the current network input. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd><code>true</code> if the engine is stale, <code>false</code> otherwise.</dd></dl>
<p>@purpose To determine if <code><aclass="el"href="#a6bee75b5a6e508e6eebf83f0d48c50b8"title="Updates the internal state of the engine, performing partitioning and QSE equilibration.">update()</a></code> needs to be called.</p>
<p>@how It creates a <code><aclass="el"href="structgridfire_1_1_q_s_e_cache_key.html"title="Key struct for the QSE abundance cache.">QSECacheKey</a></code> from the <code>netIn</code> data and checks for its existence in the <code>m_qse_abundance_cache</code>. A cache miss indicates the engine is stale because it does not have a valid QSE partition for the current conditions. It also queries the base engine's <code><aclass="el"href="#ae7847959fc5af2b83f5446dd73567b46"title="Checks if the engine's internal state is stale relative to the provided conditions.">isStale()</a></code> method. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00390">390</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Maps a <code><aclass="el"href="structgridfire_1_1_net_in.html">NetIn</a></code> struct to a molar abundance vector for the full network. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">netIn</td><td>A struct containing the current network input. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A vector of molar abundances corresponding to the species order in the base engine.</dd></dl>
<p>@how This method delegates directly to the base engine's <code><aclass="el"href="#aada497e8df74a295fdf5df7d7cdf64e0"title="Maps a NetIn struct to a molar abundance vector for the full network.">mapNetInToMolarAbundanceVector()</a></code>. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00768">768</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<tr><tdclass="paramname">Y_full</td><td>Vector of current molar abundances for all species. </td></tr>
<tr><tdclass="paramname">T9</td><td>Temperature in units of 10^9 K. </td></tr>
<tr><tdclass="paramname">rho</td><td>Density in g/cm^3. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A vector of vectors of species indices, where each inner vector represents a timescale pool.</dd></dl>
<p>@purpose To group species into "pools" based on their destruction timescales.</p>
<p>@how It retrieves all species destruction timescales from the base engine, sorts them, and then iterates through the sorted list, creating a new pool whenever it detects a gap between consecutive timescales that is larger than a predefined threshold (e.g., a factor of 100). </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00850">850</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Partitions the network based on timescales from a <code><aclass="el"href="structgridfire_1_1_net_in.html">NetIn</a></code> struct. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">netIn</td><td>A struct containing the current network input.</td></tr>
</table>
</dd>
</dl>
<p>@purpose A convenience overload for <code>partitionNetwork</code>.</p>
<p>@how It unpacks the <code>netIn</code> struct into <code>Y</code>, <code>T9</code>, and <code>rho</code> and then calls the primary <code>partitionNetwork</code> method. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00548">548</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Partitions the network into dynamic and algebraic (QSE) groups based on timescales. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">Y</td><td>Vector of current molar abundances for the full network. </td></tr>
<tr><tdclass="paramname">T9</td><td>Temperature in units of 10^9 K. </td></tr>
<tr><tdclass="paramname">rho</td><td>Density in g/cm^3.</td></tr>
</table>
</dd>
</dl>
<p>@purpose To perform the core partitioning logic that identifies which species are "fast" (and can be treated algebraically) and which are "slow" (and must be integrated dynamically).</p>
<p>@how</p><oltype="1">
<li><b><code>partitionByTimescale</code></b>: Gets species destruction timescales from the base engine, sorts them, and looks for large gaps to create timescale "pools".</li>
<li><b><code>identifyMeanSlowestPool</code></b>: The pool with the slowest average timescale is designated as the core set of dynamic species.</li>
<li><b><code>analyzeTimescalePoolConnectivity</code></b>: The other (faster) pools are analyzed for reaction connectivity to form cohesive groups.</li>
<li><b><code>constructCandidateGroups</code></b>: These connected groups are processed to identify "seed" species (dynamic species that feed the group) and "algebraic" species (the rest).</li>
<li><b><code>validateGroupsWithFluxAnalysis</code></b>: The groups are validated by ensuring their internal reaction flux is much larger than the flux connecting them to the outside network.</li>
</ol>
<dlclass="section pre"><dt>Precondition</dt><dd>The input state (Y, T9, rho) must be a valid physical state. </dd></dl>
<dlclass="section post"><dt>Postcondition</dt><dd>The internal member variables <code>m_qse_groups</code>, <code>m_dynamic_species</code>, and <code>m_algebraic_species</code> (and their index maps) are populated with the results of the partitioning. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00438">438</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Primes the engine with a specific species. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">netIn</td><td>A struct containing the current network input. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A <code><aclass="el"href="structgridfire_1_1_priming_report.html"title="Captures the result of a network priming operation.">PrimingReport</a></code> struct containing information about the priming process.</dd></dl>
<p>@purpose To prepare the network for ignition or specific pathway studies.</p>
<p>@how This method delegates directly to the base engine's <code><aclass="el"href="#a05730ced13ac5331060ca011f0da6235"title="Primes the engine with a specific species.">primeEngine()</a></code>. The multiscale view does not currently interact with the priming process. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00793">793</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Sets the set of logical reactions in the network. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">reactions</td><td>The set of logical reactions to use.</td></tr>
</table>
</dd>
</dl>
<p>@purpose To modify the reaction network.</p>
<p>@how This operation is not supported by the <code><aclass="el"href="classgridfire_1_1_multiscale_partitioning_engine_view.html"title="An engine view that partitions the reaction network into multiple groups based on timescales.">MultiscalePartitioningEngineView</a></code> as it would invalidate the partitioning logic. It logs a critical error and throws an exception. <aclass="el"href="classgridfire_1_1_network.html">Network</a> modifications should be done on the base engine before it is wrapped by this view.</p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00290">290</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<tr><tdclass="paramname">model</td><td>The type of screening model to use for reaction rate calculations.</td></tr>
</table>
</dd>
</dl>
<p>@how This method delegates directly to the base engine's <code><aclass="el"href="#a1a0c0a0ade632eb10f0eecab828a059f"title="Sets the electron screening model.">setScreeningModel()</a></code>. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00402">402</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Solves for the QSE abundances of the algebraic species in a given state. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">Y_full</td><td>Vector of current molar abundances for all species in the base engine. </td></tr>
<tr><tdclass="paramname">T9</td><td>Temperature in units of 10^9 K. </td></tr>
<tr><tdclass="paramname">rho</td><td>Density in g/cm^3. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A vector of molar abundances for the algebraic species.</dd></dl>
<p>@purpose To find the equilibrium abundances of the algebraic species that satisfy the QSE conditions.</p>
<p>@how It uses the Levenberg-Marquardt algorithm via Eigen's <code>LevenbergMarquardt</code> class. The problem is defined by the <code><aclass="el"href="structgridfire_1_1_multiscale_partitioning_engine_view_1_1_eigen_functor.html"title="Functor for solving QSE abundances using Eigen's nonlinear optimization.">EigenFunctor</a></code> which computes the residuals and Jacobian for the QSE equations.</p>
<dlclass="section pre"><dt>Precondition</dt><dd>The input state (Y_full, T9, rho) must be a valid physical state. </dd></dl>
<dlclass="section post"><dt>Postcondition</dt><dd>The algebraic species in the QSE cache are updated with the new equilibrium abundances. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l01136">1136</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Updates the internal state of the engine, performing partitioning and QSE equilibration. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">netIn</td><td>A struct containing the current network input: temperature, density, and composition. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>The new composition after QSE species have been brought to equilibrium.</dd></dl>
<p>@purpose This is the main entry point for preparing the multiscale engine for use. It triggers the network partitioning and solves for the initial QSE abundances, caching the result.</p>
<p>@how</p><oltype="1">
<li>It first checks the QSE cache. If a valid entry already exists for the input state, it returns the input composition, as no work is needed.</li>
<li>If the cache misses, it calls <code><aclass="el"href="#a4bc879246c6fbd8633b05052858df51d"title="Equilibrates the network by partitioning and solving for QSE abundances.">equilibrateNetwork()</a></code>.</li>
<li><code><aclass="el"href="#a4bc879246c6fbd8633b05052858df51d"title="Equilibrates the network by partitioning and solving for QSE abundances.">equilibrateNetwork()</a></code> in turn calls <code><aclass="el"href="#a7d26945df5395b9317552a3989c42d1c"title="Partitions the network into dynamic and algebraic (QSE) groups based on timescales.">partitionNetwork()</a></code> to define the dynamic and algebraic species sets.</li>
<li>It then calls <code><aclass="el"href="#a3c5fcb8e3396d74359fd601554c9ffa9"title="Solves for the QSE abundances of the algebraic species in a given state.">solveQSEAbundances()</a></code> to compute the equilibrium abundances.</li>
<li>The resulting equilibrium abundances for the algebraic species are stored in the <code>m_qse_abundance_cache</code>.</li>
<li>A new <code>fourdst::composition::Composition</code> object reflecting the equilibrated state is created and returned.</li>
</ol>
<dlclass="section pre"><dt>Precondition</dt><dd>The <code>netIn</code> struct should contain a valid physical state. </dd></dl>
<dlclass="section post"><dt>Postcondition</dt><dd>The engine is partitioned (<code>m_dynamic_species</code>, <code>m_algebraic_species</code>, etc. are populated). The <code>m_qse_abundance_cache</code> is populated with the QSE solution for the given state. The returned composition reflects the new equilibrium. </dd></dl>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l00356">356</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
<p>Validates candidate QSE groups using flux analysis. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">candidate_groups</td><td>A vector of candidate QSE groups. </td></tr>
<tr><tdclass="paramname">Y</td><td>Vector of current molar abundances for the full network. </td></tr>
<tr><tdclass="paramname">T9</td><td>Temperature in units of 10^9 K. </td></tr>
<tr><tdclass="paramname">rho</td><td>Density in g/cm^3. </td></tr>
</table>
</dd>
</dl>
<dlclass="section return"><dt>Returns</dt><dd>A vector of validated QSE groups that meet the flux criteria.</dd></dl>
<p>@purpose To ensure that a candidate QSE group is truly in equilibrium by checking that the reaction fluxes <em>within</em> the group are much larger than the fluxes <em>leaving</em> the group.</p>
<p>@how For each candidate group, it calculates the sum of all internal reaction fluxes and the sum of all external (bridge) reaction fluxes. If the ratio of internal to external flux exceeds a configurable threshold, the group is considered valid and is added to the returned vector. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8cpp_source.html#l01002">1002</a> of file <aclass="el"href="engine__multiscale_8cpp_source.html">engine_multiscale.cpp</a>.</p>
</div>
</div>
<h2class="groupheader">Member Data Documentation</h2>
<p>Indices of all reactions involving only active species. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8h_source.html#l00943">943</a> of file <aclass="el"href="engine__multiscale_8h_source.html">engine_multiscale.h</a>.</p>
<p>Indices of all species considered active in the current partition (dynamic + algebraic). </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8h_source.html#l00939">939</a> of file <aclass="el"href="engine__multiscale_8h_source.html">engine_multiscale.h</a>.</p>
<p>Species that are treated as algebraic (in QSE) in the QSE groups. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8h_source.html#l00930">930</a> of file <aclass="el"href="engine__multiscale_8h_source.html">engine_multiscale.h</a>.</p>
<p>Indices of algebraic species in the full network. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8h_source.html#l00934">934</a> of file <aclass="el"href="engine__multiscale_8h_source.html">engine_multiscale.h</a>.</p>
<p>The base engine to which this view delegates calculations. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8h_source.html#l00914">914</a> of file <aclass="el"href="engine__multiscale_8h_source.html">engine_multiscale.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8h_source.html#l00957">957</a> of file <aclass="el"href="engine__multiscale_8h_source.html">engine_multiscale.h</a>.</p>
<p>The simplified set of species presented to the solver (the "slow" species). </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8h_source.html#l00922">922</a> of file <aclass="el"href="engine__multiscale_8h_source.html">engine_multiscale.h</a>.</p>
<p>Indices mapping the dynamic species back to the base engine's full species list. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8h_source.html#l00926">926</a> of file <aclass="el"href="engine__multiscale_8h_source.html">engine_multiscale.h</a>.</p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8h_source.html#l00910">910</a> of file <aclass="el"href="engine__multiscale_8h_source.html">engine_multiscale.h</a>.</p>
<p>Cache for QSE abundances based on T9, rho, and Y. </p>
<p>@purpose This is the core of the caching mechanism. It stores the results of QSE solves to avoid re-computation. The key is a <code><aclass="el"href="structgridfire_1_1_q_s_e_cache_key.html"title="Key struct for the QSE abundance cache.">QSECacheKey</a></code> which hashes the thermodynamic state, and the value is the vector of solved molar abundances for the algebraic species. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8h_source.html#l00953">953</a> of file <aclass="el"href="engine__multiscale_8h_source.html">engine_multiscale.h</a>.</p>
<p>The list of identified equilibrium groups. </p>
<pclass="definition">Definition at line <aclass="el"href="engine__multiscale_8h_source.html#l00918">918</a> of file <aclass="el"href="engine__multiscale_8h_source.html">engine_multiscale.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>