Skip to content

Commit

Permalink
Merge pull request #76 from fusion-energy/develop
Browse files Browse the repository at this point in the history
using open source workflow for dagmc
  • Loading branch information
shimwell authored Feb 28, 2022
2 parents bac5618 + 1213c3c commit d742eb0
Show file tree
Hide file tree
Showing 53 changed files with 2,342 additions and 1,043 deletions.
50 changes: 41 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,44 @@ jobs:
- checkout

- run:
name: run tests
no_output_timeout: 30m
command: |
cd ..
pytest repo/tests -v --cov=tasks/ --cov-report term --cov-report xml --junitxml=test-reports/junit.xml
- store_test_results:
path: test-reports
- store_artifacts:
path: test-reports
name: test task 1
command: pytest tests/test_task_1.py -v
- run:
name: test task 2
command: pytest tests/test_task_2.py -v
- run:
name: test task 3
command: pytest tests/test_task_3.py -v
- run:
name: test task 4
command: pytest tests/test_task_4.py -v
- run:
name: test task 5
command: pytest tests/test_task_5.py -v
- run:
name: test task 6
command: pytest tests/test_task_6.py -v
- run:
name: test task 7
command: pytest tests/test_task_7.py -v
- run:
name: test task 8
command: pytest tests/test_task_8.py -v
- run:
name: test task 9
command: pytest tests/test_task_9.py -v
- run:
name: test task 10
command: pytest tests/test_task_10.py -v
- run:
name: test task 11
command: pytest tests/test_task_11.py -v
- run:
name: test task 12
command: pytest tests/test_task_12.py -v
- run:
name: test task 13
command: pytest tests/test_task_13.py -v
- run:
name: test task 14
command: pytest tests/test_task_14.py -v
57 changes: 55 additions & 2 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,59 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: run tests
- name: test task 1
run: |
pytest tests -v --cov=tasks/ --cov-report term --cov-report xml --junitxml=test-reports/junit.xml
pytest tests/test_task_1.py -v
- name: test task 2
run: |
pytest tests/test_task_2.py -v
- name: test task 3
run: |
pytest tests/test_task_3.py -v
- name: test task 4
run: |
pytest tests/test_task_4.py -v
- name: test task 5
run: |
pytest tests/test_task_5.py -v
- name: test task 6
run: |
pytest tests/test_task_6.py -v
- name: test task 7
run: |
pytest tests/test_task_7.py -v
- name: test task 8
run: |
pytest tests/test_task_8.py -v
- name: test task 9
run: |
pytest tests/test_task_9.py -v
- name: test task 10
run: |
pytest tests/test_task_10.py -v
- name: test task 11
run: |
pytest tests/test_task_11.py -v
- name: test task 12
run: |
pytest tests/test_task_12.py -v
- name: test task 13
run: |
pytest tests/test_task_13.py -v
- name: test task 14
run: |
pytest tests/test_task_14.py -v
14 changes: 8 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@

# openmc files
*.xml

tallies.out

*.h5

# DAGMC files
*.h5m

# Cubit files
*.trelis

*.jou

*.log
*.cub

# Python library files
*.so

# Paraview files
*.vtk
*.vtp
*.pvtp
Expand All @@ -26,8 +27,9 @@ __pycache__/

.ipynb_checkpoints/

# CAD files
*.brep
*.stl
*.stp
*.svg
*.log
*.png
42 changes: 19 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

# for local testing I tend to use this build command
# docker build -t neutronics-workshop --build-arg compile_cores=14 --build-arg build_double_down=ON .
# and then run with this command
# docker run -p 8888:8888 neutronics-workshop

