Note for now much of the docs is LLM written. This was done to save time and focus on code development. The docs have been LOOSLEY reviewed. However, the code itself has been either fully written by hand or fully reviewed. Therefore, the docs should at the moment be seen as a loose resource rather than authoratiative (and this is on top of the general ability for docs to drift)
213 lines
22 KiB
HTML
213 lines
22 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>SERiF: src/include/serif/backend/mfem Directory 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>
|
|
<script type="text/x-mathjax-config">
|
|
MathJax.Hub.Config({
|
|
extensions: ["tex2jax.js"],
|
|
jax: ["input/TeX","output/HTML-CSS"],
|
|
});
|
|
</script>
|
|
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.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"/>
|
|
<link href="doxygen-extra.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">SERiF<span id="projectnumber"> v0.0.1a</span>
|
|
</div>
|
|
<div id="projectbrief">Stellar Evolution and Rotation in Four Dimensions</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('dir_f4279ff9f0ade9101a3d0c95da9106b0.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">mfem Directory Reference</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<div class="dynheader">
|
|
Directory dependency graph for mfem:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="dir_f4279ff9f0ade9101a3d0c95da9106b0_dep.svg" width="100%" height="600"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div></div>
|
|
</div>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="subdirs" name="subdirs"></a>
|
|
Directories</h2></td></tr>
|
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top"><span class="iconfclosed"></span> </td><td class="memItemRight" valign="bottom"><a class="el" href="dir_7f477ac1f4073d80fe2cf961b8371c78.html">discretization</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top"><span class="iconfclosed"></span> </td><td class="memItemRight" valign="bottom"><a class="el" href="dir_a06a86b96ba8029e601031e1f2191759.html">geometry</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top"><span class="iconfclosed"></span> </td><td class="memItemRight" valign="bottom"><a class="el" href="dir_868918a99b4e75b7dbed614771b99884.html">mapping</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top"><span class="iconfclosed"></span> </td><td class="memItemRight" valign="bottom"><a class="el" href="dir_1233560eb10cdcde82755d8d2adeb88b.html">model</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top"><span class="iconfclosed"></span> </td><td class="memItemRight" valign="bottom"><a class="el" href="dir_071310146d715fd89847bf9b7662fb48.html">operators</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top"><span class="iconfclosed"></span> </td><td class="memItemRight" valign="bottom"><a class="el" href="dir_b775f56dba5805041c07293ece4547b5.html">projection</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top"><span class="iconfclosed"></span> </td><td class="memItemRight" valign="bottom"><a class="el" href="dir_a6addf8d2b502bb84d626acd01a49eda.html">serialize</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top"><span class="iconfclosed"></span> </td><td class="memItemRight" valign="bottom"><a class="el" href="dir_dd439b85c0fa899b8964b586100d1f6d.html">shared</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top"><span class="iconfclosed"></span> </td><td class="memItemRight" valign="bottom"><a class="el" href="dir_518c5782990baa988ca590b53b43636d.html">solver</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="files" name="files"></a>
|
|
Files</h2></td></tr>
|
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top"><span class="icondoc"></span> </td><td class="memItemRight" valign="bottom"><a class="el" href="backend_2mfem_2runtime_8hpp.html">runtime.hpp</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top"><span class="icondoc"></span> </td><td class="memItemRight" valign="bottom"><a class="el" href="backend_2mfem_2types_8hpp.html">types.hpp</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<p>MFEM implementations live here and in the matching <code>src/lib/serif/backend/mfem</code> tree. Physics descriptions, equations, EOS relations, normalization rules, Newton acceptance, and continuation scheduling stay in their ordinary SERiF modules. The directory migration preserves physics-oriented namespaces; include paths identify the implementation backend. Helpers whose responsibility changed now follow their owner: <code>model::make_discretization</code>, <code>geometry::surface::AutomaticPressureSurface</code>, generic preconditioner diagonal regularization, and discretization element coordinates.</p>
|
|
<table class="markdownTable">
|
|
<tr class="markdownTableHead">
|
|
<th class="markdownTableHeadNone">Directory </th><th class="markdownTableHeadNone">Responsibility </th></tr>
|
|
<tr class="markdownTableRowOdd">
|
|
<td class="markdownTableBodyNone"><code>discretization</code> </td><td class="markdownTableBodyNone">Bind physical terms to MFEM spaces; own coefficient ordering, element orientation, basis evaluation, quadrature, traces, and MFEM mesh extraction. </td></tr>
|
|
<tr class="markdownTableRowEven">
|
|
<td class="markdownTableBodyNone"><code>mapping</code> </td><td class="markdownTableBodyNone">Evaluate physical mappings and their variations from supplied reference geometry and current coefficients. </td></tr>
|
|
<tr class="markdownTableRowOdd">
|
|
<td class="markdownTableBodyNone"><code>geometry</code> </td><td class="markdownTableBodyNone">Adapt surface and deformation descriptions to MFEM resources, including pressure traces and boundary metrics. </td></tr>
|
|
<tr class="markdownTableRowEven">
|
|
<td class="markdownTableBodyNone"><code>operators</code> </td><td class="markdownTableBodyNone">Integrate equation contributions and expose their linear actions, transposes, diagonals, and assembly. No EOS-specific pressure construction belongs here. </td></tr>
|
|
<tr class="markdownTableRowOdd">
|
|
<td class="markdownTableBodyNone"><code>model</code> </td><td class="markdownTableBodyNone">Connect the preceding adapters into the model's computational graph and publish owning evaluated systems. The deformation-to-equation bridge belongs here. </td></tr>
|
|
<tr class="markdownTableRowEven">
|
|
<td class="markdownTableBodyNone"><code>solver</code> </td><td class="markdownTableBodyNone">Supply MFEM linear solvers, inverses, geometry admissibility, and stellar adapters to the common Newton and continuation algorithms. </td></tr>
|
|
<tr class="markdownTableRowOdd">
|
|
<td class="markdownTableBodyNone"><code>projection</code> </td><td class="markdownTableBodyNone">Project reusable radial profiles into MFEM finite-element spaces. </td></tr>
|
|
<tr class="markdownTableRowEven">
|
|
<td class="markdownTableBodyNone"><code>shared</code> </td><td class="markdownTableBodyNone">Small backend facilities with multiple independent consumers: live mesh/space snapshots, boundary traversal, vector spans, and matrix/vector checks. </td></tr>
|
|
</table>
|
|
<h1><a class="anchor" id="autotoc_md1"></a>
|
|
Ownership and reuse</h1>
|
|
<p>The computational graph owns immutable prepared data, including fixed geometry at equation quadrature points. A mapper does not own a second mutable reference-geometry cache. Standalone point and face mapping evaluate their own reference geometry directly. Accepted systems retain their preparation owners and remain independent of subsequent candidate preparation.</p>
|
|
<p>MFEM resources are externally mutable. Snapshot policies distinguish topology, material/boundary labels, finite-element layout, and physical/logical coordinate revisions. Input factories capture current revisions; reusing stale input metadata is rejected. Notify MFEM of direct coordinate changes (for example with <code>NodesUpdated</code>) and rebuild the input context after changing its resources. Revision tracking cannot detect unreported writes to external coordinate storage.</p>
|
|
<p>A <code>DofMap</code> owns the meaning of reduced coefficients. Public coefficient access validates that meaning. Internal element traversals obtain a validated <code>Elements</code> view once, then retain element bounds, support, and vector-size checks without rescanning all mesh attributes for every element. Do not mutate the mesh or space during a traversal. Element orientation is implemented once in <code>discretization/element_coordinates</code>.</p>
|
|
<p>Surface normalization and surface preconditioning share validated boundary traversal, but keep their different integrands: vector radial/harmonic metric diagonals versus scalar H1 mass and stiffness matrices. Likewise, model block selection preserves native child assembly and repeated ranges; restriction of an arbitrary preconditioner operator retains its separate unique-index contract.</p>
|
|
<h1><a class="anchor" id="autotoc_md2"></a>
|
|
Core boundary</h1>
|
|
<p><code>serif_core_lib</code> and <code>serif_core_dep</code> have no MFEM dependency. The core header check and the standard-vector Newton tests compile without MFEM include paths. The public <code>serif</code> library includes the core and adds this backend. Convenience entry headers may select MFEM adapters, while physical configuration and numerical algorithms remain available separately.</p>
|
|
<p>Continuation families, physical parameter laws, coordinate stepping, and the driver share <code><a class="el" href="namespaceserif_1_1solver_1_1continuation.html">serif::solver::continuation</a></code> in <code>solver/continuation</code>. Its entry header is backend independent; only stellar correction wiring and finite-element state transfer live in <code>backend/mfem/solver/continuation</code>.</p>
|
|
<p>The common Newton loop asks its vector adapter only for owned vectors and coefficient spans. The MFEM wrapper supplies linear-solve wiring; it does not duplicate acceptance, backtracking, or checkpoint ownership. A future backend should implement its discretization and execution adapters and reuse these common rules, rather than copy the nonlinear or continuation algorithms.</p>
|
|
<p>Current term bindings require serial, conforming three-dimensional MFEM spaces. Supported value, gradient, divergence, trace, and tensor/dense basis paths retain their explicit compile-time and runtime checks. This layout does not imply that every MFEM space or another finite-element library is already supported.</p>
|
|
<h1><a class="anchor" id="autotoc_md3"></a>
|
|
Optional surface density reconstruction</h1>
|
|
<p>Pass the numerical choice directly to the stellar factory, after any deformation:</p>
|
|
<div class="fragment"><div class="line"><span class="keyword">namespace </span>reconstruction = <a class="code hl_namespace" href="namespaceserif_1_1discretization_1_1reconstruction.html">serif::discretization::reconstruction</a>;</div>
|
|
<div class="line"><span class="keyword">using </span>Density = <a class="code hl_struct" href="structserif_1_1discretization_1_1blocks_1_1density_1_1mass.html">serif::discretization::blocks::density::mass</a>;</div>
|
|
<div class="line"><span class="keyword">auto</span> finite_elements = <a class="code hl_function" href="namespaceserif_1_1model.html#ac5681e63c50dc5a136eaa699838cf332">serif::model::make_stellar_discretization</a>(</div>
|
|
<div class="line"> star, mesh_options, moving_boundary,</div>
|
|
<div class="line"> reconstruction::SurfacePower<Density>{</div>
|
|
<div class="line"> .density_exponent = n,</div>
|
|
<div class="line"> .region = reconstruction::SurfaceAdjacent<</div>
|
|
<div class="line"> <a class="code hl_struct" href="structserif_1_1discretization_1_1domain_1_1_stellar_surface_boundary.html">serif::discretization::domain::StellarSurfaceBoundary</a>>{}});</div>
|
|
<div class="ttc" id="anamespaceserif_1_1discretization_1_1reconstruction_html"><div class="ttname"><a href="namespaceserif_1_1discretization_1_1reconstruction.html">serif::discretization::reconstruction</a></div><div class="ttdef"><b>Definition</b> surface_power.hpp:10</div></div>
|
|
<div class="ttc" id="anamespaceserif_1_1model_html_ac5681e63c50dc5a136eaa699838cf332"><div class="ttname"><a href="namespaceserif_1_1model.html#ac5681e63c50dc5a136eaa699838cf332">serif::model::make_stellar_discretization</a></div><div class="ttdeci">auto make_stellar_discretization(std::shared_ptr< Owner > owner, Bindings bindings, const ::mfem::GridFunction &compactification, const mapping::DomainMapper &mapper)</div><div class="ttdoc">Retain the supplied resource owner without copying finite-element spaces or changing their addresses.</div><div class="ttdef"><b>Definition</b> discretization.hpp:64</div></div>
|
|
<div class="ttc" id="astructserif_1_1discretization_1_1blocks_1_1density_1_1mass_html"><div class="ttname"><a href="structserif_1_1discretization_1_1blocks_1_1density_1_1mass.html">serif::discretization::blocks::density::mass</a></div><div class="ttdoc">The mass density term for the system. Note that the naming here could be a bit confusing as FEM also ...</div><div class="ttdef"><b>Definition</b> fields.hpp:147</div></div>
|
|
<div class="ttc" id="astructserif_1_1discretization_1_1domain_1_1_stellar_surface_boundary_html"><div class="ttname"><a href="structserif_1_1discretization_1_1domain_1_1_stellar_surface_boundary.html">serif::discretization::domain::StellarSurfaceBoundary</a></div><div class="ttdoc">The StellarSurfaceBoundary is the surface of the star. It is a derived class of Boundary.</div><div class="ttdef"><b>Definition</b> types.hpp:63</div></div>
|
|
</div><!-- fragment --><p>Omitting the argument preserves ordinary interpolation. Exponent 1 takes that same path without a reconstruction plan. Stored coefficients remain physical nodal densities. Only material elements touching the selected boundary change: with inward reference coordinate <code>t=0</code> at the surface and <code>t=1</code> at their inner face, their zero-trace radial space becomes <code>t^n P_(p-1)</code>. Tangential interpolation and deeper elements remain ordinary. The full basis retains surface degrees of freedom and reproduces constants; the vacuum solve enforces their zero values explicitly.</p>
|
|
<p>The plan belongs to the field binding and is immutable throughout a solve. Its exponent is an explicit numerical choice; changing an EOS during continuation does not silently change the representation. A different profile, mesh or exponent requires a new binding and deliberate field transfer. Construction validates matching radial coordinates and the actual hanging-node constraints. Tangential/equatorial refinement is supported when those constraints preserve the reconstructed traces. Incompatible radial hanging layers fail with a SERiF diagnostic.</p>
|
|
<p><code>discretization::backend::mfem::FieldValues<Term></code> reads the same physical representation as the equation operators. Use it for arbitrary-point values, scalar H1 gradients or batches of samples. Its binding, coefficients and mesh resources must outlive the reader. Extra deformation/compactification maps must be supplied for physical gradients and H(div) values. Ordinary MFEM GridFunction interpolation of reconstructed nodal values is not the represented field.</p>
|
|
<p>Reference preparation replaces only the radial tensor factors; forward and transpose contractions retain the existing kernels. Automatic volume rules include a fractional-power allowance before quadrature-policy resolution, so an explicit fixed order remains authoritative. Gaussian quadrature is still approximate and should be checked by increasing its order for a new regime. Nonnegativity certifies the polynomial carrier with its positive weight and requires the selected zero-density trace. This implementation does not provide a certificate for finite-pressure surface lifting or a general EOS surface profile.</p>
|
|
<p>To add a numerical form, provide an ADL-visible <code>make_reconstruction(specification, binding)</code> overload, a specification with <code>using Term</code>, and an immutable <code>RadialProfile</code> that evaluates complete nodal functions and inward derivatives, including endpoints. The profile must preserve nodal values, constants and compatible face traces. Add its admissibility certificate and archive codec explicitly; missing capabilities report errors. No MFEM element subclass or physics-equation rewrite is required. The current surface-power form supports scalar H1 mass density only.</p>
|
|
<p>Weighted archive bindings use schema version 2; older readers reject them rather than reinterpret their coefficients. The live Rayfem adapter sends a higher-order sampled display field labeled <code>density (sampled)</code>. This display approximation is never used by the solver or TOP exporter. </p>
|
|
</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_e3fc9bd9804296f8660ca61563b995c5.html">serif</a></li><li class="navelem"><a class="el" href="dir_5efd9e6a724a898950c58bd67170566f.html">backend</a></li><li class="navelem"><a class="el" href="dir_f4279ff9f0ade9101a3d0c95da9106b0.html">mfem</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>
|