Skip to content

Commit c189d0e

Browse files
authored
Update Documentation (#74)
* improve acecssability * upgrade rtd * update readme
1 parent 79e9379 commit c189d0e

16 files changed

Lines changed: 183 additions & 43 deletions

‎CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ if( BUILD_DOC )
324324
set( SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/docs/sphinx )
325325
set( SPHINX_INDEX_FILE ${SPHINX_BUILD}/index.html )
326326
add_custom_command( OUTPUT ${SPHINX_INDEX_FILE}
327-
COMMAND ${SPHINX_EXECUTABLE} ${SPHINX_SOURCE} ${SPHINX_BUILD}
327+
COMMAND ${CMAKE_COMMAND} -E env KITRT_DOXYGEN_XML=${DOXYGEN_OUTPUT_DIR}/xml ${SPHINX_EXECUTABLE} ${SPHINX_SOURCE} ${SPHINX_BUILD}
328328
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
329329
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/doc/index.rst ${DOXYGEN_INDEX_FILE}
330330
MAIN_DEPENDENCY ${SPHINX_SOURCE}/conf.py

‎README.md‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ KiT-RT has two layers:
1919
- `kitrt_code`: this C++ solver repository. Use it to build the solver, run one deterministic config, or extend solver internals.
2020
- `CharmKiT`: the Python workflow layer for lattice/hohlraum sweeps, SLURM submission, CSV inputs, and QOI collection.
2121

22+
<<<<<<< HEAD
23+
Prerequisites for the CPU smoke test:
24+
25+
- C++17 compiler, CMake 3.16+, Git, and initialized submodules
26+
- OpenMP, BLAS, LAPACK, and VTK development libraries
27+
- Python 3.10+ for `tools/check_smoke_output.py`
28+
29+
=======
30+
>>>>>>> 79e9379a02585184b95f4031d61ae086a483267f
2231
### Ten-minute CPU smoke test
2332

2433
```bash
@@ -96,7 +105,7 @@ Applications include:
96105
### Neural–PDE Integration
97106

98107
* **Structure-Preserving Operator Learning** — *arXiv:2402.16613* \[[PDF](https://arxiv.org/abs/2402.16613)]
99-
* **Structure-preserving neural networks for entropy-based closure** — *Journal of Computational Physics* \[[DOI](https://doi.org/10.1016/j.jcp.2025.113967)], *ICML* \[[Link]([https://doi.org/10.1016/j.jcp.2025.113967](https://proceedings.mlr.press/v162/schotthofer22a.html))], *AIAA* \[[DOI](https://doi.org/10.2514/6.2021-2895)]
108+
* **Structure-preserving neural networks for entropy-based closure** — *Journal of Computational Physics* \[[DOI](https://doi.org/10.1016/j.jcp.2025.113967)], *ICML* \[[Link](https://proceedings.mlr.press/v162/schotthofer22a.html)], *AIAA* \[[DOI](https://doi.org/10.2514/6.2021-2895)]
100109
* [PhD Thesis: Synergies between Numerical Methods for Kinetic Equations and Neural Networks](https://doi.org/10.5445/IR/1000158838)
101110

102111

@@ -126,7 +135,8 @@ cd ..
126135

127136
#### 1b) Docker installation
128137
```bash
129-
docker run --rm -it -v $(pwd):/mnt -w /mnt kitrt/test:latest /bin/bash
138+
docker build -t kitrt/test:local tools/docker
139+
docker run --rm -it -v "$(pwd):/mnt" -w /mnt kitrt/test:local /bin/bash
130140
mkdir -p build_docker_omp
131141
cd build_docker_omp
132142
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_MPI=OFF -DBUILD_CUDA_HPC=OFF -DBUILD_ML=OFF ..
@@ -255,7 +265,7 @@ gcovr -r .. --html-details coverage.html
255265

256266
## Python API
257267

258-
The Python interface is provided via [charm_kit](https://github.com/KiT-RT/charm_kit), allowing seamless integration into AI and outer-loop (UQ, Optimization) workflows.
268+
The Python workflow interface is provided via [CharmKiT](https://github.com/KiT-RT/CharmKiT), allowing integration into AI and outer-loop (UQ, Optimization) workflows.
259269
Check the corresponding readme for further info.
260270

261271

‎doc/conf.py‎

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import subprocess, os
1+
import os
2+
import subprocess
23

34
project = 'KiT-RT'
4-
copyright = '2022, Karlsruhe Institute of Technology'
5+
copyright = '2024, Steffen Schotthoefer, Pia Stammer, Jonas Kusch'
56
author = 'Jonas Kusch, Steffen Schotthöfer, Pia Stammer, Jannick Wolters, Tianbai Xiao'
67

78
version = '1.2.0'
@@ -13,9 +14,32 @@
1314
'sphinx_rtd_theme'
1415
]
1516

16-
#templates_path = ['_templates']
17+
# templates_path = ['_templates']
1718
master_doc = 'index'
18-
exclude_patterns = []
19+
20+
# Legacy API stub pages for classes that have been removed, renamed, or folded
21+
# into aggregate pages. Excluding them keeps source-discovery builds from
22+
# publishing stale API references.
23+
exclude_patterns = [
24+
'optimizers/mloptimizer.rst',
25+
'problems/checkerboardpn.rst',
26+
'problems/checkerboardsn.rst',
27+
'problems/electronrt.rst',
28+
'problems/icru.rst',
29+
'problems/linesourcepn.rst',
30+
'problems/linesourcesn.rst',
31+
'problems/linesourcesnpseudo1d.rst',
32+
'problems/linesourcesnpseudo1dphysics.rst',
33+
'problems/musclebonelung.rst',
34+
'problems/phantom2d.rst',
35+
'problems/slabgeohg.rst',
36+
'problems/waterphantom.rst',
37+
'solvers/csdsnsolverfp.rst',
38+
'solvers/csdsnsolvernotrafo.rst',
39+
'solvers/csdsolvertrafofp.rst',
40+
'solvers/csdsolvertrafofp2d.rst',
41+
'solvers/csdsolvertrafofpsh2d.rst',
42+
]
1943

2044
html_theme = 'sphinx_rtd_theme'
2145
html_theme_options = {
@@ -24,28 +48,32 @@
2448
}
2549
html_logo = 'images/KiT-RT_logo_small.png'
2650
html_static_path = ['_static']
51+
2752
def setup(app):
2853
app.add_css_file('theme_overrides.css')
2954

55+
conf_dir = os.path.abspath(os.path.dirname(__file__))
56+
default_doxygen_xml = os.path.abspath(os.path.join(conf_dir, '..', 'build', 'docs', 'doxygen', 'xml'))
57+
doxygen_xml = os.environ.get('KITRT_DOXYGEN_XML', default_doxygen_xml)
58+
3059
breathe_projects = {
31-
"KiT-RT": "../build/docs/doxygen/xml",
60+
'KiT-RT': doxygen_xml,
3261
}
3362

34-
breathe_default_project = "KiT-RT"
63+
breathe_default_project = 'KiT-RT'
3564

3665
read_the_docs_build = os.environ.get('READTHEDOCS', None) == 'True'
3766
if read_the_docs_build:
38-
inputDir = '../'
39-
outputDir = '../build/docs/doxygen'
40-
if not os.path.exists(outputDir):
41-
os.makedirs(outputDir)
42-
with open("Doxyfile.in", "rt") as fin:
43-
with open("Doxyfile", "wt") as fout:
67+
inputDir = os.path.abspath(os.path.join(conf_dir, '..'))
68+
outputDir = os.path.abspath(os.path.join(conf_dir, '..', 'build', 'docs', 'doxygen'))
69+
os.makedirs(outputDir, exist_ok=True)
70+
with open(os.path.join(conf_dir, 'Doxyfile.in'), 'rt') as fin:
71+
with open(os.path.join(conf_dir, 'Doxyfile'), 'wt') as fout:
4472
for line in fin:
4573
line = line.replace('GENERATE_HTML = YES', 'GENERATE_HTML = NO')
4674
line = line.replace('SEARCH_INCLUDES = YES', 'SEARCH_INCLUDES = NO')
4775
line = line.replace('CLASS_DIAGRAMS = YES', 'CLASS_DIAGRAMS = NO')
4876
line = line.replace('@DOXYGEN_OUTPUT_DIR@', outputDir)
4977
line = line.replace('@DOXYGEN_INPUT_DIR@', inputDir)
5078
fout.write(line)
51-
subprocess.call('doxygen', shell=True)
79+
subprocess.call('doxygen', cwd=conf_dir, shell=True)

‎doc/configFiles.rst‎

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ Output control:
7070
Current enum values (from code)
7171
--------------------------------
7272

73+
These names come from ``include/common/globalconstants.hpp`` and are the strings
74+
accepted by the config parser.
75+
7376
`SOLVER`:
7477

7578
- `SN_SOLVER`
@@ -84,9 +87,9 @@ Current enum values (from code)
8487

8588
- `LINESOURCE`, `LINESOURCE_1D`
8689
- `CHECKERBOARD`, `CHECKERBOARD_1D`
87-
- `AIRCAVITY_1D`, `WATERPHANTOM`, `RADIATIONCT`
90+
- `STARMAP_VALIDATION`, `AIRCAVITY_1D`
91+
- `WATERPHANTOM`, `WATERPHANTOM_1D`, `RADIATIONCT`
8892
- `MELTINGCUBE`, `MELTINGCUBE_1D`
89-
- `STARMAP_VALIDATION`
9093
- `HOHLRAUM`, `SYMMETRIC_HOHLRAUM`, `QUARTER_HOHLRAUM`
9194
- `LATTICE`, `HALF_LATTICE`
9295

@@ -108,6 +111,42 @@ Current enum values (from code)
108111
- `SPHERICAL_MONOMIALS`
109112
- `SPHERICAL_MONOMIALS_ROTATED`
110113

114+
`ENTROPY_FUNCTIONAL`:
115+
116+
- `QUADRATIC`
117+
- `MAXWELL_BOLTZMANN`
118+
- `BOSE_EINSTEIN`
119+
- `FERMI_DIRAC`
120+
121+
`ENTROPY_OPTIMIZER`:
122+
123+
- `NEWTON`
124+
- `REGULARIZED_NEWTON`
125+
- `PART_REGULARIZED_NEWTON`
126+
- `REDUCED_NEWTON`
127+
- `REDUCED_PART_REGULARIZED_NEWTON`
128+
- `ML`
129+
130+
`VOLUME_OUTPUT`:
131+
132+
- `ANALYTIC`, `MINIMAL`, `MOMENTS`, `DUAL_MOMENTS`, `MEDICAL`
133+
134+
`SCREEN_OUTPUT` and `HISTORY_OUTPUT`:
135+
136+
- `ITER`, `WALL_TIME`, `SIM_TIME`, `MASS`, `RMS_FLUX`
137+
- `VTK_OUTPUT`, `CSV_OUTPUT`
138+
- `CUR_OUTFLOW`, `TOTAL_OUTFLOW`, `CUR_OUTFLOW_P1`, `TOTAL_OUTFLOW_P1`
139+
- `CUR_OUTFLOW_P2`, `TOTAL_OUTFLOW_P2`, `MAX_OUTFLOW`
140+
- `CUR_PARTICLE_ABSORPTION`, `TOTAL_PARTICLE_ABSORPTION`, `MAX_PARTICLE_ABSORPTION`
141+
- `TOTAL_PARTICLE_ABSORPTION_CENTER`, `TOTAL_PARTICLE_ABSORPTION_VERTICAL`, `TOTAL_PARTICLE_ABSORPTION_HORIZONTAL`
142+
- `PROBE_MOMENT_TIME_TRACE`, `VAR_ABSORPTION_GREEN`, `ABSORPTION_GREEN_BLOCK`
143+
- `AVG_ABSORPTION_GREEN_BLOCK_INTEGRATED`, `VAR_ABSORPTION_GREEN_BLOCK_INTEGRATED`, `ABSORPTION_GREEN_LINE`
144+
145+
`SAMPLER_NAME`:
146+
147+
- `CLASSIFICATION_SAMPLER`
148+
- `REGRESSION_SAMPLER`
149+
111150
HPC SN config pattern
112151
---------------------
113152

‎doc/developer_guide.rst‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@ A typical local developer workflow is:
2626
./build_dev/unit_tests
2727
ctest --test-dir build_dev --output-on-failure
2828
29+
Documentation build
30+
-------------------
31+
32+
A local Doxygen/Sphinx build uses the active CMake build directory for generated
33+
Doxygen XML:
34+
35+
.. code-block:: bash
36+
37+
python -m pip install -r doc/requirements.txt
38+
cmake -S . -B build_doc -DCMAKE_BUILD_TYPE=Release -DBUILD_DOC=ON -DBUILD_MPI=OFF -DBUILD_CUDA_HPC=OFF -DBUILD_HIP_HPC=OFF -DBUILD_ML=OFF
39+
cmake --build build_doc -j
40+
41+
Open ``build_doc/docs/sphinx/index.html`` to inspect the generated docs.
42+
2943
CI
3044
--
3145

‎doc/getting_started.rst‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ Ten-minute CPU path
2626
-------------------
2727

2828
Run these commands from a fresh clone on a machine with the required CPU
29-
dependencies installed:
29+
dependencies installed. See :doc:`installation` for BLAS/LAPACK, VTK, and
30+
Python package requirements.
3031

3132
.. code-block:: bash
3233
@@ -45,7 +46,15 @@ details.
4546
Container path
4647
--------------
4748

48-
Apptainer is supported through ``KITRT_CONTAINER_RUNTIME=apptainer``.
49-
Singularity remains supported through ``KITRT_CONTAINER_RUNTIME=singularity``.
50-
If your site does not permit root builds, use a prebuilt SIF or a remote pull
51-
URI instead of building containers on the cluster login node.
49+
Container definitions live under ``tools/singularity``. Apptainer is supported
50+
through ``KITRT_CONTAINER_RUNTIME=apptainer``; Singularity remains supported
51+
through ``KITRT_CONTAINER_RUNTIME=singularity``. A local CPU image can be built
52+
with:
53+
54+
.. code-block:: bash
55+
56+
cd tools/singularity
57+
KITRT_CONTAINER_RUNTIME=apptainer ./build_container.sh cpu
58+
59+
If your site does not permit local SIF builds, use a site-provided image or a
60+
remote pull URI instead of building containers on the cluster login node.

‎doc/index.rst‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Supported solver families
1515
- :math:`P_N` (spherical harmonics moments)
1616
- :math:`M_N` (entropy-closure moments, including normalized variant)
1717
- Continuous slowing-down (CSD) variants for :math:`S_N`, :math:`P_N`, and :math:`M_N`
18-
- HPC :math:`S_N` path (CPU MPI/OpenMP and optional CUDA backend)
18+
- HPC :math:`S_N` path (CPU MPI/OpenMP and optional CUDA or HIP backend)
1919

2020
For a solver-focused overview (including numerical background references and
2121
code mapping), see :doc:`solvers_overview`.
@@ -32,6 +32,7 @@ Table of contents
3232
tutorials/smoke_test
3333
troubleshooting
3434
release
35+
philosophy
3536
configFiles
3637
solvers_overview
3738
physics

‎doc/installation.rst‎

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,33 @@ Installation
66
Requirements
77
------------
88

9-
Required:
9+
Required for the documented CPU build and smoke test:
1010

1111
- C++17 compiler
1212
- CMake 3.16+
13+
- Git and initialized submodules
14+
- Python 3.10+ for the smoke-test checker
1315
- OpenMP
14-
- LAPACK (and optionally BLAS)
15-
- VTK
16-
- Git
16+
- BLAS and LAPACK development libraries
17+
- VTK development libraries
18+
19+
On Ubuntu systems, the CPU prerequisites are typically provided by packages like:
20+
21+
.. code-block:: bash
22+
23+
sudo apt-get update
24+
sudo apt-get install -y build-essential cmake git python3 libopenblas-dev liblapack-dev libvtk9-dev
25+
26+
Package names vary by distribution and cluster module stack. The important CMake
27+
packages are OpenMP, BLAS, LAPACK, and VTK.
1728

1829
Optional features:
1930

20-
- MPI (`-DBUILD_MPI=ON`)
31+
- MPI (`-DBUILD_MPI=ON`; for example Open MPI or MPICH)
2132
- CUDA backend for the HPC SN solver (`-DBUILD_CUDA_HPC=ON`)
33+
- HIP/ROCm backend for the HPC SN solver (`-DBUILD_HIP_HPC=ON`; requires CMake 3.21+)
2234
- TensorFlow backend for neural closure (`-DBUILD_ML=ON`)
35+
- Documentation build (`-DBUILD_DOC=ON`; requires Doxygen plus `doc/requirements.txt`)
2336

2437
Get the source and submodules
2538
-----------------------------
@@ -57,9 +70,17 @@ MPI + CUDA build for HPC SN CUDA backend:
5770
.. code-block:: bash
5871
5972
mkdir -p build_cuda
60-
cmake -S . -B build_cuda -DCMAKE_BUILD_TYPE=Release -DBUILD_MPI=ON -DBUILD_CUDA_HPC=ON -DBUILD_ML=OFF
73+
cmake -S . -B build_cuda -DCMAKE_BUILD_TYPE=Release -DBUILD_MPI=ON -DBUILD_CUDA_HPC=ON -DBUILD_HIP_HPC=OFF -DBUILD_ML=OFF
6174
cmake --build build_cuda -j
6275
76+
MPI + ROCm/HIP build for HPC SN HIP backend:
77+
78+
.. code-block:: bash
79+
80+
mkdir -p build_rocm
81+
cmake -S . -B build_rocm -DCMAKE_BUILD_TYPE=Release -DBUILD_MPI=ON -DBUILD_CUDA_HPC=OFF -DBUILD_HIP_HPC=ON -DBUILD_ML=OFF
82+
cmake --build build_rocm -j
83+
6384
Build with tests:
6485

6586
.. code-block:: bash
@@ -102,3 +123,17 @@ Tests
102123
103124
./build_test/unit_tests
104125
ctest --test-dir build_test --output-on-failure
126+
127+
Documentation
128+
-------------
129+
130+
Install the Sphinx Python dependencies and build Doxygen plus Sphinx through
131+
CMake:
132+
133+
.. code-block:: bash
134+
135+
python -m pip install -r doc/requirements.txt
136+
cmake -S . -B build_doc -DCMAKE_BUILD_TYPE=Release -DBUILD_DOC=ON -DBUILD_MPI=OFF -DBUILD_CUDA_HPC=OFF -DBUILD_HIP_HPC=OFF -DBUILD_ML=OFF
137+
cmake --build build_doc -j
138+
139+
The generated HTML entry point is `build_doc/docs/sphinx/index.html`.

‎doc/quadratures/qgausslegendretensorized2D.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
QGaussLegendreTensorized2D
2-
========================
2+
===========================
33

44
.. doxygenclass:: QGaussLegendreTensorized2D
55
:members:

‎doc/release.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Release Notes
66
=====
77

88
The CMake project version is currently ``1.2.0``. Until GitHub releases and
9-
published container artifacts are available, cite the exact commit hash used for
9+
release container artifacts are available, cite the exact commit hash used for
1010
reproducibility.
1111

1212
Recommended release artifacts

0 commit comments

Comments
 (0)