244 lines
18 KiB
HTML
244 lines
18 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: src/include/gridfire/engine/engine.h File 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"> 0.0.1a</span>
|
||
|
|
</div>
|
||
|
|
<div id="projectbrief">General Purpose Nuclear Network</div>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</tbody>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
<!-- end header part -->
|
||
|
|
<!-- Generated by Doxygen 1.13.2 -->
|
||
|
|
<script type="text/javascript">
|
||
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||
|
|
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||
|
|
/* @license-end */
|
||
|
|
</script>
|
||
|
|
<script type="text/javascript">
|
||
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&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&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&dn=expat.txt MIT */
|
||
|
|
$(function(){initNavTree('engine_8h.html',''); initResizable(true); });
|
||
|
|
/* @license-end */
|
||
|
|
</script>
|
||
|
|
<div id="doc-content">
|
||
|
|
<!-- window showing the filter options -->
|
||
|
|
<div id="MSearchSelectWindow"
|
||
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<!-- iframe showing the search results (closed by default) -->
|
||
|
|
<div id="MSearchResultsWindow">
|
||
|
|
<div id="MSearchResults">
|
||
|
|
<div class="SRPage">
|
||
|
|
<div id="SRIndex">
|
||
|
|
<div id="SRResults"></div>
|
||
|
|
<div class="SRStatus" id="Loading">Loading...</div>
|
||
|
|
<div class="SRStatus" id="Searching">Searching...</div>
|
||
|
|
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="header">
|
||
|
|
<div class="headertitle"><div class="title">engine.h File Reference</div></div>
|
||
|
|
</div><!--header-->
|
||
|
|
<div class="contents">
|
||
|
|
|
||
|
|
<p>Core header for the GridFire reaction network engine module.
|
||
|
|
<a href="#details">More...</a></p>
|
||
|
|
<div class="textblock"><code>#include "<a class="el" href="engine__abstract_8h_source.html">gridfire/engine/engine_abstract.h</a>"</code><br />
|
||
|
|
<code>#include "<a class="el" href="engine__graph_8h_source.html">gridfire/engine/engine_graph.h</a>"</code><br />
|
||
|
|
<code>#include "<a class="el" href="engine__views_8h_source.html">gridfire/engine/views/engine_views.h</a>"</code><br />
|
||
|
|
<code>#include "<a class="el" href="engine__procedures_8h_source.html">gridfire/engine/procedures/engine_procedures.h</a>"</code><br />
|
||
|
|
<code>#include "<a class="el" href="engine__types_8h_source.html">gridfire/engine/types/engine_types.h</a>"</code><br />
|
||
|
|
</div>
|
||
|
|
<p><a href="engine_8h_source.html">Go to the source code of this file.</a></p>
|
||
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||
|
|
<div class="textblock"><p>Core header for the GridFire reaction network engine module. </p>
|
||
|
|
<p>This module defines the core interfaces and classes for reaction network engines in GridFire. It provides abstract base classes for engines, dynamic engines, and engine views, as well as concrete engine implementations and view implementations.</p>
|
||
|
|
<p>The engine module is designed to support a wide range of reaction network simulations, from simple single-zone calculations to complex multi-zone simulations with adaptive network topologies.</p>
|
||
|
|
<h1><a class="anchor" id="EngineDesign"></a>
|
||
|
|
Engine Design</h1>
|
||
|
|
<p>The engine module is built around the following key concepts:</p>
|
||
|
|
<ul>
|
||
|
|
<li><b>Engine:</b> The base class for all reaction network engines. It defines the minimal interface for evaluating the right-hand side (dY/dt) and energy generation rate for a given set of abundances, temperature, and density.</li>
|
||
|
|
<li><b>DynamicEngine:</b> An extension of the Engine class that supports Jacobian and stoichiometry operations, as well as the ability to dynamically modify the reaction network.</li>
|
||
|
|
<li><b>EngineView:</b> An abstract base class for "views" of reaction network engines. Engine views provide a way to dynamically or adaptively modify the network topology without modifying the underlying physics engine.</li>
|
||
|
|
</ul>
|
||
|
|
<h1><a class="anchor" id="EngineComposition"></a>
|
||
|
|
Engine Composition</h1>
|
||
|
|
<p>Engines and engine views can be composed to create complex reaction network simulations. For example, an AdaptiveEngineView can be used to dynamically cull species and reactions from a GraphEngine, reducing the computational cost of the simulation.</p>
|
||
|
|
<p>The order in which engines and engine views are composed is important. The base engine should always be the innermost engine, and the engine views should be layered on top of the base engine.</p>
|
||
|
|
<h1><a class="anchor" id="AvailableEngines"></a>
|
||
|
|
Available Engines</h1>
|
||
|
|
<p>The engine module provides the following concrete engine implementations:</p>
|
||
|
|
<ul>
|
||
|
|
<li><b>GraphEngine:</b> A reaction network engine that uses a graph-based representation of the reaction network. It uses sparse matrices for efficient storage and computation of the stoichiometry and Jacobian matrices.</li>
|
||
|
|
</ul>
|
||
|
|
<h1><a class="anchor" id="AvailableViews"></a>
|
||
|
|
Available Views</h1>
|
||
|
|
<p>The engine module provides the following engine view implementations:</p>
|
||
|
|
<ul>
|
||
|
|
<li><b>AdaptiveEngineView:</b> An engine view that dynamically adapts the reaction network based on runtime conditions. It culls species and reactions with low reaction flow rates, reducing the computational cost of the simulation.</li>
|
||
|
|
<li><b>DefinedEngineView:</b> An engine view that restricts the reaction network to a predefined set of species and reactions. This can be useful for simulating specific reaction pathways or for comparing results with other codes.</li>
|
||
|
|
<li><b>MultiscalePartitioningEngineView:</b> An engine view that partitions the reaction network into multiple groups based on timescales. This can be useful for simulating stiff reaction networks, where some reactions occur much faster than others.</li>
|
||
|
|
<li><b>NetworkPrimingEngineView:</b> An engine view that primes the reaction network with a specific species or set of species. This can be useful for igniting a reaction network or for studying the effects of specific species on the network.</li>
|
||
|
|
</ul>
|
||
|
|
<h1><a class="anchor" id="UsageExamples"></a>
|
||
|
|
Usage Examples</h1>
|
||
|
|
<h2><a class="anchor" id="GraphEngineExample"></a>
|
||
|
|
GraphEngine Example</h2>
|
||
|
|
<p>The following code shows how to create a GraphEngine from a composition:</p>
|
||
|
|
<div class="fragment"><div class="line"><span class="preprocessor">#include "<a class="code" href="engine__graph_8h.html">gridfire/engine/engine_graph.h</a>"</span></div>
|
||
|
|
<div class="line"><span class="preprocessor">#include "fourdst/composition/composition.h"</span></div>
|
||
|
|
<div class="line"> </div>
|
||
|
|
<div class="line"><span class="comment">// Create a composition</span></div>
|
||
|
|
<div class="line">fourdst::composition::Composition composition;</div>
|
||
|
|
<div class="line"> </div>
|
||
|
|
<div class="line"><span class="comment">// Create a GraphEngine</span></div>
|
||
|
|
<div class="line"><a class="code hl_class" href="classgridfire_1_1_graph_engine.html">gridfire::GraphEngine</a> engine(composition);</div>
|
||
|
|
<div class="ttc" id="aclassgridfire_1_1_graph_engine_html"><div class="ttname"><a href="classgridfire_1_1_graph_engine.html">gridfire::GraphEngine</a></div><div class="ttdoc">A reaction network engine that uses a graph-based representation.</div><div class="ttdef"><b>Definition</b> <a href="engine__graph_8h_source.html#l00101">engine_graph.h:101</a></div></div>
|
||
|
|
<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 --><h2><a class="anchor" id="AdaptiveEngineViewExample"></a>
|
||
|
|
AdaptiveEngineView Example</h2>
|
||
|
|
<p>The following code shows how to create an AdaptiveEngineView from a GraphEngine:</p>
|
||
|
|
<div class="fragment"><div class="line"><span class="preprocessor">#include "<a class="code" href="engine__adaptive_8h.html">gridfire/engine/views/engine_adaptive.h</a>"</span></div>
|
||
|
|
<div class="line"><span class="preprocessor">#include "<a class="code" href="engine__graph_8h.html">gridfire/engine/engine_graph.h</a>"</span></div>
|
||
|
|
<div class="line"><span class="preprocessor">#include "fourdst/composition/composition.h"</span></div>
|
||
|
|
<div class="line"> </div>
|
||
|
|
<div class="line"><span class="comment">// Create a composition</span></div>
|
||
|
|
<div class="line">fourdst::composition::Composition composition;</div>
|
||
|
|
<div class="line"> </div>
|
||
|
|
<div class="line"><span class="comment">// Create a GraphEngine</span></div>
|
||
|
|
<div class="line"><a class="code hl_class" href="classgridfire_1_1_graph_engine.html">gridfire::GraphEngine</a> baseEngine(composition);</div>
|
||
|
|
<div class="line"> </div>
|
||
|
|
<div class="line"><span class="comment">// Create an AdaptiveEngineView</span></div>
|
||
|
|
<div class="line"><a class="code hl_class" href="classgridfire_1_1_adaptive_engine_view.html">gridfire::AdaptiveEngineView</a> engine(baseEngine);</div>
|
||
|
|
<div class="ttc" id="aclassgridfire_1_1_adaptive_engine_view_html"><div class="ttname"><a href="classgridfire_1_1_adaptive_engine_view.html">gridfire::AdaptiveEngineView</a></div><div class="ttdoc">An engine view that dynamically adapts the reaction network based on runtime conditions.</div><div class="ttdef"><b>Definition</b> <a href="engine__adaptive_8h_source.html#l00050">engine_adaptive.h:50</a></div></div>
|
||
|
|
<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 --><h2><a class="anchor" id="DefinedEngineViewExample"></a>
|
||
|
|
DefinedEngineView Example</h2>
|
||
|
|
<p>The following code shows how to create a DefinedEngineView from a GraphEngine:</p>
|
||
|
|
<div class="fragment"><div class="line"><span class="preprocessor">#include "<a class="code" href="engine__defined_8h.html">gridfire/engine/views/engine_defined.h</a>"</span></div>
|
||
|
|
<div class="line"><span class="preprocessor">#include "<a class="code" href="engine__graph_8h.html">gridfire/engine/engine_graph.h</a>"</span></div>
|
||
|
|
<div class="line"><span class="preprocessor">#include "fourdst/composition/composition.h"</span></div>
|
||
|
|
<div class="line"> </div>
|
||
|
|
<div class="line"><span class="comment">// Create a composition</span></div>
|
||
|
|
<div class="line">fourdst::composition::Composition composition;</div>
|
||
|
|
<div class="line"> </div>
|
||
|
|
<div class="line"><span class="comment">// Create a GraphEngine</span></div>
|
||
|
|
<div class="line"><a class="code hl_class" href="classgridfire_1_1_graph_engine.html">gridfire::GraphEngine</a> baseEngine(composition);</div>
|
||
|
|
<div class="line"> </div>
|
||
|
|
<div class="line"><span class="comment">// Create a DefinedEngineView</span></div>
|
||
|
|
<div class="line">std::vector<std::string> peNames = {<span class="stringliteral">"p(p,e+)d"</span>, <span class="stringliteral">"he4(a,g)be8"</span>};</div>
|
||
|
|
<div class="line"><a class="code hl_class" href="classgridfire_1_1_defined_engine_view.html">gridfire::DefinedEngineView</a> engine(peNames, baseEngine);</div>
|
||
|
|
<div class="ttc" id="aclassgridfire_1_1_defined_engine_view_html"><div class="ttname"><a href="classgridfire_1_1_defined_engine_view.html">gridfire::DefinedEngineView</a></div><div class="ttdef"><b>Definition</b> <a href="engine__defined_8h_source.html#l00016">engine_defined.h:16</a></div></div>
|
||
|
|
<div class="ttc" id="aengine__defined_8h_html"><div class="ttname"><a href="engine__defined_8h.html">engine_defined.h</a></div></div>
|
||
|
|
</div><!-- fragment --><h2><a class="anchor" id="MultiscalePartitioningEngineViewExample"></a>
|
||
|
|
MultiscalePartitioningEngineView Example</h2>
|
||
|
|
<p>The following code shows how to create a MultiscalePartitioningEngineView from a GraphEngine:</p>
|
||
|
|
<div class="fragment"><div class="line"><span class="preprocessor">#include "<a class="code" href="engine__multiscale_8h.html">gridfire/engine/views/engine_multiscale.h</a>"</span></div>
|
||
|
|
<div class="line"><span class="preprocessor">#include "<a class="code" href="engine__graph_8h.html">gridfire/engine/engine_graph.h</a>"</span></div>
|
||
|
|
<div class="line"><span class="preprocessor">#include "fourdst/composition/composition.h"</span></div>
|
||
|
|
<div class="line"> </div>
|
||
|
|
<div class="line"><span class="comment">// Create a composition</span></div>
|
||
|
|
<div class="line">fourdst::composition::Composition composition;</div>
|
||
|
|
<div class="line"> </div>
|
||
|
|
<div class="line"><span class="comment">// Create a GraphEngine</span></div>
|
||
|
|
<div class="line"><a class="code hl_class" href="classgridfire_1_1_graph_engine.html">gridfire::GraphEngine</a> baseEngine(composition);</div>
|
||
|
|
<div class="line"> </div>
|
||
|
|
<div class="line"><span class="comment">// Create a MultiscalePartitioningEngineView</span></div>
|
||
|
|
<div class="line"><a class="code hl_class" href="classgridfire_1_1_multiscale_partitioning_engine_view.html">gridfire::MultiscalePartitioningEngineView</a> engine(baseEngine);</div>
|
||
|
|
<div class="ttc" id="aclassgridfire_1_1_multiscale_partitioning_engine_view_html"><div class="ttname"><a href="classgridfire_1_1_multiscale_partitioning_engine_view.html">gridfire::MultiscalePartitioningEngineView</a></div><div class="ttdoc">An engine view that partitions the reaction network into multiple groups based on timescales.</div><div class="ttdef"><b>Definition</b> <a href="engine__multiscale_8h_source.html#l00174">engine_multiscale.h:174</a></div></div>
|
||
|
|
<div class="ttc" id="aengine__multiscale_8h_html"><div class="ttname"><a href="engine__multiscale_8h.html">engine_multiscale.h</a></div></div>
|
||
|
|
</div><!-- fragment --><h2><a class="anchor" id="NetworkPrimingEngineViewExample"></a>
|
||
|
|
NetworkPrimingEngineView Example</h2>
|
||
|
|
<p>The following code shows how to create a NetworkPrimingEngineView from a GraphEngine:</p>
|
||
|
|
<div class="fragment"><div class="line"><span class="preprocessor">#include "<a class="code" href="engine__priming_8h.html">gridfire/engine/views/engine_priming.h</a>"</span></div>
|
||
|
|
<div class="line"><span class="preprocessor">#include "<a class="code" href="engine__graph_8h.html">gridfire/engine/engine_graph.h</a>"</span></div>
|
||
|
|
<div class="line"><span class="preprocessor">#include "fourdst/composition/composition.h"</span></div>
|
||
|
|
<div class="line"> </div>
|
||
|
|
<div class="line"><span class="comment">// Create a composition</span></div>
|
||
|
|
<div class="line">fourdst::composition::Composition composition;</div>
|
||
|
|
<div class="line"> </div>
|
||
|
|
<div class="line"><span class="comment">// Create a GraphEngine</span></div>
|
||
|
|
<div class="line"><a class="code hl_class" href="classgridfire_1_1_graph_engine.html">gridfire::GraphEngine</a> baseEngine(composition);</div>
|
||
|
|
<div class="line"> </div>
|
||
|
|
<div class="line"><span class="comment">// Create a NetworkPrimingEngineView</span></div>
|
||
|
|
<div class="line">std::string primingSymbol = <span class="stringliteral">"p"</span>;</div>
|
||
|
|
<div class="line"><a class="code hl_class" href="classgridfire_1_1_network_priming_engine_view.html">gridfire::NetworkPrimingEngineView</a> engine(primingSymbol, baseEngine);</div>
|
||
|
|
<div class="ttc" id="aclassgridfire_1_1_network_priming_engine_view_html"><div class="ttname"><a href="classgridfire_1_1_network_priming_engine_view.html">gridfire::NetworkPrimingEngineView</a></div><div class="ttdoc">Provides a view of a DynamicEngine filtered to reactions involving a specified priming species.</div><div class="ttdef"><b>Definition</b> <a href="engine__priming_8h_source.html#l00030">engine_priming.h:30</a></div></div>
|
||
|
|
<div class="ttc" id="aengine__priming_8h_html"><div class="ttname"><a href="engine__priming_8h.html">engine_priming.h</a></div></div>
|
||
|
|
</div><!-- fragment -->
|
||
|
|
<p class="definition">Definition in file <a class="el" href="engine_8h_source.html">engine.h</a>.</p>
|
||
|
|
</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="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_b0856f6b0d80ccb263b2f415c91f9e17.html">include</a></li><li class="navelem"><a class="el" href="dir_3626e0c0e3c5d7812d6b277dfa4ec364.html">gridfire</a></li><li class="navelem"><a class="el" href="dir_aff155d61c3b73b9ab7dcdc908c4d49e.html">engine</a></li><li class="navelem"><a class="el" href="engine_8h.html">engine.h</a></li>
|
||
|
|
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2 </li>
|
||
|
|
</ul>
|
||
|
|
</div>
|
||
|
|
</body>
|
||
|
|
</html>
|