# This can't be done currently as the base images uses conda installs for moab / dagmc which don't compile with OpenMC
FROM ghcr.io/openmc-data-storage/miniconda3_4.9.2_endfb-7.1_nndc_tendl_2019:latest as dependencies
Expand Down Expand Up @@ -58,8 +60,6 @@ RUN apt-get --yes install libeigen3-dev \
hdf5-tools \
imagemagick \
cmake \
# libeigen3-dev required for DAGMC
libeigen3-dev \
# libnetcdf-dev is needed to allow NETCDF on MOAB which helps with tet meshes in OpenMC
libnetcdf-dev \
# libtbb-dev required for DAGMC
Expand Down Expand Up @@ -87,9 +87,14 @@ RUN apt-get --yes install libeigen3-dev \
# installing cadquery and jupyter
RUN conda install jupyter -y && \
conda install -c conda-forge -c python python=3.8 && \
conda install -c conda-forge -c cadquery cadquery=2.1
# conda install -c conda-forge -c cadquery cadquery=2.2
# commented out until next CQ release
conda install -c conda-forge -c cadquery cadquery=master
# cadquery master dose not appear to show the .solid in the notebook

# Installing Gmsh
RUN conda install -c conda-forge gmsh
RUN apt-get install libxft2

# Python libraries used in the workshop
RUN pip install cmake\
Expand Down Expand Up @@ -148,7 +153,7 @@ RUN if [ "$build_double_down" = "ON" ] ; \
# Clone and install MOAB
RUN mkdir MOAB && \
cd MOAB && \
git clone --single-branch --branch 5.3.0 --depth 1 https://bitbucket.org/fathomteam/moab.git && \
git clone --single-branch --branch 5.3.1 --depth 1 https://bitbucket.org/fathomteam/moab.git && \
mkdir build && \
cd build && \
cmake ../moab -DENABLE_HDF5=ON \
Expand Down Expand Up @@ -184,8 +189,8 @@ RUN if [ "$build_double_down" = "ON" ] ; \
mkdir build ; \
cd build ; \
cmake .. -DMOAB_DIR=/MOAB \
-DCMAKE_INSTALL_PREFIX=.. \
-DEMBREE_DIR=/embree ; \
-DCMAKE_INSTALL_PREFIX=.. \
-DEMBREE_DIR=/embree ; \
make -j"$compile_cores" ; \
make -j"$compile_cores" install ; \
rm -rf /double-down/build /double-down/double-down ; \
Expand All @@ -195,12 +200,7 @@ RUN if [ "$build_double_down" = "ON" ] ; \
# DAGMC version develop install from source
RUN mkdir DAGMC && \
cd DAGMC && \
git clone --single-branch --branch develop https://github.com/svalinn/DAGMC.git && \
# git clone --single-branch --branch develop --depth 1 https://github.com/svalinn/DAGMC.git && \
cd DAGMC && \
# this commit is from this PR https://github.com/svalinn/DAGMC/pull/786
git checkout fbd0cdbad100a0fd8d80de42321e69d09fdd67f4 && \
cd .. && \
git clone --single-branch --branch v3.2.1 --depth 1 https://github.com/svalinn/DAGMC.git && \
mkdir build && \
cd build && \
cmake ../DAGMC -DBUILD_TALLY=ON \
Expand All @@ -224,18 +224,14 @@ RUN wget https://github.com/mit-crpg/WMP_Library/releases/download/v1.1/WMP_Libr

# installs OpenMc from source
RUN cd /opt && \
# git clone --single-branch --branch model_lib_fix --depth 1 https://github.com/fusion-energy/openmc.git && \
git clone --single-branch --branch develop https://github.com/openmc-dev/openmc.git && \
# git clone --single-branch --branch v0.12.1 --depth 1 https://github.com/openmc-dev/openmc.git && \
git clone --single-branch --branch v0.13.0 --depth 1 https://github.com/openmc-dev/openmc.git && \
cd openmc && \
# this commit is from this PR https://github.com/openmc-dev/openmc/pull/1900
git checkout 0157dc219ff8dca814859b3140c6cef1e78cdee1 && \
mkdir build && \
cd build && \
cmake -Doptimize=on \
-Ddagmc=ON \
-DDAGMC_ROOT=/DAGMC \
-DHDF5_PREFER_PARALLEL=off .. && \
-DHDF5_PREFER_PARALLEL=off .. && \
make -j"$compile_cores" && \
make -j"$compile_cores" install && \
cd /opt/openmc/ && \
Expand All @@ -251,20 +247,20 @@ ENV OPENMC_CROSS_SECTIONS=/nuclear_data/cross_sections.xml


