Skip to content

Commit

Permalink
Merge branch 'openmc-dev:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
marquezj committed Jul 3, 2023
2 parents cbad9fc + 382bcb2 commit 5e500f7
Show file tree
Hide file tree
Showing 352 changed files with 15,021 additions and 11,411 deletions.
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Bug report
about: Report a bug that is preventing proper operation
title: ''
labels: Bugs
assignees: ''

---

<!--
If you are a user of OpenMC and are running into trouble with the code or are
seeking general user support, we highly recommend posting on the OpenMC
discourse forum first. GitHub issues should be used specifically for bug reports
and feature requests.
https://openmc.discourse.group/
-->

## Bug Description
<!--A clear and concise description of the problem (Note: A missing feature is not a bug).-->


## Steps to Reproduce
<!--Steps to reproduce the behavior (input file, or modifications to an existing input file, etc.)-->


## Environment
<!--Operating system, OpenMC version, how OpenMC was installed, nuclear data being used, etc.-->
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Troubleshooting and User Support
url: https://openmc.discourse.group/
about: For user support and troubleshooting, please use our Discourse forum
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Documentation improvement
about: Found something incomplete or incorrect in our documentation?
title: ''
labels: Documentation
assignees: ''

---

<!--Describe the issue with the documentation and include a URL to the corresponding page-->
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest a new feature or enhancement to existing capabilities
title: ''
labels: ''
assignees: ''

---

## Description
<!--What is the feature or enhancement?-->


## Alternatives
<!--If alternative solutions have been considered, describe them here and the reasoning for the chosen solution --->


## Compatibility
<!--Will the enhancement change existing APIs or add something new?-->
24 changes: 24 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--
If you are a first-time contributor to OpenMC, please have a look at our
contributing guidelines:
https://github.com/openmc-dev/openmc/blob/develop/CONTRIBUTING.md
-->

# Description

Please include a summary of the change and which issue is fixed if applicable. Please also include relevant motivation and context.

Fixes # (issue)

# Checklist

