docs(docs): rebuilt for version v0.7.1_rc2

This commit is contained in:
2025-11-28 09:46:00 -05:00
parent 033c5a083d
commit a472dc5214
2480 changed files with 231104 additions and 76191 deletions

View File

@@ -3,18 +3,16 @@
<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="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GridFire: GridFire</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="resize.js"></script>
<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>
@@ -29,7 +27,7 @@
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">GridFire<span id="projectnumber">&#160;v0.7.0_rc2</span>
<div id="projectname">GridFire<span id="projectnumber">&#160;v0.7.1_rc2</span>
</div>
<div id="projectbrief">General Purpose Nuclear Network</div>
</td>
@@ -38,24 +36,19 @@
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.13.2 -->
<!-- Generated by Doxygen 1.9.8 -->
<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(); });
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
@@ -73,7 +66,7 @@ $(function() {
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('index.html',''); initResizable(true); });
$(document).ready(function(){initNavTree('index.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
@@ -145,16 +138,16 @@ pypi</h3>
<td class="markdownTableBodyNone">0.5.0 </td><td class="markdownTableBodyNone">Linux </td><td class="markdownTableBodyNone">x86_64 </td><td class="markdownTableBodyNone">3.8, 3.9, 3.10, 3.11, 3.12, 3.13 (std &amp; t), 3.14 (std &amp; t) </td><td class="markdownTableBodyNone">3.10, 3.11 </td></tr>
</table>
<blockquote class="doxtable">
<p><b>Note</b>: Currently macOS x86_64 does <b>not</b> have a precompiled wheel. Due to that platform being phased out it is likely that there will never be precompiled wheels or releases for it. </p>
<p>&zwj;<b>Note</b>: Currently macOS x86_64 does <b>not</b> have a precompiled wheel. Due to that platform being phased out it is likely that there will never be precompiled wheels or releases for it. </p>
</blockquote>
<blockquote class="doxtable">
<p><b>Note:</b> macOS wheels were targeted to macOS 12 Monterey and should work on any version more recent than that (at least as of August 2025). </p>
<p>&zwj;<b>Note:</b> macOS wheels were targeted to macOS 12 Monterey and should work on any version more recent than that (at least as of August 2025). </p>
</blockquote>
<blockquote class="doxtable">
<p><b>Note:</b> Linux wheels were compiled using manylinux_2_28 and are expected to work on Debian 10+, Ubuntu 18.10+, Fedora 29+, or CentOS/RHEL 8+ </p>
<p>&zwj;<b>Note:</b> Linux wheels were compiled using manylinux_2_28 and are expected to work on Debian 10+, Ubuntu 18.10+, Fedora 29+, or CentOS/RHEL 8+ </p>
</blockquote>
<blockquote class="doxtable">
<p><b>Note:</b> If your system does not have a prebuilt wheel the source distribution will download from pypi and try to build. This may simply not work if you do not have the correct system dependencies installed. If it fails the best bet is to try to build boost &gt;= 1.83.0 from source and install (<a href="https://www.boost.org/">https://www.boost.org/</a>) as that is the most common broken dependency. </p>
<p>&zwj;<b>Note:</b> If your system does not have a prebuilt wheel the source distribution will download from pypi and try to build. This may simply not work if you do not have the correct system dependencies installed. If it fails the best bet is to try to build boost &gt;= 1.83.0 from source and install (<a href="https://www.boost.org/">https://www.boost.org/</a>) as that is the most common broken dependency. </p>
</blockquote>
<h3><a class="anchor" id="autotoc_md8"></a>
source</h3>
@@ -163,10 +156,10 @@ source</h3>
<div class="line">cd GridFire</div>
<div class="line">pip install .</div>
</div><!-- fragment --><blockquote class="doxtable">
<p><b>Note:</b> that if you do not have all system dependencies installed this will fail, the steps in further sections address these in more detail. </p>
<p>&zwj;<b>Note:</b> that if you do not have all system dependencies installed this will fail, the steps in further sections address these in more detail. </p>
</blockquote>
<blockquote class="doxtable">
<p><b>Note:</b> If you are using macos you should use the included <code>pip_install_mac_patch.sh</code> script instead of <code>pip install .</code> as this will automatically patch the build shared object libraries such that they can be loaded by the macos dynamic loader. </p>
<p>&zwj;<b>Note:</b> If you are using macos you should use the included <code>pip_install_mac_patch.sh</code> script instead of <code>pip install .</code> as this will automatically patch the build shared object libraries such that they can be loaded by the macos dynamic loader. </p>
</blockquote>
<h3><a class="anchor" id="autotoc_md9"></a>
source for developers</h3>
@@ -208,7 +201,7 @@ Currently, known good platforms</h3>
<li>Ubuntu 22.04 (X86_64)</li>
</ul>
<blockquote class="doxtable">
<p><b>Note:</b> On Ubuntu 22.04 the user needs to install boost libraries manually as the versions in the Ubuntu repositories are too old. The installer automatically detects this and will instruct the user in how to do this. </p>
<p>&zwj;<b>Note:</b> On Ubuntu 22.04 the user needs to install boost libraries manually as the versions in the Ubuntu repositories are too old. The installer automatically detects this and will instruct the user in how to do this. </p>
</blockquote>
<h2><a class="anchor" id="autotoc_md14"></a>
Manual Build Instructions</h2>
@@ -233,13 +226,13 @@ Optional</h4>
<li>pip (used by the <code>install.sh</code> script or by calling pip directly, not needed if using meson directly)</li>
</ul>
<blockquote class="doxtable">
<p><b>Note:</b> Boost is the only external library dependency used by GridFire directly. </p>
<p>&zwj;<b>Note:</b> Boost is the only external library dependency used by GridFire directly. </p>
</blockquote>
<blockquote class="doxtable">
<p><b>Note:</b> Windows is not supported at this time and <em>there are no plans to support it in the future</em>. Windows users are encouraged to use WSL2 or a Linux VM. </p>
<p>&zwj;<b>Note:</b> Windows is not supported at this time and <em>there are no plans to support it in the future</em>. Windows users are encouraged to use WSL2 or a Linux VM. </p>
</blockquote>
<blockquote class="doxtable">
<p><b>Note:</b> If <code>install-tui.sh</code> is not able to find a usable version of boost it will provide directions to fetch, compile, and install a usable version. </p>
<p>&zwj;<b>Note:</b> If <code>install-tui.sh</code> is not able to find a usable version of boost it will provide directions to fetch, compile, and install a usable version. </p>
</blockquote>
<h3><a class="anchor" id="autotoc_md18"></a>
Install Scripts</h3>
@@ -252,23 +245,20 @@ Reproducibility</h4>
<p>The TUI mode provides easy modification of meson build system and compiler settings which can then be saved to a config file. This config file can then be loaded by either tui mode or cli mode (with the <code>--config</code>) flag meaning that build configurations can be made and reused. Note that this is <b>not</b> a deterministically reproducible build system as it does not interact with any system dependencies or settings, only meson and compiler settings.</p>
<h4><a class="anchor" id="autotoc_md21"></a>
Examples</h4>
<h5><a class="anchor" id="autotoc_md22"></a>
TUI config and saving</h5>
<p><a class="anchor" id="autotoc_md22"></a> </p><h5>TUI config and saving</h5>
<p><a href="https://asciinema.org/a/ahIrQPL71ErZv5EKKujfO1ZEW"><img src="https://asciinema.org/a/ahIrQPL71ErZv5EKKujfO1ZEW.svg" alt="asciicast" style="pointer-events: none;" class="inline"/></a></p>
<h5><a class="anchor" id="autotoc_md23"></a>
TUI config loading and meson setup</h5>
<p><a class="anchor" id="autotoc_md23"></a> </p><h5>TUI config loading and meson setup</h5>
<p><a href="https://asciinema.org/a/zGdzt9kYsETltG0TJKC50g3BK"><img src="https://asciinema.org/a/zGdzt9kYsETltG0TJKC50g3BK.svg" alt="asciicast" style="pointer-events: none;" class="inline"/></a></p>
<h5><a class="anchor" id="autotoc_md24"></a>
CLI config loading, setup, and build</h5>
<p><a class="anchor" id="autotoc_md24"></a> </p><h5>CLI config loading, setup, and build</h5>
<p><a href="https://asciinema.org/a/GYaWTXZbDJRD4ohde0s3DkFMC"><img src="https://asciinema.org/a/GYaWTXZbDJRD4ohde0s3DkFMC.svg" alt="asciicast" style="pointer-events: none;" class="inline"/></a></p>
<blockquote class="doxtable">
<p><b>Note:</b> <code>install-tui.sh</code> is simply a script which calls <code>install.sh</code> with the <code>--tui</code> flag. You can get the exact same results by running <code>install.sh --tui</code>. </p>
<p>&zwj;<b>Note:</b> <code>install-tui.sh</code> is simply a script which calls <code>install.sh</code> with the <code>--tui</code> flag. You can get the exact same results by running <code>install.sh --tui</code>. </p>
</blockquote>
<blockquote class="doxtable">
<p><b>Note:</b> Call <code>install.sh</code> with the <code>--help</code> or <code>--h</code> flag to see command line options </p>
<p>&zwj;<b>Note:</b> Call <code>install.sh</code> with the <code>--help</code> or <code>--h</code> flag to see command line options </p>
</blockquote>
<blockquote class="doxtable">
<p><b>Note:</b> <code>clang</code> tends to compile GridFire much faster than <code>gcc</code> thus why I select it in the above asciinema recording. </p>
<p>&zwj;<b>Note:</b> <code>clang</code> tends to compile GridFire much faster than <code>gcc</code> thus why I select it in the above asciinema recording. </p>
</blockquote>
<h3><a class="anchor" id="autotoc_md25"></a>
Dependency Installation on Common Platforms</h3>
@@ -278,10 +268,10 @@ Dependency Installation on Common Platforms</h3>
</div><!-- fragment --></li>
</ul>
<blockquote class="doxtable">
<p><b>Note:</b> Depending on the ubuntu version you have the libboost-all-dev libraries may be too old. If this is the case refer to the boost documentation for how to download and install a version <code>&gt;=1.83.0</code> </p>
<p>&zwj;<b>Note:</b> Depending on the ubuntu version you have the libboost-all-dev libraries may be too old. If this is the case refer to the boost documentation for how to download and install a version <code>&gt;=1.83.0</code> </p>
</blockquote>
<blockquote class="doxtable">
<p><b>Note:</b> On recent versions of ubuntu python has switched to being externally managed by the system. We <b>strongly</b> recommend that if you install manually all python packages are installed inside some kind of virtual environment (e.g. <code>pyenv</code>, <code>conda</code>, <code>python-venv</code>, etc...). When using the installer script this is handled automatically using <code>python-venv</code>. </p>
<p>&zwj;<b>Note:</b> On recent versions of ubuntu python has switched to being externally managed by the system. We <b>strongly</b> recommend that if you install manually all python packages are installed inside some kind of virtual environment (e.g. <code>pyenv</code>, <code>conda</code>, <code>python-venv</code>, etc...). When using the installer script this is handled automatically using <code>python-venv</code>. </p>
</blockquote>
<ul>
<li><b>Fedora/CentOS/RHEL:</b> <div class="fragment"><div class="line">sudo dnf install -y gcc-c++ meson python3 python3-pip boost-devel</div>
@@ -453,7 +443,8 @@ Usage Examples</h1>
C++</h2>
<h3><a class="anchor" id="autotoc_md48"></a>
GraphEngine Initialization</h3>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="engine__graph_8h.html">gridfire/engine/engine_graph.h</a>&quot;</span></div>
<div class="fragment"><div class="line"> ++</div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="engine__graph_8h.html">gridfire/engine/engine_graph.h</a>&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;fourdst/composition/composition.h&quot;</span></div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main(){</div>
@@ -464,7 +455,8 @@ GraphEngine Initialization</h3>
<div class="ttc" id="aengine__graph_8h_html"><div class="ttname"><a href="engine__graph_8h.html">engine_graph.h</a></div></div>
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md49"></a>
Adaptive Network View</h3>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="engine__adaptive_8h.html">gridfire/engine/views/engine_adaptive.h</a>&quot;</span></div>
<div class="fragment"><div class="line"> ++</div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="engine__adaptive_8h.html">gridfire/engine/views/engine_adaptive.h</a>&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="engine__graph_8h.html">gridfire/engine/engine_graph.h</a>&quot;</span></div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main(){</div>
@@ -476,7 +468,8 @@ Adaptive Network View</h3>
<div class="ttc" id="aengine__adaptive_8h_html"><div class="ttname"><a href="engine__adaptive_8h.html">engine_adaptive.h</a></div></div>
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md50"></a>
Composition Initialization</h3>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;fourdst/composition/composition.h&quot;</span></div>
<div class="fragment"><div class="line"> ++</div>
<div class="line"><span class="preprocessor">#include &quot;fourdst/composition/composition.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;fourdst/composition/utils.h&quot;</span> <span class="comment">// for buildCompositionFromMassFractions</span></div>
<div class="line"><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;string&gt;</span></div>
@@ -495,7 +488,8 @@ Composition Initialization</h3>
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md51"></a>
Common Workflow Example</h3>
<p>A representative workflow often composes multiple engine views to balance accuracy, stability, and performance when integrating stiff nuclear networks:</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="gridfire_8h.html">gridfire/gridfire.h</a>&quot;</span> <span class="comment">// Unified header for real usage</span></div>
<div class="fragment"><div class="line"> ++</div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="gridfire_8h.html">gridfire/gridfire.h</a>&quot;</span> <span class="comment">// Unified header for real usage</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &quot;fourdst/composition/composition.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include &quot;fourdst/composition/utils.h&quot;</span> <span class="comment">// for buildCompositionFromMassFractions</span></div>
@@ -542,7 +536,8 @@ Common Workflow Example</h3>
</div><!-- fragment --><h3><a class="anchor" id="autotoc_md52"></a>
Callback and Policy Example</h3>
<p>Custom callback functions can be registered with any solver. Because it might make sense for each solver to provide different context to the callback function, you should use the struct <code><a class="el" href="namespacegridfire_1_1solver.html">gridfire::solver</a>::&lt;SolverName&gt;::TimestepContext</code> as the argument type for the callback function. This struct contains all the information provided by that solver to the callback function.</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="gridfire_8h.html">gridfire/gridfire.h</a>&quot;</span> <span class="comment">// Unified header for real usage</span></div>
<div class="fragment"><div class="line"> ++</div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="gridfire_8h.html">gridfire/gridfire.h</a>&quot;</span> <span class="comment">// Unified header for real usage</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &quot;fourdst/composition/composition.h&quot;</span> <span class="comment">// for Composition</span></div>
<div class="line"><span class="preprocessor">#include &quot;fourdst/composition/utils.h&quot;</span> <span class="comment">// for buildCompositionFromMassFractions</span></div>
@@ -550,11 +545,11 @@ Callback and Policy Example</h3>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;iostream&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> callback(<span class="keyword">const</span> <a class="code hl_struct" href="structgridfire_1_1solver_1_1_c_v_o_d_e_solver_strategy_1_1_timestep_context.html">gridfire::solver::CVODESolverStrategy::TimestepContext</a>&amp; context) {</div>
<div class="line"> <span class="keywordtype">int</span> H1Index = context.<a class="code hl_variable" href="structgridfire_1_1solver_1_1_c_v_o_d_e_solver_strategy_1_1_timestep_context.html#a5a457651dcb9d4a66ed219ddf7095313">engine</a>.<a class="code hl_function" href="classgridfire_1_1engine_1_1_dynamic_engine.html#ac0f40017603e8e6887b75dc7360d7c5e">getSpeciesIndex</a>(fourdst::atomic::H_1);</div>
<div class="line"> <span class="keywordtype">int</span> He4Index = context.<a class="code hl_variable" href="structgridfire_1_1solver_1_1_c_v_o_d_e_solver_strategy_1_1_timestep_context.html#a5a457651dcb9d4a66ed219ddf7095313">engine</a>.<a class="code hl_function" href="classgridfire_1_1engine_1_1_dynamic_engine.html#ac0f40017603e8e6887b75dc7360d7c5e">getSpeciesIndex</a>(fourdst::atomic::He_4);</div>
<div class="line"><span class="keywordtype">void</span> callback(<span class="keyword">const</span> <a class="code hl_struct" href="structgridfire_1_1solver_1_1CVODESolverStrategy_1_1TimestepContext.html">gridfire::solver::CVODESolverStrategy::TimestepContext</a>&amp; context) {</div>
<div class="line"> <span class="keywordtype">int</span> H1Index = context.<a class="code hl_variable" href="structgridfire_1_1solver_1_1CVODESolverStrategy_1_1TimestepContext.html#a5a457651dcb9d4a66ed219ddf7095313">engine</a>.<a class="code hl_function" href="classgridfire_1_1engine_1_1DynamicEngine.html#ac0f40017603e8e6887b75dc7360d7c5e">getSpeciesIndex</a>(fourdst::atomic::H_1);</div>
<div class="line"> <span class="keywordtype">int</span> He4Index = context.<a class="code hl_variable" href="structgridfire_1_1solver_1_1CVODESolverStrategy_1_1TimestepContext.html#a5a457651dcb9d4a66ed219ddf7095313">engine</a>.<a class="code hl_function" href="classgridfire_1_1engine_1_1DynamicEngine.html#ac0f40017603e8e6887b75dc7360d7c5e">getSpeciesIndex</a>(fourdst::atomic::He_4);</div>
<div class="line"> </div>
<div class="line"> std::cout &lt;&lt; context.<a class="code hl_variable" href="structgridfire_1_1solver_1_1_c_v_o_d_e_solver_strategy_1_1_timestep_context.html#a0b39f0d207181840efacb64417b492ae">t</a> &lt;&lt; <span class="stringliteral">&quot;,&quot;</span> &lt;&lt; context.<a class="code hl_variable" href="structgridfire_1_1solver_1_1_c_v_o_d_e_solver_strategy_1_1_timestep_context.html#aaae3c42b9172be4d501f022e67f5a6f6">state</a>(H1Index) &lt;&lt; <span class="stringliteral">&quot;,&quot;</span> &lt;&lt; context.<a class="code hl_variable" href="structgridfire_1_1solver_1_1_c_v_o_d_e_solver_strategy_1_1_timestep_context.html#aaae3c42b9172be4d501f022e67f5a6f6">state</a>(He4Index) &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"> std::cout &lt;&lt; context.<a class="code hl_variable" href="structgridfire_1_1solver_1_1CVODESolverStrategy_1_1TimestepContext.html#a0b39f0d207181840efacb64417b492ae">t</a> &lt;&lt; <span class="stringliteral">&quot;,&quot;</span> &lt;&lt; context.<a class="code hl_variable" href="structgridfire_1_1solver_1_1CVODESolverStrategy_1_1TimestepContext.html#aaae3c42b9172be4d501f022e67f5a6f6">state</a>(H1Index) &lt;&lt; <span class="stringliteral">&quot;,&quot;</span> &lt;&lt; context.<a class="code hl_variable" href="structgridfire_1_1solver_1_1CVODESolverStrategy_1_1TimestepContext.html#aaae3c42b9172be4d501f022e67f5a6f6">state</a>(He4Index) &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main(){</div>
@@ -563,14 +558,14 @@ Callback and Policy Example</h3>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"> <span class="keyword">const</span> fourdst::composition::Composition composition = fourdst::composition::buildCompositionFromMassFractions(symbols, X);</div>
<div class="line"> <a class="code hl_class" href="classgridfire_1_1policy_1_1_main_sequence_policy.html">gridfire::policy::MainSequencePolicy</a> stellarPolicy(netIn.composition);</div>
<div class="line"> <a class="code hl_class" href="classgridfire_1_1engine_1_1_dynamic_engine.html">gridfire::engine::DynamicEngine</a>&amp; engine = stellarPolicy.construct();</div>
<div class="line"> <a class="code hl_class" href="classgridfire_1_1policy_1_1MainSequencePolicy.html">gridfire::policy::MainSequencePolicy</a> stellarPolicy(netIn.composition);</div>
<div class="line"> <a class="code hl_class" href="classgridfire_1_1engine_1_1DynamicEngine.html">gridfire::engine::DynamicEngine</a>&amp; engine = stellarPolicy.construct();</div>
<div class="line"> </div>
<div class="line"> <a class="code hl_class" href="classgridfire_1_1solver_1_1_c_v_o_d_e_solver_strategy.html">gridfire::solver::CVODESolverStrategy</a> solver(adaptView);</div>
<div class="line"> <a class="code hl_class" href="classgridfire_1_1solver_1_1CVODESolverStrategy.html">gridfire::solver::CVODESolverStrategy</a> solver(adaptView);</div>
<div class="line"> solver.set_callback(callback);</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// 6. Prepare input conditions</span></div>
<div class="line"> <a class="code hl_struct" href="structgridfire_1_1_net_in.html">gridfire::NetIn</a> input{</div>
<div class="line"> <a class="code hl_struct" href="structgridfire_1_1NetIn.html">gridfire::NetIn</a> input{</div>
<div class="line"> comp, <span class="comment">// composition</span></div>
<div class="line"> 1.5e7, <span class="comment">// temperature [K]</span></div>
<div class="line"> 1.5e2, <span class="comment">// density [g/cm^3]</span></div>
@@ -579,44 +574,45 @@ Callback and Policy Example</h3>
<div class="line"> };</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// 7. Execute integration</span></div>
<div class="line"> <a class="code hl_struct" href="structgridfire_1_1_net_out.html">gridfire::NetOut</a> output = solver.evaluate(input);</div>
<div class="line"> <a class="code hl_struct" href="structgridfire_1_1NetOut.html">gridfire::NetOut</a> output = solver.evaluate(input);</div>
<div class="line"> std::cout &lt;&lt; <span class="stringliteral">&quot;Final results are: &quot;</span> &lt;&lt; output &lt;&lt; std::endl;</div>
<div class="line">}</div>
<div class="ttc" id="aclassgridfire_1_1engine_1_1_dynamic_engine_html"><div class="ttname"><a href="classgridfire_1_1engine_1_1_dynamic_engine.html">gridfire::engine::DynamicEngine</a></div><div class="ttdoc">Abstract class for engines supporting Jacobian and stoichiometry operations.</div><div class="ttdef"><b>Definition</b> engine_abstract.h:175</div></div>
<div class="ttc" id="aclassgridfire_1_1engine_1_1_dynamic_engine_html_ac0f40017603e8e6887b75dc7360d7c5e"><div class="ttname"><a href="classgridfire_1_1engine_1_1_dynamic_engine.html#ac0f40017603e8e6887b75dc7360d7c5e">gridfire::engine::DynamicEngine::getSpeciesIndex</a></div><div class="ttdeci">virtual size_t getSpeciesIndex(const fourdst::atomic::Species &amp;species) const =0</div><div class="ttdoc">Get the index of a species in the network.</div></div>
<div class="ttc" id="aclassgridfire_1_1policy_1_1_main_sequence_policy_html"><div class="ttname"><a href="classgridfire_1_1policy_1_1_main_sequence_policy.html">gridfire::policy::MainSequencePolicy</a></div><div class="ttdoc">A NetworkPolicy for building reaction networks suitable for low-mass main-sequence stars.</div><div class="ttdef"><b>Definition</b> stellar_policy.h:60</div></div>
<div class="ttc" id="aclassgridfire_1_1solver_1_1_c_v_o_d_e_solver_strategy_html"><div class="ttname"><a href="classgridfire_1_1solver_1_1_c_v_o_d_e_solver_strategy.html">gridfire::solver::CVODESolverStrategy</a></div><div class="ttdoc">Stiff ODE integrator backed by SUNDIALS CVODE (BDF) for network + energy.</div><div class="ttdef"><b>Definition</b> CVODE_solver_strategy.h:81</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> types.h:27</div></div>
<div class="ttc" id="astructgridfire_1_1_net_out_html"><div class="ttname"><a href="structgridfire_1_1_net_out.html">gridfire::NetOut</a></div><div class="ttdef"><b>Definition</b> types.h:37</div></div>
<div class="ttc" id="astructgridfire_1_1solver_1_1_c_v_o_d_e_solver_strategy_1_1_timestep_context_html"><div class="ttname"><a href="structgridfire_1_1solver_1_1_c_v_o_d_e_solver_strategy_1_1_timestep_context.html">gridfire::solver::CVODESolverStrategy::TimestepContext</a></div><div class="ttdoc">Immutable view of the current integration state passed to callbacks.</div><div class="ttdef"><b>Definition</b> CVODE_solver_strategy.h:173</div></div>
<div class="ttc" id="astructgridfire_1_1solver_1_1_c_v_o_d_e_solver_strategy_1_1_timestep_context_html_a0b39f0d207181840efacb64417b492ae"><div class="ttname"><a href="structgridfire_1_1solver_1_1_c_v_o_d_e_solver_strategy_1_1_timestep_context.html#a0b39f0d207181840efacb64417b492ae">gridfire::solver::CVODESolverStrategy::TimestepContext::t</a></div><div class="ttdeci">const double t</div><div class="ttdoc">Current integration time [s].</div><div class="ttdef"><b>Definition</b> CVODE_solver_strategy.h:175</div></div>
<div class="ttc" id="astructgridfire_1_1solver_1_1_c_v_o_d_e_solver_strategy_1_1_timestep_context_html_a5a457651dcb9d4a66ed219ddf7095313"><div class="ttname"><a href="structgridfire_1_1solver_1_1_c_v_o_d_e_solver_strategy_1_1_timestep_context.html#a5a457651dcb9d4a66ed219ddf7095313">gridfire::solver::CVODESolverStrategy::TimestepContext::engine</a></div><div class="ttdeci">const engine::DynamicEngine &amp; engine</div><div class="ttdoc">Reference to the engine.</div><div class="ttdef"><b>Definition</b> CVODE_solver_strategy.h:182</div></div>
<div class="ttc" id="astructgridfire_1_1solver_1_1_c_v_o_d_e_solver_strategy_1_1_timestep_context_html_aaae3c42b9172be4d501f022e67f5a6f6"><div class="ttname"><a href="structgridfire_1_1solver_1_1_c_v_o_d_e_solver_strategy_1_1_timestep_context.html#aaae3c42b9172be4d501f022e67f5a6f6">gridfire::solver::CVODESolverStrategy::TimestepContext::state</a></div><div class="ttdeci">const N_Vector &amp; state</div><div class="ttdoc">Current CVODE state vector (N_Vector).</div><div class="ttdef"><b>Definition</b> CVODE_solver_strategy.h:176</div></div>
<div class="ttc" id="aclassgridfire_1_1engine_1_1DynamicEngine_html"><div class="ttname"><a href="classgridfire_1_1engine_1_1DynamicEngine.html">gridfire::engine::DynamicEngine</a></div><div class="ttdoc">Abstract class for engines supporting Jacobian and stoichiometry operations.</div><div class="ttdef"><b>Definition</b> engine_abstract.h:175</div></div>
<div class="ttc" id="aclassgridfire_1_1engine_1_1DynamicEngine_html_ac0f40017603e8e6887b75dc7360d7c5e"><div class="ttname"><a href="classgridfire_1_1engine_1_1DynamicEngine.html#ac0f40017603e8e6887b75dc7360d7c5e">gridfire::engine::DynamicEngine::getSpeciesIndex</a></div><div class="ttdeci">virtual size_t getSpeciesIndex(const fourdst::atomic::Species &amp;species) const =0</div><div class="ttdoc">Get the index of a species in the network.</div></div>
<div class="ttc" id="aclassgridfire_1_1policy_1_1MainSequencePolicy_html"><div class="ttname"><a href="classgridfire_1_1policy_1_1MainSequencePolicy.html">gridfire::policy::MainSequencePolicy</a></div><div class="ttdoc">A NetworkPolicy for building reaction networks suitable for low-mass main-sequence stars.</div><div class="ttdef"><b>Definition</b> stellar_policy.h:60</div></div>
<div class="ttc" id="aclassgridfire_1_1solver_1_1CVODESolverStrategy_html"><div class="ttname"><a href="classgridfire_1_1solver_1_1CVODESolverStrategy.html">gridfire::solver::CVODESolverStrategy</a></div><div class="ttdoc">Stiff ODE integrator backed by SUNDIALS CVODE (BDF) for network + energy.</div><div class="ttdef"><b>Definition</b> CVODE_solver_strategy.h:81</div></div>
<div class="ttc" id="astructgridfire_1_1NetIn_html"><div class="ttname"><a href="structgridfire_1_1NetIn.html">gridfire::NetIn</a></div><div class="ttdef"><b>Definition</b> types.h:27</div></div>
<div class="ttc" id="astructgridfire_1_1NetOut_html"><div class="ttname"><a href="structgridfire_1_1NetOut.html">gridfire::NetOut</a></div><div class="ttdef"><b>Definition</b> types.h:37</div></div>
<div class="ttc" id="astructgridfire_1_1solver_1_1CVODESolverStrategy_1_1TimestepContext_html"><div class="ttname"><a href="structgridfire_1_1solver_1_1CVODESolverStrategy_1_1TimestepContext.html">gridfire::solver::CVODESolverStrategy::TimestepContext</a></div><div class="ttdoc">Immutable view of the current integration state passed to callbacks.</div><div class="ttdef"><b>Definition</b> CVODE_solver_strategy.h:173</div></div>
<div class="ttc" id="astructgridfire_1_1solver_1_1CVODESolverStrategy_1_1TimestepContext_html_a0b39f0d207181840efacb64417b492ae"><div class="ttname"><a href="structgridfire_1_1solver_1_1CVODESolverStrategy_1_1TimestepContext.html#a0b39f0d207181840efacb64417b492ae">gridfire::solver::CVODESolverStrategy::TimestepContext::t</a></div><div class="ttdeci">const double t</div><div class="ttdoc">Current integration time [s].</div><div class="ttdef"><b>Definition</b> CVODE_solver_strategy.h:175</div></div>
<div class="ttc" id="astructgridfire_1_1solver_1_1CVODESolverStrategy_1_1TimestepContext_html_a5a457651dcb9d4a66ed219ddf7095313"><div class="ttname"><a href="structgridfire_1_1solver_1_1CVODESolverStrategy_1_1TimestepContext.html#a5a457651dcb9d4a66ed219ddf7095313">gridfire::solver::CVODESolverStrategy::TimestepContext::engine</a></div><div class="ttdeci">const engine::DynamicEngine &amp; engine</div><div class="ttdoc">Reference to the engine.</div><div class="ttdef"><b>Definition</b> CVODE_solver_strategy.h:182</div></div>
<div class="ttc" id="astructgridfire_1_1solver_1_1CVODESolverStrategy_1_1TimestepContext_html_aaae3c42b9172be4d501f022e67f5a6f6"><div class="ttname"><a href="structgridfire_1_1solver_1_1CVODESolverStrategy_1_1TimestepContext.html#aaae3c42b9172be4d501f022e67f5a6f6">gridfire::solver::CVODESolverStrategy::TimestepContext::state</a></div><div class="ttdeci">const N_Vector &amp; state</div><div class="ttdoc">Current CVODE state vector (N_Vector).</div><div class="ttdef"><b>Definition</b> CVODE_solver_strategy.h:176</div></div>
</div><!-- fragment --><p> &gt;<b>Note:</b> If you want to see exactly why each repartitioning stage was triggered in a human readable manner add the flag True to <code>solver.evaluate</code> (<code>solver.evaluate(input, true)</code>).</p>
<p>&gt;<b>Note:</b> A fully detailed list of all available information in the TimestepContext struct is available in the API documentation.</p>
<p>&gt;<b>Note:</b> The order of species in the boost state vector (<code>ctx.state</code>) is <b>not guaranteed</b> to be any particular order run over run. Therefore, in order to reliably extract </p><blockquote class="doxtable">
<p>values from it, you <b>must</b> use the <code>getSpeciesIndex</code> method of the engine to get the index of the species you are interested in (these will always be in the same order). </p>
<p>&zwj;values from it, you <b>must</b> use the <code>getSpeciesIndex</code> method of the engine to get the index of the species you are interested in (these will always be in the same order). </p>
</blockquote>
<p>If you wish to know what is provided by a solver context without investigating the code you can simply do</p>
<div class="fragment"><div class="line"><span class="keywordtype">void</span> callback(<span class="keyword">const</span> <a class="code hl_struct" href="classgridfire_1_1solver_1_1_solver_context_base.html">gridfire::solver::SolverContextBase</a>&amp; context) {</div>
<div class="line"> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; [parameterName, description] : context.<a class="code hl_function" href="classgridfire_1_1solver_1_1_solver_context_base.html#a9cbef3cabc8524e542613ee50d8860c6">describe</a>()) {</div>
<div class="fragment"><div class="line"> ++</div>
<div class="line"><span class="keywordtype">void</span> callback(<span class="keyword">const</span> <a class="code hl_struct" href="classgridfire_1_1solver_1_1SolverContextBase.html">gridfire::solver::SolverContextBase</a>&amp; context) {</div>
<div class="line"> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span>&amp; [parameterName, description] : context.describe()) {</div>
<div class="line"> std::cout &lt;&lt; parameterName &lt;&lt; <span class="stringliteral">&quot;: &quot;</span> &lt;&lt; description &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"> }</div>
<div class="line"> std::cout &lt;&lt; std::flush();</div>
<div class="line"> exit(0);</div>
<div class="line">}</div>
<div class="ttc" id="aclassgridfire_1_1solver_1_1_solver_context_base_html"><div class="ttname"><a href="classgridfire_1_1solver_1_1_solver_context_base.html">gridfire::solver::SolverContextBase</a></div><div class="ttdoc">Base class for solver callback contexts.</div><div class="ttdef"><b>Definition</b> strategy_abstract.h:21</div></div>
<div class="ttc" id="aclassgridfire_1_1solver_1_1_solver_context_base_html_a9cbef3cabc8524e542613ee50d8860c6"><div class="ttname"><a href="classgridfire_1_1solver_1_1_solver_context_base.html#a9cbef3cabc8524e542613ee50d8860c6">gridfire::solver::SolverContextBase::describe</a></div><div class="ttdeci">virtual std::vector&lt; std::tuple&lt; std::string, std::string &gt; &gt; describe() const =0</div><div class="ttdoc">Describe the context for callback functions.</div></div>
<div class="ttc" id="aclassgridfire_1_1solver_1_1SolverContextBase_html"><div class="ttname"><a href="classgridfire_1_1solver_1_1SolverContextBase.html">gridfire::solver::SolverContextBase</a></div><div class="ttdoc">Base class for solver callback contexts.</div><div class="ttdef"><b>Definition</b> strategy_abstract.h:21</div></div>
</div><!-- fragment --><p>If you set this as the callback (to any solver strategy) it will print out the available parameters and what they are and then close the code. This is useful when writing new callbacks.</p>
<h4><a class="anchor" id="autotoc_md53"></a>
Callback Context</h4>
<p>Since each solver may provide different context to the callback function, and it may be frustrating to refer to the documentation every time, we also enforce that all solvers must implement a <code>descripe_callback_context</code> method which returns a vector of tuples&lt;string, string&gt; where the first element is the name of the field and the second is its datatype. It is on the developer to ensure that this information is accurate.</p>
<div class="fragment"><div class="line">...</div>
<div class="fragment"><div class="line"> ++</div>
<div class="line">...</div>
<div class="line">std::cout &lt;&lt; solver.describe_callback_context() &lt;&lt; std::endl;</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md54"></a>
Python</h2>
<p>The python bindings intentionally look <b>very</b> similar to the C++ code. Generally all examples can be adapted to python by replacing includes of paths with imports of modules such that</p>
<p><code>#include "gridfire/engine/GraphEngine.h"</code> becomes <code>import <a class="el" href="classgridfire_1_1engine_1_1_graph_engine.html" title="A reaction network engine that uses a graph-based representation.">gridfire.engine.GraphEngine</a></code></p>
<p><code>#include "gridfire/engine/GraphEngine.h"</code> becomes <code>import <a class="el" href="classgridfire_1_1engine_1_1GraphEngine.html" title="A reaction network engine that uses a graph-based representation.">gridfire.engine.GraphEngine</a></code></p>
<p>All GridFire C++ types have been bound and can be passed around as one would expect.</p>
<h3><a class="anchor" id="autotoc_md55"></a>
Python Example for End Users</h3>
@@ -726,17 +722,15 @@ Python Example for End Users</h3>
External Usage</h1>
<p>C++ does not have a stable ABI nor does it make any strong guarantees about stl container layouts between compiler versions. Therefore, GridFire includes a set of stable C bindings which can be used to interface with a limited subset of GridFire functionality from other languages.</p>
<blockquote class="doxtable">
<p><b>Note:</b> These bindings are not intended to allow GridFire to be extended from other languages; rather, they are intended to allow GridFire to be used as a black-box library from other languages. </p>
<p>&zwj;<b>Note:</b> These bindings are not intended to allow GridFire to be extended from other languages; rather, they are intended to allow GridFire to be used as a black-box library from other languages. </p>
</blockquote>
<blockquote class="doxtable">
<p><b>Note:</b> One assumption for external usage is that the ordering of the species list will not change. That is to say that whatever order the array used to register the species is will be assumed to always be the order used when passing abundance arrays to and from GridFire. </p>
<p>&zwj;<b>Note:</b> One assumption for external usage is that the ordering of the species list will not change. That is to say that whatever order the array used to register the species is will be assumed to always be the order used when passing abundance arrays to and from GridFire. </p>
</blockquote>
<blockquote class="doxtable">
<p><b>Note:</b> Because the C API does not pass the general Composition object a <code>mass_lost</code> output parameter has been added to the evolve calls, this tracks the total mass in species which have not been registered with the C API GridFire by the caller </p>
<p>&zwj;<b>Note:</b> Because the C API does not pass the general Composition object a <code>mass_lost</code> output parameter has been added to the evolve calls, this tracks the total mass in species which have not been registered with the C API GridFire by the caller </p>
</blockquote>
<h2><a class="anchor" id="autotoc_md57"></a>
C API Overview</h2>
<p>In general when using the C API the workflow is to </p>
<p>## C API Overview In general when using the C API the workflow is to</p>
<ol type="1">
<li>create a <code>gf_context</code> pointer. This object holds the state of GridFire so that it does not need to be re-initialized for each call.</li>
<li>call initialization routines on the context to set up the engine and solver you wish to use.</li>
@@ -744,9 +738,10 @@ C API Overview</h2>
<li>At each state check the ret code of the function to ensure that no errors occurred. Valid ret-codes are 0 and 1. All other ret codes indicate an error.</li>
<li>Finally, call <code>gf_free</code> to free the context and all associated memory.</li>
</ol>
<h3><a class="anchor" id="autotoc_md58"></a>
<h3><a class="anchor" id="autotoc_md57"></a>
C Example</h3>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="gridfire__extern_8h.html">gridfire/extern/gridfire_extern.h</a>&quot;</span></div>
<div class="fragment"><div class="line"> ++</div>
<div class="line"><span class="preprocessor">#include &quot;<a class="code" href="gridfire__extern_8h.html">gridfire/extern/gridfire_extern.h</a>&quot;</span></div>
<div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#define NUM_SPECIES 8</span></div>
@@ -831,7 +826,7 @@ C Example</h3>
<div class="ttc" id="agridfire__extern_8h_html_abde0ca38a62727d2f76f0bcd920bf124"><div class="ttname"><a href="gridfire__extern_8h.html#abde0ca38a62727d2f76f0bcd920bf124">gf_evolve</a></div><div class="ttdeci">int gf_evolve(void *ptr, const double *Y_in, size_t num_species, double T, double rho, double tMax, double dt0, double *Y_out, double *energy_out, double *dEps_dT, double *dEps_dRho, double *specific_neutrino_energy_loss, double *specific_neutrino_flux, double *mass_lost)</div><div class="ttdef"><b>Definition</b> gridfire_extern.cpp:87</div></div>
<div class="ttc" id="agridfire__extern_8h_html_ae70b23310adcce0925900ca00a18a4a6"><div class="ttname"><a href="gridfire__extern_8h.html#ae70b23310adcce0925900ca00a18a4a6">gf_construct_engine_from_policy</a></div><div class="ttdeci">int gf_construct_engine_from_policy(void *ptr, const char *policy_name, const double *abundances, size_t num_species)</div><div class="ttdef"><b>Definition</b> gridfire_extern.cpp:39</div></div>
<div class="ttc" id="agridfire__extern_8h_html_af7e09bf5cf979211260e715faaa3a680"><div class="ttname"><a href="gridfire__extern_8h.html#af7e09bf5cf979211260e715faaa3a680">gf_register_species</a></div><div class="ttdeci">int gf_register_species(void *ptr, const int num_species, const char **species_names)</div><div class="ttdef"><b>Definition</b> gridfire_extern.cpp:15</div></div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md59"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md58"></a>
Fortran API Overview</h2>
<p>GridFire makes use of the stable C API and Fortran 2003's <code>iso_c_bindings</code> to provide a Fortran interface for legacy code. The fortran interface is designed to be very similar to the C API and exposes the same functionality.</p>
<ol type="1">
@@ -844,13 +839,13 @@ Fortran API Overview</h2>
<li><code>GridFiregff_free</code>: Frees the GridFire context and associated resources.</li>
</ol>
<blockquote class="doxtable">
<p><b>Note:</b> You must instantiate a <code>GridFire</code> type object to access these methods. </p>
<p>&zwj;<b>Note:</b> You must instantiate a <code>GridFire</code> type object to access these methods. </p>
</blockquote>
<blockquote class="doxtable">
<p><b>Note:</b> free and init have had the <code>gff_</code> prefix (GridFire Fortran) to avoid name clashes with common Fortran functions. </p>
<p>&zwj;<b>Note:</b> free and init have had the <code>gff_</code> prefix (GridFire Fortran) to avoid name clashes with common Fortran functions. </p>
</blockquote>
<p>When building GridFire a fortran module file <code>gridfire_mod.mod</code> is generated which contains all the necessary bindings to use GridFire from Fortran. You must also link your code against the C API library <code>libgridfire_extern</code>.</p>
<h3><a class="anchor" id="autotoc_md60"></a>
<h3><a class="anchor" id="autotoc_md59"></a>
Fortran Example</h3>
<div class="fragment"><div class="line"><span class="keyword">program</span> main</div>
<div class="line"> <span class="keywordtype">use </span>iso_c_binding</div>
@@ -942,7 +937,7 @@ Fortran Example</h3>
<div class="line"> </div>
<div class="line"><span class="keyword">end program </span>main</div>
<div class="ttc" id="anamespacegridfire__mod_html"><div class="ttname"><a href="namespacegridfire__mod.html">gridfire_mod</a></div><div class="ttdef"><b>Definition</b> gridfire_mod.f90:1</div></div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md61"></a>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md60"></a>
Related Projects</h1>
<p>GridFire integrates with and builds upon several key 4D-STAR libraries:</p>
<ul>
@@ -954,13 +949,12 @@ Related Projects</h1>
<li><a href="https://github.com/4D-STAR/libplugin">libplugin</a>: Dynamically loadable plugin framework. </li>
</ul>
</div></div><!-- PageDoc -->
<a href="doxygen_crawl.html"></a>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<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>
<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.9.8 </li>
</ul>
</div>
</body>