Files
GridFire/docs/html/namespacegridfire_1_1engine_1_1diagnostics.html
2025-11-27 15:06:27 -05:00

330 lines
20 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.13.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GridFire: gridfire::engine::diagnostics Namespace Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">GridFire<span id="projectnumber">&#160;v0.7.0_rc2</span>
</div>
<div id="projectbrief">General Purpose Nuclear Network</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.13.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('namespacegridfire_1_1engine_1_1diagnostics.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">gridfire::engine::diagnostics Namespace Reference</div></div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ad792baf3c6720fce34a5161c0ade3fc4" id="r_ad792baf3c6720fce34a5161c0ade3fc4"><td class="memItemLeft" align="right" valign="top">std::optional&lt; nlohmann::json &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad792baf3c6720fce34a5161c0ade3fc4">report_limiting_species</a> (const <a class="el" href="classgridfire_1_1engine_1_1_dynamic_engine.html">DynamicEngine</a> &amp;engine, const std::vector&lt; double &gt; &amp;Y_full, const std::vector&lt; double &gt; &amp;E_full, double relTol, double absTol, size_t top_n=10, bool json=false)</td></tr>
<tr class="memdesc:ad792baf3c6720fce34a5161c0ade3fc4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Report the species that are limiting the accuracy of the integration. This is useful for identifying species that may be limiting the timestepping due to their high relative errors compared to the specified tolerances. <br /></td></tr>
<tr class="separator:ad792baf3c6720fce34a5161c0ade3fc4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac2570f6bc58b8825674f60f1634149b" id="r_aac2570f6bc58b8825674f60f1634149b"><td class="memItemLeft" align="right" valign="top">std::optional&lt; nlohmann::json &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aac2570f6bc58b8825674f60f1634149b">inspect_species_balance</a> (const <a class="el" href="classgridfire_1_1engine_1_1_dynamic_engine.html">DynamicEngine</a> &amp;engine, const std::string &amp;species_name, const fourdst::composition::Composition &amp;comp, double T9, double rho, bool json)</td></tr>
<tr class="memdesc:aac2570f6bc58b8825674f60f1634149b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inspect the production and destruction balance of a specific species in the reaction network. This function analyzes the reactions that create and destroy the specified species, providing insights into potential imbalances that may affect the accuracy of the simulation. <br /></td></tr>
<tr class="separator:aac2570f6bc58b8825674f60f1634149b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a42702b787f12988ae8fc7e1e6d8186" id="r_a8a42702b787f12988ae8fc7e1e6d8186"><td class="memItemLeft" align="right" valign="top">std::optional&lt; nlohmann::json &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a8a42702b787f12988ae8fc7e1e6d8186">inspect_jacobian_stiffness</a> (const <a class="el" href="classgridfire_1_1engine_1_1_dynamic_engine.html">DynamicEngine</a> &amp;engine, const fourdst::composition::Composition &amp;comp, double T9, double rho, bool json)</td></tr>
<tr class="memdesc:a8a42702b787f12988ae8fc7e1e6d8186"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inspect the stiffness of the Jacobian matrix for the reaction network at the given temperature and density. This function evaluates the diagonal and off-diagonal elements of the Jacobian to identify potential numerical issues related to stiffness. <br /></td></tr>
<tr class="separator:a8a42702b787f12988ae8fc7e1e6d8186"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab247fdf00c23cf857d9131a3462d41ae" id="r_ab247fdf00c23cf857d9131a3462d41ae"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab247fdf00c23cf857d9131a3462d41ae">save_jacobian_to_file</a> (const <a class="el" href="classgridfire_1_1engine_1_1_network_jacobian.html">NetworkJacobian</a> &amp;jacobian, const std::string &amp;filename)</td></tr>
<tr class="memdesc:ab247fdf00c23cf857d9131a3462d41ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Save the Jacobian matrix to a file for external analysis. <br /></td></tr>
<tr class="separator:ab247fdf00c23cf857d9131a3462d41ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="a8a42702b787f12988ae8fc7e1e6d8186" name="a8a42702b787f12988ae8fc7e1e6d8186"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8a42702b787f12988ae8fc7e1e6d8186">&#9670;&#160;</a></span>inspect_jacobian_stiffness()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::optional&lt; nlohmann::json &gt; gridfire::engine::diagnostics::inspect_jacobian_stiffness </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgridfire_1_1engine_1_1_dynamic_engine.html">DynamicEngine</a> &amp;</td> <td class="paramname"><span class="paramname"><em>engine</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const fourdst::composition::Composition &amp;</td> <td class="paramname"><span class="paramname"><em>comp</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>T9</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>rho</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>json</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Inspect the stiffness of the Jacobian matrix for the reaction network at the given temperature and density. This function evaluates the diagonal and off-diagonal elements of the Jacobian to identify potential numerical issues related to stiffness. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">engine</td><td>Constant reference to the <a class="el" href="classgridfire_1_1engine_1_1_dynamic_engine.html" title="Abstract class for engines supporting Jacobian and stoichiometry operations.">DynamicEngine</a> instance. </td></tr>
<tr><td class="paramname">comp</td><td>The current composition of the system as a fourdst::composition::Composition object. </td></tr>
<tr><td class="paramname">T9</td><td>The temperature in GK (10^9 K). </td></tr>
<tr><td class="paramname">rho</td><td>The density in g/cm^3. </td></tr>
<tr><td class="paramname">json</td><td>Flag indicating whether to return the results in JSON format. If false, results are printed to standard output. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>std::optional&lt;nlohmann::json&gt; JSON object containing the Jacobian stiffness report if <code>json</code> is true; otherwise, std::nullopt. </dd></dl>
</div>
</div>
<a id="aac2570f6bc58b8825674f60f1634149b" name="aac2570f6bc58b8825674f60f1634149b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aac2570f6bc58b8825674f60f1634149b">&#9670;&#160;</a></span>inspect_species_balance()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::optional&lt; nlohmann::json &gt; gridfire::engine::diagnostics::inspect_species_balance </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgridfire_1_1engine_1_1_dynamic_engine.html">DynamicEngine</a> &amp;</td> <td class="paramname"><span class="paramname"><em>engine</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;</td> <td class="paramname"><span class="paramname"><em>species_name</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const fourdst::composition::Composition &amp;</td> <td class="paramname"><span class="paramname"><em>comp</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>T9</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>rho</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>json</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Inspect the production and destruction balance of a specific species in the reaction network. This function analyzes the reactions that create and destroy the specified species, providing insights into potential imbalances that may affect the accuracy of the simulation. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">engine</td><td>Constant reference to the <a class="el" href="classgridfire_1_1engine_1_1_dynamic_engine.html" title="Abstract class for engines supporting Jacobian and stoichiometry operations.">DynamicEngine</a> instance. </td></tr>
<tr><td class="paramname">species_name</td><td>The name of the species to inspect. </td></tr>
<tr><td class="paramname">comp</td><td>The current composition of the system as a fourdst::composition::Composition object. </td></tr>
<tr><td class="paramname">T9</td><td>The temperature in GK (10^9 K). </td></tr>
<tr><td class="paramname">rho</td><td>The density in g/cm^3. </td></tr>
<tr><td class="paramname">json</td><td>Flag indicating whether to return the results in JSON format. If false, results are printed to standard output. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>std::optional&lt;nlohmann::json&gt; JSON object containing the species balance report if <code>json</code> is true; otherwise, std::nullopt. </dd></dl>
</div>
</div>
<a id="ad792baf3c6720fce34a5161c0ade3fc4" name="ad792baf3c6720fce34a5161c0ade3fc4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad792baf3c6720fce34a5161c0ade3fc4">&#9670;&#160;</a></span>report_limiting_species()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::optional&lt; nlohmann::json &gt; gridfire::engine::diagnostics::report_limiting_species </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgridfire_1_1engine_1_1_dynamic_engine.html">DynamicEngine</a> &amp;</td> <td class="paramname"><span class="paramname"><em>engine</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; double &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>Y_full</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::vector&lt; double &gt; &amp;</td> <td class="paramname"><span class="paramname"><em>E_full</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>relTol</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>absTol</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t</td> <td class="paramname"><span class="paramname"><em>top_n</em></span><span class="paramdefsep"> = </span><span class="paramdefval">10</span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>json</em></span><span class="paramdefsep"> = </span><span class="paramdefval">false</span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Report the species that are limiting the accuracy of the integration. This is useful for identifying species that may be limiting the timestepping due to their high relative errors compared to the specified tolerances. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">engine</td><td>Constant reference to the <a class="el" href="classgridfire_1_1engine_1_1_dynamic_engine.html" title="Abstract class for engines supporting Jacobian and stoichiometry operations.">DynamicEngine</a> instance. </td></tr>
<tr><td class="paramname">Y_full</td><td>Vector of the current species molar abundances sorted in the same order as the dynamic engine species list. </td></tr>
<tr><td class="paramname">E_full</td><td>Vector of the current species molar abundance errors sorted in the same order as the dynamic engine species list. </td></tr>
<tr><td class="paramname">relTol</td><td>Relative tolerance for the integration. </td></tr>
<tr><td class="paramname">absTol</td><td>Absolute tolerance for the integration. </td></tr>
<tr><td class="paramname">top_n</td><td>The number of top limiting species to report. Default is 10. </td></tr>
<tr><td class="paramname">json</td><td>Flag indicating whether to return the results in JSON format. If false, results are printed to standard output. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>std::optional&lt;nlohmann::json&gt; JSON object containing the limiting species report if <code>json</code> is true; otherwise, std::nullopt. </dd></dl>
</div>
</div>
<a id="ab247fdf00c23cf857d9131a3462d41ae" name="ab247fdf00c23cf857d9131a3462d41ae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab247fdf00c23cf857d9131a3462d41ae">&#9670;&#160;</a></span>save_jacobian_to_file()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void gridfire::engine::diagnostics::save_jacobian_to_file </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgridfire_1_1engine_1_1_network_jacobian.html">NetworkJacobian</a> &amp;</td> <td class="paramname"><span class="paramname"><em>jacobian</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::string &amp;</td> <td class="paramname"><span class="paramname"><em>filename</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Save the Jacobian matrix to a file for external analysis. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">jacobian</td><td>Constant reference to the <a class="el" href="classgridfire_1_1engine_1_1_network_jacobian.html" title="A wrapper class for handling the network Jacobian matrix.">NetworkJacobian</a> instance to be saved. </td></tr>
<tr><td class="paramname">filename</td><td>The name of the file where the Jacobian will be saved. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="namespacegridfire.html">gridfire</a></li><li class="navelem"><a class="el" href="namespacegridfire_1_1engine.html">engine</a></li><li class="navelem"><a class="el" href="namespacegridfire_1_1engine_1_1diagnostics.html">diagnostics</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
</ul>
</div>
</body>
</html>