<ahref="engine__graph_8h.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aid="l00001"name="l00001"></a><spanclass="lineno"> 1</span><spanclass="preprocessor">#pragma once</span></div>
<divclass="line"><aid="l00023"name="l00023"></a><spanclass="lineno"> 23</span><spanclass="comment">// PERF: The function getNetReactionStoichiometry returns a map of species to their stoichiometric coefficients for a given reaction.</span></div>
<divclass="line"><aid="l00024"name="l00024"></a><spanclass="lineno"> 24</span><spanclass="comment">// this makes extra copies of the species, which is not ideal and could be optimized further.</span></div>
<divclass="line"><aid="l00025"name="l00025"></a><spanclass="lineno"> 25</span><spanclass="comment">// Even more relevant is the member m_reactionIDMap which makes copies of a REACLIBReaction for each reaction ID.</span></div>
<divclass="line"><aid="l00026"name="l00026"></a><spanclass="lineno"> 26</span><spanclass="comment">// REACLIBReactions are quite large data structures, so this could be a performance bottleneck.</span></div>
<divclass="line"><aid="l00422"name="l00422"></a><spanclass="lineno"> 422</span> T <aclass="code hl_function"href="classgridfire_1_1_graph_engine.html#a9245642b741f215e52861d00e756fb3f">calculateMolarReactionFlow</a>(</div>
<divclass="line"><aid="l00488"name="l00488"></a><spanclass="lineno"> 488</span><spanclass="keyword">const</span> std::vector<T>&Y_in, T T9, T rho)<spanclass="keyword"> const </span>{</div>
<divclass="line"><aid="l00501"name="l00501"></a><spanclass="lineno"> 501</span><spanclass="comment">// --- AD Pre-setup (flags to control conditionals in an AD safe / branch aware manner) ---</span></div>
<divclass="line"><aid="l00502"name="l00502"></a><spanclass="lineno"> 502</span><spanclass="comment">// ----- Constants for AD safe calculations ---</span></div>
<divclass="line"><aid="l00503"name="l00503"></a><spanclass="lineno"> 503</span><spanclass="keyword">const</span> T zero = <spanclass="keyword">static_cast<</span>T<spanclass="keyword">></span>(0.0);</div>
<divclass="line"><aid="l00504"name="l00504"></a><spanclass="lineno"> 504</span><spanclass="keyword">const</span> T one = <spanclass="keyword">static_cast<</span>T<spanclass="keyword">></span>(1.0);</div>
<divclass="line"><aid="l00506"name="l00506"></a><spanclass="lineno"> 506</span><spanclass="comment">// ----- Initialize variables for molar concentration product and thresholds ---</span></div>
<divclass="line"><aid="l00507"name="l00507"></a><spanclass="lineno"> 507</span><spanclass="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>
<divclass="line"><aid="l00508"name="l00508"></a><spanclass="lineno"> 508</span><spanclass="comment">// to zero so that the final returned reaction flow is 0. This is as opposed to standard if statements</span></div>
<divclass="line"><aid="l00509"name="l00509"></a><spanclass="lineno"> 509</span><spanclass="comment">// which create branches that break the AD tape.</span></div>
<divclass="line"><aid="l00510"name="l00510"></a><spanclass="lineno"> 510</span><spanclass="keyword">const</span> T rho_threshold = <spanclass="keyword">static_cast<</span>T<spanclass="keyword">></span>(<aclass="code hl_variable"href="namespacegridfire.html#ada3c137c014ecd8d06200fea2d1a9f50">MIN_DENSITY_THRESHOLD</a>);</div>
<divclass="line"><aid="l00512"name="l00512"></a><spanclass="lineno"> 512</span><spanclass="comment">// --- Check if the density is below the threshold where we ignore reactions ---</span></div>
<divclass="line"><aid="l00513"name="l00513"></a><spanclass="lineno"> 513</span> T threshold_flag = CppAD::CondExpLt(rho, rho_threshold, zero, one); <spanclass="comment">// If rho < threshold, set flag to 0</span></div>
<divclass="line"><aid="l00515"name="l00515"></a><spanclass="lineno"> 515</span> std::vector<T> Y = Y_in;</div>
<divclass="line"><aid="l00516"name="l00516"></a><spanclass="lineno"> 516</span><spanclass="keywordflow">for</span> (<spanclass="keywordtype">size_t</span> i = 0; i <<aclass="code hl_variable"href="classgridfire_1_1_graph_engine.html#a92d26068ba139e47d335f5fe9e2814cc">m_networkSpecies</a>.size(); ++i) {</div>
<divclass="line"><aid="l00517"name="l00517"></a><spanclass="lineno"> 517</span><spanclass="comment">// We use CppAD::CondExpLt to handle AD taping and prevent branching</span></div>
<divclass="line"><aid="l00518"name="l00518"></a><spanclass="lineno"> 518</span><spanclass="comment">// Note that while this is syntactically more complex this is equivalent to</span></div>
<divclass="line"><aid="l00519"name="l00519"></a><spanclass="lineno"> 519</span><spanclass="comment">// if (Y[i] < 0) {Y[i] = 0;}</span></div>
<divclass="line"><aid="l00520"name="l00520"></a><spanclass="lineno"> 520</span><spanclass="comment">// The issue is that this would introduce a branch which would require the auto diff tape to be re-recorded</span></div>
<divclass="line"><aid="l00521"name="l00521"></a><spanclass="lineno"> 521</span><spanclass="comment">// each timestep, which is very inefficient.</span></div>
<divclass="line"><aid="l00525"name="l00525"></a><spanclass="lineno"> 525</span><spanclass="keyword">const</span> T u = <spanclass="keyword">static_cast<</span>T<spanclass="keyword">></span>(<aclass="code hl_variable"href="classgridfire_1_1_graph_engine.html#a0837bab6dcd111d9075c9343b90d64f1">m_constants</a>.get(<spanclass="stringliteral">"u"</span>).value); <spanclass="comment">// Atomic mass unit in grams</span></div>
<divclass="line"><aid="l00526"name="l00526"></a><spanclass="lineno"> 526</span><spanclass="keyword">const</span> T N_A = <spanclass="keyword">static_cast<</span>T<spanclass="keyword">></span>(<aclass="code hl_variable"href="classgridfire_1_1_graph_engine.html#a0837bab6dcd111d9075c9343b90d64f1">m_constants</a>.get(<spanclass="stringliteral">"N_a"</span>).value); <spanclass="comment">// Avogadro's number in mol^-1</span></div>
<divclass="line"><aid="l00527"name="l00527"></a><spanclass="lineno"> 527</span><spanclass="keyword">const</span> T c = <spanclass="keyword">static_cast<</span>T<spanclass="keyword">></span>(<aclass="code hl_variable"href="classgridfire_1_1_graph_engine.html#a0837bab6dcd111d9075c9343b90d64f1">m_constants</a>.get(<spanclass="stringliteral">"c"</span>).value); <spanclass="comment">// Speed of light in cm/s</span></div>
<divclass="line"><aid="l00529"name="l00529"></a><spanclass="lineno"> 529</span><spanclass="comment">// --- SINGLE LOOP OVER ALL REACTIONS ---</span></div>
<divclass="line"><aid="l00536"name="l00536"></a><spanclass="lineno"> 536</span><spanclass="comment">// 2. Use the rate to update all relevant species derivatives (dY/dt)</span></div>
<divclass="line"><aid="l00555"name="l00555"></a><spanclass="lineno"><aclass="line"href="classgridfire_1_1_graph_engine.html#a5e96b5a0b34c8932f0e14eabda57f1a4"> 555</a></span> T <aclass="code hl_function"href="classgridfire_1_1_graph_engine.html#a9245642b741f215e52861d00e756fb3f">GraphEngine::calculateMolarReactionFlow</a>(</div>
<divclass="line"><aid="l00562"name="l00562"></a><spanclass="lineno"> 562</span><spanclass="comment">// --- Pre-setup (flags to control conditionals in an AD safe / branch aware manner) ---</span></div>
<divclass="line"><aid="l00563"name="l00563"></a><spanclass="lineno"> 563</span><spanclass="comment">// ----- Constants for AD safe calculations ---</span></div>
<divclass="line"><aid="l00564"name="l00564"></a><spanclass="lineno"> 564</span><spanclass="keyword">const</span> T zero = <spanclass="keyword">static_cast<</span>T<spanclass="keyword">></span>(0.0);</div>
<divclass="line"><aid="l00565"name="l00565"></a><spanclass="lineno"> 565</span><spanclass="keyword">const</span> T one = <spanclass="keyword">static_cast<</span>T<spanclass="keyword">></span>(1.0);</div>
<divclass="line"><aid="l00567"name="l00567"></a><spanclass="lineno"> 567</span><spanclass="comment">// ----- Initialize variables for molar concentration product and thresholds ---</span></div>
<divclass="line"><aid="l00568"name="l00568"></a><spanclass="lineno"> 568</span><spanclass="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>
<divclass="line"><aid="l00569"name="l00569"></a><spanclass="lineno"> 569</span><spanclass="comment">// to zero so that the final returned reaction flow is 0. This is as opposed to standard if statements</span></div>
<divclass="line"><aid="l00570"name="l00570"></a><spanclass="lineno"> 570</span><spanclass="comment">// which create branches that break the AD tape.</span></div>
<divclass="line"><aid="l00571"name="l00571"></a><spanclass="lineno"> 571</span><spanclass="keyword">const</span> T Y_threshold = <spanclass="keyword">static_cast<</span>T<spanclass="keyword">></span>(<aclass="code hl_variable"href="namespacegridfire.html#a96c062f94713921e5d7568ecedcdcb06">MIN_ABUNDANCE_THRESHOLD</a>);</div>
<divclass="line"><aid="l00572"name="l00572"></a><spanclass="lineno"> 572</span> T threshold_flag = one;</div>
<divclass="line"><aid="l00574"name="l00574"></a><spanclass="lineno"> 574</span><spanclass="comment">// --- Calculate the molar reaction rate (in units of [s^-1][cm^3(N-1)][mol^(1-N)] for N reactants) ---</span></div>
<divclass="line"><aid="l00575"name="l00575"></a><spanclass="lineno"> 575</span><spanclass="keyword">const</span> T k_reaction = <aclass="code hl_namespace"href="namespacegridfire_1_1reaction.html">reaction</a>.calculate_rate(T9);</div>
<divclass="line"><aid="l00577"name="l00577"></a><spanclass="lineno"> 577</span><spanclass="comment">// --- Cound the number of each reactant species to account for species multiplicity ---</span></div>
<divclass="line"><aid="l00584"name="l00584"></a><spanclass="lineno"> 584</span><spanclass="comment">// --- Accumulator for the molar concentration ---</span></div>
<divclass="line"><aid="l00587"name="l00587"></a><spanclass="lineno"> 587</span><spanclass="comment">// --- Loop through each unique reactant species and calculate the molar concentration for that species then multiply that into the accumulator ---</span></div>
<divclass="line"><aid="l00589"name="l00589"></a><spanclass="lineno"> 589</span><spanclass="comment">// --- Resolve species to molar abundance ---</span></div>
<divclass="line"><aid="l00590"name="l00590"></a><spanclass="lineno"> 590</span><spanclass="comment">// PERF: Could probably optimize out this lookup</span></div>
<divclass="line"><aid="l00595"name="l00595"></a><spanclass="lineno"> 595</span><spanclass="comment">// --- Check if the species abundance is below the threshold where we ignore reactions ---</span></div>
<divclass="line"><aid="l00601"name="l00601"></a><spanclass="lineno"> 601</span><spanclass="comment">// --- If count is > 1 , we need to raise the molar concentration to the power of count since there are really count bodies in that reaction ---</span></div>
<divclass="line"><aid="l00609"name="l00609"></a><spanclass="lineno"> 609</span><spanclass="comment">// --- Final reaction flow calculation [mol][s^-1][cm^-3] ---</span></div>
<divclass="line"><aid="l00610"name="l00610"></a><spanclass="lineno"> 610</span><spanclass="comment">// Note: If the threshold flag ever gets set to zero this will return zero.</span></div>
<divclass="line"><aid="l00611"name="l00611"></a><spanclass="lineno"> 611</span><spanclass="comment">// This will result basically in multiple branches being written to the AD tape, which will make</span></div>
<divclass="line"><aid="l00612"name="l00612"></a><spanclass="lineno"> 612</span><spanclass="comment">// the tape more expensive to record, but it will also mean that we only need to record it once for</span></div>
<divclass="line"><aid="l00613"name="l00613"></a><spanclass="lineno"> 613</span><spanclass="comment">// the entire network.</span></div>
<divclass="ttc"id="aclassgridfire_1_1_dynamic_engine_html"><divclass="ttname"><ahref="classgridfire_1_1_dynamic_engine.html">gridfire::DynamicEngine</a></div><divclass="ttdoc">Abstract class for engines supporting Jacobian and stoichiometry operations.</div><divclass="ttdef"><b>Definition</b><ahref="engine__abstract_8h_source.html#l00121">engine_abstract.h:121</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a0837bab6dcd111d9075c9343b90d64f1"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a0837bab6dcd111d9075c9343b90d64f1">gridfire::GraphEngine::m_constants</a></div><divclass="ttdeci">Constants & m_constants</div><divclass="ttdoc">Access to physical constants.</div><divclass="ttdef"><b>Definition</b><ahref="#l00323">engine_graph.h:323</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a0ed390f3e598ebba4e245ac90bb78767"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a0ed390f3e598ebba4e245ac90bb78767">gridfire::GraphEngine::getNetworkSpecies</a></div><divclass="ttdeci">const std::vector< fourdst::atomic::Species >& getNetworkSpecies() const override</div><divclass="ttdoc">Gets the list of species in the network.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00113">engine_graph.cpp:113</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a26215593544c3a52597194602e4e25dd"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a26215593544c3a52597194602e4e25dd">gridfire::GraphEngine::getSpeciesTimescales</a></div><divclass="ttdeci">std::unordered_map< fourdst::atomic::Species, double > getSpeciesTimescales(const std::vector< double >&Y, double T9, double rho) const override</div><divclass="ttdoc">Computes timescales for all species in the network.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00436">engine_graph.cpp:436</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a26602e1b3c610780a47b5a6511d6d567"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a26602e1b3c610780a47b5a6511d6d567">gridfire::GraphEngine::populateReactionIDMap</a></div><divclass="ttdeci">void populateReactionIDMap()</div><divclass="ttdoc">Populates the reaction ID map.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00086">engine_graph.cpp:86</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a2e22b111f6d00ecc9e3804a71f1ce876"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a2e22b111f6d00ecc9e3804a71f1ce876">gridfire::GraphEngine::m_rhsADFun</a></div><divclass="ttdeci">CppAD::ADFun< double > m_rhsADFun</div><divclass="ttdoc">CppAD function for the right-hand side of the ODE.</div><divclass="ttdef"><b>Definition</b><ahref="#l00317">engine_graph.h:317</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a2f1718c89d4aaad028102724d18fa910"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a2f1718c89d4aaad028102724d18fa910">gridfire::GraphEngine::m_jacobianMatrix</a></div><divclass="ttdeci">boost::numeric::ublas::compressed_matrix< double > m_jacobianMatrix</div><divclass="ttdoc">Jacobian matrix (species x species).</div><divclass="ttdef"><b>Definition</b><ahref="#l00315">engine_graph.h:315</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a303e6093591cde91430f866a04a8be7c"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a303e6093591cde91430f866a04a8be7c">gridfire::GraphEngine::getJacobianMatrixEntry</a></div><divclass="ttdeci">double getJacobianMatrixEntry(const int i, const int j) const override</div><divclass="ttdoc">Gets an entry from the previously generated Jacobian matrix.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00317">engine_graph.cpp:317</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a30e09ed0bce6aa5fc89beaa316a7b827"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a30e09ed0bce6aa5fc89beaa316a7b827">gridfire::GraphEngine::m_networkSpeciesMap</a></div><divclass="ttdeci">std::unordered_map< std::string_view, fourdst::atomic::Species > m_networkSpeciesMap</div><divclass="ttdoc">Map from species name to Species object.</div><divclass="ttdef"><b>Definition</b><ahref="#l00311">engine_graph.h:311</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a3b17102b143435ddfdc015d7a50c4b18"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a3b17102b143435ddfdc015d7a50c4b18">gridfire::GraphEngine::m_config</a></div><divclass="ttdeci">Config & m_config</div><divclass="ttdef"><b>Definition</b><ahref="#l00322">engine_graph.h:322</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a47202c43342b96480070874bffce1391"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a47202c43342b96480070874bffce1391">gridfire::GraphEngine::populateSpeciesToIndexMap</a></div><divclass="ttdeci">void populateSpeciesToIndexMap()</div><divclass="ttdoc">Populates the species-to-index map.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00095">engine_graph.cpp:95</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a52edc3e88f1e8fc497e1e63972d63c80"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a52edc3e88f1e8fc497e1e63972d63c80">gridfire::GraphEngine::m_screeningType</a></div><divclass="ttdeci">screening::ScreeningType m_screeningType</div><divclass="ttdoc">Screening type for the reaction network. Default to no screening.</div><divclass="ttdef"><b>Definition</b><ahref="#l00319">engine_graph.h:319</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a5a5458ed01923124f2d7e1f04f32f138"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a5a5458ed01923124f2d7e1f04f32f138">gridfire::GraphEngine::reserveJacobianMatrix</a></div><divclass="ttdeci">void reserveJacobianMatrix()</div><divclass="ttdoc">Reserves space for the Jacobian matrix.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00102">engine_graph.cpp:102</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a5d6cc63b99b467c2a976d1fbaaa1dfa3"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a5d6cc63b99b467c2a976d1fbaaa1dfa3">gridfire::GraphEngine::m_reactionIDMap</a></div><divclass="ttdeci">std::unordered_map< std::string_view, reaction::Reaction * > m_reactionIDMap</div><divclass="ttdoc">Map from reaction ID to REACLIBReaction. //PERF: This makes copies of REACLIBReaction and could be a ...</div><divclass="ttdef"><b>Definition</b><ahref="#l00308">engine_graph.h:308</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a6b5feaf788bade212b7c8df7ac8c8152"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a6b5feaf788bade212b7c8df7ac8c8152">gridfire::GraphEngine::getStoichiometryMatrixEntry</a></div><divclass="ttdeci">int getStoichiometryMatrixEntry(const int speciesIndex, const int reactionIndex) const override</div><divclass="ttdoc">Gets an entry from the stoichiometry matrix.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00327">engine_graph.cpp:327</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a832e2fe066381811a3e0464806ff5e95"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a832e2fe066381811a3e0464806ff5e95">gridfire::GraphEngine::exportToCSV</a></div><divclass="ttdeci">void exportToCSV(const std::string &filename) const</div><divclass="ttdoc">Exports the network to a CSV file for analysis.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00382">engine_graph.cpp:382</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a8b3baf29829c7ae0a61430ea70632bbf"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a8b3baf29829c7ae0a61430ea70632bbf">gridfire::GraphEngine::calculateRHSAndEnergy</a></div><divclass="ttdeci">StepDerivatives< double > calculateRHSAndEnergy(const std::vector< double >&Y, const double T9, const double rho) const override</div><divclass="ttdoc">Calculates the right-hand side (dY/dt) and energy generation rate.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00038">engine_graph.cpp:38</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a8c29d8bbde407e913be5eb77efb2c0c9"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a8c29d8bbde407e913be5eb77efb2c0c9">gridfire::GraphEngine::getNetReactionStoichiometry</a></div><divclass="ttdeci">static std::unordered_map< fourdst::atomic::Species, int > getNetReactionStoichiometry(const reaction::Reaction &reaction)</div><divclass="ttdoc">Gets the net stoichiometry for a given reaction.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00321">engine_graph.cpp:321</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a9245642b741f215e52861d00e756fb3f"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a9245642b741f215e52861d00e756fb3f">gridfire::GraphEngine::calculateMolarReactionFlow</a></div><divclass="ttdeci">double calculateMolarReactionFlow(const reaction::Reaction &reaction, const std::vector< double >&Y, const double T9, const double rho) const override</div><divclass="ttdoc">Calculates the molar reaction flow for a given reaction.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00275">engine_graph.cpp:275</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a92d26068ba139e47d335f5fe9e2814cc"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a92d26068ba139e47d335f5fe9e2814cc">gridfire::GraphEngine::m_networkSpecies</a></div><divclass="ttdeci">std::vector< fourdst::atomic::Species > m_networkSpecies</div><divclass="ttdoc">Vector of unique species in the network.</div><divclass="ttdef"><b>Definition</b><ahref="#l00310">engine_graph.h:310</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a95563f6bc86007d9ee053a0f1e15b889"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a95563f6bc86007d9ee053a0f1e15b889">gridfire::GraphEngine::recordADTape</a></div><divclass="ttdeci">void recordADTape()</div><divclass="ttdoc">Records the AD tape for the right-hand side of the ODE.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00456">engine_graph.cpp:456</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_a9f74786ff930ab72664b31f29d05a30c"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#a9f74786ff930ab72664b31f29d05a30c">gridfire::GraphEngine::GraphEngine</a></div><divclass="ttdeci">GraphEngine(const fourdst::composition::Composition &composition)</div><divclass="ttdoc">Constructs a GraphEngine from a composition.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00026">engine_graph.cpp:26</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_aa6202cee0c3c481eda77cc9a91bc126b"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#aa6202cee0c3c481eda77cc9a91bc126b">gridfire::GraphEngine::involvesSpecies</a></div><divclass="ttdeci">bool involvesSpecies(const fourdst::atomic::Species &species) const</div><divclass="ttdoc">Checks if a given species is involved in the network.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00125">engine_graph.cpp:125</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_acb7c4f5108b0efeae48ad15598e808c3"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#acb7c4f5108b0efeae48ad15598e808c3">gridfire::GraphEngine::m_reactions</a></div><divclass="ttdeci">reaction::LogicalReactionSet m_reactions</div><divclass="ttdoc">Set of REACLIB reactions in the network.</div><divclass="ttdef"><b>Definition</b><ahref="#l00307">engine_graph.h:307</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_acdce8d87e23a2cd1504bc9472e538c0f"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#acdce8d87e23a2cd1504bc9472e538c0f">gridfire::GraphEngine::syncInternalMaps</a></div><divclass="ttdeci">void syncInternalMaps()</div><divclass="ttdoc">Synchronizes the internal maps.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00047">engine_graph.cpp:47</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_acf4cfccea20f5cb31c9886bf233a28be"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#acf4cfccea20f5cb31c9886bf233a28be">gridfire::GraphEngine::validateConservation</a></div><divclass="ttdeci">bool validateConservation() const</div><divclass="ttdoc">Validates mass and charge conservation across all reactions.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00133">engine_graph.cpp:133</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_ad1cb5fd32efc37668e2d9ecf0c72ad24"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#ad1cb5fd32efc37668e2d9ecf0c72ad24">gridfire::GraphEngine::m_stoichiometryMatrix</a></div><divclass="ttdeci">boost::numeric::ublas::compressed_matrix< int > m_stoichiometryMatrix</div><divclass="ttdoc">Stoichiometry matrix (species x reactions).</div><divclass="ttdef"><b>Definition</b><ahref="#l00314">engine_graph.h:314</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_ad45650d10fc5dff1673ae3f806d067da"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#ad45650d10fc5dff1673ae3f806d067da">gridfire::GraphEngine::getNetworkReactions</a></div><divclass="ttdeci">const reaction::LogicalReactionSet & getNetworkReactions() const override</div><divclass="ttdoc">Gets the set of logical reactions in the network.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00119">engine_graph.cpp:119</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_ad8237c252145a75092202d00f5e1ddf7"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#ad8237c252145a75092202d00f5e1ddf7">gridfire::GraphEngine::m_speciesToIndexMap</a></div><divclass="ttdeci">std::unordered_map< fourdst::atomic::Species, size_t > m_speciesToIndexMap</div><divclass="ttdoc">Map from species to their index in the stoichiometry matrix.</div><divclass="ttdef"><b>Definition</b><ahref="#l00312">engine_graph.h:312</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_adac8c7d62bae76e17fc060e86dadd929"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#adac8c7d62bae76e17fc060e86dadd929">gridfire::GraphEngine::exportToDot</a></div><divclass="ttdeci">void exportToDot(const std::string &filename) const</div><divclass="ttdoc">Exports the network to a DOT file for visualization.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00334">engine_graph.cpp:334</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_ae347ff0316e532e0298ec8c913908105"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#ae347ff0316e532e0298ec8c913908105">gridfire::GraphEngine::generateJacobianMatrix</a></div><divclass="ttdeci">void generateJacobianMatrix(const std::vector< double >&Y, const double T9, const double rho) override</div><divclass="ttdoc">Generates the Jacobian matrix for the current state.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00284">engine_graph.cpp:284</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_aed726d36ee2b3796beff6067a1e4db38"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#aed726d36ee2b3796beff6067a1e4db38">gridfire::GraphEngine::generateStoichiometryMatrix</a></div><divclass="ttdeci">void generateStoichiometryMatrix() override</div><divclass="ttdoc">Generates the stoichiometry matrix for the network.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00209">engine_graph.cpp:209</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_aedf42d83bfcc28313b6b6454034d2efa"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#aedf42d83bfcc28313b6b6454034d2efa">gridfire::GraphEngine::collectNetworkSpecies</a></div><divclass="ttdeci">void collectNetworkSpecies()</div><divclass="ttdoc">Collects the unique species in the network.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00057">engine_graph.cpp:57</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_aeeafeab40a5f4dbfae78bdc87e25e93f"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#aeeafeab40a5f4dbfae78bdc87e25e93f">gridfire::GraphEngine::validateComposition</a></div><divclass="ttdeci">void validateComposition(const fourdst::composition::Composition &composition, double culling, double T9)</div><divclass="ttdoc">Validates the composition against the current reaction set.</div><divclass="ttdef"><b>Definition</b><ahref="engine__graph_8cpp_source.html#l00188">engine_graph.cpp:188</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1_graph_engine_html_af41df9ce979b6410e12642cb093916c9"><divclass="ttname"><ahref="classgridfire_1_1_graph_engine.html#af41df9ce979b6410e12642cb093916c9">gridfire::GraphEngine::calculateAllDerivatives</a></div><divclass="ttdeci">StepDerivatives< T > calculateAllDerivatives(const std::vector< T >&Y_in, T T9, T rho) const</div><divclass="ttdoc">Calculates all derivatives (dY/dt) and the energy generation rate.</div><divclass="ttdef"><b>Definition</b><ahref="#l00487">engine_graph.h:487</a></div></div>
<divclass="ttc"id="aclassgridfire_1_1reaction_1_1_reaction_html"><divclass="ttname"><ahref="classgridfire_1_1reaction_1_1_reaction.html">gridfire::reaction::Reaction</a></div><divclass="ttdoc">Represents a single nuclear reaction from a specific data source.</div><divclass="ttdef"><b>Definition</b><ahref="reaction_8h_source.html#l00072">reaction.h:72</a></div></div>
<divclass="ttc"id="aengine__abstract_8h_html"><divclass="ttname"><ahref="engine__abstract_8h.html">engine_abstract.h</a></div><divclass="ttdoc">Abstract interfaces for reaction network engines in GridFire.</div></div>
<divclass="ttc"id="anamespacegridfire_1_1reaction_html_aa86f08712565f278adacc7cd2361eb31"><divclass="ttname"><ahref="namespacegridfire_1_1reaction.html#aa86f08712565f278adacc7cd2361eb31">gridfire::reaction::LogicalReactionSet</a></div><divclass="ttdeci">TemplatedReactionSet< LogicalReaction > LogicalReactionSet</div><divclass="ttdoc">A set of logical reactions.</div><divclass="ttdef"><b>Definition</b><ahref="reaction_8h_source.html#l00557">reaction.h:557</a></div></div>
<divclass="ttc"id="anamespacegridfire_html_a1121d0b2d005195333412559fa29d3cc"><divclass="ttname"><ahref="namespacegridfire.html#a1121d0b2d005195333412559fa29d3cc">gridfire::ADDouble</a></div><divclass="ttdeci">CppAD::AD< double > ADDouble</div><divclass="ttdoc">Alias for CppAD AD type for double precision.</div><divclass="ttdef"><b>Definition</b><ahref="#l00034">engine_graph.h:34</a></div></div>
<divclass="ttc"id="anamespacegridfire_html_a96c062f94713921e5d7568ecedcdcb06"><divclass="ttname"><ahref="namespacegridfire.html#a96c062f94713921e5d7568ecedcdcb06">gridfire::MIN_ABUNDANCE_THRESHOLD</a></div><divclass="ttdeci">static constexpr double MIN_ABUNDANCE_THRESHOLD</div><divclass="ttdoc">Minimum abundance threshold below which species are ignored.</div><divclass="ttdef"><b>Definition</b><ahref="#l00056">engine_graph.h:56</a></div></div>
<divclass="ttc"id="anamespacegridfire_html_ada3c137c014ecd8d06200fea2d1a9f50"><divclass="ttname"><ahref="namespacegridfire.html#ada3c137c014ecd8d06200fea2d1a9f50">gridfire::MIN_DENSITY_THRESHOLD</a></div><divclass="ttdeci">static constexpr double MIN_DENSITY_THRESHOLD</div><divclass="ttdoc">Minimum density threshold below which reactions are ignored.</div><divclass="ttdef"><b>Definition</b><ahref="#l00047">engine_graph.h:47</a></div></div>
<divclass="ttc"id="anamespacegridfire_html_ae01b1738df1921db565bcbd68dd6cf64"><divclass="ttname"><ahref="namespacegridfire.html#ae01b1738df1921db565bcbd68dd6cf64">gridfire::MIN_JACOBIAN_THRESHOLD</a></div><divclass="ttdeci">static constexpr double MIN_JACOBIAN_THRESHOLD</div><divclass="ttdoc">Minimum value for Jacobian matrix entries.</div><divclass="ttdef"><b>Definition</b><ahref="#l00064">engine_graph.h:64</a></div></div>
<divclass="ttc"id="areaction_8h_html"><divclass="ttname"><ahref="reaction_8h.html">reaction.h</a></div><divclass="ttdoc">Defines classes for representing and managing nuclear reactions.</div></div>
<divclass="ttc"id="astructgridfire_1_1_step_derivatives_html"><divclass="ttname"><ahref="structgridfire_1_1_step_derivatives.html">gridfire::StepDerivatives</a></div><divclass="ttdoc">Structure holding derivatives and energy generation for a network step.</div><divclass="ttdef"><b>Definition</b><ahref="engine__abstract_8h_source.html#l00053">engine_abstract.h:53</a></div></div>
<divclass="ttc"id="astructgridfire_1_1_step_derivatives_html_ab4aeb41be952c7b5844e1ee81fef9008"><divclass="ttname"><ahref="structgridfire_1_1_step_derivatives.html#ab4aeb41be952c7b5844e1ee81fef9008">gridfire::StepDerivatives::nuclearEnergyGenerationRate</a></div><divclass="ttdeci">T nuclearEnergyGenerationRate</div><divclass="ttdoc">Specific energy generation rate (e.g., erg/g/s).</div><divclass="ttdef"><b>Definition</b><ahref="engine__abstract_8h_source.html#l00055">engine_abstract.h:55</a></div></div>
<divclass="ttc"id="astructgridfire_1_1_step_derivatives_html_ae0de268b86c2404379409c4feae0b34d"><divclass="ttname"><ahref="structgridfire_1_1_step_derivatives.html#ae0de268b86c2404379409c4feae0b34d">gridfire::StepDerivatives::dydt</a></div><divclass="ttdeci">std::vector< T > dydt</div><divclass="ttdoc">Derivatives of abundances (dY/dt for each species).</div><divclass="ttdef"><b>Definition</b><ahref="engine__abstract_8h_source.html#l00054">engine_abstract.h:54</a></div></div>
<liclass="footer">Generated by <ahref="https://www.doxygen.org/index.html"><imgclass="footer"src="doxygen.svg"width="104"height="31"alt="doxygen"/></a> 1.13.2 </li>