mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
merged develop into cmfd_rbgs
This commit is contained in:
commit
7c6bfe78a3
63 changed files with 6113 additions and 927 deletions
9
.gitignore
vendored
9
.gitignore
vendored
|
|
@ -21,6 +21,12 @@ src/openmc
|
|||
docs/build
|
||||
docs/source/_images/*.pdf
|
||||
|
||||
# Source build
|
||||
src/build
|
||||
|
||||
# build from src/utils/setup.py
|
||||
src/utils/build
|
||||
|
||||
# xml-fortran reader
|
||||
src/xml-fortran/xmlreader
|
||||
|
||||
|
|
@ -29,3 +35,6 @@ src/templates/*.f90
|
|||
|
||||
# Test results error file
|
||||
results_error.dat
|
||||
|
||||
# HDF5 files
|
||||
*.h5
|
||||
|
|
|
|||
1716
data/cross_sections_nndc.xml
Normal file
1716
data/cross_sections_nndc.xml
Normal file
File diff suppressed because it is too large
Load diff
96
data/get_nndc_data.py
Executable file
96
data/get_nndc_data.py
Executable file
|
|
@ -0,0 +1,96 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import print_function
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tarfile
|
||||
|
||||
try:
|
||||
from urllib.request import urlopen
|
||||
except ImportError:
|
||||
from urllib2 import urlopen
|
||||
|
||||
baseUrl = 'http://www.nndc.bnl.gov/endf/b7.1/aceFiles/'
|
||||
files = ['ENDF-B-VII.1-neutron-293.6K.tar.gz',
|
||||
'ENDF-B-VII.1-neutron-300K.tar.gz',
|
||||
'ENDF-B-VII.1-neutron-900K.tar.gz',
|
||||
'ENDF-B-VII.1-neutron-1500K.tar.gz',
|
||||
'ENDF-B-VII.1-tsl.tar.gz']
|
||||
block_size = 16384
|
||||
|
||||
# ==============================================================================
|
||||
# DOWNLOAD FILES FROM NNDC SITE
|
||||
|
||||
filesComplete = []
|
||||
for f in files:
|
||||
# Establish connection to URL
|
||||
url = baseUrl + f
|
||||
req = urlopen(url)
|
||||
|
||||
# Get file size from header
|
||||
file_size = int(req.info().getheaders('Content-Length')[0])
|
||||
downloaded = 0
|
||||
|
||||
# Check if file already downloaded
|
||||
if os.path.exists(f):
|
||||
if os.path.getsize(f) == file_size:
|
||||
print('Skipping ' + f)
|
||||
filesComplete.append(f)
|
||||
continue
|
||||
else:
|
||||
if sys.version_info[0] < 3:
|
||||
overwrite = raw_input('Overwrite {0}? ([y]/n) '.format(f))
|
||||
else:
|
||||
overwrite = input('Overwrite {0}? ([y]/n) '.format(f))
|
||||
if overwrite.lower().startswith('n'):
|
||||
continue
|
||||
|
||||
# Copy file to disk
|
||||
print('Downloading {0}... '.format(f), end='')
|
||||
with open(f, 'wb') as fh:
|
||||
while True:
|
||||
chunk = req.read(block_size)
|
||||
if not chunk: break
|
||||
fh.write(chunk)
|
||||
downloaded += len(chunk)
|
||||
status = '{0:10} [{1:3.2f}%]'.format(downloaded, downloaded * 100. / file_size)
|
||||
print(status + chr(8)*len(status), end='')
|
||||
print('')
|
||||
filesComplete.append(f)
|
||||
|
||||
# ==============================================================================
|
||||
# EXTRACT FILES FROM TGZ
|
||||
|
||||
for f in files:
|
||||
if not f in filesComplete:
|
||||
continue
|
||||
|
||||
# Extract files
|
||||
suffix = f[f.rindex('-') + 1:].rstrip('.tar.gz')
|
||||
with tarfile.open(f, 'r') as tgz:
|
||||
print('Extracting {0}...'.format(f))
|
||||
tgz.extractall(path='nndc/' + suffix)
|
||||
|
||||
# ==============================================================================
|
||||
# COPY CROSS_SECTIONS.XML
|
||||
|
||||
print('Copying cross_sections_nndc.xml...')
|
||||
shutil.copyfile('cross_sections_nndc.xml', 'nndc/cross_sections.xml')
|
||||
|
||||
# ==============================================================================
|
||||
# PROMPT USER TO DELETE .TAR.GZ FILES
|
||||
|
||||
# Ask user to delete
|
||||
if sys.version_info[0] < 3:
|
||||
response = raw_input('Delete *.tar.gz files? ([y]/n) ')
|
||||
else:
|
||||
response = input('Delete *.tar.gz files? ([y]/n) ')
|
||||
|
||||
# Delete files if requested
|
||||
if not response or response.lower().startswith('y'):
|
||||
for f in files:
|
||||
if os.path.exists(f):
|
||||
print('Removing {0}...'.format(f))
|
||||
os.remove(f)
|
||||
|
|
@ -15,6 +15,9 @@ work with a few common cross section sources.
|
|||
- **cross_sections_ascii.xml** -- This file matches ENDF/B-VII.0 cross sections
|
||||
distributed with MCNP5 / MCNP6 beta.
|
||||
|
||||
- **cross_sections_nndc.xml** -- This file matches ENDF/B-VII.1 cross sections
|
||||
distributed from the `NNDC website`_.
|
||||
|
||||
- **cross_sections_serpent.xml** -- This file matches ENDF/B-VII.0 cross
|
||||
sections distributed with Serpent 1.1.7.
|
||||
|
||||
|
|
@ -31,3 +34,4 @@ element in your settings.xml, or set the CROSS_SECTIONS environment variable to
|
|||
the full path of the cross_sections.xml file.
|
||||
|
||||
.. _user's guide: http://mit-crpg.github.io/openmc/usersguide/install.html#cross-section-configuration
|
||||
.. _NNDC website: http://www.nndc.bnl.gov/endf/b7.1/acefiles.html
|
||||
|
|
|
|||
BIN
docs/source/_images/3dba.png
Normal file
BIN
docs/source/_images/3dba.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
|
|
@ -48,7 +48,12 @@ following commands in a terminal:
|
|||
sudo make install
|
||||
|
||||
This will build an executable named ``openmc`` and install it (by default in
|
||||
/usr/local/bin).
|
||||
/usr/local/bin). If you do not have administrator privileges, the last command
|
||||
can be replaced with a local install, e.g.
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
make install -e prefix=$HOME/.local
|
||||
|
||||
.. _GitHub: https://github.com/mit-crpg/openmc
|
||||
.. _git: http://git-scm.com
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ bugs fixed, and known issues for each successive release.
|
|||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
notes_0.5.4
|
||||
notes_0.5.3
|
||||
notes_0.5.2
|
||||
notes_0.5.1
|
||||
|
|
|
|||
63
docs/source/releasenotes/notes_0.5.4.rst
Normal file
63
docs/source/releasenotes/notes_0.5.4.rst
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
.. _notes_0.5.4:
|
||||
|
||||
==============================
|
||||
Release Notes for OpenMC 0.5.4
|
||||
==============================
|
||||
|
||||
.. note::
|
||||
These release notes are for an upcoming release of OpenMC and are still
|
||||
subject to change.
|
||||
|
||||
-------------------
|
||||
System Requirements
|
||||
-------------------
|
||||
|
||||
There are no special requirements for running the OpenMC code. As of this
|
||||
release, OpenMC has been tested on a variety of Linux distributions, Mac OS X,
|
||||
and Microsoft Windows 7. Memory requirements will vary depending on the size of
|
||||
the problem at hand (mostly on the number of nuclides in the problem).
|
||||
|
||||
------------
|
||||
New Features
|
||||
------------
|
||||
|
||||
- New XML parsing backend (FoX)
|
||||
- Ability to write particle track files
|
||||
- Handle lost particles more gracefully (via particle track files)
|
||||
- Source sites outside geometry are resampled
|
||||
- Multiple random number generator streams
|
||||
- plot_mesh_tally.py utility converted to use Tkinter rather than PyQt
|
||||
- Script added to download ACE data from NNDC
|
||||
- Mixed ASCII/binary cross_sections.xml now allowed
|
||||
- Expanded options for writing source bank
|
||||
- Re-enabled ability to use source file as starting source
|
||||
|
||||
---------
|
||||
Bug Fixes
|
||||
---------
|
||||
|
||||
- 32c03c_: Check for valid data in cross_sections.xml
|
||||
- c71ef5_: Fix bug in statepoint.py
|
||||
- 8884fb_: Check for all ZAIDs for S(a,b) tables
|
||||
- b38af0_: Fix XML reading on multiple levels of input
|
||||
- d28750_: Fix bug in convert_xsdir.py
|
||||
|
||||
.. _32c03c: https://github.com/mit-crpg/openmc/commit/32c03c
|
||||
.. _c71ef5: https://github.com/mit-crpg/openmc/commit/c71ef5
|
||||
.. _8884fb: https://github.com/mit-crpg/openmc/commit/8884fb
|
||||
.. _b38af0: https://github.com/mit-crpg/openmc/commit/b38af0
|
||||
.. _d28750: https://github.com/mit-crpg/openmc/commit/d28750
|
||||
|
||||
------------
|
||||
Contributors
|
||||
------------
|
||||
|
||||
This release contains new contributions from the following people:
|
||||
|
||||
- `Sterling Harper <smharper@mit.edu>`_
|
||||
- `Bryan Herman <bherman@mit.edu>`_
|
||||
- `Nick Horelik <nhorelik@mit.edu>`_
|
||||
- `Adam Nelson <nelsonag@umich.edu>`_
|
||||
- `Paul Romano <paul.k.romano@gmail.com>`_
|
||||
- `Tuomas Viitanen <tuomas.viitanen@vtt.fi>`_
|
||||
- `Jon Walsh <walshjon@mit.edu>`_
|
||||
|
|
@ -264,7 +264,9 @@ attributes/sub-elements:
|
|||
|
||||
: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
|
||||
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.
|
||||
|
||||
*Default*: None
|
||||
|
||||
|
|
@ -348,8 +350,10 @@ attributes/sub-elements:
|
|||
|
||||
The ``<state_point>`` element indicates at what batches a state point file
|
||||
should be written. A state point file can be used to restart a run or to get
|
||||
tally results at any batch. This element has the following
|
||||
attributes/sub-elements:
|
||||
tally results at any batch. The default behavior when using this tag is to
|
||||
write out the source bank in the state_point file. This behavior can be
|
||||
customized by using the ``<source_point>`` element. This element has the
|
||||
following attributes/sub-elements:
|
||||
|
||||
:batches:
|
||||
A list of integers separated by spaces indicating at what batches a state
|
||||
|
|
@ -364,19 +368,52 @@ attributes/sub-elements:
|
|||
|
||||
*Default*: None
|
||||
|
||||
``<source_point>`` Element
|
||||
--------------------------
|
||||
|
||||
The ``<source_point>`` element indicates at what batches the source bank
|
||||
should be written. The source bank can be either written out within a state
|
||||
point file or separately in a source point file. This element has the following
|
||||
attributes/sub-elements:
|
||||
|
||||
:batches:
|
||||
A list of integers separated by spaces indicating at what batches a state
|
||||
point file should be written. It should be noted that if source_separate
|
||||
tag is not set to "true", this list must be a subset of state point batches.
|
||||
|
||||
*Default*: Last batch only
|
||||
|
||||
:interval:
|
||||
A single integer :math:`n` indicating that a state point should be written
|
||||
every :math:`n` batches. This option can be given in lieu of listing
|
||||
batches explicitly. It should be noted that if source_separate tag is not
|
||||
set to "true", this value should produce a list of batches that is a subset
|
||||
of state point batches.
|
||||
|
||||
*Default*: None
|
||||
|
||||
:source_separate:
|
||||
If this element is set to "true", a separate binary source file will be
|
||||
If this element is set to "true", a separate binary source point file will be
|
||||
written. Otherwise, the source sites will be written in the state point
|
||||
directly.
|
||||
|
||||
*Default*: false
|
||||
|
||||
:source_write: If this element is set to "false", source sites are not written
|
||||
to the state point file. This can substantially reduce the size of state
|
||||
points if large numbers of particles per batch are used.
|
||||
:source_write:
|
||||
If this element is set to "false", source sites are not written
|
||||
to the state point or source point file. This can substantially reduce the
|
||||
size of state points if large numbers of particles per batch are used.
|
||||
|
||||
*Default*: true
|
||||
|
||||
:overwrite_latest:
|
||||
If this element is set to "true", a source point file containing
|
||||
the source bank will be written out to a separate file named
|
||||
``source.binary`` or ``source.h5`` depending on if HDF5 is enabled.
|
||||
This file will be overwritten at every single batch so that the latest
|
||||
source bank will be available. It should be noted that a user can set both
|
||||
this element to "true" and specify batches to write a permanent source bank.
|
||||
|
||||
``<survival_biasing>`` Element
|
||||
------------------------------
|
||||
|
||||
|
|
@ -1052,7 +1089,7 @@ sub-elements:
|
|||
the PNG format can often times reduce the file size by orders of
|
||||
magnitude without any loss of image quality. Likewise,
|
||||
high-resolution voxel files produced by OpenMC can be quite large,
|
||||
but the equivalent SILO files will by significantly smaller.
|
||||
but the equivalent SILO files will be significantly smaller.
|
||||
|
||||
*Default*: "slice"
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,15 @@ Prerequisites
|
|||
|
||||
sudo apt-get install gfortran
|
||||
|
||||
* CMake_ cross-platform build system
|
||||
|
||||
The compiling and linking of source files is handled by CMake in a
|
||||
platform-independent manner. If you are using Debian or a Debian
|
||||
derivative such as Ubuntu, you can install CMake using the following
|
||||
command::
|
||||
|
||||
sudo apt-get install cmake
|
||||
|
||||
.. admonition:: Optional
|
||||
|
||||
* An MPI implementation for distributed-memory parallel runs
|
||||
|
|
@ -74,8 +83,8 @@ Prerequisites
|
|||
OpenMC with. HDF5_ must be built with parallel I/O features if you intend
|
||||
to use HDF5_ with MPI. An example of configuring HDF5_ is listed below::
|
||||
|
||||
FC=/opt/mpich/3.0.4-gnu/bin/mpif90 CC=/opt/mpich/3.0.4-gnu/bin/mpicc \
|
||||
./configure --prefix=/opt/hdf5/1.8.11-gnu --enable-fortran \
|
||||
FC=/opt/mpich/3.1/bin/mpif90 CC=/opt/mpich/3.1/bin/mpicc \
|
||||
./configure --prefix=/opt/hdf5/1.8.12 --enable-fortran \
|
||||
--enable-fortran2003 --enable-parallel
|
||||
|
||||
You may omit ``--enable-parallel`` if you want to compile HDF5_ in serial.
|
||||
|
|
@ -88,8 +97,8 @@ Prerequisites
|
|||
requires PETSc_ to be configured with Fortran datatypes. An example of
|
||||
configuring PETSc_ is listed below::
|
||||
|
||||
./configure --prefix=/opt/petsc/3.4.2-gnu --download-f-blas-lapack \
|
||||
--with-mpi-dir=/opt/mpich/3.0.4-gnu/ --with-shared-libraries=0 \
|
||||
./configure --prefix=/opt/petsc/3.4.4 --download-f-blas-lapack \
|
||||
--with-mpi-dir=/opt/mpich/3.1 --with-shared-libraries \
|
||||
--with-fortran-datatypes
|
||||
|
||||
The BLAS/LAPACK library is not required to be downloaded and can be linked
|
||||
|
|
@ -98,6 +107,7 @@ Prerequisites
|
|||
* git_ version control software for obtaining source code
|
||||
|
||||
.. _gfortran: http://gcc.gnu.org/wiki/GFortran
|
||||
.. _CMake: http://www.cmake.org
|
||||
.. _OpenMPI: http://www.open-mpi.org
|
||||
.. _MPICH: http://www.mpich.org
|
||||
.. _HDF5: http://www.hdfgroup.org/HDF5/
|
||||
|
|
@ -131,50 +141,95 @@ switch to the source of the latest stable release, run the following commands::
|
|||
Build Configuration
|
||||
-------------------
|
||||
|
||||
All configuration for OpenMC is done within the Makefile located in
|
||||
``src/Makefile``. In the Makefile, you will see that there are a number of User
|
||||
Options which can be changed. It is recommended that you do not change anything
|
||||
else in the Makefile unless you are experienced with compiling and building
|
||||
software using Makefiles. The following parameters can be set from the User
|
||||
Options sections in the Makefile:
|
||||
Compiling OpenMC with CMake is carried out in two steps. First, ``cmake`` is run
|
||||
to determine the compiler, whether optional packages (MPI, HDF5, PETSc) are
|
||||
available, to generate a list of dependencies between source files so that they
|
||||
may be compiled in the correct order, and to generate a normal Makefile. The
|
||||
Makefile is then used by ``make`` to actually carry out the compile and linking
|
||||
commands. A typical out-of-source build would thus look something like the
|
||||
following
|
||||
|
||||
COMPILER
|
||||
This variable tells the Makefile which compiler to use. Valid options are
|
||||
gnu, intel, pgi, ibm, and cray. The default is gnu (gfortran).
|
||||
.. code-block:: sh
|
||||
|
||||
DEBUG
|
||||
mkdir src/build
|
||||
cd src/build
|
||||
cmake ..
|
||||
make
|
||||
|
||||
Note that first a build directory is created as a subdirectory of the source
|
||||
directory. The Makefile in ``src/`` will automatically perform an out-of-source
|
||||
build with default options.
|
||||
|
||||
CMakeLists.txt Options
|
||||
++++++++++++++++++++++
|
||||
|
||||
The following options are available in the CMakeLists.txt file:
|
||||
|
||||
debug
|
||||
Enables debugging when compiling. The flags added are dependent on which
|
||||
compiler is used.
|
||||
|
||||
PROFILE
|
||||
profile
|
||||
Enables profiling using the GNU profiler, gprof.
|
||||
|
||||
OPTIMIZE
|
||||
optimize
|
||||
Enables high-optimization using compiler-dependent flags. For gfortran and
|
||||
Intel Fortran, this compiles with -O3.
|
||||
|
||||
MPI
|
||||
Enables parallel runs using the Message Passing Interface. The MPI_DIR
|
||||
variable should be set to the base directory of the MPI implementation.
|
||||
|
||||
OPENMP
|
||||
openmp
|
||||
Enables shared-memory parallelism using the OpenMP API. The Fortran compiler
|
||||
being used must support OpenMP.
|
||||
|
||||
HDF5
|
||||
Enables HDF5 output in addition to normal screen and text file output. The
|
||||
HDF5_DIR variable should be set to the base directory of the HDF5
|
||||
installation.
|
||||
|
||||
PETSC
|
||||
petsc
|
||||
Enables PETSc for use in CMFD acceleration. The PETSC_DIR variable should be
|
||||
set to the base directory of the PETSc installation.
|
||||
|
||||
It is also possible to change these options from the command line itself. For
|
||||
example, if you want to compile with DEBUG turned on without actually change the
|
||||
Makefile, you can enter the following from a terminal::
|
||||
To set any of these options (e.g. turning on debug mode), the following form
|
||||
should be used:
|
||||
|
||||
make DEBUG=yes
|
||||
.. code-block:: sh
|
||||
|
||||
cmake -Ddebug=on /path/to/src
|
||||
|
||||
Compiling with MPI
|
||||
++++++++++++++++++
|
||||
|
||||
To compile with MPI, set the :envvar:`FC` environment variable to the path to
|
||||
the MPI Fortran wrapper. For example, in a bash shell:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
export FC=mpif90
|
||||
cmake /path/to/src
|
||||
|
||||
Note that in many shells, an environment variable can be set for a single
|
||||
command, i.e.
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
FC=mpif90 cmake /path/to/src
|
||||
|
||||
Compiling with HDF5
|
||||
+++++++++++++++++++
|
||||
|
||||
To compile with MPI, set the :envvar:`FC` environment variable to the path to
|
||||
the HDF5 Fortran wrapper. For example, in a bash shell:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
export FC=h5fc
|
||||
cmake /path/to/src
|
||||
|
||||
As noted above, an environment variable can typically be set for a single
|
||||
command, i.e.
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
FC=h5fc cmake /path/to/src
|
||||
|
||||
To compile with support for both MPI and HDF5, use the parallel HDF5 wrapper
|
||||
``h5pfc`` instead. Note that this requires that your HDF5 installation be
|
||||
compiled with ``--enable-parallel``.
|
||||
|
||||
Compiling on Linux and Mac OS X
|
||||
-------------------------------
|
||||
|
|
@ -189,7 +244,15 @@ the root directory of the source code:
|
|||
sudo make install
|
||||
|
||||
This will build an executable named ``openmc`` and install it (by default in
|
||||
/usr/local/bin).
|
||||
/usr/local/bin). If you do not have administrative privileges, you can install
|
||||
OpenMC locally by replacing the last command with:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
make install -e prefix=$HOME/.local
|
||||
|
||||
The ``prefix`` variable can be changed to any path for which you have
|
||||
write-access.
|
||||
|
||||
Compiling on Windows
|
||||
--------------------
|
||||
|
|
@ -202,9 +265,10 @@ a Linux-like environment for Windows. You will need to first `install
|
|||
Cygwin`_. When you are asked to select packages, make sure the following are
|
||||
selected:
|
||||
|
||||
* Devel: gcc4-core
|
||||
* Devel: gcc4-fortran
|
||||
* Devel: gcc-core
|
||||
* Devel: gcc-fortran
|
||||
* Devel: make
|
||||
* Devel: cmake
|
||||
|
||||
If you plan on obtaining the source code directly using git, select the
|
||||
following packages:
|
||||
|
|
@ -264,10 +328,27 @@ Cross Section Configuration
|
|||
|
||||
In order to run a simulation with OpenMC, you will need cross section data for
|
||||
each nuclide in your problem. Since OpenMC uses ACE format cross sections, you
|
||||
can use nuclear data that was processed with NJOY, such as that distributed with
|
||||
MCNP_ or Serpent_. The TALYS-based evaluated nuclear data library, TENDL_, is
|
||||
can use nuclear data that was processed with NJOY_, such as that distributed
|
||||
with MCNP_ or Serpent_. Several sources provide free processed ACE data as
|
||||
described below. The TALYS-based evaluated nuclear data library, TENDL_, is also
|
||||
openly available in ACE format.
|
||||
|
||||
Using ENDF/B-VII.1 Cross Sections from NNDC
|
||||
-------------------------------------------
|
||||
|
||||
The NNDC_ provides ACE data from the ENDF/B-VII.1 neutron and thermal scattering
|
||||
sublibraries at four temperatures processed using NJOY_. To use this data with
|
||||
OpenMC, a script is provided with OpenMC that will automatically download,
|
||||
extract, and set up a confiuration file:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
cd openmc/data
|
||||
python get_nndc_data.py
|
||||
|
||||
At this point, you should set the :envvar:`CROSS_SECTIONS` environment variable
|
||||
to the absolute path of the file ``openmc/data/nndc/cross_sections.xml``.
|
||||
|
||||
Using JEFF Cross Sections from OECD/NEA
|
||||
---------------------------------------
|
||||
|
||||
|
|
@ -314,6 +395,8 @@ distribution to the location of the Serpent cross sections. Then, either set the
|
|||
environment variable to the absolute path of the ``cross_sections_serpent.xml``
|
||||
file.
|
||||
|
||||
.. _NJOY: http://t2.lanl.gov/nis/codes.shtml
|
||||
.. _NNDC: http://www.nndc.bnl.gov/endf/b7.1/acefiles.html
|
||||
.. _NEA: http://www.oecd-nea.org
|
||||
.. _JEFF: http://www.oecd-nea.org/dbdata/jeff/
|
||||
.. _here: http://www.oecd-nea.org/dbdata/pubs/jeff312-cd.html
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ Data Processing and Visualization
|
|||
=================================
|
||||
|
||||
This section is intended to explain in detail the recommended procedures for
|
||||
carrying out common tasks with OpenMC. While several utilities of varying
|
||||
complexity are provided to help automate the process, in many cases it will be
|
||||
extremely beneficial to do some coding in Python to quickly obtain results. In
|
||||
these cases, and for many of the provided utilities, it is necessary for your
|
||||
Python installation to contain:
|
||||
carrying out common post-processing tasks with OpenMC. While several utilities
|
||||
of varying complexity are provided to help automate the process, in many cases
|
||||
it will be extremely beneficial to do some coding in Python to quickly obtain
|
||||
results. In these cases, and for many of the provided utilities, it is necessary
|
||||
for your Python installation to contain:
|
||||
|
||||
* [1]_ `Numpy <http://www.numpy.org/>`_
|
||||
* [1]_ `Scipy <http://www.scipy.org/>`_
|
||||
|
|
@ -41,6 +41,55 @@ Plotting in 2D
|
|||
.. image:: ../_images/atr.png
|
||||
:height: 200px
|
||||
|
||||
See below for a simple example of a plots xml file that demonstrates the
|
||||
capabilities of 2D slice plots. Here we assume that there is a ``geometry.xml``
|
||||
file containing 7 cells.
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plots>
|
||||
|
||||
<plot id="1" type="slice" color="cell" basis="xy">
|
||||
<filename> myplot </filename>
|
||||
<origin> 0 0 </origin>
|
||||
<width> 10 10 </width>
|
||||
<pixels> 2000 2000 </pixels>
|
||||
<background> 0 0 0 </background>
|
||||
<col_spec id="1" rgb="198 226 255"/>
|
||||
<col_spec id="2" rgb="255 218 185"/>
|
||||
<col_spec id="3" rgb="255 255 255"/>
|
||||
<col_spec id="4" rgb="101 101 101"/>
|
||||
<col_spec id="7" rgb="123 123 231"/>
|
||||
<mask background="255 255 255">
|
||||
<components> 1 3 4 5 6 </components>
|
||||
</mask>
|
||||
</plot>
|
||||
|
||||
</plots>
|
||||
|
||||
|
||||
In this example, OpenMC will produce a plot named ``myplot.ppm`` when run in
|
||||
plotting mode. The picture will be on the xy-plane, depicting the rectangle
|
||||
between points (-5,-5) and (5,5) with 2000 pixels along each dimension. The
|
||||
color of each pixel is determined by placing a particle at the center of that
|
||||
pixel and using OpenMC's internal ``find_cell`` routine (the same one used for
|
||||
particle tracking during simulation) to determine the cell and material at that
|
||||
location. In this example, pixels are 10/2000=0.005 cm wide, so points will be
|
||||
at (-4.9975,-4.9975), (-4.9950,-4.9975), (-4.9925,-4.9975), etc. This is pointed
|
||||
out to demonstrate that this plot may miss any features smaller than 0.005 cm,
|
||||
since they could exist between pixel centers. More pixels can be used to resolve
|
||||
finer features, but could result in larger files.
|
||||
|
||||
The ``background``, ``col_spec``, and ``mask`` elements define how to set pixel
|
||||
colors based on the cell ids at each pixel center. In this example, RGB colors
|
||||
are specified for cells 1,2,3,4, and 7, a random color will be assigned to cells
|
||||
5 and 6, and a black background color (``rgb="0 0 0"``) will be applied to
|
||||
locations where no cell is defined. However, the ``mask`` element here says that
|
||||
only cells 1,3,4,5, and 6 should be displayed, with other cells taking a white
|
||||
color (``rgb="255 255 255"``), which overrides the ``col_spec`` for cell 2 and
|
||||
the random color assigned to cell 7.
|
||||
|
||||
After running OpenMC to obtain PPM files, images should be saved to another
|
||||
format before using them elsewhere. This cuts down the size of the file by
|
||||
orders of magnitude. Most image viewers and editors that can view PPM images
|
||||
|
|
@ -53,7 +102,7 @@ Ubuntu: ``sudo apt-get install imagemagick``). Images are then converted like:
|
|||
|
||||
.. code-block:: sh
|
||||
|
||||
convert plot.ppm plot.png
|
||||
convert myplot.ppm myplot.png
|
||||
|
||||
Plotting in 3D
|
||||
--------------
|
||||
|
|
@ -61,10 +110,37 @@ Plotting in 3D
|
|||
.. image:: ../_images/3dgeomplot.png
|
||||
:height: 200px
|
||||
|
||||
See below for a simple example of a plots xml file that demonstrates the
|
||||
capabilities of 3D voxel plots.
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plots>
|
||||
|
||||
<plot id="1" type="voxel" color="mat">
|
||||
<filename> myplot </filename>
|
||||
<origin> 0 0 0 </origin>
|
||||
<width> 10 10 10 </width>
|
||||
<pixels> 500 500 500 </pixels>
|
||||
</plot>
|
||||
|
||||
</plots>
|
||||
|
||||
Voxel plots are built the same way 2D slice plots are, by determining the cell
|
||||
or material id of a particle at the center of each voxel. In this example, the
|
||||
space covered is the cube between the points (-5,-5,-5) and (5,5,5), with voxel
|
||||
centers 10/500 = 0.02 cm apart. The binary VOXEL files that are produced do not
|
||||
specify any color - instead containing only material or cell ids (material id
|
||||
in this example) - and thus the ``background``, ``col_spec``, and ``mask``
|
||||
elements are not used. If no cell is found at a voxel center, an id of -1 is
|
||||
stored.
|
||||
|
||||
The binary VOXEL files output by OpenMC can not be viewed directly by any
|
||||
existing viewers. In order to view them, they must be converted into a standard
|
||||
mesh format that can be viewed in ParaView, Visit, etc. The provided utility
|
||||
voxel.py accomplishes this for SILO:
|
||||
mesh format that can be viewed in ParaView, Visit, etc. This typically will
|
||||
compress the size of the file significantly. The provided utility voxel.py
|
||||
accomplishes this for SILO:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
|
|
@ -88,13 +164,21 @@ or
|
|||
Users can process the binary into any other format if desired by following the
|
||||
example of voxel.py. For the binary file structure, see :ref:`devguide_voxel`.
|
||||
|
||||
Once processed into a standard 3D file format, colors and masks can be defined
|
||||
using the stored id numbers to better explore the geometry. The process for
|
||||
doing this will depend on the 3D viewer, but should be straightforward.
|
||||
|
||||
.. image:: ../_images/3dba.png
|
||||
:height: 200px
|
||||
|
||||
.. note:: 3D voxel plotting can be very computer intensive for the viewing
|
||||
program (Visit, Paraview, etc.) if the number of voxels is large (>10
|
||||
million or so). Thus if you want an accurate picture that renders
|
||||
smoothly, consider using only one voxel in a certain direction. For
|
||||
instance, the 3D pin lattice figure above was generated with a
|
||||
500x500x1 voxel mesh, which allows for resolution of the cylinders
|
||||
without wasting too many voxels on the axial dimension.
|
||||
instance, the 3D pin lattice figure at the beginning of this section
|
||||
was generated with a 500x500x1 voxel mesh, which allows for resolution
|
||||
of the cylinders without wasting too many voxels on the axial
|
||||
dimension.
|
||||
|
||||
|
||||
-------------------
|
||||
|
|
|
|||
|
|
@ -79,6 +79,14 @@ with the :envvar:`CROSS_SECTIONS` environment variable. It is recommended to add
|
|||
a line in your ``.profile`` or ``.bash_profile`` setting the
|
||||
:envvar:`CROSS_SECTIONS` environment variable.
|
||||
|
||||
ERROR: Invalid usage of L(I) in ACE data; Consider using more recent data set.
|
||||
******************************************************************************
|
||||
|
||||
The cross-sections requested in ``materials.xml`` do not conform to the current
|
||||
standard format. This typically happens with fissionable nuclides in a ``.6*c``
|
||||
library as distributed with MCNP. Please try a newer library such as any from
|
||||
the ``.7*c`` set.
|
||||
|
||||
Geometry Debugging
|
||||
******************
|
||||
|
||||
|
|
@ -107,8 +115,8 @@ have many particles travelling through them there will not be many locations
|
|||
where overlaps are checked for in that region. The user should refer to the
|
||||
output after a geometry debug run to see how many checks were performed in each
|
||||
cell, and then adjust the number of starting particles or starting source
|
||||
distributions accordingly to achieve good coverage.
|
||||
|
||||
distributions accordingly to achieve good coverage.
|
||||
|
||||
ERROR: After particle __ crossed surface __ it could not be located in any cell and it did not leak.
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
|
|||
209
src/CMakeLists.txt
Normal file
209
src/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
|
||||
project(openmc Fortran)
|
||||
|
||||
# Setup output directories
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/include)
|
||||
|
||||
#===============================================================================
|
||||
# Command line options
|
||||
#===============================================================================
|
||||
|
||||
option(openmp "Enable shared-memory parallelism with OpenMP" OFF)
|
||||
option(profile "Compile with profiling flags" OFF)
|
||||
option(petsc "Enable PETSC for use in CMFD acceleration" OFF)
|
||||
option(debug "Compile with debug flags" OFF)
|
||||
option(optimize "Turn on all compiler optimization flags" OFF)
|
||||
option(verbose "Create verbose Makefiles" OFF)
|
||||
|
||||
if (verbose)
|
||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||
endif()
|
||||
|
||||
#===============================================================================
|
||||
# MPI for distributed-memory parallelism / HDF5 for binary output
|
||||
#===============================================================================
|
||||
|
||||
if($ENV{FC} MATCHES "mpi.*")
|
||||
message("-- Detected MPI wrapper: $ENV{FC}")
|
||||
add_definitions(-DMPI)
|
||||
elseif($ENV{FC} MATCHES "h5fc$")
|
||||
message("-- Detected HDF5 wrapper: $ENV{FC}")
|
||||
add_definitions(-DHDF5)
|
||||
elseif($ENV{FC} MATCHES "h5pfc$")
|
||||
message("-- Detected parallel HDF5 wrapper: $ENV{FC}")
|
||||
add_definitions(-DMPI -DHDF5)
|
||||
endif()
|
||||
|
||||
#===============================================================================
|
||||
# Set compile/link flags based on which compiler is being used
|
||||
#===============================================================================
|
||||
|
||||
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
|
||||
# GNU Fortran compiler options
|
||||
set(f90flags "-cpp -std=f2008 -fbacktrace")
|
||||
if(debug)
|
||||
set(f90flags "-g -Wall -pedantic -fbounds-check -ffpe-trap=invalid,overflow,underflow ${f90flags}")
|
||||
set(ldflags "-g")
|
||||
endif()
|
||||
if(profile)
|
||||
set(f90flags "-pg ${f90flags}")
|
||||
set(ldflags "-pg ${ldflags}")
|
||||
endif()
|
||||
if(optimize)
|
||||
set(f90flags "-O3 ${f90flags}")
|
||||
endif()
|
||||
if(openmp)
|
||||
set(f90flags "-fopenmp ${f90flags}")
|
||||
set(ldflags "-fopenmp ${ldflags}")
|
||||
endif()
|
||||
|
||||
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
|
||||
# Intel Fortran compiler options
|
||||
set(f90flags "-fpp -std08 -assume byterecl -traceback")
|
||||
if(debug)
|
||||
set(f90flags "-g -warn -ftrapuv -fp-stack-check -check all -fpe0 ${f90flags}")
|
||||
set(ldflags "-g")
|
||||
endif()
|
||||
if(profile)
|
||||
set(f90flags "-pg ${f90flags}")
|
||||
set(ldflags "-pg ${ldflags}")
|
||||
endif()
|
||||
if(optimize)
|
||||
set(f90flags "-O3 ${f90flags}")
|
||||
endif()
|
||||
if(openmp)
|
||||
set(f90flags "-openmp ${f90flags}")
|
||||
set(ldflags "-openmp ${ldflags}")
|
||||
endif()
|
||||
|
||||
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "PGI")
|
||||
# PGI Fortran compiler options
|
||||
set(f90flags "-Mpreprocess -Minform=inform -traceback")
|
||||
add_definitions(-DNO_F2008)
|
||||
if(debug)
|
||||
set(f90flags "-g -Mbounds -Mchkptr -Mchkstk ${f90flags}")
|
||||
set(ldflags "-g")
|
||||
endif()
|
||||
if(profile)
|
||||
set(f90flags "-pg ${f90flags}")
|
||||
set(ldflags "-pg ${ldflags}")
|
||||
endif()
|
||||
if(optimize)
|
||||
set(f90flags "-fast -Mipa ${f90flags}")
|
||||
endif()
|
||||
|
||||
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "XL")
|
||||
# IBM XL compiler options
|
||||
set(f90flags "-WF,-DNO_F2008 -O2")
|
||||
if(debug)
|
||||
set(f90flags "-g -C -qflag=i:i -u")
|
||||
set(ldflags "-g")
|
||||
endif()
|
||||
if(profile)
|
||||
set(f90flags "-p ${f90flags}")
|
||||
set(ldflags "-p ${ldflags}")
|
||||
endif()
|
||||
if(optimize)
|
||||
set(f90flags "-O3 ${f90flags}")
|
||||
endif()
|
||||
if(openmp)
|
||||
set(f90flags "-qsmp=omp ${f90flags}")
|
||||
set(ldflags "-qsmp=omp ${ldflags}")
|
||||
endif()
|
||||
|
||||
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Cray")
|
||||
# Cray Fortran compiler options
|
||||
set(f90flags "-e Z -m 0")
|
||||
if(debug)
|
||||
set(f90flags "-g -R abcnsp -O0 ${f90flags}")
|
||||
set(ldflags "-g")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
#===============================================================================
|
||||
# PETSc for CMFD functionality
|
||||
#===============================================================================
|
||||
|
||||
if(petsc)
|
||||
find_package(PETSc REQUIRED HINTS $ENV{PETSC_DIR}/conf)
|
||||
find_library(libpetsc petsc $ENV{PETSC_DIR}/lib)
|
||||
|
||||
# If libfblas wasn't found, search the PETSc lib directory
|
||||
if(PETSC_FBLAS_LIB STREQUAL "PETSC_FBLAS_LIB-NOTFOUND")
|
||||
find_library(PETSC_FBLAS_LIB fblas $ENV{PETSC_DIR}/lib)
|
||||
list(REMOVE_ITEM PETSC_PACKAGE_LIBS PETSC_FBLAS_LIB-NOTFOUND)
|
||||
list(INSERT PETSC_PACKAGE_LIBS 0 ${PETSC_FBLAS_LIB})
|
||||
endif()
|
||||
|
||||
# If libflapack wasn't found, search the PETSc lib directory
|
||||
if(PETSC_FLAPACK_LIB STREQUAL "PETSC_FLAPACK_LIB-NOTFOUND")
|
||||
find_library(PETSC_FLAPACK_LIB flapack $ENV{PETSC_DIR}/lib)
|
||||
list(REMOVE_ITEM PETSC_PACKAGE_LIBS PETSC_FLAPACK_LIB-NOTFOUND)
|
||||
list(INSERT PETSC_PACKAGE_LIBS 0 ${PETSC_FLAPACK_LIB})
|
||||
endif()
|
||||
|
||||
message("-- Using PETSC: ${libpetsc}")
|
||||
add_definitions(-DPETSC)
|
||||
include_directories($ENV{PETSC_DIR}/include)
|
||||
set(libraries "${libpetsc};${PETSC_PACKAGE_LIBS};${libraries}")
|
||||
endif()
|
||||
|
||||
#===============================================================================
|
||||
# git SHA1 hash
|
||||
#===============================================================================
|
||||
|
||||
execute_process(COMMAND git rev-parse -q HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
RESULT_VARIABLE GIT_SHA1_SUCCESS
|
||||
OUTPUT_VARIABLE GIT_SHA1
|
||||
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(GIT_SHA1_SUCCESS EQUAL 0)
|
||||
add_definitions(-DGIT_SHA1="${GIT_SHA1}")
|
||||
endif()
|
||||
|
||||
#===============================================================================
|
||||
# FoX Fortran XML Library
|
||||
#===============================================================================
|
||||
|
||||
file(GLOB_RECURSE source_fox xml/*.F90)
|
||||
add_library(fox STATIC ${source_fox})
|
||||
|
||||
#===============================================================================
|
||||
# Build OpenMC executable
|
||||
#===============================================================================
|
||||
|
||||
set(program "openmc")
|
||||
file(GLOB source *.F90)
|
||||
add_executable(${program} ${source})
|
||||
target_link_libraries(${program} ${libraries} fox)
|
||||
set_target_properties(${program} PROPERTIES
|
||||
COMPILE_FLAGS "${f90flags}"
|
||||
LINK_FLAGS "${ldflags}")
|
||||
|
||||
#===============================================================================
|
||||
# Install executable, scripts, manpage, license
|
||||
#===============================================================================
|
||||
|
||||
install(TARGETS ${program} RUNTIME DESTINATION bin)
|
||||
install(PROGRAMS utils/statepoint_cmp.py
|
||||
DESTINATION bin
|
||||
RENAME statepoint_cmp)
|
||||
install(PROGRAMS utils/statepoint_histogram.py
|
||||
DESTINATION bin
|
||||
RENAME statepoint_histogram)
|
||||
install(PROGRAMS utils/statepoint_meshplot.py
|
||||
DESTINATION bin
|
||||
RENAME statepoint_meshplot)
|
||||
install(FILES ../man/man1/openmc.1 DESTINATION share/man/man1)
|
||||
install(FILES ../LICENSE DESTINATION "share/doc/${program}/copyright")
|
||||
|
||||
find_package(PythonInterp)
|
||||
if(PYTHONINTERP_FOUND)
|
||||
install(CODE "execute_process(
|
||||
COMMAND ${PYTHON_EXECUTABLE} setup.py install --user
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/utils)")
|
||||
endif()
|
||||
404
src/DEPENDENCIES
404
src/DEPENDENCIES
|
|
@ -1,404 +0,0 @@
|
|||
ace.o: ace_header.o
|
||||
ace.o: constants.o
|
||||
ace.o: endf.o
|
||||
ace.o: error.o
|
||||
ace.o: fission.o
|
||||
ace.o: global.o
|
||||
ace.o: material_header.o
|
||||
ace.o: output.o
|
||||
ace.o: set_header.o
|
||||
ace.o: string.o
|
||||
|
||||
ace_header.o: constants.o
|
||||
ace_header.o: endf_header.o
|
||||
|
||||
cmfd_data.o: cmfd_header.o
|
||||
cmfd_data.o: constants.o
|
||||
cmfd_data.o: error.o
|
||||
cmfd_data.o: global.o
|
||||
cmfd_data.o: mesh.o
|
||||
cmfd_data.o: mesh_header.o
|
||||
cmfd_data.o: string.o
|
||||
cmfd_data.o: tally_header.o
|
||||
|
||||
cmfd_execute.o: cmfd_data.o
|
||||
cmfd_execute.o: cmfd_jfnk_solver.o
|
||||
cmfd_execute.o: cmfd_power_solver.o
|
||||
cmfd_execute.o: cmfd_solver.o
|
||||
cmfd_execute.o: constants.o
|
||||
cmfd_execute.o: error.o
|
||||
cmfd_execute.o: global.o
|
||||
cmfd_execute.o: mesh.o
|
||||
cmfd_execute.o: mesh_header.o
|
||||
cmfd_execute.o: output.o
|
||||
cmfd_execute.o: search.o
|
||||
cmfd_execute.o: tally.o
|
||||
|
||||
cmfd_header.o: constants.o
|
||||
|
||||
cmfd_input.o: cmfd_header.o
|
||||
cmfd_input.o: constants.o
|
||||
cmfd_input.o: error.o
|
||||
cmfd_input.o: global.o
|
||||
cmfd_input.o: mesh_header.o
|
||||
cmfd_input.o: output.o
|
||||
cmfd_input.o: string.o
|
||||
cmfd_input.o: tally.o
|
||||
cmfd_input.o: tally_header.o
|
||||
cmfd_input.o: tally_initialize.o
|
||||
cmfd_input.o: xml_interface.o
|
||||
|
||||
cmfd_jfnk_solver.o: cmfd_loss_operator.o
|
||||
cmfd_jfnk_solver.o: cmfd_power_solver.o
|
||||
cmfd_jfnk_solver.o: cmfd_prod_operator.o
|
||||
cmfd_jfnk_solver.o: constants.o
|
||||
cmfd_jfnk_solver.o: global.o
|
||||
cmfd_jfnk_solver.o: matrix_header.o
|
||||
cmfd_jfnk_solver.o: solver_interface.o
|
||||
cmfd_jfnk_solver.o: vector_header.o
|
||||
|
||||
cmfd_loss_operator.o: constants.o
|
||||
cmfd_loss_operator.o: global.o
|
||||
cmfd_loss_operator.o: matrix_header.o
|
||||
|
||||
cmfd_power_solver.o: cmfd_loss_operator.o
|
||||
cmfd_power_solver.o: cmfd_prod_operator.o
|
||||
cmfd_power_solver.o: constants.o
|
||||
cmfd_power_solver.o: global.o
|
||||
cmfd_power_solver.o: matrix_header.o
|
||||
cmfd_power_solver.o: solver_interface.o
|
||||
cmfd_power_solver.o: vector_header.o
|
||||
|
||||
cmfd_prod_operator.o: constants.o
|
||||
cmfd_prod_operator.o: global.o
|
||||
cmfd_prod_operator.o: matrix_header.o
|
||||
|
||||
cmfd_slepc_solver.o: cmfd_loss_operator.o
|
||||
cmfd_slepc_solver.o: cmfd_prod_operator.o
|
||||
cmfd_slepc_solver.o: constants.o
|
||||
cmfd_slepc_solver.o: global.o
|
||||
|
||||
cmfd_solver.o: cmfd_loss_operator.o
|
||||
cmfd_solver.o: cmfd_prod_operator.o
|
||||
cmfd_solver.o: constants.o
|
||||
cmfd_solver.o: global.o
|
||||
cmfd_solver.o: matrix_header.o
|
||||
cmfd_solver.o: vector_header.o
|
||||
|
||||
cross_section.o: ace_header.o
|
||||
cross_section.o: constants.o
|
||||
cross_section.o: error.o
|
||||
cross_section.o: fission.o
|
||||
cross_section.o: global.o
|
||||
cross_section.o: material_header.o
|
||||
cross_section.o: particle_header.o
|
||||
cross_section.o: random_lcg.o
|
||||
cross_section.o: search.o
|
||||
|
||||
doppler.o: constants.o
|
||||
|
||||
eigenvalue.o: cmfd_execute.o
|
||||
eigenvalue.o: constants.o
|
||||
eigenvalue.o: error.o
|
||||
eigenvalue.o: global.o
|
||||
eigenvalue.o: math.o
|
||||
eigenvalue.o: mesh.o
|
||||
eigenvalue.o: mesh_header.o
|
||||
eigenvalue.o: output.o
|
||||
eigenvalue.o: particle_header.o
|
||||
eigenvalue.o: random_lcg.o
|
||||
eigenvalue.o: search.o
|
||||
eigenvalue.o: source.o
|
||||
eigenvalue.o: state_point.o
|
||||
eigenvalue.o: string.o
|
||||
eigenvalue.o: tally.o
|
||||
eigenvalue.o: tracking.o
|
||||
|
||||
endf.o: constants.o
|
||||
endf.o: string.o
|
||||
|
||||
energy_grid.o: constants.o
|
||||
energy_grid.o: global.o
|
||||
energy_grid.o: list_header.o
|
||||
energy_grid.o: output.o
|
||||
|
||||
error.o: global.o
|
||||
|
||||
finalize.o: global.o
|
||||
finalize.o: hdf5_interface.o
|
||||
finalize.o: output.o
|
||||
finalize.o: tally.o
|
||||
|
||||
fission.o: ace_header.o
|
||||
fission.o: constants.o
|
||||
fission.o: error.o
|
||||
fission.o: global.o
|
||||
fission.o: interpolation.o
|
||||
fission.o: search.o
|
||||
|
||||
fixed_source.o: constants.o
|
||||
fixed_source.o: global.o
|
||||
fixed_source.o: output.o
|
||||
fixed_source.o: particle_header.o
|
||||
fixed_source.o: random_lcg.o
|
||||
fixed_source.o: source.o
|
||||
fixed_source.o: state_point.o
|
||||
fixed_source.o: string.o
|
||||
fixed_source.o: tally.o
|
||||
fixed_source.o: tracking.o
|
||||
|
||||
geometry.o: constants.o
|
||||
geometry.o: error.o
|
||||
geometry.o: geometry_header.o
|
||||
geometry.o: global.o
|
||||
geometry.o: output.o
|
||||
geometry.o: particle_header.o
|
||||
geometry.o: particle_restart_write.o
|
||||
geometry.o: string.o
|
||||
geometry.o: tally.o
|
||||
|
||||
global.o: ace_header.o
|
||||
global.o: bank_header.o
|
||||
global.o: cmfd_header.o
|
||||
global.o: constants.o
|
||||
global.o: dict_header.o
|
||||
global.o: geometry_header.o
|
||||
global.o: hdf5_interface.o
|
||||
global.o: material_header.o
|
||||
global.o: mesh_header.o
|
||||
global.o: plot_header.o
|
||||
global.o: set_header.o
|
||||
global.o: source_header.o
|
||||
global.o: tally_header.o
|
||||
global.o: timer_header.o
|
||||
|
||||
hdf5_summary.o: ace_header.o
|
||||
hdf5_summary.o: constants.o
|
||||
hdf5_summary.o: endf.o
|
||||
hdf5_summary.o: geometry_header.o
|
||||
hdf5_summary.o: global.o
|
||||
hdf5_summary.o: material_header.o
|
||||
hdf5_summary.o: mesh_header.o
|
||||
hdf5_summary.o: output.o
|
||||
hdf5_summary.o: output_interface.o
|
||||
hdf5_summary.o: string.o
|
||||
hdf5_summary.o: tally_header.o
|
||||
|
||||
initialize.o: ace.o
|
||||
initialize.o: bank_header.o
|
||||
initialize.o: constants.o
|
||||
initialize.o: dict_header.o
|
||||
initialize.o: energy_grid.o
|
||||
initialize.o: error.o
|
||||
initialize.o: geometry.o
|
||||
initialize.o: geometry_header.o
|
||||
initialize.o: global.o
|
||||
initialize.o: hdf5_interface.o
|
||||
initialize.o: hdf5_summary.o
|
||||
initialize.o: input_xml.o
|
||||
initialize.o: output.o
|
||||
initialize.o: output_interface.o
|
||||
initialize.o: random_lcg.o
|
||||
initialize.o: source.o
|
||||
initialize.o: state_point.o
|
||||
initialize.o: string.o
|
||||
initialize.o: tally_header.o
|
||||
initialize.o: tally_initialize.o
|
||||
|
||||
input_xml.o: cmfd_input.o
|
||||
input_xml.o: constants.o
|
||||
input_xml.o: dict_header.o
|
||||
input_xml.o: error.o
|
||||
input_xml.o: geometry_header.o
|
||||
input_xml.o: global.o
|
||||
input_xml.o: list_header.o
|
||||
input_xml.o: mesh_header.o
|
||||
input_xml.o: output.o
|
||||
input_xml.o: plot_header.o
|
||||
input_xml.o: random_lcg.o
|
||||
input_xml.o: string.o
|
||||
input_xml.o: tally_header.o
|
||||
input_xml.o: tally_initialize.o
|
||||
input_xml.o: xml_interface.o
|
||||
|
||||
interpolation.o: constants.o
|
||||
interpolation.o: endf_header.o
|
||||
interpolation.o: error.o
|
||||
interpolation.o: global.o
|
||||
interpolation.o: search.o
|
||||
interpolation.o: string.o
|
||||
|
||||
list_header.o: constants.o
|
||||
|
||||
main.o: constants.o
|
||||
main.o: eigenvalue.o
|
||||
main.o: finalize.o
|
||||
main.o: fixed_source.o
|
||||
main.o: global.o
|
||||
main.o: initialize.o
|
||||
main.o: particle_restart.o
|
||||
main.o: plot.o
|
||||
|
||||
math.o: constants.o
|
||||
math.o: random_lcg.o
|
||||
|
||||
matrix_header.o: constants.o
|
||||
matrix_header.o: vector_header.o
|
||||
|
||||
mesh.o: constants.o
|
||||
mesh.o: global.o
|
||||
mesh.o: mesh_header.o
|
||||
mesh.o: particle_header.o
|
||||
mesh.o: search.o
|
||||
|
||||
output.o: ace_header.o
|
||||
output.o: constants.o
|
||||
output.o: endf.o
|
||||
output.o: error.o
|
||||
output.o: geometry_header.o
|
||||
output.o: global.o
|
||||
output.o: math.o
|
||||
output.o: mesh.o
|
||||
output.o: mesh_header.o
|
||||
output.o: particle_header.o
|
||||
output.o: plot_header.o
|
||||
output.o: string.o
|
||||
output.o: tally_header.o
|
||||
|
||||
output_interface.o: constants.o
|
||||
output_interface.o: error.o
|
||||
output_interface.o: global.o
|
||||
output_interface.o: hdf5_interface.o
|
||||
output_interface.o: mpiio_interface.o
|
||||
output_interface.o: tally_header.o
|
||||
|
||||
particle_header.o: constants.o
|
||||
particle_header.o: geometry_header.o
|
||||
|
||||
particle_restart.o: bank_header.o
|
||||
particle_restart.o: constants.o
|
||||
particle_restart.o: geometry_header.o
|
||||
particle_restart.o: global.o
|
||||
particle_restart.o: output.o
|
||||
particle_restart.o: output_interface.o
|
||||
particle_restart.o: particle_header.o
|
||||
particle_restart.o: random_lcg.o
|
||||
particle_restart.o: tracking.o
|
||||
|
||||
particle_restart_write.o: bank_header.o
|
||||
particle_restart_write.o: global.o
|
||||
particle_restart_write.o: output_interface.o
|
||||
particle_restart_write.o: particle_header.o
|
||||
particle_restart_write.o: string.o
|
||||
|
||||
physics.o: ace_header.o
|
||||
physics.o: constants.o
|
||||
physics.o: endf.o
|
||||
physics.o: error.o
|
||||
physics.o: fission.o
|
||||
physics.o: global.o
|
||||
physics.o: interpolation.o
|
||||
physics.o: material_header.o
|
||||
physics.o: math.o
|
||||
physics.o: mesh.o
|
||||
physics.o: output.o
|
||||
physics.o: particle_header.o
|
||||
physics.o: particle_restart_write.o
|
||||
physics.o: random_lcg.o
|
||||
physics.o: search.o
|
||||
physics.o: string.o
|
||||
|
||||
plot.o: constants.o
|
||||
plot.o: error.o
|
||||
plot.o: geometry.o
|
||||
plot.o: geometry_header.o
|
||||
plot.o: global.o
|
||||
plot.o: output.o
|
||||
plot.o: particle_header.o
|
||||
plot.o: plot_header.o
|
||||
plot.o: ppmlib.o
|
||||
plot.o: string.o
|
||||
|
||||
plot_header.o: constants.o
|
||||
|
||||
random_lcg.o: global.o
|
||||
|
||||
search.o: error.o
|
||||
search.o: global.o
|
||||
|
||||
set_header.o: constants.o
|
||||
set_header.o: list_header.o
|
||||
|
||||
solver_interface.o: error.o
|
||||
solver_interface.o: global.o
|
||||
solver_interface.o: matrix_header.o
|
||||
solver_interface.o: vector_header.o
|
||||
|
||||
source.o: bank_header.o
|
||||
source.o: constants.o
|
||||
source.o: error.o
|
||||
source.o: geometry.o
|
||||
source.o: geometry_header.o
|
||||
source.o: global.o
|
||||
source.o: math.o
|
||||
source.o: output.o
|
||||
source.o: particle_header.o
|
||||
source.o: random_lcg.o
|
||||
source.o: string.o
|
||||
|
||||
state_point.o: constants.o
|
||||
state_point.o: error.o
|
||||
state_point.o: global.o
|
||||
state_point.o: output.o
|
||||
state_point.o: output_interface.o
|
||||
state_point.o: string.o
|
||||
state_point.o: tally_header.o
|
||||
|
||||
string.o: constants.o
|
||||
string.o: error.o
|
||||
string.o: global.o
|
||||
|
||||
tally.o: ace_header.o
|
||||
tally.o: constants.o
|
||||
tally.o: error.o
|
||||
tally.o: global.o
|
||||
tally.o: math.o
|
||||
tally.o: mesh.o
|
||||
tally.o: mesh_header.o
|
||||
tally.o: output.o
|
||||
tally.o: particle_header.o
|
||||
tally.o: search.o
|
||||
tally.o: string.o
|
||||
tally.o: tally_header.o
|
||||
|
||||
tally_header.o: constants.o
|
||||
|
||||
tally_initialize.o: constants.o
|
||||
tally_initialize.o: global.o
|
||||
tally_initialize.o: tally_header.o
|
||||
|
||||
timer_header.o: constants.o
|
||||
|
||||
track_output.o: global.o
|
||||
track_output.o: output_interface.o
|
||||
track_output.o: particle_header.o
|
||||
track_output.o: string.o
|
||||
|
||||
tracking.o: cross_section.o
|
||||
tracking.o: error.o
|
||||
tracking.o: geometry.o
|
||||
tracking.o: geometry_header.o
|
||||
tracking.o: global.o
|
||||
tracking.o: output.o
|
||||
tracking.o: particle_header.o
|
||||
tracking.o: physics.o
|
||||
tracking.o: random_lcg.o
|
||||
tracking.o: string.o
|
||||
tracking.o: tally.o
|
||||
tracking.o: track_output.o
|
||||
|
||||
vector_header.o: constants.o
|
||||
|
||||
xml_interface.o: constants.o
|
||||
xml_interface.o: error.o
|
||||
xml_interface.o: global.o
|
||||
291
src/Makefile
291
src/Makefile
|
|
@ -1,283 +1,12 @@
|
|||
program = openmc
|
||||
prefix = /usr/local
|
||||
|
||||
source = $(wildcard *.F90)
|
||||
objects = $(source:.F90=.o)
|
||||
xml_lib = -Lxml/lib -lxml
|
||||
|
||||
#===============================================================================
|
||||
# User Options
|
||||
#===============================================================================
|
||||
|
||||
COMPILER = gnu
|
||||
DEBUG = no
|
||||
PROFILE = no
|
||||
OPTIMIZE = no
|
||||
MPI = no
|
||||
OPENMP = no
|
||||
HDF5 = no
|
||||
PETSC = no
|
||||
|
||||
#===============================================================================
|
||||
# External Library Paths
|
||||
#===============================================================================
|
||||
|
||||
MPI_DIR = /opt/mpich/3.0.4-$(COMPILER)
|
||||
HDF5_DIR = /opt/hdf5/1.8.11-$(COMPILER)
|
||||
PHDF5_DIR = /opt/phdf5/1.8.11-$(COMPILER)
|
||||
PETSC_DIR = /opt/petsc/3.4.2-$(COMPILER)
|
||||
|
||||
#===============================================================================
|
||||
# Add git SHA-1 hash
|
||||
#===============================================================================
|
||||
|
||||
GIT_SHA1 = $(shell git log -1 2>/dev/null | head -n 1 | awk '{print $$2}')
|
||||
|
||||
#===============================================================================
|
||||
# GNU Fortran compiler options
|
||||
#===============================================================================
|
||||
|
||||
ifeq ($(COMPILER),gnu)
|
||||
F90 = gfortran
|
||||
F90FLAGS := -cpp -std=f2008 -fbacktrace
|
||||
LDFLAGS =
|
||||
|
||||
# Debugging
|
||||
ifeq ($(DEBUG),yes)
|
||||
F90FLAGS += -g -Wall -pedantic -fbounds-check \
|
||||
-ffpe-trap=invalid,overflow,underflow
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
# Profiling
|
||||
ifeq ($(PROFILE),yes)
|
||||
F90FLAGS += -pg
|
||||
LDFLAGS += -pg
|
||||
endif
|
||||
|
||||
# Optimization
|
||||
ifeq ($(OPTIMIZE),yes)
|
||||
F90FLAGS += -O3
|
||||
endif
|
||||
endif
|
||||
|
||||
#===============================================================================
|
||||
# Intel Fortran compiler options
|
||||
#===============================================================================
|
||||
|
||||
ifeq ($(COMPILER),intel)
|
||||
F90 = ifort
|
||||
F90FLAGS := -fpp -std08 -assume byterecl -traceback
|
||||
LDFLAGS =
|
||||
|
||||
# Debugging
|
||||
ifeq ($(DEBUG),yes)
|
||||
F90FLAGS += -g -warn -ftrapuv -fp-stack-check -check all -fpe0
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
# Profiling
|
||||
ifeq ($(PROFILE),yes)
|
||||
F90FLAGS += -pg
|
||||
LDFLAGS += -pg
|
||||
endif
|
||||
|
||||
# Optimization
|
||||
ifeq ($(OPTIMIZE),yes)
|
||||
F90FLAGS += -O3
|
||||
endif
|
||||
endif
|
||||
|
||||
#===============================================================================
|
||||
# PGI compiler options
|
||||
#===============================================================================
|
||||
|
||||
ifeq ($(COMPILER),pgi)
|
||||
F90 = pgf90
|
||||
F90FLAGS := -Mpreprocess -DNO_F2008 -Minform=inform -traceback
|
||||
LDFLAGS =
|
||||
|
||||
# Debugging
|
||||
ifeq ($(DEBUG),yes)
|
||||
F90FLAGS += -g -Mbounds -Mchkptr -Mchkstk
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
# Profiling
|
||||
ifeq ($(PROFILE),yes)
|
||||
F90FLAGS += -pg
|
||||
LDFLAGS += -pg
|
||||
endif
|
||||
|
||||
# Optimization
|
||||
ifeq ($(OPTIMIZE),yes)
|
||||
F90FLAGS += -fast -Mipa
|
||||
endif
|
||||
endif
|
||||
|
||||
#===============================================================================
|
||||
# IBM XL compiler options
|
||||
#===============================================================================
|
||||
|
||||
ifeq ($(COMPILER),ibm)
|
||||
F90 = xlf2003
|
||||
F90FLAGS := -WF,-DNO_F2008 -O2
|
||||
|
||||
# Debugging
|
||||
ifeq ($(DEBUG),yes)
|
||||
F90FLAGS += -g -C -qflag=i:i -u
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
# Profiling
|
||||
ifeq ($(PROFILE),yes)
|
||||
F90FLAGS += -p
|
||||
LDFLAGS += -p
|
||||
endif
|
||||
|
||||
# Optimization
|
||||
ifeq ($(OPTIMIZE),yes)
|
||||
F90FLAGS += -O3
|
||||
endif
|
||||
endif
|
||||
|
||||
#===============================================================================
|
||||
# Cray compiler options
|
||||
#===============================================================================
|
||||
|
||||
ifeq ($(COMPILER),cray)
|
||||
F90 = ftn
|
||||
F90FLAGS := -e Z -m 0
|
||||
|
||||
# Debugging
|
||||
ifeq ($(DEBUG),yes)
|
||||
F90FLAGS += -g -R abcnsp -O0
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
endif
|
||||
|
||||
#===============================================================================
|
||||
# Setup External Libraries
|
||||
#===============================================================================
|
||||
|
||||
# MPI for distributed-memory parallelism and HDF5 for I/O
|
||||
|
||||
ifeq ($(MPI),yes)
|
||||
ifeq ($(HDF5),yes)
|
||||
F90 = $(PHDF5_DIR)/bin/h5pfc
|
||||
F90FLAGS += -DHDF5
|
||||
else
|
||||
F90 = $(MPI_DIR)/bin/mpif90
|
||||
endif
|
||||
F90FLAGS += -DMPI
|
||||
else
|
||||
ifeq ($(HDF5),yes)
|
||||
F90 = $(HDF5_DIR)/bin/h5fc
|
||||
F90FLAGS += -DHDF5
|
||||
endif
|
||||
endif
|
||||
|
||||
# OpenMP for shared-memory parallelism
|
||||
|
||||
ifeq ($(OPENMP),yes)
|
||||
ifeq ($(COMPILER),intel)
|
||||
F90FLAGS += -openmp
|
||||
LDFLAGS += -openmp
|
||||
endif
|
||||
|
||||
ifeq ($(COMPILER),gnu)
|
||||
F90FLAGS += -fopenmp
|
||||
LDFLAGS += -fopenmp
|
||||
endif
|
||||
|
||||
ifeq ($(COMPILER),ibm)
|
||||
F90FLAGS += -qsmp=omp
|
||||
LDFLAGS += -qsmp=omp
|
||||
endif
|
||||
endif
|
||||
|
||||
# PETSC for CMFD functionality
|
||||
|
||||
ifeq ($(PETSC),yes)
|
||||
# Check to make sure MPI is set
|
||||
ifneq ($(MPI),yes)
|
||||
$(error MPI must be enabled to compile with PETSC!)
|
||||
endif
|
||||
|
||||
# Set up PETSc environment
|
||||
include $(PETSC_DIR)/conf/petscvariables
|
||||
F90FLAGS += -I$(PETSC_DIR)/include -DPETSC
|
||||
LDFLAGS += $(PETSC_LIB)
|
||||
endif
|
||||
|
||||
#===============================================================================
|
||||
# Machine-specific setup
|
||||
#===============================================================================
|
||||
|
||||
# IBM Blue Gene/P ANL supercomputer
|
||||
|
||||
ifeq ($(MACHINE),bluegene)
|
||||
F90 = /bgsys/drivers/ppcfloor/comm/xl/bin/mpixlf2003
|
||||
F90FLAGS = -WF,-DNO_F2008,-DMPI,-DRESTRICTED_ASSOCIATED_BUG -O3
|
||||
LDFLAGS = -lmpich.cnkf90
|
||||
endif
|
||||
|
||||
# Cray XK6 ORNL Titan supercomputer
|
||||
|
||||
ifeq ($(MACHINE),crayxk6)
|
||||
F90 = ftn
|
||||
F90FLAGS += -DMPI
|
||||
endif
|
||||
|
||||
# IBM Blue Gene/Q ANL supercomputer
|
||||
|
||||
ifeq ($(MACHINE),bluegeneq)
|
||||
F90 = mpixlf2003
|
||||
F90FLAGS = -WF,-DNO_F2008,-DMPI,-DRESTRICTED_ASSOCIATED_BUG -O5
|
||||
endif
|
||||
|
||||
#===============================================================================
|
||||
# Targets
|
||||
#===============================================================================
|
||||
|
||||
all: xml $(program)
|
||||
xml:
|
||||
cd xml; make MACHINE=$(MACHINE) F90=$(F90) F90FLAGS="$(F90FLAGS)" LDFLAGS="$(LDFLAGS)"
|
||||
$(program): $(objects)
|
||||
$(F90) $(objects) $(xml_lib) $(LDFLAGS) -o $@
|
||||
install:
|
||||
@install -D $(program) $(DESTDIR)$(prefix)/bin/$(program)
|
||||
@install -D utils/statepoint_cmp.py $(DESTDIR)$(prefix)/bin/statepoint_cmp
|
||||
@install -D utils/statepoint_histogram.py $(DESTDIR)$(prefix)/bin/statepoint_histogram
|
||||
@install -D utils/statepoint_meshplot.py $(DESTDIR)$(prefix)/bin/statepoint_meshplot
|
||||
@install -D ../man/man1/openmc.1 $(DESTDIR)$(prefix)/share/man/man1/openmc.1
|
||||
@install -D ../LICENSE $(DESTDIR)$(prefix)/share/doc/$(program)/copyright
|
||||
uninstall:
|
||||
@rm $(DESTDIR)$(prefix)/bin/$(program)
|
||||
@rm $(DESTDIR)$(prefix)/bin/statepoint_cmp
|
||||
@rm $(DESTDIR)$(prefix)/bin/statepoint_histogram
|
||||
@rm $(DESTDIR)$(prefix)/bin/statepoint_meshplot
|
||||
@rm $(DESTDIR)$(prefix)/share/man/man1/openmc.1
|
||||
@rm $(DESTDIR)$(prefix)/share/doc/$(program)/copyright
|
||||
distclean: clean
|
||||
cd xml; make clean
|
||||
all:
|
||||
mkdir -p build
|
||||
cmake -H. -Bbuild
|
||||
make -s -C build
|
||||
clean:
|
||||
@rm -f *.o *.mod $(program)
|
||||
neat:
|
||||
@rm -f *.o *.mod
|
||||
make -s -C build clean
|
||||
distclean:
|
||||
rm -fr build
|
||||
install:
|
||||
make -s -C build install
|
||||
|
||||
#===============================================================================
|
||||
# Rules
|
||||
#===============================================================================
|
||||
|
||||
.SUFFIXES: .F90 .o
|
||||
.PHONY: all xml install uninstall clean neat distclean
|
||||
|
||||
%.o: %.F90
|
||||
$(F90) $(F90FLAGS) -DGIT_SHA1="\"$(GIT_SHA1)\"" -Ixml/include -c $<
|
||||
|
||||
#===============================================================================
|
||||
# Dependencies
|
||||
#===============================================================================
|
||||
|
||||
include DEPENDENCIES
|
||||
.PHONY: all clean distclean install
|
||||
|
|
|
|||
65
src/ace.F90
65
src/ace.F90
|
|
@ -942,6 +942,7 @@ contains
|
|||
integer :: NEa ! number of energies for Watt 'a'
|
||||
integer :: NRb ! number of interpolation regions for Watt 'b'
|
||||
integer :: NEb ! number of energies for Watt 'b'
|
||||
real(8), allocatable :: L(:) ! locations of distributions for each Ein
|
||||
|
||||
! initialize length
|
||||
length = 0
|
||||
|
|
@ -966,6 +967,22 @@ contains
|
|||
! Continuous tabular distribution
|
||||
NR = int(XSS(lc + 1))
|
||||
NE = int(XSS(lc + 2 + 2*NR))
|
||||
! Before progressing, check to see if data set uses L(I) values
|
||||
! in a way inconsistent with the current form of the ACE Format Guide
|
||||
! (MCNP5 Manual, Vol 3)
|
||||
allocate(L(NE))
|
||||
L = int(XSS(lc + 3 + 2*NR + NE: lc + 3 + 2*NR + 2*NE - 1))
|
||||
do i = 1,NE
|
||||
! Now check to see if L(i) is equal to any other entries
|
||||
! If so, then we must exit
|
||||
if (count(L == L(i)) > 1) then
|
||||
message = "Invalid usage of L(I) in ACE data; &
|
||||
&Consider using more recent data set."
|
||||
call fatal_error()
|
||||
end if
|
||||
end do
|
||||
deallocate(L)
|
||||
! Continue with finding data length
|
||||
length = length + 2 + 2*NR + 2*NE
|
||||
do i = 1,NE
|
||||
! determine length
|
||||
|
|
@ -1008,6 +1025,22 @@ contains
|
|||
! Kalbach-Mann correlated scattering
|
||||
NR = int(XSS(lc + 1))
|
||||
NE = int(XSS(lc + 2 + 2*NR))
|
||||
! Before progressing, check to see if data set uses L(I) values
|
||||
! in a way inconsistent with the current form of the ACE Format Guide
|
||||
! (MCNP5 Manual, Vol 3)
|
||||
allocate(L(NE))
|
||||
L = int(XSS(lc + 3 + 2*NR + NE: lc + 3 + 2*NR + 2*NE - 1))
|
||||
do i = 1,NE
|
||||
! Now check to see if L(i) is equal to any other entries
|
||||
! If so, then we must exit
|
||||
if (count(L == L(i)) > 1) then
|
||||
message = "Invalid usage of L(I) in ACE data; &
|
||||
&Consider using more recent data set."
|
||||
call fatal_error()
|
||||
end if
|
||||
end do
|
||||
deallocate(L)
|
||||
! Continue with finding data length
|
||||
length = length + 2 + 2*NR + 2*NE
|
||||
do i = 1,NE
|
||||
NP = int(XSS(lc + length + 2))
|
||||
|
|
@ -1022,6 +1055,22 @@ contains
|
|||
! Correlated energy and angle distribution
|
||||
NR = int(XSS(lc + 1))
|
||||
NE = int(XSS(lc + 2 + 2*NR))
|
||||
! Before progressing, check to see if data set uses L(I) values
|
||||
! in a way inconsistent with the current form of the ACE Format Guide
|
||||
! (MCNP5 Manual, Vol 3)
|
||||
allocate(L(NE))
|
||||
L = int(XSS(lc + 3 + 2*NR + NE: lc + 3 + 2*NR + 2*NE - 1))
|
||||
do i = 1,NE
|
||||
! Now check to see if L(i) is equal to any other entries
|
||||
! If so, then we must exit
|
||||
if (count(L == L(i)) > 1) then
|
||||
message = "Invalid usage of L(I) in ACE data; &
|
||||
&Consider using more recent data set."
|
||||
call fatal_error()
|
||||
end if
|
||||
end do
|
||||
deallocate(L)
|
||||
! Continue with finding data length
|
||||
length = length + 2 + 2*NR + 2*NE
|
||||
do i = 1,NE
|
||||
! outgoing energy distribution
|
||||
|
|
@ -1054,6 +1103,22 @@ contains
|
|||
! Laboratory energy-angle law
|
||||
NR = int(XSS(lc + 1))
|
||||
NE = int(XSS(lc + 2 + 2*NR))
|
||||
! Before progressing, check to see if data set uses L(I) values
|
||||
! in a way inconsistent with the current form of the ACE Format Guide
|
||||
! (MCNP5 Manual, Vol 3)
|
||||
allocate(L(NE))
|
||||
L = int(XSS(lc + 3 + 2*NR + NE: lc + 3 + 2*NR + 2*NE - 1))
|
||||
do i = 1,NE
|
||||
! Now check to see if L(i) is equal to any other entries
|
||||
! If so, then we must exit
|
||||
if (count(L == L(i)) > 1) then
|
||||
message = "Invalid usage of L(I) in ACE data; &
|
||||
&Consider using more recent data set."
|
||||
call fatal_error()
|
||||
end if
|
||||
end do
|
||||
deallocate(L)
|
||||
! Continue with finding data length
|
||||
NMU = int(XSS(lc + 4 + 2*NR + 2*NE))
|
||||
length = 4 + 2*(NR + NE + NMU)
|
||||
|
||||
|
|
|
|||
|
|
@ -11,13 +11,14 @@ module constants
|
|||
integer, parameter :: VERSION_RELEASE = 3
|
||||
|
||||
! Revision numbers for binary files
|
||||
integer, parameter :: REVISION_STATEPOINT = 10
|
||||
integer, parameter :: REVISION_STATEPOINT = 11
|
||||
integer, parameter :: REVISION_PARTICLE_RESTART = 1
|
||||
|
||||
! Binary file types
|
||||
integer, parameter :: &
|
||||
FILETYPE_STATEPOINT = -1, &
|
||||
FILETYPE_PARTICLE_RESTART = -2
|
||||
FILETYPE_PARTICLE_RESTART = -2, &
|
||||
FILETYPE_SOURCE = -3
|
||||
|
||||
! ============================================================================
|
||||
! ADJUSTABLE PARAMETERS
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ module eigenvalue
|
|||
use random_lcg, only: prn, set_particle_seed, prn_skip
|
||||
use search, only: binary_search
|
||||
use source, only: get_source_particle
|
||||
use state_point, only: write_state_point
|
||||
use state_point, only: write_state_point, write_source_point
|
||||
use string, only: to_str
|
||||
use tally, only: synchronize_tallies, setup_active_usertallies, &
|
||||
reset_result
|
||||
|
|
@ -222,6 +222,12 @@ contains
|
|||
call write_state_point()
|
||||
end if
|
||||
|
||||
! Write out source point if it's been specified for this batch
|
||||
if ((sourcepoint_batch % contains(current_batch) .or. source_latest) .and. &
|
||||
source_write) then
|
||||
call write_source_point()
|
||||
end if
|
||||
|
||||
if (master .and. current_batch == n_batches) then
|
||||
! Make sure combined estimate of k-effective is calculated at the last
|
||||
! batch in case no state point is written
|
||||
|
|
|
|||
|
|
@ -189,6 +189,7 @@ module global
|
|||
! Write source at end of simulation
|
||||
logical :: source_separate = .false.
|
||||
logical :: source_write = .true.
|
||||
logical :: source_latest = .false.
|
||||
|
||||
! ============================================================================
|
||||
! PARALLEL PROCESSING VARIABLES
|
||||
|
|
@ -260,6 +261,7 @@ module global
|
|||
character(MAX_FILE_LEN) :: path_cross_sections ! Path to cross_sections.xml
|
||||
character(MAX_FILE_LEN) :: path_source = '' ! Path to binary source
|
||||
character(MAX_FILE_LEN) :: path_state_point ! Path to binary state point
|
||||
character(MAX_FILE_LEN) :: path_source_point ! Path to binary source point
|
||||
character(MAX_FILE_LEN) :: path_particle_restart ! Path to particle restart
|
||||
character(MAX_FILE_LEN) :: path_output = '' ! Path to output directory
|
||||
|
||||
|
|
@ -371,6 +373,10 @@ module global
|
|||
integer :: n_state_points = 0
|
||||
type(SetInt) :: statepoint_batch
|
||||
|
||||
! Information about source points to be written
|
||||
integer :: n_source_points = 0
|
||||
type(SetInt) :: sourcepoint_batch
|
||||
|
||||
! Various output options
|
||||
logical :: output_summary = .false.
|
||||
logical :: output_xs = .false.
|
||||
|
|
|
|||
|
|
@ -363,8 +363,50 @@ contains
|
|||
case (FILETYPE_PARTICLE_RESTART)
|
||||
path_particle_restart = argv(i)
|
||||
particle_restart_run = .true.
|
||||
case default
|
||||
message = "Unrecognized file after restart flag."
|
||||
call fatal_error()
|
||||
end select
|
||||
|
||||
! If its a restart run check for additional source file
|
||||
if (restart_run .and. i + 1 <= argc) then
|
||||
|
||||
! Increment arg
|
||||
i = i + 1
|
||||
|
||||
! Check if it has extension we can read
|
||||
if ((ends_with(argv(i), '.binary') .or. &
|
||||
ends_with(argv(i), '.h5'))) then
|
||||
|
||||
! Check file type is a source file
|
||||
call sp % file_open(argv(i), 'r', serial = .false.)
|
||||
call sp % read_data(filetype, 'filetype')
|
||||
call sp % file_close()
|
||||
if (filetype /= FILETYPE_SOURCE) then
|
||||
message = "Second file after restart flag must be a source file"
|
||||
call fatal_error()
|
||||
end if
|
||||
|
||||
! It is a source file
|
||||
path_source_point = argv(i)
|
||||
|
||||
else ! Different option is specified not a source file
|
||||
|
||||
! Source is in statepoint file
|
||||
path_source_point = path_state_point
|
||||
|
||||
! Set argument back
|
||||
i = i - 1
|
||||
|
||||
end if
|
||||
|
||||
else ! No command line arg after statepoint
|
||||
|
||||
! Source is assumed to be in statepoint file
|
||||
path_source_point = path_state_point
|
||||
|
||||
end if
|
||||
|
||||
case ('-g', '-geometry-debug', '--geometry-debug')
|
||||
check_overlaps = .true.
|
||||
|
||||
|
|
|
|||
|
|
@ -625,20 +625,6 @@ contains
|
|||
n_state_points = 1
|
||||
call statepoint_batch % add(n_batches)
|
||||
end if
|
||||
|
||||
! Check if the user has specified to write binary source file
|
||||
if (check_for_node(node_sp, "source_separate")) then
|
||||
call get_node_value(node_sp, "source_separate", temp_str)
|
||||
call lower_case(temp_str)
|
||||
if (trim(temp_str) == 'true' .or. &
|
||||
trim(temp_str) == '1') source_separate = .true.
|
||||
end if
|
||||
if (check_for_node(node_sp, "source_write")) then
|
||||
call get_node_value(node_sp, "source_write", temp_str)
|
||||
call lower_case(temp_str)
|
||||
if (trim(temp_str) == 'false' .or. &
|
||||
trim(temp_str) == '0') source_write = .false.
|
||||
end if
|
||||
else
|
||||
! If no <state_point> tag was present, by default write state point at
|
||||
! last batch only
|
||||
|
|
@ -646,6 +632,85 @@ contains
|
|||
call statepoint_batch % add(n_batches)
|
||||
end if
|
||||
|
||||
! Check if the user has specified to write source points
|
||||
if (check_for_node(doc, "source_point")) then
|
||||
|
||||
! Get pointer to source_point node
|
||||
call get_node_ptr(doc, "source_point", node_sp)
|
||||
|
||||
! Determine number of batches at which to store source points
|
||||
if (check_for_node(node_sp, "batches")) then
|
||||
n_source_points = get_arraysize_integer(node_sp, "batches")
|
||||
else
|
||||
n_source_points = 0
|
||||
end if
|
||||
|
||||
if (n_source_points > 0) then
|
||||
! User gave specific batches to write source points
|
||||
allocate(temp_int_array(n_source_points))
|
||||
call get_node_array(node_sp, "batches", temp_int_array)
|
||||
do i = 1, n_source_points
|
||||
call sourcepoint_batch % add(temp_int_array(i))
|
||||
end do
|
||||
deallocate(temp_int_array)
|
||||
elseif (check_for_node(node_sp, "interval")) then
|
||||
! User gave an interval for writing source points
|
||||
call get_node_value(node_sp, "interval", temp_int)
|
||||
n_source_points = n_batches / temp_int
|
||||
do i = 1, n_source_points
|
||||
call sourcepoint_batch % add(temp_int * i)
|
||||
end do
|
||||
else
|
||||
! If neither were specified, write source points with state points
|
||||
n_source_points = n_state_points
|
||||
do i = 1, n_state_points
|
||||
call sourcepoint_batch % add(statepoint_batch % get_item(i))
|
||||
end do
|
||||
end if
|
||||
|
||||
! Check if the user has specified to write binary source file
|
||||
if (check_for_node(node_sp, "separate")) then
|
||||
call get_node_value(node_sp, "separate", temp_str)
|
||||
call lower_case(temp_str)
|
||||
if (trim(temp_str) == 'true' .or. &
|
||||
trim(temp_str) == '1') source_separate = .true.
|
||||
end if
|
||||
if (check_for_node(node_sp, "write")) then
|
||||
call get_node_value(node_sp, "write", temp_str)
|
||||
call lower_case(temp_str)
|
||||
if (trim(temp_str) == 'false' .or. &
|
||||
trim(temp_str) == '0') source_write = .false.
|
||||
end if
|
||||
if (check_for_node(node_sp, "overwrite_latest")) then
|
||||
call get_node_value(node_sp, "overwrite_latest", temp_str)
|
||||
call lower_case(temp_str)
|
||||
if (trim(temp_str) == 'true' .or. &
|
||||
trim(temp_str) == '1') source_latest = .true.
|
||||
end if
|
||||
else
|
||||
! If no <source_point> tag was present, by default we keep source bank in
|
||||
! statepoint file and write it out at statepoints intervals
|
||||
source_separate = .false.
|
||||
n_source_points = n_state_points
|
||||
do i = 1, n_state_points
|
||||
call sourcepoint_batch % add(statepoint_batch % get_item(i))
|
||||
end do
|
||||
end if
|
||||
|
||||
! If source is not seperate and is to be written out in the statepoint file,
|
||||
! make sure that the sourcepoint batch numbers are contained in the
|
||||
! statepoint list
|
||||
if (.not. source_separate) then
|
||||
do i = 1, n_source_points
|
||||
if (.not. statepoint_batch % contains(sourcepoint_batch % &
|
||||
get_item(i))) then
|
||||
message = 'Sourcepoint batches are not a subset&
|
||||
& of statepoint batches.'
|
||||
call fatal_error()
|
||||
end if
|
||||
end do
|
||||
end if
|
||||
|
||||
! Check if the user has specified to not reduce tallies at the end of every
|
||||
! batch
|
||||
if (check_for_node(doc, "no_reduce")) then
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ module output_interface
|
|||
|
||||
#ifdef HDF5
|
||||
use hdf5_interface
|
||||
#elif MPI
|
||||
#endif
|
||||
#ifdef MPI
|
||||
use mpiio_interface
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -867,9 +867,9 @@ contains
|
|||
end if
|
||||
|
||||
! Bank source neutrons
|
||||
if (nu == 0 .or. n_bank == 3*work) return
|
||||
if (nu == 0 .or. n_bank == size(fission_bank)) return
|
||||
p % fission = .true. ! Fission neutrons will be banked
|
||||
do i = int(n_bank,4) + 1, int(min(n_bank + nu, 3*work),4)
|
||||
do i = int(n_bank,4) + 1, int(min(n_bank + nu, int(size(fission_bank),8)),4)
|
||||
! Bank source neutrons by copying particle data
|
||||
fission_bank(i) % xyz = p % coord0 % xyz
|
||||
|
||||
|
|
@ -894,7 +894,7 @@ contains
|
|||
end do
|
||||
|
||||
! increment number of bank sites
|
||||
n_bank = min(n_bank + nu, 3*work)
|
||||
n_bank = min(n_bank + nu, int(size(fission_bank),8))
|
||||
|
||||
! Store total weight banked for analog fission tallies
|
||||
p % n_bank = nu
|
||||
|
|
|
|||
|
|
@ -92,11 +92,22 @@ element settings {
|
|||
attribute batches { list { xsd:positiveInteger+ } }) |
|
||||
(element interval { xsd:positiveInteger } |
|
||||
attribute interval { xsd:positiveInteger })
|
||||
) &
|
||||
(element source_separate { xsd:boolean } |
|
||||
attribute source_separate { xsd:boolean })? &
|
||||
(element source_write { xsd:boolean } |
|
||||
attribute source_write { xsd:boolean })?
|
||||
)
|
||||
}? &
|
||||
|
||||
element source_point {
|
||||
(
|
||||
(element batches { list { xsd:positiveInteger+ } } |
|
||||
attribute batches { list { xsd:positiveInteger+ } }) |
|
||||
(element interval { xsd:positiveInteger } |
|
||||
attribute interval { xsd:positiveInteger })
|
||||
)? &
|
||||
(element separate { xsd:boolean } |
|
||||
attribute separate { xsd:boolean })? &
|
||||
(element write { xsd:boolean } |
|
||||
attribute write { xsd:boolean })? &
|
||||
(element overwrite_latest { xsd:boolean} |
|
||||
attribute overwrite_latest {xsd:boolean})?
|
||||
}? &
|
||||
|
||||
element survival_biasing { xsd:boolean }? &
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
module source
|
||||
|
||||
use bank_header, only: Bank
|
||||
use bank_header, only: Bank
|
||||
use constants
|
||||
use error, only: fatal_error
|
||||
use geometry, only: find_cell
|
||||
use geometry_header, only: BASE_UNIVERSE
|
||||
use error, only: fatal_error
|
||||
use geometry, only: find_cell
|
||||
use geometry_header, only: BASE_UNIVERSE
|
||||
use global
|
||||
use math, only: maxwell_spectrum, watt_spectrum
|
||||
use output, only: write_message
|
||||
use particle_header, only: Particle
|
||||
use random_lcg, only: prn, set_particle_seed
|
||||
use string, only: to_str
|
||||
use math, only: maxwell_spectrum, watt_spectrum
|
||||
use output, only: write_message
|
||||
use output_interface, only: BinaryOutput
|
||||
use particle_header, only: Particle
|
||||
use random_lcg, only: prn, set_particle_seed
|
||||
use string, only: to_str
|
||||
|
||||
#ifdef MPI
|
||||
use mpi
|
||||
|
|
@ -28,8 +29,9 @@ contains
|
|||
|
||||
integer(8) :: i ! loop index over bank sites
|
||||
integer(8) :: id ! particle id
|
||||
|
||||
integer(4) :: itmp ! temporary integer
|
||||
type(Bank), pointer :: src => null() ! source bank site
|
||||
type(BinaryOutput) :: sp ! statepoint/source binary file
|
||||
|
||||
message = "Initializing source particles..."
|
||||
call write_message(6)
|
||||
|
|
@ -38,8 +40,26 @@ contains
|
|||
! Read the source from a binary file instead of sampling from some
|
||||
! assumed source distribution
|
||||
|
||||
message = 'This feature is currently disabled and will be added back in.'
|
||||
call fatal_error()
|
||||
message = 'Reading source file from ' // trim(path_source) // '...'
|
||||
call write_message(6)
|
||||
|
||||
! Open the binary file
|
||||
call sp % file_open(path_source, 'r', serial = .false.)
|
||||
|
||||
! Read the file type
|
||||
call sp % read_data(itmp, "filetype")
|
||||
|
||||
! Check to make sure this is a source file
|
||||
if (itmp /= FILETYPE_SOURCE) then
|
||||
message = "Specified starting source file not a source file type."
|
||||
call fatal_error()
|
||||
end if
|
||||
|
||||
! Read in the source bank
|
||||
call sp % read_source_bank()
|
||||
|
||||
! Close file
|
||||
call sp % file_close()
|
||||
|
||||
else
|
||||
! Generation source sites from specified distribution in user input
|
||||
|
|
@ -110,6 +130,7 @@ contains
|
|||
end if
|
||||
end if
|
||||
end do
|
||||
call p % clear()
|
||||
|
||||
case (SRC_SPACE_POINT)
|
||||
! Point source
|
||||
|
|
|
|||
|
|
@ -232,6 +232,13 @@ contains
|
|||
|
||||
end if
|
||||
|
||||
! Indicate where source bank is stored in statepoint
|
||||
if (source_separate) then
|
||||
call sp % write_data(0, "source_present")
|
||||
else
|
||||
call sp % write_data(1, "source_present")
|
||||
end if
|
||||
|
||||
! Check for the no-tally-reduction method
|
||||
if (.not. reduce_tallies) then
|
||||
! If using the no-tally-reduction method, we need to collect tally
|
||||
|
|
@ -280,14 +287,45 @@ contains
|
|||
|
||||
end if
|
||||
|
||||
! Check for eigenvalue calculation
|
||||
if (run_mode == MODE_EIGENVALUE .and. source_write) then
|
||||
end subroutine write_state_point
|
||||
|
||||
! Check for writing source out separately
|
||||
!===============================================================================
|
||||
! WRITE_SOURCE_POINT
|
||||
!===============================================================================
|
||||
|
||||
subroutine write_source_point()
|
||||
|
||||
type(BinaryOutput) :: sp
|
||||
character(MAX_FILE_LEN) :: filename
|
||||
|
||||
! Check to write out source for a specified batch
|
||||
if (sourcepoint_batch % contains(current_batch)) then
|
||||
|
||||
! Create or open up file
|
||||
if (source_separate) then
|
||||
|
||||
! Set filename for source
|
||||
filename = trim(path_output) // 'source.' // &
|
||||
! Set filename
|
||||
filename = trim(path_output) // 'source.' // trim(to_str(current_batch))
|
||||
#ifdef HDF5
|
||||
filename = trim(filename) // '.h5'
|
||||
#else
|
||||
filename = trim(filename) // '.binary'
|
||||
#endif
|
||||
|
||||
! Write message for new file creation
|
||||
message = "Creating source file " // trim(filename) // "..."
|
||||
call write_message(1)
|
||||
|
||||
! Create separate source file
|
||||
call sp % file_create(filename, serial = .false.)
|
||||
|
||||
! Write file type
|
||||
call sp % write_data(FILETYPE_SOURCE, "filetype")
|
||||
|
||||
else
|
||||
|
||||
! Set filename for state point
|
||||
filename = trim(path_output) // 'statepoint.' // &
|
||||
trim(to_str(current_batch))
|
||||
#ifdef HDF5
|
||||
filename = trim(filename) // '.h5'
|
||||
|
|
@ -295,16 +333,7 @@ contains
|
|||
filename = trim(filename) // '.binary'
|
||||
#endif
|
||||
|
||||
! Write message
|
||||
message = "Creating source file " // trim(filename) // "..."
|
||||
call write_message(1)
|
||||
|
||||
! Create source file
|
||||
call sp % file_create(filename, serial = .false.)
|
||||
|
||||
else
|
||||
|
||||
! Reopen state point file in parallel
|
||||
! Reopen statepoint file in parallel
|
||||
call sp % file_open(filename, 'w', serial = .false.)
|
||||
|
||||
end if
|
||||
|
|
@ -317,7 +346,36 @@ contains
|
|||
|
||||
end if
|
||||
|
||||
end subroutine write_state_point
|
||||
! Also check to write source separately in overwritten file
|
||||
if (source_latest) then
|
||||
|
||||
! Set filename
|
||||
filename = trim(path_output) // 'source'
|
||||
#ifdef HDF5
|
||||
filename = trim(filename) // '.h5'
|
||||
#else
|
||||
filename = trim(filename) // '.binary'
|
||||
#endif
|
||||
|
||||
! Write message for new file creation
|
||||
message = "Creating source file " // trim(filename) // "..."
|
||||
call write_message(1)
|
||||
|
||||
! Always create this file because it will be overwritten
|
||||
call sp % file_create(filename, serial = .false.)
|
||||
|
||||
! Write file type
|
||||
call sp % write_data(FILETYPE_SOURCE, "filetype")
|
||||
|
||||
! Write out source
|
||||
call sp % write_source_bank()
|
||||
|
||||
! Close file
|
||||
call sp % file_close()
|
||||
|
||||
end if
|
||||
|
||||
end subroutine write_source_point
|
||||
|
||||
!===============================================================================
|
||||
! WRITE_TALLY_RESULTS_NR
|
||||
|
|
@ -467,6 +525,7 @@ contains
|
|||
integer :: length(4)
|
||||
integer :: int_array(3)
|
||||
integer, allocatable :: temp_array(:)
|
||||
logical :: source_present
|
||||
real(8) :: real_array(3)
|
||||
type(TallyObject), pointer :: t => null()
|
||||
|
||||
|
|
@ -671,6 +730,20 @@ contains
|
|||
|
||||
end do TALLY_METADATA
|
||||
|
||||
! Check for source in statepoint if needed
|
||||
call sp % read_data(int_array(1), "source_present")
|
||||
if (int_array(1) == 1) then
|
||||
source_present = .true.
|
||||
else
|
||||
source_present = .false.
|
||||
end if
|
||||
|
||||
! Check to make sure source bank is present
|
||||
if (path_source_point == path_state_point .and. .not. source_present) then
|
||||
message = "Source bank must be contained in statepoint restart file"
|
||||
call fatal_error()
|
||||
end if
|
||||
|
||||
! Read tallies to master
|
||||
if (master) then
|
||||
|
||||
|
|
@ -711,26 +784,20 @@ contains
|
|||
if (run_mode == MODE_EIGENVALUE) then
|
||||
|
||||
! Check if source was written out separately
|
||||
if (source_separate) then
|
||||
if (.not. source_present) then
|
||||
|
||||
! Close statepoint file
|
||||
call sp % file_close()
|
||||
|
||||
! Set filename for source
|
||||
filename = trim(path_output) // 'source.' // &
|
||||
trim(to_str(restart_batch))
|
||||
#ifdef HDF5
|
||||
filename = trim(filename) // '.h5'
|
||||
#else
|
||||
filename = trim(filename) // '.binary'
|
||||
#endif
|
||||
|
||||
! Write message
|
||||
message = "Loading source file " // trim(filename) // "..."
|
||||
call write_message(1)
|
||||
|
||||
! Open source file
|
||||
call sp % file_open(filename, 'r', serial = .false.)
|
||||
call sp % file_open(path_source_point, 'r', serial = .false.)
|
||||
|
||||
! Read file type
|
||||
call sp % read_data(int_array(1), "filetype")
|
||||
|
||||
end if
|
||||
|
||||
|
|
|
|||
11
src/utils/setup.py
Normal file
11
src/utils/setup.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
from distutils.core import setup
|
||||
|
||||
setup(name='statepoint',
|
||||
version='0.5.4',
|
||||
description='OpenMC StatePoint',
|
||||
author='Paul Romano',
|
||||
author_email='paul.k.romano@gmail.com',
|
||||
url='https://github.com/mit-crpg/openmc',
|
||||
py_modules=['statepoint'])
|
||||
|
|
@ -151,7 +151,7 @@ class StatePoint(object):
|
|||
|
||||
# Read statepoint revision
|
||||
self.revision = self._get_int(path='revision')[0]
|
||||
if self.revision != 10:
|
||||
if self.revision != 11:
|
||||
raise Exception('Statepoint Revision is not consistent.')
|
||||
|
||||
# Read OpenMC version
|
||||
|
|
@ -298,6 +298,13 @@ class StatePoint(object):
|
|||
f.stride = stride
|
||||
stride *= f.length
|
||||
|
||||
# Source bank present
|
||||
source_present = self._get_int(path='source_present')[0]
|
||||
if source_present == 1:
|
||||
self.source_present = True
|
||||
else:
|
||||
self.source_present = False
|
||||
|
||||
# Set flag indicating metadata has already been read
|
||||
self._metadata = True
|
||||
|
||||
|
|
@ -342,6 +349,11 @@ class StatePoint(object):
|
|||
if not self._results:
|
||||
self.read_results()
|
||||
|
||||
# Check if source bank is in statepoint
|
||||
if not self.source_present:
|
||||
print('Source not in statepoint file.')
|
||||
return
|
||||
|
||||
# For HDF5 state points, copy entire bank
|
||||
if self._hdf5:
|
||||
source_sites = self._f['source_bank'].value
|
||||
|
|
|
|||
10
tests/cleanup
Executable file
10
tests/cleanup
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This simple script ensures that all binary
|
||||
# output files have been deleted in all the
|
||||
# folders. This can occur if a previous error
|
||||
# occurred and the test suite was rerun without
|
||||
# deleting left over binary files. This will
|
||||
# cause an assertion error in some of the
|
||||
# tests.
|
||||
find . \( -name "*.binary" -o -name "*.h5" \) -exec rm -f {} \;
|
||||
|
|
@ -6,6 +6,7 @@ import os
|
|||
import sys
|
||||
import nose
|
||||
import glob
|
||||
import shutil
|
||||
from subprocess import call
|
||||
|
||||
from nose_mpi import NoseMPI
|
||||
|
|
@ -46,9 +47,8 @@ def run_suite(name=None, mpi=False):
|
|||
|
||||
try:
|
||||
os.chdir(pwd)
|
||||
os.rename(pwd + '/../src/openmc-' + name, pwd + '/../src/openmc')
|
||||
shutil.copyfile(pwd + '/../src/openmc-' + name, pwd + '/../src/openmc')
|
||||
result = nose.run(argv=argv, addplugins=plugins)
|
||||
os.rename(pwd + '/../src/openmc', pwd + '/../src/openmc-' + name)
|
||||
except OSError:
|
||||
result = False
|
||||
print('No OpenMC executable found for ' + name + ' tests')
|
||||
|
|
@ -117,6 +117,8 @@ if len(sys.argv) > 1:
|
|||
if j.rfind(suffix) != -1:
|
||||
if suffix == 'omp' and j == 'compile':
|
||||
continue
|
||||
if j == 'compile':
|
||||
continue
|
||||
tests__.append(j)
|
||||
else:
|
||||
tests__.append(i) # append specific test (e.g., mpi-debug)
|
||||
|
|
|
|||
|
|
@ -15,10 +15,11 @@ import shutil
|
|||
|
||||
pwd = os.path.dirname(__file__)
|
||||
|
||||
if 'COMPILER' in os.environ:
|
||||
compiler = 'COMPILER=' + os.environ['COMPILER']
|
||||
else:
|
||||
compiler = 'COMPILER=gnu'
|
||||
# Set default copmilers
|
||||
fc = 'gfortran'
|
||||
h5fc = 'h5fc'
|
||||
h5pfc = 'h5pfc'
|
||||
mpifc = 'mpif90'
|
||||
|
||||
|
||||
def setup():
|
||||
|
|
@ -27,257 +28,333 @@ def setup():
|
|||
|
||||
|
||||
def test_normal():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -H. -Bbuild'.format(fc))
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-normal')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-normal')
|
||||
|
||||
|
||||
def test_debug():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'DEBUG=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Ddebug=on -H. -Bbuild'.format(fc))
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-debug')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-debug')
|
||||
|
||||
|
||||
def test_profile():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'PROFILE=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dprofile=on -H. -Bbuild'.format(fc))
|
||||
assert returncode == 0
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-profile')
|
||||
|
||||
|
||||
def test_optimize():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'OPTIMIZE=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Doptimize=on -H. -Bbuild'.format(fc))
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-optimize')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-optimize')
|
||||
|
||||
|
||||
def test_mpi():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -H. -Bbuild'.format(mpifc))
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-mpi')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-mpi')
|
||||
|
||||
|
||||
def test_mpi_debug():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'DEBUG=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Ddebug=on -H. -Bbuild'.format(mpifc))
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-mpi-debug')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-mpi-debug')
|
||||
|
||||
|
||||
def test_mpi_optimize():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'OPTIMIZE=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Doptimize=on -H. -Bbuild'.format(mpifc))
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-mpi-optimize')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-mpi-optimize')
|
||||
|
||||
|
||||
def test_omp():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'OPENMP=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dopenmp=on -H. -Bbuild'.format(fc))
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-omp')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-omp')
|
||||
|
||||
|
||||
def test_omp_debug():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'OPENMP=yes', 'DEBUG=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dopenmp=on -Ddebug=on '.format(fc) +
|
||||
'-H. -Bbuild')
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-omp-debug')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-omp-debug')
|
||||
|
||||
|
||||
def test_omp_optimize():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'OPENMP=yes', 'OPTIMIZE=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dopenmp=on -Doptimize=on '.format(fc) +
|
||||
'-H. -Bbuild')
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-omp-optimize')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-omp-optimize')
|
||||
|
||||
|
||||
def test_hdf5():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'HDF5=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -H. -Bbuild'.format(h5fc))
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-hdf5')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-hdf5')
|
||||
|
||||
|
||||
def test_hdf5_debug():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'HDF5=yes', 'DEBUG=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Ddebug=on -H. -Bbuild'.format(h5fc))
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-hdf5-debug')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-hdf5-debug')
|
||||
|
||||
|
||||
def test_hdf5_optimize():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'HDF5=yes', 'OPTIMIZE=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Doptimize=on -H. -Bbuild'.format(h5fc))
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-hdf5-optimize')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-hdf5-optimize')
|
||||
|
||||
|
||||
def test_omp_hdf5():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'OPENMP=yes', 'HDF5=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dopenmp=on -H. -Bbuild'.format(h5fc))
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-omp-hdf5')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-omp-hdf5')
|
||||
|
||||
|
||||
def test_omp_hdf5_debug():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'OPENMP=yes', 'HDF5=yes', 'DEBUG=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dopenmp=on -Ddebug=on '.format(h5fc) +
|
||||
'-H. -Bbuild')
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-omp-hdf5-debug')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-omp-hdf5-debug')
|
||||
|
||||
|
||||
def test_omp_hdf5_optimize():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'OPENMP=yes', 'HDF5=yes', 'OPTIMIZE=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dopenmp=on -Doptimize=on '.format(h5fc) +
|
||||
'-H. -Bbuild')
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-omp-hdf5-optimize')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-omp-hdf5-optimize')
|
||||
|
||||
|
||||
def test_petsc():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'PETSC=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dpetsc=on -H. -Bbuild'.format(mpifc))
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-petsc')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-petsc')
|
||||
|
||||
|
||||
def test_petsc_debug():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'PETSC=yes', 'DEBUG=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dpetsc=on -Ddebug=on '.format(mpifc) +
|
||||
'-H. -Bbuild')
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-petsc-debug')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-petsc-debug')
|
||||
|
||||
|
||||
def test_petsc_optimize():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'PETSC=yes',
|
||||
'OPTIMIZE=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dpetsc=on -Doptimize=on '.format(mpifc) +
|
||||
'-H. -Bbuild')
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-petsc-optimize')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-petsc-optimize')
|
||||
|
||||
|
||||
def test_mpi_omp():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'OPENMP=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dopenmp=on -H. -Bbuild'.format(mpifc))
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-mpi-omp')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-mpi-omp')
|
||||
|
||||
|
||||
def test_mpi_omp_debug():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'OPENMP=yes', 'DEBUG=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dopenmp=on -Ddebug=on '.format(mpifc) +
|
||||
'-H. -Bbuild')
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-mpi-omp-debug')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-mpi-omp-debug')
|
||||
|
||||
|
||||
def test_mpi_omp_optimize():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'OPENMP=yes', 'OPTIMIZE=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dopenmp=on -Doptimize=on '.format(mpifc) +
|
||||
'-H. -Bbuild')
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-mpi-omp-optimize')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-mpi-omp-optimize')
|
||||
|
||||
|
||||
def test_mpi_hdf5():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'HDF5=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -H. -Bbuild'.format(h5pfc))
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-phdf5')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-phdf5')
|
||||
|
||||
|
||||
def test_mpi_hdf5_debug():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'HDF5=yes', 'DEBUG=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Ddebug=on -H. -Bbuild'.format(h5pfc))
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-phdf5-debug')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-phdf5-debug')
|
||||
|
||||
|
||||
def test_mpi_hdf5_optimize():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'HDF5=yes', 'OPTIMIZE=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Doptimize=on -H. -Bbuild'.format(h5pfc))
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-phdf5-optimize')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-phdf5-optimize')
|
||||
|
||||
|
||||
def test_mpi_omp_hdf5():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'OPENMP=yes', 'HDF5=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dopenmp=on -H. -Bbuild'.format(h5pfc))
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-phdf5-omp')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-phdf5-omp')
|
||||
|
||||
|
||||
def test_mpi_omp_hdf5_debug():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'OPENMP=yes', 'HDF5=yes',
|
||||
'DEBUG=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dopenmp=on -Ddebug=on '.format(h5pfc) +
|
||||
'-H. -Bbuild')
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-phdf5-omp-debug')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-phdf5-omp-debug')
|
||||
|
||||
|
||||
def test_mpi_omp_hdf5_optimize():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'OPENMP=yes', 'HDF5=yes',
|
||||
'OPTIMIZE=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dopenmp=on -Doptimize=on '.format(h5pfc) +
|
||||
'-H. -Bbuild')
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-phdf5-omp-optimize')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-phdf5-omp-optimize')
|
||||
|
||||
|
||||
def test_mpi_hdf5_petsc():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'HDF5=yes', 'PETSC=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dpetsc=on -H. -Bbuild'.format(h5pfc))
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-phdf5-petsc')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-phdf5-petsc')
|
||||
|
||||
|
||||
def test_mpi_hdf5_petsc_debug():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'HDF5=yes', 'PETSC=yes',
|
||||
'DEBUG=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dpetsc=on -Ddebug=on '.format(h5pfc) +
|
||||
'-H. -Bbuild')
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-phdf5-petsc-debug')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-phdf5-petsc-debug')
|
||||
|
||||
|
||||
def test_mpi_hdf5_petsc_optimize():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'HDF5=yes', 'PETSC=yes',
|
||||
'OPTIMIZE=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dpetsc=on -Doptimize=on '.format(h5pfc) +
|
||||
'-H. -Bbuild')
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-phdf5-petsc-optimize')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-phdf5-petsc-optimize')
|
||||
|
||||
|
||||
def test_mpi_omp_hdf5_petsc():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'OMP=yes', 'HDF5=yes',
|
||||
'PETSC=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dpetsc=on -Dopenmp=on '.format(h5pfc) +
|
||||
'-H. -Bbuild')
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-omp-phdf5-petsc')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-omp-phdf5-petsc')
|
||||
|
||||
|
||||
def test_mpi_omp_hdf5_petsc_debug():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'OMP=yes', 'HDF5=yes',
|
||||
'PETSC=yes', 'DEBUG=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dpetsc=on -Dopenmp=on '.format(h5pfc) +
|
||||
'-Ddebug=on -H. -Bbuild')
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-omp-phdf5-petsc-debug')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-omp-phdf5-petsc-debug')
|
||||
|
||||
|
||||
def test_mpi_omp_hdf5_petsc_optimize():
|
||||
returncode = run(['make', 'distclean'])
|
||||
returncode = run(['make', compiler, 'MPI=yes', 'OMP=yes', 'HDF5=yes',
|
||||
'PETSC=yes', 'OPTIMIZE=yes'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
returncode = run('FC={0} cmake -Dpetsc=on -Dopenmp=on '.format(h5pfc) +
|
||||
'-Doptimize=on -H. -Bbuild')
|
||||
assert returncode == 0
|
||||
shutil.move('openmc', 'openmc-omp-phdf5-petsc-optimize')
|
||||
returncode = run('make -s -C build')
|
||||
assert returncode == 0
|
||||
shutil.move('build/bin/openmc', 'openmc-omp-phdf5-petsc-optimize')
|
||||
|
||||
|
||||
def run(commands):
|
||||
proc = Popen(commands, stderr=STDOUT, stdout=PIPE)
|
||||
proc = Popen(commands, shell=True, stderr=STDOUT, stdout=PIPE)
|
||||
print(proc.communicate()[0])
|
||||
returncode = proc.returncode
|
||||
return returncode
|
||||
|
||||
|
||||
def teardown(commands):
|
||||
returncode = run(['make', 'distclean'])
|
||||
shutil.rmtree('build', ignore_errors=True)
|
||||
shutil.copy('openmc-normal', 'openmc')
|
||||
|
|
|
|||
8
tests/test_source_file/geometry.xml
Normal file
8
tests/test_source_file/geometry.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<geometry>
|
||||
|
||||
<!-- Sphere with radius 10 -->
|
||||
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="vacuum"/>
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
|
||||
</geometry>
|
||||
9
tests/test_source_file/materials.xml
Normal file
9
tests/test_source_file/materials.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0"?>
|
||||
<materials>
|
||||
|
||||
<material id="1">
|
||||
<density value="4.5" units="g/cc" />
|
||||
<nuclide name="U-235" xs="70c" ao="1.0" />
|
||||
</material>
|
||||
|
||||
</materials>
|
||||
25
tests/test_source_file/results.py
Normal file
25
tests/test_source_file/results.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
|
||||
# import statepoint
|
||||
sys.path.append('../../src/utils')
|
||||
import statepoint
|
||||
|
||||
# read in statepoint file
|
||||
if len(sys.argv) > 1:
|
||||
sp = statepoint.StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = statepoint.StatePoint('statepoint.10.binary')
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
fh.write(outstr)
|
||||
2
tests/test_source_file/results_true.dat
Normal file
2
tests/test_source_file/results_true.dat
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
k-combined:
|
||||
2.977307E-01 2.848670E-03
|
||||
19
tests/test_source_file/settings.xml
Normal file
19
tests/test_source_file/settings.xml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0"?>
|
||||
<settings>
|
||||
|
||||
<state_point batches="10" />
|
||||
<source_point separate="true" />
|
||||
|
||||
<eigenvalue>
|
||||
<batches>10</batches>
|
||||
<inactive>5</inactive>
|
||||
<particles>1000</particles>
|
||||
</eigenvalue>
|
||||
|
||||
<source>
|
||||
<space type="box">
|
||||
<parameters>-4 -4 -4 4 4 4</parameters>
|
||||
</space>
|
||||
</source>
|
||||
|
||||
</settings>
|
||||
101
tests/test_source_file/test_source_file.py
Normal file
101
tests/test_source_file/test_source_file.py
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
from subprocess import Popen, STDOUT, PIPE, call
|
||||
import filecmp
|
||||
from nose_mpi import NoseMPI
|
||||
import glob
|
||||
|
||||
pwd = os.path.dirname(__file__)
|
||||
|
||||
settings1="""<?xml version="1.0"?>
|
||||
<settings>
|
||||
|
||||
<state_point batches="10" />
|
||||
<source_point separate="true" />
|
||||
|
||||
<eigenvalue>
|
||||
<batches>10</batches>
|
||||
<inactive>5</inactive>
|
||||
<particles>1000</particles>
|
||||
</eigenvalue>
|
||||
|
||||
<source>
|
||||
<space type="box">
|
||||
<parameters>-4 -4 -4 4 4 4</parameters>
|
||||
</space>
|
||||
</source>
|
||||
|
||||
</settings>
|
||||
"""
|
||||
|
||||
settings2 = """<?xml version="1.0"?>
|
||||
<settings>
|
||||
|
||||
<eigenvalue>
|
||||
<batches>10</batches>
|
||||
<inactive>5</inactive>
|
||||
<particles>1000</particles>
|
||||
</eigenvalue>
|
||||
|
||||
<source>
|
||||
<file> source.10.{0} </file>
|
||||
</source>
|
||||
|
||||
</settings>
|
||||
"""
|
||||
|
||||
def setup():
|
||||
os.putenv('PWD', pwd)
|
||||
os.chdir(pwd)
|
||||
|
||||
def test_run1():
|
||||
openmc_path = pwd + '/../../src/openmc'
|
||||
if int(NoseMPI.mpi_np) > 0:
|
||||
proc = Popen([NoseMPI.mpi_exec, '-np', NoseMPI.mpi_np, openmc_path],
|
||||
stderr=STDOUT, stdout=PIPE)
|
||||
else:
|
||||
proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE)
|
||||
print(proc.communicate()[0])
|
||||
returncode = proc.returncode
|
||||
assert returncode == 0
|
||||
|
||||
def test_statepoint_exists():
|
||||
statepoint = glob.glob(pwd + '/statepoint.10.*')
|
||||
assert len(statepoint) == 1
|
||||
assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5')
|
||||
source = glob.glob(pwd + '/source.10.*')
|
||||
assert len(statepoint) == 1
|
||||
assert source[0].endswith('binary') or source[0].endswith('h5')
|
||||
|
||||
def test_run2():
|
||||
openmc_path = pwd + '/../../src/openmc'
|
||||
source = glob.glob(pwd + '/source.10.*')
|
||||
with open('settings.xml','w') as fh:
|
||||
fh.write(settings2.format(source[0].split('.')[2]))
|
||||
if int(NoseMPI.mpi_np) > 0:
|
||||
proc = Popen([NoseMPI.mpi_exec, '-np', NoseMPI.mpi_np, openmc_path],
|
||||
stderr=STDOUT, stdout=PIPE)
|
||||
else:
|
||||
proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE)
|
||||
print(proc.communicate()[0])
|
||||
returncode = proc.returncode
|
||||
assert returncode == 0
|
||||
|
||||
def test_results():
|
||||
statepoint = glob.glob(pwd + '/statepoint.10.*')
|
||||
call(['python', 'results.py', statepoint[0]])
|
||||
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
|
||||
if not compare:
|
||||
os.rename('results_test.dat', 'results_error.dat')
|
||||
assert compare
|
||||
|
||||
def teardown():
|
||||
with open('settings.xml','w') as fh:
|
||||
fh.write(settings1)
|
||||
output = glob.glob(pwd + '/statepoint.10.*')
|
||||
output += glob.glob(pwd + '/source.10.*')
|
||||
output.append(pwd + '/results_test.dat')
|
||||
for f in output:
|
||||
if os.path.exists(f):
|
||||
os.remove(f)
|
||||
8
tests/test_sourcepoint_batch/geometry.xml
Normal file
8
tests/test_sourcepoint_batch/geometry.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<geometry>
|
||||
|
||||
<!-- Sphere with radius 10 -->
|
||||
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="vacuum"/>
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
|
||||
</geometry>
|
||||
9
tests/test_sourcepoint_batch/materials.xml
Normal file
9
tests/test_sourcepoint_batch/materials.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0"?>
|
||||
<materials>
|
||||
|
||||
<material id="1">
|
||||
<density value="4.5" units="g/cc" />
|
||||
<nuclide name="U-235" xs="70c" ao="1.0" />
|
||||
</material>
|
||||
|
||||
</materials>
|
||||
32
tests/test_sourcepoint_batch/results.py
Normal file
32
tests/test_sourcepoint_batch/results.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
|
||||
# import statepoint
|
||||
sys.path.append('../../src/utils')
|
||||
import statepoint
|
||||
|
||||
# read in statepoint file
|
||||
if len(sys.argv) > 1:
|
||||
sp = statepoint.StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = statepoint.StatePoint('statepoint.8.binary')
|
||||
sp.read_results()
|
||||
sp.read_source()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
|
||||
# write out xyz
|
||||
xyz = sp.source[0].xyz
|
||||
for i in xyz:
|
||||
outstr += "{0:12.6E} ".format(i)
|
||||
outstr += "\n"
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
fh.write(outstr)
|
||||
3
tests/test_sourcepoint_batch/results_true.dat
Normal file
3
tests/test_sourcepoint_batch/results_true.dat
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
k-combined:
|
||||
0.000000E+00 0.000000E+00
|
||||
-9.438655E-02 -4.436810E+00 -2.416825E+00
|
||||
19
tests/test_sourcepoint_batch/settings.xml
Normal file
19
tests/test_sourcepoint_batch/settings.xml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0"?>
|
||||
<settings>
|
||||
|
||||
<state_point batches="2 3 4 5 8"/>
|
||||
<source_point batches="2 5 8"/>
|
||||
|
||||
<eigenvalue>
|
||||
<batches>10</batches>
|
||||
<inactive>5</inactive>
|
||||
<particles>1000</particles>
|
||||
</eigenvalue>
|
||||
|
||||
<source>
|
||||
<space type="box">
|
||||
<parameters>-4 -4 -4 4 4 4</parameters>
|
||||
</space>
|
||||
</source>
|
||||
|
||||
</settings>
|
||||
44
tests/test_sourcepoint_batch/test_sourcepoint_batch.py
Normal file
44
tests/test_sourcepoint_batch/test_sourcepoint_batch.py
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
from subprocess import Popen, STDOUT, PIPE, call
|
||||
import filecmp
|
||||
from nose_mpi import NoseMPI
|
||||
import glob
|
||||
|
||||
pwd = os.path.dirname(__file__)
|
||||
|
||||
def setup():
|
||||
os.putenv('PWD', pwd)
|
||||
os.chdir(pwd)
|
||||
|
||||
def test_run():
|
||||
openmc_path = pwd + '/../../src/openmc'
|
||||
if int(NoseMPI.mpi_np) > 0:
|
||||
proc = Popen([NoseMPI.mpi_exec, '-np', NoseMPI.mpi_np, openmc_path],
|
||||
stderr=STDOUT, stdout=PIPE)
|
||||
else:
|
||||
proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE)
|
||||
print(proc.communicate()[0])
|
||||
returncode = proc.returncode
|
||||
assert returncode == 0
|
||||
|
||||
def test_statepoint_exists():
|
||||
statepoint = glob.glob(pwd + '/statepoint.*')
|
||||
assert len(statepoint) == 5
|
||||
assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5')
|
||||
|
||||
def test_results():
|
||||
statepoint = glob.glob(pwd + '/statepoint.8.*')
|
||||
call(['python', 'results.py', statepoint[0]])
|
||||
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
|
||||
if not compare:
|
||||
os.rename('results_test.dat', 'results_error.dat')
|
||||
assert compare
|
||||
|
||||
def teardown():
|
||||
output = glob.glob(pwd + '/statepoint.*')
|
||||
output.append(pwd + '/results_test.dat')
|
||||
for f in output:
|
||||
if os.path.exists(f):
|
||||
os.remove(f)
|
||||
8
tests/test_sourcepoint_interval/geometry.xml
Normal file
8
tests/test_sourcepoint_interval/geometry.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<geometry>
|
||||
|
||||
<!-- Sphere with radius 10 -->
|
||||
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="vacuum"/>
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
|
||||
</geometry>
|
||||
9
tests/test_sourcepoint_interval/materials.xml
Normal file
9
tests/test_sourcepoint_interval/materials.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0"?>
|
||||
<materials>
|
||||
|
||||
<material id="1">
|
||||
<density value="4.5" units="g/cc" />
|
||||
<nuclide name="U-235" xs="70c" ao="1.0" />
|
||||
</material>
|
||||
|
||||
</materials>
|
||||
32
tests/test_sourcepoint_interval/results.py
Normal file
32
tests/test_sourcepoint_interval/results.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
|
||||
# import statepoint
|
||||
sys.path.append('../../src/utils')
|
||||
import statepoint
|
||||
|
||||
# read in statepoint file
|
||||
if len(sys.argv) > 1:
|
||||
sp = statepoint.StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = statepoint.StatePoint('statepoint.8.binary')
|
||||
sp.read_results()
|
||||
sp.read_source()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
|
||||
# write out xyz
|
||||
xyz = sp.source[0].xyz
|
||||
for i in xyz:
|
||||
outstr += "{0:12.6E} ".format(i)
|
||||
outstr += "\n"
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
fh.write(outstr)
|
||||
3
tests/test_sourcepoint_interval/results_true.dat
Normal file
3
tests/test_sourcepoint_interval/results_true.dat
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
k-combined:
|
||||
0.000000E+00 0.000000E+00
|
||||
-9.438655E-02 -4.436810E+00 -2.416825E+00
|
||||
19
tests/test_sourcepoint_interval/settings.xml
Normal file
19
tests/test_sourcepoint_interval/settings.xml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0"?>
|
||||
<settings>
|
||||
|
||||
<state_point interval="2"/>
|
||||
<source_point interval="4"/>
|
||||
|
||||
<eigenvalue>
|
||||
<batches>10</batches>
|
||||
<inactive>5</inactive>
|
||||
<particles>1000</particles>
|
||||
</eigenvalue>
|
||||
|
||||
<source>
|
||||
<space type="box">
|
||||
<parameters>-4 -4 -4 4 4 4</parameters>
|
||||
</space>
|
||||
</source>
|
||||
|
||||
</settings>
|
||||
44
tests/test_sourcepoint_interval/test_sourcepoint_interval.py
Normal file
44
tests/test_sourcepoint_interval/test_sourcepoint_interval.py
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
from subprocess import Popen, STDOUT, PIPE, call
|
||||
import filecmp
|
||||
from nose_mpi import NoseMPI
|
||||
import glob
|
||||
|
||||
pwd = os.path.dirname(__file__)
|
||||
|
||||
def setup():
|
||||
os.putenv('PWD', pwd)
|
||||
os.chdir(pwd)
|
||||
|
||||
def test_run():
|
||||
openmc_path = pwd + '/../../src/openmc'
|
||||
if int(NoseMPI.mpi_np) > 0:
|
||||
proc = Popen([NoseMPI.mpi_exec, '-np', NoseMPI.mpi_np, openmc_path],
|
||||
stderr=STDOUT, stdout=PIPE)
|
||||
else:
|
||||
proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE)
|
||||
print(proc.communicate()[0])
|
||||
returncode = proc.returncode
|
||||
assert returncode == 0
|
||||
|
||||
def test_statepoint_exists():
|
||||
statepoint = glob.glob(pwd + '/statepoint.*')
|
||||
assert len(statepoint) == 5
|
||||
assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5')
|
||||
|
||||
def test_results():
|
||||
statepoint = glob.glob(pwd + '/statepoint.8.*')
|
||||
call(['python', 'results.py', statepoint[0]])
|
||||
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
|
||||
if not compare:
|
||||
os.rename('results_test.dat', 'results_error.dat')
|
||||
assert compare
|
||||
|
||||
def teardown():
|
||||
output = glob.glob(pwd + '/statepoint.*')
|
||||
output.append(pwd + '/results_test.dat')
|
||||
for f in output:
|
||||
if os.path.exists(f):
|
||||
os.remove(f)
|
||||
8
tests/test_sourcepoint_latest/geometry.xml
Normal file
8
tests/test_sourcepoint_latest/geometry.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<geometry>
|
||||
|
||||
<!-- Sphere with radius 10 -->
|
||||
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="vacuum"/>
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
|
||||
</geometry>
|
||||
9
tests/test_sourcepoint_latest/materials.xml
Normal file
9
tests/test_sourcepoint_latest/materials.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0"?>
|
||||
<materials>
|
||||
|
||||
<material id="1">
|
||||
<density value="4.5" units="g/cc" />
|
||||
<nuclide name="U-235" xs="70c" ao="1.0" />
|
||||
</material>
|
||||
|
||||
</materials>
|
||||
25
tests/test_sourcepoint_latest/results.py
Normal file
25
tests/test_sourcepoint_latest/results.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
|
||||
# import statepoint
|
||||
sys.path.append('../../src/utils')
|
||||
import statepoint
|
||||
|
||||
# read in statepoint file
|
||||
if len(sys.argv) > 1:
|
||||
sp = statepoint.StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = statepoint.StatePoint('statepoint.10.binary')
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
fh.write(outstr)
|
||||
2
tests/test_sourcepoint_latest/results_true.dat
Normal file
2
tests/test_sourcepoint_latest/results_true.dat
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
k-combined:
|
||||
3.011353E-01 2.854556E-03
|
||||
18
tests/test_sourcepoint_latest/settings.xml
Normal file
18
tests/test_sourcepoint_latest/settings.xml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0"?>
|
||||
<settings>
|
||||
|
||||
<source_point batches="0" separate="true" overwrite_latest="true"/>
|
||||
|
||||
<eigenvalue>
|
||||
<batches>10</batches>
|
||||
<inactive>5</inactive>
|
||||
<particles>1000</particles>
|
||||
</eigenvalue>
|
||||
|
||||
<source>
|
||||
<space type="box">
|
||||
<parameters>-4 -4 -4 4 4 4</parameters>
|
||||
</space>
|
||||
</source>
|
||||
|
||||
</settings>
|
||||
48
tests/test_sourcepoint_latest/test_sourcepoint_latest.py
Normal file
48
tests/test_sourcepoint_latest/test_sourcepoint_latest.py
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
from subprocess import Popen, STDOUT, PIPE, call
|
||||
import filecmp
|
||||
from nose_mpi import NoseMPI
|
||||
import glob
|
||||
|
||||
pwd = os.path.dirname(__file__)
|
||||
|
||||
def setup():
|
||||
os.putenv('PWD', pwd)
|
||||
os.chdir(pwd)
|
||||
|
||||
def test_run():
|
||||
openmc_path = pwd + '/../../src/openmc'
|
||||
if int(NoseMPI.mpi_np) > 0:
|
||||
proc = Popen([NoseMPI.mpi_exec, '-np', NoseMPI.mpi_np, openmc_path],
|
||||
stderr=STDOUT, stdout=PIPE)
|
||||
else:
|
||||
proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE)
|
||||
print(proc.communicate()[0])
|
||||
returncode = proc.returncode
|
||||
assert returncode == 0
|
||||
|
||||
def test_statepoint_exists():
|
||||
statepoint = glob.glob(pwd + '/statepoint.10.*')
|
||||
assert len(statepoint) == 1
|
||||
assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5')
|
||||
source = glob.glob(pwd + '/source.*')
|
||||
assert len(source) == 1
|
||||
assert source[0].endswith('binary') or source[0].endswith('h5')
|
||||
|
||||
def test_results():
|
||||
statepoint = glob.glob(pwd + '/statepoint.10.*')
|
||||
call(['python', 'results.py', statepoint[0]])
|
||||
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
|
||||
if not compare:
|
||||
os.rename('results_test.dat', 'results_error.dat')
|
||||
assert compare
|
||||
|
||||
def teardown():
|
||||
output = glob.glob(pwd + '/statepoint.10.*')
|
||||
output += glob.glob(pwd + '/source.*')
|
||||
output.append(pwd + '/results_test.dat')
|
||||
for f in output:
|
||||
if os.path.exists(f):
|
||||
os.remove(f)
|
||||
8
tests/test_sourcepoint_restart/geometry.xml
Normal file
8
tests/test_sourcepoint_restart/geometry.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<geometry>
|
||||
|
||||
<!-- Sphere with radius 10 -->
|
||||
<surface id="1" type="sphere" coeffs="0 0 0 10" boundary="vacuum"/>
|
||||
<cell id="1" material="1" surfaces="-1" />
|
||||
|
||||
</geometry>
|
||||
9
tests/test_sourcepoint_restart/materials.xml
Normal file
9
tests/test_sourcepoint_restart/materials.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0"?>
|
||||
<materials>
|
||||
|
||||
<material id="1">
|
||||
<density value="4.5" units="g/cc" />
|
||||
<nuclide name="U-235" xs="70c" ao="1.0" />
|
||||
</material>
|
||||
|
||||
</materials>
|
||||
44
tests/test_sourcepoint_restart/results.py
Normal file
44
tests/test_sourcepoint_restart/results.py
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import numpy as np
|
||||
|
||||
# import statepoint
|
||||
sys.path.append('../../src/utils')
|
||||
import statepoint
|
||||
|
||||
# read in statepoint file
|
||||
if len(sys.argv) > 1:
|
||||
sp = statepoint.StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = statepoint.StatePoint('statepoint.10.binary')
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results1 = sp.tallies[0].results
|
||||
shape1 = results1.shape
|
||||
size1 = (np.product(shape1))
|
||||
results1 = np.reshape(results1, size1)
|
||||
results2 = sp.tallies[1].results
|
||||
shape2 = results2.shape
|
||||
size2 = (np.product(shape2))
|
||||
results2 = np.reshape(results2, size2)
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tally 1:\n'
|
||||
for item in results1:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
outstr += 'tally 2:\n'
|
||||
for item in results2:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
fh.write(outstr)
|
||||
2412
tests/test_sourcepoint_restart/results_true.dat
Normal file
2412
tests/test_sourcepoint_restart/results_true.dat
Normal file
File diff suppressed because it is too large
Load diff
19
tests/test_sourcepoint_restart/settings.xml
Normal file
19
tests/test_sourcepoint_restart/settings.xml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0"?>
|
||||
<settings>
|
||||
|
||||
<state_point batches="7 10" />
|
||||
<source_point batches="7" separate="true" />
|
||||
|
||||
<eigenvalue>
|
||||
<batches>10</batches>
|
||||
<inactive>5</inactive>
|
||||
<particles>1000</particles>
|
||||
</eigenvalue>
|
||||
|
||||
<source>
|
||||
<space type="box">
|
||||
<parameters>-4 -4 -4 4 4 4</parameters>
|
||||
</space>
|
||||
</source>
|
||||
|
||||
</settings>
|
||||
23
tests/test_sourcepoint_restart/tallies.xml
Normal file
23
tests/test_sourcepoint_restart/tallies.xml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0"?>
|
||||
<tallies>
|
||||
|
||||
<mesh id="1">
|
||||
<type>rectangular</type>
|
||||
<dimension>5 3 4</dimension>
|
||||
<lower_left>-10. -5. 0.</lower_left>
|
||||
<upper_right>10. 4. 9.</upper_right>
|
||||
</mesh>
|
||||
|
||||
<tally id="10">
|
||||
<filter type="mesh" bins="1" />
|
||||
<filter type="energy" bins="0.0 5.0 10.0" />
|
||||
<filter type="energyout" bins="0.0 5.0 10.0" />
|
||||
<scores>scatter-P3 nu-fission</scores>
|
||||
</tally>
|
||||
|
||||
<tally id="5">
|
||||
<filter type="cell" bins="1" />
|
||||
<scores>fission absorption total flux</scores>
|
||||
</tally>
|
||||
|
||||
</tallies>
|
||||
129
tests/test_sourcepoint_restart/test_sourcepoint_restart.py
Normal file
129
tests/test_sourcepoint_restart/test_sourcepoint_restart.py
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
from subprocess import Popen, STDOUT, PIPE, call
|
||||
import filecmp
|
||||
from nose_mpi import NoseMPI
|
||||
import glob
|
||||
|
||||
pwd = os.path.dirname(__file__)
|
||||
|
||||
def setup():
|
||||
os.putenv('PWD', pwd)
|
||||
os.chdir(pwd)
|
||||
|
||||
def test_run():
|
||||
openmc_path = pwd + '/../../src/openmc'
|
||||
if int(NoseMPI.mpi_np) > 0:
|
||||
proc = Popen([NoseMPI.mpi_exec, '-np', NoseMPI.mpi_np, openmc_path],
|
||||
stderr=STDOUT, stdout=PIPE)
|
||||
else:
|
||||
proc = Popen([openmc_path], stderr=STDOUT, stdout=PIPE)
|
||||
print(proc.communicate()[0])
|
||||
returncode = proc.returncode
|
||||
assert returncode == 0
|
||||
|
||||
def test_created_statepoint():
|
||||
statepoint = glob.glob(pwd + '/statepoint.*')
|
||||
assert len(statepoint) == 2
|
||||
assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5')
|
||||
sourcepoint = glob.glob(pwd + '/source.7.*')
|
||||
assert len(sourcepoint) == 1
|
||||
assert sourcepoint[0].endswith('binary') or sourcepoint[0].endswith('h5')
|
||||
|
||||
def test_results():
|
||||
statepoint = glob.glob(pwd + '/statepoint.10.*')
|
||||
call(['python', 'results.py', statepoint[0]])
|
||||
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
|
||||
if not compare:
|
||||
os.rename('results_test.dat', 'results_error.dat')
|
||||
assert compare
|
||||
os.remove(statepoint[0])
|
||||
|
||||
def test_restart_form1():
|
||||
statepoint = glob.glob(pwd + '/statepoint.7.*')
|
||||
sourcepoint = glob.glob(pwd + '/source.7.*')
|
||||
openmc_path = pwd + '/../../src/openmc'
|
||||
if int(NoseMPI.mpi_np) > 0:
|
||||
proc = Popen([NoseMPI.mpi_exec, '-np', NoseMPI.mpi_np, openmc_path,
|
||||
'-r', statepoint[0], sourcepoint[0]],
|
||||
stderr=STDOUT, stdout=PIPE)
|
||||
else:
|
||||
proc = Popen([openmc_path, '-r', statepoint[0], sourcepoint[0]], stderr=STDOUT, stdout=PIPE)
|
||||
print(proc.communicate()[0])
|
||||
returncode = proc.returncode
|
||||
assert returncode == 0
|
||||
|
||||
def test_created_statepoint_form1():
|
||||
statepoint = glob.glob(pwd + '/statepoint.10.*')
|
||||
assert len(statepoint) == 1
|
||||
assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5')
|
||||
|
||||
def test_results_form1():
|
||||
statepoint = glob.glob(pwd + '/statepoint.10.*')
|
||||
call(['python', 'results.py', statepoint[0]])
|
||||
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
|
||||
if not compare:
|
||||
os.rename('results_test.dat', 'results_error.dat')
|
||||
assert compare
|
||||
os.remove(statepoint[0])
|
||||
|
||||
def test_restart_form2():
|
||||
statepoint = glob.glob(pwd + '/statepoint.7.*')
|
||||
sourcepoint = glob.glob(pwd + '/source.7.*')
|
||||
openmc_path = pwd + '/../../src/openmc'
|
||||
if int(NoseMPI.mpi_np) > 0:
|
||||
proc = Popen([NoseMPI.mpi_exec, '-np', NoseMPI.mpi_np, openmc_path,
|
||||
'--restart', statepoint[0], sourcepoint[0]],
|
||||
stderr=STDOUT, stdout=PIPE)
|
||||
else:
|
||||
proc = Popen([openmc_path, '--restart', statepoint[0], sourcepoint[0]],
|
||||
stderr=STDOUT, stdout=PIPE)
|
||||
print(proc.communicate()[0])
|
||||
returncode = proc.returncode
|
||||
assert returncode == 0
|
||||
|
||||
def test_created_statepoint_form2():
|
||||
statepoint = glob.glob(pwd + '/statepoint.10.*')
|
||||
assert len(statepoint) == 1
|
||||
assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5')
|
||||
|
||||
def test_results_form2():
|
||||
statepoint = glob.glob(pwd + '/statepoint.10.*')
|
||||
call(['python', 'results.py', statepoint[0]])
|
||||
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
|
||||
if not compare:
|
||||
os.rename('results_test.dat', 'results_error.dat')
|
||||
assert compare
|
||||
os.remove(statepoint[0])
|
||||
|
||||
def test_restart_serial():
|
||||
statepoint = glob.glob(pwd + '/statepoint.7.*')
|
||||
sourcepoint = glob.glob(pwd + '/source.7.*')
|
||||
openmc_path = pwd + '/../../src/openmc'
|
||||
proc = Popen([openmc_path, '--restart', statepoint[0], sourcepoint[0]],
|
||||
stderr=STDOUT, stdout=PIPE)
|
||||
print(proc.communicate()[0])
|
||||
returncode = proc.returncode
|
||||
assert returncode == 0
|
||||
|
||||
def test_created_statepoint_serial():
|
||||
statepoint = glob.glob(pwd + '/statepoint.10.*')
|
||||
assert len(statepoint) == 1
|
||||
assert statepoint[0].endswith('binary') or statepoint[0].endswith('h5')
|
||||
|
||||
def test_results_serial():
|
||||
statepoint = glob.glob(pwd + '/statepoint.10.*')
|
||||
call(['python', 'results.py', statepoint[0]])
|
||||
compare = filecmp.cmp('results_test.dat', 'results_true.dat')
|
||||
if not compare:
|
||||
os.rename('results_test.dat', 'results_error.dat')
|
||||
assert compare
|
||||
|
||||
def teardown():
|
||||
output = glob.glob(pwd + '/statepoint.*')
|
||||
output += glob.glob(pwd + '/source.*')
|
||||
output.append(pwd + '/results_test.dat')
|
||||
for f in output:
|
||||
if os.path.exists(f):
|
||||
os.remove(f)
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<settings>
|
||||
|
||||
<state_point batches="10" source_separate="true" />
|
||||
<state_point batches="10" />
|
||||
<source_point separate="true" />
|
||||
|
||||
<eigenvalue>
|
||||
<batches>10</batches>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue