2025-07-01 11:40:58 -04:00
<!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::utils 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" >
2025-07-31 15:04:57 -04:00
< div id = "projectname" > GridFire< span id = "projectnumber" >   0.6.0< / span >
2025-07-01 11:40:58 -04:00
< / 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('namespacegridfire_1_1utils.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" >
2025-10-08 11:17:09 -04:00
< a href = "#nested-classes" > Classes< / a > |
2025-07-01 11:40:58 -04:00
< a href = "#func-members" > Functions< / a > < / div >
< div class = "headertitle" > < div class = "title" > gridfire::utils Namespace Reference< / div > < / div >
< / div > <!-- header -->
< div class = "contents" >
< table class = "memberdecls" >
2025-10-08 11:17:09 -04:00
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a id = "nested-classes" name = "nested-classes" > < / a >
Classes< / h2 > < / td > < / tr >
< tr class = "memitem:" > < td class = "memItemLeft" align = "right" valign = "top" > class   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "classgridfire_1_1utils_1_1_column.html" > Column< / a > < / td > < / tr >
< tr class = "separator:" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:" > < td class = "memItemLeft" align = "right" valign = "top" > class   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "classgridfire_1_1utils_1_1_column_base.html" > ColumnBase< / a > < / td > < / tr >
< tr class = "separator:" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table > < table class = "memberdecls" >
2025-07-01 11:40:58 -04:00
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a id = "func-members" name = "func-members" > < / a >
Functions< / h2 > < / td > < / tr >
2025-10-08 11:17:09 -04:00
< tr class = "memitem:a05fda32d3fc4ab10060b8c4c251c2f3d" id = "r_a05fda32d3fc4ab10060b8c4c251c2f3d" > < td class = "memItemLeft" align = "right" valign = "top" > std::string  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "#a05fda32d3fc4ab10060b8c4c251c2f3d" > formatNuclearTimescaleLogString< / a > (const < a class = "el" href = "classgridfire_1_1_dynamic_engine.html" > DynamicEngine< / a > & engine, const fourdst::composition::Composition & composition, double T9, double rho)< / td > < / tr >
< tr class = "memdesc:a05fda32d3fc4ab10060b8c4c251c2f3d" > < td class = "mdescLeft" >   < / td > < td class = "mdescRight" > Formats a map of nuclear species timescales into a human-readable string. < br / > < / td > < / tr >
< tr class = "separator:a05fda32d3fc4ab10060b8c4c251c2f3d" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:a6451ba6762273b91a8281043cfaa5d2a" id = "r_a6451ba6762273b91a8281043cfaa5d2a" > < td class = "memItemLeft" align = "right" valign = "top" > std::string  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "#a6451ba6762273b91a8281043cfaa5d2a" > format_table< / a > (const std::string & tableName, const std::vector< std::unique_ptr< < a class = "el" href = "classgridfire_1_1utils_1_1_column_base.html" > ColumnBase< / a > > > & columns)< / td > < / tr >
< tr class = "separator:a6451ba6762273b91a8281043cfaa5d2a" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2025-07-01 11:40:58 -04:00
< / table >
< h2 class = "groupheader" > Function Documentation< / h2 >
2025-10-08 11:17:09 -04:00
< a id = "a6451ba6762273b91a8281043cfaa5d2a" name = "a6451ba6762273b91a8281043cfaa5d2a" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a6451ba6762273b91a8281043cfaa5d2a" > ◆   < / a > < / span > format_table()< / h2 >
< div class = "memitem" >
< div class = "memproto" >
< table class = "mlabels" >
< tr >
< td class = "mlabels-left" >
< table class = "memname" >
< tr >
< td class = "memname" > std::string gridfire::utils::format_table < / td >
< td > (< / td >
< td class = "paramtype" > const std::string & < / td > < td class = "paramname" > < span class = "paramname" > < em > tableName< / em > < / span > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const std::vector< std::unique_ptr< < a class = "el" href = "classgridfire_1_1utils_1_1_column_base.html" > ColumnBase< / a > > > & < / td > < td class = "paramname" > < span class = "paramname" > < em > columns< / em > < / span >   )< / td >
< / tr >
< / table >
< / td >
< td class = "mlabels-right" >
< span class = "mlabels" > < span class = "mlabel inline" > inline< / span > < / span > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< / div >
< / div >
< a id = "a05fda32d3fc4ab10060b8c4c251c2f3d" name = "a05fda32d3fc4ab10060b8c4c251c2f3d" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a05fda32d3fc4ab10060b8c4c251c2f3d" > ◆   < / a > < / span > formatNuclearTimescaleLogString()< / h2 >
2025-07-01 11:40:58 -04:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > std::string gridfire::utils::formatNuclearTimescaleLogString < / td >
< td > (< / td >
< td class = "paramtype" > const < a class = "el" href = "classgridfire_1_1_dynamic_engine.html" > DynamicEngine< / a > & < / td > < td class = "paramname" > < span class = "paramname" > < em > engine< / em > < / span > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
2025-10-08 11:17:09 -04:00
< td class = "paramtype" > const fourdst::composition::Composition & < / td > < td class = "paramname" > < span class = "paramname" > < em > composition< / em > < / span > , < / td >
2025-07-01 11:40:58 -04:00
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
2025-10-08 11:17:09 -04:00
< td class = "paramtype" > double< / td > < td class = "paramname" > < span class = "paramname" > < em > T9< / em > < / span > , < / td >
2025-07-01 11:40:58 -04:00
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
2025-10-08 11:17:09 -04:00
< td class = "paramtype" > double< / td > < td class = "paramname" > < span class = "paramname" > < em > rho< / em > < / span >   )< / td >
2025-07-01 11:40:58 -04:00
< / tr >
< / table >
< / div > < div class = "memdoc" >
2025-07-01 15:06:22 -04:00
< p > Formats a map of nuclear species timescales into a human-readable string. < / p >
< p > This function takes a reaction network engine and the current plasma conditions to calculate the characteristic timescales for each species. It then formats this information into a neatly aligned ASCII table, which is suitable for logging or printing to the console.< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramname" > engine< / td > < td > A constant reference to a < code > < a class = "el" href = "classgridfire_1_1_dynamic_engine.html" title = "Abstract class for engines supporting Jacobian and stoichiometry operations." > DynamicEngine< / a > < / code > object, used to calculate the species timescales. < / td > < / tr >
< tr > < td class = "paramname" > Y< / td > < td > A vector of the molar abundances (mol/g) for each species. < / td > < / tr >
< tr > < td class = "paramname" > T9< / td > < td > The temperature in units of 10^9 K. < / td > < / tr >
< tr > < td class = "paramname" > rho< / td > < td > The plasma density in g/cm^3. < / td > < / tr >
< / table >
< / dd >
< / dl >
< dl class = "section return" > < dt > Returns< / dt > < dd > A std::string containing the formatted table of species and their timescales.< / dd > < / dl >
< p > < b > Pre-conditions< / b > < / p > < ul >
< li > The < code > engine< / code > must be in a valid state.< / li >
< li > The size of the < code > Y< / code > vector must be consistent with the number of species expected by the < code > engine< / code > .< / li >
< / ul >
< p > < b > Algorithm< / b > < / p > < ol type = "1" >
< li > Calls the < code > getSpeciesTimescales< / code > method on the provided < code > engine< / code > to get the timescale for each species under the given conditions.< / li >
< li > Determines the maximum length of the species names to dynamically set the width of the "Species" column for proper alignment.< / li >
< li > Uses a < code > std::ostringstream< / code > to build the output string.< / li >
< li > Constructs a header for the table with titles "Species" and "Timescale (s)".< / li >
< li > Iterates through the map of timescales, adding a row to the table for each species.< / li >
< li > Timescales are formatted in scientific notation with 3 digits of precision.< / li >
< li > Special handling is included to print "inf" for infinite timescales.< / li >
< li > The final string, including header and footer lines, is returned.< / li >
< / ol >
< p > < b > Usage< / b > < / p > < div class = "fragment" > < div class = "line" > < span class = "comment" > // Assume ' my_engine' is a valid DynamicEngine object and Y, T9, rho are initialized.< / span > < / div >
2025-10-08 11:17:09 -04:00
< div class = "line" > std::string log_output = < a class = "code hl_function" href = "#a05fda32d3fc4ab10060b8c4c251c2f3d" > gridfire::utils::formatNuclearTimescaleLogString< / a > (my_engine, Y, T9, rho);< / div >
2025-07-01 15:06:22 -04:00
< div class = "line" > std::cout < < log_output;< / div >
< div class = "line" > < / div >
< div class = "line" > < span class = "comment" > // Example Output:< / span > < / div >
< div class = "line" > < span class = "comment" > // == Timescales (s) ==< / span > < / div >
< div class = "line" > < span class = "comment" > // Species Timescale (s)< / span > < / div >
< div class = "line" > < span class = "comment" > // ==========================< / span > < / div >
< div class = "line" > < span class = "comment" > // h1 1.234e+05< / span > < / div >
< div class = "line" > < span class = "comment" > // he4 inf< / span > < / div >
< div class = "line" > < span class = "comment" > // c12 8.765e-02< / span > < / div >
< div class = "line" > < span class = "comment" > // ==========================< / span > < / div >
2025-10-08 11:17:09 -04:00
< div class = "ttc" id = "anamespacegridfire_1_1utils_html_a05fda32d3fc4ab10060b8c4c251c2f3d" > < div class = "ttname" > < a href = "#a05fda32d3fc4ab10060b8c4c251c2f3d" > gridfire::utils::formatNuclearTimescaleLogString< / a > < / div > < div class = "ttdeci" > std::string formatNuclearTimescaleLogString(const DynamicEngine & engine, const fourdst::composition::Composition & composition, double T9, double rho)< / div > < div class = "ttdoc" > Formats a map of nuclear species timescales into a human-readable string.< / div > < div class = "ttdef" > < b > Definition< / b > logging.cpp:12< / div > < / div >
2025-07-01 15:06:22 -04:00
< / div > <!-- fragment -->
2025-07-01 11:40:58 -04:00
< / 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_1utils.html" > utils< / 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 >