refactor(.gitignore): removed html/ from .gitignore

This commit is contained in:
2025-07-01 11:40:51 -04:00
parent 0c16e81e98
commit 7df6f60912
197 changed files with 6248 additions and 4744 deletions

View File

@@ -112,343 +112,373 @@ $(function(){initNavTree('engine__graph_8h_source.html',''); initResizable(true)
<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> </div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include &lt;unordered_map&gt;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include &lt;vector&gt;</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;boost/numeric/ublas/matrix_sparse.hpp&gt;</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include &quot;cppad/cppad.hpp&quot;</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</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="l00021" name="l00021"></a><span class="lineno"> 21</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="l00022" name="l00022"></a><span class="lineno"> 22</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="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment">// REACLIBReactions are quite large data structures, so this could be a performance bottleneck.</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> </div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacegridfire.html">gridfire</a> {</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="namespacegridfire.html#a1121d0b2d005195333412559fa29d3cc"> 31</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="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="keyword">using </span>fourdst::config::Config;</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <span class="keyword">using </span>fourdst::logging::LogManager;</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keyword">using </span>fourdst::constant::Constants;</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="namespacegridfire.html#ada3c137c014ecd8d06200fea2d1a9f50"> 44</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="l00045" name="l00045"></a><span class="lineno"> 45</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"><a class="line" href="namespacegridfire.html#a96c062f94713921e5d7568ecedcdcb06"> 53</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="l00054" name="l00054"></a><span class="lineno"> 54</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="namespacegridfire.html#ae01b1738df1921db565bcbd68dd6cf64"> 61</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="l00062" name="l00062"></a><span class="lineno"> 62</span></div>
<div class="foldopen" id="foldopen00086" data-start="{" data-end="};">
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html"> 86</a></span> <span class="keyword">class </span><a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a9f74786ff930ab72664b31f29d05a30c">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="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="keyword">explicit</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a9f74786ff930ab72664b31f29d05a30c">GraphEngine</a>(<span class="keyword">const</span> fourdst::composition::Composition &amp;composition);</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span></div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keyword">explicit</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a9f74786ff930ab72664b31f29d05a30c">GraphEngine</a>(<a class="code hl_class" href="classgridfire_1_1reaction_1_1_logical_reaction_set.html">reaction::LogicalReactionSet</a> reactions);</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span></div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <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#a8b3baf29829c7ae0a61430ea70632bbf">calculateRHSAndEnergy</a>(</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="keyword">const</span> std::vector&lt;double&gt;&amp; Y,</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="keyword">const</span> <span class="keywordtype">double</span> T9,</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="keyword">const</span> <span class="keywordtype">double</span> rho</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> ) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span></div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#ae347ff0316e532e0298ec8c913908105">generateJacobianMatrix</a>(</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <span class="keyword">const</span> std::vector&lt;double&gt;&amp; Y,</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keyword">const</span> <span class="keywordtype">double</span> T9,</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <span class="keyword">const</span> <span class="keywordtype">double</span> rho</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span></div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</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="l00155" name="l00155"></a><span class="lineno"> 155</span></div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <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="l00169" name="l00169"></a><span class="lineno"> 169</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="l00170" name="l00170"></a><span class="lineno"> 170</span> <span class="keyword">const</span> std::vector&lt;double&gt;&amp;Y,</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <span class="keyword">const</span> <span class="keywordtype">double</span> T9,</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="keyword">const</span> <span class="keywordtype">double</span> rho</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> ) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span></div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</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="l00180" name="l00180"></a><span class="lineno"> 180</span></div>
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> [[nodiscard]] <span class="keyword">const</span> <a class="code hl_class" href="classgridfire_1_1reaction_1_1_logical_reaction_set.html">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="l00186" name="l00186"></a><span class="lineno"> 186</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#a303e6093591cde91430f866a04a8be7c">getJacobianMatrixEntry</a>(</div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> <span class="keyword">const</span> <span class="keywordtype">int</span> i,</div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <span class="keyword">const</span> <span class="keywordtype">int</span> j</div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> ) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span></div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</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="l00210" name="l00210"></a><span class="lineno"> 210</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="l00211" name="l00211"></a><span class="lineno"> 211</span> );</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span></div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</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="l00225" name="l00225"></a><span class="lineno"> 225</span> <span class="keyword">const</span> <span class="keywordtype">int</span> speciesIndex,</div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> <span class="keyword">const</span> <span class="keywordtype">int</span> reactionIndex</div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> ) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span></div>
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> [[nodiscard]] std::unordered_map&lt;fourdst::atomic::Species, double&gt; <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a26215593544c3a52597194602e4e25dd">getSpeciesTimescales</a>(</div>
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> <span class="keyword">const</span> std::vector&lt;double&gt;&amp; Y,</div>
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> <span class="keywordtype">double</span> T9,</div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> <span class="keywordtype">double</span> rho</div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> ) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span></div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</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="l00253" name="l00253"></a><span class="lineno"> 253</span> <span class="keyword">const</span> fourdst::atomic::Species&amp; species</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span></div>
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</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="l00273" name="l00273"></a><span class="lineno"> 273</span> <span class="keyword">const</span> std::string&amp; filename</div>
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span></div>
<div class="line"><a id="l00292" name="l00292"></a><span class="lineno"> 292</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="l00293" name="l00293"></a><span class="lineno"> 293</span> <span class="keyword">const</span> std::string&amp; filename</div>
<div class="line"><a id="l00294" name="l00294"></a><span class="lineno"> 294</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00295" name="l00295"></a><span class="lineno"> 295</span> </div>
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"> 296</span> </div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#acb7c4f5108b0efeae48ad15598e808c3"> 298</a></span> <a class="code hl_class" href="classgridfire_1_1reaction_1_1_logical_reaction_set.html">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="l00299" name="l00299"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a5d6cc63b99b467c2a976d1fbaaa1dfa3"> 299</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="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>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include &lt;unordered_map&gt;</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include &lt;boost/numeric/ublas/matrix_sparse.hpp&gt;</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include &quot;cppad/cppad.hpp&quot;</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</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="l00024" name="l00024"></a><span class="lineno"> 24</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="l00025" name="l00025"></a><span class="lineno"> 25</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="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment">// REACLIBReactions are quite large data structures, so this could be a performance bottleneck.</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacegridfire.html">gridfire</a> {</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="namespacegridfire.html#a1121d0b2d005195333412559fa29d3cc"> 34</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="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keyword">using </span>fourdst::config::Config;</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keyword">using </span>fourdst::logging::LogManager;</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keyword">using </span>fourdst::constant::Constants;</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="namespacegridfire.html#ada3c137c014ecd8d06200fea2d1a9f50"> 47</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="l00048" name="l00048"></a><span class="lineno"> 48</span></div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="namespacegridfire.html#a96c062f94713921e5d7568ecedcdcb06"> 56</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="l00057" name="l00057"></a><span class="lineno"> 57</span></div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="namespacegridfire.html#ae01b1738df1921db565bcbd68dd6cf64"> 64</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="l00065" name="l00065"></a><span class="lineno"> 65</span></div>
<div class="foldopen" id="foldopen00089" data-start="{" data-end="};">
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html"> 89</a></span> <span class="keyword">class </span><a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a9f74786ff930ab72664b31f29d05a30c">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="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keyword">public</span>:</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="keyword">explicit</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a9f74786ff930ab72664b31f29d05a30c">GraphEngine</a>(<span class="keyword">const</span> fourdst::composition::Composition &amp;composition);</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span></div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="keyword">explicit</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a9f74786ff930ab72664b31f29d05a30c">GraphEngine</a>(<a class="code hl_typedef" href="namespacegridfire_1_1reaction.html#aa86f08712565f278adacc7cd2361eb31">reaction::LogicalReactionSet</a> reactions);</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span></div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</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#a8b3baf29829c7ae0a61430ea70632bbf">calculateRHSAndEnergy</a>(</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keyword">const</span> std::vector&lt;double&gt;&amp; Y,</div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <span class="keyword">const</span> <span class="keywordtype">double</span> T9,</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <span class="keyword">const</span> <span class="keywordtype">double</span> rho</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> ) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span></div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#ae347ff0316e532e0298ec8c913908105">generateJacobianMatrix</a>(</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="keyword">const</span> std::vector&lt;double&gt;&amp; Y,</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keyword">const</span> <span class="keywordtype">double</span> T9,</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> rho</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> ) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span></div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</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="l00158" name="l00158"></a><span class="lineno"> 158</span></div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</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="l00172" name="l00172"></a><span class="lineno"> 172</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="l00173" name="l00173"></a><span class="lineno"> 173</span> <span class="keyword">const</span> std::vector&lt;double&gt;&amp;Y,</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> <span class="keyword">const</span> <span class="keywordtype">double</span> T9,</div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> <span class="keyword">const</span> <span class="keywordtype">double</span> rho</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="l00182" name="l00182"></a><span class="lineno"> 182</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="l00183" name="l00183"></a><span class="lineno"> 183</span></div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</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="l00189" name="l00189"></a><span class="lineno"> 189</span></div>
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</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="l00202" name="l00202"></a><span class="lineno"> 202</span> <span class="keyword">const</span> <span class="keywordtype">int</span> i,</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> <span class="keyword">const</span> <span class="keywordtype">int</span> j</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> ) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span></div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</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="l00213" name="l00213"></a><span class="lineno"> 213</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="l00214" name="l00214"></a><span class="lineno"> 214</span> );</div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span></div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</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="l00228" name="l00228"></a><span class="lineno"> 228</span> <span class="keyword">const</span> <span class="keywordtype">int</span> speciesIndex,</div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> <span class="keyword">const</span> <span class="keywordtype">int</span> reactionIndex</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> ) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span></div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> [[nodiscard]] std::unordered_map&lt;fourdst::atomic::Species, double&gt; <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a26215593544c3a52597194602e4e25dd">getSpeciesTimescales</a>(</div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> <span class="keyword">const</span> std::vector&lt;double&gt;&amp; Y,</div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> <span class="keywordtype">double</span> T9,</div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> <span class="keywordtype">double</span> rho</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> ) <span class="keyword">const override</span>;</div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span> </div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a51b4cedf9b00de79fb6eef243631b04d">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="l00250" name="l00250"></a><span class="lineno"> 250</span></div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</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="l00258" name="l00258"></a><span class="lineno"> 258</span> <span class="keyword">const</span> fourdst::atomic::Species&amp; species</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span></div>
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</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="l00278" name="l00278"></a><span class="lineno"> 278</span> <span class="keyword">const</span> std::string&amp; filename</div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span></div>
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</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="l00298" name="l00298"></a><span class="lineno"> 298</span> <span class="keyword">const</span> std::string&amp; filename</div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span> </div>
<div class="line"><a id="l00301" name="l00301"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a92d26068ba139e47d335f5fe9e2814cc"> 301</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="l00302" name="l00302"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a30e09ed0bce6aa5fc89beaa316a7b827"> 302</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="l00303" name="l00303"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#ad8237c252145a75092202d00f5e1ddf7"> 303</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="l00301" name="l00301"></a><span class="lineno"> 301</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="l00302" name="l00302"></a><span class="lineno"> 302</span> </div>
<div class="line"><a id="l00303" name="l00303"></a><span class="lineno"> 303</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="l00304" name="l00304"></a><span class="lineno"> 304</span> </div>
<div class="line"><a id="l00305" name="l00305"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#ad1cb5fd32efc37668e2d9ecf0c72ad24"> 305</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="l00306" name="l00306"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a2f1718c89d4aaad028102724d18fa910"> 306</a></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="l00307" name="l00307"></a><span class="lineno"> 307</span> </div>
<div class="line"><a id="l00308" name="l00308"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a2e22b111f6d00ecc9e3804a71f1ce876"> 308</a></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="l00305" name="l00305"></a><span class="lineno"> 305</span> </div>
<div class="line"><a id="l00306" name="l00306"></a><span class="lineno"> 306</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00307" name="l00307"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#acb7c4f5108b0efeae48ad15598e808c3"> 307</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="l00308" name="l00308"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a5d6cc63b99b467c2a976d1fbaaa1dfa3"> 308</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="l00309" name="l00309"></a><span class="lineno"> 309</span> </div>
<div class="line"><a id="l00310" name="l00310"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a3b17102b143435ddfdc015d7a50c4b18"> 310</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="l00311" name="l00311"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a0837bab6dcd111d9075c9343b90d64f1"> 311</a></span> Constants&amp; <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a0837bab6dcd111d9075c9343b90d64f1">m_constants</a> = Constants::getInstance(); </div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a483979fc154adc88d029b3b672066d53"> 312</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="l00310" name="l00310"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a92d26068ba139e47d335f5fe9e2814cc"> 310</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="l00311" name="l00311"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a30e09ed0bce6aa5fc89beaa316a7b827"> 311</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="l00312" name="l00312"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#ad8237c252145a75092202d00f5e1ddf7"> 312</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="l00313" name="l00313"></a><span class="lineno"> 313</span> </div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"> 314</span> <span class="keyword">private</span>:</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"> 322</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="l00323" name="l00323"></a><span class="lineno"> 323</span></div>
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno"> 330</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="l00331" name="l00331"></a><span class="lineno"> 331</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#a26602e1b3c610780a47b5a6511d6d567">populateReactionIDMap</a>();</div>
<div class="line"><a id="l00339" name="l00339"></a><span class="lineno"> 339</span></div>
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno"> 346</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="l00347" name="l00347"></a><span class="lineno"> 347</span></div>
<div class="line"><a id="l00355" name="l00355"></a><span class="lineno"> 355</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a5a5458ed01923124f2d7e1f04f32f138">reserveJacobianMatrix</a>();</div>
<div class="line"><a id="l00356" name="l00356"></a><span class="lineno"> 356</span></div>
<div class="line"><a id="l00366" name="l00366"></a><span class="lineno"> 366</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="l00367" name="l00367"></a><span class="lineno"> 367</span></div>
<div class="line"><a id="l00377" name="l00377"></a><span class="lineno"> 377</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="l00378" name="l00378"></a><span class="lineno"> 378</span></div>
<div class="line"><a id="l00390" name="l00390"></a><span class="lineno"> 390</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#aeeafeab40a5f4dbfae78bdc87e25e93f">validateComposition</a>(</div>
<div class="line"><a id="l00391" name="l00391"></a><span class="lineno"> 391</span> <span class="keyword">const</span> fourdst::composition::Composition &amp;composition,</div>
<div class="line"><a id="l00392" name="l00392"></a><span class="lineno"> 392</span> <span class="keywordtype">double</span> culling,</div>
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno"> 393</span> <span class="keywordtype">double</span> T9</div>
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno"> 394</span> );</div>
<div class="line"><a id="l00395" name="l00395"></a><span class="lineno"> 395</span></div>
<div class="line"><a id="l00409" name="l00409"></a><span class="lineno"> 409</span> <span class="keyword">template</span> &lt;IsArithmeticOrAD T&gt;</div>
<div class="line"><a id="l00410" name="l00410"></a><span class="lineno"> 410</span> T <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a9245642b741f215e52861d00e756fb3f">calculateMolarReactionFlow</a>(</div>
<div class="line"><a id="l00411" name="l00411"></a><span class="lineno"> 411</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="l00412" name="l00412"></a><span class="lineno"> 412</span> <span class="keyword">const</span> std::vector&lt;T&gt; &amp;Y,</div>
<div class="line"><a id="l00413" name="l00413"></a><span class="lineno"> 413</span> <span class="keyword">const</span> T T9,</div>
<div class="line"><a id="l00414" name="l00414"></a><span class="lineno"> 414</span> <span class="keyword">const</span> T rho</div>
<div class="line"><a id="l00415" name="l00415"></a><span class="lineno"> 415</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00416" name="l00416"></a><span class="lineno"> 416</span></div>
<div class="line"><a id="l00429" name="l00429"></a><span class="lineno"> 429</span> <span class="keyword">template</span>&lt;IsArithmeticOrAD T&gt;</div>
<div class="line"><a id="l00430" name="l00430"></a><span class="lineno"> 430</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">calculateAllDerivatives</a>(</div>
<div class="line"><a id="l00431" name="l00431"></a><span class="lineno"> 431</span> <span class="keyword">const</span> std::vector&lt;T&gt; &amp;Y_in,</div>
<div class="line"><a id="l00432" name="l00432"></a><span class="lineno"> 432</span> T T9,</div>
<div class="line"><a id="l00433" name="l00433"></a><span class="lineno"> 433</span> T rho</div>
<div class="line"><a id="l00434" name="l00434"></a><span class="lineno"> 434</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00435" name="l00435"></a><span class="lineno"> 435</span></div>
<div class="line"><a id="l00448" name="l00448"></a><span class="lineno"> 448</span> <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="l00449" name="l00449"></a><span class="lineno"> 449</span> <span class="keyword">const</span> std::vector&lt;double&gt;&amp; Y_in,</div>
<div class="line"><a id="l00450" name="l00450"></a><span class="lineno"> 450</span> <span class="keyword">const</span> <span class="keywordtype">double</span> T9,</div>
<div class="line"><a id="l00451" name="l00451"></a><span class="lineno"> 451</span> <span class="keyword">const</span> <span class="keywordtype">double</span> rho</div>
<div class="line"><a id="l00452" name="l00452"></a><span class="lineno"> 452</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00453" name="l00453"></a><span class="lineno"> 453</span></div>
<div class="line"><a id="l00466" name="l00466"></a><span class="lineno"> 466</span> <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="l00467" name="l00467"></a><span class="lineno"> 467</span> <span class="keyword">const</span> std::vector&lt;ADDouble&gt;&amp; Y_in,</div>
<div class="line"><a id="l00468" name="l00468"></a><span class="lineno"> 468</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="l00469" name="l00469"></a><span class="lineno"> 469</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="l00470" name="l00470"></a><span class="lineno"> 470</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00471" name="l00471"></a><span class="lineno"> 471</span> };</div>
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#ad1cb5fd32efc37668e2d9ecf0c72ad24"> 314</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="l00315" name="l00315"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a2f1718c89d4aaad028102724d18fa910"> 315</a></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="l00316" name="l00316"></a><span class="lineno"> 316</span> </div>
<div class="line"><a id="l00317" name="l00317"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a2e22b111f6d00ecc9e3804a71f1ce876"> 317</a></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="l00318" name="l00318"></a><span class="lineno"> 318</span> </div>
<div class="line"><a id="l00319" name="l00319"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a52edc3e88f1e8fc497e1e63972d63c80"> 319</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="l00320" name="l00320"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#af17cf3762abac3efcab9a8e87c961210"> 320</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="l00321" name="l00321"></a><span class="lineno"> 321</span> </div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a3b17102b143435ddfdc015d7a50c4b18"> 322</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="l00323" name="l00323"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a0837bab6dcd111d9075c9343b90d64f1"> 323</a></span> Constants&amp; <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a0837bab6dcd111d9075c9343b90d64f1">m_constants</a> = Constants::getInstance(); </div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a483979fc154adc88d029b3b672066d53"> 324</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="l00325" name="l00325"></a><span class="lineno"> 325</span> </div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno"> 326</span> <span class="keyword">private</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#acdce8d87e23a2cd1504bc9472e538c0f">syncInternalMaps</a>();</div>
<div class="line"><a id="l00335" name="l00335"></a><span class="lineno"> 335</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#aedf42d83bfcc28313b6b6454034d2efa">collectNetworkSpecies</a>();</div>
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno"> 343</span></div>
<div class="line"><a id="l00350" name="l00350"></a><span class="lineno"> 350</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="l00351" name="l00351"></a><span class="lineno"> 351</span></div>
<div class="line"><a id="l00358" name="l00358"></a><span class="lineno"> 358</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="l00359" name="l00359"></a><span class="lineno"> 359</span></div>
<div class="line"><a id="l00367" name="l00367"></a><span class="lineno"> 367</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a5a5458ed01923124f2d7e1f04f32f138">reserveJacobianMatrix</a>();</div>
<div class="line"><a id="l00368" name="l00368"></a><span class="lineno"> 368</span></div>
<div class="line"><a id="l00378" name="l00378"></a><span class="lineno"> 378</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="l00379" name="l00379"></a><span class="lineno"> 379</span></div>
<div class="line"><a id="l00389" name="l00389"></a><span class="lineno"> 389</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="l00390" name="l00390"></a><span class="lineno"> 390</span></div>
<div class="line"><a id="l00402" name="l00402"></a><span class="lineno"> 402</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#aeeafeab40a5f4dbfae78bdc87e25e93f">validateComposition</a>(</div>
<div class="line"><a id="l00403" name="l00403"></a><span class="lineno"> 403</span> <span class="keyword">const</span> fourdst::composition::Composition &amp;composition,</div>
<div class="line"><a id="l00404" name="l00404"></a><span class="lineno"> 404</span> <span class="keywordtype">double</span> culling,</div>
<div class="line"><a id="l00405" name="l00405"></a><span class="lineno"> 405</span> <span class="keywordtype">double</span> T9</div>
<div class="line"><a id="l00406" name="l00406"></a><span class="lineno"> 406</span> );</div>
<div class="line"><a id="l00407" name="l00407"></a><span class="lineno"> 407</span></div>
<div class="line"><a id="l00421" name="l00421"></a><span class="lineno"> 421</span> <span class="keyword">template</span> &lt;IsArithmeticOrAD T&gt;</div>
<div class="line"><a id="l00422" name="l00422"></a><span class="lineno"> 422</span> T <a class="code hl_function" href="classgridfire_1_1_graph_engine.html#a9245642b741f215e52861d00e756fb3f">calculateMolarReactionFlow</a>(</div>
<div class="line"><a id="l00423" name="l00423"></a><span class="lineno"> 423</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="l00424" name="l00424"></a><span class="lineno"> 424</span> <span class="keyword">const</span> std::vector&lt;T&gt; &amp;Y,</div>
<div class="line"><a id="l00425" name="l00425"></a><span class="lineno"> 425</span> <span class="keyword">const</span> T T9,</div>
<div class="line"><a id="l00426" name="l00426"></a><span class="lineno"> 426</span> <span class="keyword">const</span> T rho</div>
<div class="line"><a id="l00427" name="l00427"></a><span class="lineno"> 427</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00428" name="l00428"></a><span class="lineno"> 428</span></div>
<div class="line"><a id="l00441" name="l00441"></a><span class="lineno"> 441</span> <span class="keyword">template</span>&lt;IsArithmeticOrAD T&gt;</div>
<div class="line"><a id="l00442" name="l00442"></a><span class="lineno"> 442</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="l00443" name="l00443"></a><span class="lineno"> 443</span> <span class="keyword">const</span> std::vector&lt;T&gt; &amp;Y_in,</div>
<div class="line"><a id="l00444" name="l00444"></a><span class="lineno"> 444</span> T T9,</div>
<div class="line"><a id="l00445" name="l00445"></a><span class="lineno"> 445</span> T rho</div>
<div class="line"><a id="l00446" name="l00446"></a><span class="lineno"> 446</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00447" name="l00447"></a><span class="lineno"> 447</span></div>
<div class="line"><a id="l00460" name="l00460"></a><span class="lineno"> 460</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="l00461" name="l00461"></a><span class="lineno"> 461</span> <span class="keyword">const</span> std::vector&lt;double&gt;&amp; Y_in,</div>
<div class="line"><a id="l00462" name="l00462"></a><span class="lineno"> 462</span> <span class="keyword">const</span> <span class="keywordtype">double</span> T9,</div>
<div class="line"><a id="l00463" name="l00463"></a><span class="lineno"> 463</span> <span class="keyword">const</span> <span class="keywordtype">double</span> rho</div>
<div class="line"><a id="l00464" name="l00464"></a><span class="lineno"> 464</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00465" name="l00465"></a><span class="lineno"> 465</span></div>
<div class="line"><a id="l00478" name="l00478"></a><span class="lineno"> 478</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="l00479" name="l00479"></a><span class="lineno"> 479</span> <span class="keyword">const</span> std::vector&lt;ADDouble&gt;&amp; Y_in,</div>
<div class="line"><a id="l00480" name="l00480"></a><span class="lineno"> 480</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="l00481" name="l00481"></a><span class="lineno"> 481</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="l00482" name="l00482"></a><span class="lineno"> 482</span> ) <span class="keyword">const</span>;</div>
<div class="line"><a id="l00483" name="l00483"></a><span class="lineno"> 483</span> };</div>
</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"> 473</span> </div>
<div class="line"><a id="l00474" name="l00474"></a><span class="lineno"> 474</span> <span class="keyword">template</span>&lt;IsArithmeticOrAD T&gt;</div>
<div class="foldopen" id="foldopen00475" data-start="{" data-end="}">
<div class="line"><a id="l00475" name="l00475"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#af41df9ce979b6410e12642cb093916c9"> 475</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="l00476" name="l00476"></a><span class="lineno"> 476</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="l00477" name="l00477"></a><span class="lineno"> 477</span> </div>
<div class="line"><a id="l00478" name="l00478"></a><span class="lineno"> 478</span> <span class="comment">// --- Setup output derivatives structure ---</span></div>
<div class="line"><a id="l00479" name="l00479"></a><span class="lineno"> 479</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="l00480" name="l00480"></a><span class="lineno"> 480</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="l00481" name="l00481"></a><span class="lineno"> 481</span> </div>
<div class="line"><a id="l00482" name="l00482"></a><span class="lineno"> 482</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="l00483" name="l00483"></a><span class="lineno"> 483</span> <span class="comment">// ----- Constants for AD safe calculations ---</span></div>
<div class="line"><a id="l00484" name="l00484"></a><span class="lineno"> 484</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="l00485" name="l00485"></a><span class="lineno"> 485</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="l00486" name="l00486"></a><span class="lineno"> 486</span> </div>
<div class="line"><a id="l00487" name="l00487"></a><span class="lineno"> 487</span> <span class="comment">// ----- Initialize variables for molar concentration product and thresholds ---</span></div>
<div class="line"><a id="l00488" name="l00488"></a><span class="lineno"> 488</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="l00489" name="l00489"></a><span class="lineno"> 489</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="l00490" name="l00490"></a><span class="lineno"> 490</span> <span class="comment">// which create branches that break the AD tape.</span></div>
<div class="line"><a id="l00491" name="l00491"></a><span class="lineno"> 491</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="l00492" name="l00492"></a><span class="lineno"> 492</span> </div>
<div class="line"><a id="l00493" name="l00493"></a><span class="lineno"> 493</span> <span class="comment">// --- Check if the density is below the threshold where we ignore reactions ---</span></div>
<div class="line"><a id="l00494" name="l00494"></a><span class="lineno"> 494</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="l00495" name="l00495"></a><span class="lineno"> 495</span> </div>
<div class="line"><a id="l00496" name="l00496"></a><span class="lineno"> 496</span> std::vector&lt;T&gt; Y = Y_in;</div>
<div class="line"><a id="l00497" name="l00497"></a><span class="lineno"> 497</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="l00498" name="l00498"></a><span class="lineno"> 498</span> <span class="comment">// We use CppAD::CondExpLt to handle AD taping and prevent branching</span></div>
<div class="line"><a id="l00499" name="l00499"></a><span class="lineno"> 499</span> <span class="comment">// Note that while this is syntactically more complex this is equivalent to</span></div>
<div class="line"><a id="l00500" name="l00500"></a><span class="lineno"> 500</span> <span class="comment">// if (Y[i] &lt; 0) {Y[i] = 0;}</span></div>
<div class="line"><a id="l00501" name="l00501"></a><span class="lineno"> 501</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="l00502" name="l00502"></a><span class="lineno"> 502</span> <span class="comment">// each timestep, which is very inefficient.</span></div>
<div class="line"><a id="l00503" name="l00503"></a><span class="lineno"> 503</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="l00504" name="l00504"></a><span class="lineno"> 504</span> }</div>
<div class="line"><a id="l00484" name="l00484"></a><span class="lineno"> 484</span> </div>
<div class="line"><a id="l00485" name="l00485"></a><span class="lineno"> 485</span> </div>
<div class="line"><a id="l00486" name="l00486"></a><span class="lineno"> 486</span> <span class="keyword">template</span>&lt;IsArithmeticOrAD T&gt;</div>
<div class="foldopen" id="foldopen00487" data-start="{" data-end="}">
<div class="line"><a id="l00487" name="l00487"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#af41df9ce979b6410e12642cb093916c9"> 487</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="l00488" name="l00488"></a><span class="lineno"> 488</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="l00489" name="l00489"></a><span class="lineno"> 489</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="l00490" name="l00490"></a><span class="lineno"> 490</span> <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#acb7c4f5108b0efeae48ad15598e808c3">m_reactions</a>,</div>
<div class="line"><a id="l00491" name="l00491"></a><span class="lineno"> 491</span> <a class="code hl_variable" href="classgridfire_1_1_graph_engine.html#a92d26068ba139e47d335f5fe9e2814cc">m_networkSpecies</a>,</div>
<div class="line"><a id="l00492" name="l00492"></a><span class="lineno"> 492</span> Y_in,</div>
<div class="line"><a id="l00493" name="l00493"></a><span class="lineno"> 493</span> T9,</div>
<div class="line"><a id="l00494" name="l00494"></a><span class="lineno"> 494</span> rho</div>
<div class="line"><a id="l00495" name="l00495"></a><span class="lineno"> 495</span> );</div>
<div class="line"><a id="l00496" name="l00496"></a><span class="lineno"> 496</span> </div>
<div class="line"><a id="l00497" name="l00497"></a><span class="lineno"> 497</span> <span class="comment">// --- Setup output derivatives structure ---</span></div>
<div class="line"><a id="l00498" name="l00498"></a><span class="lineno"> 498</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="l00499" name="l00499"></a><span class="lineno"> 499</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="l00500" name="l00500"></a><span class="lineno"> 500</span> </div>
<div class="line"><a id="l00501" name="l00501"></a><span class="lineno"> 501</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="l00502" name="l00502"></a><span class="lineno"> 502</span> <span class="comment">// ----- Constants for AD safe calculations ---</span></div>
<div class="line"><a id="l00503" name="l00503"></a><span class="lineno"> 503</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="l00504" name="l00504"></a><span class="lineno"> 504</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="l00505" name="l00505"></a><span class="lineno"> 505</span> </div>
<div class="line"><a id="l00506" name="l00506"></a><span class="lineno"> 506</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#a0837bab6dcd111d9075c9343b90d64f1">m_constants</a>.get(<span class="stringliteral">&quot;u&quot;</span>).value); <span class="comment">// Atomic mass unit in grams</span></div>
<div class="line"><a id="l00507" name="l00507"></a><span class="lineno"> 507</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#a0837bab6dcd111d9075c9343b90d64f1">m_constants</a>.get(<span class="stringliteral">&quot;N_a&quot;</span>).value); <span class="comment">// Avogadro&#39;s number in mol^-1</span></div>
<div class="line"><a id="l00508" name="l00508"></a><span class="lineno"> 508</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#a0837bab6dcd111d9075c9343b90d64f1">m_constants</a>.get(<span class="stringliteral">&quot;c&quot;</span>).value); <span class="comment">// Speed of light in cm/s</span></div>
<div class="line"><a id="l00509" name="l00509"></a><span class="lineno"> 509</span> </div>
<div class="line"><a id="l00510" name="l00510"></a><span class="lineno"> 510</span> <span class="comment">// --- SINGLE LOOP OVER ALL REACTIONS ---</span></div>
<div class="line"><a id="l00511" name="l00511"></a><span class="lineno"> 511</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="l00512" name="l00512"></a><span class="lineno"> 512</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="l00513" name="l00513"></a><span class="lineno"> 513</span> </div>
<div class="line"><a id="l00514" name="l00514"></a><span class="lineno"> 514</span> <span class="comment">// 1. Calculate reaction rate</span></div>
<div class="line"><a id="l00515" name="l00515"></a><span class="lineno"> 515</span> <span class="keyword">const</span> T molarReactionFlow = <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="l00516" name="l00516"></a><span class="lineno"> 516</span> </div>
<div class="line"><a id="l00517" name="l00517"></a><span class="lineno"> 517</span> <span class="comment">// 2. Use the rate to update all relevant species derivatives (dY/dt)</span></div>
<div class="line"><a id="l00518" name="l00518"></a><span class="lineno"> 518</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="l00519" name="l00519"></a><span class="lineno"> 519</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="l00520" name="l00520"></a><span class="lineno"> 520</span> result.<a class="code hl_variable" href="structgridfire_1_1_step_derivatives.html#ae0de268b86c2404379409c4feae0b34d">dydt</a>[speciesIndex] += threshold_flag * nu_ij * molarReactionFlow / rho;</div>
<div class="line"><a id="l00521" name="l00521"></a><span class="lineno"> 521</span> }</div>
<div class="line"><a id="l00522" name="l00522"></a><span class="lineno"> 522</span> }</div>
<div class="line"><a id="l00523" name="l00523"></a><span class="lineno"> 523</span> </div>
<div class="line"><a id="l00524" name="l00524"></a><span class="lineno"> 524</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="l00525" name="l00525"></a><span class="lineno"> 525</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="l00526" name="l00526"></a><span class="lineno"> 526</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="l00527" name="l00527"></a><span class="lineno"> 527</span> }</div>
<div class="line"><a id="l00506" name="l00506"></a><span class="lineno"> 506</span> <span class="comment">// ----- Initialize variables for molar concentration product and thresholds ---</span></div>
<div class="line"><a id="l00507" name="l00507"></a><span class="lineno"> 507</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="l00508" name="l00508"></a><span class="lineno"> 508</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="l00509" name="l00509"></a><span class="lineno"> 509</span> <span class="comment">// which create branches that break the AD tape.</span></div>
<div class="line"><a id="l00510" name="l00510"></a><span class="lineno"> 510</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="l00511" name="l00511"></a><span class="lineno"> 511</span> </div>
<div class="line"><a id="l00512" name="l00512"></a><span class="lineno"> 512</span> <span class="comment">// --- Check if the density is below the threshold where we ignore reactions ---</span></div>
<div class="line"><a id="l00513" name="l00513"></a><span class="lineno"> 513</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="l00514" name="l00514"></a><span class="lineno"> 514</span> </div>
<div class="line"><a id="l00515" name="l00515"></a><span class="lineno"> 515</span> std::vector&lt;T&gt; Y = Y_in;</div>
<div class="line"><a id="l00516" name="l00516"></a><span class="lineno"> 516</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="l00517" name="l00517"></a><span class="lineno"> 517</span> <span class="comment">// We use CppAD::CondExpLt to handle AD taping and prevent branching</span></div>
<div class="line"><a id="l00518" name="l00518"></a><span class="lineno"> 518</span> <span class="comment">// Note that while this is syntactically more complex this is equivalent to</span></div>
<div class="line"><a id="l00519" name="l00519"></a><span class="lineno"> 519</span> <span class="comment">// if (Y[i] &lt; 0) {Y[i] = 0;}</span></div>
<div class="line"><a id="l00520" name="l00520"></a><span class="lineno"> 520</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="l00521" name="l00521"></a><span class="lineno"> 521</span> <span class="comment">// each timestep, which is very inefficient.</span></div>
<div class="line"><a id="l00522" name="l00522"></a><span class="lineno"> 522</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="l00523" name="l00523"></a><span class="lineno"> 523</span> }</div>
<div class="line"><a id="l00524" name="l00524"></a><span class="lineno"> 524</span> </div>
<div class="line"><a id="l00525" name="l00525"></a><span class="lineno"> 525</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#a0837bab6dcd111d9075c9343b90d64f1">m_constants</a>.get(<span class="stringliteral">&quot;u&quot;</span>).value); <span class="comment">// Atomic mass unit in grams</span></div>
<div class="line"><a id="l00526" name="l00526"></a><span class="lineno"> 526</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#a0837bab6dcd111d9075c9343b90d64f1">m_constants</a>.get(<span class="stringliteral">&quot;N_a&quot;</span>).value); <span class="comment">// Avogadro&#39;s number in mol^-1</span></div>
<div class="line"><a id="l00527" name="l00527"></a><span class="lineno"> 527</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#a0837bab6dcd111d9075c9343b90d64f1">m_constants</a>.get(<span class="stringliteral">&quot;c&quot;</span>).value); <span class="comment">// Speed of light in cm/s</span></div>
<div class="line"><a id="l00528" name="l00528"></a><span class="lineno"> 528</span> </div>
<div class="line"><a id="l00529" name="l00529"></a><span class="lineno"> 529</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>
<div class="line"><a id="l00530" name="l00530"></a><span class="lineno"> 530</span> </div>
<div class="line"><a id="l00531" name="l00531"></a><span class="lineno"> 531</span> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00532" name="l00532"></a><span class="lineno"> 532</span> }</div>
</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> </div>
<div class="line"><a id="l00535" name="l00535"></a><span class="lineno"> 535</span> <span class="keyword">template</span> &lt;IsArithmeticOrAD T&gt;</div>
<div class="foldopen" id="foldopen00536" data-start="{" data-end="}">
<div class="line"><a id="l00536" name="l00536"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a5e96b5a0b34c8932f0e14eabda57f1a4"> 536</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="l00537" name="l00537"></a><span class="lineno"> 537</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="l00538" name="l00538"></a><span class="lineno"> 538</span> <span class="keyword">const</span> std::vector&lt;T&gt; &amp;Y,</div>
<div class="line"><a id="l00539" name="l00539"></a><span class="lineno"> 539</span> <span class="keyword">const</span> T T9,</div>
<div class="line"><a id="l00540" name="l00540"></a><span class="lineno"> 540</span> <span class="keyword">const</span> T rho</div>
<div class="line"><a id="l00541" name="l00541"></a><span class="lineno"> 541</span> )<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00529" name="l00529"></a><span class="lineno"> 529</span> <span class="comment">// --- SINGLE LOOP OVER ALL REACTIONS ---</span></div>
<div class="line"><a id="l00530" name="l00530"></a><span class="lineno"> 530</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="l00531" name="l00531"></a><span class="lineno"> 531</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="l00532" name="l00532"></a><span class="lineno"> 532</span> </div>
<div class="line"><a id="l00533" name="l00533"></a><span class="lineno"> 533</span> <span class="comment">// 1. Calculate reaction rate</span></div>
<div class="line"><a id="l00534" name="l00534"></a><span class="lineno"> 534</span> <span class="keyword">const</span> T molarReactionFlow = screeningFactors[reactionIndex] * <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="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="comment">// 2. Use the rate to update all relevant species derivatives (dY/dt)</span></div>
<div class="line"><a id="l00537" name="l00537"></a><span class="lineno"> 537</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="l00538" name="l00538"></a><span class="lineno"> 538</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="l00539" name="l00539"></a><span class="lineno"> 539</span> result.<a class="code hl_variable" href="structgridfire_1_1_step_derivatives.html#ae0de268b86c2404379409c4feae0b34d">dydt</a>[speciesIndex] += threshold_flag * nu_ij * molarReactionFlow / rho;</div>
<div class="line"><a id="l00540" name="l00540"></a><span class="lineno"> 540</span> }</div>
<div class="line"><a id="l00541" name="l00541"></a><span class="lineno"> 541</span> }</div>
<div class="line"><a id="l00542" name="l00542"></a><span class="lineno"> 542</span> </div>
<div class="line"><a id="l00543" name="l00543"></a><span class="lineno"> 543</span> <span class="comment">// --- Pre-setup (flags to control conditionals in an AD safe / branch aware manner) ---</span></div>
<div class="line"><a id="l00544" name="l00544"></a><span class="lineno"> 544</span> <span class="comment">// ----- Constants for AD safe calculations ---</span></div>
<div class="line"><a id="l00545" name="l00545"></a><span class="lineno"> 545</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="l00546" name="l00546"></a><span class="lineno"> 546</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="l00543" name="l00543"></a><span class="lineno"> 543</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="l00544" name="l00544"></a><span class="lineno"> 544</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="l00545" name="l00545"></a><span class="lineno"> 545</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="l00546" name="l00546"></a><span class="lineno"> 546</span> }</div>
<div class="line"><a id="l00547" name="l00547"></a><span class="lineno"> 547</span> </div>
<div class="line"><a id="l00548" name="l00548"></a><span class="lineno"> 548</span> <span class="comment">// ----- Initialize variables for molar concentration product and thresholds ---</span></div>
<div class="line"><a id="l00549" name="l00549"></a><span class="lineno"> 549</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="l00550" name="l00550"></a><span class="lineno"> 550</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="l00551" name="l00551"></a><span class="lineno"> 551</span> <span class="comment">// which create branches that break the AD tape.</span></div>
<div class="line"><a id="l00552" name="l00552"></a><span class="lineno"> 552</span> <span class="keyword">const</span> T Y_threshold = <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(<a class="code hl_variable" href="namespacegridfire.html#a96c062f94713921e5d7568ecedcdcb06">MIN_ABUNDANCE_THRESHOLD</a>);</div>
<div class="line"><a id="l00553" name="l00553"></a><span class="lineno"> 553</span> T threshold_flag = one;</div>
<div class="line"><a id="l00554" name="l00554"></a><span class="lineno"> 554</span> </div>
<div class="line"><a id="l00555" name="l00555"></a><span class="lineno"> 555</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="l00556" name="l00556"></a><span class="lineno"> 556</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="l00557" name="l00557"></a><span class="lineno"> 557</span> </div>
<div class="line"><a id="l00558" name="l00558"></a><span class="lineno"> 558</span> <span class="comment">// --- Cound the number of each reactant species to account for species multiplicity ---</span></div>
<div class="line"><a id="l00559" name="l00559"></a><span class="lineno"> 559</span> std::unordered_map&lt;std::string, int&gt; reactant_counts;</div>
<div class="line"><a id="l00560" name="l00560"></a><span class="lineno"> 560</span> reactant_counts.reserve(<a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a>.reactants().size());</div>
<div class="line"><a id="l00561" name="l00561"></a><span class="lineno"> 561</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="l00562" name="l00562"></a><span class="lineno"> 562</span> reactant_counts[std::string(reactant.name())]++;</div>
<div class="line"><a id="l00563" name="l00563"></a><span class="lineno"> 563</span> }</div>
<div class="line"><a id="l00564" name="l00564"></a><span class="lineno"> 564</span> </div>
<div class="line"><a id="l00565" name="l00565"></a><span class="lineno"> 565</span> <span class="comment">// --- Accumulator for the molar concentration ---</span></div>
<div class="line"><a id="l00566" name="l00566"></a><span class="lineno"> 566</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>
<div class="line"><a id="l00567" name="l00567"></a><span class="lineno"> 567</span> </div>
<div class="line"><a id="l00568" name="l00568"></a><span class="lineno"> 568</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="l00569" name="l00569"></a><span class="lineno"> 569</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="l00570" name="l00570"></a><span class="lineno"> 570</span> <span class="comment">// --- Resolve species to molar abundance ---</span></div>
<div class="line"><a id="l00571" name="l00571"></a><span class="lineno"> 571</span> <span class="comment">// PERF: Could probably optimize out this lookup</span></div>
<div class="line"><a id="l00572" name="l00572"></a><span class="lineno"> 572</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="l00573" name="l00573"></a><span class="lineno"> 573</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> species_index = species_it-&gt;second;</div>
<div class="line"><a id="l00574" name="l00574"></a><span class="lineno"> 574</span> <span class="keyword">const</span> T Yi = Y[species_index];</div>
<div class="line"><a id="l00575" name="l00575"></a><span class="lineno"> 575</span> </div>
<div class="line"><a id="l00576" name="l00576"></a><span class="lineno"> 576</span> <span class="comment">// --- Check if the species abundance is below the threshold where we ignore reactions ---</span></div>
<div class="line"><a id="l00577" name="l00577"></a><span class="lineno"> 577</span> threshold_flag *= CppAD::CondExpLt(Yi, Y_threshold, zero, one);</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="comment">// --- Convert from molar abundance to molar concentration ---</span></div>
<div class="line"><a id="l00580" name="l00580"></a><span class="lineno"> 580</span> T molar_concentration = Yi * rho;</div>
<div class="line"><a id="l00581" name="l00581"></a><span class="lineno"> 581</span> </div>
<div class="line"><a id="l00582" name="l00582"></a><span class="lineno"> 582</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="l00583" name="l00583"></a><span class="lineno"> 583</span> molar_concentration_product *= CppAD::pow(molar_concentration, <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="l00584" name="l00584"></a><span class="lineno"> 584</span> </div>
<div class="line"><a id="l00585" name="l00585"></a><span class="lineno"> 585</span> <span class="comment">// --- Apply factorial correction for identical reactions ---</span></div>
<div class="line"><a id="l00586" name="l00586"></a><span class="lineno"> 586</span> <span class="keywordflow">if</span> (count &gt; 1) {</div>
<div class="line"><a id="l00587" name="l00587"></a><span class="lineno"> 587</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="l00588" name="l00588"></a><span class="lineno"> 588</span> }</div>
<div class="line"><a id="l00589" name="l00589"></a><span class="lineno"> 589</span> }</div>
<div class="line"><a id="l00590" name="l00590"></a><span class="lineno"> 590</span> <span class="comment">// --- Final reaction flow calculation [mol][s^-1][cm^-3] ---</span></div>
<div class="line"><a id="l00591" name="l00591"></a><span class="lineno"> 591</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="l00592" name="l00592"></a><span class="lineno"> 592</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="l00593" name="l00593"></a><span class="lineno"> 593</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="l00594" name="l00594"></a><span class="lineno"> 594</span> <span class="comment">// the entire network.</span></div>
<div class="line"><a id="l00595" name="l00595"></a><span class="lineno"> 595</span> <span class="keywordflow">return</span> molar_concentration_product * k_reaction * threshold_flag;</div>
<div class="line"><a id="l00596" name="l00596"></a><span class="lineno"> 596</span> }</div>
<div class="line"><a id="l00548" name="l00548"></a><span class="lineno"> 548</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>
<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> <span class="keywordflow">return</span> result;</div>
<div class="line"><a id="l00551" name="l00551"></a><span class="lineno"> 551</span> }</div>
</div>
<div class="line"><a id="l00597" name="l00597"></a><span class="lineno"> 597</span>};</div>
<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#l00118">engine_abstract.h:118</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a0837bab6dcd111d9075c9343b90d64f1"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a0837bab6dcd111d9075c9343b90d64f1">gridfire::GraphEngine::m_constants</a></div><div class="ttdeci">Constants &amp; m_constants</div><div class="ttdoc">Access to physical constants.</div><div class="ttdef"><b>Definition</b> <a href="#l00311">engine_graph.h:311</a></div></div>
<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#l00112">engine_graph.cpp:112</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a26215593544c3a52597194602e4e25dd"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a26215593544c3a52597194602e4e25dd">gridfire::GraphEngine::getSpeciesTimescales</a></div><div class="ttdeci">std::unordered_map&lt; fourdst::atomic::Species, double &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#l00426">engine_graph.cpp:426</a></div></div>
<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#l00085">engine_graph.cpp:85</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="#l00308">engine_graph.h:308</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="#l00306">engine_graph.h:306</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#l00307">engine_graph.cpp:307</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="#l00302">engine_graph.h:302</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="#l00310">engine_graph.h:310</a></div></div>
<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#l00094">engine_graph.cpp:94</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="#l00312">engine_graph.h:312</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a5a5458ed01923124f2d7e1f04f32f138"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a5a5458ed01923124f2d7e1f04f32f138">gridfire::GraphEngine::reserveJacobianMatrix</a></div><div class="ttdeci">void reserveJacobianMatrix()</div><div class="ttdoc">Reserves space for the Jacobian matrix.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00101">engine_graph.cpp:101</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="#l00299">engine_graph.h:299</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#l00317">engine_graph.cpp:317</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#l00372">engine_graph.cpp:372</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a8b3baf29829c7ae0a61430ea70632bbf"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a8b3baf29829c7ae0a61430ea70632bbf">gridfire::GraphEngine::calculateRHSAndEnergy</a></div><div class="ttdeci">StepDerivatives&lt; double &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#l00037">engine_graph.cpp:37</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#l00311">engine_graph.cpp:311</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#l00265">engine_graph.cpp:265</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="#l00301">engine_graph.h:301</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#l00442">engine_graph.cpp:442</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a9f74786ff930ab72664b31f29d05a30c"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a9f74786ff930ab72664b31f29d05a30c">gridfire::GraphEngine::GraphEngine</a></div><div class="ttdeci">GraphEngine(const fourdst::composition::Composition &amp;composition)</div><div class="ttdoc">Constructs a GraphEngine from a composition.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00025">engine_graph.cpp:25</a></div></div>
<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#l00124">engine_graph.cpp:124</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="#l00298">engine_graph.h:298</a></div></div>
<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#l00046">engine_graph.cpp:46</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#l00132">engine_graph.cpp:132</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="#l00305">engine_graph.h:305</a></div></div>
<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#l00118">engine_graph.cpp:118</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="#l00303">engine_graph.h:303</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#l00324">engine_graph.cpp:324</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_ae347ff0316e532e0298ec8c913908105"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#ae347ff0316e532e0298ec8c913908105">gridfire::GraphEngine::generateJacobianMatrix</a></div><div class="ttdeci">void generateJacobianMatrix(const std::vector&lt; double &gt; &amp;Y, const double T9, const double rho) 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#l00274">engine_graph.cpp:274</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#l00208">engine_graph.cpp:208</a></div></div>
<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#l00056">engine_graph.cpp:56</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_aeeafeab40a5f4dbfae78bdc87e25e93f"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#aeeafeab40a5f4dbfae78bdc87e25e93f">gridfire::GraphEngine::validateComposition</a></div><div class="ttdeci">void validateComposition(const fourdst::composition::Composition &amp;composition, double culling, double T9)</div><div class="ttdoc">Validates the composition against the current reaction set.</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_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="#l00475">engine_graph.h:475</a></div></div>
<div class="ttc" id="aclassgridfire_1_1reaction_1_1_logical_reaction_set_html"><div class="ttname"><a href="classgridfire_1_1reaction_1_1_logical_reaction_set.html">gridfire::reaction::LogicalReactionSet</a></div><div class="ttdoc">A collection of LogicalReaction objects.</div><div class="ttdef"><b>Definition</b> <a href="reaction_8h_source.html#l00554">reaction.h:554</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#l00071">reaction.h:71</a></div></div>
<div class="line"><a id="l00552" name="l00552"></a><span class="lineno"> 552</span> </div>
<div class="line"><a id="l00553" name="l00553"></a><span class="lineno"> 553</span> </div>
<div class="line"><a id="l00554" name="l00554"></a><span class="lineno"> 554</span> <span class="keyword">template</span> &lt;IsArithmeticOrAD T&gt;</div>
<div class="foldopen" id="foldopen00555" data-start="{" data-end="}">
<div class="line"><a id="l00555" name="l00555"></a><span class="lineno"><a class="line" href="classgridfire_1_1_graph_engine.html#a5e96b5a0b34c8932f0e14eabda57f1a4"> 555</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="l00556" name="l00556"></a><span class="lineno"> 556</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="l00557" name="l00557"></a><span class="lineno"> 557</span> <span class="keyword">const</span> std::vector&lt;T&gt; &amp;Y,</div>
<div class="line"><a id="l00558" name="l00558"></a><span class="lineno"> 558</span> <span class="keyword">const</span> T T9,</div>
<div class="line"><a id="l00559" name="l00559"></a><span class="lineno"> 559</span> <span class="keyword">const</span> T rho</div>
<div class="line"><a id="l00560" name="l00560"></a><span class="lineno"> 560</span> )<span class="keyword"> const </span>{</div>
<div class="line"><a id="l00561" name="l00561"></a><span class="lineno"> 561</span> </div>
<div class="line"><a id="l00562" name="l00562"></a><span class="lineno"> 562</span> <span class="comment">// --- Pre-setup (flags to control conditionals in an AD safe / branch aware manner) ---</span></div>
<div class="line"><a id="l00563" name="l00563"></a><span class="lineno"> 563</span> <span class="comment">// ----- Constants for AD safe calculations ---</span></div>
<div class="line"><a id="l00564" name="l00564"></a><span class="lineno"> 564</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="l00565" name="l00565"></a><span class="lineno"> 565</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="l00566" name="l00566"></a><span class="lineno"> 566</span> </div>
<div class="line"><a id="l00567" name="l00567"></a><span class="lineno"> 567</span> <span class="comment">// ----- Initialize variables for molar concentration product and thresholds ---</span></div>
<div class="line"><a id="l00568" name="l00568"></a><span class="lineno"> 568</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="l00569" name="l00569"></a><span class="lineno"> 569</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="l00570" name="l00570"></a><span class="lineno"> 570</span> <span class="comment">// which create branches that break the AD tape.</span></div>
<div class="line"><a id="l00571" name="l00571"></a><span class="lineno"> 571</span> <span class="keyword">const</span> T Y_threshold = <span class="keyword">static_cast&lt;</span>T<span class="keyword">&gt;</span>(<a class="code hl_variable" href="namespacegridfire.html#a96c062f94713921e5d7568ecedcdcb06">MIN_ABUNDANCE_THRESHOLD</a>);</div>
<div class="line"><a id="l00572" name="l00572"></a><span class="lineno"> 572</span> T threshold_flag = one;</div>
<div class="line"><a id="l00573" name="l00573"></a><span class="lineno"> 573</span> </div>
<div class="line"><a id="l00574" name="l00574"></a><span class="lineno"> 574</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="l00575" name="l00575"></a><span class="lineno"> 575</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="l00576" name="l00576"></a><span class="lineno"> 576</span> </div>
<div class="line"><a id="l00577" name="l00577"></a><span class="lineno"> 577</span> <span class="comment">// --- Cound the number of each reactant species to account for species multiplicity ---</span></div>
<div class="line"><a id="l00578" name="l00578"></a><span class="lineno"> 578</span> std::unordered_map&lt;std::string, int&gt; reactant_counts;</div>
<div class="line"><a id="l00579" name="l00579"></a><span class="lineno"> 579</span> reactant_counts.reserve(<a class="code hl_namespace" href="namespacegridfire_1_1reaction.html">reaction</a>.reactants().size());</div>
<div class="line"><a id="l00580" name="l00580"></a><span class="lineno"> 580</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="l00581" name="l00581"></a><span class="lineno"> 581</span> reactant_counts[std::string(reactant.name())]++;</div>
<div class="line"><a id="l00582" name="l00582"></a><span class="lineno"> 582</span> }</div>
<div class="line"><a id="l00583" name="l00583"></a><span class="lineno"> 583</span> </div>
<div class="line"><a id="l00584" name="l00584"></a><span class="lineno"> 584</span> <span class="comment">// --- Accumulator for the molar concentration ---</span></div>
<div class="line"><a id="l00585" name="l00585"></a><span class="lineno"> 585</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>
<div class="line"><a id="l00586" name="l00586"></a><span class="lineno"> 586</span> </div>
<div class="line"><a id="l00587" name="l00587"></a><span class="lineno"> 587</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="l00588" name="l00588"></a><span class="lineno"> 588</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="l00589" name="l00589"></a><span class="lineno"> 589</span> <span class="comment">// --- Resolve species to molar abundance ---</span></div>
<div class="line"><a id="l00590" name="l00590"></a><span class="lineno"> 590</span> <span class="comment">// PERF: Could probably optimize out this lookup</span></div>
<div class="line"><a id="l00591" name="l00591"></a><span class="lineno"> 591</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="l00592" name="l00592"></a><span class="lineno"> 592</span> <span class="keyword">const</span> <span class="keywordtype">size_t</span> species_index = species_it-&gt;second;</div>
<div class="line"><a id="l00593" name="l00593"></a><span class="lineno"> 593</span> <span class="keyword">const</span> T Yi = Y[species_index];</div>
<div class="line"><a id="l00594" name="l00594"></a><span class="lineno"> 594</span> </div>
<div class="line"><a id="l00595" name="l00595"></a><span class="lineno"> 595</span> <span class="comment">// --- Check if the species abundance is below the threshold where we ignore reactions ---</span></div>
<div class="line"><a id="l00596" name="l00596"></a><span class="lineno"> 596</span> threshold_flag *= CppAD::CondExpLt(Yi, Y_threshold, zero, one);</div>
<div class="line"><a id="l00597" name="l00597"></a><span class="lineno"> 597</span> </div>
<div class="line"><a id="l00598" name="l00598"></a><span class="lineno"> 598</span> <span class="comment">// --- Convert from molar abundance to molar concentration ---</span></div>
<div class="line"><a id="l00599" name="l00599"></a><span class="lineno"> 599</span> T molar_concentration = Yi * rho;</div>
<div class="line"><a id="l00600" name="l00600"></a><span class="lineno"> 600</span> </div>
<div class="line"><a id="l00601" name="l00601"></a><span class="lineno"> 601</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="l00602" name="l00602"></a><span class="lineno"> 602</span> molar_concentration_product *= CppAD::pow(molar_concentration, <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="l00603" name="l00603"></a><span class="lineno"> 603</span> </div>
<div class="line"><a id="l00604" name="l00604"></a><span class="lineno"> 604</span> <span class="comment">// --- Apply factorial correction for identical reactions ---</span></div>
<div class="line"><a id="l00605" name="l00605"></a><span class="lineno"> 605</span> <span class="keywordflow">if</span> (count &gt; 1) {</div>
<div class="line"><a id="l00606" name="l00606"></a><span class="lineno"> 606</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="l00607" name="l00607"></a><span class="lineno"> 607</span> }</div>
<div class="line"><a id="l00608" name="l00608"></a><span class="lineno"> 608</span> }</div>
<div class="line"><a id="l00609" name="l00609"></a><span class="lineno"> 609</span> <span class="comment">// --- Final reaction flow calculation [mol][s^-1][cm^-3] ---</span></div>
<div class="line"><a id="l00610" name="l00610"></a><span class="lineno"> 610</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="l00611" name="l00611"></a><span class="lineno"> 611</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="l00612" name="l00612"></a><span class="lineno"> 612</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="l00613" name="l00613"></a><span class="lineno"> 613</span> <span class="comment">// the entire network.</span></div>
<div class="line"><a id="l00614" name="l00614"></a><span class="lineno"> 614</span> <span class="keywordflow">return</span> molar_concentration_product * k_reaction * threshold_flag;</div>
<div class="line"><a id="l00615" name="l00615"></a><span class="lineno"> 615</span> }</div>
</div>
<div class="line"><a id="l00616" name="l00616"></a><span class="lineno"> 616</span>};</div>
<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#l00121">engine_abstract.h:121</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a0837bab6dcd111d9075c9343b90d64f1"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a0837bab6dcd111d9075c9343b90d64f1">gridfire::GraphEngine::m_constants</a></div><div class="ttdeci">Constants &amp; m_constants</div><div class="ttdoc">Access to physical constants.</div><div class="ttdef"><b>Definition</b> <a href="#l00323">engine_graph.h:323</a></div></div>
<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#l00113">engine_graph.cpp:113</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a26215593544c3a52597194602e4e25dd"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a26215593544c3a52597194602e4e25dd">gridfire::GraphEngine::getSpeciesTimescales</a></div><div class="ttdeci">std::unordered_map&lt; fourdst::atomic::Species, double &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#l00436">engine_graph.cpp:436</a></div></div>
<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#l00086">engine_graph.cpp:86</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="#l00317">engine_graph.h:317</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="#l00315">engine_graph.h:315</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#l00317">engine_graph.cpp:317</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="#l00311">engine_graph.h:311</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="#l00322">engine_graph.h:322</a></div></div>
<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#l00095">engine_graph.cpp:95</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="#l00324">engine_graph.h:324</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a51b4cedf9b00de79fb6eef243631b04d"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a51b4cedf9b00de79fb6eef243631b04d">gridfire::GraphEngine::update</a></div><div class="ttdeci">void update(const NetIn &amp;netIn) override</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00452">engine_graph.cpp:452</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="#l00319">engine_graph.h:319</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a5a5458ed01923124f2d7e1f04f32f138"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a5a5458ed01923124f2d7e1f04f32f138">gridfire::GraphEngine::reserveJacobianMatrix</a></div><div class="ttdeci">void reserveJacobianMatrix()</div><div class="ttdoc">Reserves space for the Jacobian matrix.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00102">engine_graph.cpp:102</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="#l00308">engine_graph.h:308</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="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00271">engine_graph.cpp:271</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#l00327">engine_graph.cpp:327</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="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00266">engine_graph.cpp:266</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#l00382">engine_graph.cpp:382</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a8b3baf29829c7ae0a61430ea70632bbf"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a8b3baf29829c7ae0a61430ea70632bbf">gridfire::GraphEngine::calculateRHSAndEnergy</a></div><div class="ttdeci">StepDerivatives&lt; double &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#l00038">engine_graph.cpp:38</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#l00321">engine_graph.cpp:321</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#l00275">engine_graph.cpp:275</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="#l00310">engine_graph.h:310</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#l00456">engine_graph.cpp:456</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_a9f74786ff930ab72664b31f29d05a30c"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#a9f74786ff930ab72664b31f29d05a30c">gridfire::GraphEngine::GraphEngine</a></div><div class="ttdeci">GraphEngine(const fourdst::composition::Composition &amp;composition)</div><div class="ttdoc">Constructs a GraphEngine from a composition.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00026">engine_graph.cpp:26</a></div></div>
<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#l00125">engine_graph.cpp:125</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="#l00307">engine_graph.h:307</a></div></div>
<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#l00047">engine_graph.cpp:47</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#l00133">engine_graph.cpp:133</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="#l00314">engine_graph.h:314</a></div></div>
<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#l00119">engine_graph.cpp:119</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="#l00312">engine_graph.h:312</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#l00334">engine_graph.cpp:334</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_ae347ff0316e532e0298ec8c913908105"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#ae347ff0316e532e0298ec8c913908105">gridfire::GraphEngine::generateJacobianMatrix</a></div><div class="ttdeci">void generateJacobianMatrix(const std::vector&lt; double &gt; &amp;Y, const double T9, const double rho) 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#l00284">engine_graph.cpp:284</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#l00209">engine_graph.cpp:209</a></div></div>
<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#l00057">engine_graph.cpp:57</a></div></div>
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html_aeeafeab40a5f4dbfae78bdc87e25e93f"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html#aeeafeab40a5f4dbfae78bdc87e25e93f">gridfire::GraphEngine::validateComposition</a></div><div class="ttdeci">void validateComposition(const fourdst::composition::Composition &amp;composition, double culling, double T9)</div><div class="ttdoc">Validates the composition against the current reaction set.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8cpp_source.html#l00188">engine_graph.cpp:188</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="#l00320">engine_graph.h:320</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="#l00487">engine_graph.h:487</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>
<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#l00024">reaction.h:24</a></div></div>
<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#l00021">engine_abstract.h:21</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="#l00031">engine_graph.h:31</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="#l00053">engine_graph.h:53</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="#l00044">engine_graph.h:44</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="#l00061">engine_graph.h:61</a></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>
<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#l00557">reaction.h:557</a></div></div>
<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="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="ttdef"><b>Definition</b> <a href="screening__types_8h_source.html#l00008">screening_types.h:8</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.</div><div class="ttdef"><b>Definition</b> <a href="screening__types_8h_source.html#l00009">screening_types.h:9</a></div></div>
<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#l00024">engine_abstract.h:24</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="#l00034">engine_graph.h:34</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="#l00056">engine_graph.h:56</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="#l00047">engine_graph.h:47</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="#l00064">engine_graph.h:64</a></div></div>
<div class="ttc" id="anetwork_8h_html"><div class="ttname"><a href="network_8h.html">network.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="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#l00050">engine_abstract.h:50</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#l00052">engine_abstract.h:52</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#l00051">engine_abstract.h:51</a></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_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>
<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#l00053">engine_abstract.h:53</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#l00055">engine_abstract.h:55</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#l00054">engine_abstract.h:54</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->