105 lines
12 KiB
TeX
105 lines
12 KiB
TeX
|
|
\doxysection{src/include/serif/backend/mfem Directory Reference}
|
||
|
|
\hypertarget{dir_f4279ff9f0ade9101a3d0c95da9106b0}{}\label{dir_f4279ff9f0ade9101a3d0c95da9106b0}\index{src/include/serif/backend/mfem Directory Reference@{src/include/serif/backend/mfem Directory Reference}}
|
||
|
|
Directory dependency graph for mfem\+:
|
||
|
|
\nopagebreak
|
||
|
|
\begin{figure}[H]
|
||
|
|
\begin{center}
|
||
|
|
\leavevmode
|
||
|
|
\includegraphics[width=350pt]{dir_f4279ff9f0ade9101a3d0c95da9106b0_dep}
|
||
|
|
\end{center}
|
||
|
|
\end{figure}
|
||
|
|
\doxysubsubsection*{Directories}
|
||
|
|
\begin{DoxyCompactItemize}
|
||
|
|
\item
|
||
|
|
directory \mbox{\hyperlink{dir_7f477ac1f4073d80fe2cf961b8371c78}{discretization}}
|
||
|
|
\item
|
||
|
|
directory \mbox{\hyperlink{dir_a06a86b96ba8029e601031e1f2191759}{geometry}}
|
||
|
|
\item
|
||
|
|
directory \mbox{\hyperlink{dir_868918a99b4e75b7dbed614771b99884}{mapping}}
|
||
|
|
\item
|
||
|
|
directory \mbox{\hyperlink{dir_1233560eb10cdcde82755d8d2adeb88b}{model}}
|
||
|
|
\item
|
||
|
|
directory \mbox{\hyperlink{dir_071310146d715fd89847bf9b7662fb48}{operators}}
|
||
|
|
\item
|
||
|
|
directory \mbox{\hyperlink{dir_b775f56dba5805041c07293ece4547b5}{projection}}
|
||
|
|
\item
|
||
|
|
directory \mbox{\hyperlink{dir_a6addf8d2b502bb84d626acd01a49eda}{serialize}}
|
||
|
|
\item
|
||
|
|
directory \mbox{\hyperlink{dir_dd439b85c0fa899b8964b586100d1f6d}{shared}}
|
||
|
|
\item
|
||
|
|
directory \mbox{\hyperlink{dir_518c5782990baa988ca590b53b43636d}{solver}}
|
||
|
|
\end{DoxyCompactItemize}
|
||
|
|
\doxysubsubsection*{Files}
|
||
|
|
\begin{DoxyCompactItemize}
|
||
|
|
\item
|
||
|
|
file \mbox{\hyperlink{backend_2mfem_2runtime_8hpp}{runtime.\+hpp}}
|
||
|
|
\item
|
||
|
|
file \mbox{\hyperlink{backend_2mfem_2types_8hpp}{types.\+hpp}}
|
||
|
|
\end{DoxyCompactItemize}
|
||
|
|
|
||
|
|
|
||
|
|
\doxysubsection{Detailed Description}
|
||
|
|
MFEM implementations live here and in the matching {\ttfamily src/lib/serif/backend/mfem} 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\+: {\ttfamily model\+::make\+\_\+discretization}, {\ttfamily geometry\+::surface\+::\+Automatic\+Pressure\+Surface}, generic preconditioner diagonal regularization, and discretization element coordinates.
|
||
|
|
|
||
|
|
\tabulinesep=1mm
|
||
|
|
\begin{longtabu}spread 0pt [c]{*{2}{|X[-1]}|}
|
||
|
|
\hline
|
||
|
|
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Directory }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Responsibility }\\\cline{1-2}
|
||
|
|
\endfirsthead
|
||
|
|
\hline
|
||
|
|
\endfoot
|
||
|
|
\hline
|
||
|
|
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Directory }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Responsibility }\\\cline{1-2}
|
||
|
|
\endhead
|
||
|
|
{\ttfamily discretization} &Bind physical terms to MFEM spaces; own coefficient ordering, element orientation, basis evaluation, quadrature, traces, and MFEM mesh extraction. \\\cline{1-2}
|
||
|
|
{\ttfamily mapping} &Evaluate physical mappings and their variations from supplied reference geometry and current coefficients. \\\cline{1-2}
|
||
|
|
{\ttfamily geometry} &Adapt surface and deformation descriptions to MFEM resources, including pressure traces and boundary metrics. \\\cline{1-2}
|
||
|
|
{\ttfamily operators} &Integrate equation contributions and expose their linear actions, transposes, diagonals, and assembly. No EOS-\/specific pressure construction belongs here. \\\cline{1-2}
|
||
|
|
{\ttfamily model} &Connect the preceding adapters into the model\textquotesingle{}s computational graph and publish owning evaluated systems. The deformation-\/to-\/equation bridge belongs here. \\\cline{1-2}
|
||
|
|
{\ttfamily solver} &Supply MFEM linear solvers, inverses, geometry admissibility, and stellar adapters to the common Newton and continuation algorithms. \\\cline{1-2}
|
||
|
|
{\ttfamily projection} &Project reusable radial profiles into MFEM finite-\/element spaces. \\\cline{1-2}
|
||
|
|
{\ttfamily shared} &Small backend facilities with multiple independent consumers\+: live mesh/space snapshots, boundary traversal, vector spans, and matrix/vector checks. \\\cline{1-2}
|
||
|
|
\end{longtabu}
|
||
|
|
\hypertarget{README.md_autotoc_md1}{}\doxysubsection{\texorpdfstring{Ownership and reuse}{Ownership and reuse}}\label{README.md_autotoc_md1}
|
||
|
|
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.
|
||
|
|
|
||
|
|
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 {\ttfamily Nodes\+Updated}) and rebuild the input context after changing its resources. Revision tracking cannot detect unreported writes to external coordinate storage.
|
||
|
|
|
||
|
|
A {\ttfamily Dof\+Map} owns the meaning of reduced coefficients. Public coefficient access validates that meaning. Internal element traversals obtain a validated {\ttfamily Elements} 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 {\ttfamily discretization/element\+\_\+coordinates}.
|
||
|
|
|
||
|
|
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.\hypertarget{README.md_autotoc_md2}{}\doxysubsection{\texorpdfstring{Core boundary}{Core boundary}}\label{README.md_autotoc_md2}
|
||
|
|
{\ttfamily serif\+\_\+core\+\_\+lib} and {\ttfamily serif\+\_\+core\+\_\+dep} have no MFEM dependency. The core header check and the standard-\/vector Newton tests compile without MFEM include paths. The public {\ttfamily serif} library includes the core and adds this backend. Convenience entry headers may select MFEM adapters, while physical configuration and numerical algorithms remain available separately.
|
||
|
|
|
||
|
|
Continuation families, physical parameter laws, coordinate stepping, and the driver share {\ttfamily \doxylink{namespaceserif_1_1solver_1_1continuation}{serif\+::solver\+::continuation}} in {\ttfamily solver/continuation}. Its entry header is backend independent; only stellar correction wiring and finite-\/element state transfer live in {\ttfamily backend/mfem/solver/continuation}.
|
||
|
|
|
||
|
|
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.
|
||
|
|
|
||
|
|
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.\hypertarget{README.md_autotoc_md3}{}\doxysubsection{\texorpdfstring{Optional surface density reconstruction}{Optional surface density reconstruction}}\label{README.md_autotoc_md3}
|
||
|
|
Pass the numerical choice directly to the stellar factory, after any deformation\+:
|
||
|
|
|
||
|
|
|
||
|
|
\begin{DoxyCode}{0}
|
||
|
|
\DoxyCodeLine{\textcolor{keyword}{namespace\ }reconstruction\ =\ \mbox{\hyperlink{namespaceserif_1_1discretization_1_1reconstruction}{serif::discretization::reconstruction}};}
|
||
|
|
\DoxyCodeLine{\textcolor{keyword}{using\ }Density\ =\ \mbox{\hyperlink{structserif_1_1discretization_1_1blocks_1_1density_1_1mass}{serif::discretization::blocks::density::mass}};}
|
||
|
|
\DoxyCodeLine{\textcolor{keyword}{auto}\ finite\_elements\ =\ \mbox{\hyperlink{namespaceserif_1_1model_ac5681e63c50dc5a136eaa699838cf332}{serif::model::make\_stellar\_discretization}}(}
|
||
|
|
\DoxyCodeLine{\ \ \ \ star,\ mesh\_options,\ moving\_boundary,}
|
||
|
|
\DoxyCodeLine{\ \ \ \ reconstruction::SurfacePower<Density>\{}
|
||
|
|
\DoxyCodeLine{\ \ \ \ \ \ \ \ .density\_exponent\ =\ n,}
|
||
|
|
\DoxyCodeLine{\ \ \ \ \ \ \ \ .region\ =\ reconstruction::SurfaceAdjacent<}
|
||
|
|
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structserif_1_1discretization_1_1domain_1_1_stellar_surface_boundary}{serif::discretization::domain::StellarSurfaceBoundary}}>\{\}\});}
|
||
|
|
|
||
|
|
\end{DoxyCode}
|
||
|
|
|
||
|
|
|
||
|
|
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 {\ttfamily t=0} at the surface and {\ttfamily t=1} at their inner face, their zero-\/trace radial space becomes {\ttfamily t\texorpdfstring{$^\wedge$}{\string^}n P\+\_\+(p-\/1)}. 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.
|
||
|
|
|
||
|
|
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.
|
||
|
|
|
||
|
|
{\ttfamily discretization\+::backend\+::mfem\+::\+Field\+Values\texorpdfstring{$<$}{<}Term\texorpdfstring{$>$}{>}} 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 Grid\+Function interpolation of reconstructed nodal values is not the represented field.
|
||
|
|
|
||
|
|
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.
|
||
|
|
|
||
|
|
To add a numerical form, provide an ADL-\/visible {\ttfamily make\+\_\+reconstruction(specification, binding)} overload, a specification with {\ttfamily using Term}, and an immutable {\ttfamily Radial\+Profile} 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.
|
||
|
|
|
||
|
|
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 {\ttfamily density (sampled)}. This display approximation is never used by the solver or TOP exporter.
|