Skip to content

Commit d8d9e25

Browse files
authored
Constraints (#1072)
1 parent 9d283e5 commit d8d9e25

File tree

6 files changed

+999
-0
lines changed

6 files changed

+999
-0
lines changed

.github/workflows/docs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ jobs:
3434
cmake -S . -B build -G Ninja --install-prefix=$(pwd)/build/install -D MFC_DOCUMENTATION=ON
3535
ninja -C build install
3636
37+
- name: Upload Built Documentation Artifact
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: mfc-docs
41+
path: build/install/docs/mfc
42+
if-no-files-found: error
43+
retention-days: 7
44+
3745
# From here https://github.com/cicirello/generate-sitemap
3846
- name: Generate the sitemap
3947
id: sitemap

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ docs/*/initial*
3636
docs/*/result*
3737
docs/documentation/*-example.png
3838
docs/documentation/examples.md
39+
docs/documentation/case_constraints.md
3940

4041
examples/*batch/*/
4142
examples/**/D/*

CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,18 @@ if (MFC_DOCUMENTATION)
652652
VERBATIM
653653
)
654654

655+
# Generate case_constraints.md from case_validator.py and examples/
656+
add_custom_command(
657+
OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/case_constraints.md"
658+
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/toolchain/mfc/gen_case_constraints_docs.py"
659+
"${CMAKE_CURRENT_SOURCE_DIR}/toolchain/mfc/case_validator.py"
660+
"${examples_DOCs}"
661+
COMMAND "bash" "${CMAKE_CURRENT_SOURCE_DIR}/docs/gen_constraints.sh"
662+
"${CMAKE_CURRENT_SOURCE_DIR}"
663+
COMMENT "Generating case_constraints.md"
664+
VERBATIM
665+
)
666+
655667
file(GLOB common_DOCs CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/docs/*")
656668

657669
# GEN_DOCS: Given a target name (herein <target>), this macro sets up a
@@ -685,8 +697,10 @@ if (MFC_DOCUMENTATION)
685697
"${CMAKE_CURRENT_BINARY_DIR}/${target}-Doxyfile" @ONLY)
686698

687699
set(opt_example_dependency "")
700+
set(opt_constraints_dependency "")
688701
if (${target} STREQUAL documentation)
689702
set(opt_example_dependency "${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/examples.md")
703+
set(opt_constraints_dependency "${CMAKE_CURRENT_SOURCE_DIR}/docs/documentation/case_constraints.md")
690704
endif()
691705

692706
file(GLOB_RECURSE ${target}_DOCs CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/docs/${target}/*")
@@ -696,6 +710,7 @@ if (MFC_DOCUMENTATION)
696710
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${target}/html/index.html"
697711
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${target}-Doxyfile"
698712
"${opt_example_dependency}"
713+
"${opt_constraints_dependency}"
699714
"${${target}_SRCs}" "${${target}_DOCs}"
700715
COMMAND "${DOXYGEN_EXECUTABLE}" "${target}-Doxyfile"
701716
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"

docs/documentation/case.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ For example, to run the `scaling` case in "weak-scaling" mode:
6868

6969
## Parameters
7070

71+
## Feature Compatibility
72+
73+
Before diving into parameter details, check the **[Feature Compatibility Guide](case_constraints.md)** to understand:
74+
- Which features work together (MHD, bubbles, phase change, etc.)
75+
- Common configuration patterns with copy-paste examples
76+
- Requirements for each model equation and Riemann solver
77+
78+
💡 **Tip:** If you get a validation error, the compatibility guide explains what each parameter requires.
79+
7180
There are multiple sets of parameters that must be specified in the python input file:
7281
1. [Runtime Parameters](#1-runtime)
7382
2. [Computational Domain Parameters](#2-computational-domain)

docs/gen_constraints.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
# Generate case constraints documentation from case_validator.py
3+
4+
set -e
5+
6+
REPO_ROOT="$1"
7+
8+
if [ -z "$REPO_ROOT" ]; then
9+
echo "Usage: $0 <repo_root>"
10+
exit 1
11+
fi
12+
13+
echo "Generating case constraints documentation..."
14+
python3 "$REPO_ROOT/toolchain/mfc/gen_case_constraints_docs.py" > "$REPO_ROOT/docs/documentation/case_constraints.md"
15+
echo "✓ Generated docs/documentation/case_constraints.md"
16+
17+

0 commit comments

Comments
 (0)