<trclass="memdesc:af56693a70d9e2b40c8ae2c3bcd4b26c8"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Formats a map of nuclear species timescales into a human-readable string. <br/></td></tr>
<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>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">engine</td><td>A constant reference to a <code><aclass="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><tdclass="paramname">Y</td><td>A vector of the molar abundances (mol/g) for each species. </td></tr>
<tr><tdclass="paramname">T9</td><td>The temperature in units of 10^9 K. </td></tr>
<tr><tdclass="paramname">rho</td><td>The plasma density in g/cm^3. </td></tr>
</table>
</dd>
</dl>
<dlclass="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><oltype="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><divclass="fragment"><divclass="line"><spanclass="comment">// Assume 'my_engine' is a valid DynamicEngine object and Y, T9, rho are initialized.</span></div>
<divclass="line">std::string log_output = <aclass="code hl_function"href="#af56693a70d9e2b40c8ae2c3bcd4b26c8">gridfire::utils::formatNuclearTimescaleLogString</a>(my_engine, Y, T9, rho);</div>
<divclass="ttc"id="anamespacegridfire_1_1utils_html_af56693a70d9e2b40c8ae2c3bcd4b26c8"><divclass="ttname"><ahref="#af56693a70d9e2b40c8ae2c3bcd4b26c8">gridfire::utils::formatNuclearTimescaleLogString</a></div><divclass="ttdeci">std::string formatNuclearTimescaleLogString(const DynamicEngine &engine, const std::vector< double >&Y, const double T9, const double rho)</div><divclass="ttdoc">Formats a map of nuclear species timescales into a human-readable string.</div><divclass="ttdef"><b>Definition</b><ahref="logging_8cpp_source.html#l00013">logging.cpp:13</a></div></div>
<pclass="definition">Definition at line <aclass="el"href="logging_8cpp_source.html#l00013">13</a> of file <aclass="el"href="logging_8cpp_source.html">logging.cpp</a>.</p>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<divid="nav-path"class="navpath"><!-- id is needed for treeview function! -->
<liclass="footer">Generated by <ahref="https://www.doxygen.org/index.html"><imgclass="footer"src="doxygen.svg"width="104"height="31"alt="doxygen"/></a> 1.13.2 </li>