Skip to content

Comments

Improve API documentation discoverability#1167

Merged
sbryngelson merged 14 commits intoMFlowCode:masterfrom
sbryngelson:api-docs
Feb 19, 2026
Merged

Improve API documentation discoverability#1167
sbryngelson merged 14 commits intoMFlowCode:masterfrom
sbryngelson:api-docs

Conversation

@sbryngelson
Copy link
Member

@sbryngelson sbryngelson commented Feb 19, 2026

User description

Summary

  • Add API nav link to the docs landing page (7-column grid)
  • Add cross-links to Pre-Process, Simulation, and Post-Process API docs from the user guide sidebar
  • Auto-generate API target landing pages (docs/{target}/readme.md) at build time via gen_api_landing.py, which scans src/{target}/*.fpp for module names and produces @ref links with correct Fortran case handling
  • Enable SOURCE_BROWSER = YES in Doxygen so users can click through to annotated source code
  • Add missing @file documentation blocks to 16 source files; fix 3 malformed Doxygen comment openers (!!> and bare !!)
  • Fix unlinked module names in file list descriptions: explicit @ref for mixed-case modules (m_bubbles_EE/EL/EL_kernels), correct stale names (m_patches -> m_ib_patches)
  • Add fix_file_briefs.py build-time script that auto-fixes @file @brief headers to match actual module/program declarations — catches renames, case issues, and missing headers automatically
  • Exclude strawberryperl.com from lychee (frequently times out)

Test plan

  • ./mfc.sh build -j 10 -t documentation succeeds
  • All module names on API landing pages are hyperlinked (including mixed-case m_bubbles_EE/EL/EL_kernels)
  • All file list descriptions populated — zero blank entries across simulation, pre_process, post_process
  • All "Contains module" descriptions are hyperlinked to the correct namespace page
  • "See Also" cross-links navigate to correct index.html pages
  • API nav link visible on landing page
  • SOURCE_BROWSER shows annotated source on module pages
  • fix_file_briefs.py is idempotent (0 changes on second run)
  • ./mfc.sh precheck passes (5/5)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added generated API landing pages for Pre‑Process, Simulation and Post‑Process with module indexes and navigation.
    • Updated simulation and data-output interfaces to support richer directional and auxiliary data.
  • Documentation

    • Improved Doxygen integration and enabled source browsing with warning logs.
    • Restructured many module pages into Modules and See Also sections; added cross‑references.
    • Appended “Page last updated” footers across documentation.
  • Chores

    • Integrated new pre/post documentation steps into the docs build flow.

CodeAnt-AI Description

Improve API documentation discoverability and source browsing

What Changed

  • Added an "API" link on the docs landing page and generated per-component API landing pages (pre_process, simulation, post_process) listing modules with working links
  • Auto-generate and fix Doxygen @file/@brief headers at build time (docs/gen_api_landing.py, docs/fix_file_briefs.py) so module names and mixed-case Fortran identifiers are linked correctly and file list pages show descriptions
  • Enabled Doxygen source browsing so users can click through to annotated source, and configured a Doxygen warnings logfile
  • Added or corrected many file-header and parameter docs across modules so documentation pages include complete, accurate descriptions and parameter names
  • Inserted "page last updated" footers on several documentation pages and excluded a flaky external host from link checks

Impact

✅ Clearer API navigation from the docs landing page
✅ Clickable, annotated source from module pages
✅ Complete and correctly linked module/file lists in API pages

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Add API nav link to landing page, cross-links in user guide sidebar,
auto-generated module listings for all three Doxygen targets, and
enable SOURCE_BROWSER for click-through to annotated source code.
The gen_api_landing.py script scans src/{target}/*.fpp at build time
to produce docs/{target}/readme.md with explicit @ref links that
handle Fortran case-insensitive namespaces correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2026

Warning

Rate limit exceeded

@sbryngelson has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 0 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

Adds two doc-generation Python steps (API landing pages and header fixes), wires them as CMake custom targets into the Doxygen build, enables DOXYGEN WARN_LOGFILE and SOURCE_BROWSER, updates site navigation and many Fortran source Doxygen headers, and makes multiple public subroutine signature changes across simulation and common modules.

Changes

Cohort / File(s) Summary
Build / Doxygen
CMakeLists.txt, docs/Doxyfile.in, .lychee.toml
Added gen_api_landing and fix_file_briefs custom targets and dependencies, set DOXYGEN_WARN_LOGFILE in GEN_DOCS, enabled SOURCE_BROWSER in Doxyfile, and added https://strawberryperl\.com to lychee exclude list.
Doc-gen scripts
docs/gen_api_landing.py, docs/fix_file_briefs.py
Added script to generate per-target API readmes and script to insert/fix @file/@brief headers in Fortran sources.
Site / pages
docs/index.html, docs/documentation/readme.md, docs/*/readme.md, docs/documentation/*
Added API nav item, updated readmes to Doxygen mainpage/Modules/See Also layout, and appended "Page last updated" footers across many docs pages.
Documentation headers (many files)
src/common/*, src/pre_process/*, src/simulation/*, src/post_process/*
Inserted/normalized Doxygen file/module header blocks and include directives in numerous Fortran source files.
API / signature changes
src/simulation/m_rhs.fpp, src/simulation/m_riemann_solvers.fpp, src/simulation/m_viscous.fpp, src/simulation/m_data_output.fpp, src/common/m_variables_conversion.fpp, src/simulation/m_bubbles*.fpp, src/simulation/m_ibm.fpp, src/simulation/m_sim_helpers.fpp, src/common/m_mpi_common.fpp, ...
Multiple public subroutine signatures and parameter lists changed (directional boundary arrays, expanded Riemann/viscous interfaces, added temperature/mixture args, parameter renames like pbpb_in, ghost_pointsghost_points_in, etc.). Review API/ABI impacts.
Minor doc-only edits
assorted source files listed in summary
Various docstring tweaks, parameter doc adds/removals, dummy-arg renames, and small formatting/typo fixes across many files.

Sequence Diagram(s)

sequenceDiagram
    participant CMake
    participant GenAPI as gen_api_landing.py
    participant FixBriefs as fix_file_briefs.py
    participant Doxygen
    participant HTML as DocsOut

    CMake->>GenAPI: run gen_api_landing (custom command)
    GenAPI-->>CMake: gen-api-landing.stamp
    CMake->>FixBriefs: run fix_file_briefs (custom command)
    FixBriefs-->>CMake: fix-file-briefs.stamp
    CMake->>Doxygen: invoke doxygen (deps satisfied)
    Doxygen->>HTML: generate HTML (SOURCE_BROWSER enabled, WARN_LOGFILE -> log)
    HTML-->>CMake: docs build complete
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

Review effort 3/5, size:L

Suggested reviewers

  • wilfonba

Poem

🐰 I hopped through headers, fixed each line,

Built landing pages for modules to shine.
Briefs stitched tidy, links set aright,
Docs now gather in cozy light.
📚🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Improve API documentation discoverability' clearly and concisely summarizes the main change—enhancing API documentation visibility through landing pages, navigation links, and automated doc generation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description check ✅ Passed The PR description is comprehensive and well-structured, covering all major changes with clear examples and motivation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

sbryngelson and others added 6 commits February 19, 2026 10:31
Add Doxygen @file/@brief blocks to 13 modules that were missing them
(m_body_forces, m_igr, m_muscl, m_sim_helpers, m_surface_tension,
m_finite_differences, m_mpi_common, m_nvtx, m_delay_file_access,
m_phase_change, m_check_ib_patches, m_check_patches, m_simplex_noise)
and fix 3 files with malformed comment openers (m_chemistry used !!>
instead of !>, m_data_output and m_helper_basic started with !!
continuation markers instead of !> openers). All file list pages now
show descriptions for every entry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use explicit @ref for mixed-case Fortran modules (m_bubbles_EE/EL/
EL_kernels) so Doxygen resolves the lowercase namespace. Correct
wrong module names in @file briefs: m_boundary_conditions_common ->
m_boundary_common, m_patches -> m_ib_patches / m_icpp_patches.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add docs/fix_file_briefs.py that reads the actual module/program name
from each Fortran source file and ensures the @file @brief matches,
using @ref for mixed-case identifiers. Runs before Doxygen via CMake
so new files, renames, and case issues are caught automatically.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sbryngelson sbryngelson marked this pull request as ready for review February 19, 2026 11:44
Copilot AI review requested due to automatic review settings February 19, 2026 11:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the discoverability and completeness of MFC's API documentation by adding navigation links, auto-generating landing pages, and ensuring all source files have proper Doxygen headers.

Changes:

  • Added API navigation link to the main landing page and cross-links in the user guide sidebar for easy navigation to Pre-Process, Simulation, and Post-Process API documentation
  • Implemented automated API landing page generation and @file/@brief header fixing via Python build scripts that run before Doxygen
  • Fixed 19 source files: added missing @file headers, corrected malformed Doxygen comment openers, updated stale module names, and added @ref syntax for mixed-case Fortran modules to ensure proper hyperlinking

Reviewed changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
docs/index.html Added API navigation link to 7-column grid on main landing page
docs/documentation/readme.md Added API cross-links in Development section for all three components
docs/simulation/readme.md Auto-generated API landing page with module list and cross-links
docs/pre_process/readme.md Auto-generated API landing page with module list and cross-links
docs/post_process/readme.md Auto-generated API landing page with module list and cross-links
docs/gen_api_landing.py Build script that scans source files and generates API landing pages
docs/fix_file_briefs.py Build script that auto-fixes @file/@brief headers to match actual module/program declarations
CMakeLists.txt Integrated both scripts as dependencies of Doxygen targets
docs/Doxyfile.in Enabled SOURCE_BROWSER to allow clickthrough to annotated source code
src/simulation/*.fpp (6 files) Added missing @file headers or fixed @brief to use @ref for mixed-case modules
src/pre_process/*.fpp (3 files) Added missing @file headers or corrected stale module names
src/common/*.fpp (7 files) Added missing @file headers or fixed malformed comment openers
.lychee.toml Excluded strawberryperl.com from link checking (frequently times out)

Comment on lines 49 to 52
"""Return sorted list of module names (m_*) from .fpp files."""
return sorted(
f.stem for f in directory.glob("m_*.fpp")
)
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The get_modules function only scans for .fpp files but misses .f90 files that contain modules. This excludes several modules from the generated API landing pages, including m_nvtx, m_compile_specific, m_delay_file_access from common/, m_grid from pre_process/, and m_data_input from post_process/. The function should use glob patterns for both *.fpp and *.f90 files, similar to how fix_file_briefs.py handles both file extensions on line 68.

Suggested change
"""Return sorted list of module names (m_*) from .fpp files."""
return sorted(
f.stem for f in directory.glob("m_*.fpp")
)
"""Return sorted list of module names (m_*) from .fpp and .f90 files."""
modules: set[str] = set()
for pattern in ("m_*.fpp", "m_*.f90"):
for f in directory.glob(pattern):
modules.add(f.stem)
return sorted(modules)

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 32 files

Confidence score: 4/5

  • Incremental builds can leave generated headers and API landing pages stale because custom commands in CMakeLists.txt depend only on the scripts, so edits to .fpp sources won’t retrigger those steps
  • Overall risk is low since this mainly affects freshness of generated artifacts rather than core runtime behavior
  • Pay close attention to CMakeLists.txt - ensure custom commands depend on the relevant .fpp sources so rebuilds trigger correctly.
Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="CMakeLists.txt">

<violation number="1" location="CMakeLists.txt:813">
P2: The API landing page generator won’t rerun when source .fpp files change because the custom command only depends on the script. That leaves docs/{target}/readme.md stale on incremental builds. Add the relevant source lists to the DEPENDS so changes to modules retrigger generation.</violation>

<violation number="2" location="CMakeLists.txt:829">
P2: The @file/@brief fixer won’t rerun when .fpp sources change because the custom command only depends on the script. That makes header fixes stale on incremental builds. Add source file dependencies so edits retrigger the tool.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/pre_process/m_check_ib_patches.fpp (1)

302-303: ⚠️ Potential issue | 🟡 Minor

Missed malformed Doxygen opener on s_check_inactive_ib_patch_geometry.

Line 302 uses !!> which Doxygen parses as a plain !! continuation marker followed by a literal > — not a block opener. The PR explicitly fixes the same class of defect elsewhere (m_chemistry.fpp, m_helper_basic.fpp) but this instance was missed, leaving s_check_inactive_ib_patch_geometry without a rendered documentation entry.

📝 Proposed fix
-!!>  This subroutine verifies that the geometric parameters of
+!>  This subroutine verifies that the geometric parameters of
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/pre_process/m_check_ib_patches.fpp` around lines 302 - 303, The Doxygen
opener for s_check_inactive_ib_patch_geometry is malformed: replace the leading
"!!>" token with the correct Doxygen block opener used elsewhere (use "!!<" as
the opener) so the subroutine docblock is recognized—update the comment header
for s_check_inactive_ib_patch_geometry to use "!!<" and match the style used in
m_chemistry.fpp/m_helper_basic.fpp (preserve the rest of the comment text and
spacing).
src/simulation/m_surface_tension.fpp (1)

39-39: ⚠️ Potential issue | 🟡 Minor

Pre-existing malformed Doxygen group-close marker: @) should be @}.

Line 39 uses !> @) to close the @{ group opened on line 37, but @) is not a valid Doxygen command. The correct closing tag is @}. The PR's goal explicitly includes fixing malformed Doxygen comment openers — this one appears to have been missed.

🐛 Proposed fix
-    !> @)
+    !> @}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/simulation/m_surface_tension.fpp` at line 39, Replace the malformed
Doxygen group-close marker "!> @)" with the correct "!> @}" in the Fortran
module comments so the "@{" group opened earlier is properly closed; locate the
comment line containing the exact token "!> @)" in m_surface_tension.fpp and
update it to "!> @}" (no other code changes required).
🧹 Nitpick comments (4)
docs/index.html (2)

175-175: sm:grid-cols-3 produces an orphaned row with 7 items.

At the sm breakpoint, 7 items fill 2 rows of 3 plus 1 lone item. Previously 6 items divided evenly. Consider sm:grid-cols-4 (gives 4+3) or justify-items-center on the grid wrapper.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/index.html` at line 175, The grid at the div with class "justify-center
grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-7 gap-x-4 md:gap-x-8 text-md
md:text-xl text-center text-white font-medium" creates an orphaned single item
at the sm breakpoint; update the class to either replace sm:grid-cols-3 with
sm:grid-cols-4 (so items lay out 4+3) or keep sm:grid-cols-3 and add
justify-items-center to the class list to center the lone item—apply the change
to that div's class attribute.

195-198: API nav points only to the Simulation target; Pre-Process and Post-Process require a second click.

Users visiting the landing page expecting e.g. the Pre-Process API must navigate to the Simulation landing, then follow the "See Also" cross-link. An optional improvement would be a dropdown or a dedicated API page that lists all three targets, but the current cross-link approach is acceptable for a first iteration.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/index.html` around lines 195 - 198, The "API" nav anchor (the <a>
element with href="simulation/index.html" and inner <span>API</span>) currently
points only to the Simulation landing; update navigation so the "API" link goes
to a dedicated API index that lists Pre-Process, Simulation, and Post-Process
(create a new api/index.html that contains links to each target), and change the
anchor's href from "simulation/index.html" to "api/index.html" (alternatively
implement a dropdown menu from that anchor that exposes the three targets).
Ensure the anchor text remains "API" so users land directly on a page listing
all three API targets.
docs/gen_api_landing.py (1)

71-71: Fragile section-heading derivation via split()[-1].

info['title'].split()[-1] picks the last word of the title. For the three current targets this works (Pre-Process, Simulation, Post-Process), but it breaks silently if a title is ever restructured (e.g., "MFC Pre Process Utility" would yield "Utility"). Consider using an explicit "section_title" key in the TARGETS dict.

♻️ Proposed fix
 TARGETS = {
     "pre_process": {
         "title": "MFC Pre-Process",
+        "section": "Pre-Process",
         ...
     },
     "simulation": {
         "title": "MFC Simulation",
+        "section": "Simulation",
         ...
     },
     "post_process": {
         "title": "MFC Post-Process",
+        "section": "Post-Process",
         ...
     },
 }

 # then:
-        lines.append(f"### {info['title'].split()[-1]}")
+        lines.append(f"### {info['section']}")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/gen_api_landing.py` at line 71, Replace the fragile title-splitting
logic that builds section headings from info['title'].split()[-1] with code that
first looks for an explicit 'section_title' key on the target metadata (i.e., in
the TARGETS dict / the info dict used here) and uses that if present; if no
'section_title' is provided, fall back to the existing split()[-1] behavior for
backward compatibility. Update the place that appends the heading (the
lines.append call in docs/gen_api_landing.py) to use info.get('section_title',
info['title'].split()[-1]) so maintainers can set explicit section names without
breaking existing titles.
CMakeLists.txt (1)

811-839: Stamp commands don't depend on .fpp source files — new modules won't trigger auto-regeneration.

Both gen-api-landing.stamp and fix-file-briefs.stamp list only their Python scripts in DEPENDS. Adding or renaming an .fpp module leaves the stamp newer than any tracked dependency, so CMake skips regeneration silently. The landing pages and file briefs stay stale until the stamp is manually deleted.

Add the globbed .fpp lists as additional DEPENDS so any source-file change invalidates the stamp:

♻️ Proposed fix
+    file(GLOB_RECURSE api_fpp_srcs CONFIGURE_DEPENDS
+        "${CMAKE_CURRENT_SOURCE_DIR}/src/pre_process/*.fpp"
+        "${CMAKE_CURRENT_SOURCE_DIR}/src/simulation/*.fpp"
+        "${CMAKE_CURRENT_SOURCE_DIR}/src/post_process/*.fpp"
+        "${CMAKE_CURRENT_SOURCE_DIR}/src/common/*.fpp")
+
     add_custom_command(
         OUTPUT  "${CMAKE_CURRENT_BINARY_DIR}/gen-api-landing.stamp"
         DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/docs/gen_api_landing.py"
+                ${api_fpp_srcs}
         COMMAND "${Python3_EXECUTABLE}" ...

Apply the same ${api_fpp_srcs} addition to the fix-file-briefs command.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CMakeLists.txt` around lines 811 - 839, The stamp targets
gen-api-landing.stamp and fix-file-briefs.stamp only depend on their Python
scripts so adding/renaming .fpp modules won't retrigger them; update the
add_custom_command DEPENDS for the gen_api_landing and fix_file_briefs commands
to include the globbed Fortran source list (e.g. ${api_fpp_srcs} or the
appropriate .fpp glob variable you use in this CMakeLists) so any .fpp change
invalidates the stamp, and apply the identical change to the fix-file-briefs
command to ensure both stamps regenerate when .fpp sources change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/fix_file_briefs.py`:
- Line 80: The code uses Path.write_text without specifying encoding (calls to
f.write_text(text) and f.write_text(new_text)), which may re-encode Fortran
source files with the platform default; update both occurrences in
docs/fix_file_briefs.py to call write_text with an explicit encoding (e.g.,
encoding='utf-8') so files are written with a stable encoding rather than the
platform default.
- Line 41: Add "from __future__ import annotations" at the top of the module so
annotations like the return type of find_entity (tuple[str, str] | None) are
evaluated lazily and remain compatible with Python 3.7–3.9, and update the two
write_text(...) calls (the ones modifying Fortran source) to pass
encoding='utf-8' to ensure explicit round-trip encoding when writing files.

In `@docs/gen_api_landing.py`:
- Line 91: The call to out.write_text("\n".join(lines)) uses the platform
default encoding; update the Path.write_text invocation (out.write_text) to pass
encoding='utf-8' so the file is written deterministically across platforms
(i.e., out.write_text("\n".join(lines), encoding="utf-8")). Ensure the joined
content is a str before writing to avoid encoding issues.
- Around line 48-52: The function get_modules uses PEP 585 typing (list[str])
which breaks on Python 3.8; add the line "from __future__ import annotations" at
the top of the file (before any other imports) to enable postponed evaluation of
annotations so get_modules and any other annotations using built-in generics
work on Python 3.8–3.9 environments.

In `@docs/simulation/readme.md`:
- Around line 41-54: gen_api_landing.py currently only scans *.fpp files and
omits four public .f90 modules; update the scanner logic in gen_api_landing.py
to include .f90 files (or explicitly include m_precision_select.f90,
m_compile_specific.f90, m_delay_file_access.f90, m_nvtx.f90) when collecting
modules for the API landing page, ensure the parser/regex that detects Doxygen
headers and module names handles .f90 syntax, and add tests or a small fixture
to confirm m_precision_select, m_compile_specific, m_delay_file_access, and
m_nvtx appear in the generated landing pages.

---

Outside diff comments:
In `@src/pre_process/m_check_ib_patches.fpp`:
- Around line 302-303: The Doxygen opener for s_check_inactive_ib_patch_geometry
is malformed: replace the leading "!!>" token with the correct Doxygen block
opener used elsewhere (use "!!<" as the opener) so the subroutine docblock is
recognized—update the comment header for s_check_inactive_ib_patch_geometry to
use "!!<" and match the style used in m_chemistry.fpp/m_helper_basic.fpp
(preserve the rest of the comment text and spacing).

In `@src/simulation/m_surface_tension.fpp`:
- Line 39: Replace the malformed Doxygen group-close marker "!> @)" with the
correct "!> @}" in the Fortran module comments so the "@{" group opened earlier
is properly closed; locate the comment line containing the exact token "!> @)"
in m_surface_tension.fpp and update it to "!> @}" (no other code changes
required).

---

Nitpick comments:
In `@CMakeLists.txt`:
- Around line 811-839: The stamp targets gen-api-landing.stamp and
fix-file-briefs.stamp only depend on their Python scripts so adding/renaming
.fpp modules won't retrigger them; update the add_custom_command DEPENDS for the
gen_api_landing and fix_file_briefs commands to include the globbed Fortran
source list (e.g. ${api_fpp_srcs} or the appropriate .fpp glob variable you use
in this CMakeLists) so any .fpp change invalidates the stamp, and apply the
identical change to the fix-file-briefs command to ensure both stamps regenerate
when .fpp sources change.

In `@docs/gen_api_landing.py`:
- Line 71: Replace the fragile title-splitting logic that builds section
headings from info['title'].split()[-1] with code that first looks for an
explicit 'section_title' key on the target metadata (i.e., in the TARGETS dict /
the info dict used here) and uses that if present; if no 'section_title' is
provided, fall back to the existing split()[-1] behavior for backward
compatibility. Update the place that appends the heading (the lines.append call
in docs/gen_api_landing.py) to use info.get('section_title',
info['title'].split()[-1]) so maintainers can set explicit section names without
breaking existing titles.

In `@docs/index.html`:
- Line 175: The grid at the div with class "justify-center grid grid-cols-2
sm:grid-cols-3 lg:grid-cols-7 gap-x-4 md:gap-x-8 text-md md:text-xl text-center
text-white font-medium" creates an orphaned single item at the sm breakpoint;
update the class to either replace sm:grid-cols-3 with sm:grid-cols-4 (so items
lay out 4+3) or keep sm:grid-cols-3 and add justify-items-center to the class
list to center the lone item—apply the change to that div's class attribute.
- Around line 195-198: The "API" nav anchor (the <a> element with
href="simulation/index.html" and inner <span>API</span>) currently points only
to the Simulation landing; update navigation so the "API" link goes to a
dedicated API index that lists Pre-Process, Simulation, and Post-Process (create
a new api/index.html that contains links to each target), and change the
anchor's href from "simulation/index.html" to "api/index.html" (alternatively
implement a dropdown menu from that anchor that exposes the three targets).
Ensure the anchor text remains "API" so users land directly on a page listing
all three API targets.

- Add DOXYGEN_WARN_LOGFILE to CMakeLists.txt and Doxyfile.in to capture
  per-target warning logs during documentation builds
- Fix stale, missing, duplicate, and misspelled @param entries across 28
  source files (common, pre_process, post_process, simulation modules)
- Common module fixes (m_helper, m_model, m_mpi_common, m_phase_change,
  m_finite_differences) eliminate 3x warnings since each is shared across
  all three Doxygen targets
- Remaining 5 warnings are structural unbalanced grouping from
  fypp macro expansion, not @param issues

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codeant-ai
Copy link
Contributor

codeant-ai bot commented Feb 19, 2026

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@codeant-ai codeant-ai bot added the size:XL This PR changes 500-999 lines, ignoring generated files label Feb 19, 2026
@codeant-ai
Copy link
Contributor

codeant-ai bot commented Feb 19, 2026

Nitpicks 🔍

🔒 No security issues identified
⚡ Recommended areas for review

  • Incomplete Doxygen params
    The updated Doxygen header for s_ibm_correct_state documents pb_in/mv_in but no longer documents the primary arguments q_cons_vf and q_prim_vf (they were removed earlier). This produces incomplete API docs and may confuse users or doc-generation tooling. Ensure all parameters (including large/important ones) are documented consistently.

  • Optional argument usage
    The new q_T_sf parameter was added to
    s_convert_conservative_to_primitive_variables but is only used when
    chemistry is true. If callers are not consistently updated to pass
    that argument, or if some call sites don't need temperature, this
    change can break call sites. Consider making the dummy argument
    optional and guarding uses with present() or ensure all call sites
    were updated. Also audit other newly-added optional parameters such
    as Re_K, G_K, and G for consistent present() checks.

  • Shared module state / GPU bounds
    The subroutine s_convert_primitive_to_flux_variables now copies the
    incoming is1/is2/is3 bounds into module-scoped variables
    (is1b/is2b/...) and calls $:GPU_UPDATE. Using module-scoped
    variables for bounds risks unintended side-effects or races if called
    concurrently or from different contexts. Prefer using local temporaries
    for bounds inside the routine and pass them to GPU pragmas/loops to
    avoid global mutable state.

  • Brief-line regex fragility
    BRIEF_CONTAINS_RE anchors to the start of a line expecting exactly '!!' or '!>' and then @brief. It won't match lines with leading whitespace or other comment markers, and the pattern doesn't anchor to end-of-line, which may cause incorrect replacements. Also the replacement logic replaces m.span() without preserving trailing newline or whitespace on the matched line.

  • Missing directory creation
    The script writes docs/{target}/readme.md but does not ensure the parent directory exists. If docs/{target} is missing, out.write_text(...) will raise an exception and generation will fail. Consider creating the parent dir (with parents=True) before writing.

# Scans src/{target}/*.fpp to produce module lists in docs/{target}/readme.md.
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/gen-api-landing.stamp"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/docs/gen_api_landing.py"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Extend the gen_api_landing custom command dependencies to also include the Fortran template sources it scans, so API landing pages regenerate when those .fpp files change. [custom_rule]

Severity Level: Minor ⚠️

Suggested change
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/docs/gen_api_landing.py"
${pre_process_FPPs}
${simulation_FPPs}
${post_process_FPPs}
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** CMakeLists.txt
**Line:** 815:815
**Comment:**
	*Custom Rule: Extend the `gen_api_landing` custom command dependencies to also include the Fortran template sources it scans, so API landing pages regenerate when those `.fpp` files change.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
👍 | 👎

add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/fix-file-briefs.stamp"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/docs/fix_file_briefs.py"
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/docs/fix_file_briefs.py"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Extend the fix_file_briefs custom command dependencies to include the Fortran template sources whose module and program declarations it inspects, so header fixes rerun when those sources change. [custom_rule]

Severity Level: Minor ⚠️

Suggested change
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/docs/fix_file_briefs.py"
${pre_process_FPPs}
${simulation_FPPs}
${post_process_FPPs}
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** CMakeLists.txt
**Line:** 832:832
**Comment:**
	*Custom Rule: Extend the `fix_file_briefs` custom command dependencies to include the Fortran template sources whose module and program declarations it inspects, so header fixes rerun when those sources change.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
👍 | 👎

- @ref authors "Authors" - Contributors


<div style='text-align:center; font-size:0.75rem; color:#888; padding:16px 0 0;'>Page last updated: 2026-02-19</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Replace the hard-coded "last updated" date in the footer with wording that does not require manual date maintenance. [custom_rule]

Severity Level: Minor ⚠️

Suggested change
<div style='text-align:center; font-size:0.75rem; color:#888; padding:16px 0 0;'>Page last updated: 2026-02-19</div>
<div style='text-align:center; font-size:0.75rem; color:#888; padding:16px 0 0;'>See the repository history for the latest updates to this page.</div>
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** docs/documentation/readme.md
**Line:** 46:46
**Comment:**
	*Custom Rule: Replace the hard-coded "last updated" date in the footer with wording that does not require manual date maintenance.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
👍 | 👎


# First `module X` or `program X` that isn't `end module/program`.
DECL_RE = re.compile(
r"^\s*(module|program)\s+(\w+)\s*$", re.MULTILINE | re.IGNORECASE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Refine the declaration regex so it does not treat module procedure lines or similar constructs as top-level modules. [custom_rule]

Severity Level: Minor ⚠️

Suggested change
r"^\s*(module|program)\s+(\w+)\s*$", re.MULTILINE | re.IGNORECASE
r"^\s*(module(?!\s+procedure)\b|program)\s+(\w+)\s*$",
re.MULTILINE | re.IGNORECASE,
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** docs/fix_file_briefs.py
**Line:** 30:30
**Comment:**
	*Custom Rule: Refine the declaration regex so it does not treat `module procedure` lines or similar constructs as top-level modules.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
👍 | 👎

Comment on lines 69 to 99
text = f.read_text()
entity = find_entity(text)
if entity is None:
continue
kind, name = entity
ref = make_ref(name)

if not has_file_directive(text):
# No @file at all — prepend a complete header.
header = f"!>\n!! @file\n!! @brief Contains {kind} {ref}\n\n"
text = header + text
f.write_text(text)
fixed += 1
print(f"Added {f.relative_to(src_dir)}")
continue

# Has @file — check if there's a "Contains module/program" brief to fix.
m = BRIEF_CONTAINS_RE.search(text)
if m is None:
continue # Has @file but no "Contains ..." brief — leave it alone

current_name = m.group(3).strip()
if current_name == ref:
continue # Already correct

# Replace the name portion of the brief line.
new_line = f"{m.group(1)} @brief {m.group(2)}{ref}"
new_text = text[: m.start()] + new_line + text[m.end() :]

if new_text != text:
f.write_text(new_text)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Read and write Fortran sources using an explicit UTF-8 encoding to avoid locale-dependent behavior on different systems. [custom_rule]

Severity Level: Minor ⚠️

Suggested change
text = f.read_text()
entity = find_entity(text)
if entity is None:
continue
kind, name = entity
ref = make_ref(name)
if not has_file_directive(text):
# No @file at all — prepend a complete header.
header = f"!>\n!! @file\n!! @brief Contains {kind} {ref}\n\n"
text = header + text
f.write_text(text)
fixed += 1
print(f"Added {f.relative_to(src_dir)}")
continue
# Has @file — check if there's a "Contains module/program" brief to fix.
m = BRIEF_CONTAINS_RE.search(text)
if m is None:
continue # Has @file but no "Contains ..." brief — leave it alone
current_name = m.group(3).strip()
if current_name == ref:
continue # Already correct
# Replace the name portion of the brief line.
new_line = f"{m.group(1)} @brief {m.group(2)}{ref}"
new_text = text[: m.start()] + new_line + text[m.end() :]
if new_text != text:
f.write_text(new_text)
text = f.read_text(encoding="utf-8")
entity = find_entity(text)
if entity is None:
continue
kind, name = entity
ref = make_ref(name)
if not has_file_directive(text):
# No @file at all — prepend a complete header.
header = f"!>\n!! @file\n!! @brief Contains {kind} {ref}\n\n"
text = header + text
f.write_text(text, encoding="utf-8")
fixed += 1
print(f"Added {f.relative_to(src_dir)}")
continue
# Has @file — check if there's a "Contains module/program" brief to fix.
m = BRIEF_CONTAINS_RE.search(text)
if m is None:
continue # Has @file but no "Contains ..." brief — leave it alone
current_name = m.group(3).strip()
if current_name == ref:
continue # Already correct
# Replace the name portion of the brief line.
new_line = f"{m.group(1)} @brief {m.group(2)}{ref}"
new_text = text[: m.start()] + new_line + text[m.end() :]
if new_text != text:
f.write_text(new_text, encoding="utf-8")
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** docs/fix_file_briefs.py
**Line:** 69:99
**Comment:**
	*Custom Rule: Read and write Fortran sources using an explicit UTF-8 encoding to avoid locale-dependent behavior on different systems.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
👍 | 👎

!>
!! @file
!! @brief Contains module m_bubbles_EL_kernels
!! @brief Contains module @ref m_bubbles_el_kernels "m_bubbles_EL_kernels"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Update the module reference in the brief tag so it exactly matches the declared module name, ensuring documentation tools can resolve the link correctly. [custom_rule]

Severity Level: Minor ⚠️

Suggested change
!! @brief Contains module @ref m_bubbles_el_kernels "m_bubbles_EL_kernels"
!! @brief Contains module @ref m_bubbles_EL_kernels "m_bubbles_EL_kernels"
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** src/simulation/m_bubbles_EL_kernels.fpp
**Line:** 3:3
**Comment:**
	*Custom Rule: Update the module reference in the brief tag so it exactly matches the declared module name, ensuring documentation tools can resolve the link correctly.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
👍 | 👎

!! @param q_prim_vf Primitive variables
!! @param pb Internal bubble pressure
!! @param mv Mass of vapor in bubble
!! @param pb_in Internal bubble pressure
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Add back parameter documentation lines for q_cons_vf and q_prim_vf so that all arguments of the subroutine are described alongside the new pb_in and mv_in docs. [custom_rule]

Severity Level: Minor ⚠️

Suggested change
!! @param pb_in Internal bubble pressure
!! @param q_cons_vf Conservative variables
!! @param q_prim_vf Primitive variables
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** src/simulation/m_ibm.fpp
**Line:** 159:159
**Comment:**
	*Custom Rule: Add back parameter documentation lines for `q_cons_vf` and `q_prim_vf` so that all arguments of the subroutine are described alongside the new `pb_in` and `mv_in` docs.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
👍 | 👎


!> Function that uses the interpolation coefficients and the current state
!! at the cell centers in order to estimate the state at the image point
!! @param gp Ghost point data structure
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Add a parameter documentation line for q_prim_vf so the first argument of the image-point interpolation routine is also described. [custom_rule]

Severity Level: Minor ⚠️

Suggested change
!! @param gp Ghost point data structure
!! @param q_prim_vf Primitive variables at cell centers
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** src/simulation/m_ibm.fpp
**Line:** 854:854
**Comment:**
	*Custom Rule: Add a parameter documentation line for `q_prim_vf` so the first argument of the image-point interpolation routine is also described.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
👍 | 👎


!> Computes the moment of inertia for an immersed boundary
!! @param ib_marker Immersed boundary marker index
subroutine s_compute_moment_of_inertia(ib_marker, axis)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Add a parameter documentation line for axis so both arguments of the moment-of-inertia routine are described. [custom_rule]

Severity Level: Minor ⚠️

Suggested change
subroutine s_compute_moment_of_inertia(ib_marker, axis)
!! @param axis Rotation axis vector about which the moment is computed
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** src/simulation/m_ibm.fpp
**Line:** 1265:1265
**Comment:**
	*Custom Rule: Add a parameter documentation line for `axis` so both arguments of the moment-of-inertia routine are described.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
👍 | 👎

@codeant-ai
Copy link
Contributor

codeant-ai bot commented Feb 19, 2026

CodeAnt AI finished reviewing your PR.

- m_surface_tension.fpp: typo @) -> @} (close group)
- m_global_parameters.fpp (sim): copy-paste @{ -> @} (close group)
- m_global_parameters.fpp (post): typo #} -> @} (close group)
- m_rhs.fpp: add missing @} closer for index bounds group
- m_compute_levelset.fpp: remove orphaned @} with no matching opener

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/simulation/m_bubbles.fpp (1)

318-327: ⚠️ Potential issue | 🟡 Minor

s_bwproperty docstring is missing @param entries for its three output parameters.

The intent(out) parameters chi_vw_out, k_mw_out, and rho_mw_out (lines 325–327) have no corresponding @param lines in the Doxygen block, yet their inline comments are already present. Given that this PR focuses on documentation completeness, these should be added.

📝 Proposed addition
 !>  Subroutine that computes bubble wall properties for vapor bubbles
     !!  `@param` pb_in Internal bubble pressure
     !!  `@param` iR0 Current bubble size index
+    !!  `@param` chi_vw_out Mass fraction of vapour at the bubble wall (Ando 2010)
+    !!  `@param` k_mw_out Thermal conductivity of the gas mixture at the bubble wall (Ando 2010)
+    !!  `@param` rho_mw_out Density of the gas mixture at the bubble wall (Ando 2010)
 elemental subroutine s_bwproperty(pb_in, iR0, chi_vw_out, k_mw_out, rho_mw_out)

Based on learnings: "Add Doxygen docstrings in source files for new public routines" — applied here to the output parameters of an existing routine being actively edited in this PR.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/simulation/m_bubbles.fpp` around lines 318 - 327, The Doxygen block for
subroutine s_bwproperty is missing `@param` entries for the three output
arguments; add `@param` lines documenting chi_vw_out, k_mw_out, and rho_mw_out
(including brief descriptions matching their inline comments such as "Bubble
wall properties (Ando 2010)") to the existing docstring above elemental
subroutine s_bwproperty so all intent(out) parameters are documented.
🧹 Nitpick comments (7)
src/simulation/m_time_steppers.fpp (1)

767-779: Missing @param ldt in the Doxygen block for s_apply_bodyforces.

Three of the four parameters are now documented via @param, but ldt is absent from the block comment. It only has a terse inline !< local dt annotation (Line 778). Since the explicit goal of this PR is complete API documentation for these routines, the block is incomplete.

📝 Proposed fix
 !> This subroutine applies the body forces source term at each
     !! Runge-Kutta stage
     !! `@param` q_cons_vf Conservative variables
     !! `@param` q_prim_vf_in Primitive variables
     !! `@param` rhs_vf_in Right-hand side variables
+    !! `@param` ldt Local time-step size (scaled RK coefficient * dt)
 subroutine s_apply_bodyforces(q_cons_vf, q_prim_vf_in, rhs_vf_in, ldt)

Based on learnings: "Add Doxygen docstrings in source files for new public routines."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/simulation/m_time_steppers.fpp` around lines 767 - 779, The Doxygen block
for subroutine s_apply_bodyforces is missing documentation for the ldt
parameter; update the routine's header comment to include an `@param` ldt
description (e.g., "@param ldt local time step") so all four parameters
(q_cons_vf, q_prim_vf_in, rhs_vf_in, ldt) are documented consistently with the
existing `@param` entries and the inline "!< local dt" annotation can remain or be
removed as desired.
src/post_process/m_data_input.f90 (1)

146-148: @param t_step description should indicate the argument is optional.

t_step is declared integer, intent(in), optional (line 152), but the new @param line simply says "Time step index". Readers of the generated API docs won't know it can be omitted, nor under what condition it is required (i.e., when parallel_io is .true.). A more accurate description prevents misuse.

📝 Suggested doc fix
-!!  `@param` t_step Time step index
+!!  `@param` t_step (Optional) Time step index; required when parallel_io is .true.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/post_process/m_data_input.f90` around lines 146 - 148, Update the `@param`
documentation for the argument t_step in the helper subroutine that reads IB
data files to state that t_step is optional (matches the declaration integer,
intent(in), optional) and clarify its requirement: explicitly note that t_step
may be omitted unless parallel_io is .true;, in which case a time step index
must be provided; reference the t_step parameter and the parallel_io flag in the
description so generated API docs and readers understand when the argument is
required.
src/simulation/m_hyperelastic.fpp (1)

217-228: Stale description body in both solver subroutines — describes s_hyperelastic_rmt_stress_update, not the Cauchy solvers

The boilerplate lines retained in both solver comment blocks:

!! calculate the grad_xi, grad_xi is a nxn tensor
!! calculate the inverse of grad_xi to obtain F, F is a nxn tensor
!! calculate the FFtranspose to obtain the btensor, btensor is nxn tensor
!! btensor is symmetric, save the data space

describe the deformation-gradient / btensor computation pipeline that lives in s_hyperelastic_rmt_stress_update. These solvers receive an already-computed btensor_in and compute Cauchy stresses from it — they do none of the grad_xi / inverse / F·F^T work. Since this PR is explicitly improving API documentation, replacing these lines with a brief, accurate description of what each solver actually does (compute deviatoric btensor and update stress primitive fields via neo-Hookean / Mooney-Rivlin EOS) would prevent generated API docs from describing the wrong algorithm.

Also applies to: 260-271

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/simulation/m_hyperelastic.fpp` around lines 217 - 228, The comment block
incorrectly describes deformation-gradient and btensor construction (grad_xi,
inverse, F·F^T) which is done in s_hyperelastic_rmt_stress_update; update the
doc for the solver subroutines (referencing btensor_in, q_prim_vf, G_param and
the solver names) to state that these routines accept a precomputed btensor_in,
compute the deviatoric part of btensor and then compute/update the Cauchy stress
/ primitive stress fields using the appropriate constitutive law (neo-Hookean or
Mooney-Rivlin), explicitly noting they do not compute grad_xi or F.
CMakeLists.txt (1)

813-822: Add the globbed .fpp file lists as dependencies so the landing pages rebuild when modules change.

The script reads src/{target}/*.fpp and src/common/*.fpp to generate module documentation, but these files are not declared as dependencies. Adding the already-globbed lists will ensure the build re-runs when you add, remove, or rename a module.

Proposed fix
     add_custom_command(
         OUTPUT  "${CMAKE_CURRENT_BINARY_DIR}/gen-api-landing.stamp"
         DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/docs/gen_api_landing.py"
+                "${pre_process_FPPs}" "${simulation_FPPs}" "${post_process_FPPs}"
         COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/docs/gen_api_landing.py"
                 "${CMAKE_CURRENT_SOURCE_DIR}"
         COMMAND "${CMAKE_COMMAND}" -E touch "${CMAKE_CURRENT_BINARY_DIR}/gen-api-landing.stamp"
         COMMENT "Generating API landing pages"
         VERBATIM
     )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CMakeLists.txt` around lines 813 - 822, The add_custom_command that produces
"${CMAKE_CURRENT_BINARY_DIR}/gen-api-landing.stamp" must include the globbed
.fpp inputs so changes to modules trigger reruns; update the add_custom_command
DEPENDS to include the previously-globbed lists used for src/{target}/*.fpp and
src/common/*.fpp (the same variables or file(GLOB ...) expressions used
elsewhere), ensuring the script
"${CMAKE_CURRENT_SOURCE_DIR}/docs/gen_api_landing.py" and its generated stamp
target (gen_api_landing / gen-api-landing.stamp) also depend on those .fpp files
so CMake will rebuild when .fpp files are added/removed/renamed.
src/simulation/m_sim_helpers.fpp (1)

96-96: Inconsistent capitalization in new @param descriptions.

All three new @param entries (lines 96, 172, 239) capitalize the first word of the description ("Vapor quality", "Density", "Speed of sound"), while every pre-existing @param in this file uses lowercase ("directional velocities", "mixture pressure", "cell centered maximum dt", etc.). For consistency:

📝 Proposed capitalization fix
-        !! `@param` qv Vapor quality
+        !! `@param` qv vapor quality (or preferred: mixture reference internal energy)
-        !! `@param` rho Density
+        !! `@param` rho density
-        !! `@param` c Speed of sound
+        !! `@param` c speed of sound

Also applies to: 172-172, 239-239

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/simulation/m_sim_helpers.fpp` at line 96, The three newly added `@param`
descriptions use capitalized first words; update them to match the file's
existing style by lowercasing the first word for each parameter: change the
`@param` for qv from "Vapor quality" to "vapor quality", the `@param` for rho from
"Density" to "density", and the `@param` for cs (or the parameter documenting
speed of sound) from "Speed of sound" to "speed of sound" so the docblock
capitalization is consistent with other `@param` entries.
src/simulation/m_viscous.fpp (1)

554-562: s_get_viscous now has 21 parameters — consider a derived-type bundle.

The signature grew to 21 arguments (3 left rsx/rsy/rsz arrays, 3 left derivative arrays, 1 qL_prim, and 7 right-side mirrors, plus q_prim_qp, 3 dq_prim derivatives, and ix/iy/iz). The project guideline caps routines at 6 arguments and recommends a derived-type params struct beyond that.

Grouping the left/right boundary and derivative fields into a small bundle type (e.g., boundary_prim_data) would halve the argument list and make future directional expansions local to the type definition.

Based on learnings, the project guideline states: "Prefer ≤ 6 subroutine arguments; consider a derived-type params struct for more."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/simulation/m_viscous.fpp` around lines 554 - 562, s_get_viscous currently
takes 21 arguments which exceeds the project guideline; refactor by creating one
or more derived types (e.g., boundary_prim_data for rsx/rsy/rsz and their
derivatives, and maybe qprim_point for q_prim_qp and dq_prim_* ) and replace the
long parameter list with a few typed bundles passed to s_get_viscous (and
updated callers). Update the subroutine signature (s_get_viscous) to accept
these derived-type objects plus ix, iy, iz, move related declarations into the
types, and adjust all call sites to construct and pass the new bundles instead
of the individual arrays.
src/simulation/m_bubbles_EL.fpp (1)

845-846: @param preterm1 description "Pre-computed term 1" is slightly misleading.

preterm1 and term2 are both intent(out), optional — they are computed inside s_get_pinf and returned to the caller. "Pre-computed" implies the caller provides a pre-computed value (like an intent(in) argument), which inverts the data-flow direction.

💡 Suggested wording
-        !! `@param` preterm1 Pre-computed term 1
-        !! `@param` term2 Computed term 2
+        !! `@param` preterm1 Output coefficient: prefactor for the pressure-correction term (3/2 * Rbeq * (dc²-Rbeq²) / (aux * denom))
+        !! `@param` term2 Output correction: velocity-weighted radial term for the subgrid pressure model
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/simulation/m_bubbles_EL.fpp` around lines 845 - 846, The documentation
for s_get_pinf incorrectly labels preterm1 as "Pre-computed term 1" and thus
implies caller-provided input; update the comment for parameters preterm1 and
term2 to reflect that both are intent(out), optional values computed inside
s_get_pinf and returned to the caller (e.g., "Computed term 1 (output, optional)
returned by s_get_pinf"); ensure the description matches the intent(out)
semantics for preterm1 and term2.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CMakeLists.txt`:
- Around line 829-838: The custom CMake commands (add_custom_command for the
fix_file_briefs target and the gen_api_landing block) only depend on the Python
script and therefore won't re-run when FPP source files change; update the
DEPENDS lists of add_custom_command (the one creating fix-file-briefs.stamp) and
the gen_api_landing add_custom_command to include the FPP source file variables
"${pre_process_FPPs}", "${simulation_FPPs}", and "${post_process_FPPs}" so
edits/renames in .fpp/.f90 trigger the script and regenerate the stamp/target.

In `@docs/documentation/visualization.md`:
- Line 145: Replace the hardcoded footer div that contains "Page last updated:
2026-02-13" with a build-time injected value: locate the HTML snippet "<div
style='text-align:center; font-size:0.75rem; color:`#888`; padding:16px 0 0;'>Page
last updated:" and change it to use your static-site templating variable or
plugin (e.g., MkDocs/Sphinx git-revision-date variable or a git-based per-file
date like `git log -1 --format=%ci -- <file>`) so the date is generated at build
time for each page rather than hardcoded; ensure the templating syntax you use
is compatible with the site generator in use and update any other occurrences of
the same footer across the docs to the same templated approach.

In `@src/common/m_variables_conversion.fpp`:
- Around line 1182-1183: The parameters s2b and s3b are documented but unused:
either remove them (and their docs) from the subroutine signature and related
documentation, or wire them into the loop bounds by replacing the hardcoded
assignments is2b = is2%beg and is3b = is3%beg with is2b = s2b and is3b = s3b so
the routine honors the provided starting boundary indices; update any call sites
if you remove parameters and ensure consistency in the subroutine (variables:
s2b, s3b, is2b, is3b, is2%beg, is3%beg).

In `@src/simulation/m_bubbles_EE.fpp`:
- Around line 95-97: Add a `@param` entry for divu_in to the Doxygen docblock for
s_compute_bubbles_EE_rhs so the third parameter is documented (the inline `!<`
comment at line 102 is not picked up by Doxygen); update the comment block that
currently lists `@param` idir and `@param` q_prim_vf to include `@param divu_in`
with a short description of what divu_in represents (e.g., divergence of
velocity) so the generated parameter table is complete.
- Line 162: The function s_compute_bubble_EE_source has a missing `@param` entry
for the fourth parameter divu_in in its Doxygen block (you added `@param` rhs_vf
but left divu_in only as an inline !<), so update the docstring for
s_compute_bubble_EE_source to include a proper "@param divu_in" line in the
block header with a short description of what divu_in represents/contains;
ensure this matches the existing style used for "@param rhs_vf" so Doxygen will
include it in the generated parameter table.

In `@src/simulation/m_bubbles.fpp`:
- Around line 319-321: The Doxygen block for elemental subroutine s_bwproperty
is missing `@param` entries for its output arguments; update the docstring for
s_bwproperty to include the three output parameters chi_vw_out, k_mw_out, and
rho_mw_out with brief descriptions (e.g., "Bubble wall properties (Ando 2010)"),
matching the style used for other routines like f_rddot so all parameters are
documented in the `@param` block.

In `@src/simulation/m_hyperelastic.fpp`:
- Around line 219-224: Update the parameter documentation to reflect mutation:
change the `@param` entries for btensor_in and q_prim_vf to include the direction
qualifier [in,out] in the docblocks for both s_neoHookean_cauchy_solver and
s_Mooney_Rivlin_cauchy_solver (and the duplicate docblock at lines referenced
around 262–267), since btensor_in and q_prim_vf are declared intent(inout) and
are modified in-place (diagonal overwritten and stress/invariants written);
ensure the two `@param` lines read e.g. "@param btensor_in [in,out] Left
Cauchy-Green deformation tensor" and "@param q_prim_vf [in,out] Primitive
variables" so callers and readers see the correct contract.

In `@src/simulation/m_ibm.fpp`:
- Around line 852-869: The docblock for subroutine s_interpolate_image_point is
missing a `@param` entry for the first argument q_prim_vf; update the comment
header to add a concise `@param` description for q_prim_vf matching its
declaration (type(scalar_field), dimension(sys_size), intent(IN)) and purpose
(e.g., primary field values at cell centers used for interpolation), placing it
alongside the existing `@param` entries so the parameter list is complete and
consistent with the subroutine signature.
- Around line 1263-1265: The docblock for subroutine s_compute_moment_of_inertia
is missing a `@param` entry for the second argument axis and the axis
normalization is wrong; update the comment to include "@param axis the axis
about which we compute the moment (only required in 3D)" and change the
normalization logic for normal_axis in s_compute_moment_of_inertia to divide by
sqrt(sum(axis**2)) (keeping the existing guard that checks sum(axis**2) > 0) so
the axis is normalized by its Euclidean norm rather than sqrt(sum(axis)).

In `@src/simulation/m_sim_helpers.fpp`:
- Line 96: Update the doc comment for the parameter qv in the m_sim_helpers.fpp
comment block: replace the description "Vapor quality" with "Fluid reference
energy" so it matches the terminology used across the codebase (e.g.,
m_variables_conversion, m_time_steppers, m_data_output, m_cbc) and correctly
reflects that qv is the equation-of-state reference internal energy term used in
the E and pres expressions.

---

Outside diff comments:
In `@src/simulation/m_bubbles.fpp`:
- Around line 318-327: The Doxygen block for subroutine s_bwproperty is missing
`@param` entries for the three output arguments; add `@param` lines documenting
chi_vw_out, k_mw_out, and rho_mw_out (including brief descriptions matching
their inline comments such as "Bubble wall properties (Ando 2010)") to the
existing docstring above elemental subroutine s_bwproperty so all intent(out)
parameters are documented.

---

Nitpick comments:
In `@CMakeLists.txt`:
- Around line 813-822: The add_custom_command that produces
"${CMAKE_CURRENT_BINARY_DIR}/gen-api-landing.stamp" must include the globbed
.fpp inputs so changes to modules trigger reruns; update the add_custom_command
DEPENDS to include the previously-globbed lists used for src/{target}/*.fpp and
src/common/*.fpp (the same variables or file(GLOB ...) expressions used
elsewhere), ensuring the script
"${CMAKE_CURRENT_SOURCE_DIR}/docs/gen_api_landing.py" and its generated stamp
target (gen_api_landing / gen-api-landing.stamp) also depend on those .fpp files
so CMake will rebuild when .fpp files are added/removed/renamed.

In `@src/post_process/m_data_input.f90`:
- Around line 146-148: Update the `@param` documentation for the argument t_step
in the helper subroutine that reads IB data files to state that t_step is
optional (matches the declaration integer, intent(in), optional) and clarify its
requirement: explicitly note that t_step may be omitted unless parallel_io is
.true;, in which case a time step index must be provided; reference the t_step
parameter and the parallel_io flag in the description so generated API docs and
readers understand when the argument is required.

In `@src/simulation/m_bubbles_EL.fpp`:
- Around line 845-846: The documentation for s_get_pinf incorrectly labels
preterm1 as "Pre-computed term 1" and thus implies caller-provided input; update
the comment for parameters preterm1 and term2 to reflect that both are
intent(out), optional values computed inside s_get_pinf and returned to the
caller (e.g., "Computed term 1 (output, optional) returned by s_get_pinf");
ensure the description matches the intent(out) semantics for preterm1 and term2.

In `@src/simulation/m_hyperelastic.fpp`:
- Around line 217-228: The comment block incorrectly describes
deformation-gradient and btensor construction (grad_xi, inverse, F·F^T) which is
done in s_hyperelastic_rmt_stress_update; update the doc for the solver
subroutines (referencing btensor_in, q_prim_vf, G_param and the solver names) to
state that these routines accept a precomputed btensor_in, compute the
deviatoric part of btensor and then compute/update the Cauchy stress / primitive
stress fields using the appropriate constitutive law (neo-Hookean or
Mooney-Rivlin), explicitly noting they do not compute grad_xi or F.

In `@src/simulation/m_sim_helpers.fpp`:
- Line 96: The three newly added `@param` descriptions use capitalized first
words; update them to match the file's existing style by lowercasing the first
word for each parameter: change the `@param` for qv from "Vapor quality" to "vapor
quality", the `@param` for rho from "Density" to "density", and the `@param` for cs
(or the parameter documenting speed of sound) from "Speed of sound" to "speed of
sound" so the docblock capitalization is consistent with other `@param` entries.

In `@src/simulation/m_time_steppers.fpp`:
- Around line 767-779: The Doxygen block for subroutine s_apply_bodyforces is
missing documentation for the ldt parameter; update the routine's header comment
to include an `@param` ldt description (e.g., "@param ldt local time step") so all
four parameters (q_cons_vf, q_prim_vf_in, rhs_vf_in, ldt) are documented
consistently with the existing `@param` entries and the inline "!< local dt"
annotation can remain or be removed as desired.

In `@src/simulation/m_viscous.fpp`:
- Around line 554-562: s_get_viscous currently takes 21 arguments which exceeds
the project guideline; refactor by creating one or more derived types (e.g.,
boundary_prim_data for rsx/rsy/rsz and their derivatives, and maybe qprim_point
for q_prim_qp and dq_prim_* ) and replace the long parameter list with a few
typed bundles passed to s_get_viscous (and updated callers). Update the
subroutine signature (s_get_viscous) to accept these derived-type objects plus
ix, iy, iz, move related declarations into the types, and adjust all call sites
to construct and pass the new bundles instead of the individual arrays.

Once this is done, click `configure` and then `save` on the next dialogue box.


<div style='text-align:center; font-size:0.75rem; color:#888; padding:16px 0 0;'>Page last updated: 2026-02-13</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Hardcoded date will silently become stale.

2026-02-13 is static HTML embedded in 16+ docs pages across this PR. Any future content edit won't update these footers, and there's no mechanism to detect the drift. If the site is built via a static generator (e.g., MkDocs/Sphinx), consider injecting the date at build time (e.g., the git log -1 --format=%ci -- <file> per-file approach, or a MkDocs git-revision-date-localized plugin) rather than hardcoding it.

— The AI summary states the timestamp is "effectively duplicated at two locations within the page," but the complete file contains only one instance of the footer (line 145).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/documentation/visualization.md` at line 145, Replace the hardcoded
footer div that contains "Page last updated: 2026-02-13" with a build-time
injected value: locate the HTML snippet "<div style='text-align:center;
font-size:0.75rem; color:`#888`; padding:16px 0 0;'>Page last updated:" and change
it to use your static-site templating variable or plugin (e.g., MkDocs/Sphinx
git-revision-date variable or a git-based per-file date like `git log -1
--format=%ci -- <file>`) so the date is generated at build time for each page
rather than hardcoded; ensure the templating syntax you use is compatible with
the site generator in use and update any other occurrences of the same footer
across the docs to the same templated approach.

Comment on lines +1182 to +1183
!! @param s2b Starting boundary index in the second coordinate direction
!! @param s3b Starting boundary index in the third coordinate direction
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

rg -n '\bs[23]b\b' src/common/m_variables_conversion.fpp

Repository: MFlowCode/MFC

Length of output: 357


🏁 Script executed:

sed -n '1150,1250p' src/common/m_variables_conversion.fpp | cat -n

Repository: MFlowCode/MFC

Length of output: 5210


🏁 Script executed:

sed -n '1220,1230p' src/common/m_variables_conversion.fpp | cat -n

Repository: MFlowCode/MFC

Length of output: 527


🏁 Script executed:

# Get the full subroutine to search for s2b/s3b usage within the body
sed -n '1175,1350p' src/common/m_variables_conversion.fpp | grep -E '(subroutine|end subroutine|s[23]b)' | head -40

Repository: MFlowCode/MFC

Length of output: 809


🏁 Script executed:

# Find the exact line range of the subroutine and verify no other s2b/s3b usage
awk '/subroutine s_convert_primitive_to_flux_variables/,/end subroutine s_convert_primitive_to_flux_variables/ {print NR": "$0}' src/common/m_variables_conversion.fpp | grep -E '(subroutine|end subroutine|s[23]b)'

Repository: MFlowCode/MFC

Length of output: 549


Remove unused parameters s2b and s3b or implement their intended functionality.

These parameters are declared and documented at lines 1182–1189 but never used in the subroutine body. Loop indices is2b and is3b are hardcoded to is2%beg and is3%beg (lines 1224–1225), not derived from s2b/s3b. Either remove the dead parameters and their documentation, or if they were intended to allow partial-domain GPU kernels, assign is2b = s2b and is3b = s3b instead. Since this is in src/common/, changes affect all three executables.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/common/m_variables_conversion.fpp` around lines 1182 - 1183, The
parameters s2b and s3b are documented but unused: either remove them (and their
docs) from the subroutine signature and related documentation, or wire them into
the loop bounds by replacing the hardcoded assignments is2b = is2%beg and is3b =
is3%beg with is2b = s2b and is3b = s3b so the routine honors the provided
starting boundary indices; update any call sites if you remove parameters and
ensure consistency in the subroutine (variables: s2b, s3b, is2b, is3b, is2%beg,
is3%beg).

Comment on lines +95 to +97
!> Compute the right-hand side for Euler-Euler bubble transport
!! @param idir Direction index
!! @param q_prim_vf Primitive variables
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Missing @param divu_in in s_compute_bubbles_EE_rhs docstring.

The new doc block documents idir and q_prim_vf but omits the third parameter divu_in. The inline !< comment on line 102 won't appear in the generated parameter table; a @param entry is needed for a complete Doxygen listing.

📝 Proposed fix
 !>  Compute the right-hand side for Euler-Euler bubble transport
     !! `@param` idir Direction index
     !! `@param` q_prim_vf Primitive variables
+    !! `@param` divu_in Matrix for div(u), updated in-place
 subroutine s_compute_bubbles_EE_rhs(idir, q_prim_vf, divu_in)

Based on learnings: "Add Doxygen docstrings in source files for new public routines."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
!> Compute the right-hand side for Euler-Euler bubble transport
!! @param idir Direction index
!! @param q_prim_vf Primitive variables
!> Compute the right-hand side for Euler-Euler bubble transport
!! `@param` idir Direction index
!! `@param` q_prim_vf Primitive variables
!! `@param` divu_in Matrix for div(u), updated in-place
subroutine s_compute_bubbles_EE_rhs(idir, q_prim_vf, divu_in)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/simulation/m_bubbles_EE.fpp` around lines 95 - 97, Add a `@param` entry for
divu_in to the Doxygen docblock for s_compute_bubbles_EE_rhs so the third
parameter is documented (the inline `!<` comment at line 102 is not picked up by
Doxygen); update the comment block that currently lists `@param` idir and `@param`
q_prim_vf to include `@param divu_in` with a short description of what divu_in
represents (e.g., divergence of velocity) so the generated parameter table is
complete.

!! that are needed for the bubble modeling
!! @param q_prim_vf Primitive variables
!! @param q_cons_vf Conservative variables
!! @param rhs_vf Right-hand side variables
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Missing @param divu_in in s_compute_bubble_EE_source docstring.

Adding @param rhs_vf was correct, but divu_in (the fourth parameter) still has no @param entry in the block header — only an inline !< on line 167 that Doxygen won't promote to the parameter table.

📝 Proposed fix
     !!  `@param` q_cons_vf Conservative variables
     !!  `@param` rhs_vf Right-hand side variables
+    !!  `@param` divu_in Matrix for div(u)
 impure subroutine s_compute_bubble_EE_source(q_cons_vf, q_prim_vf, rhs_vf, divu_in)

Based on learnings: "Add Doxygen docstrings in source files for new public routines."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
!! @param rhs_vf Right-hand side variables
!! `@param` q_cons_vf Conservative variables
!! `@param` rhs_vf Right-hand side variables
!! `@param` divu_in Matrix for div(u)
impure subroutine s_compute_bubble_EE_source(q_cons_vf, q_prim_vf, rhs_vf, divu_in)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/simulation/m_bubbles_EE.fpp` at line 162, The function
s_compute_bubble_EE_source has a missing `@param` entry for the fourth parameter
divu_in in its Doxygen block (you added `@param` rhs_vf but left divu_in only as
an inline !<), so update the docstring for s_compute_bubble_EE_source to include
a proper "@param divu_in" line in the block header with a short description of
what divu_in represents/contains; ensure this matches the existing style used
for "@param rhs_vf" so Doxygen will include it in the generated parameter table.

Comment on lines +219 to +224
!! @param btensor_in Left Cauchy-Green deformation tensor
!! @param q_prim_vf Primitive variables
!! @param btensor is the output
!! @param G_param Elastic shear modulus
!! @param j x-direction cell index
!! @param k y-direction cell index
!! @param l z-direction cell index
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

@param btensor_in should use [in,out] direction qualifier — it is mutated inside both solvers

In both s_neoHookean_cauchy_solver (lines 244–246) and s_Mooney_Rivlin_cauchy_solver (lines 288–290), btensor_in is declared intent(inout) and its diagonal entries are overwritten in-place with the deviatoric values before being used for the stress update. Documenting it as a plain @param (input-only implication) misrepresents the contract for both callers and API readers.

Similarly, q_prim_vf in the same blocks is intent(inout) and has stress/invariant values written into it — the existing @param q_prim_vf Primitive variables line (unchanged) carries the same omission.

📝 Suggested direction qualifiers for both solvers
-        !! `@param` btensor_in Left Cauchy-Green deformation tensor
+        !! `@param`[in,out] btensor_in Left Cauchy-Green deformation tensor (diagonal entries replaced with deviatoric in-place)
-        !! `@param` q_prim_vf Primitive variables
+        !! `@param`[in,out] q_prim_vf Primitive variables (stress and elastic invariant entries updated)
-        !! `@param` G_param Elastic shear modulus
+        !! `@param`[in] G_param Elastic shear modulus
-        !! `@param` j x-direction cell index
-        !! `@param` k y-direction cell index
-        !! `@param` l z-direction cell index
+        !! `@param`[in] j x-direction cell index
+        !! `@param`[in] k y-direction cell index
+        !! `@param`[in] l z-direction cell index

(Apply the same change to both s_neoHookean_cauchy_solver and s_Mooney_Rivlin_cauchy_solver.)

Also applies to: 262-267

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/simulation/m_hyperelastic.fpp` around lines 219 - 224, Update the
parameter documentation to reflect mutation: change the `@param` entries for
btensor_in and q_prim_vf to include the direction qualifier [in,out] in the
docblocks for both s_neoHookean_cauchy_solver and s_Mooney_Rivlin_cauchy_solver
(and the duplicate docblock at lines referenced around 262–267), since
btensor_in and q_prim_vf are declared intent(inout) and are modified in-place
(diagonal overwritten and stress/invariants written); ensure the two `@param`
lines read e.g. "@param btensor_in [in,out] Left Cauchy-Green deformation
tensor" and "@param q_prim_vf [in,out] Primitive variables" so callers and
readers see the correct contract.

sbryngelson and others added 5 commits February 19, 2026 12:27
- gen_api_landing.py: scan .f90 files (not just .fpp), add encoding
  and mkdir, add future annotations
- fix_file_briefs.py: exclude module procedure from regex, add
  encoding, add future annotations
- CMakeLists.txt: add source file DEPENDS to stamp commands so they
  re-run when Fortran sources change

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Doxygen uses the comment block directly before the module declaration
(not the @file header) to populate the Modules List page. These 16
modules only had file-level @Briefs, so they appeared with empty
descriptions on the namespace list pages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add ~170 !> @brief one-line descriptions to previously undocumented
  subroutines/functions across all 45 source files
- Add cross-navigation links (User Guide, Pre-Process/Simulation/Post-
  Process API) injected at the top of the Doxygen sidebar via JavaScript
- Fix stale @param ib in s_ib_3D_airfoil

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…int for missing briefs

- Rewrite ~51 module-level !> @brief descriptions to be concise and
  descriptive (one sentence, no boilerplate)
- Update gen_api_landing.py to extract briefs from source files and
  render module tables with descriptions on API landing pages
- Add check_module_briefs() linter to lint_docs.py ensuring every
  m_*.fpp/.f90 has a module-level !> @brief before the module declaration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 57 files (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="toolchain/mfc/lint_docs.py">

<violation number="1" location="toolchain/mfc/lint_docs.py:817">
P2: The new module brief check treats the common "Contains module ..." @brief as invalid, so existing modules like m_data_input will be flagged as missing briefs. This creates false lint failures and conflicts with the current auto-fixed @brief format.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@sbryngelson sbryngelson merged commit c612b6a into MFlowCode:master Feb 19, 2026
34 of 36 checks passed
@codecov
Copy link

codecov bot commented Feb 19, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.05%. Comparing base (5a8dd03) to head (43818e4).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/common/m_boundary_common.fpp 20.00% 4 Missing ⚠️
src/simulation/m_hyperelastic.fpp 0.00% 4 Missing ⚠️
src/simulation/m_compute_levelset.fpp 40.00% 3 Missing ⚠️
src/common/m_mpi_common.fpp 50.00% 1 Missing ⚠️
src/post_process/m_start_up.fpp 50.00% 1 Missing ⚠️
src/simulation/m_bubbles.fpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1167      +/-   ##
==========================================
- Coverage   44.06%   44.05%   -0.02%     
==========================================
  Files          70       70              
  Lines       20431    20498      +67     
  Branches     1975     1990      +15     
==========================================
+ Hits         9003     9030      +27     
- Misses      10291    10329      +38     
- Partials     1137     1139       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files

Development

Successfully merging this pull request may close these issues.

1 participant