- [ ] I have performed a self-review of my own code
- [ ] I have run [clang-format](https://docs.openmc.org/en/latest/devguide/styleguide.html#automatic-formatting) on any C++ source files (if applicable)
- [ ] I have followed the [style guidelines](https://docs.openmc.org/en/latest/devguide/styleguide.html#python) for Python source files (if applicable)
- [ ] I have made corresponding changes to the documentation (if applicable)
- [ ] I have added tests that prove my fix is effective or that my feature works (if applicable)
<!--
While tests will automatically be checked by CI, it is good practice to
ensure that they pass locally first. See instructions here:
https://docs.openmc.org/en/latest/devguide/tests.html
-->
25 changes: 25 additions & 0 deletions .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: C++ Format Check

on: pull_request

jobs:
cpp-linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: file
files-changed-only: true
tidy-checks: '-*'
version: '15' # clang-format version
file-annotations: true
step-summary: true
extensions: 'cpp,h'

- name: Failure Check
if: steps.linter.outputs.checks-failed > 0
run: echo "Some files failed the formatting check! See job summary and file annotations for more info" && exit 1
1 change: 1 addition & 0 deletions docs/requirements-rtd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ h5py
pandas
uncertainties
matplotlib
lxml
17 changes: 5 additions & 12 deletions docs/source/devguide/docbuild.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,14 @@ Building Sphinx Documentation
=============================

In order to build the documentation in the ``docs`` directory, you will need to
have the `Sphinx <https://www.sphinx-doc.org/en/master/>`_ third-party Python
package. The easiest way to install Sphinx is via pip:
have the several third-party Python packages installed, including `Sphinx
<https://www.sphinx-doc.org/en/master/>`_. To install the necessary
prerequisites, provide the optional "docs" dependencies when installing OpenMC's
Python API. That is, from the root directory of the OpenMC repository:

.. code-block:: sh
pip install sphinx
Additionally, you will need several Sphinx extensions that can be installed
directly with pip:

.. code-block:: sh
pip install sphinx-numfig
pip install sphinxcontrib-katex
pip install sphinxcontrib-svg2pdfconverter
python -m pip install .[docs]
-----------------------------------
Building Documentation as a Webpage
Expand Down
18 changes: 7 additions & 11 deletions docs/source/devguide/tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ Prerequisites
OpenMC in development/editable mode. With setuptools, this is accomplished by
running::

python setup.py develop

or using pip (recommended)::

pip install -e .[test]
python -m pip install -e .[test]

- The test suite requires a specific set of cross section data in order for
tests to pass. A download URL for the data that OpenMC expects can be found
Expand Down Expand Up @@ -83,13 +79,13 @@ does not exist run::

touch test_<name-of-header-file>.cpp

The file must be added to the CMake build system in
``tests/cpp_unit_tests/CMakeLists.txt``. ``test_<name-of-header-file>`` should
be added to ``TEST_NAMES``.
The file must be added to the CMake build system in
``tests/cpp_unit_tests/CMakeLists.txt``. ``test_<name-of-header-file>`` should
be added to ``TEST_NAMES``.

To add a test case to ``test_<name-of-header-file>.cpp`` ensure
``catch2/catch_test_macros.hpp`` is included. A unit test can then be added
using the ``TEST_CASE`` macro and the ``REQUIRE`` assertion from Catch2.
To add a test case to ``test_<name-of-header-file>.cpp`` ensure
``catch2/catch_test_macros.hpp`` is included. A unit test can then be added
using the ``TEST_CASE`` macro and the ``REQUIRE`` assertion from Catch2.

Adding Tests to the Regression Suite
------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/source/devguide/workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ pip_. From the root directory of the OpenMC repository, run:

.. code-block:: sh
pip install -e .[test]
python -m pip install -e .[test]
This installs the OpenMC Python package in `"editable" mode
<https://pip.pypa.io/en/stable/cli/pip_install/#editable-installs>`_ so that 1)
Expand Down
7 changes: 0 additions & 7 deletions docs/source/io_formats/depletion_results.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,3 @@ The current version of the depletion results file format is 1.1.
**/reactions/<name>/**

:Attributes: - **index** (*int*) -- Index user in results for this reaction

.. note::

The reaction rates for some isotopes not originally present may
be non-zero, but should be negligible compared to other atoms.
This can be controlled by changing the
:class:`openmc.deplete.Operator` ``dilute_initial`` attribute.
1 change: 1 addition & 0 deletions docs/source/io_formats/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ Output Files
track
voxel
volume
weight_windows
2 changes: 2 additions & 0 deletions docs/source/io_formats/particle_restart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ The current version of the particle restart file format is 2.0.
- **run_mode** (*char[]*) -- Run mode used, either 'fixed source',
'eigenvalue', or 'particle restart'.
- **id** (*int8_t*) -- Unique identifier of the particle.
- **type** (*int*) -- Particle type (0=neutron, 1=photon, 2=electron,
3=positron)
- **weight** (*double*) -- Weight of the particle.
- **energy** (*double*) -- Energy of the particle in eV for
continuous-energy mode, or the energy group of the particle for
Expand Down
104 changes: 88 additions & 16 deletions docs/source/io_formats/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -449,24 +449,27 @@ attributes/sub-elements:

*Default*: 1.0

:type:
Indicator of source type. One of ``independent``, ``file``, or ``compiled``.

:particle:
The source particle type, either ``neutron`` or ``photon``.

*Default*: neutron

:file:
If this attribute is given, it indicates that the source is to be read from
a binary source file whose path is given by the value of this element. Note,
the number of source sites needs to be the same as the number of particles
simulated in a fission source generation.
If this attribute is given, it indicates that the source type is ``file``,
meaning particles are to be read from a binary source file whose path is
given by the value of this element.

*Default*: None

:library:
If this attribute is given, it indicates that the source is to be
instantiated from an externally compiled source function. This source can be
as complex as is required to define the source for your problem. The library
has a few basic requirements:
If this attribute is given, it indicates that the source type is
``compiled``, meaning that particles are instantiated from an externally
compiled source function. This source can be completely customized as needed
to define the source for your problem. The library has a few basic
requirements:

* It must contain a class that inherits from ``openmc::Source``;
* The class must implement a function called ``sample()``;
Expand All @@ -476,14 +479,12 @@ attributes/sub-elements:

More documentation on how to build sources can be found in :ref:`custom_source`.

*Default*: None

:parameters:
If this attribute is given, it provides the parameters to pass through to the
class generated using the ``library`` parameter . More documentation on how to
build parametrized sources can be found in :ref:`parameterized_custom_source`.

*Default*: None
If this attribute is given, it indicated that the source type is
``compiled``. Its value provides the parameters to pass through to the class
generated using the ``library`` parameter. More documentation on how to
build parametrized sources can be found in
:ref:`parameterized_custom_source`.

:space:
An element specifying the spatial distribution of source sites. This element
Expand Down Expand Up @@ -1066,7 +1067,7 @@ sub-elements/attributes:
:particle_type:
The particle that the weight windows will apply to (e.g., 'neutron')

*Default*: None
*Default*: 'neutron'

:energy_bins:
Monotonically increasing list of bounding energies in [eV] to be used for
Expand Down Expand Up @@ -1104,3 +1105,74 @@ sub-elements/attributes:
Threshold below which particles will be terminated

*Default*: :math:`10^{-38}`

--------------------------------------
``<weight_window_generator>`` Element
--------------------------------------

The ``<weight_window_generator>`` element provides information for creating a set of
mesh-based weight windows.

:mesh:
ID of a mesh that is to be used for the weight windows spatial bins

*Default*: None

:energy_bounds:
The weight window energy bounds. If not present, the max/min energy of the
cross section data is applied as a single energy bin.

*Default*: None

:particle_type:
The particle that the weight windows will apply to (e.g., 'neutron')

*Default*: neutron

:max_realizations:
The number of tally realizations after which the weight windows will stop updating.

*Default*: 1

:update_interval:
The number of tally realizations between weight window updates.

*Default*: 1

:on_the_fly:
Controls whether or not the tally results are reset after a weight window update.

*Default*: true

:method:
Method used to update weight window values (currently only 'magic' is supported)

*Default*: magic

:update_parameters:
Method-specific update parameters used when generating/updating weight windows.

For MAGIC:

:value:
The type of tally value to use when creating weight windows (one of 'mean' or 'rel_err')

*Default*: 'mean'

:threshold:
The relative error threshold above which tally results will be ignored.

*Default*: 1.0

:ratio:
The ratio of the lower to upper weight window bounds.

*Default*: 5.0

--------------------------------------
``<weight_windows_file>`` Element
--------------------------------------

The ``weight_windows_file`` element has no attributes and contains the path to
a weight windows HDF5 file to load during simulation initialization.

6 changes: 5 additions & 1 deletion docs/source/io_formats/statepoint.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
State Point File Format
=======================

The current version of the statepoint file format is 17.0.
The current version of the statepoint file format is 18.1.

**/**

Expand Down Expand Up @@ -68,6 +68,8 @@ The current version of the statepoint file format is 17.0.
:Attributes: - **n_meshes** (*int*) -- Number of meshes in the problem.
- **ids** (*int[]*) -- User-defined unique ID of each mesh.

.. _mesh-spec-hdf5:

**/tallies/meshes/mesh <uid>/**

:Datasets: - **type** (*char[]*) -- Type of mesh.
Expand Down Expand Up @@ -139,6 +141,8 @@ The current version of the statepoint file format is 17.0.
- **internal** (*int*) -- Flag indicating the presence of tally
data (0) or absence of tally data (1). All user defined
tallies will have a value of 0 unless otherwise instructed.
- **multiply_density** (*int*) -- Flag indicating whether reaction
rates should be multiplied by atom density (1) or not (0).

:Datasets: - **n_realizations** (*int*) -- Number of realizations.
- **n_filters** (*int*) -- Number of filters used.
Expand Down
6 changes: 6 additions & 0 deletions docs/source/io_formats/tallies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ The ``<tally>`` element accepts the following sub-elements:
list of valid scores can be found in the :ref:`user's guide
<usersguide_scores>`.

:multiply_density:
A boolean that indicates whether reaction rate scores should be computed by
multiplying by the atom density of a nuclide present in a material.

*Default*: true

:trigger:
Precision trigger applied to all filter bins and nuclides for this tally.
It must specify the trigger's type, threshold and scores to which it will
Expand Down
Loading

0 comments on commit 5e500f7

Please sign in to comment.