You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li><b>Add the module to <spanclass="tt">docs/module_categories.json</span></b> so it appears in this page</li>
410
410
</ol>
411
411
<p>Follow the pattern of existing modules like <spanclass="tt">m_body_forces</span> (simple) or <spanclass="tt">m_viscous</span> (more involved) as a template.</p>
<p>💡 <b>Tip:</b> If you encounter a validation error, check the relevant section above or review <ahref="https://github.com/MFlowCode/MFC/blob/master/toolchain/mfc/case_validator.py"><spanclass="tt">case_validator.py</span></a> for complete validation logic.</p>
<divclass="line"> self.errors.append(<spanclass="stringliteral">"my_param requires other_param to be set"</span>)</div>
427
427
</div><!-- fragment --><p>If your check enforces a physics constraint, also add a <spanclass="tt">PHYSICS_DOCS</span> entry (see <aclass="el" href="#how-to-document-physics-constraints" title="How to Document Physics Constraints">How to Document Physics Constraints</a> below).</p>
428
-
<p><b>Step 5: Declare in Fortran</b> (<spanclass="tt">src/<target>/m_global_parameters.fpp</span>)</p>
429
-
<p>Add the variable declaration in the appropriate target's global parameters module. Choose the target(s) where the parameter is used:</p>
428
+
<p><b>Step 5: Fortran declaration and namelist binding (auto-generated)</b></p>
429
+
<p>Scalar declarations, GPU declare lines, Doxygen descriptions, and namelist bindings are auto-generated at CMake configure time from the <spanclass="tt">TYPED_DECLS</span> and <spanclass="tt">FORTRAN_ARRAY_DIMS</span> tables in <spanclass="tt">toolchain/mfc/params/definitions.py</span>. For a plain scalar registered with <spanclass="tt">_r()</span> / <spanclass="tt">_nv()</span> above, no manual Fortran edit is needed — reconfigure (<spanclass="tt">./mfc.sh build</span>) and the generated include in each target's <spanclass="tt">m_global_parameters.fpp</span> is updated automatically.</p>
<li>MPI broadcast lists in <spanclass="tt">src/*/m_mpi_proxy.fpp</span></li>
436
+
<li><spanclass="tt">CASE_OPT_EXTRA_LINES</span> in <spanclass="tt">toolchain/mfc/params/generators/fortran_gen.py</span> for case-optimization constants</li>
434
437
</ul>
435
-
<divclass="fragment"><divclass="line"><spanclass="keywordtype">real</span>(wp) :: my_param<spanclass="comment"> !< Description of the parameter</span></div>
436
-
</div><!-- fragment --><p>If the parameter is used in GPU kernels, add a GPU declaration:</p>
</div><!-- fragment --><p>The toolchain writes the parameter to the input file and Fortran reads it via this namelist. No other I/O code is needed.</p>
442
-
<p><b>Step 7: Use in Fortran code</b></p>
438
+
<p>After editing any generator or table, force regen by reconfiguring (<spanclass="tt">./mfc.sh build</span>) — cached builds compile stale includes.</p>
439
+
<p><b>Step 6: Use in Fortran code</b></p>
443
440
<p>Reference <spanclass="tt">my_param</span> anywhere in the target's modules. It is available as a global after the namelist is read at startup.</p>
<p>This example case contains an automated convergence test using a 1D, two-component advection case. The case can be run by executing the bash script <spanclass="tt">./submitJobs.sh</span> in a terminal after enabling execution permissions with <spanclass="tt">chmod +x ./submitJobs.sh</span> and setting the <spanclass="tt">ROOT_DIR</span> and <spanclass="tt">MFC_DIR</span> variables. By default the script runs the case for 6 different grid resolutions with 1st, 3rd, and 5th, order spatial reconstructions. These settings can be modified by editing the variables at the top of the script. You can also run different model equations by setting the <spanclass="tt">ME</span> variable and different Riemann solvers by setting the <spanclass="tt">RS</span> variable.</p>
632
632
<p>Once the simulations have been run, you can generate convergence plots with matplotlib by running <spanclass="tt">python3 plot.py</span> in a terminal. This will generate plots of the L1, L2, and Linf error norms and save the results to <spanclass="tt">errors.csv</span>.</p>
<div class="ttc" id="anamespacem__global__parameters_html_a4dac2e4ead915635e0c6c33af87be01b"><div class="ttname"><a href="namespacem__global__parameters.html#a4dac2e4ead915635e0c6c33af87be01b">m_global_parameters::sys_size</a></div><div class="ttdeci">integer sys_size</div><div class="ttdoc">Number of unknowns in the system of equations.</div><div class="ttdef"><b>Definition</b> <a href="m__global__parameters_8fpp_8f90_source.html#l00201">m_global_parameters.fpp.f90:201</a></div></div>
<div class="ttc" id="anamespacem__global__parameters_html_a4dac2e4ead915635e0c6c33af87be01b"><div class="ttname"><a href="namespacem__global__parameters.html#a4dac2e4ead915635e0c6c33af87be01b">m_global_parameters::sys_size</a></div><div class="ttdeci">integer sys_size</div><div class="ttdoc">Number of unknowns in the system of equations.</div><div class="ttdef"><b>Definition</b> <a href="m__global__parameters_8fpp_8f90_source.html#l00204">m_global_parameters.fpp.f90:204</a></div></div>
4091
4091
<div class="ttc" id="anamespacem__mpi__proxy_html"><div class="ttname"><a href="namespacem__mpi__proxy.html">m_mpi_proxy</a></div><div class="ttdoc">MPI gather and scatter operations for distributing post-process grid and flow-variable data.</div><div class="ttdef"><b>Definition</b> <a href="m__mpi__proxy_8fpp_8f90_source.html#l00007">m_mpi_proxy.fpp.f90:7</a></div></div>
4092
4092
<div class="ttc" id="astructm__derived__types_1_1scalar__field_html"><div class="ttname"><a href="structm__derived__types_1_1scalar__field.html">m_derived_types::scalar_field</a></div><div class="ttdoc">Derived type annexing a scalar field (SF).</div><div class="ttdef"><b>Definition</b> <a href="m__derived__types_8fpp_8f90_source.html#l00331">m_derived_types.fpp.f90:331</a></div></div>
0 commit comments