Files
GridFire/docs/html/engine__graph_8h_source.html

803 lines
170 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.13.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
2025-07-24 11:10:45 -04:00
<title>GridFire: src/include/gridfire/engine/engine_graph.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">GridFire<span id="projectnumber">&#160;0.0.1a</span>
</div>
<div id="projectbrief">General Purpose Nuclear Network</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.13.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('engine__graph_8h_source.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">engine_graph.h</div></div>
</div><!--header-->
<div class="contents">
<a href="engine__graph_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#include &quot;fourdst/composition/atomicSpecies.h&quot;</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="preprocessor">#include &quot;fourdst/composition/composition.h&quot;</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include &quot;fourdst/logging/logging.h&quot;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="preprocessor">#include &quot;fourdst/config/config.h&quot;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#include &quot;<a class="code" href="network_8h.html">gridfire/network.h</a>&quot;</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include &quot;<a class="code" href="reaction_8h.html">gridfire/reaction/reaction.h</a>&quot;</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include &quot;<a class="code" href="engine__abstract_8h.html">gridfire/engine/engine_abstract.h</a>&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="preprocessor">#include &quot;<a class="code" href="screening__abstract_8h.html">gridfire/screening/screening_abstract.h</a>&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &quot;<a class="code" href="screening__types_8h.html">gridfire/screening/screening_types.h</a>&quot;</span></div>
2025-07-24 11:10:45 -04:00
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include &quot;<a class="code" href="partition__abstract_8h.html">gridfire/partition/partition_abstract.h</a>&quot;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include &quot;<a class="code" href="construction_8h.html">gridfire/engine/procedures/construction.h</a>&quot;</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> </div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include &lt;unordered_map&gt;</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include &lt;ranges&gt;</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include &lt;boost/numeric/ublas/matrix_sparse.hpp&gt;</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="preprocessor">#include &quot;cppad/cppad.hpp&quot;</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#include &quot;cppad/utility/sparse_rc.hpp&quot;</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor">#include &quot;cppad/speed/sparse_jac_fun.hpp&quot;</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> </div>
2025-07-24 11:10:45 -04:00
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="preprocessor">#include &quot;<a class="code" href="priming_8h.html">procedures/priming.h</a>&quot;</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> </div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#include &quot;quill/LogMacros.h&quot;</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="comment">// PERF: The function getNetReactionStoichiometry returns a map of species to their stoichiometric coefficients for a given reaction.</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="comment">// this makes extra copies of the species, which is not ideal and could be optimized further.</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="comment">// Even more relevant is the member m_reactionIDMap which makes copies of a REACLIBReaction for each reaction ID.</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="comment">// REACLIBReactions are quite large data structures, so this could be a performance bottleneck.</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="comment">// static bool isF17 = false;</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacegridfire.html">gridfire</a> {</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="namespacegridfire.html#a1121d0b2d005195333412559fa29d3cc"> 44</a></span> <span class="keyword">typedef</span> CppAD::AD&lt;double&gt; <a class="code hl_typedef" href="namespacegridfire.html#a1121d0b2d005195333412559fa29d3cc">ADDouble</a>;</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keyword">using </span>fourdst::config::Config;</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keyword">using </span>fourdst::logging::LogManager;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keyword">using </span>fourdst::constant::Constants;</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="namespacegridfire.html#ada3c137c014ecd8d06200fea2d1a9f50"> 57</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">double</span> <a class="code hl_variable" href="namespacegridfire.html#ada3c137c014ecd8d06200fea2d1a9f50">MIN_DENSITY_THRESHOLD</a> = 1e-18;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="namespacegridfire.html#a96c062f94713921e5d7568ecedcdcb06"> 66</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">double</span> <a class="code hl_variable" href="namespacegridfire.html#a96c062f94713921e5d7568ecedcdcb06">MIN_ABUNDANCE_THRESHOLD</a> = 1e-18;</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"><a class="line" href="namespacegridfire.html#ae01b1738df1921db565bcbd68dd6cf64"> 74</a></span> <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keywordtype">double</span> <a class="code hl_variable" href="namespacegridfire.html#ae01b1738df1921db565bcbd68dd6cf64">MIN_JACOBIAN_THRESHOLD</a> = 1e-24;</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> </div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span></div>
<div class="foldopen" id="foldopen00100" data-start="{" data-end="};">
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html"> 100</a></span> <span class="keyword">class </span><a class="code hl_function" href="classgridfire_1_1_graph_engine.html#afad967546b611d9c005268760feb75d5">GraphEngine</a> final : <span class="keyword">public</span> <a class="code hl_class" href="classgridfire_1_1_dynamic_engine.html">DynamicEngine</a>{</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keyword">explicit</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#afad967546b611d9c005268760feb75d5">GraphEngine</a>(</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keyword">const</span> fourdst::composition::Composition &amp;composition,</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacegridfire.html#a3b1f70dc7ff5b501809330a97079e4f6">BuildDepthType</a> = <a class="code hl_enumvalue" href="namespacegridfire.html#a0210bd2e07538932135a56b62b8ddb57abbd47109890259c0127154db1af26c75">NetworkBuildDepth::Full</a></div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> );</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> </div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keyword">explicit</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#afad967546b611d9c005268760feb75d5">GraphEngine</a>(</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keyword">const</span> fourdst::composition::Composition &amp;composition,</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keyword">const</span> <a class="code hl_class" href="classgridfire_1_1partition_1_1_partition_function.html">partition::PartitionFunction</a>&amp; partitionFunction,</div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacegridfire.html#a3b1f70dc7ff5b501809330a97079e4f6">BuildDepthType</a> buildDepth = <a class="code hl_enumvalue" href="namespacegridfire.html#a0210bd2e07538932135a56b62b8ddb57abbd47109890259c0127154db1af26c75">NetworkBuildDepth::Full</a></div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> );</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span></div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <span class="keyword">explicit</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#afad967546b611d9c005268760feb75d5">GraphEngine</a>(<span class="keyword">const</span> <a class="code hl_typedef" href="namespacegridfire_1_1reaction.html#aa86f08712565f278adacc7cd2361eb31">reaction::LogicalReactionSet</a> &amp;reactions);</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span></div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> [[nodiscard]] std::expected&lt;StepDerivatives&lt;double&gt;, <a class="code hl_struct" href="structgridfire_1_1expectations_1_1_stale_engine_error.html">expectations::StaleEngineError</a>&gt; <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#aaed3743a52246b0f7bf03995e1c12081">calculateRHSAndEnergy</a>(</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keyword">const</span> std::vector&lt;double&gt;&amp; Y,</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> <span class="keyword">const</span> <span class="keywordtype">double</span> T9,</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> <span class="keyword">const</span> <span class="keywordtype">double</span> rho</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> ) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span></div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#ad049a295e2bb0f3e97b76d5742875119">generateJacobianMatrix</a>(</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> <span class="keyword">const</span> std::vector&lt;double&gt;&amp; Y_dynamic,</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <span class="keyword">const</span> <span class="keywordtype">double</span> T9,</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <span class="keyword">const</span> <span class="keywordtype">double</span> rho</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> ) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> </div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#ad049a295e2bb0f3e97b76d5742875119">generateJacobianMatrix</a>(</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="keyword">const</span> std::vector&lt;double&gt; &amp;Y_dynamic,</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> <span class="keywordtype">double</span> T9,</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> <span class="keywordtype">double</span> rho,</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacegridfire.html#a898dfe22579e649935645cbd6f073178">SparsityPattern</a> &amp;sparsityPattern</div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> ) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span></div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#aed726d36ee2b3796beff6067a1e4db38">generateStoichiometryMatrix</a>() <span class="keyword">override</span>;</div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span></div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> [[nodiscard]] <span class="keywordtype">double</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a9245642b741f215e52861d00e756fb3f">calculateMolarReactionFlow</a>(</div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> <span class="keyword">const</span> <a class="code hl_class" href="classgridfire_1_1reaction_1_1_reaction.html">reaction::Reaction</a>&amp; <a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a>,</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <span class="keyword">const</span> std::vector&lt;double&gt;&amp;Y,</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> <span class="keyword">const</span> <span class="keywordtype">double</span> T9,</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> <span class="keyword">const</span> <span class="keywordtype">double</span> rho</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> ) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span></div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> [[nodiscard]] <span class="keyword">const</span> std::vector&lt;fourdst::atomic::Species&gt;&amp; <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a0ed390f3e598ebba4e245ac90bb78767">getNetworkSpecies</a>() <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span></div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> [[nodiscard]] <span class="keyword">const</span> <a class="code hl_typedef" href="namespacegridfire_1_1reaction.html#aa86f08712565f278adacc7cd2361eb31">reaction::LogicalReactionSet</a>&amp; <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#ad45650d10fc5dff1673ae3f806d067da">getNetworkReactions</a>() <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> </div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a371ba0881d6903ddb2d586faa61805d0">setNetworkReactions</a>(<span class="keyword">const</span> <a class="code hl_typedef" href="namespacegridfire_1_1reaction.html#aa86f08712565f278adacc7cd2361eb31">reaction::LogicalReactionSet</a>&amp; reactions) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span></div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> [[nodiscard]] <span class="keywordtype">double</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a303e6093591cde91430f866a04a8be7c">getJacobianMatrixEntry</a>(</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> <span class="keyword">const</span> <span class="keywordtype">int</span> i,</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> <span class="keyword">const</span> <span class="keywordtype">int</span> j</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> ) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span></div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> [[nodiscard]] <span class="keyword">static</span> std::unordered_map&lt;fourdst::atomic::Species, int&gt; <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a8c29d8bbde407e913be5eb77efb2c0c9">getNetReactionStoichiometry</a>(</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> <span class="keyword">const</span> <a class="code hl_class" href="classgridfire_1_1reaction_1_1_reaction.html">reaction::Reaction</a>&amp; <a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a></div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> );</div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span></div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> [[nodiscard]] <span class="keywordtype">int</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a6b5feaf788bade212b7c8df7ac8c8152">getStoichiometryMatrixEntry</a>(</div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> <span class="keyword">const</span> <span class="keywordtype">int</span> speciesIndex,</div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> <span class="keyword">const</span> <span class="keywordtype">int</span> reactionIndex</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> ) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span></div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> [[nodiscard]] std::expected&lt;std::unordered_map&lt;fourdst::atomic::Species, double&gt;, <a class="code hl_struct" href="structgridfire_1_1expectations_1_1_stale_engine_error.html">expectations::StaleEngineError</a>&gt; <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a65f9f33cddb0bbd1da7c9d0cff23d581">getSpeciesTimescales</a>(</div>
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> <span class="keyword">const</span> std::vector&lt;double&gt;&amp; Y,</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> <span class="keywordtype">double</span> T9,</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> <span class="keywordtype">double</span> rho</div>
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span> ) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> </div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> [[nodiscard]] std::expected&lt;std::unordered_map&lt;fourdst::atomic::Species, double&gt;, <a class="code hl_struct" href="structgridfire_1_1expectations_1_1_stale_engine_error.html">expectations::StaleEngineError</a>&gt; <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#aef8f6bde24d27345067b71084330c7da">getSpeciesDestructionTimescales</a>(</div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> <span class="keyword">const</span> std::vector&lt;double&gt;&amp; Y,</div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> <span class="keywordtype">double</span> T9,</div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> <span class="keywordtype">double</span> rho</div>
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span> ) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> </div>
<div class="line"><a id="l00284" name="l00284"></a><span class="lineno"> 284</span> fourdst::composition::Composition <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a5ac7cff23e70bd07ba7e510b753e2ab6">update</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structgridfire_1_1_net_in.html">NetIn</a> &amp;netIn) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00285" name="l00285"></a><span class="lineno"> 285</span> </div>
<div class="line"><a id="l00286" name="l00286"></a><span class="lineno"> 286</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#af04a9f8a629d6f6c58c477af0f1ab9e5">isStale</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structgridfire_1_1_net_in.html">NetIn</a> &amp;netIn) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00287" name="l00287"></a><span class="lineno"> 287</span></div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span> [[nodiscard]] <span class="keywordtype">bool</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#aa6202cee0c3c481eda77cc9a91bc126b">involvesSpecies</a>(</div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"> 295</span> <span class="keyword">const</span> fourdst::atomic::Species&amp; species</div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</span></div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#adac8c7d62bae76e17fc060e86dadd929">exportToDot</a>(</div>
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span> <span class="keyword">const</span> std::string&amp; filename</div>
<div class="line"><a id="l00316" name="l00316"></a><span class="lineno"> 316</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno"> 317</span></div>
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno"> 334</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a832e2fe066381811a3e0464806ff5e95">exportToCSV</a>(</div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno"> 335</span> <span class="keyword">const</span> std::string&amp; filename</div>
<div class="line"><a id="l00336" name="l00336"></a><span class="lineno"> 336</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00337" name="l00337"></a><span class="lineno"> 337</span> </div>
<div class="line"><a id="l00338" name="l00338"></a><span class="lineno"> 338</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a8110e687844f921438bb517e1d8ce62f">setScreeningModel</a>(<a class="code hl_enumeration" href="namespacegridfire_1_1screening.html#aa82aafbc4f8c28d0a75b60798e3a7d25">screening::ScreeningType</a>) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"> 339</span> </div>
<div class="line"><a id="l00340" name="l00340"></a><span class="lineno"> 340</span> [[nodiscard]] <a class="code hl_enumeration" href="namespacegridfire_1_1screening.html#aa82aafbc4f8c28d0a75b60798e3a7d25">screening::ScreeningType</a> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a697f2004e0d02c59e83c7890742d7c9a">getScreeningModel</a>() <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00341" name="l00341"></a><span class="lineno"> 341</span> </div>
<div class="line"><a id="l00342" name="l00342"></a><span class="lineno"> 342</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a6c5410878496abc349ba30b691cdf0f1">setPrecomputation</a>(<span class="keywordtype">bool</span> precompute);</div>
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno"> 343</span> </div>
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno"> 344</span> [[nodiscard]] <span class="keywordtype">bool</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a015f8975701f028c29835d3a9794e00f">isPrecomputationEnabled</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00345" name="l00345"></a><span class="lineno"> 345</span> </div>
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno"> 346</span> [[nodiscard]] <span class="keyword">const</span> <a class="code hl_class" href="classgridfire_1_1partition_1_1_partition_function.html">partition::PartitionFunction</a>&amp; <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#add98ece49ec5c538bddf3cc77004fe44">getPartitionFunction</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00347" name="l00347"></a><span class="lineno"> 347</span> </div>
<div class="line"><a id="l00348" name="l00348"></a><span class="lineno"> 348</span> [[nodiscard]] <span class="keywordtype">double</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a0b7b85f824e1021ae6e56b644db53b28">calculateReverseRate</a>(</div>
<div class="line"><a id="l00349" name="l00349"></a><span class="lineno"> 349</span> <span class="keyword">const</span> <a class="code hl_class" href="classgridfire_1_1reaction_1_1_reaction.html">reaction::Reaction</a> &amp;<a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a>,</div>
<div class="line"><a id="l00350" name="l00350"></a><span class="lineno"> 350</span> <span class="keywordtype">double</span> T9</div>
<div class="line"><a id="l00351" name="l00351"></a><span class="lineno"> 351</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00352" name="l00352"></a><span class="lineno"> 352</span> </div>
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno"> 353</span> [[nodiscard]] <span class="keywordtype">double</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a01fc9fd5d576b66d07360d05e821c755">calculateReverseRateTwoBody</a>(</div>
<div class="line"><a id="l00354" name="l00354"></a><span class="lineno"> 354</span> <span class="keyword">const</span> <a class="code hl_class" href="classgridfire_1_1reaction_1_1_reaction.html">reaction::Reaction</a> &amp;<a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a>,</div>
<div class="line"><a id="l00355" name="l00355"></a><span class="lineno"> 355</span> <span class="keyword">const</span> <span class="keywordtype">double</span> T9,</div>
<div class="line"><a id="l00356" name="l00356"></a><span class="lineno"> 356</span> <span class="keyword">const</span> <span class="keywordtype">double</span> forwardRate,</div>
<div class="line"><a id="l00357" name="l00357"></a><span class="lineno"> 357</span> <span class="keyword">const</span> <span class="keywordtype">double</span> expFactor</div>
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno"> 358</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00359" name="l00359"></a><span class="lineno"> 359</span> </div>
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno"> 360</span> [[nodiscard]] <span class="keywordtype">double</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#af28950c5af3a92eb03a1a64ed0f913e7">calculateReverseRateTwoBodyDerivative</a>(</div>
<div class="line"><a id="l00361" name="l00361"></a><span class="lineno"> 361</span> <span class="keyword">const</span> <a class="code hl_class" href="classgridfire_1_1reaction_1_1_reaction.html">reaction::Reaction</a> &amp;<a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a>,</div>
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno"> 362</span> <span class="keyword">const</span> <span class="keywordtype">double</span> T9,</div>
<div class="line"><a id="l00363" name="l00363"></a><span class="lineno"> 363</span> <span class="keyword">const</span> <span class="keywordtype">double</span> reverseRate</div>
<div class="line"><a id="l00364" name="l00364"></a><span class="lineno"> 364</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00365" name="l00365"></a><span class="lineno"> 365</span> </div>
<div class="line"><a id="l00366" name="l00366"></a><span class="lineno"> 366</span> [[nodiscard]] <span class="keywordtype">bool</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#ae7a210d9ab13ad5fb0c612f027acabd0">isUsingReverseReactions</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00367" name="l00367"></a><span class="lineno"> 367</span> </div>
<div class="line"><a id="l00368" name="l00368"></a><span class="lineno"> 368</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a409991d527ea4d4b05d1af907fe5d197">setUseReverseReactions</a>(<span class="keywordtype">bool</span> useReverse);</div>
<div class="line"><a id="l00369" name="l00369"></a><span class="lineno"> 369</span> </div>
<div class="line"><a id="l00370" name="l00370"></a><span class="lineno"> 370</span> [[nodiscard]] <span class="keywordtype">int</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a914f6abc61805cddaebcb8f3cf470dda">getSpeciesIndex</a>(</div>
<div class="line"><a id="l00371" name="l00371"></a><span class="lineno"> 371</span> <span class="keyword">const</span> fourdst::atomic::Species&amp; species</div>
<div class="line"><a id="l00372" name="l00372"></a><span class="lineno"> 372</span> ) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00373" name="l00373"></a><span class="lineno"> 373</span> </div>
<div class="line"><a id="l00374" name="l00374"></a><span class="lineno"> 374</span> [[nodiscard]] std::vector&lt;double&gt; <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a27f3a928e1f6bbe7e847cffed6db729f">mapNetInToMolarAbundanceVector</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structgridfire_1_1_net_in.html">NetIn</a> &amp;netIn) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00375" name="l00375"></a><span class="lineno"> 375</span> </div>
<div class="line"><a id="l00376" name="l00376"></a><span class="lineno"> 376</span> [[nodiscard]] <a class="code hl_struct" href="structgridfire_1_1_priming_report.html">PrimingReport</a> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#ae7a371be61ab09b3fa4a93f05bd44e5e">primeEngine</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structgridfire_1_1_net_in.html">NetIn</a> &amp;netIn) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00377" name="l00377"></a><span class="lineno"> 377</span> </div>
<div class="line"><a id="l00378" name="l00378"></a><span class="lineno"> 378</span> [[nodiscard]] <a class="code hl_typedef" href="namespacegridfire.html#a3b1f70dc7ff5b501809330a97079e4f6">BuildDepthType</a> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a166a5f4349580f9aa0b930afec73fcc4">getDepth</a>() <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00379" name="l00379"></a><span class="lineno"> 379</span> </div>
<div class="line"><a id="l00380" name="l00380"></a><span class="lineno"> 380</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#ad9d6c70ace5cbbf7f3aa7b31fce39490">rebuild</a>(<span class="keyword">const</span> fourdst::composition::Composition&amp; comp, <span class="keyword">const</span> <a class="code hl_typedef" href="namespacegridfire.html#a3b1f70dc7ff5b501809330a97079e4f6">BuildDepthType</a> depth) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno"> 381</span> </div>
2025-07-24 11:10:45 -04:00
<div class="line"><a id="l00382" name="l00382"></a><span class="lineno"> 382</span> </div>
<div class="line"><a id="l00383" name="l00383"></a><span class="lineno"> 383</span> <span class="keyword">private</span>:</div>
<div class="foldopen" id="foldopen00384" data-start="{" data-end="};">
<div class="line"><a id="l00384" name="l00384"></a><span class="lineno"><a class="line" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html"> 384</a></span> <span class="keyword">struct </span><a class="code hl_struct" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html">PrecomputedReaction</a> {</div>
<div class="line"><a id="l00385" name="l00385"></a><span class="lineno"> 385</span> <span class="comment">// Forward cacheing</span></div>
<div class="line"><a id="l00386" name="l00386"></a><span class="lineno"><a class="line" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a93635f6940d3534e949f402503c3d497"> 386</a></span> <span class="keywordtype">size_t</span> <a class="code hl_variable" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a93635f6940d3534e949f402503c3d497">reaction_index</a>;</div>
<div class="line"><a id="l00387" name="l00387"></a><span class="lineno"><a class="line" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a510e380116e2e6d9158cf00fedac2666"> 387</a></span> std::vector&lt;size_t&gt; <a class="code hl_variable" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a510e380116e2e6d9158cf00fedac2666">unique_reactant_indices</a>;</div>
<div class="line"><a id="l00388" name="l00388"></a><span class="lineno"><a class="line" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a03d596c88289e21e7bd18711e3a1f275"> 388</a></span> std::vector&lt;int&gt; <a class="code hl_variable" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a03d596c88289e21e7bd18711e3a1f275">reactant_powers</a>;</div>
<div class="line"><a id="l00389" name="l00389"></a><span class="lineno"><a class="line" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#ac42504e868c0b9fd9ac9a405ea739f0e"> 389</a></span> <span class="keywordtype">double</span> <a class="code hl_variable" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#ac42504e868c0b9fd9ac9a405ea739f0e">symmetry_factor</a>;</div>
<div class="line"><a id="l00390" name="l00390"></a><span class="lineno"><a class="line" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a3e2e67e532970738d20491ea56b170f3"> 390</a></span> std::vector&lt;size_t&gt; <a class="code hl_variable" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a3e2e67e532970738d20491ea56b170f3">affected_species_indices</a>;</div>
<div class="line"><a id="l00391" name="l00391"></a><span class="lineno"><a class="line" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a7a7e9167b19e339e0d69544b9c00e79c"> 391</a></span> std::vector&lt;int&gt; <a class="code hl_variable" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a7a7e9167b19e339e0d69544b9c00e79c">stoichiometric_coefficients</a>;</div>
<div class="line"><a id="l00392" name="l00392"></a><span class="lineno"> 392</span> </div>
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno"> 393</span> <span class="comment">// Reverse cacheing</span></div>
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno"><a class="line" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a9974f944a2cf5179baabebe09d60cf18"> 394</a></span> std::vector&lt;size_t&gt; <a class="code hl_variable" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a9974f944a2cf5179baabebe09d60cf18">unique_product_indices</a>; </div>
<div class="line"><a id="l00395" name="l00395"></a><span class="lineno"><a class="line" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a3ce63aa3ad88568f4eb0d3ca2414209f"> 395</a></span> std::vector&lt;int&gt; <a class="code hl_variable" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a3ce63aa3ad88568f4eb0d3ca2414209f">product_powers</a>; </div>
<div class="line"><a id="l00396" name="l00396"></a><span class="lineno"><a class="line" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a6bcfe2230dd54b088180d34389266b07"> 396</a></span> <span class="keywordtype">double</span> <a class="code hl_variable" href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a6bcfe2230dd54b088180d34389266b07">reverse_symmetry_factor</a>; </div>
<div class="line"><a id="l00397" name="l00397"></a><span class="lineno"> 397</span> };</div>
2025-07-24 11:10:45 -04:00
</div>
<div class="line"><a id="l00398" name="l00398"></a><span class="lineno"> 398</span> </div>
<div class="foldopen" id="foldopen00399" data-start="{" data-end="};">
<div class="line"><a id="l00399" name="l00399"></a><span class="lineno"><a class="line" href="structgridfire_1_1_graph_engine_1_1constants.html"> 399</a></span> <span class="keyword">struct </span><a class="code hl_struct" href="structgridfire_1_1_graph_engine_1_1constants.html">constants</a> {</div>
<div class="line"><a id="l00400" name="l00400"></a><span class="lineno"><a class="line" href="structgridfire_1_1_graph_engine_1_1constants.html#a3597bc632a5dd50aaa0044d8c18ca423"> 400</a></span> <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code hl_variable" href="structgridfire_1_1_graph_engine_1_1constants.html#a3597bc632a5dd50aaa0044d8c18ca423">u</a> = Constants::getInstance().get(<span class="stringliteral">&quot;u&quot;</span>).value; </div>
<div class="line"><a id="l00401" name="l00401"></a><span class="lineno"><a class="line" href="structgridfire_1_1_graph_engine_1_1constants.html#a5ccc874d6704615e0ce54c14dc67699d"> 401</a></span> <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code hl_variable" href="structgridfire_1_1_graph_engine_1_1constants.html#a5ccc874d6704615e0ce54c14dc67699d">Na</a> = Constants::getInstance().get(<span class="stringliteral">&quot;N_a&quot;</span>).value; </div>
<div class="line"><a id="l00402" name="l00402"></a><span class="lineno"><a class="line" href="structgridfire_1_1_graph_engine_1_1constants.html#a8bea6e348699c1aea93d17bb56739306"> 402</a></span> <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code hl_variable" href="structgridfire_1_1_graph_engine_1_1constants.html#a8bea6e348699c1aea93d17bb56739306">c</a> = Constants::getInstance().get(<span class="stringliteral">&quot;c&quot;</span>).value; </div>
<div class="line"><a id="l00403" name="l00403"></a><span class="lineno"><a class="line" href="structgridfire_1_1_graph_engine_1_1constants.html#a29c8ae2b5c1d5fecd25c4fde2b623f7f"> 403</a></span> <span class="keyword">const</span> <span class="keywordtype">double</span> <a class="code hl_variable" href="structgridfire_1_1_graph_engine_1_1constants.html#a29c8ae2b5c1d5fecd25c4fde2b623f7f">kB</a> = Constants::getInstance().get(<span class="stringliteral">&quot;kB&quot;</span>).value; </div>
<div class="line"><a id="l00404" name="l00404"></a><span class="lineno"> 404</span> };</div>
2025-07-24 11:10:45 -04:00
</div>
<div class="line"><a id="l00405" name="l00405"></a><span class="lineno"> 405</span> <span class="keyword">private</span>:</div>
<div class="foldopen" id="foldopen00406" data-start="{" data-end="};">
<div class="line"><a id="l00406" name="l00406"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html"> 406</a></span> <span class="keyword">class </span><a class="code hl_function" href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#a20d8e668f0af5fad5b7eda12564dc7cf">AtomicReverseRate</a> final : <span class="keyword">public</span> CppAD::atomic_base&lt;double&gt; {</div>
<div class="line"><a id="l00407" name="l00407"></a><span class="lineno"> 407</span> <span class="keyword">public</span>:</div>
<div class="foldopen" id="foldopen00408" data-start="{" data-end="}">
<div class="line"><a id="l00408" name="l00408"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#a20d8e668f0af5fad5b7eda12564dc7cf"> 408</a></span> <a class="code hl_function" href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#a20d8e668f0af5fad5b7eda12564dc7cf">AtomicReverseRate</a>(</div>
<div class="line"><a id="l00409" name="l00409"></a><span class="lineno"> 409</span> <span class="keyword">const</span> <a class="code hl_class" href="classgridfire_1_1reaction_1_1_reaction.html">reaction::Reaction</a>&amp; <a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a>,</div>
<div class="line"><a id="l00410" name="l00410"></a><span class="lineno"> 410</span> <span class="keyword">const</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#afad967546b611d9c005268760feb75d5">GraphEngine</a>&amp; engine</div>
<div class="line"><a id="l00411" name="l00411"></a><span class="lineno"> 411</span> ):</div>
<div class="line"><a id="l00412" name="l00412"></a><span class="lineno"> 412</span> atomic_base&lt;double&gt;(<span class="stringliteral">&quot;AtomicReverseRate&quot;</span>),</div>
<div class="line"><a id="l00413" name="l00413"></a><span class="lineno"> 413</span> <a class="code hl_variable" href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#a98ed8b450f7868f55e8362a848a4710d">m_reaction</a>(<a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a>),</div>
<div class="line"><a id="l00414" name="l00414"></a><span class="lineno"> 414</span> <a class="code hl_variable" href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#a75d355a0bef27217165644affd0cca4d">m_engine</a>(engine) {}</div>
</div>
<div class="line"><a id="l00415" name="l00415"></a><span class="lineno"> 415</span> </div>
<div class="line"><a id="l00416" name="l00416"></a><span class="lineno"> 416</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#ad9b8dd0e8ba9c7745e33acc9a649d2e0">forward</a>(</div>
<div class="line"><a id="l00417" name="l00417"></a><span class="lineno"> 417</span> <span class="keywordtype">size_t</span> p,</div>
<div class="line"><a id="l00418" name="l00418"></a><span class="lineno"> 418</span> <span class="keywordtype">size_t</span> q,</div>
<div class="line"><a id="l00419" name="l00419"></a><span class="lineno"> 419</span> <span class="keyword">const</span> CppAD::vector&lt;bool&gt;&amp; vx,</div>
<div class="line"><a id="l00420" name="l00420"></a><span class="lineno"> 420</span> CppAD::vector&lt;bool&gt;&amp; vy,</div>
<div class="line"><a id="l00421" name="l00421"></a><span class="lineno"> 421</span> <span class="keyword">const</span> CppAD::vector&lt;double&gt;&amp; tx,</div>
<div class="line"><a id="l00422" name="l00422"></a><span class="lineno"> 422</span> CppAD::vector&lt;double&gt;&amp; ty</div>
<div class="line"><a id="l00423" name="l00423"></a><span class="lineno"> 423</span> ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00424" name="l00424"></a><span class="lineno"> 424</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#a4e8ff268c4377599c8798c7929ec2d5e">reverse</a>(</div>
<div class="line"><a id="l00425" name="l00425"></a><span class="lineno"> 425</span> <span class="keywordtype">size_t</span> q,</div>
<div class="line"><a id="l00426" name="l00426"></a><span class="lineno"> 426</span> <span class="keyword">const</span> CppAD::vector&lt;double&gt;&amp; tx,</div>
<div class="line"><a id="l00427" name="l00427"></a><span class="lineno"> 427</span> <span class="keyword">const</span> CppAD::vector&lt;double&gt;&amp; ty,</div>
<div class="line"><a id="l00428" name="l00428"></a><span class="lineno"> 428</span> CppAD::vector&lt;double&gt;&amp; px,</div>
<div class="line"><a id="l00429" name="l00429"></a><span class="lineno"> 429</span> <span class="keyword">const</span> CppAD::vector&lt;double&gt;&amp; py</div>
<div class="line"><a id="l00430" name="l00430"></a><span class="lineno"> 430</span> ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00431" name="l00431"></a><span class="lineno"> 431</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#aec41632c2a362be33a1f7ff04204cbf4">for_sparse_jac</a>(</div>
<div class="line"><a id="l00432" name="l00432"></a><span class="lineno"> 432</span> <span class="keywordtype">size_t</span> q,</div>
<div class="line"><a id="l00433" name="l00433"></a><span class="lineno"> 433</span> <span class="keyword">const</span> CppAD::vector&lt;std::set&lt;size_t&gt;&gt;&amp;r,</div>
<div class="line"><a id="l00434" name="l00434"></a><span class="lineno"> 434</span> CppAD::vector&lt;std::set&lt;size_t&gt;&gt;&amp; s</div>
<div class="line"><a id="l00435" name="l00435"></a><span class="lineno"> 435</span> ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00436" name="l00436"></a><span class="lineno"> 436</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#a881d4daf2b973d523548cd8d4021bdc4">rev_sparse_jac</a>(</div>
<div class="line"><a id="l00437" name="l00437"></a><span class="lineno"> 437</span> <span class="keywordtype">size_t</span> q,</div>
<div class="line"><a id="l00438" name="l00438"></a><span class="lineno"> 438</span> <span class="keyword">const</span> CppAD::vector&lt;std::set&lt;size_t&gt;&gt;&amp;rt,</div>
<div class="line"><a id="l00439" name="l00439"></a><span class="lineno"> 439</span> CppAD::vector&lt;std::set&lt;size_t&gt;&gt;&amp; st</div>
<div class="line"><a id="l00440" name="l00440"></a><span class="lineno"> 440</span> ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00441" name="l00441"></a><span class="lineno"> 441</span> </div>
<div class="line"><a id="l00442" name="l00442"></a><span class="lineno"> 442</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00443" name="l00443"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#a98ed8b450f7868f55e8362a848a4710d"> 443</a></span> <span class="keyword">const</span> <a class="code hl_class" href="classgridfire_1_1reaction_1_1_reaction.html">reaction::Reaction</a>&amp; <a class="code hl_variable" href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#a98ed8b450f7868f55e8362a848a4710d">m_reaction</a>;</div>
<div class="line"><a id="l00444" name="l00444"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#a75d355a0bef27217165644affd0cca4d"> 444</a></span> <span class="keyword">const</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#afad967546b611d9c005268760feb75d5">GraphEngine</a>&amp; <a class="code hl_variable" href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#a75d355a0bef27217165644affd0cca4d">m_engine</a>;</div>
<div class="line"><a id="l00445" name="l00445"></a><span class="lineno"> 445</span> };</div>
2025-07-24 11:10:45 -04:00
</div>
<div class="line"><a id="l00446" name="l00446"></a><span class="lineno"> 446</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00447" name="l00447"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a3b17102b143435ddfdc015d7a50c4b18"> 447</a></span> Config&amp; <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a3b17102b143435ddfdc015d7a50c4b18">m_config</a> = Config::getInstance();</div>
<div class="line"><a id="l00448" name="l00448"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a483979fc154adc88d029b3b672066d53"> 448</a></span> quill::Logger* <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a483979fc154adc88d029b3b672066d53">m_logger</a> = LogManager::getInstance().getLogger(<span class="stringliteral">&quot;log&quot;</span>);</div>
<div class="line"><a id="l00449" name="l00449"></a><span class="lineno"> 449</span> </div>
<div class="line"><a id="l00450" name="l00450"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a10c01bc20ae668c2857efb2a1783098e"> 450</a></span> <a class="code hl_struct" href="structgridfire_1_1_graph_engine_1_1constants.html">constants</a> <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a10c01bc20ae668c2857efb2a1783098e">m_constants</a>;</div>
<div class="line"><a id="l00451" name="l00451"></a><span class="lineno"> 451</span> </div>
<div class="line"><a id="l00452" name="l00452"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#acb7c4f5108b0efeae48ad15598e808c3"> 452</a></span> <a class="code hl_typedef" href="namespacegridfire_1_1reaction.html#aa86f08712565f278adacc7cd2361eb31">reaction::LogicalReactionSet</a> <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#acb7c4f5108b0efeae48ad15598e808c3">m_reactions</a>; </div>
<div class="line"><a id="l00453" name="l00453"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a5d6cc63b99b467c2a976d1fbaaa1dfa3"> 453</a></span> std::unordered_map&lt;std::string_view, reaction::Reaction*&gt; <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a5d6cc63b99b467c2a976d1fbaaa1dfa3">m_reactionIDMap</a>; </div>
<div class="line"><a id="l00454" name="l00454"></a><span class="lineno"> 454</span> </div>
<div class="line"><a id="l00455" name="l00455"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a92d26068ba139e47d335f5fe9e2814cc"> 455</a></span> std::vector&lt;fourdst::atomic::Species&gt; <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a92d26068ba139e47d335f5fe9e2814cc">m_networkSpecies</a>; </div>
<div class="line"><a id="l00456" name="l00456"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a30e09ed0bce6aa5fc89beaa316a7b827"> 456</a></span> std::unordered_map&lt;std::string_view, fourdst::atomic::Species&gt; <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a30e09ed0bce6aa5fc89beaa316a7b827">m_networkSpeciesMap</a>; </div>
<div class="line"><a id="l00457" name="l00457"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#ad8237c252145a75092202d00f5e1ddf7"> 457</a></span> std::unordered_map&lt;fourdst::atomic::Species, size_t&gt; <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#ad8237c252145a75092202d00f5e1ddf7">m_speciesToIndexMap</a>; </div>
<div class="line"><a id="l00458" name="l00458"></a><span class="lineno"> 458</span> </div>
<div class="line"><a id="l00459" name="l00459"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#ad1cb5fd32efc37668e2d9ecf0c72ad24"> 459</a></span> boost::numeric::ublas::compressed_matrix&lt;int&gt; <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#ad1cb5fd32efc37668e2d9ecf0c72ad24">m_stoichiometryMatrix</a>; </div>
<div class="line"><a id="l00460" name="l00460"></a><span class="lineno"> 460</span> </div>
<div class="line"><a id="l00461" name="l00461"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a2f1718c89d4aaad028102724d18fa910"> 461</a></span> <span class="keyword">mutable</span> boost::numeric::ublas::compressed_matrix&lt;double&gt; <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a2f1718c89d4aaad028102724d18fa910">m_jacobianMatrix</a>; </div>
<div class="line"><a id="l00462" name="l00462"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a2e22b111f6d00ecc9e3804a71f1ce876"> 462</a></span> <span class="keyword">mutable</span> CppAD::ADFun&lt;double&gt; <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a2e22b111f6d00ecc9e3804a71f1ce876">m_rhsADFun</a>; </div>
<div class="line"><a id="l00463" name="l00463"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a250cc6350dc052fbdfdf9a02066e7891"> 463</a></span> <span class="keyword">mutable</span> CppAD::sparse_jac_work <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a250cc6350dc052fbdfdf9a02066e7891">m_jac_work</a>; </div>
<div class="line"><a id="l00464" name="l00464"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a19b2eea0e8d05ac90f9fd7120bdc6e06"> 464</a></span> CppAD::sparse_rc&lt;std::vector&lt;size_t&gt;&gt; <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a19b2eea0e8d05ac90f9fd7120bdc6e06">m_full_jacobian_sparsity_pattern</a>; </div>
<div class="line"><a id="l00465" name="l00465"></a><span class="lineno"> 465</span> </div>
<div class="line"><a id="l00466" name="l00466"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a816797b1d656d416844489692af44cf6"> 466</a></span> std::vector&lt;std::unique_ptr&lt;AtomicReverseRate&gt;&gt; <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a816797b1d656d416844489692af44cf6">m_atomicReverseRates</a>;</div>
<div class="line"><a id="l00467" name="l00467"></a><span class="lineno"> 467</span> </div>
<div class="line"><a id="l00468" name="l00468"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a52edc3e88f1e8fc497e1e63972d63c80"> 468</a></span> <a class="code hl_enumeration" href="namespacegridfire_1_1screening.html#aa82aafbc4f8c28d0a75b60798e3a7d25">screening::ScreeningType</a> <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a52edc3e88f1e8fc497e1e63972d63c80">m_screeningType</a> = <a class="code hl_enumvalue" href="namespacegridfire_1_1screening.html#aa82aafbc4f8c28d0a75b60798e3a7d25ad80b95b1abb9c8659fa4cc9d3d29bb71">screening::ScreeningType::BARE</a>; </div>
<div class="line"><a id="l00469" name="l00469"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#af17cf3762abac3efcab9a8e87c961210"> 469</a></span> std::unique_ptr&lt;screening::ScreeningModel&gt; <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#af17cf3762abac3efcab9a8e87c961210">m_screeningModel</a> = <a class="code hl_function" href="namespacegridfire_1_1screening.html#a6ca8556d27ac373e176f5b23437c416e">screening::selectScreeningModel</a>(<a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a52edc3e88f1e8fc497e1e63972d63c80">m_screeningType</a>);</div>
<div class="line"><a id="l00470" name="l00470"></a><span class="lineno"> 470</span> </div>
<div class="line"><a id="l00471" name="l00471"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a191cff35402d3c97c82c5c966a39d0de"> 471</a></span> <span class="keywordtype">bool</span> <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a191cff35402d3c97c82c5c966a39d0de">m_usePrecomputation</a> = <span class="keyword">true</span>; </div>
<div class="line"><a id="l00472" name="l00472"></a><span class="lineno"> 472</span> </div>
<div class="line"><a id="l00473" name="l00473"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a32d3efbf4c3d5158f87c0c732cdc26dc"> 473</a></span> <span class="keywordtype">bool</span> <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a32d3efbf4c3d5158f87c0c732cdc26dc">m_useReverseReactions</a> = <span class="keyword">true</span>; </div>
<div class="line"><a id="l00474" name="l00474"></a><span class="lineno"> 474</span> </div>
<div class="line"><a id="l00475" name="l00475"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a80c73690d5af247ff9f2ba8b00abce01"> 475</a></span> <a class="code hl_typedef" href="namespacegridfire.html#a3b1f70dc7ff5b501809330a97079e4f6">BuildDepthType</a> <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a80c73690d5af247ff9f2ba8b00abce01">m_depth</a>;</div>
<div class="line"><a id="l00476" name="l00476"></a><span class="lineno"> 476</span> </div>
<div class="line"><a id="l00477" name="l00477"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a5d431d5385b1219ba29689eb29601ea3"> 477</a></span> std::vector&lt;PrecomputedReaction&gt; <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a5d431d5385b1219ba29689eb29601ea3">m_precomputedReactions</a>; </div>
<div class="line"><a id="l00478" name="l00478"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a3621f36d77ea8c738ad7de6e5b35ca3e"> 478</a></span> std::unique_ptr&lt;partition::PartitionFunction&gt; <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a3621f36d77ea8c738ad7de6e5b35ca3e">m_partitionFunction</a>; </div>
<div class="line"><a id="l00479" name="l00479"></a><span class="lineno"> 479</span> </div>
<div class="line"><a id="l00480" name="l00480"></a><span class="lineno"> 480</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00488" name="l00488"></a><span class="lineno"> 488</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#acdce8d87e23a2cd1504bc9472e538c0f">syncInternalMaps</a>();</div>
<div class="line"><a id="l00489" name="l00489"></a><span class="lineno"> 489</span></div>
<div class="line"><a id="l00496" name="l00496"></a><span class="lineno"> 496</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#aedf42d83bfcc28313b6b6454034d2efa">collectNetworkSpecies</a>();</div>
<div class="line"><a id="l00497" name="l00497"></a><span class="lineno"> 497</span></div>
<div class="line"><a id="l00504" name="l00504"></a><span class="lineno"> 504</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a26602e1b3c610780a47b5a6511d6d567">populateReactionIDMap</a>();</div>
<div class="line"><a id="l00505" name="l00505"></a><span class="lineno"> 505</span></div>
<div class="line"><a id="l00512" name="l00512"></a><span class="lineno"> 512</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a47202c43342b96480070874bffce1391">populateSpeciesToIndexMap</a>();</div>
<div class="line"><a id="l00513" name="l00513"></a><span class="lineno"> 513</span></div>
<div class="line"><a id="l00521" name="l00521"></a><span class="lineno"> 521</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a8d0c0bd54a2908cff62dae7af0c149b5">reserveJacobianMatrix</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00522" name="l00522"></a><span class="lineno"> 522</span></div>
<div class="line"><a id="l00532" name="l00532"></a><span class="lineno"> 532</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a95563f6bc86007d9ee053a0f1e15b889">recordADTape</a>();</div>
<div class="line"><a id="l00533" name="l00533"></a><span class="lineno"> 533</span> </div>
<div class="line"><a id="l00534" name="l00534"></a><span class="lineno"> 534</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a29b338630c959449c15881935ac30746">collectAtomicReverseRateAtomicBases</a>();</div>
<div class="line"><a id="l00535" name="l00535"></a><span class="lineno"> 535</span> </div>
<div class="line"><a id="l00536" name="l00536"></a><span class="lineno"> 536</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a92644bc333bff69c5685be4552ca12fd">precomputeNetwork</a>();</div>
<div class="line"><a id="l00537" name="l00537"></a><span class="lineno"> 537</span> </div>
<div class="line"><a id="l00538" name="l00538"></a><span class="lineno"> 538</span></div>
<div class="line"><a id="l00548" name="l00548"></a><span class="lineno"> 548</span> [[nodiscard]] <span class="keywordtype">bool</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#acf4cfccea20f5cb31c9886bf233a28be">validateConservation</a>() <span class="keyword">const</span>;</div>
<div class="line"><a id="l00549" name="l00549"></a><span class="lineno"> 549</span> </div>
<div class="line"><a id="l00550" name="l00550"></a><span class="lineno"> 550</span> </div>
<div class="line"><a id="l00551" name="l00551"></a><span class="lineno"> 551</span> [[nodiscard]] <a class="code hl_struct" href="structgridfire_1_1_step_derivatives.html">StepDerivatives&lt;double&gt;</a> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a97f98706b51fbe0d167ed81ffe58c438">calculateAllDerivativesUsingPrecomputation</a>(</div>
<div class="line"><a id="l00552" name="l00552"></a><span class="lineno"> 552</span> <span class="keyword">const</span> std::vector&lt;double&gt; &amp;Y_in,</div>
<div class="line"><a id="l00553" name="l00553"></a><span class="lineno"> 553</span> <span class="keyword">const</span> std::vector&lt;double&gt;&amp; bare_rates,</div>
<div class="line"><a id="l00554" name="l00554"></a><span class="lineno"> 554</span> <span class="keyword">const</span> std::vector&lt;double&gt; &amp;bare_reverse_rates,</div>
<div class="line"><a id="l00555" name="l00555"></a><span class="lineno"> 555</span> <span class="keywordtype">double</span> T9, <span class="keywordtype">double</span> rho</div>
<div class="line"><a id="l00556" name="l00556"></a><span class="lineno"> 556</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00557" name="l00557"></a><span class="lineno"> 557</span></div>
<div class="line"><a id="l00571" name="l00571"></a><span class="lineno"> 571</span> <span class="keyword">template</span> &lt;IsArithmeticOrAD T&gt;</div>
<div class="line"><a id="l00572" name="l00572"></a><span class="lineno"> 572</span> T <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a9245642b741f215e52861d00e756fb3f">calculateMolarReactionFlow</a>(</div>
<div class="line"><a id="l00573" name="l00573"></a><span class="lineno"> 573</span> <span class="keyword">const</span> <a class="code hl_class" href="classgridfire_1_1reaction_1_1_reaction.html">reaction::Reaction</a> &amp;<a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a>,</div>
<div class="line"><a id="l00574" name="l00574"></a><span class="lineno"> 574</span> <span class="keyword">const</span> std::vector&lt;T&gt; &amp;Y,</div>
<div class="line"><a id="l00575" name="l00575"></a><span class="lineno"> 575</span> <span class="keyword">const</span> T T9,</div>
<div class="line"><a id="l00576" name="l00576"></a><span class="lineno"> 576</span> <span class="keyword">const</span> T rho</div>
<div class="line"><a id="l00577" name="l00577"></a><span class="lineno"> 577</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00578" name="l00578"></a><span class="lineno"> 578</span> </div>
<div class="line"><a id="l00579" name="l00579"></a><span class="lineno"> 579</span> <span class="keyword">template</span>&lt;IsArithmeticOrAD T&gt;</div>
<div class="line"><a id="l00580" name="l00580"></a><span class="lineno"> 580</span> T <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a17774cd9ffcf1ba94019df766a0984a0">calculateReverseMolarReactionFlow</a>(</div>
<div class="line"><a id="l00581" name="l00581"></a><span class="lineno"> 581</span> T T9,</div>
<div class="line"><a id="l00582" name="l00582"></a><span class="lineno"> 582</span> T rho,</div>
<div class="line"><a id="l00583" name="l00583"></a><span class="lineno"> 583</span> std::vector&lt;T&gt; screeningFactors,</div>
<div class="line"><a id="l00584" name="l00584"></a><span class="lineno"> 584</span> std::vector&lt;T&gt; Y,</div>
<div class="line"><a id="l00585" name="l00585"></a><span class="lineno"> 585</span> <span class="keywordtype">size_t</span> reactionIndex,</div>
<div class="line"><a id="l00586" name="l00586"></a><span class="lineno"> 586</span> <span class="keyword">const</span> <a class="code hl_class" href="classgridfire_1_1reaction_1_1_logical_reaction.html">reaction::LogicalReaction</a> &amp;<a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a></div>
<div class="line"><a id="l00587" name="l00587"></a><span class="lineno"> 587</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00588" name="l00588"></a><span class="lineno"> 588</span></div>
<div class="line"><a id="l00601" name="l00601"></a><span class="lineno"> 601</span> <span class="keyword">template</span>&lt;IsArithmeticOrAD T&gt;</div>
<div class="line"><a id="l00602" name="l00602"></a><span class="lineno"> 602</span> [[nodiscard]] <a class="code hl_struct" href="structgridfire_1_1_step_derivatives.html">StepDerivatives&lt;T&gt;</a> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#af41df9ce979b6410e12642cb093916c9">calculateAllDerivatives</a>(</div>
<div class="line"><a id="l00603" name="l00603"></a><span class="lineno"> 603</span> <span class="keyword">const</span> std::vector&lt;T&gt; &amp;Y_in,</div>
<div class="line"><a id="l00604" name="l00604"></a><span class="lineno"> 604</span> T T9,</div>
<div class="line"><a id="l00605" name="l00605"></a><span class="lineno"> 605</span> T rho</div>
2025-07-24 11:10:45 -04:00
<div class="line"><a id="l00606" name="l00606"></a><span class="lineno"> 606</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00607" name="l00607"></a><span class="lineno"> 607</span></div>
<div class="line"><a id="l00620" name="l00620"></a><span class="lineno"> 620</span> [[nodiscard]] <a class="code hl_struct" href="structgridfire_1_1_step_derivatives.html">StepDerivatives&lt;double&gt;</a> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#af41df9ce979b6410e12642cb093916c9">calculateAllDerivatives</a>(</div>
<div class="line"><a id="l00621" name="l00621"></a><span class="lineno"> 621</span> <span class="keyword">const</span> std::vector&lt;double&gt;&amp; Y_in,</div>
<div class="line"><a id="l00622" name="l00622"></a><span class="lineno"> 622</span> <span class="keyword">const</span> <span class="keywordtype">double</span> T9,</div>
<div class="line"><a id="l00623" name="l00623"></a><span class="lineno"> 623</span> <span class="keyword">const</span> <span class="keywordtype">double</span> rho</div>
<div class="line"><a id="l00624" name="l00624"></a><span class="lineno"> 624</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00625" name="l00625"></a><span class="lineno"> 625</span></div>
<div class="line"><a id="l00638" name="l00638"></a><span class="lineno"> 638</span> [[nodiscard]] <a class="code hl_struct" href="structgridfire_1_1_step_derivatives.html">StepDerivatives&lt;ADDouble&gt;</a> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#af41df9ce979b6410e12642cb093916c9">calculateAllDerivatives</a>(</div>
<div class="line"><a id="l00639" name="l00639"></a><span class="lineno"> 639</span> <span class="keyword">const</span> std::vector&lt;ADDouble&gt;&amp; Y_in,</div>
<div class="line"><a id="l00640" name="l00640"></a><span class="lineno"> 640</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacegridfire.html#a1121d0b2d005195333412559fa29d3cc">ADDouble</a> &amp;T9,</div>
<div class="line"><a id="l00641" name="l00641"></a><span class="lineno"> 641</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespacegridfire.html#a1121d0b2d005195333412559fa29d3cc">ADDouble</a> &amp;rho</div>
<div class="line"><a id="l00642" name="l00642"></a><span class="lineno"> 642</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00643" name="l00643"></a><span class="lineno"> 643</span> };</div>
2025-07-24 11:10:45 -04:00
</div>
<div class="line"><a id="l00644" name="l00644"></a><span class="lineno"> 644</span> </div>
<div class="line"><a id="l00645" name="l00645"></a><span class="lineno"> 645</span> </div>
<div class="line"><a id="l00646" name="l00646"></a><span class="lineno"> 646</span> </div>
<div class="line"><a id="l00647" name="l00647"></a><span class="lineno"> 647</span> <span class="keyword">template</span> &lt;IsArithmeticOrAD T&gt;</div>
<div class="foldopen" id="foldopen00648" data-start="{" data-end="}">
<div class="line"><a id="l00648" name="l00648"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a17774cd9ffcf1ba94019df766a0984a0"> 648</a></span> T <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a17774cd9ffcf1ba94019df766a0984a0">GraphEngine::calculateReverseMolarReactionFlow</a>(</div>
<div class="line"><a id="l00649" name="l00649"></a><span class="lineno"> 649</span> T T9,</div>
<div class="line"><a id="l00650" name="l00650"></a><span class="lineno"> 650</span> T rho,</div>
<div class="line"><a id="l00651" name="l00651"></a><span class="lineno"> 651</span> std::vector&lt;T&gt; screeningFactors,</div>
<div class="line"><a id="l00652" name="l00652"></a><span class="lineno"> 652</span> std::vector&lt;T&gt; Y,</div>
<div class="line"><a id="l00653" name="l00653"></a><span class="lineno"> 653</span> <span class="keywordtype">size_t</span> reactionIndex,</div>
<div class="line"><a id="l00654" name="l00654"></a><span class="lineno"> 654</span> <span class="keyword">const</span> <a class="code hl_class" href="classgridfire_1_1reaction_1_1_logical_reaction.html">reaction::LogicalReaction</a> &amp;<a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a></div>
<div class="line"><a id="l00655" name="l00655"></a><span class="lineno"> 655</span> )<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00656" name="l00656"></a><span class="lineno"> 656</span> <span class="keywordflow">if</span> (!<a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a32d3efbf4c3d5158f87c0c732cdc26dc">m_useReverseReactions</a>) {</div>
<div class="line"><a id="l00657" name="l00657"></a><span class="lineno"> 657</span> <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(0.0); <span class="comment">// If reverse reactions are not used, return zero</span></div>
<div class="line"><a id="l00658" name="l00658"></a><span class="lineno"> 658</span> }</div>
<div class="line"><a id="l00659" name="l00659"></a><span class="lineno"> 659</span> T reverseMolarFlow = <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(0.0);</div>
<div class="line"><a id="l00660" name="l00660"></a><span class="lineno"> 660</span> </div>
<div class="line"><a id="l00661" name="l00661"></a><span class="lineno"> 661</span> <span class="keywordflow">if</span> (<a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a>.qValue() != 0.0) {</div>
<div class="line"><a id="l00662" name="l00662"></a><span class="lineno"> 662</span> T reverseRateConstant = <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(0.0);</div>
<div class="line"><a id="l00663" name="l00663"></a><span class="lineno"> 663</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span> (std::is_same_v&lt;T, ADDouble&gt;) { <span class="comment">// Check if T is an AD type at compile time</span></div>
<div class="line"><a id="l00664" name="l00664"></a><span class="lineno"> 664</span> <span class="keyword">const</span> <span class="keyword">auto</span>&amp; atomic_func_ptr = <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a816797b1d656d416844489692af44cf6">m_atomicReverseRates</a>[reactionIndex];</div>
<div class="line"><a id="l00665" name="l00665"></a><span class="lineno"> 665</span> <span class="keywordflow">if</span> (atomic_func_ptr != <span class="keyword">nullptr</span>) {</div>
<div class="line"><a id="l00666" name="l00666"></a><span class="lineno"> 666</span> <span class="comment">// A. Instantiate the atomic operator for the specific reaction</span></div>
<div class="line"><a id="l00667" name="l00667"></a><span class="lineno"> 667</span> <span class="comment">// B. Marshal the input vector</span></div>
<div class="line"><a id="l00668" name="l00668"></a><span class="lineno"> 668</span> std::vector&lt;T&gt; ax = { T9 };</div>
<div class="line"><a id="l00669" name="l00669"></a><span class="lineno"> 669</span> </div>
<div class="line"><a id="l00670" name="l00670"></a><span class="lineno"> 670</span> std::vector&lt;T&gt; ay(1);</div>
<div class="line"><a id="l00671" name="l00671"></a><span class="lineno"> 671</span> (*atomic_func_ptr)(ax, ay);</div>
<div class="line"><a id="l00672" name="l00672"></a><span class="lineno"> 672</span> reverseRateConstant = <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(ay[0]);</div>
<div class="line"><a id="l00673" name="l00673"></a><span class="lineno"> 673</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00674" name="l00674"></a><span class="lineno"> 674</span> <span class="keywordflow">return</span> reverseMolarFlow; <span class="comment">// If no atomic function is available, return zero</span></div>
<div class="line"><a id="l00675" name="l00675"></a><span class="lineno"> 675</span> }</div>
<div class="line"><a id="l00676" name="l00676"></a><span class="lineno"> 676</span> } <span class="keywordflow">else</span> {</div>
<div class="line"><a id="l00677" name="l00677"></a><span class="lineno"> 677</span> <span class="comment">// A,B If not calling with an AD type, calculate the reverse rate directly</span></div>
<div class="line"><a id="l00678" name="l00678"></a><span class="lineno"> 678</span> reverseRateConstant = <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a0b7b85f824e1021ae6e56b644db53b28">calculateReverseRate</a>(<a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a>, T9);</div>
<div class="line"><a id="l00679" name="l00679"></a><span class="lineno"> 679</span> }</div>
<div class="line"><a id="l00680" name="l00680"></a><span class="lineno"> 680</span> </div>
<div class="line"><a id="l00681" name="l00681"></a><span class="lineno"> 681</span> <span class="comment">// C. Get product multiplicities</span></div>
<div class="line"><a id="l00682" name="l00682"></a><span class="lineno"> 682</span> std::unordered_map&lt;fourdst::atomic::Species, int&gt; productCounts;</div>
<div class="line"><a id="l00683" name="l00683"></a><span class="lineno"> 683</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; product : <a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a>.products()) {</div>
<div class="line"><a id="l00684" name="l00684"></a><span class="lineno"> 684</span> productCounts[product]++;</div>
<div class="line"><a id="l00685" name="l00685"></a><span class="lineno"> 685</span> }</div>
<div class="line"><a id="l00686" name="l00686"></a><span class="lineno"> 686</span> </div>
<div class="line"><a id="l00687" name="l00687"></a><span class="lineno"> 687</span> <span class="comment">// D. Calculate the symmetry factor</span></div>
<div class="line"><a id="l00688" name="l00688"></a><span class="lineno"> 688</span> T reverseSymmetryFactor = <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(1.0);</div>
<div class="line"><a id="l00689" name="l00689"></a><span class="lineno"> 689</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> &amp;count: productCounts | std::views::values) {</div>
<div class="line"><a id="l00690" name="l00690"></a><span class="lineno"> 690</span> reverseSymmetryFactor /= <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(std::tgamma(<span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(count + 1))); <span class="comment">// Gamma function for factorial</span></div>
<div class="line"><a id="l00691" name="l00691"></a><span class="lineno"> 691</span> }</div>
<div class="line"><a id="l00692" name="l00692"></a><span class="lineno"> 692</span> </div>
<div class="line"><a id="l00693" name="l00693"></a><span class="lineno"> 693</span> <span class="comment">// E. Calculate the abundance term</span></div>
<div class="line"><a id="l00694" name="l00694"></a><span class="lineno"> 694</span> T productAbundanceTerm = <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(1.0);</div>
<div class="line"><a id="l00695" name="l00695"></a><span class="lineno"> 695</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; [species, count] : productCounts) {</div>
<div class="line"><a id="l00696" name="l00696"></a><span class="lineno"> 696</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> speciesIndex = <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#ad8237c252145a75092202d00f5e1ddf7">m_speciesToIndexMap</a>.at(species);</div>
<div class="line"><a id="l00697" name="l00697"></a><span class="lineno"> 697</span> productAbundanceTerm *= CppAD::pow(Y[speciesIndex], count);</div>
<div class="line"><a id="l00698" name="l00698"></a><span class="lineno"> 698</span> }</div>
<div class="line"><a id="l00699" name="l00699"></a><span class="lineno"> 699</span> </div>
<div class="line"><a id="l00700" name="l00700"></a><span class="lineno"> 700</span> <span class="comment">// F. Determine the power for the density term</span></div>
<div class="line"><a id="l00701" name="l00701"></a><span class="lineno"> 701</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> num_products = <a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a>.products().size();</div>
<div class="line"><a id="l00702" name="l00702"></a><span class="lineno"> 702</span> <span class="keyword">const</span> T rho_power = CppAD::pow(rho, <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(num_products &gt; 1 ? num_products - 1 : 0)); <span class="comment">// Density raised to the power of (N-1) for N products</span></div>
<div class="line"><a id="l00703" name="l00703"></a><span class="lineno"> 703</span> </div>
<div class="line"><a id="l00704" name="l00704"></a><span class="lineno"> 704</span> <span class="comment">// G. Assemble the reverse molar flow rate</span></div>
<div class="line"><a id="l00705" name="l00705"></a><span class="lineno"> 705</span> reverseMolarFlow = screeningFactors[reactionIndex] *</div>
<div class="line"><a id="l00706" name="l00706"></a><span class="lineno"> 706</span> reverseRateConstant *</div>
<div class="line"><a id="l00707" name="l00707"></a><span class="lineno"> 707</span> productAbundanceTerm *</div>
<div class="line"><a id="l00708" name="l00708"></a><span class="lineno"> 708</span> reverseSymmetryFactor *</div>
<div class="line"><a id="l00709" name="l00709"></a><span class="lineno"> 709</span> rho_power;</div>
<div class="line"><a id="l00710" name="l00710"></a><span class="lineno"> 710</span> }</div>
<div class="line"><a id="l00711" name="l00711"></a><span class="lineno"> 711</span> <span class="keywordflow">return</span> reverseMolarFlow;</div>
<div class="line"><a id="l00712" name="l00712"></a><span class="lineno"> 712</span> }</div>
2025-07-24 11:10:45 -04:00
</div>
<div class="line"><a id="l00713" name="l00713"></a><span class="lineno"> 713</span> </div>
<div class="line"><a id="l00714" name="l00714"></a><span class="lineno"> 714</span> <span class="keyword">template</span>&lt;IsArithmeticOrAD T&gt;</div>
<div class="foldopen" id="foldopen00715" data-start="{" data-end="}">
<div class="line"><a id="l00715" name="l00715"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#af41df9ce979b6410e12642cb093916c9"> 715</a></span> <a class="code hl_struct" href="structgridfire_1_1_step_derivatives.html">StepDerivatives&lt;T&gt;</a> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#af41df9ce979b6410e12642cb093916c9">GraphEngine::calculateAllDerivatives</a>(</div>
<div class="line"><a id="l00716" name="l00716"></a><span class="lineno"> 716</span> <span class="keyword">const</span> std::vector&lt;T&gt; &amp;Y_in, T T9, T rho)<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00717" name="l00717"></a><span class="lineno"> 717</span> std::vector&lt;T&gt; screeningFactors = <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#af17cf3762abac3efcab9a8e87c961210">m_screeningModel</a>-&gt;calculateScreeningFactors(</div>
<div class="line"><a id="l00718" name="l00718"></a><span class="lineno"> 718</span> <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#acb7c4f5108b0efeae48ad15598e808c3">m_reactions</a>,</div>
<div class="line"><a id="l00719" name="l00719"></a><span class="lineno"> 719</span> <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a92d26068ba139e47d335f5fe9e2814cc">m_networkSpecies</a>,</div>
<div class="line"><a id="l00720" name="l00720"></a><span class="lineno"> 720</span> Y_in,</div>
<div class="line"><a id="l00721" name="l00721"></a><span class="lineno"> 721</span> T9,</div>
<div class="line"><a id="l00722" name="l00722"></a><span class="lineno"> 722</span> rho</div>
<div class="line"><a id="l00723" name="l00723"></a><span class="lineno"> 723</span> );</div>
<div class="line"><a id="l00724" name="l00724"></a><span class="lineno"> 724</span> </div>
<div class="line"><a id="l00725" name="l00725"></a><span class="lineno"> 725</span> <span class="comment">// --- Setup output derivatives structure ---</span></div>
<div class="line"><a id="l00726" name="l00726"></a><span class="lineno"> 726</span> <a class="code hl_struct" href="structgridfire_1_1_step_derivatives.html">StepDerivatives&lt;T&gt;</a> result;</div>
<div class="line"><a id="l00727" name="l00727"></a><span class="lineno"> 727</span> result.<a class="code hl_variable" href="structgridfire_1_1_step_derivatives.html#ae0de268b86c2404379409c4feae0b34d">dydt</a>.resize(<a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a92d26068ba139e47d335f5fe9e2814cc">m_networkSpecies</a>.size(), <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(0.0));</div>
<div class="line"><a id="l00728" name="l00728"></a><span class="lineno"> 728</span> </div>
<div class="line"><a id="l00729" name="l00729"></a><span class="lineno"> 729</span> <span class="comment">// --- AD Pre-setup (flags to control conditionals in an AD safe / branch aware manner) ---</span></div>
<div class="line"><a id="l00730" name="l00730"></a><span class="lineno"> 730</span> <span class="comment">// ----- Constants for AD safe calculations ---</span></div>
<div class="line"><a id="l00731" name="l00731"></a><span class="lineno"> 731</span> <span class="keyword">const</span> T zero = <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(0.0);</div>
<div class="line"><a id="l00732" name="l00732"></a><span class="lineno"> 732</span> <span class="keyword">const</span> T one = <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(1.0);</div>
<div class="line"><a id="l00733" name="l00733"></a><span class="lineno"> 733</span> </div>
<div class="line"><a id="l00734" name="l00734"></a><span class="lineno"> 734</span> <span class="comment">// ----- Initialize variables for molar concentration product and thresholds ---</span></div>
<div class="line"><a id="l00735" name="l00735"></a><span class="lineno"> 735</span> <span class="comment">// Note: the logic here is that we use CppAD::CondExprLt to test thresholds and if they are less we set the flag</span></div>
<div class="line"><a id="l00736" name="l00736"></a><span class="lineno"> 736</span> <span class="comment">// to zero so that the final returned reaction flow is 0. This is as opposed to standard if statements</span></div>
<div class="line"><a id="l00737" name="l00737"></a><span class="lineno"> 737</span> <span class="comment">// which create branches that break the AD tape.</span></div>
<div class="line"><a id="l00738" name="l00738"></a><span class="lineno"> 738</span> <span class="keyword">const</span> T rho_threshold = <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(<a class="code hl_variable" href="namespacegridfire.html#ada3c137c014ecd8d06200fea2d1a9f50">MIN_DENSITY_THRESHOLD</a>);</div>
<div class="line"><a id="l00739" name="l00739"></a><span class="lineno"> 739</span> </div>
<div class="line"><a id="l00740" name="l00740"></a><span class="lineno"> 740</span> <span class="comment">// --- Check if the density is below the threshold where we ignore reactions ---</span></div>
<div class="line"><a id="l00741" name="l00741"></a><span class="lineno"> 741</span> T threshold_flag = CppAD::CondExpLt(rho, rho_threshold, zero, one); <span class="comment">// If rho &lt; threshold, set flag to 0</span></div>
<div class="line"><a id="l00742" name="l00742"></a><span class="lineno"> 742</span> </div>
<div class="line"><a id="l00743" name="l00743"></a><span class="lineno"> 743</span> std::vector&lt;T&gt; Y = Y_in;</div>
<div class="line"><a id="l00744" name="l00744"></a><span class="lineno"> 744</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a92d26068ba139e47d335f5fe9e2814cc">m_networkSpecies</a>.size(); ++i) {</div>
<div class="line"><a id="l00745" name="l00745"></a><span class="lineno"> 745</span> <span class="comment">// We use CppAD::CondExpLt to handle AD taping and prevent branching</span></div>
<div class="line"><a id="l00746" name="l00746"></a><span class="lineno"> 746</span> <span class="comment">// Note that while this is syntactically more complex this is equivalent to</span></div>
<div class="line"><a id="l00747" name="l00747"></a><span class="lineno"> 747</span> <span class="comment">// if (Y[i] &lt; 0) {Y[i] = 0;}</span></div>
<div class="line"><a id="l00748" name="l00748"></a><span class="lineno"> 748</span> <span class="comment">// The issue is that this would introduce a branch which would require the auto diff tape to be re-recorded</span></div>
<div class="line"><a id="l00749" name="l00749"></a><span class="lineno"> 749</span> <span class="comment">// each timestep, which is very inefficient.</span></div>
<div class="line"><a id="l00750" name="l00750"></a><span class="lineno"> 750</span> Y[i] = CppAD::CondExpLt(Y[i], zero, zero, Y[i]); <span class="comment">// Ensure no negative abundances</span></div>
<div class="line"><a id="l00751" name="l00751"></a><span class="lineno"> 751</span> }</div>
<div class="line"><a id="l00752" name="l00752"></a><span class="lineno"> 752</span> </div>
<div class="line"><a id="l00753" name="l00753"></a><span class="lineno"> 753</span> <span class="keyword">const</span> T u = <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(<a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a10c01bc20ae668c2857efb2a1783098e">m_constants</a>.u); <span class="comment">// Atomic mass unit in grams</span></div>
<div class="line"><a id="l00754" name="l00754"></a><span class="lineno"> 754</span> <span class="keyword">const</span> T N_A = <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(<a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a10c01bc20ae668c2857efb2a1783098e">m_constants</a>.Na); <span class="comment">// Avogadro&#39;s number in mol^-1</span></div>
<div class="line"><a id="l00755" name="l00755"></a><span class="lineno"> 755</span> <span class="keyword">const</span> T c = <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(<a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a10c01bc20ae668c2857efb2a1783098e">m_constants</a>.c); <span class="comment">// Speed of light in cm/s</span></div>
<div class="line"><a id="l00756" name="l00756"></a><span class="lineno"> 756</span> </div>
<div class="line"><a id="l00757" name="l00757"></a><span class="lineno"> 757</span> <span class="comment">// --- SINGLE LOOP OVER ALL REACTIONS ---</span></div>
<div class="line"><a id="l00758" name="l00758"></a><span class="lineno"> 758</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> reactionIndex = 0; reactionIndex &lt; <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#acb7c4f5108b0efeae48ad15598e808c3">m_reactions</a>.size(); ++reactionIndex) {</div>
<div class="line"><a id="l00759" name="l00759"></a><span class="lineno"> 759</span> <span class="keyword">const</span> <span class="keyword">auto</span>&amp; <a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a> = <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#acb7c4f5108b0efeae48ad15598e808c3">m_reactions</a>[reactionIndex];</div>
<div class="line"><a id="l00760" name="l00760"></a><span class="lineno"> 760</span> </div>
<div class="line"><a id="l00761" name="l00761"></a><span class="lineno"> 761</span> <span class="comment">// 1. Calculate forward reaction rate</span></div>
<div class="line"><a id="l00762" name="l00762"></a><span class="lineno"> 762</span> <span class="keyword">const</span> T forwardMolarReactionFlow = screeningFactors[reactionIndex] *</div>
<div class="line"><a id="l00763" name="l00763"></a><span class="lineno"> 763</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a9245642b741f215e52861d00e756fb3f">calculateMolarReactionFlow&lt;T&gt;</a>(<a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a>, Y, T9, rho);</div>
<div class="line"><a id="l00764" name="l00764"></a><span class="lineno"> 764</span> </div>
<div class="line"><a id="l00765" name="l00765"></a><span class="lineno"> 765</span> <span class="comment">// 2. Calculate reverse reaction rate</span></div>
<div class="line"><a id="l00766" name="l00766"></a><span class="lineno"> 766</span> T reverseMolarFlow = <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a17774cd9ffcf1ba94019df766a0984a0">calculateReverseMolarReactionFlow&lt;T&gt;</a>(</div>
<div class="line"><a id="l00767" name="l00767"></a><span class="lineno"> 767</span> T9,</div>
<div class="line"><a id="l00768" name="l00768"></a><span class="lineno"> 768</span> rho,</div>
<div class="line"><a id="l00769" name="l00769"></a><span class="lineno"> 769</span> screeningFactors,</div>
<div class="line"><a id="l00770" name="l00770"></a><span class="lineno"> 770</span> Y,</div>
<div class="line"><a id="l00771" name="l00771"></a><span class="lineno"> 771</span> reactionIndex,</div>
<div class="line"><a id="l00772" name="l00772"></a><span class="lineno"> 772</span> <a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a></div>
<div class="line"><a id="l00773" name="l00773"></a><span class="lineno"> 773</span> );</div>
<div class="line"><a id="l00774" name="l00774"></a><span class="lineno"> 774</span> </div>
<div class="line"><a id="l00775" name="l00775"></a><span class="lineno"> 775</span> <span class="keyword">const</span> T molarReactionFlow = forwardMolarReactionFlow - reverseMolarFlow; <span class="comment">// Net molar reaction flow</span></div>
<div class="line"><a id="l00776" name="l00776"></a><span class="lineno"> 776</span> </div>
<div class="line"><a id="l00777" name="l00777"></a><span class="lineno"> 777</span> <span class="comment">// 3. Use the rate to update all relevant species derivatives (dY/dt)</span></div>
<div class="line"><a id="l00778" name="l00778"></a><span class="lineno"> 778</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> speciesIndex = 0; speciesIndex &lt; <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a92d26068ba139e47d335f5fe9e2814cc">m_networkSpecies</a>.size(); ++speciesIndex) {</div>
<div class="line"><a id="l00779" name="l00779"></a><span class="lineno"> 779</span> <span class="keyword">const</span> T nu_ij = <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(<a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#ad1cb5fd32efc37668e2d9ecf0c72ad24">m_stoichiometryMatrix</a>(speciesIndex, reactionIndex));</div>
<div class="line"><a id="l00780" name="l00780"></a><span class="lineno"> 780</span> result.<a class="code hl_variable" href="structgridfire_1_1_step_derivatives.html#ae0de268b86c2404379409c4feae0b34d">dydt</a>[speciesIndex] += threshold_flag * nu_ij * molarReactionFlow;</div>
<div class="line"><a id="l00781" name="l00781"></a><span class="lineno"> 781</span> }</div>
<div class="line"><a id="l00782" name="l00782"></a><span class="lineno"> 782</span> }</div>
<div class="line"><a id="l00783" name="l00783"></a><span class="lineno"> 783</span> </div>
<div class="line"><a id="l00784" name="l00784"></a><span class="lineno"> 784</span> T massProductionRate = <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(0.0); <span class="comment">// [mol][s^-1]</span></div>
<div class="line"><a id="l00785" name="l00785"></a><span class="lineno"> 785</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; [species, index] : <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#ad8237c252145a75092202d00f5e1ddf7">m_speciesToIndexMap</a>) {</div>
<div class="line"><a id="l00786" name="l00786"></a><span class="lineno"> 786</span> massProductionRate += result.<a class="code hl_variable" href="structgridfire_1_1_step_derivatives.html#ae0de268b86c2404379409c4feae0b34d">dydt</a>[index] * species.mass() * u;</div>
<div class="line"><a id="l00787" name="l00787"></a><span class="lineno"> 787</span> }</div>
<div class="line"><a id="l00788" name="l00788"></a><span class="lineno"> 788</span> </div>
<div class="line"><a id="l00789" name="l00789"></a><span class="lineno"> 789</span> result.<a class="code hl_variable" href="structgridfire_1_1_step_derivatives.html#ab4aeb41be952c7b5844e1ee81fef9008">nuclearEnergyGenerationRate</a> = -massProductionRate * N_A * c * c; <span class="comment">// [cm^2][s^-3] = [erg][s^-1][g^-1]</span></div>
2025-07-24 11:10:45 -04:00
<div class="line"><a id="l00790" name="l00790"></a><span class="lineno"> 790</span> </div>
<div class="line"><a id="l00791" name="l00791"></a><span class="lineno"> 791</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00792" name="l00792"></a><span class="lineno"> 792</span> }</div>
</div>
<div class="line"><a id="l00793" name="l00793"></a><span class="lineno"> 793</span> </div>
2025-07-24 11:10:45 -04:00
<div class="line"><a id="l00794" name="l00794"></a><span class="lineno"> 794</span> </div>
<div class="line"><a id="l00795" name="l00795"></a><span class="lineno"> 795</span> <span class="keyword">template</span> &lt;IsArithmeticOrAD T&gt;</div>
<div class="foldopen" id="foldopen00796" data-start="{" data-end="}">
<div class="line"><a id="l00796" name="l00796"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a5e96b5a0b34c8932f0e14eabda57f1a4"> 796</a></span> T <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a9245642b741f215e52861d00e756fb3f">GraphEngine::calculateMolarReactionFlow</a>(</div>
<div class="line"><a id="l00797" name="l00797"></a><span class="lineno"> 797</span> <span class="keyword">const</span> <a class="code hl_class" href="classgridfire_1_1reaction_1_1_reaction.html">reaction::Reaction</a> &amp;<a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a>,</div>
<div class="line"><a id="l00798" name="l00798"></a><span class="lineno"> 798</span> <span class="keyword">const</span> std::vector&lt;T&gt; &amp;Y,</div>
<div class="line"><a id="l00799" name="l00799"></a><span class="lineno"> 799</span> <span class="keyword">const</span> T T9,</div>
<div class="line"><a id="l00800" name="l00800"></a><span class="lineno"> 800</span> <span class="keyword">const</span> T rho</div>
<div class="line"><a id="l00801" name="l00801"></a><span class="lineno"> 801</span> )<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00802" name="l00802"></a><span class="lineno"> 802</span> </div>
<div class="line"><a id="l00803" name="l00803"></a><span class="lineno"> 803</span> <span class="comment">// --- Pre-setup (flags to control conditionals in an AD safe / branch aware manner) ---</span></div>
<div class="line"><a id="l00804" name="l00804"></a><span class="lineno"> 804</span> <span class="comment">// ----- Constants for AD safe calculations ---</span></div>
<div class="line"><a id="l00805" name="l00805"></a><span class="lineno"> 805</span> <span class="keyword">const</span> T zero = <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(0.0);</div>
2025-07-24 11:10:45 -04:00
<div class="line"><a id="l00806" name="l00806"></a><span class="lineno"> 806</span> </div>
<div class="line"><a id="l00807" name="l00807"></a><span class="lineno"> 807</span> <span class="comment">// --- Calculate the molar reaction rate (in units of [s^-1][cm^3(N-1)][mol^(1-N)] for N reactants) ---</span></div>
<div class="line"><a id="l00808" name="l00808"></a><span class="lineno"> 808</span> <span class="keyword">const</span> T k_reaction = <a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a>.calculate_rate(T9);</div>
<div class="line"><a id="l00809" name="l00809"></a><span class="lineno"> 809</span> </div>
<div class="line"><a id="l00810" name="l00810"></a><span class="lineno"> 810</span> <span class="comment">// --- Cound the number of each reactant species to account for species multiplicity ---</span></div>
<div class="line"><a id="l00811" name="l00811"></a><span class="lineno"> 811</span> std::unordered_map&lt;std::string, int&gt; reactant_counts;</div>
<div class="line"><a id="l00812" name="l00812"></a><span class="lineno"> 812</span> reactant_counts.reserve(<a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a>.reactants().size());</div>
<div class="line"><a id="l00813" name="l00813"></a><span class="lineno"> 813</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; reactant : <a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a>.reactants()) {</div>
<div class="line"><a id="l00814" name="l00814"></a><span class="lineno"> 814</span> reactant_counts[std::string(reactant.name())]++;</div>
<div class="line"><a id="l00815" name="l00815"></a><span class="lineno"> 815</span> }</div>
<div class="line"><a id="l00816" name="l00816"></a><span class="lineno"> 816</span> <span class="keyword">const</span> <span class="keywordtype">int</span> totalReactants = <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span>(<a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a>.reactants().size());</div>
<div class="line"><a id="l00817" name="l00817"></a><span class="lineno"> 817</span> </div>
<div class="line"><a id="l00818" name="l00818"></a><span class="lineno"> 818</span> <span class="comment">// --- Accumulator for the molar concentration ---</span></div>
<div class="line"><a id="l00819" name="l00819"></a><span class="lineno"> 819</span> <span class="keyword">auto</span> molar_concentration_product = <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(1.0);</div>
2025-07-24 11:10:45 -04:00
<div class="line"><a id="l00820" name="l00820"></a><span class="lineno"> 820</span> </div>
<div class="line"><a id="l00821" name="l00821"></a><span class="lineno"> 821</span> <span class="comment">// --- Loop through each unique reactant species and calculate the molar concentration for that species then multiply that into the accumulator ---</span></div>
<div class="line"><a id="l00822" name="l00822"></a><span class="lineno"> 822</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; [species_name, count] : reactant_counts) {</div>
<div class="line"><a id="l00823" name="l00823"></a><span class="lineno"> 823</span> <span class="comment">// --- Resolve species to molar abundance ---</span></div>
<div class="line"><a id="l00824" name="l00824"></a><span class="lineno"> 824</span> <span class="comment">// PERF: Could probably optimize out this lookup</span></div>
<div class="line"><a id="l00825" name="l00825"></a><span class="lineno"> 825</span> <span class="keyword">const</span> <span class="keyword">auto</span> species_it = <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#ad8237c252145a75092202d00f5e1ddf7">m_speciesToIndexMap</a>.find(<a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a30e09ed0bce6aa5fc89beaa316a7b827">m_networkSpeciesMap</a>.at(species_name));</div>
<div class="line"><a id="l00826" name="l00826"></a><span class="lineno"> 826</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> species_index = species_it-&gt;second;</div>
<div class="line"><a id="l00827" name="l00827"></a><span class="lineno"> 827</span> <span class="keyword">const</span> T Yi = Y[species_index];</div>
<div class="line"><a id="l00828" name="l00828"></a><span class="lineno"> 828</span> </div>
<div class="line"><a id="l00829" name="l00829"></a><span class="lineno"> 829</span> <span class="comment">// --- If count is &gt; 1 , we need to raise the molar concentration to the power of count since there are really count bodies in that reaction ---</span></div>
<div class="line"><a id="l00830" name="l00830"></a><span class="lineno"> 830</span> molar_concentration_product *= CppAD::pow(Yi, <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(count)); <span class="comment">// ni^count</span></div>
<div class="line"><a id="l00831" name="l00831"></a><span class="lineno"> 831</span> </div>
<div class="line"><a id="l00832" name="l00832"></a><span class="lineno"> 832</span> <span class="comment">// --- Apply factorial correction for identical reactions ---</span></div>
<div class="line"><a id="l00833" name="l00833"></a><span class="lineno"> 833</span> <span class="keywordflow">if</span> (count &gt; 1) {</div>
<div class="line"><a id="l00834" name="l00834"></a><span class="lineno"> 834</span> molar_concentration_product /= <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(std::tgamma(<span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(count + 1))); <span class="comment">// Gamma function for factorial</span></div>
<div class="line"><a id="l00835" name="l00835"></a><span class="lineno"> 835</span> }</div>
<div class="line"><a id="l00836" name="l00836"></a><span class="lineno"> 836</span> }</div>
<div class="line"><a id="l00837" name="l00837"></a><span class="lineno"> 837</span> <span class="comment">// --- Final reaction flow calculation [mol][s^-1][g^-1] ---</span></div>
<div class="line"><a id="l00838" name="l00838"></a><span class="lineno"> 838</span> <span class="comment">// Note: If the threshold flag ever gets set to zero this will return zero.</span></div>
<div class="line"><a id="l00839" name="l00839"></a><span class="lineno"> 839</span> <span class="comment">// This will result basically in multiple branches being written to the AD tape, which will make</span></div>
<div class="line"><a id="l00840" name="l00840"></a><span class="lineno"> 840</span> <span class="comment">// the tape more expensive to record, but it will also mean that we only need to record it once for</span></div>
<div class="line"><a id="l00841" name="l00841"></a><span class="lineno"> 841</span> <span class="comment">// the entire network.</span></div>
<div class="line"><a id="l00842" name="l00842"></a><span class="lineno"> 842</span> <span class="keyword">const</span> T densityTerm = CppAD::pow(rho, totalReactants &gt; 1 ? <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(totalReactants - 1) : zero); <span class="comment">// Density raised to the power of (N-1) for N reactants</span></div>
<div class="line"><a id="l00843" name="l00843"></a><span class="lineno"> 843</span> <span class="keywordflow">return</span> molar_concentration_product * k_reaction * densityTerm;</div>
<div class="line"><a id="l00844" name="l00844"></a><span class="lineno"> 844</span> }</div>
</div>
<div class="line"><a id="l00845" name="l00845"></a><span class="lineno"> 845</span> </div>
<div class="line"><a id="l00846" name="l00846"></a><span class="lineno"> 846</span>};</div>
2025-07-24 11:10:45 -04:00
<div class="ttc" id="aclassgridfire_1_1_dynamic_engine_html"><div class="ttname"><a href="classgridfire_1_1_dynamic_engine.html">gridfire::DynamicEngine</a></div><div class="ttdoc">Abstract class for engines supporting Jacobian and stoichiometry operations.</div><div class="ttdef"><b>Definition</b> <a href="engine__abstract_8h_source.html#l00130">engine_abstract.h:130</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_1_1_atomic_reverse_rate_html_a20d8e668f0af5fad5b7eda12564dc7cf"><div class="ttname"><a href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#a20d8e668f0af5fad5b7eda12564dc7cf">gridfire::GraphEngine::AtomicReverseRate::AtomicReverseRate</a></div><div class="ttdeci">AtomicReverseRate(const reaction::Reaction &amp;reaction, const GraphEngine &amp;engine)</div><div class="ttdef"><b>Definition</b> <a href="#l00408">engine_graph.h:408</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_1_1_atomic_reverse_rate_html_a4e8ff268c4377599c8798c7929ec2d5e"><div class="ttname"><a href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#a4e8ff268c4377599c8798c7929ec2d5e">gridfire::GraphEngine::AtomicReverseRate::reverse</a></div><div class="ttdeci">bool reverse(size_t q, const CppAD::vector&lt; double &gt; &amp;tx, const CppAD::vector&lt; double &gt; &amp;ty, CppAD::vector&lt; double &gt; &amp;px, const CppAD::vector&lt; double &gt; &amp;py) override</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l01051">engine_graph.cpp:1051</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_1_1_atomic_reverse_rate_html_a75d355a0bef27217165644affd0cca4d"><div class="ttname"><a href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#a75d355a0bef27217165644affd0cca4d">gridfire::GraphEngine::AtomicReverseRate::m_engine</a></div><div class="ttdeci">const GraphEngine &amp; m_engine</div><div class="ttdef"><b>Definition</b> <a href="#l00444">engine_graph.h:444</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_1_1_atomic_reverse_rate_html_a881d4daf2b973d523548cd8d4021bdc4"><div class="ttname"><a href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#a881d4daf2b973d523548cd8d4021bdc4">gridfire::GraphEngine::AtomicReverseRate::rev_sparse_jac</a></div><div class="ttdeci">bool rev_sparse_jac(size_t q, const CppAD::vector&lt; std::set&lt; size_t &gt; &gt; &amp;rt, CppAD::vector&lt; std::set&lt; size_t &gt; &gt; &amp;st) override</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l01078">engine_graph.cpp:1078</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_1_1_atomic_reverse_rate_html_a98ed8b450f7868f55e8362a848a4710d"><div class="ttname"><a href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#a98ed8b450f7868f55e8362a848a4710d">gridfire::GraphEngine::AtomicReverseRate::m_reaction</a></div><div class="ttdeci">const reaction::Reaction &amp; m_reaction</div><div class="ttdef"><b>Definition</b> <a href="#l00443">engine_graph.h:443</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_1_1_atomic_reverse_rate_html_ad9b8dd0e8ba9c7745e33acc9a649d2e0"><div class="ttname"><a href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#ad9b8dd0e8ba9c7745e33acc9a649d2e0">gridfire::GraphEngine::AtomicReverseRate::forward</a></div><div class="ttdeci">bool forward(size_t p, size_t q, const CppAD::vector&lt; bool &gt; &amp;vx, CppAD::vector&lt; bool &gt; &amp;vy, const CppAD::vector&lt; double &gt; &amp;tx, CppAD::vector&lt; double &gt; &amp;ty) override</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l01029">engine_graph.cpp:1029</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_1_1_atomic_reverse_rate_html_aec41632c2a362be33a1f7ff04204cbf4"><div class="ttname"><a href="classgridfire_1_1_graph_engine_1_1_atomic_reverse_rate.html#aec41632c2a362be33a1f7ff04204cbf4">gridfire::GraphEngine::AtomicReverseRate::for_sparse_jac</a></div><div class="ttdeci">bool for_sparse_jac(size_t q, const CppAD::vector&lt; std::set&lt; size_t &gt; &gt; &amp;r, CppAD::vector&lt; std::set&lt; size_t &gt; &gt; &amp;s) override</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l01069">engine_graph.cpp:1069</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a015f8975701f028c29835d3a9794e00f"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a015f8975701f028c29835d3a9794e00f">gridfire::GraphEngine::isPrecomputationEnabled</a></div><div class="ttdeci">bool isPrecomputationEnabled() const</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00615">engine_graph.cpp:615</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a01fc9fd5d576b66d07360d05e821c755"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a01fc9fd5d576b66d07360d05e821c755">gridfire::GraphEngine::calculateReverseRateTwoBody</a></div><div class="ttdeci">double calculateReverseRateTwoBody(const reaction::Reaction &amp;reaction, const double T9, const double forwardRate, const double expFactor) const</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00269">engine_graph.cpp:269</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a0b7b85f824e1021ae6e56b644db53b28"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a0b7b85f824e1021ae6e56b644db53b28">gridfire::GraphEngine::calculateReverseRate</a></div><div class="ttdeci">double calculateReverseRate(const reaction::Reaction &amp;reaction, double T9) const</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00242">engine_graph.cpp:242</a></div></div>
2025-07-24 11:10:45 -04:00
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a0ed390f3e598ebba4e245ac90bb78767"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a0ed390f3e598ebba4e245ac90bb78767">gridfire::GraphEngine::getNetworkSpecies</a></div><div class="ttdeci">const std::vector&lt; fourdst::atomic::Species &gt; &amp; getNetworkSpecies() const override</div><div class="ttdoc">Gets the list of species in the network.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00162">engine_graph.cpp:162</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a10c01bc20ae668c2857efb2a1783098e"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a10c01bc20ae668c2857efb2a1783098e">gridfire::GraphEngine::m_constants</a></div><div class="ttdeci">constants m_constants</div><div class="ttdef"><b>Definition</b> <a href="#l00450">engine_graph.h:450</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a166a5f4349580f9aa0b930afec73fcc4"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a166a5f4349580f9aa0b930afec73fcc4">gridfire::GraphEngine::getDepth</a></div><div class="ttdeci">BuildDepthType getDepth() const override</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00434">engine_graph.cpp:434</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a17774cd9ffcf1ba94019df766a0984a0"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a17774cd9ffcf1ba94019df766a0984a0">gridfire::GraphEngine::calculateReverseMolarReactionFlow</a></div><div class="ttdeci">T calculateReverseMolarReactionFlow(T T9, T rho, std::vector&lt; T &gt; screeningFactors, std::vector&lt; T &gt; Y, size_t reactionIndex, const reaction::LogicalReaction &amp;reaction) const</div><div class="ttdef"><b>Definition</b> <a href="#l00648">engine_graph.h:648</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a191cff35402d3c97c82c5c966a39d0de"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a191cff35402d3c97c82c5c966a39d0de">gridfire::GraphEngine::m_usePrecomputation</a></div><div class="ttdeci">bool m_usePrecomputation</div><div class="ttdoc">Flag to enable or disable using precomputed reactions for efficiency. Mathematically,...</div><div class="ttdef"><b>Definition</b> <a href="#l00471">engine_graph.h:471</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a19b2eea0e8d05ac90f9fd7120bdc6e06"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a19b2eea0e8d05ac90f9fd7120bdc6e06">gridfire::GraphEngine::m_full_jacobian_sparsity_pattern</a></div><div class="ttdeci">CppAD::sparse_rc&lt; std::vector&lt; size_t &gt; &gt; m_full_jacobian_sparsity_pattern</div><div class="ttdoc">Full sparsity pattern for the Jacobian matrix.</div><div class="ttdef"><b>Definition</b> <a href="#l00464">engine_graph.h:464</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a250cc6350dc052fbdfdf9a02066e7891"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a250cc6350dc052fbdfdf9a02066e7891">gridfire::GraphEngine::m_jac_work</a></div><div class="ttdeci">CppAD::sparse_jac_work m_jac_work</div><div class="ttdoc">Work object for sparse Jacobian calculations.</div><div class="ttdef"><b>Definition</b> <a href="#l00463">engine_graph.h:463</a></div></div>
2025-07-24 11:10:45 -04:00
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a26602e1b3c610780a47b5a6511d6d567"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a26602e1b3c610780a47b5a6511d6d567">gridfire::GraphEngine::populateReactionIDMap</a></div><div class="ttdeci">void populateReactionIDMap()</div><div class="ttdoc">Populates the reaction ID map.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00135">engine_graph.cpp:135</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a27f3a928e1f6bbe7e847cffed6db729f"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a27f3a928e1f6bbe7e847cffed6db729f">gridfire::GraphEngine::mapNetInToMolarAbundanceVector</a></div><div class="ttdeci">std::vector&lt; double &gt; mapNetInToMolarAbundanceVector(const NetIn &amp;netIn) const override</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00399">engine_graph.cpp:399</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a29b338630c959449c15881935ac30746"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a29b338630c959449c15881935ac30746">gridfire::GraphEngine::collectAtomicReverseRateAtomicBases</a></div><div class="ttdeci">void collectAtomicReverseRateAtomicBases()</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00947">engine_graph.cpp:947</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a2e22b111f6d00ecc9e3804a71f1ce876"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a2e22b111f6d00ecc9e3804a71f1ce876">gridfire::GraphEngine::m_rhsADFun</a></div><div class="ttdeci">CppAD::ADFun&lt; double &gt; m_rhsADFun</div><div class="ttdoc">CppAD function for the right-hand side of the ODE.</div><div class="ttdef"><b>Definition</b> <a href="#l00462">engine_graph.h:462</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a2f1718c89d4aaad028102724d18fa910"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a2f1718c89d4aaad028102724d18fa910">gridfire::GraphEngine::m_jacobianMatrix</a></div><div class="ttdeci">boost::numeric::ublas::compressed_matrix&lt; double &gt; m_jacobianMatrix</div><div class="ttdoc">Jacobian matrix (species x species).</div><div class="ttdef"><b>Definition</b> <a href="#l00461">engine_graph.h:461</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a303e6093591cde91430f866a04a8be7c"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a303e6093591cde91430f866a04a8be7c">gridfire::GraphEngine::getJacobianMatrixEntry</a></div><div class="ttdeci">double getJacobianMatrixEntry(const int i, const int j) const override</div><div class="ttdoc">Gets an entry from the previously generated Jacobian matrix.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00722">engine_graph.cpp:722</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a30e09ed0bce6aa5fc89beaa316a7b827"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a30e09ed0bce6aa5fc89beaa316a7b827">gridfire::GraphEngine::m_networkSpeciesMap</a></div><div class="ttdeci">std::unordered_map&lt; std::string_view, fourdst::atomic::Species &gt; m_networkSpeciesMap</div><div class="ttdoc">Map from species name to Species object.</div><div class="ttdef"><b>Definition</b> <a href="#l00456">engine_graph.h:456</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a32d3efbf4c3d5158f87c0c732cdc26dc"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a32d3efbf4c3d5158f87c0c732cdc26dc">gridfire::GraphEngine::m_useReverseReactions</a></div><div class="ttdeci">bool m_useReverseReactions</div><div class="ttdoc">Flag to enable or disable reverse reactions. If false, only forward reactions are considered.</div><div class="ttdef"><b>Definition</b> <a href="#l00473">engine_graph.h:473</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a3621f36d77ea8c738ad7de6e5b35ca3e"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a3621f36d77ea8c738ad7de6e5b35ca3e">gridfire::GraphEngine::m_partitionFunction</a></div><div class="ttdeci">std::unique_ptr&lt; partition::PartitionFunction &gt; m_partitionFunction</div><div class="ttdoc">Partition function for the network.</div><div class="ttdef"><b>Definition</b> <a href="#l00478">engine_graph.h:478</a></div></div>
2025-07-24 11:10:45 -04:00
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a371ba0881d6903ddb2d586faa61805d0"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a371ba0881d6903ddb2d586faa61805d0">gridfire::GraphEngine::setNetworkReactions</a></div><div class="ttdeci">void setNetworkReactions(const reaction::LogicalReactionSet &amp;reactions) override</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00174">engine_graph.cpp:174</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a3b17102b143435ddfdc015d7a50c4b18"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a3b17102b143435ddfdc015d7a50c4b18">gridfire::GraphEngine::m_config</a></div><div class="ttdeci">Config &amp; m_config</div><div class="ttdef"><b>Definition</b> <a href="#l00447">engine_graph.h:447</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a409991d527ea4d4b05d1af907fe5d197"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a409991d527ea4d4b05d1af907fe5d197">gridfire::GraphEngine::setUseReverseReactions</a></div><div class="ttdeci">void setUseReverseReactions(bool useReverse)</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00391">engine_graph.cpp:391</a></div></div>
2025-07-24 11:10:45 -04:00
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a47202c43342b96480070874bffce1391"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a47202c43342b96480070874bffce1391">gridfire::GraphEngine::populateSpeciesToIndexMap</a></div><div class="ttdeci">void populateSpeciesToIndexMap()</div><div class="ttdoc">Populates the species-to-index map.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00144">engine_graph.cpp:144</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a483979fc154adc88d029b3b672066d53"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a483979fc154adc88d029b3b672066d53">gridfire::GraphEngine::m_logger</a></div><div class="ttdeci">quill::Logger * m_logger</div><div class="ttdef"><b>Definition</b> <a href="#l00448">engine_graph.h:448</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a52edc3e88f1e8fc497e1e63972d63c80"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a52edc3e88f1e8fc497e1e63972d63c80">gridfire::GraphEngine::m_screeningType</a></div><div class="ttdeci">screening::ScreeningType m_screeningType</div><div class="ttdoc">Screening type for the reaction network. Default to no screening.</div><div class="ttdef"><b>Definition</b> <a href="#l00468">engine_graph.h:468</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a5ac7cff23e70bd07ba7e510b753e2ab6"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a5ac7cff23e70bd07ba7e510b753e2ab6">gridfire::GraphEngine::update</a></div><div class="ttdeci">fourdst::composition::Composition update(const NetIn &amp;netIn) override</div><div class="ttdoc">Update the internal state of the engine.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00886">engine_graph.cpp:886</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a5d431d5385b1219ba29689eb29601ea3"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a5d431d5385b1219ba29689eb29601ea3">gridfire::GraphEngine::m_precomputedReactions</a></div><div class="ttdeci">std::vector&lt; PrecomputedReaction &gt; m_precomputedReactions</div><div class="ttdoc">Precomputed reactions for efficiency.</div><div class="ttdef"><b>Definition</b> <a href="#l00477">engine_graph.h:477</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a5d6cc63b99b467c2a976d1fbaaa1dfa3"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a5d6cc63b99b467c2a976d1fbaaa1dfa3">gridfire::GraphEngine::m_reactionIDMap</a></div><div class="ttdeci">std::unordered_map&lt; std::string_view, reaction::Reaction * &gt; m_reactionIDMap</div><div class="ttdoc">Map from reaction ID to REACLIBReaction. //PERF: This makes copies of REACLIBReaction and could be a ...</div><div class="ttdef"><b>Definition</b> <a href="#l00453">engine_graph.h:453</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a65f9f33cddb0bbd1da7c9d0cff23d581"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a65f9f33cddb0bbd1da7c9d0cff23d581">gridfire::GraphEngine::getSpeciesTimescales</a></div><div class="ttdeci">std::expected&lt; std::unordered_map&lt; fourdst::atomic::Species, double &gt;, expectations::StaleEngineError &gt; getSpeciesTimescales(const std::vector&lt; double &gt; &amp;Y, double T9, double rho) const override</div><div class="ttdoc">Computes timescales for all species in the network.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00842">engine_graph.cpp:842</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a697f2004e0d02c59e83c7890742d7c9a"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a697f2004e0d02c59e83c7890742d7c9a">gridfire::GraphEngine::getScreeningModel</a></div><div class="ttdeci">screening::ScreeningType getScreeningModel() const override</div><div class="ttdoc">Get the current electron screening model.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00607">engine_graph.cpp:607</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a6b5feaf788bade212b7c8df7ac8c8152"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a6b5feaf788bade212b7c8df7ac8c8152">gridfire::GraphEngine::getStoichiometryMatrixEntry</a></div><div class="ttdeci">int getStoichiometryMatrixEntry(const int speciesIndex, const int reactionIndex) const override</div><div class="ttdoc">Gets an entry from the stoichiometry matrix.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00733">engine_graph.cpp:733</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a6c5410878496abc349ba30b691cdf0f1"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a6c5410878496abc349ba30b691cdf0f1">gridfire::GraphEngine::setPrecomputation</a></div><div class="ttdeci">void setPrecomputation(bool precompute)</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00611">engine_graph.cpp:611</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a80c73690d5af247ff9f2ba8b00abce01"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a80c73690d5af247ff9f2ba8b00abce01">gridfire::GraphEngine::m_depth</a></div><div class="ttdeci">BuildDepthType m_depth</div><div class="ttdef"><b>Definition</b> <a href="#l00475">engine_graph.h:475</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a8110e687844f921438bb517e1d8ce62f"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a8110e687844f921438bb517e1d8ce62f">gridfire::GraphEngine::setScreeningModel</a></div><div class="ttdeci">void setScreeningModel(screening::ScreeningType) override</div><div class="ttdoc">Set the electron screening model.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00602">engine_graph.cpp:602</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a816797b1d656d416844489692af44cf6"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a816797b1d656d416844489692af44cf6">gridfire::GraphEngine::m_atomicReverseRates</a></div><div class="ttdeci">std::vector&lt; std::unique_ptr&lt; AtomicReverseRate &gt; &gt; m_atomicReverseRates</div><div class="ttdef"><b>Definition</b> <a href="#l00466">engine_graph.h:466</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a832e2fe066381811a3e0464806ff5e95"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a832e2fe066381811a3e0464806ff5e95">gridfire::GraphEngine::exportToCSV</a></div><div class="ttdeci">void exportToCSV(const std::string &amp;filename) const</div><div class="ttdoc">Exports the network to a CSV file for analysis.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00788">engine_graph.cpp:788</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a8c29d8bbde407e913be5eb77efb2c0c9"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a8c29d8bbde407e913be5eb77efb2c0c9">gridfire::GraphEngine::getNetReactionStoichiometry</a></div><div class="ttdeci">static std::unordered_map&lt; fourdst::atomic::Species, int &gt; getNetReactionStoichiometry(const reaction::Reaction &amp;reaction)</div><div class="ttdoc">Gets the net stoichiometry for a given reaction.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00727">engine_graph.cpp:727</a></div></div>
2025-07-24 11:10:45 -04:00
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a8d0c0bd54a2908cff62dae7af0c149b5"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a8d0c0bd54a2908cff62dae7af0c149b5">gridfire::GraphEngine::reserveJacobianMatrix</a></div><div class="ttdeci">void reserveJacobianMatrix() const</div><div class="ttdoc">Reserves space for the Jacobian matrix.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00151">engine_graph.cpp:151</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a914f6abc61805cddaebcb8f3cf470dda"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a914f6abc61805cddaebcb8f3cf470dda">gridfire::GraphEngine::getSpeciesIndex</a></div><div class="ttdeci">int getSpeciesIndex(const fourdst::atomic::Species &amp;species) const override</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00395">engine_graph.cpp:395</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a9245642b741f215e52861d00e756fb3f"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a9245642b741f215e52861d00e756fb3f">gridfire::GraphEngine::calculateMolarReactionFlow</a></div><div class="ttdeci">double calculateMolarReactionFlow(const reaction::Reaction &amp;reaction, const std::vector&lt; double &gt; &amp;Y, const double T9, const double rho) const override</div><div class="ttdoc">Calculates the molar reaction flow for a given reaction.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00623">engine_graph.cpp:623</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a92644bc333bff69c5685be4552ca12fd"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a92644bc333bff69c5685be4552ca12fd">gridfire::GraphEngine::precomputeNetwork</a></div><div class="ttdeci">void precomputeNetwork()</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00960">engine_graph.cpp:960</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a92d26068ba139e47d335f5fe9e2814cc"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a92d26068ba139e47d335f5fe9e2814cc">gridfire::GraphEngine::m_networkSpecies</a></div><div class="ttdeci">std::vector&lt; fourdst::atomic::Species &gt; m_networkSpecies</div><div class="ttdoc">Vector of unique species in the network.</div><div class="ttdef"><b>Definition</b> <a href="#l00455">engine_graph.h:455</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a95563f6bc86007d9ee053a0f1e15b889"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a95563f6bc86007d9ee053a0f1e15b889">gridfire::GraphEngine::recordADTape</a></div><div class="ttdeci">void recordADTape()</div><div class="ttdoc">Records the AD tape for the right-hand side of the ODE.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00902">engine_graph.cpp:902</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a97f98706b51fbe0d167ed81ffe58c438"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a97f98706b51fbe0d167ed81ffe58c438">gridfire::GraphEngine::calculateAllDerivativesUsingPrecomputation</a></div><div class="ttdeci">StepDerivatives&lt; double &gt; calculateAllDerivativesUsingPrecomputation(const std::vector&lt; double &gt; &amp;Y_in, const std::vector&lt; double &gt; &amp;bare_rates, const std::vector&lt; double &gt; &amp;bare_reverse_rates, double T9, double rho) const</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00448">engine_graph.cpp:448</a></div></div>
2025-07-24 11:10:45 -04:00
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_aa6202cee0c3c481eda77cc9a91bc126b"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#aa6202cee0c3c481eda77cc9a91bc126b">gridfire::GraphEngine::involvesSpecies</a></div><div class="ttdeci">bool involvesSpecies(const fourdst::atomic::Species &amp;species) const</div><div class="ttdoc">Checks if a given species is involved in the network.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00179">engine_graph.cpp:179</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_aaed3743a52246b0f7bf03995e1c12081"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#aaed3743a52246b0f7bf03995e1c12081">gridfire::GraphEngine::calculateRHSAndEnergy</a></div><div class="ttdeci">std::expected&lt; StepDerivatives&lt; double &gt;, expectations::StaleEngineError &gt; calculateRHSAndEnergy(const std::vector&lt; double &gt; &amp;Y, const double T9, const double rho) const override</div><div class="ttdoc">Calculates the right-hand side (dY/dt) and energy generation rate.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00057">engine_graph.cpp:57</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_acb7c4f5108b0efeae48ad15598e808c3"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#acb7c4f5108b0efeae48ad15598e808c3">gridfire::GraphEngine::m_reactions</a></div><div class="ttdeci">reaction::LogicalReactionSet m_reactions</div><div class="ttdoc">Set of REACLIB reactions in the network.</div><div class="ttdef"><b>Definition</b> <a href="#l00452">engine_graph.h:452</a></div></div>
2025-07-24 11:10:45 -04:00
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_acdce8d87e23a2cd1504bc9472e538c0f"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#acdce8d87e23a2cd1504bc9472e538c0f">gridfire::GraphEngine::syncInternalMaps</a></div><div class="ttdeci">void syncInternalMaps()</div><div class="ttdoc">Synchronizes the internal maps.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00081">engine_graph.cpp:81</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_acf4cfccea20f5cb31c9886bf233a28be"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#acf4cfccea20f5cb31c9886bf233a28be">gridfire::GraphEngine::validateConservation</a></div><div class="ttdeci">bool validateConservation() const</div><div class="ttdoc">Validates mass and charge conservation across all reactions.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00187">engine_graph.cpp:187</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_ad049a295e2bb0f3e97b76d5742875119"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#ad049a295e2bb0f3e97b76d5742875119">gridfire::GraphEngine::generateJacobianMatrix</a></div><div class="ttdeci">void generateJacobianMatrix(const std::vector&lt; double &gt; &amp;Y_dynamic, const double T9, const double rho) const override</div><div class="ttdoc">Generates the Jacobian matrix for the current state.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00632">engine_graph.cpp:632</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_ad1cb5fd32efc37668e2d9ecf0c72ad24"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#ad1cb5fd32efc37668e2d9ecf0c72ad24">gridfire::GraphEngine::m_stoichiometryMatrix</a></div><div class="ttdeci">boost::numeric::ublas::compressed_matrix&lt; int &gt; m_stoichiometryMatrix</div><div class="ttdoc">Stoichiometry matrix (species x reactions).</div><div class="ttdef"><b>Definition</b> <a href="#l00459">engine_graph.h:459</a></div></div>
2025-07-24 11:10:45 -04:00
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_ad45650d10fc5dff1673ae3f806d067da"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#ad45650d10fc5dff1673ae3f806d067da">gridfire::GraphEngine::getNetworkReactions</a></div><div class="ttdeci">const reaction::LogicalReactionSet &amp; getNetworkReactions() const override</div><div class="ttdoc">Gets the set of logical reactions in the network.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00168">engine_graph.cpp:168</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_ad8237c252145a75092202d00f5e1ddf7"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#ad8237c252145a75092202d00f5e1ddf7">gridfire::GraphEngine::m_speciesToIndexMap</a></div><div class="ttdeci">std::unordered_map&lt; fourdst::atomic::Species, size_t &gt; m_speciesToIndexMap</div><div class="ttdoc">Map from species to their index in the stoichiometry matrix.</div><div class="ttdef"><b>Definition</b> <a href="#l00457">engine_graph.h:457</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_ad9d6c70ace5cbbf7f3aa7b31fce39490"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#ad9d6c70ace5cbbf7f3aa7b31fce39490">gridfire::GraphEngine::rebuild</a></div><div class="ttdeci">void rebuild(const fourdst::composition::Composition &amp;comp, const BuildDepthType depth) override</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00438">engine_graph.cpp:438</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_adac8c7d62bae76e17fc060e86dadd929"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#adac8c7d62bae76e17fc060e86dadd929">gridfire::GraphEngine::exportToDot</a></div><div class="ttdeci">void exportToDot(const std::string &amp;filename) const</div><div class="ttdoc">Exports the network to a DOT file for visualization.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00740">engine_graph.cpp:740</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_add98ece49ec5c538bddf3cc77004fe44"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#add98ece49ec5c538bddf3cc77004fe44">gridfire::GraphEngine::getPartitionFunction</a></div><div class="ttdeci">const partition::PartitionFunction &amp; getPartitionFunction() const</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00619">engine_graph.cpp:619</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_ae7a210d9ab13ad5fb0c612f027acabd0"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#ae7a210d9ab13ad5fb0c612f027acabd0">gridfire::GraphEngine::isUsingReverseReactions</a></div><div class="ttdeci">bool isUsingReverseReactions() const</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00387">engine_graph.cpp:387</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_ae7a371be61ab09b3fa4a93f05bd44e5e"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#ae7a371be61ab09b3fa4a93f05bd44e5e">gridfire::GraphEngine::primeEngine</a></div><div class="ttdeci">PrimingReport primeEngine(const NetIn &amp;netIn) override</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00407">engine_graph.cpp:407</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_aed726d36ee2b3796beff6067a1e4db38"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#aed726d36ee2b3796beff6067a1e4db38">gridfire::GraphEngine::generateStoichiometryMatrix</a></div><div class="ttdeci">void generateStoichiometryMatrix() override</div><div class="ttdoc">Generates the stoichiometry matrix for the network.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00545">engine_graph.cpp:545</a></div></div>
2025-07-24 11:10:45 -04:00
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_aedf42d83bfcc28313b6b6454034d2efa"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#aedf42d83bfcc28313b6b6454034d2efa">gridfire::GraphEngine::collectNetworkSpecies</a></div><div class="ttdeci">void collectNetworkSpecies()</div><div class="ttdoc">Collects the unique species in the network.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00106">engine_graph.cpp:106</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_aef8f6bde24d27345067b71084330c7da"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#aef8f6bde24d27345067b71084330c7da">gridfire::GraphEngine::getSpeciesDestructionTimescales</a></div><div class="ttdeci">std::expected&lt; std::unordered_map&lt; fourdst::atomic::Species, double &gt;, expectations::StaleEngineError &gt; getSpeciesDestructionTimescales(const std::vector&lt; double &gt; &amp;Y, double T9, double rho) const override</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00861">engine_graph.cpp:861</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_af04a9f8a629d6f6c58c477af0f1ab9e5"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#af04a9f8a629d6f6c58c477af0f1ab9e5">gridfire::GraphEngine::isStale</a></div><div class="ttdeci">bool isStale(const NetIn &amp;netIn) override</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00898">engine_graph.cpp:898</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_af17cf3762abac3efcab9a8e87c961210"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#af17cf3762abac3efcab9a8e87c961210">gridfire::GraphEngine::m_screeningModel</a></div><div class="ttdeci">std::unique_ptr&lt; screening::ScreeningModel &gt; m_screeningModel</div><div class="ttdef"><b>Definition</b> <a href="#l00469">engine_graph.h:469</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_af28950c5af3a92eb03a1a64ed0f913e7"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#af28950c5af3a92eb03a1a64ed0f913e7">gridfire::GraphEngine::calculateReverseRateTwoBodyDerivative</a></div><div class="ttdeci">double calculateReverseRateTwoBodyDerivative(const reaction::Reaction &amp;reaction, const double T9, const double reverseRate) const</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00346">engine_graph.cpp:346</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_af41df9ce979b6410e12642cb093916c9"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#af41df9ce979b6410e12642cb093916c9">gridfire::GraphEngine::calculateAllDerivatives</a></div><div class="ttdeci">StepDerivatives&lt; T &gt; calculateAllDerivatives(const std::vector&lt; T &gt; &amp;Y_in, T T9, T rho) const</div><div class="ttdoc">Calculates all derivatives (dY/dt) and the energy generation rate.</div><div class="ttdef"><b>Definition</b> <a href="#l00715">engine_graph.h:715</a></div></div>
2025-07-24 11:10:45 -04:00
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_afad967546b611d9c005268760feb75d5"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#afad967546b611d9c005268760feb75d5">gridfire::GraphEngine::GraphEngine</a></div><div class="ttdeci">GraphEngine(const fourdst::composition::Composition &amp;composition, const BuildDepthType=NetworkBuildDepth::Full)</div><div class="ttdoc">Constructs a GraphEngine from a composition.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00034">engine_graph.cpp:34</a></div></div>
<div class="ttc" id="aclassgridfire_1_1partition_1_1_partition_function_html"><div class="ttname"><a href="classgridfire_1_1partition_1_1_partition_function.html">gridfire::partition::PartitionFunction</a></div><div class="ttdoc">Abstract interface for evaluating nuclear partition functions.</div><div class="ttdef"><b>Definition</b> <a href="partition__abstract_8h_source.html#l00017">partition_abstract.h:17</a></div></div>
<div class="ttc" id="aclassgridfire_1_1reaction_1_1_logical_reaction_html"><div class="ttname"><a href="classgridfire_1_1reaction_1_1_logical_reaction.html">gridfire::reaction::LogicalReaction</a></div><div class="ttdoc">Represents a &quot;logical&quot; reaction that aggregates rates from multiple sources.</div><div class="ttdef"><b>Definition</b> <a href="reaction_8h_source.html#l00310">reaction.h:310</a></div></div>
<div class="ttc" id="aclassgridfire_1_1reaction_1_1_reaction_html"><div class="ttname"><a href="classgridfire_1_1reaction_1_1_reaction.html">gridfire::reaction::Reaction</a></div><div class="ttdoc">Represents a single nuclear reaction from a specific data source.</div><div class="ttdef"><b>Definition</b> <a href="reaction_8h_source.html#l00072">reaction.h:72</a></div></div>
2025-07-24 11:10:45 -04:00
<div class="ttc" id="aconstruction_8h_html"><div class="ttname"><a href="construction_8h.html">construction.h</a></div></div>
<div class="ttc" id="aengine__abstract_8h_html"><div class="ttname"><a href="engine__abstract_8h.html">engine_abstract.h</a></div><div class="ttdoc">Abstract interfaces for reaction network engines in GridFire.</div></div>
<div class="ttc" id="anamespacegridfire_1_1reaction_html"><div class="ttname"><a href="namespacegridfire_1_1reaction.html">gridfire::reaction</a></div><div class="ttdef"><b>Definition</b> <a href="reaction_8h_source.html#l00025">reaction.h:25</a></div></div>
2025-07-24 11:10:45 -04:00
<div class="ttc" id="anamespacegridfire_1_1reaction_html_aa86f08712565f278adacc7cd2361eb31"><div class="ttname"><a href="namespacegridfire_1_1reaction.html#aa86f08712565f278adacc7cd2361eb31">gridfire::reaction::LogicalReactionSet</a></div><div class="ttdeci">TemplatedReactionSet&lt; LogicalReaction &gt; LogicalReactionSet</div><div class="ttdoc">A set of logical reactions.</div><div class="ttdef"><b>Definition</b> <a href="reaction_8h_source.html#l00563">reaction.h:563</a></div></div>
2025-07-01 15:06:22 -04:00
<div class="ttc" id="anamespacegridfire_1_1screening_html_a6ca8556d27ac373e176f5b23437c416e"><div class="ttname"><a href="namespacegridfire_1_1screening.html#a6ca8556d27ac373e176f5b23437c416e">gridfire::screening::selectScreeningModel</a></div><div class="ttdeci">std::unique_ptr&lt; ScreeningModel &gt; selectScreeningModel(ScreeningType type)</div><div class="ttdoc">A factory function to select and create a screening model.</div><div class="ttdef"><b>Definition</b> <a href="screening__types_8cpp_source.html#l00009">screening_types.cpp:9</a></div></div>
<div class="ttc" id="anamespacegridfire_1_1screening_html_aa82aafbc4f8c28d0a75b60798e3a7d25"><div class="ttname"><a href="namespacegridfire_1_1screening.html#aa82aafbc4f8c28d0a75b60798e3a7d25">gridfire::screening::ScreeningType</a></div><div class="ttdeci">ScreeningType</div><div class="ttdoc">Enumerates the available plasma screening models.</div><div class="ttdef"><b>Definition</b> <a href="screening__types_8h_source.html#l00015">screening_types.h:15</a></div></div>
<div class="ttc" id="anamespacegridfire_1_1screening_html_aa82aafbc4f8c28d0a75b60798e3a7d25ad80b95b1abb9c8659fa4cc9d3d29bb71"><div class="ttname"><a href="namespacegridfire_1_1screening.html#aa82aafbc4f8c28d0a75b60798e3a7d25ad80b95b1abb9c8659fa4cc9d3d29bb71">gridfire::screening::ScreeningType::BARE</a></div><div class="ttdeci">@ BARE</div><div class="ttdoc">No screening applied. The screening factor is always 1.0.</div><div class="ttdef"><b>Definition</b> <a href="screening__types_8h_source.html#l00016">screening_types.h:16</a></div></div>
2025-07-24 11:10:45 -04:00
<div class="ttc" id="anamespacegridfire_html"><div class="ttname"><a href="namespacegridfire.html">gridfire</a></div><div class="ttdef"><b>Definition</b> <a href="engine__abstract_8h_source.html#l00031">engine_abstract.h:31</a></div></div>
<div class="ttc" id="anamespacegridfire_html_a0210bd2e07538932135a56b62b8ddb57abbd47109890259c0127154db1af26c75"><div class="ttname"><a href="namespacegridfire.html#a0210bd2e07538932135a56b62b8ddb57abbd47109890259c0127154db1af26c75">gridfire::NetworkBuildDepth::Full</a></div><div class="ttdeci">@ Full</div><div class="ttdef"><b>Definition</b> <a href="building_8h_source.html#l00022">building.h:22</a></div></div>
<div class="ttc" id="anamespacegridfire_html_a1121d0b2d005195333412559fa29d3cc"><div class="ttname"><a href="namespacegridfire.html#a1121d0b2d005195333412559fa29d3cc">gridfire::ADDouble</a></div><div class="ttdeci">CppAD::AD&lt; double &gt; ADDouble</div><div class="ttdoc">Alias for CppAD AD type for double precision.</div><div class="ttdef"><b>Definition</b> <a href="#l00044">engine_graph.h:44</a></div></div>
2025-07-24 11:10:45 -04:00
<div class="ttc" id="anamespacegridfire_html_a3b1f70dc7ff5b501809330a97079e4f6"><div class="ttname"><a href="namespacegridfire.html#a3b1f70dc7ff5b501809330a97079e4f6">gridfire::BuildDepthType</a></div><div class="ttdeci">std::variant&lt; NetworkBuildDepth, int &gt; BuildDepthType</div><div class="ttdoc">Variant specifying either a predefined NetworkBuildDepth or a custom integer depth.</div><div class="ttdef"><b>Definition</b> <a href="building_8h_source.html#l00037">building.h:37</a></div></div>
<div class="ttc" id="anamespacegridfire_html_a898dfe22579e649935645cbd6f073178"><div class="ttname"><a href="namespacegridfire.html#a898dfe22579e649935645cbd6f073178">gridfire::SparsityPattern</a></div><div class="ttdeci">std::vector&lt; std::pair&lt; size_t, size_t &gt; &gt; SparsityPattern</div><div class="ttdef"><b>Definition</b> <a href="engine__abstract_8h_source.html#l00065">engine_abstract.h:65</a></div></div>
<div class="ttc" id="anamespacegridfire_html_a96c062f94713921e5d7568ecedcdcb06"><div class="ttname"><a href="namespacegridfire.html#a96c062f94713921e5d7568ecedcdcb06">gridfire::MIN_ABUNDANCE_THRESHOLD</a></div><div class="ttdeci">static constexpr double MIN_ABUNDANCE_THRESHOLD</div><div class="ttdoc">Minimum abundance threshold below which species are ignored.</div><div class="ttdef"><b>Definition</b> <a href="#l00066">engine_graph.h:66</a></div></div>
<div class="ttc" id="anamespacegridfire_html_ada3c137c014ecd8d06200fea2d1a9f50"><div class="ttname"><a href="namespacegridfire.html#ada3c137c014ecd8d06200fea2d1a9f50">gridfire::MIN_DENSITY_THRESHOLD</a></div><div class="ttdeci">static constexpr double MIN_DENSITY_THRESHOLD</div><div class="ttdoc">Minimum density threshold below which reactions are ignored.</div><div class="ttdef"><b>Definition</b> <a href="#l00057">engine_graph.h:57</a></div></div>
<div class="ttc" id="anamespacegridfire_html_ae01b1738df1921db565bcbd68dd6cf64"><div class="ttname"><a href="namespacegridfire.html#ae01b1738df1921db565bcbd68dd6cf64">gridfire::MIN_JACOBIAN_THRESHOLD</a></div><div class="ttdeci">static constexpr double MIN_JACOBIAN_THRESHOLD</div><div class="ttdoc">Minimum value for Jacobian matrix entries.</div><div class="ttdef"><b>Definition</b> <a href="#l00074">engine_graph.h:74</a></div></div>
<div class="ttc" id="anetwork_8h_html"><div class="ttname"><a href="network_8h.html">network.h</a></div></div>
2025-07-24 11:10:45 -04:00
<div class="ttc" id="apartition__abstract_8h_html"><div class="ttname"><a href="partition__abstract_8h.html">partition_abstract.h</a></div></div>
<div class="ttc" id="apriming_8h_html"><div class="ttname"><a href="priming_8h.html">priming.h</a></div></div>
<div class="ttc" id="areaction_8h_html"><div class="ttname"><a href="reaction_8h.html">reaction.h</a></div><div class="ttdoc">Defines classes for representing and managing nuclear reactions.</div></div>
<div class="ttc" id="ascreening__abstract_8h_html"><div class="ttname"><a href="screening__abstract_8h.html">screening_abstract.h</a></div></div>
<div class="ttc" id="ascreening__types_8h_html"><div class="ttname"><a href="screening__types_8h.html">screening_types.h</a></div></div>
<div class="ttc" id="astructgridfire_1_1_graph_engine_1_1_precomputed_reaction_html"><div class="ttname"><a href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html">gridfire::GraphEngine::PrecomputedReaction</a></div><div class="ttdef"><b>Definition</b> <a href="#l00384">engine_graph.h:384</a></div></div>
<div class="ttc" id="astructgridfire_1_1_graph_engine_1_1_precomputed_reaction_html_a03d596c88289e21e7bd18711e3a1f275"><div class="ttname"><a href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a03d596c88289e21e7bd18711e3a1f275">gridfire::GraphEngine::PrecomputedReaction::reactant_powers</a></div><div class="ttdeci">std::vector&lt; int &gt; reactant_powers</div><div class="ttdef"><b>Definition</b> <a href="#l00388">engine_graph.h:388</a></div></div>
<div class="ttc" id="astructgridfire_1_1_graph_engine_1_1_precomputed_reaction_html_a3ce63aa3ad88568f4eb0d3ca2414209f"><div class="ttname"><a href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a3ce63aa3ad88568f4eb0d3ca2414209f">gridfire::GraphEngine::PrecomputedReaction::product_powers</a></div><div class="ttdeci">std::vector&lt; int &gt; product_powers</div><div class="ttdoc">Powers of each unique product in the reverse reaction.</div><div class="ttdef"><b>Definition</b> <a href="#l00395">engine_graph.h:395</a></div></div>
<div class="ttc" id="astructgridfire_1_1_graph_engine_1_1_precomputed_reaction_html_a3e2e67e532970738d20491ea56b170f3"><div class="ttname"><a href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a3e2e67e532970738d20491ea56b170f3">gridfire::GraphEngine::PrecomputedReaction::affected_species_indices</a></div><div class="ttdeci">std::vector&lt; size_t &gt; affected_species_indices</div><div class="ttdef"><b>Definition</b> <a href="#l00390">engine_graph.h:390</a></div></div>
<div class="ttc" id="astructgridfire_1_1_graph_engine_1_1_precomputed_reaction_html_a510e380116e2e6d9158cf00fedac2666"><div class="ttname"><a href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a510e380116e2e6d9158cf00fedac2666">gridfire::GraphEngine::PrecomputedReaction::unique_reactant_indices</a></div><div class="ttdeci">std::vector&lt; size_t &gt; unique_reactant_indices</div><div class="ttdef"><b>Definition</b> <a href="#l00387">engine_graph.h:387</a></div></div>
<div class="ttc" id="astructgridfire_1_1_graph_engine_1_1_precomputed_reaction_html_a6bcfe2230dd54b088180d34389266b07"><div class="ttname"><a href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a6bcfe2230dd54b088180d34389266b07">gridfire::GraphEngine::PrecomputedReaction::reverse_symmetry_factor</a></div><div class="ttdeci">double reverse_symmetry_factor</div><div class="ttdoc">Symmetry factor for reverse reactions.</div><div class="ttdef"><b>Definition</b> <a href="#l00396">engine_graph.h:396</a></div></div>
<div class="ttc" id="astructgridfire_1_1_graph_engine_1_1_precomputed_reaction_html_a7a7e9167b19e339e0d69544b9c00e79c"><div class="ttname"><a href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a7a7e9167b19e339e0d69544b9c00e79c">gridfire::GraphEngine::PrecomputedReaction::stoichiometric_coefficients</a></div><div class="ttdeci">std::vector&lt; int &gt; stoichiometric_coefficients</div><div class="ttdef"><b>Definition</b> <a href="#l00391">engine_graph.h:391</a></div></div>
<div class="ttc" id="astructgridfire_1_1_graph_engine_1_1_precomputed_reaction_html_a93635f6940d3534e949f402503c3d497"><div class="ttname"><a href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a93635f6940d3534e949f402503c3d497">gridfire::GraphEngine::PrecomputedReaction::reaction_index</a></div><div class="ttdeci">size_t reaction_index</div><div class="ttdef"><b>Definition</b> <a href="#l00386">engine_graph.h:386</a></div></div>
<div class="ttc" id="astructgridfire_1_1_graph_engine_1_1_precomputed_reaction_html_a9974f944a2cf5179baabebe09d60cf18"><div class="ttname"><a href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#a9974f944a2cf5179baabebe09d60cf18">gridfire::GraphEngine::PrecomputedReaction::unique_product_indices</a></div><div class="ttdeci">std::vector&lt; size_t &gt; unique_product_indices</div><div class="ttdoc">Unique product indices for reverse reactions.</div><div class="ttdef"><b>Definition</b> <a href="#l00394">engine_graph.h:394</a></div></div>
<div class="ttc" id="astructgridfire_1_1_graph_engine_1_1_precomputed_reaction_html_ac42504e868c0b9fd9ac9a405ea739f0e"><div class="ttname"><a href="structgridfire_1_1_graph_engine_1_1_precomputed_reaction.html#ac42504e868c0b9fd9ac9a405ea739f0e">gridfire::GraphEngine::PrecomputedReaction::symmetry_factor</a></div><div class="ttdeci">double symmetry_factor</div><div class="ttdef"><b>Definition</b> <a href="#l00389">engine_graph.h:389</a></div></div>
<div class="ttc" id="astructgridfire_1_1_graph_engine_1_1constants_html"><div class="ttname"><a href="structgridfire_1_1_graph_engine_1_1constants.html">gridfire::GraphEngine::constants</a></div><div class="ttdef"><b>Definition</b> <a href="#l00399">engine_graph.h:399</a></div></div>
<div class="ttc" id="astructgridfire_1_1_graph_engine_1_1constants_html_a29c8ae2b5c1d5fecd25c4fde2b623f7f"><div class="ttname"><a href="structgridfire_1_1_graph_engine_1_1constants.html#a29c8ae2b5c1d5fecd25c4fde2b623f7f">gridfire::GraphEngine::constants::kB</a></div><div class="ttdeci">const double kB</div><div class="ttdoc">Boltzmann constant in erg/K.</div><div class="ttdef"><b>Definition</b> <a href="#l00403">engine_graph.h:403</a></div></div>
<div class="ttc" id="astructgridfire_1_1_graph_engine_1_1constants_html_a3597bc632a5dd50aaa0044d8c18ca423"><div class="ttname"><a href="structgridfire_1_1_graph_engine_1_1constants.html#a3597bc632a5dd50aaa0044d8c18ca423">gridfire::GraphEngine::constants::u</a></div><div class="ttdeci">const double u</div><div class="ttdoc">Atomic mass unit in g.</div><div class="ttdef"><b>Definition</b> <a href="#l00400">engine_graph.h:400</a></div></div>
<div class="ttc" id="astructgridfire_1_1_graph_engine_1_1constants_html_a5ccc874d6704615e0ce54c14dc67699d"><div class="ttname"><a href="structgridfire_1_1_graph_engine_1_1constants.html#a5ccc874d6704615e0ce54c14dc67699d">gridfire::GraphEngine::constants::Na</a></div><div class="ttdeci">const double Na</div><div class="ttdoc">Avogadro&#39;s number.</div><div class="ttdef"><b>Definition</b> <a href="#l00401">engine_graph.h:401</a></div></div>
<div class="ttc" id="astructgridfire_1_1_graph_engine_1_1constants_html_a8bea6e348699c1aea93d17bb56739306"><div class="ttname"><a href="structgridfire_1_1_graph_engine_1_1constants.html#a8bea6e348699c1aea93d17bb56739306">gridfire::GraphEngine::constants::c</a></div><div class="ttdeci">const double c</div><div class="ttdoc">Speed of light in cm/s.</div><div class="ttdef"><b>Definition</b> <a href="#l00402">engine_graph.h:402</a></div></div>
<div class="ttc" id="astructgridfire_1_1_net_in_html"><div class="ttname"><a href="structgridfire_1_1_net_in.html">gridfire::NetIn</a></div><div class="ttdef"><b>Definition</b> <a href="network_8h_source.html#l00053">network.h:53</a></div></div>
2025-07-24 11:10:45 -04:00
<div class="ttc" id="astructgridfire_1_1_priming_report_html"><div class="ttname"><a href="structgridfire_1_1_priming_report.html">gridfire::PrimingReport</a></div><div class="ttdoc">Captures the result of a network priming operation.</div><div class="ttdef"><b>Definition</b> <a href="reporting_8h_source.html#l00067">reporting.h:67</a></div></div>
<div class="ttc" id="astructgridfire_1_1_step_derivatives_html"><div class="ttname"><a href="structgridfire_1_1_step_derivatives.html">gridfire::StepDerivatives</a></div><div class="ttdoc">Structure holding derivatives and energy generation for a network step.</div><div class="ttdef"><b>Definition</b> <a href="engine__abstract_8h_source.html#l00060">engine_abstract.h:60</a></div></div>
<div class="ttc" id="astructgridfire_1_1_step_derivatives_html_ab4aeb41be952c7b5844e1ee81fef9008"><div class="ttname"><a href="structgridfire_1_1_step_derivatives.html#ab4aeb41be952c7b5844e1ee81fef9008">gridfire::StepDerivatives::nuclearEnergyGenerationRate</a></div><div class="ttdeci">T nuclearEnergyGenerationRate</div><div class="ttdoc">Specific energy generation rate (e.g., erg/g/s).</div><div class="ttdef"><b>Definition</b> <a href="engine__abstract_8h_source.html#l00062">engine_abstract.h:62</a></div></div>
<div class="ttc" id="astructgridfire_1_1_step_derivatives_html_ae0de268b86c2404379409c4feae0b34d"><div class="ttname"><a href="structgridfire_1_1_step_derivatives.html#ae0de268b86c2404379409c4feae0b34d">gridfire::StepDerivatives::dydt</a></div><div class="ttdeci">std::vector&lt; T &gt; dydt</div><div class="ttdoc">Derivatives of abundances (dY/dt for each species).</div><div class="ttdef"><b>Definition</b> <a href="engine__abstract_8h_source.html#l00061">engine_abstract.h:61</a></div></div>
<div class="ttc" id="astructgridfire_1_1expectations_1_1_stale_engine_error_html"><div class="ttname"><a href="structgridfire_1_1expectations_1_1_stale_engine_error.html">gridfire::expectations::StaleEngineError</a></div><div class="ttdef"><b>Definition</b> <a href="expected__engine_8h_source.html#l00044">expected_engine.h:44</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
2025-07-24 11:10:45 -04:00
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_b0856f6b0d80ccb263b2f415c91f9e17.html">include</a></li><li class="navelem"><a class="el" href="dir_3626e0c0e3c5d7812d6b277dfa4ec364.html">gridfire</a></li><li class="navelem"><a class="el" href="dir_aff155d61c3b73b9ab7dcdc908c4d49e.html">engine</a></li><li class="navelem"><a class="el" href="engine__graph_8h.html">engine_graph.h</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
</ul>
</div>
</body>
</html>