Skip to content

Commit 370e3d2

Browse files
author
MFC Action
committed
Docs @ b104aea
1 parent c80312b commit 370e3d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+3074
-2033
lines changed

documentation/case.html

Lines changed: 29 additions & 29 deletions
Large diffs are not rendered by default.

documentation/case_constraints.html

Lines changed: 98 additions & 85 deletions
Large diffs are not rendered by default.

documentation/contributing.html

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ <h3 class="doxsection"><a class="anchor" id="autotoc_md70"></a>
188188
<div class="line"> → RHS assembly</div>
189189
<div class="line"> → Runge-Kutta update → q_cons_vf (next stage/step)</div>
190190
</div><!-- fragment --><p>Key data structures (defined in <span class="tt">src/common/m_derived_types.fpp</span>):</p><ul>
191-
<li><span class="tt">scalar_field</span> — wraps a 3D <span class="tt">real(stp)</span> array (<span class="tt">sf(i,j,k)</span>)</li>
192-
<li><span class="tt">vector_field</span> — array of <span class="tt">scalar_field</span> (<span class="tt">vf(1:sys_size)</span>)</li>
191+
<li><span class="tt">scalar_field</span> — wraps a 3D <span class="tt">real(stp)</span> array (<span class="tt">%sf(i,j,k)</span>)</li>
192+
<li><span class="tt">vector_field</span> — array of <span class="tt">scalar_field</span> (<span class="tt">%vf(1:sys_size)</span>)</li>
193193
<li><span class="tt">q_cons_vf</span> / <span class="tt">q_prim_vf</span> — conservative and primitive state vectors</li>
194194
</ul>
195195
<h3 class="doxsection"><a class="anchor" id="autotoc_md71"></a>
@@ -279,7 +279,7 @@ <h2 class="doxsection"><a class="anchor" id="autotoc_md77"></a>
279279
<h3 class="doxsection"><a class="anchor" id="autotoc_md78"></a>
280280
Array Bounds and Indexing</h3>
281281
<ul>
282-
<li>MFC uses <b>non-unity lower bounds</b> (e.g., <span class="tt">idwbuff(1)beg:idwbuff(1)end</span> with negative ghost-cell indices). Always verify loop bounds match array declarations.</li>
282+
<li>MFC uses <b>non-unity lower bounds</b> (e.g., <span class="tt">idwbuff(1)%beg:idwbuff(1)%end</span> with negative ghost-cell indices). Always verify loop bounds match array declarations.</li>
283283
<li><b>Riemann solver indexing:</b> Left states at <span class="tt">j</span>, right states at <span class="tt">j+1</span>. Off-by-one here corrupts fluxes.</li>
284284
</ul>
285285
<h3 class="doxsection"><a class="anchor" id="autotoc_md79"></a>
@@ -311,7 +311,7 @@ <h3 class="doxsection"><a class="anchor" id="autotoc_md82"></a>
311311
<li><b>Pressure formula</b> must match <span class="tt">model_eqns</span> value. Model 2/3 (multi-fluid), model 4 (bubbles), MHD, and hypoelastic each use different EOS formulations. Wrong formula = wrong physics.</li>
312312
<li><b>Conservative-primitive conversion:</b> Density recovery, kinetic energy, and pressure each have model-specific paths. Verify the correct branch is taken.</li>
313313
<li><b>Volume fractions</b> must sum to 1. <span class="tt">alpha_rho_K</span> must be non-negative. Species mass fractions should be clipped to [0,1].</li>
314-
<li><b>Boundary conditions:</b> Periodic BCs must match at both ends (<span class="tt">bc_xbeg</span> and <span class="tt">bc_xend</span>). Cylindrical coordinates have special requirements (<span class="tt">bc_ybeg = -14</span> for axis in 3D).</li>
314+
<li><b>Boundary conditions:</b> Periodic BCs must match at both ends (<span class="tt">bc_x%beg</span> and <span class="tt">bc_x%end</span>). Cylindrical coordinates have special requirements (<span class="tt">bc_y%beg = -14</span> for axis in 3D).</li>
315315
<li><b>Parameter constraints:</b> New parameters or physics features must be validated in <span class="tt">toolchain/mfc/case_validator.py</span>. New features should add corresponding validation.</li>
316316
</ul>
317317
<h3 class="doxsection"><a class="anchor" id="autotoc_md83"></a>
@@ -395,7 +395,8 @@ <h3 class="doxsection"><a class="anchor" id="autotoc_md88"></a>
395395
<div class="fragment"><div class="line"><span class="keyword">def </span>check_my_feature(self):</div>
396396
<div class="line"> <span class="keywordflow">if</span> self.params[<span class="stringliteral">&quot;my_param&quot;</span>] &gt; 0 <span class="keywordflow">and</span> <span class="keywordflow">not</span> self.params[<span class="stringliteral">&quot;other_param&quot;</span>]:</div>
397397
<div class="line"> self.errors.append(<span class="stringliteral">&quot;my_param requires other_param to be set&quot;</span>)</div>
398-
</div><!-- fragment --><p><b>Step 5: Declare in Fortran</b> (<span class="tt">src/&lt;target&gt;/m_global_parameters.fpp</span>)</p>
398+
</div><!-- fragment --><p>If your check enforces a physics constraint, also add a <span class="tt">PHYSICS_DOCS</span> entry (see <a class="el" href="#how-to-document-physics-constraints" title="How to Document Physics Constraints">How to Document Physics Constraints</a> below).</p>
399+
<p><b>Step 5: Declare in Fortran</b> (<span class="tt">src/&lt;target&gt;/m_global_parameters.fpp</span>)</p>
399400
<p>Add the variable declaration in the appropriate target's global parameters module. Choose the target(s) where the parameter is used:</p>
400401
<ul>
401402
<li><span class="tt">src/pre_process/m_global_parameters.fpp</span></li>
@@ -672,6 +673,39 @@ <h3 class="doxsection"><a class="anchor" id="autotoc_md95"></a>
672673
<h3 class="doxsection"><a class="anchor" id="autotoc_md97"></a>
673674
Debugging</h3>
674675
<p>See <a class="el" href="troubleshooting.html" title="Troubleshooting Guide">Troubleshooting Guide</a> for debugging workflows, profiling tools, GPU diagnostic environment variables, common build/runtime errors, and fixes.</p>
676+
<h3 class="doxsection"><a class="anchor" id="how-to-document-physics-constraints"></a>
677+
How to Document Physics Constraints</h3>
678+
<p>When adding a new <span class="tt">check_</span> method to <span class="tt">case_validator.py</span>, document its physics by adding an entry to the <span class="tt">PHYSICS_DOCS</span> dict at the top of the file:</p>
679+
<div class="fragment"><div class="line">PHYSICS_DOCS = {</div>
680+
<div class="line"> ...</div>
681+
<div class="line"> <span class="stringliteral">&quot;check_my_feature&quot;</span>: {</div>
682+
<div class="line"> <span class="stringliteral">&quot;title&quot;</span>: <span class="stringliteral">&quot;My Feature Constraint&quot;</span>, <span class="comment"># Required: human-readable title</span></div>
683+
<div class="line"> <span class="stringliteral">&quot;category&quot;</span>: <span class="stringliteral">&quot;Thermodynamic Constraints&quot;</span>, <span class="comment"># Required: groups the constraint in docs</span></div>
684+
<div class="line"> <span class="stringliteral">&quot;explanation&quot;</span>: <span class="stringliteral">&quot;Why this constraint exists.&quot;</span>, <span class="comment"># Required: plain English</span></div>
685+
<div class="line"> <span class="stringliteral">&quot;math&quot;</span>: <span class="stringliteral">r&quot;\alpha &gt; 0&quot;</span>, <span class="comment"># Optional: LaTeX formula</span></div>
686+
<div class="line"> <span class="stringliteral">&quot;references&quot;</span>: [<span class="stringliteral">&quot;Wilfong26&quot;</span>], <span class="comment"># Optional: BibTeX keys from references.bib</span></div>
687+
<div class="line"> <span class="stringliteral">&quot;exceptions&quot;</span>: [<span class="stringliteral">&quot;IBM cases&quot;</span>], <span class="comment"># Optional: when constraint doesn&#39;t apply</span></div>
688+
<div class="line"> },</div>
689+
<div class="line">}</div>
690+
</div><!-- fragment --><p>The <a class="el" href="physics_constraints.html" title="Physics Constraints">Physics Constraints</a> page is <b>auto-generated</b> — run <span class="tt">./mfc.sh generate</span> to rebuild it. The generator merges your <span class="tt">PHYSICS_DOCS</span> entry with the AST-extracted <span class="tt">prohibit()</span>/<span class="tt">warn()</span> calls, so stage, severity, and parameter information appear automatically.</p>
691+
<p><b>Fields:</b></p>
692+
<table class="markdownTable">
693+
<tr class="markdownTableHead">
694+
<th class="markdownTableHeadNone">Field </th><th class="markdownTableHeadNone">Required </th><th class="markdownTableHeadNone">Description </th></tr>
695+
<tr class="markdownTableRowOdd">
696+
<td class="markdownTableBodyNone"><span class="tt">title</span> </td><td class="markdownTableBodyNone">Yes </td><td class="markdownTableBodyNone">Section heading in generated docs </td></tr>
697+
<tr class="markdownTableRowEven">
698+
<td class="markdownTableBodyNone"><span class="tt">category</span> </td><td class="markdownTableBodyNone">Yes </td><td class="markdownTableBodyNone">Grouping category (e.g., "Mixture Constraints") </td></tr>
699+
<tr class="markdownTableRowOdd">
700+
<td class="markdownTableBodyNone"><span class="tt">explanation</span> </td><td class="markdownTableBodyNone">Yes </td><td class="markdownTableBodyNone">Plain English description of the physics </td></tr>
701+
<tr class="markdownTableRowEven">
702+
<td class="markdownTableBodyNone"><span class="tt">math</span> </td><td class="markdownTableBodyNone">No </td><td class="markdownTableBodyNone">LaTeX formula (rendered by Doxygen's MathJax) </td></tr>
703+
<tr class="markdownTableRowOdd">
704+
<td class="markdownTableBodyNone"><span class="tt">references</span> </td><td class="markdownTableBodyNone">No </td><td class="markdownTableBodyNone">List of BibTeX cite keys from <span class="tt">docs/references.bib</span> </td></tr>
705+
<tr class="markdownTableRowEven">
706+
<td class="markdownTableBodyNone"><span class="tt">exceptions</span> </td><td class="markdownTableBodyNone">No </td><td class="markdownTableBodyNone">List of cases where the constraint doesn't apply </td></tr>
707+
</table>
708+
<p><b>Categories:</b> Thermodynamic Constraints, Mixture Constraints, Domain and Geometry, Velocity and Dimensional Consistency, Model Equations, Boundary Conditions, Bubble Physics, Feature Compatibility, Numerical Schemes, Acoustic Sources, Post-Processing.</p>
675709
<h2 class="doxsection"><a class="anchor" id="autotoc_md98"></a>
676710
Testing</h2>
677711
<p>MFC has 500+ regression tests. See <a class="el" href="testing.html" title="Testing">Testing</a> for the full guide.</p>

documentation/custom.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@
33
* Overrides for doxygen-awesome theme
44
*/
55

6+
/* Seamless split <code> tags for Fortran % struct accessors.
7+
* Doxygen consumes %<word> even inside code spans, so we split around %
8+
* into adjacent <code> elements and remove internal borders/padding. */
9+
code.f90l {
10+
border-right: 0;
11+
border-top-right-radius: 0;
12+
border-bottom-right-radius: 0;
13+
padding-right: 0;
14+
}
15+
code.f90r {
16+
border-left: 0;
17+
border-top-left-radius: 0;
18+
border-bottom-left-radius: 0;
19+
padding-left: 0;
20+
}
21+
622
/* Fix inline code visibility in colored admonition blocks (warning, attention, important, note, etc.) */
723

824
/* Warning/Attention/Important blocks (red/pink background) */

0 commit comments

Comments
 (0)