# python packages from the neutronics workflow
RUN pip install neutronics_material_maker \
RUN pip install neutronics_material_maker[density] \
openmc-plasma-source \
remove_dagmc_tags \
paramak \
cad_to_h5m \
stl_to_h5m \
openmc-dagmc-wrapper \
openmc-tally-unit-converter \
regular_mesh_plotter \
spectrum_plotter \
openmc_source_plotter \
dagmc_bounding_box \
openmc_mesh_tally_to_vtk

# installing a development version of the paramak that allows exporting to h5m files
RUN conda install -c fusion-energy -c cadquery -c conda-forge paramak_develop


# an older version of openmc is need to provide an older executable
# this particular exectuable allows an inital_source.h5 to be written
# a specific openmc executable can be called using model.run(openmc_exec=path)
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ some motivation for learning neutronics.

<p align="center"><a href="https://youtu.be/HH-poTG-FxM" target="_blank"><img src="https://user-images.githubusercontent.com/8583900/144746742-3e31e0ee-6380-4db7-b8ea-0b1c302d497b.png" height="400" /></a></p>


:point_right: [Try the workshop in your browser](https://neutronics-workshop-4zf6u4tg6a-lz.a.run.app/)

# History
Expand All @@ -38,8 +37,6 @@ also welcome as pull requests to the develop branch.
The resource has proven most useful as it is one of the few open source and
accessible fusion neutronics training resources.



## Installation

There are video tutorials for this section which accompany the step by step
Expand All @@ -54,7 +51,6 @@ instructions below.
[Windows](https://hub.docker.com/editions/community/docker-ce-desktop-windows),
including the part where you enable docker use as a non-root user.


2. Pull the docker image from the store by typing the following command in a
terminal window, or Windows users might prefer PowerShell.

Expand Down Expand Up @@ -128,5 +124,7 @@ map which is great for working through the workshop with colleagues.
| [Task 10 - Making CAD geometry](https://github.com/fusion-energy/neutronics-workshop/tree/main/tasks/task_10_making_CAD_geometry) | Parametric CAD geometry, Paramak, Geometry visualisation | [link](https://www.youtube.com/watch?v=Bn_TcJSOvaA) |
| [Task 11 - CAD Cell tallies](https://github.com/fusion-energy/neutronics-workshop/tree/main/tasks/task_11_CAD_cell_tally_heat) | CAD-based neutronics, Cell tallies, DAGMC, Heating | |
| [Task 12 - CAD Mesh tallies](https://github.com/fusion-energy/neutronics-workshop/tree/main/tasks/task_12_CAD_mesh_fast_flux) | CAD-based neutronics, Mesh tallies, Paramak, DAGMC, Fast flux | |
| [Task 13 - Techniques for sampling parameter space](https://github.com/fusion-energy/neutronics-workshop/tree/main/tasks/task_13_parameter_study_sampling) | Sampling, Interpolation, Multi-dimensional parameter studies | |
| [Task 14 - Parameter study optimisation](https://github.com/fusion-energy/neutronics-workshop/tree/main/tasks/task_14_parameter_study_optimisation) | Data science machine learning approaches | |
| [Task 13 - Variance_reduction](https://github.com/fusion-energy/neutronics-workshop/tree/develop/tasks/task_13_variance_reduction) | Variance reduction, weight windows | |
| [Task 14 - Activation transmutation](https://github.com/fusion-energy/neutronics-workshop/tree/develop/tasks/task_14_activation_transmutation) | Isotope build up and tally variation as a function of time | |
| [Task 15 - Techniques for sampling parameter space](https://github.com/fusion-energy/neutronics-workshop/tree/main/tasks/task_15_parameter_study_sampling) | Sampling, Interpolation, Multi-dimensional parameter studies | |
| [Task 16 - Parameter study optimisation](https://github.com/fusion-energy/neutronics-workshop/tree/main/tasks/task_16_parameter_study_optimisation) | Data science machine learning approaches | |
Loading

0 comments on commit d742eb0

Please sign in to comment.