Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
a38e159
First pass at minimal wrapping model
jmsexton03 Sep 14, 2025
d57dd21
Test with just the black box function
jmsexton03 Sep 14, 2025
e8ff270
Fix spacing
jmsexton03 Sep 15, 2025
ac3da50
Clean up naming and comments
jmsexton03 Sep 15, 2025
8897f41
Make sure amr initialized
jmsexton03 Sep 15, 2025
3627022
Make return vals more readable
jmsexton03 Sep 16, 2025
a133587
Tweak output calculation
jmsexton03 Sep 16, 2025
8164769
Use inputs file and parmparse
jmsexton03 Sep 24, 2025
ef2a52a
Add driver from python with pybind11
jmsexton03 Sep 25, 2025
83c8ea1
Add back comments
jmsexton03 Sep 25, 2025
c3a18b4
Minimal docs need checking
jmsexton03 Sep 25, 2025
630ddfd
Add more specific steps
jmsexton03 Sep 25, 2025
fcf1f88
Add more instructions aka recipe
jmsexton03 Sep 25, 2025
764c2df
Add notes on missing needed
jmsexton03 Sep 25, 2025
82f1b2c
Move HeatEquationModel to Case-2
jmsexton03 Sep 25, 2025
e6db1cb
Merge branch 'add_pymodel_heat' into add_pybind_driver_test
jmsexton03 Sep 25, 2025
6eb5a10
Move to Case-1
jmsexton03 Sep 25, 2025
4ff9f1f
Add GNUmake path for python example based on warpx
jmsexton03 Sep 25, 2025
149a648
GNUmake still not setting up link and targets correctly
jmsexton03 Sep 25, 2025
0c34ac8
tweak readme
jmsexton03 Sep 25, 2025
7f93886
Minor cleanup
jmsexton03 Sep 25, 2025
e321e72
Tweak docs for cases
jmsexton03 Sep 25, 2025
57d4336
Tweak docs for examples
jmsexton03 Sep 25, 2025
ce7703d
Tweak docs for generic needs more organizing
jmsexton03 Sep 25, 2025
8c67878
First pass at modularizing
jmsexton03 Sep 29, 2025
6d69b04
Shape of idea
jmsexton03 Sep 29, 2025
b1f2c2d
Main works again and uses inputs file flags if they're there
jmsexton03 Sep 29, 2025
e33bea2
Fix shebang
jmsexton03 Sep 29, 2025
89ae160
Make spacedim be 3 by default, add test
jmsexton03 Sep 29, 2025
476a9af
Split files again
jmsexton03 Sep 29, 2025
99b5079
Fix shebang and add test
jmsexton03 Sep 29, 2025
16a0390
Use inputs to be shorter
jmsexton03 Sep 29, 2025
cc8c9f5
Move
jmsexton03 Sep 29, 2025
396fac3
Initial copy from HeatEquation_Simple
jmsexton03 Sep 29, 2025
5621f04
First pass at adding parameters
jmsexton03 Sep 29, 2025
ab889b2
Running
jmsexton03 Sep 29, 2025
5051de6
Does basic stuff
jmsexton03 Sep 29, 2025
121bab8
Fix outnames
jmsexton03 Sep 29, 2025
dc79ada
Update output format
jmsexton03 Sep 29, 2025
280a5f9
Style
jmsexton03 Sep 29, 2025
ba1562b
Tweak functions and add names
jmsexton03 Sep 29, 2025
5820bd3
Add datalog
jmsexton03 Sep 29, 2025
a026c61
Update model object
jmsexton03 Sep 25, 2025
201e915
Merge commit 'a026c614717fbd6dedb4a181ac9fda6723f48a42' into add_pybi…
jmsexton03 Sep 30, 2025
eb682ec
First pass at code example
jmsexton03 Sep 30, 2025
ec849a6
Add inputs
jmsexton03 Sep 30, 2025
c805446
Simpler model scripts
jmsexton03 Sep 30, 2025
d8945e6
Update docs with configuration
jmsexton03 Sep 30, 2025
c0c65e9
Add info about pnames and PC inputs
jmsexton03 Sep 30, 2025
3624993
Change default plot_int
jmsexton03 Sep 30, 2025
8081c59
Fix links
jmsexton03 Sep 30, 2025
a248efa
Try inheritance
jmsexton03 Oct 2, 2025
7939425
mv
jmsexton03 Oct 2, 2025
b50fc42
Initial files
jmsexton03 Oct 2, 2025
2c12e4d
Continue adding fields
jmsexton03 Oct 2, 2025
b471f3b
add some parameter domain
jmsexton03 Oct 2, 2025
afdd3d6
Basic params working
jmsexton03 Oct 2, 2025
36058d9
Default run method
jmsexton03 Oct 2, 2025
4c13ed8
Make dimension fixes, don't require tuple returned from evolve
jmsexton03 Oct 2, 2025
842c843
Helper functions
jmsexton03 Oct 2, 2025
8576890
Add spatial tracking
jmsexton03 Oct 2, 2025
c3c3739
Add marg and more parameter fields
jmsexton03 Oct 2, 2025
ddc1889
Update HeatEquationModel inheritance
jmsexton03 Oct 2, 2025
13309cb
Switch around eval and make sure we're returning things
jmsexton03 Oct 2, 2025
8472393
Another update to shape
jmsexton03 Oct 2, 2025
1676b48
Keep simple main.py with inputs
jmsexton03 Oct 2, 2025
ef7320e
Copy from other case
jmsexton03 Oct 2, 2025
94310c5
Make outputs the same
jmsexton03 Oct 2, 2025
e892722
Try testing again, needed make
jmsexton03 Oct 2, 2025
9b2ff7c
Move to Case-0
jmsexton03 Oct 3, 2025
b2dd652
datalog output and parameter inputs match
jmsexton03 Oct 3, 2025
539adeb
Fix names again
jmsexton03 Oct 3, 2025
6b96b0c
Merge branch 'add_pyinterface_inherit' into pytuq_pr1
jmsexton03 Oct 6, 2025
764ac67
Remove duplicates and examples that are not fully tested
jmsexton03 Oct 6, 2025
ffb90c4
Moved files back to seperate directories
jmsexton03 Oct 6, 2025
b7f6500
Rename overall directory
jmsexton03 Oct 6, 2025
04a0033
Fix level
jmsexton03 Oct 6, 2025
f3ec4ba
Rename so datalog modelx only one
jmsexton03 Oct 6, 2025
e4110ac
Remove extra docs
jmsexton03 Oct 6, 2025
977cc17
More simplifications
jmsexton03 Oct 6, 2025
216a825
Summarize
jmsexton03 Oct 6, 2025
551a335
Move run management
jmsexton03 Oct 6, 2025
1eeb236
Add with subprocess
jmsexton03 Oct 6, 2025
5aa1ca2
Runs in ex_pcgsa, plots fail
jmsexton03 Oct 6, 2025
a739f28
Respect outdim if it's overridden, tweak bounds
jmsexton03 Oct 7, 2025
9f1f36d
Make outdim use self
jmsexton03 Oct 7, 2025
537742c
Make requested outputs and pyamrex use consistent
jmsexton03 Oct 7, 2025
5e9ca5f
Style
jmsexton03 Oct 7, 2025
c4cacad
Shorter outline, leave first draft at end
jmsexton03 Oct 7, 2025
8d638f3
directory name
jmsexton03 Oct 7, 2025
b290355
Rename and move
jmsexton03 Oct 10, 2025
e974f2b
Basic C++ example for workflow
jmsexton03 Oct 10, 2025
99c1876
Add modified workflow file and datalog filename input
jmsexton03 Oct 10, 2025
5233040
Fix paths, make pc fit use arguments
jmsexton03 Oct 10, 2025
6a94879
Change number of samples
jmsexton03 Oct 10, 2025
146bf79
Use keep order and multiple jobs
jmsexton03 Oct 10, 2025
a217c08
Streamline doc
jmsexton03 Oct 10, 2025
d3b9453
Tweak heading levels
jmsexton03 Oct 10, 2025
b8e035e
Move conda description for perlmutter
jmsexton03 Oct 10, 2025
6245166
Tweak srun vs parallel tasks
jmsexton03 Oct 10, 2025
7d02b21
Add motivation and math details section
jmsexton03 Oct 10, 2025
aa82e92
Collapsible code
jmsexton03 Oct 10, 2025
05b900b
Fix levels
jmsexton03 Oct 10, 2025
3649dba
Add pyamrex notes
jmsexton03 Oct 10, 2025
8646b55
Update integration description
jmsexton03 Oct 10, 2025
3c33888
Subpages
jmsexton03 Oct 10, 2025
d30c83f
Rework headers
jmsexton03 Oct 10, 2025
b687e3d
Tweak open and add link
jmsexton03 Oct 10, 2025
3f8abdb
Point out section
jmsexton03 Oct 10, 2025
4c90524
Add more specifics about run management to docs
jmsexton03 Oct 10, 2025
32e222e
Add links and references
jmsexton03 Oct 10, 2025
9a2d53a
Extra output example
jmsexton03 Oct 10, 2025
e14427f
Add extra box with docs explaining some of the steps
jmsexton03 Oct 10, 2025
5321b33
Use more detailed install docs including conda
jmsexton03 Oct 13, 2025
e1a7daa
inputs
ajnonaka Oct 14, 2025
88def0b
change NSAM (number of samples) to 20 so it runs faster
ajnonaka Oct 14, 2025
bf6e2a5
update docs based on previous commits
ajnonaka Oct 14, 2025
d6ef37b
tiny non-functional tweaks (except add the "1+" to the initial condit…
ajnonaka Oct 16, 2025
46479a2
enhanced documentation
ajnonaka Oct 16, 2025
5834766
fix typo in comment
ajnonaka Oct 16, 2025
1587bc1
pass in psam to pc_fit.py instead of qsam
ajnonaka Oct 29, 2025
a659843
update with newest main branch on pytuq repo
ajnonaka Nov 18, 2025
591b70a
updated documentation
ajnonaka Nov 18, 2025
361ee1e
new workflow files
ajnonaka Nov 20, 2025
1b9bdee
change integrate temperature to cell value at (9,9,9) to avoid singul…
ajnonaka Nov 24, 2025
185fafd
amrex-tutorials docs sphinx build instructions
ajnonaka Jan 9, 2026
b2877e0
Merge branch 'main' into pytuq_pr1
ajnonaka Jan 9, 2026
9d954fe
Merge branch 'sphinx_readme' into pytuq_pr1
ajnonaka Jan 9, 2026
30c7ee3
style
ajnonaka Jan 9, 2026
de512e9
additional conda/sphinx packages
ajnonaka Jan 9, 2026
a0f79b6
terminology: width -> variance
ajnonaka Jan 10, 2026
eeb9112
typo on pyTUQ location
ajnonaka Jan 10, 2026
b915ff7
move location of UQ example to GuidedTutorials
ajnonaka Jan 12, 2026
1843f58
change location of tutorial code and references to location
ajnonaka Jan 12, 2026
271e7bc
modify problem to give D more influence
ajnonaka Jan 12, 2026
b80c8d0
stabilize problem with smaller dt
ajnonaka Jan 12, 2026
8e5dccb
mpiexec option
ajnonaka Jan 14, 2026
24d91ac
souped-up script
ajnonaka Jan 15, 2026
8348291
add timer to main
ajnonaka Jan 21, 2026
62e837d
re-org
ajnonaka Jan 21, 2026
d4f0344
cleanup for initial public release, case-1 only
ajnonaka Jan 22, 2026
ee612a5
make HeatEquation and HeatEquation_UQ codes look as similar as possible
ajnonaka Jan 22, 2026
04485b2
comment
ajnonaka Jan 22, 2026
e2b10a7
significant refactor of docs to simplify for first release
ajnonaka Jan 23, 2026
c7b7534
documentation
ajnonaka Jan 23, 2026
b497d5a
Merge branch 'main' into ajn_pytuq
ajnonaka Jan 23, 2026
58f595e
trailing whitespace
ajnonaka Jan 23, 2026
bc1ba81
add sphinx-design package
ajnonaka Jan 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
.github/workflows/dependencies/documentation.sh
echo "Installing python packages for docs..."
python3 -m pip install --upgrade pip
python3 -m pip install sphinx sphinx_rtd_theme breathe sphinxcontrib.bibtex docutils
python3 -m pip install sphinx sphinx_rtd_theme breathe sphinxcontrib.bibtex docutils sphinx-copybutton sphinx-design

- name: Install and Build
run: |
Expand Down
4 changes: 4 additions & 0 deletions Docs/Readme.sphinx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ If you have conda, you can install the necessary packages as follows:

2. Type "conda install sphinx_rtd_theme"

3. Type "conda install sphinx-design"

4. Type "conda install -c conda-forge sphinx-copybutton"

If you don't have a conda Python installation, you get one by doing the following:

1. Go to https://conda.io/miniconda.html and download the Python 3.6 64-bit (bash installer), "Miniconda3-latest-Linux-x86_64.sh". Save this script to your hard drive.
Expand Down
209 changes: 209 additions & 0 deletions Docs/source/HeatEquation_UQ.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
.. _tutorials_uq:

.. _guided_pytuq_integration:

.. _pytuq_quickstart:

UQ with PyTUQ
===========

.. admonition:: **Time to Complete**: 30-60 minutes
:class: note

**What you will learn**:
- Install PyTUQ
- Run an AMReX+PyTUQ to perform sensitivity analysis

Overview
--------

AMReX simulations deliver high-fidelity, accurate results for complex physics problems, but the effect on simulation results due to uncertain inputs can require hundreds or thousands of simulations, making comprehensive analysis computationally prohibitive.

This tutorial demonstrates how to improve efficiency without sacrificing accuracy by using polynomial chaos expansions to build fast surrogate models that identify which input parameters truly matter.

PyTUQ (Python interface to the UQ Toolkit) provides specialized tools for surrogate construction and global sensitivity analysis, enabling rapid parameter space exploration and dimensionality reduction for scientific applications.

We demonstrate how to integrate PyTUQ with your AMReX application through a practical workflow; the AMReX-based heat equation tutorial is equipped to perform sensitivity analysis.

In these examples we model the heat equation

.. math:: \frac{\partial\phi}{\partial t} = D\nabla^2 \phi,

with initial condition

.. math:: \phi_0 = 1 + A e^{-r^2 / (2V)},

where ``r`` is the distance from the center of the domain, and with uncertain parameters ``diffusion_coeff`` (:math:`D`), ``init_amplitude`` (:math:`A`), and ``init_variance`` (:math:`V`).
The outputs of interest are the maximum temperature, mean temperature, standard deviation of temperature, and the temperature at a specified point.

.. toctree::
:maxdepth: 1

HeatEquation_UQ_MathematicalDetails

Located in ``amrex-tutorials/ExampleCodes/UQ/HeatEquation``, this example illustrates a complete forward UQ workflow from parameter sampling randomized input parameters to perform sensitivity analysis.
By understanding this example, you will have a basis for understanding how to adapt this workflow to your own AMReX application.

More specifically, you can directly compare/diff ``amrex-tutorials/ExampleCodes/UQ/HeatEquation/main.cpp`` against the original heat equation tutorial ``amrex-tutorials/GuidedTutorials/HeatEquation_Simple/main.cpp`` to see exactly what source code changes are made to the AMReX application in this example.

Installation
------------

We now describe the installation and workflow process on a local workstation.
First, install pytuq using this script (based on information provided in `pytuq/README.md <https://github.com/sandialabs/pytuq/blob/main/README.md>`_):

.. code-block:: bash
:caption: Pytuq installation script

#!/bin/bash

# 1. Clone repositories
git clone https://github.com/sandialabs/pytuq.git

# 2. Create a conda environment with python (optional, you can add to an existing env)
conda create --name pytuq
conda activate pytuq
conda install python=3.11

# 3. Install PyTUQ and requirements
cd pytuq
pip install -r requirements.txt
pip install .
conda install dill

# 4. Verify installation
conda list | grep pytuq # Should show pytuq 1.0.0

Examples
--------

C++ AMReX + PyTUQ (BASH driven)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**Prerequisites**:

- AMReX and pytuq cloned at the same directory level as amrex-tutorials
- pytuq installation described above
- GNU Parallel for task management: ``sudo apt-get install parallel`` (mpiexec option also exists in script)

.. code-block:: bash
:caption: Build AMReX appplication

cd /path/to/amrex-tutorials/ExampleCodes/UQ/HeatEquation/
make -j4

.. code-block:: bash
:caption: Run sensitivity analysis with bash script

./workflow_uqpc.x

Understanding GNU Parallel Workflow Pattern
-------------------------------------------

The ``workflow_uqpc.x`` bash script relies on the user augmenting their codes to write outputs of interest to ASCII text files.
In this case, the ``main.cpp`` was modified from the ``amrex-tutorials/GuidedTutorials/HeatEquation_Simple/main.cpp`` in the following ways:

First, support for parsing ``diffusion_coeff``, ``init_amplitude``, and ``init_variance`` from the input file and command line were added.

Second, support for writing outputs of interest to ASCII text files is added. The ``datalog_filename`` input parameter is generated by the bash
script to give each simulation output a unique identifier.
The ``datalog_int`` parameter gives the user the option to write the outputs of interest at a given time step interval, but in this example,
the outputs of interest after the final step are those that matter, and are extracted by the bash script to create a master output file
containing a separate set of simulation outputs of interest in each row.

The bash script calls PyTUQ scripts that generate an input parameter files for training and testing (``ptrain.txt`` and ``ptest.txt``)
based on polynomial chaos settings, and then uses GNU Parallel to run multiple simulations
efficiently and collect outputs into results files (``ytrain.txt`` and ``ytest.txt``) that PyTUQ can use for surrogate model fitting.

Understanding the Output
------------------------

| `pnames.txt`, `outnames.txt`
| -names of input and output parameters

| `param_margpc.txt`
| -Each row contains the mean and standard deviation for an uncertain input parameter

| `qtrain.txt`, `qtest.txt`
| -each row is a separate set of normal random variables used to generate uncertain inputs

| `ptrain.txt`, `ptest.txt`, `pall.txt`
| -each row is a separate set of input parameters for each simulation

| `stdoutlog_train##.txt`, `stdoutlog_test##.txt`
| -All standard output from AMReX simulations for training and testing data. The numbers refer to separate simulations.

| `datalog_train##.txt`, `datalog_test##.txt`
| -Specifically-chosen output from AMReX simulations for training and testing data. In this example it reports the outputs (max, mean, standard deviation, and specific cell temperature) at user-specified intervals.

| `ytrain.txt`, `ytest.txt`, `yall.txt`
| -agglomeration of outputs of interest from all simulations

| `results.pk`
| -Python pickle file encapsulating the results

| `labels.txt`
| -list of labels of simulation types (training or testing) for diagnostic/plot generation purposes

| `xx_<INVAR1>_<INVAR2>.png`
| -scatter plot of 2 inputs for training and testing

| `pcoord_1.png`, `pcoord_1_lab_Testing.png`, `pcoord_1_lab_Training.png`
| -graphical representation of how inputs correlate to outputs for each individual simulation

| `yx_<OUTVAR>.png`, `yx_<OUTVAR>_log.png`
| -scatter plots of output as a function of each input

| `yxx_#.png`
| -scatter plots of output a function of multiple inputs

| `pdf_tri_inputs.png`, `pdf_tri_output.png`
| -PDFs of inputs and outputs

| `ensemble.png`
| -graphical display of all output values

| `idm_#_training.png`, `idm_#_testing.png`
| -graphical display of output values

| `dm_#.png`
| -”data vs model” parity plots for each output; compares the predicted values from a surrogate model or approximation against the true or actual values from the full computational model

| `fit_s#_training.png`, `fit_s#_testing.png`
| -Shows model vs PC approximation for a single simulation.

| `pdf_output_#.png`, `pdf_joyplot.png`
| -PDF of output variables

| `allsens_main.txt`, `sens_main.png`
| -raw data and plot for parameter sensitivities

| `jsens_#.png`, `Jsens_ave.png`
| -joint sensitivities of output with respect to inputs

| `sensmat_main.png`
| -sensitivity matrix

| `pcslices_o#.png`
| -polynomial chaos fits

| `pccont_o#_d#_d#.png`
| -polynomial chaos fits of output variables with respect to two input variables


Additional Resources
--------------------

**PyTUQ Resources:**

- `PyTUQ Documentation <https://sandialabs.github.io/pytuq>`_
- `PyTUQ Examples directory <https://github.com/sandialabs/pytuq/tree/main/examples>`_
- eebaill, ksargsyan, & Bert Debusschere. (2025). sandialabs/pytuq: v1.0.0z (v1.0.0z). Zenodo. https://doi.org/10.5281/zenodo.17110054

**AMReX Resources:**

- `AMReX Documentation <https://amrex-codes.github.io/amrex/docs_html/>`_

**Uncertainty Quantification Theory:**

- Ghanem, Roger, David Higdon, and Houman Owhadi, eds. *Handbook of Uncertainty Quantification*. Vol. 6. New York: Springer, 2017. (For workflow, plotting, and analysis specifics)
48 changes: 48 additions & 0 deletions Docs/source/HeatEquation_UQ_MathematicalDetails.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.. _pytuq_mathematical_details:

Parameter Sensitivity via Polynomial Chaos
-------------------------------------------

In this example, PyTUQ constructs polynomial chaos expansions to analyze how uncertain physical parameters affect simulation outputs in a heat diffusion problem.

The Heat Equation
^^^^^^^^^^^^^^^^^

The governing equation for this tutorial is the heat diffusion equation:

.. math:: \frac{\partial\phi}{\partial t} = D\nabla^2 \phi,

with initial condition

.. math:: \phi_0 = 1 + A e^{-r^2 / (2V)},

where ``r`` is the distance from the center of the domain, and with uncertain parameters ``diffusion_coeff`` (:math:`D`), ``init_amplitude`` (:math:`A`), and ``init_variance`` (:math:`V`).



Quantities of Interest (Outputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The simulation extracts four statistical quantities at the final timestep:

1. **max_temp**: Maximum temperature in the domain
2. **mean_temp**: Average temperature across all cells
3. **std_temp**: Standard deviation of temperature
4. **cell_temp**: Temperature in a particular cell, in this case, cell (9,9,9)

These outputs are computed in ``main.cpp``and written to the datalog file.

PyTUQ Workflow
^^^^^^^^^^^^^^

PyTUQ uses polynomial chaos expansion to construct a surrogate model:

1. **Parameter sampling**: Generate sample points in the 3D parameter space based on the specified distributions
2. **Forward simulations**: Run the AMReX heat equation solver for each parameter set
3. **Surrogate construction**: Fit polynomial chaos coefficients to map inputs → outputs
4. **Sensitivity analysis**: Compute Sobol indices to identify which parameters most influence each output

The connection is:

- **Inputs**: ParmParse parameters (``diffusion_coeff``, ``init_amplitude``, ``init_variance``) specified in ``inputs`` file or command line
- **Outputs**: Quantities of interest extracted from datalog files
5 changes: 5 additions & 0 deletions Docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ def get_amrex_version():
extensions = ['sphinx.ext.mathjax',
'sphinx.ext.githubpages',
'sphinx.ext.viewcode',
'sphinx_design',
'sphinx_copybutton',
'sphinx.ext.intersphinx',
'sphinx_rtd_theme']

Expand All @@ -51,6 +53,9 @@ def get_amrex_version():
# Add any paths that contain templates here, relative to this directory.
templates_path = ['ytemplates']

# sphinx-copybutton configuration
copybutton_exclude = '.linenos, .gp, .go'

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
Expand Down
4 changes: 4 additions & 0 deletions Docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ sorted by the following categories:
- :ref:`GPU<tutorials_gpu>` -- Offload work to the GPUs using AMReX tools.
- :ref:`Linear Solvers<tutorials_linearsolvers>` -- Examples of several linear solvers.
- :ref:`ML/PYTORCH<tutorials_ml>` -- Use of pytorch models to replace point-wise computational kernels.
- :ref:`UQ with pytuq<tutorials_uq>` -- Use of pytuq methods to perform generalized sensitivity analysis.
- :ref:`MPMD<tutorials_mpmd>` -- Usage of AMReX-MPMD (Multiple Program Multiple Data) framework.
- :ref:`MUI<tutorials_mui>` -- Incorporates the MxUI/MUI (Multiscale Universal interface) frame into AMReX.
- :ref:`Particles<tutorials_particles>` -- Basic usage of AMReX's particle data structures.
Expand All @@ -72,6 +73,7 @@ sorted by the following categories:
GPU_Tutorial
LinearSolvers_Tutorial
ML_Tutorial
HeatEquation_UQ
MPMD_Tutorials
MUI_Tutorial
Particles_Tutorial
Expand All @@ -97,6 +99,8 @@ sorted by the following categories:

.. _`Linear Solvers`: LinearSolvers_Tutorial.html

.. _`UQ`: UQ_Tutorial.html

.. _`MPMD`: MPMD_Tutorials.html

.. _`MUI`: MUI_Tutorial.html
Expand Down
16 changes: 16 additions & 0 deletions ExampleCodes/UQ/HeatEquation/GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# AMREX_HOME defines the directory in which we will find all the AMReX code.
AMREX_HOME ?= ../../../../amrex

DEBUG = FALSE
USE_MPI = TRUE
USE_OMP = FALSE
COMP = gnu
DIM = 3

include $(AMREX_HOME)/Tools/GNUMake/Make.defs

include ./Make.package

include $(AMREX_HOME)/Src/Base/Make.package

include $(AMREX_HOME)/Tools/GNUMake/Make.rules
2 changes: 2 additions & 0 deletions ExampleCodes/UQ/HeatEquation/Make.package
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CEXE_sources += main.cpp

16 changes: 16 additions & 0 deletions ExampleCodes/UQ/HeatEquation/inputs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Grid/Domain parameters
n_cell = 32 # number of cells on each side of domain
max_grid_size = 16 # size of each box (or grid)

# Time stepping parameters
nsteps = 100 # total steps in simulation
dt = 5.e-8 # time step

# Output control
plot_int = -1 # how often to write plotfile (-1 = no plots)
datalog_int = -1 # how often to write datalog (-1 = no regular output)

# Physics parameters (these are what we vary for UQ and values here will be overwritten
diffusion_coeff = 100. # diffusion coefficient for heat equation
init_amplitude = 1. # amplitude of initial temperature profile
init_variance = 0.01 # variance of initial temperature profile
Loading
Loading