mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Merge branch 'develop' into photon-alund
This commit is contained in:
commit
460452d4f7
746 changed files with 17707 additions and 10855 deletions
|
|
@ -4,32 +4,191 @@
|
|||
C API
|
||||
=====
|
||||
|
||||
The libopenmc shared library that is built when installing OpenMC exports a
|
||||
number of C interoperable functions and global variables that can be used for
|
||||
in-memory coupling. While it is possible to directly use the C API as documented
|
||||
here for coupling, most advanced users will find it easier to work with the
|
||||
Python bindings in the :py:mod:`openmc.capi` module.
|
||||
|
||||
.. warning:: The C API is still experimental and may undergo substantial changes
|
||||
in future releases.
|
||||
|
||||
----------------
|
||||
Type Definitions
|
||||
----------------
|
||||
|
||||
.. c:type:: Bank
|
||||
|
||||
Attributes of a source particle.
|
||||
|
||||
.. c:member:: double wgt
|
||||
|
||||
Weight of the particle
|
||||
|
||||
.. c:member:: double xyz[3]
|
||||
|
||||
Position of the particle (units of cm)
|
||||
|
||||
.. c:member:: double uvw[3]
|
||||
|
||||
Unit vector indicating direction of the particle
|
||||
|
||||
.. c:member:: double E
|
||||
|
||||
Energy of the particle in eV
|
||||
|
||||
.. c:member:: int delayed_group
|
||||
|
||||
If the particle is a delayed neutron, indicates which delayed precursor
|
||||
group it was born from. If not a delayed neutron, this member is zero.
|
||||
|
||||
---------
|
||||
Functions
|
||||
---------
|
||||
|
||||
.. c:function:: void openmc_calculate_volumes()
|
||||
|
||||
Run a stochastic volume calculation
|
||||
|
||||
.. c:function:: int openmc_cell_get_fill(int32_t index, int* type, int32_t** indices, int32_t* n)
|
||||
|
||||
Get the fill for a cell
|
||||
|
||||
:param int32_t index: Index in the cells array
|
||||
:param int* type: Type of the fill
|
||||
:param int32_t** indices: Array of material indices for cell
|
||||
:param int32_t* n: Length of indices array
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_cell_get_id(int32_t index, int32_t* id)
|
||||
|
||||
Get the ID of a cell
|
||||
|
||||
:param index: Index in the cells array
|
||||
:type index: int32_t
|
||||
:param id: ID of the cell
|
||||
:type id: int32_t*
|
||||
:param int32_t index: Index in the cells array
|
||||
:param int32_t* id: ID of the cell
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_cell_set_temperature(index index, double T, int32_t* instance)
|
||||
.. c:function:: int openmc_cell_set_fill(int32_t index, int type, int32_t n, const int32_t* indices)
|
||||
|
||||
Set the fill for a cell
|
||||
|
||||
:param int32_t index: Index in the cells array
|
||||
:param int type: Type of the fill
|
||||
:param int32_t n: Length of indices array
|
||||
:param indices: Array of material indices for cell
|
||||
:type indices: const int32_t*
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_cell_set_id(int32_t index, int32_t id)
|
||||
|
||||
Set the ID of a cell
|
||||
|
||||
:param int32_t index: Index in the cells array
|
||||
:param int32_t id: ID of the cell
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_cell_set_temperature(index index, double T, const int32_t* instance)
|
||||
|
||||
Set the temperature of a cell.
|
||||
|
||||
:param index: Index in the cells array
|
||||
:type index: int32_t
|
||||
:param T: Temperature in Kelvin
|
||||
:type T: double
|
||||
:param int32_t index: Index in the cells array
|
||||
:param double T: Temperature in Kelvin
|
||||
:param instance: Which instance of the cell. To set the temperature for all
|
||||
instances, pass a null pointer.
|
||||
:type instance: int32_t*
|
||||
:type instance: const int32_t*
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_energy_filter_get_bins(int32_t index, double** energies, int32_t* n)
|
||||
|
||||
Return the bounding energies for an energy filter
|
||||
|
||||
:param int32_t index: Index in the filters array
|
||||
:param double** energies: Bounding energies of the bins for the energy filter
|
||||
:param int32_t* n: Number of energies specified
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_energy_filter_set_bins(int32_t index, int32_t n, const double* energies)
|
||||
|
||||
Set the bounding energies for an energy filter
|
||||
|
||||
:param int32_t index: Index in the filters array
|
||||
:param int32_t n: Number of energies specified
|
||||
:param energies: Bounding energies of the bins for the energy filter
|
||||
:type energies: const double*
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_extend_cells(int32_t n, int32_t* index_start, int32_t* index_end)
|
||||
|
||||
Extend the cells array by n elements
|
||||
|
||||
:param int32_t n: Number of cells to create
|
||||
:param int32_t* index_start: Index of first new cell
|
||||
:param int32_t* index_end: Index of last new cell
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_extend_filters(int32_t n, int32_t* index_start, int32_t* index_end)
|
||||
|
||||
Extend the filters array by n elements
|
||||
|
||||
:param int32_t n: Number of filters to create
|
||||
:param int32_t* index_start: Index of first new filter
|
||||
:param int32_t* index_end: Index of last new filter
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_extend_materials(int32_t n, int32_t* index_start, int32_t* index_end)
|
||||
|
||||
Extend the materials array by n elements
|
||||
|
||||
:param int32_t n: Number of materials to create
|
||||
:param int32_t* index_start: Index of first new material
|
||||
:param int32_t* index_end: Index of last new material
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_extend_sources(int32_t n, int32_t* index_start, int32_t* index_end)
|
||||
|
||||
Extend the external sources array by n elements
|
||||
|
||||
:param int32_t n: Number of sources to create
|
||||
:param int32_t* index_start: Index of first new source
|
||||
:param int32_t* index_end: Index of last new source
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_extend_tallies(int32_t n, int32_t* index_start, int32_t* index_end)
|
||||
|
||||
Extend the tallies array by n elements
|
||||
|
||||
:param int32_t n: Number of tallies to create
|
||||
:param int32_t* index_start: Index of first new tally
|
||||
:param int32_t* index_end: Index of last new tally
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_filter_get_id(int32_t index, int32_t* id)
|
||||
|
||||
Get the ID of a filter
|
||||
|
||||
:param int32_t index: Index in the filters array
|
||||
:param int32_t* id: ID of the filter
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_filter_set_id(int32_t index, int32_t id)
|
||||
|
||||
Set the ID of a filter
|
||||
|
||||
:param int32_t index: Index in the filters array
|
||||
:param int32_t id: ID of the filter
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
|
|
@ -41,54 +200,41 @@ C API
|
|||
|
||||
Determine the ID of the cell/material containing a given point
|
||||
|
||||
:param xyz: Cartesian coordinates
|
||||
:type xyz: double[3]
|
||||
:param rtype: Which ID to return (1=cell, 2=material)
|
||||
:type rtype: int
|
||||
:param id: ID of the cell/material found. If a material is requested and the
|
||||
point is in a void, the ID is 0. If an error occurs, the ID is -1.
|
||||
:type id: int32_t*
|
||||
:param instance: If a cell is repetaed in the geometry, the instance of the
|
||||
cell that was found and zero otherwise.
|
||||
:type instance: int32_t*
|
||||
:param double[3] xyz: Cartesian coordinates
|
||||
:param int rtype: Which ID to return (1=cell, 2=material)
|
||||
:param int32_t* id: ID of the cell/material found. If a material is requested
|
||||
and the point is in a void, the ID is 0. If an error
|
||||
occurs, the ID is -1.
|
||||
:param int32_t* instance: If a cell is repeated in the geometry, the instance
|
||||
of the cell that was found and zero otherwise.
|
||||
|
||||
.. c:function:: int openmc_get_cell_index(int32_t id, int32_t* index)
|
||||
|
||||
Get the index in the cells array for a cell with a given ID
|
||||
|
||||
:param id: ID of the cell
|
||||
:type id: int32_t
|
||||
:param index: Index in the cells array
|
||||
:type index: int32_t*
|
||||
:param int32_t id: ID of the cell
|
||||
:param int32_t* index: Index in the cells array
|
||||
:return: Return status (negative if an error occurs)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_get_keff(double k_combined[])
|
||||
.. c:function:: int openmc_get_filter_index(int32_t id, int32_t* index)
|
||||
|
||||
:param k_combined: Combined estimate of k-effective
|
||||
:type k_combined: double[2]
|
||||
Get the index in the filters array for a filter with a given ID
|
||||
|
||||
:param int32_t id: ID of the filter
|
||||
:param int32_t* index: Index in the filters array
|
||||
:return: Return status (negative if an error occurs)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_get_nuclide_index(char name[], int* index)
|
||||
.. c:function:: void openmc_get_filter_next_id(int32_t* id)
|
||||
|
||||
Get the index in the nuclides array for a nuclide with a given name
|
||||
Get an integer ID that has not been used by any filters.
|
||||
|
||||
:param name: Name of the nuclide
|
||||
:type name: char[]
|
||||
:param index: Index in the nuclides array
|
||||
:type index: int*
|
||||
:return: Return status (negative if an error occurs)
|
||||
:rtype: int
|
||||
:param int32_t* id: Unused integer ID
|
||||
|
||||
.. c:function:: int openmc_get_tally_index(int32_t id, int32_t* index)
|
||||
.. c:function:: int openmc_get_keff(double k_combined[2])
|
||||
|
||||
Get the index in the tallies array for a tally with a given ID
|
||||
|
||||
:param id: ID of the tally
|
||||
:type id: int32_t
|
||||
:param index: Index in the tallies array
|
||||
:type index: int32_t*
|
||||
:param double[2] k_combined: Combined estimate of k-effective
|
||||
:return: Return status (negative if an error occurs)
|
||||
:rtype: int
|
||||
|
||||
|
|
@ -96,10 +242,26 @@ C API
|
|||
|
||||
Get the index in the materials array for a material with a given ID
|
||||
|
||||
:param id: ID of the material
|
||||
:type id: int32_t
|
||||
:param index: Index in the materials array
|
||||
:type index: int32_t*
|
||||
:param int32_t id: ID of the material
|
||||
:param int32_t* index: Index in the materials array
|
||||
:return: Return status (negative if an error occurs)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_get_nuclide_index(char name[], int* index)
|
||||
|
||||
Get the index in the nuclides array for a nuclide with a given name
|
||||
|
||||
:param char[] name: Name of the nuclide
|
||||
:param int* index: Index in the nuclides array
|
||||
:return: Return status (negative if an error occurs)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_get_tally_index(int32_t id, int32_t* index)
|
||||
|
||||
Get the index in the tallies array for a tally with a given ID
|
||||
|
||||
:param int32_t id: ID of the tally
|
||||
:param int32_t* index: Index in the tallies array
|
||||
:return: Return status (negative if an error occurs)
|
||||
:rtype: int
|
||||
|
||||
|
|
@ -107,48 +269,42 @@ C API
|
|||
|
||||
Reset tallies, timers, and pseudo-random number generator state
|
||||
|
||||
.. c:function:: void openmc_init(int intracomm)
|
||||
.. c:function:: void openmc_init(const int* intracomm)
|
||||
|
||||
Initialize OpenMC
|
||||
|
||||
:param intracomm: MPI intracommunicator
|
||||
:type intracomm: int
|
||||
:param intracomm: MPI intracommunicator. If MPI is not being used, a null
|
||||
pointer should be passed.
|
||||
:type intracomm: const int*
|
||||
|
||||
.. c:function:: int openmc_load_nuclide(char name[])
|
||||
|
||||
Load data for a nuclide from the HDF5 data library.
|
||||
|
||||
:param name: Name of the nuclide.
|
||||
:type name: char[]
|
||||
:param char[] name: Name of the nuclide.
|
||||
:return: Return status (negative if an error occurs)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_material_add_nuclide(int32_t index, char name[], double density)
|
||||
.. c:function:: int openmc_material_add_nuclide(int32_t index, const char name[], double density)
|
||||
|
||||
Add a nuclide to an existing material. If the nuclide already exists, the
|
||||
density is overwritten.
|
||||
|
||||
:param index: Index in the materials array
|
||||
:type index: int32_t
|
||||
:param int32_t index: Index in the materials array
|
||||
:param name: Name of the nuclide
|
||||
:type name: char[]
|
||||
:param density: Density in atom/b-cm
|
||||
:type density: double
|
||||
:type name: const char[]
|
||||
:param double density: Density in atom/b-cm
|
||||
:return: Return status (negative if an error occurs)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_material_get_densities(int32_t index, int* nuclides[], double* densities[])
|
||||
.. c:function:: int openmc_material_get_densities(int32_t index, int** nuclides, double** densities, int* n)
|
||||
|
||||
Get density for each nuclide in a material.
|
||||
|
||||
:param index: Index in the materials array
|
||||
:type index: int32_t
|
||||
:param nuclides: Pointer to array of nuclide indices
|
||||
:type nuclides: int**
|
||||
:param densities: Pointer to the array of densities
|
||||
:type densities: double**
|
||||
:param n: Length of the array
|
||||
:type n: int
|
||||
:param int32_t index: Index in the materials array
|
||||
:param int** nuclides: Pointer to array of nuclide indices
|
||||
:param double** densities: Pointer to the array of densities
|
||||
:param int* n: Length of the array
|
||||
:return: Return status (negative if an error occurs)
|
||||
:rtype: int
|
||||
|
||||
|
|
@ -156,10 +312,8 @@ C API
|
|||
|
||||
Get the ID of a material
|
||||
|
||||
:param index: Index in the materials array
|
||||
:type index: int32_t
|
||||
:param id: ID of the material
|
||||
:type id: int32_t*
|
||||
:param int32_t index: Index in the materials array
|
||||
:param int32_t* id: ID of the material
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
|
|
@ -167,34 +321,75 @@ C API
|
|||
|
||||
Set the density of a material.
|
||||
|
||||
:param index: Index in the materials array
|
||||
:type index: int32_t
|
||||
:param density: Density of the material in atom/b-cm
|
||||
:type density: double
|
||||
:param int32_t index: Index in the materials array
|
||||
:param double density: Density of the material in atom/b-cm
|
||||
:return: Return status (negative if an error occurs)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_material_set_densities(int32_t, n, char* name[], double density[])
|
||||
.. c:function:: int openmc_material_set_densities(int32_t index, int n, const char** name, const double density*)
|
||||
|
||||
:param index: Index in the materials array
|
||||
:type index: int32_t
|
||||
:param n: Length of name/density
|
||||
:type n: int
|
||||
:param int32_t index: Index in the materials array
|
||||
:param int n: Length of name/density
|
||||
:param name: Array of nuclide names
|
||||
:type name: char**
|
||||
:type name: const char**
|
||||
:param density: Array of densities
|
||||
:type density: double[]
|
||||
:type density: const double*
|
||||
:return: Return status (negative if an error occurs)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_nuclide_name(int index, char* name[])
|
||||
.. c:function:: int openmc_material_set_id(int32_t index, int32_t id)
|
||||
|
||||
Set the ID of a material
|
||||
|
||||
:param int32_t index: Index in the materials array
|
||||
:param int32_t id: ID of the material
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_material_filter_get_bins(int32_t index, int32_t** bins, int32_t* n)
|
||||
|
||||
Get the bins for a material filter
|
||||
|
||||
:param int32_t index: Index in the filters array
|
||||
:param int32_t** bins: Index in the materials array for each bin
|
||||
:param int32_t* n: Number of bins
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_material_filter_set_bins(int32_t index, int32_t n, const int32_t* bins)
|
||||
|
||||
Set the bins for a material filter
|
||||
|
||||
:param int32_t index: Index in the filters array
|
||||
:param int32_t n: Number of bins
|
||||
:param bins: Index in the materials array for each bin
|
||||
:type bins: const int32_t*
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_mesh_filter_set_mesh(int32_t index, int32_t index_mesh)
|
||||
|
||||
Set the mesh for a mesh filter
|
||||
|
||||
:param int32_t index: Index in the filters array
|
||||
:param int32_t index_mesh: Index in the meshes array
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_next_batch()
|
||||
|
||||
Simulate next batch of particles. Must be called after openmc_simulation_init().
|
||||
|
||||
:return: Integer indicating whether simulation has finished (negative) or not
|
||||
finished (zero).
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_nuclide_name(int index, char** name)
|
||||
|
||||
Get name of a nuclide
|
||||
|
||||
:param index: Index in the nuclides array
|
||||
:type index: int
|
||||
:param name: Name of the nuclide
|
||||
:type name: char**
|
||||
:param int index: Index in the nuclides array
|
||||
:param char** name: Name of the nuclide
|
||||
:return: Return status (negative if an error occurs)
|
||||
:rtype: int
|
||||
|
||||
|
|
@ -210,27 +405,84 @@ C API
|
|||
|
||||
Run a simulation
|
||||
|
||||
.. c:function:: void openmc_simulation_finalize()
|
||||
|
||||
Finalize a simulation.
|
||||
|
||||
.. c:function:: void openmc_simulation_init()
|
||||
|
||||
Initialize a simulation. Must be called after openmc_init().
|
||||
|
||||
.. c:function:: int openmc_source_bank(struct Bank** ptr, int64_t* n)
|
||||
|
||||
Return a pointer to the source bank array.
|
||||
|
||||
:param ptr: Pointer to the source bank array
|
||||
:type ptr: struct Bank**
|
||||
:param int64_t* n: Length of the source bank array
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_source_set_strength(int32_t index, double strength)
|
||||
|
||||
Set the strength of an external source
|
||||
|
||||
:param int32_t index: Index in the external source array
|
||||
:param double strength: Source strength
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: void openmc_statepoint_write(const char filename[])
|
||||
|
||||
Write a statepoint file
|
||||
|
||||
:param filename: Name of file to create. If a null pointer is passed, a
|
||||
filename is assigned automatically.
|
||||
:type filename: const char[]
|
||||
|
||||
.. c:function:: int openmc_tally_get_id(int32_t index, int32_t* id)
|
||||
|
||||
Get the ID of a tally
|
||||
|
||||
:param index: Index in the tallies array
|
||||
:type index: int32_t
|
||||
:param id: ID of the tally
|
||||
:type id: int32_t*
|
||||
:param int32_t index: Index in the tallies array
|
||||
:param int32_t* id: ID of the tally
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_tally_get_nuclides(int32_t index, int* nuclides[], int* n)
|
||||
.. c:function:: int openmc_tally_get_filters(int32_t index, int32_t** indices, int* n)
|
||||
|
||||
Get filters specified in a tally
|
||||
|
||||
:param int32_t index: Index in the tallies array
|
||||
:param int32_t** indices: Array of filter indices
|
||||
:param int* n: Number of filters
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_tally_get_n_realizations(int32_t index, int32_t* n)
|
||||
|
||||
:param int32_t index: Index in the tallies array
|
||||
:param int32_t* n: Number of realizations
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_tally_get_nuclides(int32_t index, int** nuclides, int* n)
|
||||
|
||||
Get nuclides specified in a tally
|
||||
|
||||
:param index: Index in the tallies array
|
||||
:type index: int32_t
|
||||
:param nuclides: Array of nuclide indices
|
||||
:type nuclides: int**
|
||||
:param n: Number of nuclides
|
||||
:type n: int*
|
||||
:param int32_t index: Index in the tallies array
|
||||
:param int** nuclides: Array of nuclide indices
|
||||
:param int* n: Number of nuclides
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_tally_get_scores(int32_t index, int** scores, int* n)
|
||||
|
||||
Get scores specified for a tally
|
||||
|
||||
:param int32_t index: Index in the tallies array
|
||||
:param int** scores: Array of scores
|
||||
:param int* n: Number of scores
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
|
|
@ -238,24 +490,50 @@ C API
|
|||
|
||||
Get a pointer to tally results array.
|
||||
|
||||
:param index: Index in the tallies array
|
||||
:type index: int32_t
|
||||
:param ptr: Pointer to the results array
|
||||
:type ptr: double**
|
||||
:param shape_: Shape of the results array
|
||||
:type shape_: int[3]
|
||||
:param int32_t index: Index in the tallies array
|
||||
:param double** ptr: Pointer to the results array
|
||||
:param int[3] shape_: Shape of the results array
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_tally_set_nuclides(int32_t index, int n, char* nuclides[])
|
||||
.. c:function:: int openmc_tally_set_filters(int32_t index, int n, const int32_t* indices)
|
||||
|
||||
Set filters for a tally
|
||||
|
||||
:param int32_t index: Index in the tallies array
|
||||
:param int n: Number of filters
|
||||
:param indices: Array of filter indices
|
||||
:type indices: const int32_t*
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_tally_set_id(int32_t index, int32_t id)
|
||||
|
||||
Set the ID of a tally
|
||||
|
||||
:param int32_t index: Index in the tallies array
|
||||
:param int32_t id: ID of the tally
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_tally_set_nuclides(int32_t index, int n, const char** nuclides)
|
||||
|
||||
Set the nuclides for a tally
|
||||
|
||||
:param index: Index in the tallies array
|
||||
:type index: int32_t
|
||||
:param n: Number of nuclides
|
||||
:type n: int
|
||||
:param int32_t index: Index in the tallies array
|
||||
:param int n: Number of nuclides
|
||||
:param nuclides: Array of nuclide names
|
||||
:type nuclides: char**
|
||||
:type nuclides: const char**
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
||||
.. c:function:: int openmc_tally_set_scores(int32_t index, int n, const int* scores)
|
||||
|
||||
Set scores for a tally
|
||||
|
||||
:param int32_t index: Index in the tallies array
|
||||
:param int n: Number of scores
|
||||
:param scores: Array of scores
|
||||
:type scores: const int*
|
||||
:return: Return status (negative if an error occurred)
|
||||
:rtype: int
|
||||
|
|
|
|||
|
|
@ -18,19 +18,21 @@ on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
|||
|
||||
# On Read the Docs, we need to mock a few third-party modules so we don't get
|
||||
# ImportErrors when building documentation
|
||||
try:
|
||||
from unittest.mock import MagicMock
|
||||
except ImportError:
|
||||
from mock import Mock as MagicMock
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
|
||||
MOCK_MODULES = ['numpy', 'numpy.polynomial', 'numpy.polynomial.polynomial',
|
||||
'numpy.ctypeslib', 'scipy', 'scipy.sparse', 'scipy.interpolate',
|
||||
'scipy.integrate', 'scipy.optimize', 'scipy.special', 'h5py',
|
||||
'pandas', 'uncertainties', 'openmoc', 'openmc.data.reconstruct']
|
||||
MOCK_MODULES = [
|
||||
'numpy', 'numpy.polynomial', 'numpy.polynomial.polynomial',
|
||||
'numpy.ctypeslib', 'scipy', 'scipy.sparse', 'scipy.sparse.linalg',
|
||||
'scipy.interpolate', 'scipy.integrate', 'scipy.optimize', 'scipy.special',
|
||||
'scipy.stats', 'scipy.spatial', 'h5py', 'pandas', 'uncertainties',
|
||||
'matplotlib', 'matplotlib.pyplot', 'openmoc',
|
||||
'openmc.data.reconstruct'
|
||||
]
|
||||
sys.modules.update((mod_name, MagicMock()) for mod_name in MOCK_MODULES)
|
||||
|
||||
import numpy as np
|
||||
np.ndarray = MagicMock
|
||||
np.polynomial.Polynomial = MagicMock
|
||||
|
||||
|
||||
|
|
@ -51,6 +53,7 @@ extensions = ['sphinx.ext.autodoc',
|
|||
'sphinx.ext.autosummary',
|
||||
'sphinx.ext.intersphinx',
|
||||
'sphinx.ext.viewcode',
|
||||
'sphinx.ext.imgconverter',
|
||||
'sphinx_numfig',
|
||||
'notebook_sphinxext']
|
||||
|
||||
|
|
@ -68,16 +71,16 @@ master_doc = 'index'
|
|||
|
||||
# General information about the project.
|
||||
project = u'OpenMC'
|
||||
copyright = u'2011-2017, Massachusetts Institute of Technology'
|
||||
copyright = u'2011-2018, Massachusetts Institute of Technology'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = "0.9"
|
||||
version = "0.10"
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = "0.9.0"
|
||||
release = "0.10.0"
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
|
@ -251,6 +254,6 @@ napoleon_use_ivar = True
|
|||
intersphinx_mapping = {
|
||||
'python': ('https://docs.python.org/3', None),
|
||||
'numpy': ('https://docs.scipy.org/doc/numpy/', None),
|
||||
'pandas': ('http://pandas.pydata.org/pandas-docs/stable/', None),
|
||||
'matplotlib': ('http://matplotlib.org/', None)
|
||||
'pandas': ('https://pandas.pydata.org/pandas-docs/stable/', None),
|
||||
'matplotlib': ('https://matplotlib.org/', None)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,15 +5,16 @@ Building Sphinx Documentation
|
|||
=============================
|
||||
|
||||
In order to build the documentation in the ``docs`` directory, you will need to
|
||||
have the Sphinx_ third-party Python package. The easiest way to install Sphinx
|
||||
is via pip:
|
||||
have the `Sphinx <http://openmc.readthedocs.io/en/latest/>`_ third-party Python
|
||||
package. The easiest way to install Sphinx is via pip:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
sudo pip install sphinx
|
||||
|
||||
Additionally, you will also need a Sphinx extension for numbering figures. The
|
||||
Numfig_ package can be installed directly with pip:
|
||||
`Numfig <http://openmc.readthedocs.io/en/latest/>`_ package can be installed
|
||||
directly with pip:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
|
|
@ -24,7 +25,7 @@ Building Documentation as a Webpage
|
|||
-----------------------------------
|
||||
|
||||
To build the documentation as a webpage (what appears at
|
||||
http://mit-crpg.github.io/openmc), simply go to the ``docs`` directory and run:
|
||||
http://openmc.readthedocs.io), simply go to the ``docs`` directory and run:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
|
|
@ -35,21 +36,9 @@ Building Documentation as a PDF
|
|||
-------------------------------
|
||||
|
||||
To build PDF documentation, you will need to have a LaTeX distribution installed
|
||||
on your computer as well as Inkscape_, which is used to convert .svg files to
|
||||
.pdf files. Inkscape can be installed in a Debian-derivative with:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
sudo apt-get install inkscape
|
||||
|
||||
One the pre-requisites are installed, simply go to the ``docs`` directory and
|
||||
run:
|
||||
on your computer. Once you have a LaTeX distribution installed, simply go to the
|
||||
``docs`` directory and run:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
make latexpdf
|
||||
|
||||
.. _Sphinx: http://sphinx-doc.org
|
||||
.. _sphinxcontrib-tikz: https://bitbucket.org/philexander/tikz
|
||||
.. _Numfig: https://pypi.python.org/pypi/sphinx_numfig
|
||||
.. _Inkscape: https://inkscape.org
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ as debugging.
|
|||
|
||||
.. toctree::
|
||||
:numbered:
|
||||
:maxdepth: 3
|
||||
:maxdepth: 2
|
||||
|
||||
structures
|
||||
styleguide
|
||||
workflow
|
||||
tests
|
||||
user-input
|
||||
docbuild
|
||||
|
|
|
|||
|
|
@ -1,155 +0,0 @@
|
|||
.. _devguide_structures:
|
||||
|
||||
===============
|
||||
Data Structures
|
||||
===============
|
||||
|
||||
The purpose of this section is to give you an overview of the major data
|
||||
structures in OpenMC and how they are logically related. A majority of variables
|
||||
in OpenMC are `derived types`_ (similar to a struct in C). These derived types
|
||||
are defined in the various header modules, e.g. src/geometry_header.F90. Most
|
||||
important variables are found in the `global module`_. Have a look through that
|
||||
module to get a feel for what variables you'll often come across when looking at
|
||||
OpenMC code.
|
||||
|
||||
--------
|
||||
Particle
|
||||
--------
|
||||
|
||||
Perhaps the variable that you will see most often is simply called ``p`` and is
|
||||
of type(Particle). This variable stores information about a particle's physical
|
||||
characteristics (coordinates, direction, energy), what cell and material it's
|
||||
currently in, how many collisions it has undergone, etc. In practice, only one
|
||||
particle is followed at a time so there is no array of type(Particle). The
|
||||
Particle type is defined in the `particle_header module`_.
|
||||
|
||||
You will notice that the direction and angle of the particle is stored in a
|
||||
linked list of type(LocalCoord). In geometries with multiple :ref:`universes`,
|
||||
the coordinates in each universe are stored in this linked list. If universes or
|
||||
lattices are not used in a geometry, only one LocalCoord is present in the
|
||||
linked list.
|
||||
|
||||
The LocalCoord type has a component called cell which gives the index in the
|
||||
``cells`` array in the `global module`_. The ``cells`` array is of type(Cell)
|
||||
and stored information about each region defined by the user.
|
||||
|
||||
----
|
||||
Cell
|
||||
----
|
||||
|
||||
The Cell type is defined in the `geometry_header module`_ along with other
|
||||
geometry-related derived types. Each cell in the problem is described in terms
|
||||
of its bounding surfaces, which are listed on the ``surfaces`` component. The
|
||||
absolute value of each item in the ``surfaces`` component contains the index of
|
||||
the corresponding surface in the ``surfaces`` array defined in the `global
|
||||
module`_. The sign on each item in the ``surfaces`` component indicates whether
|
||||
the cell exists on the positive or negative side of the surface (see
|
||||
:ref:`methods_geometry`).
|
||||
|
||||
Each cell can either be filled with another universe/lattice or with a
|
||||
material. If it is filled with a material, the ``material`` component gives the
|
||||
index of the material in the ``materials`` array defined in the `global
|
||||
module`_.
|
||||
|
||||
-------
|
||||
Surface
|
||||
-------
|
||||
|
||||
The Surface type is defined in the `geometry_header module`_. A surface is
|
||||
defined by a type (sphere, cylinder, etc.) and a list of coefficients for that
|
||||
surface type. The simplest example would be a plane perpendicular to the xy, yz,
|
||||
or xz plane which needs only one parameter. The ``type`` component indicates the
|
||||
type through integer parameters such as SURF_SPHERE or SURF_CYL_Y (these are
|
||||
defined in the `constants module`_). The ``coeffs`` component gives the
|
||||
necessary coefficients to parameterize the surface type (see
|
||||
:ref:`surface_element`).
|
||||
|
||||
--------
|
||||
Material
|
||||
--------
|
||||
|
||||
The Material type is defined in the `material_header module`_. Each material
|
||||
contains a number of nuclides at a given atom density. Each item in the
|
||||
``nuclide`` component corresponds to the index in the global ``nuclides`` array
|
||||
(as usual, found in the `global module`_). The ``atom_density`` component is the
|
||||
same length as the ``nuclides`` component and lists the corresponding atom
|
||||
density in atom/barn-cm for each nuclide in the ``nuclides`` component.
|
||||
|
||||
If the material contains nuclides for which binding effects are important in
|
||||
low-energy scattering, a :math:`S(\alpha,\beta)` can be associated with that
|
||||
material through the ``sab_table`` component. Again, this component contains the
|
||||
index in the ``sab_tables`` array from the `global module`_.
|
||||
|
||||
-------
|
||||
Nuclide
|
||||
-------
|
||||
|
||||
The Nuclide derived type stores cross section and interaction data for a nucleus
|
||||
and is defined in the `ace_header module`_. The ``energy`` component is an array
|
||||
that gives the discrete energies at which microscopic cross sections are
|
||||
tabulated. The actual microscopic cross sections are stored in a separate
|
||||
derived type, Reaction. An arrays of Reactions is present in the ``reactions``
|
||||
component. There are a few summary microscopic cross sections stored in other
|
||||
components, such as ``total``, ``elastic``, ``fission``, and ``nu_fission``.
|
||||
|
||||
If a Nuclide is fissionable, the prompt and delayed neutron yield and energy
|
||||
distributions are also stored on the Nuclide type. Many nuclides also have
|
||||
unresolved resonance probability table data. If present, this data is stored in
|
||||
the component ``urr_data`` of derived type UrrData. A complete description of
|
||||
the probability table method is given in :ref:`probability_tables`.
|
||||
|
||||
The list of nuclides present in a problem is stored in the ``nuclides`` array
|
||||
defined in the `global module`_.
|
||||
|
||||
----------
|
||||
SAlphaBeta
|
||||
----------
|
||||
|
||||
The SAlphaBeta derived type stores :math:`S(\alpha,\beta)` data to account for
|
||||
molecular binding effects when treating thermal scattering. Each SAlphaBeta
|
||||
table is associated with a specific nuclide as identified in the ``zaid``
|
||||
component. A complete description of the :math:`S(\alpha,\beta)` treatment can
|
||||
be found in :ref:`sab_tables`.
|
||||
|
||||
---------
|
||||
XsListing
|
||||
---------
|
||||
|
||||
The XsListing derived type stores information on the location of an ACE cross
|
||||
section table based on the data in cross_sections.xml and is defined in the
|
||||
`ace_header module`_. For each ``<ace_table>`` you see in cross_sections.xml,
|
||||
there is a XsListing with its information. When the user input is read, the
|
||||
array ``xs_listings`` in the `global module`_ that is of derived type XsListing
|
||||
is used to locate the ACE data to parse.
|
||||
|
||||
--------------
|
||||
NuclideMicroXS
|
||||
--------------
|
||||
|
||||
The NuclideMicroXS derived type, defined in the `ace_header module`_, acts as a
|
||||
'cache' for microscopic cross sections. As a particle is traveling through
|
||||
different materials, cross sections can be reused if the energy of the particle
|
||||
hasn't changed. The components ``total``, ``elastic``, ``absorption``,
|
||||
``fission``, and ``nu_fission`` represent those microscopic cross sections at
|
||||
the current energy of the particle for a given nuclide. An array ``micro_xs`` in
|
||||
the `global module`_ that is the same length as the ``nuclides`` array stores
|
||||
these cached cross sections for each nuclide in the problem.
|
||||
|
||||
---------------
|
||||
MaterialMacroXS
|
||||
---------------
|
||||
|
||||
In addition to the NuclideMicroXS type, there is also a MaterialMacroXS derived
|
||||
type, defined in the `ace_header module`_ that stored cached *macroscopic* cross
|
||||
sections for the current material. These macroscopic cross sections are used for
|
||||
both physics and tallying purposes. The variable ``material_xs`` in the `global
|
||||
module`_ is of type MaterialMacroXS.
|
||||
|
||||
|
||||
.. _derived types: http://nf.nci.org.au/training/FortranAdvanced/slides/slides.025.html
|
||||
.. _global module: https://github.com/mit-crpg/openmc/blob/master/src/global.F90
|
||||
.. _particle_header module: https://github.com/mit-crpg/openmc/blob/master/src/particle_header.F90
|
||||
.. _geometry_header module: https://github.com/mit-crpg/openmc/blob/master/src/geometry_header.F90
|
||||
.. _constants module: https://github.com/mit-crpg/openmc/blob/master/src/constants.F90
|
||||
.. _material_header module: https://github.com/mit-crpg/openmc/blob/master/src/material_header.F90
|
||||
.. _ace_header module: https://github.com/mit-crpg/openmc/blob/master/src/ace_header.F90
|
||||
|
|
@ -12,21 +12,18 @@ adding new code in OpenMC.
|
|||
Fortran
|
||||
-------
|
||||
|
||||
General Rules
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
Conform to the Fortran 2008 standard.
|
||||
|
||||
Make sure code can be compiled with most common compilers, especially gfortran
|
||||
and the Intel Fortran compiler. This supercedes the previous rule --- if a
|
||||
and the Intel Fortran compiler. This supersedes the previous rule --- if a
|
||||
Fortran 2003/2008 feature is not implemented in a common compiler, do not use
|
||||
it.
|
||||
|
||||
Do not use special extensions that can be only be used from certain compilers.
|
||||
|
||||
In general, write your code in lower-case. Having code in all caps does not
|
||||
enhance code readability or otherwise.
|
||||
|
||||
Always include comments to describe what your code is doing. Do not be afraid of
|
||||
using copious amounts of comments.
|
||||
|
||||
|
|
@ -38,6 +35,28 @@ Don't use ``print *`` or ``write(*,*)``. If writing to a file, use a specific
|
|||
unit. Writing to standard output or standard error should be handled by the
|
||||
``write_message`` subroutine or functionality in the error module.
|
||||
|
||||
Naming
|
||||
------
|
||||
|
||||
In general, write your code in lower-case. Having code in all caps does not
|
||||
enhance code readability or otherwise.
|
||||
|
||||
Module names should be lower-case with underscores if needed, e.g.
|
||||
``xml_interface``.
|
||||
|
||||
Class names should be CamelCase, e.g. ``HexLattice``.
|
||||
|
||||
Functions and subroutines (including type-bound methods) should be lower-case
|
||||
with underscores, e.g. ``get_indices``.
|
||||
|
||||
Local variables, global variables, and type attributes should be lower-case
|
||||
with underscores (e.g. ``n_cells``) except for physics symbols that are written
|
||||
differently by convention (e.g. ``E`` for energy).
|
||||
|
||||
Constant (parameter) variables should be in upper-case with underscores, e.g.
|
||||
``SQRT_PI``. If they are used by more than one module, define them in the
|
||||
constants.F90 module.
|
||||
|
||||
Procedures
|
||||
----------
|
||||
|
||||
|
|
@ -55,18 +74,10 @@ Variables
|
|||
Never, under any circumstances, should implicit variables be used! Always
|
||||
include ``implicit none`` and define all your variables.
|
||||
|
||||
Variable names should be all lower-case and descriptive, i.e. not a random
|
||||
assortment of letters that doesn't give any information to someone seeing it for
|
||||
the first time. Variables consisting of multiple words should be separated by
|
||||
underscores, not hyphens or in camel case.
|
||||
|
||||
Constant (parameter) variables should be in ALL CAPITAL LETTERS and defined in
|
||||
in the constants.F90 module.
|
||||
|
||||
32-bit reals (real(4)) should never be used. Always use 64-bit reals (real(8)).
|
||||
|
||||
For arbitrary length character variables, use the pre-defined lengths
|
||||
MAX_LINE_LEN, MAX_WORD_LEN, and MAX_FILE_LEN if possible.
|
||||
``MAX_LINE_LEN``, ``MAX_WORD_LEN``, and ``MAX_FILE_LEN`` if possible.
|
||||
|
||||
Do not use old-style character/array length (e.g. character*80, real*8).
|
||||
|
||||
|
|
@ -92,7 +103,7 @@ allocation instead. Use allocatable variables instead of pointer variables when
|
|||
possible.
|
||||
|
||||
Shared/Module Variables
|
||||
+++++++++++++++++++++++
|
||||
-----------------------
|
||||
|
||||
Always put shared variables in modules. Access module variables through a
|
||||
``use`` statement. Always use the ``only`` specifier on the ``use`` statement
|
||||
|
|
@ -100,12 +111,6 @@ except for variables from the global, constants, and various header modules.
|
|||
|
||||
Never use ``equivalence`` statements, ``common`` blocks, or ``data`` statements.
|
||||
|
||||
Derived Types and Classes
|
||||
-------------------------
|
||||
|
||||
Derived types and classes should have CamelCase names with words not separated
|
||||
by underscores or hyphens.
|
||||
|
||||
Indentation
|
||||
-----------
|
||||
|
||||
|
|
@ -158,6 +163,120 @@ each side.
|
|||
|
||||
Do not leave trailing whitespace at the end of a line.
|
||||
|
||||
---
|
||||
C++
|
||||
---
|
||||
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
Follow the `C++ Core Guidelines`_ except when they conflict with another
|
||||
guideline listed here. For convenience, many important guidelines from that
|
||||
list are repeated here.
|
||||
|
||||
Conform to the C++11 standard. Note that this is a significant difference
|
||||
between our style and the C++ Core Guidelines. Many suggestions in those
|
||||
Guidelines require C++14.
|
||||
|
||||
Always use C++-style comments (``//``) as opposed to C-style (``/**/``). (It
|
||||
is more difficult to comment out a large section of code that uses C-style
|
||||
comments.)
|
||||
|
||||
Header files should always use include guards with the following style (See
|
||||
`SF.8 <http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#sf8-use-include-guards-for-all-h-files>`_:
|
||||
|
||||
.. code-block:: C++
|
||||
|
||||
#ifndef MODULE_NAME_H
|
||||
#define MODULE_NAME_H
|
||||
...
|
||||
content
|
||||
...
|
||||
#endif // MODULE_NAME_H
|
||||
|
||||
Do not use C-style casting. Always use the C++-style casts ``static_cast``,
|
||||
``const_cast``, or ``reinterpret_cast``. (See `ES.49 <http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#es49-if-you-must-use-a-cast-use-a-named-cast>`_)
|
||||
|
||||
Naming
|
||||
------
|
||||
|
||||
In general, write your code in lower-case. Having code in all caps does not
|
||||
enhance code readability or otherwise.
|
||||
|
||||
Struct and class names should be CamelCase, e.g. ``HexLattice``.
|
||||
|
||||
Functions (including member functions) should be lower-case with underscores,
|
||||
e.g. ``get_indices``.
|
||||
|
||||
Local variables, global variables, and struct/class attributes should be
|
||||
lower-case with underscores (e.g. ``n_cells``) except for physics symbols that
|
||||
are written differently by convention (e.g. ``E`` for energy).
|
||||
|
||||
Const variables should be in upper-case with underscores, e.g. ``SQRT_PI``.
|
||||
|
||||
Curly braces
|
||||
------------
|
||||
|
||||
For a function definition, the opening and closing braces should each be on
|
||||
their own lines. This helps distinguish function code from the argument list.
|
||||
If the entire function fits on one line, then the braces can be on the same
|
||||
line. e.g.:
|
||||
|
||||
.. code-block:: C++
|
||||
|
||||
return_type function(type1 arg1, type2 arg2)
|
||||
{
|
||||
content();
|
||||
}
|
||||
|
||||
return_type
|
||||
function_with_many_args(type1 arg1, type2 arg2, type3 arg3,
|
||||
type4 arg4)
|
||||
{
|
||||
content();
|
||||
}
|
||||
|
||||
int return_one() {return 1;}
|
||||
|
||||
For a conditional, the opening brace should be on the same line as the end of
|
||||
the conditional statement. If there is a following ``else if`` or ``else``
|
||||
statement, the closing brace should be on the same line as that following
|
||||
statement. Otherwise, the closing brace should be on its own line. A one-line
|
||||
conditional can have the closing brace on the same line or it can omit the
|
||||
braces entirely e.g.:
|
||||
|
||||
.. code-block:: C++
|
||||
|
||||
if (condition) {
|
||||
content();
|
||||
}
|
||||
|
||||
if (condition1) {
|
||||
content();
|
||||
} else if (condition 2) {
|
||||
more_content();
|
||||
} else {
|
||||
further_content();
|
||||
}
|
||||
|
||||
if (condition) {content()};
|
||||
|
||||
if (condition) content();
|
||||
|
||||
For loops similarly have an opening brace on the same line as the statement and
|
||||
a closing brace on its own line. One-line loops may have the closing brace on
|
||||
the same line or omit the braces entirely.
|
||||
|
||||
.. code-block:: C++
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
content();
|
||||
}
|
||||
|
||||
for (int i = 0; i < 5; i++) {content();}
|
||||
|
||||
for (int i = 0; i < 5; i++) content();
|
||||
|
||||
------
|
||||
Python
|
||||
------
|
||||
|
|
@ -172,6 +291,7 @@ Use of third-party Python packages should be limited to numpy_, scipy_, and
|
|||
h5py_. Use of other third-party packages must be implemented as optional
|
||||
dependencies rather than required dependencies.
|
||||
|
||||
.. _C++ Core Guidelines: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
|
||||
.. _PEP8: https://www.python.org/dev/peps/pep-0008/
|
||||
.. _numpydoc: https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
|
||||
.. _numpy: http://www.numpy.org/
|
||||
|
|
|
|||
73
docs/source/devguide/tests.rst
Normal file
73
docs/source/devguide/tests.rst
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
.. _devguide_tests:
|
||||
|
||||
==========
|
||||
Test Suite
|
||||
==========
|
||||
|
||||
Running Tests
|
||||
-------------
|
||||
|
||||
The OpenMC test suite consists of two parts, a regression test suite and a unit
|
||||
test suite. The regression test suite is based on regression or integrated
|
||||
testing where different types of input files are configured and the full OpenMC
|
||||
code is executed. Results from simulations are compared with expected
|
||||
results. The unit tests are primarily intended to test individual
|
||||
functions/classes in the OpenMC Python API.
|
||||
|
||||
The test suite relies on the third-party `pytest <https://pytest.org>`_
|
||||
package. To run either or both the regression and unit test suites, it is
|
||||
assumed that you have OpenMC fully installed, i.e., the :ref:`scripts_openmc`
|
||||
executable is available on your :envvar:`PATH` and the :mod:`openmc` Python
|
||||
module is importable. In development where it would be onerous to continually
|
||||
install OpenMC every time a small change is made, it is recommended to install
|
||||
OpenMC in development/editable mode. With setuptools, this is accomplished by
|
||||
running::
|
||||
|
||||
python setup.py develop
|
||||
|
||||
or using pip (recommended)::
|
||||
|
||||
pip install -e .[test]
|
||||
|
||||
It is also assumed that you have cross section data available that is pointed to
|
||||
by the :envvar:`OPENMC_CROSS_SECTIONS` and :envvar:`OPENMC_MULTIPOLE_LIBRARY`
|
||||
environment variables. Furthermore, to run unit tests for the :mod:`openmc.data`
|
||||
module, it is necessary to have ENDF/B-VII.1 data available and pointed to by
|
||||
the :envvar:`OPENMC_ENDF_DATA` environment variable. All data sources can be
|
||||
obtained using the ``tools/ci/travis-before-script.sh`` script.
|
||||
|
||||
To execute the test suite, go to the ``tests/`` directory and run::
|
||||
|
||||
pytest
|
||||
|
||||
If you want to collect information about source line coverage in the Python API,
|
||||
you must have the `pytest-cov <https://pypi.python.org/pypi/pytest-cov>`_ plugin
|
||||
installed and run::
|
||||
|
||||
pytest --cov=../openmc --cov-report=html
|
||||
|
||||
Adding Tests to the Regression Suite
|
||||
------------------------------------
|
||||
|
||||
To add a new test to the regression test suite, create a sub-directory in the
|
||||
``tests/regression_tests/`` directory. To configure a test you need to add the
|
||||
following files to your new test directory:
|
||||
|
||||
* OpenMC input XML files, if they are not generated through the Python API
|
||||
* **test.py** - Python test driver script; please refer to other tests to
|
||||
see how to construct. Any output files that are generated during testing
|
||||
must be removed at the end of this script.
|
||||
* **inputs_true.dat** - ASCII file that contains Python API-generated XML
|
||||
files concatenated together. When the test is run, inputs that are
|
||||
generated are compared to this file.
|
||||
* **results_true.dat** - ASCII file that contains the expected results from
|
||||
the test. The file *results_test.dat* is compared to this file during the
|
||||
execution of the python test driver script. When the above files have been
|
||||
created, generate a *results_test.dat* file and copy it to this name and
|
||||
commit. It should be noted that this file should be generated with basic
|
||||
compiler options during openmc configuration and build (e.g., no MPI, no
|
||||
debug/optimization).
|
||||
|
||||
In addition to this description, please see the various types of tests that are
|
||||
already included in the test suite to see how to create them. If all is
|
||||
implemented correctly, the new test will automatically be discovered by pytest.
|
||||
|
|
@ -89,139 +89,6 @@ features and bug fixes. The general steps for contributing are as follows:
|
|||
6. After the pull request has been thoroughly vetted, it is merged back into the
|
||||
*develop* branch of mit-crpg/openmc.
|
||||
|
||||
.. _test suite:
|
||||
|
||||
OpenMC Test Suite
|
||||
-----------------
|
||||
|
||||
The purpose of this test suite is to ensure that OpenMC compiles using various
|
||||
combinations of compiler flags and options, and that all user input options can
|
||||
be used successfully without breaking the code. The test suite is comprised of
|
||||
regression tests where different types of input files are configured and the
|
||||
full OpenMC code is executed. Results from simulations are compared with
|
||||
expected results. The test suite is comprised of many build configurations
|
||||
(e.g. debug, mpi, hdf5) and the actual tests which reside in sub-directories
|
||||
in the tests directory. We recommend to developers to test their branches
|
||||
before submitting a formal pull request using gfortran and Intel compilers
|
||||
if available.
|
||||
|
||||
The test suite is designed to integrate with cmake using ctest_. It is
|
||||
configured to run with cross sections from NNDC_ augmented with 0 K elastic
|
||||
scattering data for select nuclides as well as multipole data. To download the
|
||||
proper data, run the following commands:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
wget -O nndc_hdf5.tar.xz $(cat <openmc_root>/.travis.yml | grep anl.box | awk '{print $2}')
|
||||
tar xJvf nndc_hdf5.tar.xz
|
||||
export OPENMC_CROSS_SECTIONS=$(pwd)/nndc_hdf5/cross_sections.xml
|
||||
|
||||
git clone --branch=master git://github.com/smharper/windowed_multipole_library.git wmp_lib
|
||||
tar xzvf wmp_lib/multipole_lib.tar.gz
|
||||
export OPENMC_MULTIPOLE_LIBRARY=$(pwd)/multipole_lib
|
||||
|
||||
The test suite can be run on an already existing build using:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
cd build
|
||||
make test
|
||||
|
||||
or
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
cd build
|
||||
ctest
|
||||
|
||||
There are numerous ctest_ command line options that can be set to have
|
||||
more control over which tests are executed.
|
||||
|
||||
Before running the test suite python script, the following environmental
|
||||
variables should be set if the default paths are incorrect:
|
||||
|
||||
* **FC** - The command for a Fortran compiler (e.g. gfotran, ifort).
|
||||
|
||||
* Default - *gfortran*
|
||||
|
||||
* **CC** - The command for a C compiler (e.g. gcc, icc).
|
||||
|
||||
* Default - *gcc*
|
||||
|
||||
* **CXX** - The command for a C++ compiler (e.g. g++, icpc).
|
||||
|
||||
* Default - *g++*
|
||||
|
||||
* **MPI_DIR** - The path to the MPI directory.
|
||||
|
||||
* Default - */opt/mpich/3.2-gnu*
|
||||
|
||||
* **HDF5_DIR** - The path to the HDF5 directory.
|
||||
|
||||
* Default - */opt/hdf5/1.8.16-gnu*
|
||||
|
||||
* **PHDF5_DIR** - The path to the parallel HDF5 directory.
|
||||
|
||||
* Default - */opt/phdf5/1.8.16-gnu*
|
||||
|
||||
To run the full test suite, the following command can be executed in the
|
||||
tests directory:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
python run_tests.py
|
||||
|
||||
A subset of build configurations and/or tests can be run. To see how to use
|
||||
the script run:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
python run_tests.py --help
|
||||
|
||||
As an example, say we want to run all tests with debug flags only on tests
|
||||
that have cone and plot in their name. Also, we would like to run this on
|
||||
4 processors. We can run:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
python run_tests.py -j 4 -C debug -R "cone|plot"
|
||||
|
||||
Note that standard regular expression syntax is used for selecting build
|
||||
configurations and tests. To print out a list of build configurations, we
|
||||
can run:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
python run_tests.py -p
|
||||
|
||||
Adding tests to test suite
|
||||
++++++++++++++++++++++++++
|
||||
|
||||
To add a new test to the test suite, create a sub-directory in the tests
|
||||
directory that conforms to the regular expression *test_*. To configure
|
||||
a test you need to add the following files to your new test directory,
|
||||
*test_name* for example:
|
||||
|
||||
* OpenMC input XML files
|
||||
* **test_name.py** - Python test driver script, please refer to other
|
||||
tests to see how to construct. Any output files that are generated
|
||||
during testing must be removed at the end of this script.
|
||||
* **inputs_true.dat** - ASCII file that contains Python API-generated XML
|
||||
files concatenated together. When the test is run, inputs that are
|
||||
generated are compared to this file.
|
||||
* **results_true.dat** - ASCII file that contains the expected results
|
||||
from the test. The file *results_test.dat* is compared to this file
|
||||
during the execution of the python test driver script. When the
|
||||
above files have been created, generate a *results_test.dat* file and
|
||||
copy it to this name and commit. It should be noted that this file
|
||||
should be generated with basic compiler options during openmc
|
||||
configuration and build (e.g., no MPI/HDF5, no debug/optimization).
|
||||
|
||||
In addition to this description, please see the various types of tests that
|
||||
are already included in the test suite to see how to create them. If all is
|
||||
implemented correctly, the new test directory will automatically be added
|
||||
to the CTest framework.
|
||||
|
||||
Private Development
|
||||
-------------------
|
||||
|
||||
|
|
@ -236,6 +103,27 @@ changes you've made in your private repository back to mit-crpg/openmc
|
|||
repository, simply follow the steps above with an extra step of pulling a branch
|
||||
from your private repository into a public fork.
|
||||
|
||||
.. _devguide_editable:
|
||||
|
||||
Working in "Development" Mode
|
||||
-----------------------------
|
||||
|
||||
If you are making changes to the Python API during development, it is highly
|
||||
suggested to install the Python API in development/editable mode using
|
||||
pip_. From the root directory of the OpenMC repository, run:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
pip install -e .[test]
|
||||
|
||||
This installs the OpenMC Python package in `"editable" mode
|
||||
<https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs>`_ so
|
||||
that 1) it can be imported from a Python interpreter and 2) any changes made are
|
||||
immediately reflected in the installed version (that is, you don't need to keep
|
||||
reinstalling it). While the same effect can be achieved using the
|
||||
:envvar:`PYTHONPATH` environment variable, this is generally discouraged as it
|
||||
can interfere with virtual environments.
|
||||
|
||||
.. _git: http://git-scm.com/
|
||||
.. _GitHub: https://github.com/
|
||||
.. _git flow: http://nvie.com/git-model
|
||||
|
|
@ -247,3 +135,4 @@ from your private repository into a public fork.
|
|||
.. _Bitbucket: https://bitbucket.org
|
||||
.. _ctest: http://www.cmake.org/cmake/help/v2.8.12/ctest.html
|
||||
.. _NNDC: http://www.nndc.bnl.gov/endf/b7.1/acefiles.html
|
||||
.. _pip: https://pip.pypa.io/en/stable/
|
||||
|
|
|
|||
|
|
@ -10,21 +10,25 @@ interaction data is based on a native HDF5 format that can be generated from ACE
|
|||
files used by the MCNP and Serpent Monte Carlo codes.
|
||||
|
||||
OpenMC was originally developed by members of the `Computational Reactor Physics
|
||||
Group`_ at the `Massachusetts Institute of Technology`_ starting
|
||||
in 2011. Various universities, laboratories, and other organizations now
|
||||
contribute to the development of OpenMC. For more information on OpenMC, feel
|
||||
free to send a message to the User's Group `mailing list`_.
|
||||
Group <http://crpg.mit.edu>`_ at the `Massachusetts Institute of Technology
|
||||
<http://web.mit.edu>`_ starting in 2011. Various universities, laboratories, and
|
||||
other organizations now contribute to the development of OpenMC. For more
|
||||
information on OpenMC, feel free to send a message to the User's Group `mailing
|
||||
list <https://groups.google.com/forum/?fromgroups=#!forum/openmc-users>`_.
|
||||
|
||||
.. _Computational Reactor Physics Group: http://crpg.mit.edu
|
||||
.. _Massachusetts Institute of Technology: http://web.mit.edu
|
||||
.. _mailing list: https://groups.google.com/forum/?fromgroups=#!forum/openmc-users
|
||||
.. _Read the Docs: http://openmc.readthedocs.io/en/latest/
|
||||
.. admonition:: Recommended publication for citing
|
||||
:class: tip
|
||||
|
||||
Paul K. Romano, Nicholas E. Horelik, Bryan R. Herman, Adam G. Nelson, Benoit
|
||||
Forget, and Kord Smith, "`OpenMC: A State-of-the-Art Monte Carlo Code for
|
||||
Research and Development <https://doi.org/10.1016/j.anucene.2014.07.048>`_,"
|
||||
*Ann. Nucl. Energy*, **82**, 90--97 (2015).
|
||||
|
||||
.. only:: html
|
||||
|
||||
--------
|
||||
Contents
|
||||
--------
|
||||
--------
|
||||
Contents
|
||||
--------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
|
|
|||
102
docs/source/io_formats/depletion_chain.rst
Normal file
102
docs/source/io_formats/depletion_chain.rst
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
.. _io_depletion_chain:
|
||||
|
||||
============================
|
||||
Depletion Chain -- chain.xml
|
||||
============================
|
||||
|
||||
A depletion chain file has a ``<depletion_chain>`` root element with one or more
|
||||
``<nuclide>`` child elements. The decay, reaction, and fission product data for
|
||||
each nuclide appears as child elements of ``<nuclide>``.
|
||||
|
||||
---------------------
|
||||
``<nuclide>`` Element
|
||||
---------------------
|
||||
|
||||
The ``<nuclide>`` element contains information on the decay modes, reactions,
|
||||
and fission product yields for a given nuclide in the depletion chain. This
|
||||
element may have the following attributes:
|
||||
|
||||
:name:
|
||||
Name of the nuclide
|
||||
|
||||
:half_life:
|
||||
Half-life of the nuclide in [s]
|
||||
|
||||
:decay_modes:
|
||||
Number of decay modes present
|
||||
|
||||
:decay_energy:
|
||||
Decay energy released in [eV]
|
||||
|
||||
:reactions:
|
||||
Number of reactions present
|
||||
|
||||
For each decay mode, a :ref:`io_chain_decay` appears as a child of
|
||||
``<nuclide>``. For each reaction present, a :ref:`io_chain_reaction` appears as
|
||||
a child of ``<nuclide>``. If the nuclide is fissionable, a :ref:`io_chain_nfy`
|
||||
appears as well.
|
||||
|
||||
.. _io_chain_decay:
|
||||
|
||||
-------------------
|
||||
``<decay>`` Element
|
||||
-------------------
|
||||
|
||||
The ``<decay>`` element represents a single decay mode and has the following
|
||||
attributes:
|
||||
|
||||
:type:
|
||||
The type of the decay, e.g. 'ec/beta+'
|
||||
|
||||
:target:
|
||||
The daughter nuclide produced from the decay
|
||||
|
||||
:branching_ratio:
|
||||
The branching ratio for this decay mode
|
||||
|
||||
.. _io_chain_reaction:
|
||||
|
||||
----------------------
|
||||
``<reaction>`` Element
|
||||
----------------------
|
||||
|
||||
The ``<reaction>`` element represents a single transmutation reaction. This
|
||||
element has the following attributes:
|
||||
|
||||
:type:
|
||||
The type of the reaction, e.g., '(n,gamma)'
|
||||
|
||||
:Q:
|
||||
The Q value of the reaction in [eV]
|
||||
|
||||
:target:
|
||||
The nuclide produced in the reaction (absent if the type is 'fission')
|
||||
|
||||
:branching_ratio:
|
||||
The branching ratio for the reaction
|
||||
|
||||
.. _io_chain_nfy:
|
||||
|
||||
------------------------------------
|
||||
``<neutron_fission_yields>`` Element
|
||||
------------------------------------
|
||||
|
||||
The ``<neutron_fission_yields>`` element provides yields of fission products for
|
||||
fissionable nuclides. It has the follow sub-elements:
|
||||
|
||||
:energies:
|
||||
Energies in [eV] at which yields for products are tabulated
|
||||
|
||||
:fission_yields:
|
||||
|
||||
Fission product yields for a single energy point. This element itself has a
|
||||
number of attributes/sub-elements:
|
||||
|
||||
:energy:
|
||||
Energy in [eV] at which yields are tabulated
|
||||
|
||||
:products:
|
||||
Names of fission products
|
||||
|
||||
:data:
|
||||
Independent yields for each fission product
|
||||
42
docs/source/io_formats/depletion_results.rst
Normal file
42
docs/source/io_formats/depletion_results.rst
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
.. _io_depletion_results:
|
||||
|
||||
=============================
|
||||
Depletion Results File Format
|
||||
=============================
|
||||
|
||||
The current version of the depletion results file format is 1.0.
|
||||
|
||||
**/**
|
||||
|
||||
:Attributes: - **filetype** (*char[]*) -- String indicating the type of file.
|
||||
- **version** (*int[2]*) -- Major and minor version of the
|
||||
statepoint file format.
|
||||
|
||||
:Datasets: - **eigenvalues** (*double[][]*) -- k-eigenvalues at each
|
||||
time/stage. This array has shape (number of timesteps, number of
|
||||
stages).
|
||||
- **number** (*double[][][][]*) -- Total number of atoms. This array
|
||||
has shape (number of timesteps, number of stages, number of
|
||||
materials, number of nuclides).
|
||||
- **reaction rates** (*double[][][][][]*) -- Reaction rates used to
|
||||
build depletion matrices. This array has shape (number of
|
||||
timesteps, number of stages, number of materials, number of
|
||||
nuclides, number of reactions).
|
||||
- **time** (*double[][2]*) -- Time in [s] at beginning/end of each
|
||||
step.
|
||||
|
||||
**/materials/<id>/**
|
||||
|
||||
:Attributes: - **index** (*int*) -- Index used in results for this material
|
||||
- **volume** (*double*) -- Volume of this material in [cm^3]
|
||||
|
||||
**/nuclides/<name>/**
|
||||
|
||||
:Attributes: - **atom number index** (*int*) -- Index in array of total atoms
|
||||
for this nuclide
|
||||
- **reaction rate index** (*int*) -- Index in array of reaction
|
||||
rates for this nuclide
|
||||
|
||||
**/reactions/<name>/**
|
||||
|
||||
:Attributes: - **index** (*int*) -- Index user in results for this reaction
|
||||
|
|
@ -12,7 +12,7 @@ Input Files
|
|||
|
||||
.. toctree::
|
||||
:numbered:
|
||||
:maxdepth: 2
|
||||
:maxdepth: 1
|
||||
|
||||
geometry
|
||||
materials
|
||||
|
|
@ -27,9 +27,10 @@ Data Files
|
|||
|
||||
.. toctree::
|
||||
:numbered:
|
||||
:maxdepth: 2
|
||||
:maxdepth: 1
|
||||
|
||||
cross_sections
|
||||
depletion_chain
|
||||
nuclear_data
|
||||
mgxs_library
|
||||
data_wmp
|
||||
|
|
@ -41,11 +42,12 @@ Output Files
|
|||
|
||||
.. toctree::
|
||||
:numbered:
|
||||
:maxdepth: 2
|
||||
:maxdepth: 1
|
||||
|
||||
statepoint
|
||||
source
|
||||
summary
|
||||
depletion_results
|
||||
particle_restart
|
||||
track
|
||||
voxel
|
||||
|
|
|
|||
|
|
@ -92,20 +92,8 @@ Each ``material`` element can have the following attributes or sub-elements:
|
|||
.. note:: If one nuclide is specified in atom percent, all others must also
|
||||
be given in atom percent. The same applies for weight percentages.
|
||||
|
||||
An optional attribute/sub-element for each nuclide is ``scattering``. This
|
||||
attribute may be set to "data" to use the scattering laws specified by the
|
||||
cross section library (default). Alternatively, when set to "iso-in-lab",
|
||||
the scattering laws are used to sample the outgoing energy but an
|
||||
isotropic-in-lab distribution is used to sample the outgoing angle at each
|
||||
scattering interaction. The ``scattering`` attribute may be most useful
|
||||
when using OpenMC to compute multi-group cross-sections for deterministic
|
||||
transport codes and to quantify the effects of anisotropic scattering.
|
||||
|
||||
*Default*: None
|
||||
|
||||
.. note:: The ``scattering`` attribute/sub-element is not used in the
|
||||
multi-group :ref:`energy_mode`.
|
||||
|
||||
:sab:
|
||||
Associates an S(a,b) table with the material. This element has an
|
||||
attribute/sub-element called ``name``. The ``name`` attribute
|
||||
|
|
@ -119,6 +107,17 @@ Each ``material`` element can have the following attributes or sub-elements:
|
|||
|
||||
.. note:: This element is not used in the multi-group :ref:`energy_mode`.
|
||||
|
||||
:isotropic:
|
||||
The ``isotropic`` element indicates a list of nuclides for which elastic
|
||||
scattering should be treated as though it were isotropic in the laboratory
|
||||
system. This element may be most useful when using OpenMC to compute
|
||||
multi-group cross-sections for deterministic transport codes and to quantify
|
||||
the effects of anisotropic scattering.
|
||||
|
||||
*Default*: No nuclides are treated as have isotropic elastic scattering.
|
||||
|
||||
.. note:: This element is not used in the multi-group :ref:`energy_mode`.
|
||||
|
||||
:macroscopic:
|
||||
The ``macroscopic`` element is similar to the ``nuclide`` element, but,
|
||||
recognizes that some multi-group libraries may be providing material
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
License Agreement
|
||||
=================
|
||||
|
||||
Copyright © 2011-2017 Massachusetts Institute of Technology
|
||||
Copyright © 2011-2018 Massachusetts Institute of Technology
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ dividing space into two half-spaces.
|
|||
|
||||
.. _fig-halfspace:
|
||||
|
||||
.. figure:: ../_images/halfspace.*
|
||||
.. figure:: ../_images/halfspace.svg
|
||||
:align: center
|
||||
:figclass: align-center
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ defined as the intersection of an ellipse and two planes.
|
|||
|
||||
.. _fig-union:
|
||||
|
||||
.. figure:: ../_images/union.*
|
||||
.. figure:: ../_images/union.svg
|
||||
:align: center
|
||||
:figclass: align-center
|
||||
|
||||
|
|
@ -482,7 +482,7 @@ upper-right tiles, respectively.
|
|||
|
||||
.. _fig-rect-lat:
|
||||
|
||||
.. figure:: ../_images/rect_lat.*
|
||||
.. figure:: ../_images/rect_lat.svg
|
||||
:align: center
|
||||
:figclass: align-center
|
||||
:width: 400px
|
||||
|
|
@ -521,7 +521,7 @@ right side.
|
|||
|
||||
.. _fig-hex-lat:
|
||||
|
||||
.. figure:: ../_images/hex_lat.*
|
||||
.. figure:: ../_images/hex_lat.svg
|
||||
:align: center
|
||||
:figclass: align-center
|
||||
:width: 400px
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ Overviews
|
|||
|
||||
- Paul K. Romano, Nicholas E. Horelik, Bryan R. Herman, Adam G. Nelson, Benoit
|
||||
Forget, and Kord Smith, "`OpenMC: A State-of-the-Art Monte Carlo Code for
|
||||
Research and Development <http://dx.doi.org/10.1016/j.anucene.2014.07.048>`_,"
|
||||
Research and Development <https://doi.org/10.1016/j.anucene.2014.07.048>`_,"
|
||||
*Ann. Nucl. Energy*, **82**, 90--97 (2015).
|
||||
|
||||
- Paul K. Romano, Bryan R. Herman, Nicholas E. Horelik, Benoit Forget, Kord
|
||||
|
|
@ -19,16 +19,19 @@ Overviews
|
|||
Nuclear Science and Engineering*, Sun Valley, Idaho, May 5--9 (2013).
|
||||
|
||||
- Paul K. Romano and Benoit Forget, "`The OpenMC Monte Carlo Particle Transport
|
||||
Code <http://dx.doi.org/10.1016/j.anucene.2012.06.040>`_,"
|
||||
Code <https://doi.org/10.1016/j.anucene.2012.06.040>`_,"
|
||||
*Ann. Nucl. Energy*, **51**, 274--281 (2013).
|
||||
|
||||
------------
|
||||
Benchmarking
|
||||
------------
|
||||
|
||||
- Travis J. Labossiere-Hickman and Benoit Forget, "Selected VERA Core Physics
|
||||
Benchmarks in OpenMC," *Trans. Am. Nucl. Soc.*, **117**, 1520-1523 (2017).
|
||||
|
||||
- Khurrum S. Chaudri and Sikander M. Mirza, "`Burnup dependent Monte Carlo
|
||||
neutron physics calculations of IAEA MTR benchmark
|
||||
<http://dx.doi.org/10.1016/j.pnucene.2014.12.018>`_," *Prog. Nucl. Energy*,
|
||||
<https://doi.org/10.1016/j.pnucene.2014.12.018>`_," *Prog. Nucl. Energy*,
|
||||
**81**, 43-52 (2015).
|
||||
|
||||
- Daniel J. Kelly, Brian N. Aviles, Paul K. Romano, Bryan R. Herman,
|
||||
|
|
@ -54,10 +57,15 @@ Benchmarking
|
|||
Coupling and Multi-physics
|
||||
--------------------------
|
||||
|
||||
- Tianliang Hu, Liangzhu Cao, Hongchun Wu, Xianan Du, and Mingtao He, "`Coupled
|
||||
neutrons and thermal-hydraulics simulation of molten salt reactors based on
|
||||
OpenMC/TANSY <https://doi.org/10.1016/j.anucene.2017.05.002>`_,"
|
||||
*Ann. Nucl. Energy*, **109**, 260-276 (2017).
|
||||
|
||||
- Matthew Ellis, Derek Gaston, Benoit Forget, and Kord Smith, "`Preliminary
|
||||
Coupling of the Monte Carlo Code OpenMC and the Multiphysics Object-Oriented
|
||||
Simulation Environment for Analyzing Doppler Feedback in Monte Carlo
|
||||
Simulations <http://dx.doi.org/10.13182/NSE16-26>`_," *Nucl. Sci. Eng.*,
|
||||
Simulations <https://doi.org/10.13182/NSE16-26>`_," *Nucl. Sci. Eng.*,
|
||||
**185**, 184-193 (2017).
|
||||
|
||||
- Matthew Ellis, Benoit Forget, Kord Smith, and Derek Gaston, "Continuous
|
||||
|
|
@ -79,7 +87,7 @@ Coupling and Multi-physics
|
|||
|
||||
- Bryan R. Herman, Benoit Forget, and Kord Smith, "`Progress toward Monte
|
||||
Carlo-thermal hydraulic coupling using low-order nonlinear diffusion
|
||||
acceleration methods <http://dx.doi.org/10.1016/j.anucene.2014.10.029>`_,"
|
||||
acceleration methods <https://doi.org/10.1016/j.anucene.2014.10.029>`_,"
|
||||
*Ann. Nucl. Energy*, **84**, 63-72 (2015).
|
||||
|
||||
- Bryan R. Herman, Benoit Forget, and Kord Smith, "Utilizing CMFD in OpenMC to
|
||||
|
|
@ -106,6 +114,15 @@ Geometry and Visualization
|
|||
Miscellaneous
|
||||
-------------
|
||||
|
||||
- Adam G. Nelson, Samuel Shaner, William Boyd, and Paul K. Romano,
|
||||
"Incorporation of a Multigroup Transport Capability in the OpenMC Monte Carlo
|
||||
Particle Transport Code," *Trans. Am. Nucl. Soc.*, **117**, 679-681 (2017).
|
||||
|
||||
- Youqi Zheng, Yunlong Xiao, and Hongchun Wu, "`Application of the virtual
|
||||
density theory in fast reactor analysis based on the neutron transport
|
||||
calculation <https://doi.org/10.1016/j.nucengdes.2017.05.020>`_,"
|
||||
*Nucl. Eng. Des.*, **320**, 200-206 (2017).
|
||||
|
||||
- Amanda L. Lund, Paul K. Romano, and Andrew R. Siegel, "Accelerating Source
|
||||
Convergence in Monte Carlo Criticality Calculations Using a Particle Ramp-Up
|
||||
Technique," *Proc. Int. Conf. Mathematics & Computational Methods Applied to
|
||||
|
|
@ -126,7 +143,7 @@ Miscellaneous
|
|||
|
||||
- Yunzhao Li, Qingming He, Liangzhi Cao, Hongchun Wu, and Tiejun Zu, "`Resonance
|
||||
Elastic Scattering and Interference Effects Treatments in Subgroup Method
|
||||
<http://dx.doi.org/10.1016/j.net.2015.12.015>`_," *Nucl. Eng. Tech.*, **48**,
|
||||
<https://doi.org/10.1016/j.net.2015.12.015>`_," *Nucl. Eng. Tech.*, **48**,
|
||||
339-350 (2016).
|
||||
|
||||
- William Boyd, Sterling Harper, and Paul K. Romano, "Equipping OpenMC for the
|
||||
|
|
@ -135,7 +152,7 @@ Miscellaneous
|
|||
- Michal Kostal, Vojtech Rypar, Jan Milcak, Vlastimil Juricek, Evzen Losa,
|
||||
Benoit Forget, and Sterling Harper, "`Study of graphite reactivity worth on
|
||||
well-defined cores assembled on LR-0 reactor
|
||||
<http://dx.doi.org/10.1016/j.anucene.2015.10.010>`_," *Ann. Nucl. Energy*,
|
||||
<https://doi.org/10.1016/j.anucene.2015.10.010>`_," *Ann. Nucl. Energy*,
|
||||
**87**, 601-611 (2016).
|
||||
|
||||
- Qicang Shen, William Boyd, Benoit Forget, and Kord Smith, "Tally precision
|
||||
|
|
@ -154,9 +171,25 @@ Miscellaneous
|
|||
Multi-group Cross Section Generation
|
||||
------------------------------------
|
||||
|
||||
- Zhaoyuan Liu, Kord Smith, Benoit Forget, and Javier Ortensi, "`Cumulative
|
||||
migration method for computing rigorous diffusion coefficients and transport
|
||||
cross sections from Monte Carlo
|
||||
<https://doi.org/10.1016/j.anucene.2017.10.039>`_," *Ann. Nucl. Energy*,
|
||||
**112**, 507-516 (2018).
|
||||
|
||||
- Gang Yang, Tongkyu Park, and Won Sik Yang, "Effects of Fuel Salt Velocity
|
||||
Field on Neutronics Performances in Molten Salt Reactors with Open Flow
|
||||
Channels," *Trans. Am. Nucl. Soc.*, **117**, 1339-1342 (2017).
|
||||
|
||||
- William Boyd, Nathan Gibson, Benoit Forget, and Kord Smith, "`An analysis of
|
||||
condensation errors in multi-group cross section generation for fine-mesh
|
||||
neutron transport calculations
|
||||
<https://doi.org/10.1016/j.anucene.2017.09.052>`_," *Ann. Nucl. Energy*,
|
||||
**112**, 267-276 (2018).
|
||||
|
||||
- Hong Shuang, Yang Yongwei, Zhang Lu, and Gao Yucui, "`Fabrication and
|
||||
validation of multigroup cross section library based on the OpenMC code
|
||||
<http://dx.doi.org/10.11889/j.0253-3219.2017.hjs.40.040502>`_,"
|
||||
<https://doi.org/10.11889/j.0253-3219.2017.hjs.40.040502>`_,"
|
||||
*Nucl. Techniques* **40** (4), 040504 (2017). (in Mandarin)
|
||||
|
||||
- Nicholas E. Stauff, Changho Lee, Paul K. Romano, and Taek K. Kim,
|
||||
|
|
@ -207,7 +240,7 @@ Doppler Broadening
|
|||
|
||||
- Colin Josey, Pablo Ducru, Benoit Forget, and Kord Smith, "`Windowed multipole
|
||||
for cross section Doppler broadening
|
||||
<http://dx.doi.org/10.1016/j.jcp.2015.08.013>`_," *J. Comput. Phys.*, **307**,
|
||||
<https://doi.org/10.1016/j.jcp.2015.08.013>`_," *J. Comput. Phys.*, **307**,
|
||||
715-727 (2016).
|
||||
|
||||
- Jonathan A. Walsh, Benoit Forget, Kord S. Smith, and Forrest B. Brown,
|
||||
|
|
@ -217,12 +250,12 @@ Doppler Broadening
|
|||
|
||||
- Colin Josey, Benoit Forget, and Kord Smith, "`Windowed multipole sensitivity
|
||||
to target accuracy of the optimization procedure
|
||||
<http://dx.doi.org/10.1080/00223131.2015.1035353>`_,"
|
||||
<https://doi.org/10.1080/00223131.2015.1035353>`_,"
|
||||
*J. Nucl. Sci. Technol.*, **52**, 987-992 (2015).
|
||||
|
||||
- Paul K. Romano and Timothy H. Trumbull, "`Comparison of algorithms for Doppler
|
||||
broadening pointwise tabulated cross sections
|
||||
<http://dx.doi.org/10.1016/j.anucene.2014.08.046>`_," *Ann. Nucl. Energy*,
|
||||
<https://doi.org/10.1016/j.anucene.2014.08.046>`_," *Ann. Nucl. Energy*,
|
||||
**75**, 358--364 (2015).
|
||||
|
||||
- Tuomas Viitanen, Jaakko Leppanen, and Benoit Forget, "Target motion sampling
|
||||
|
|
@ -231,13 +264,17 @@ Doppler Broadening
|
|||
|
||||
- Benoit Forget, Sheng Xu, and Kord Smith, "`Direct Doppler broadening in Monte
|
||||
Carlo simulations using the multipole representation
|
||||
<http://dx.doi.org/10.1016/j.anucene.2013.09.043>`_," *Ann. Nucl. Energy*,
|
||||
<https://doi.org/10.1016/j.anucene.2013.09.043>`_," *Ann. Nucl. Energy*,
|
||||
**64**, 78--85 (2014).
|
||||
|
||||
------------
|
||||
Nuclear Data
|
||||
------------
|
||||
|
||||
- Jonathan A. Walsh, "Comparison of Unresolved Resonance Region Cross Section
|
||||
Formalisms in Transport Simulations," *Trans. Am. Nucl. Soc.*, **117**,
|
||||
749-752 (2017).
|
||||
|
||||
- Jonathan A. Walsh, Benoit Forget, Kord S. Smith, and Forrest B. Brown,
|
||||
"`Uncertainty in Fast Reactor-Relevant Critical Benchmark Simulations Due to
|
||||
Unresolved Resonance Structure
|
||||
|
|
@ -255,13 +292,13 @@ Nuclear Data
|
|||
- Jonathan A. Walsh, Benoit Froget, Kord S. Smith, and Forrest B. Brown,
|
||||
"`Neutron Cross Section Processing Methods for Improved Integral Benchmarking
|
||||
of Unresolved Resonance Region Evaluations
|
||||
<http://dx.doi.org/10.1051/epjconf/201611106001>`_," *Eur. Phys. J. Web Conf.*
|
||||
<https://doi.org/10.1051/epjconf/201611106001>`_," *Eur. Phys. J. Web Conf.*
|
||||
**111**, 06001 (2016).
|
||||
|
||||
- Jonathan A. Walsh, Paul K. Romano, Benoit Forget, and Kord S. Smith,
|
||||
"`Optimizations of the energy grid search algorithm in continuous-energy Monte
|
||||
Carlo particle transport codes
|
||||
<http://dx.doi.org/10.1016/j.cpc.2015.05.025>`_", *Comput. Phys. Commun.*,
|
||||
<https://doi.org/10.1016/j.cpc.2015.05.025>`_", *Comput. Phys. Commun.*,
|
||||
**196**, 134-142 (2015).
|
||||
|
||||
- Jonathan A. Walsh, Benoit Forget, Kord S. Smith, Brian C. Kiedrowski, and
|
||||
|
|
@ -280,7 +317,7 @@ Nuclear Data
|
|||
|
||||
- Jonathan A. Walsh, Benoit Forget, and Kord S. Smith, "`Accelerated sampling of
|
||||
the free gas resonance elastic scattering kernel
|
||||
<http://dx.doi.org/10.1016/j.anucene.2014.01.017>`_," *Ann. Nucl. Energy*,
|
||||
<https://doi.org/10.1016/j.anucene.2014.01.017>`_," *Ann. Nucl. Energy*,
|
||||
**69**, 116--124 (2014).
|
||||
|
||||
-----------
|
||||
|
|
@ -325,45 +362,45 @@ Parallelism
|
|||
|
||||
- Nicholas Horelik, Andrew Siegel, Benoit Forget, and Kord Smith, "`Monte Carlo
|
||||
domain decomposition for robust nuclear reactor analysis
|
||||
<http://dx.doi.org/10.1016/j.parco.2014.10.001>`_," *Parallel Comput.*,
|
||||
<https://doi.org/10.1016/j.parco.2014.10.001>`_," *Parallel Comput.*,
|
||||
**40**, 646--660 (2014).
|
||||
|
||||
- Andrew Siegel, Kord Smith, Kyle Felker, Paul Romano, Benoit Forget, and Peter
|
||||
Beckman, "`Improved cache performance in Monte Carlo transport calculations
|
||||
using energy banding <http://dx.doi.org/10.1016/j.cpc.2013.10.008>`_,"
|
||||
using energy banding <https://doi.org/10.1016/j.cpc.2013.10.008>`_,"
|
||||
*Comput. Phys. Commun.*, **185** (4), 1195--1199 (2014).
|
||||
|
||||
- Paul K. Romano, Benoit Forget, Kord Smith, and Andrew Siegel, "`On the use of
|
||||
tally servers in Monte Carlo simulations of light-water reactors
|
||||
<http://dx.doi.org/10.1051/snamc/201404301>`_," *Proc. Joint International
|
||||
<https://doi.org/10.1051/snamc/201404301>`_," *Proc. Joint International
|
||||
Conference on Supercomputing in Nuclear Applications and Monte Carlo*, Paris,
|
||||
France, Oct. 27--31 (2013).
|
||||
|
||||
- Kyle G. Felker, Andrew R. Siegel, Kord S. Smith, Paul K. Romano, and Benoit
|
||||
Forget, "`The energy band memory server algorithm for parallel Monte Carlo
|
||||
calculations <http://dx.doi.org/10.1051/snamc/201404207>`_," *Proc. Joint
|
||||
calculations <https://doi.org/10.1051/snamc/201404207>`_," *Proc. Joint
|
||||
International Conference on Supercomputing in Nuclear Applications and Monte
|
||||
Carlo*, Paris, France, Oct. 27--31 (2013).
|
||||
|
||||
- John R. Tramm and Andrew R. Siegel, "`Memory Bottlenecks and Memory Contention
|
||||
in Multi-Core Monte Carlo Transport Codes
|
||||
<http://dx.doi.org/10.1051/snamc/201404208>`_," *Proc. Joint International
|
||||
<https://doi.org/10.1051/snamc/201404208>`_," *Proc. Joint International
|
||||
Conference on Supercomputing in Nuclear Applications and Monte Carlo*, Paris,
|
||||
France, Oct. 27--31 (2013).
|
||||
|
||||
- Andrew R. Siegel, Kord Smith, Paul K. Romano, Benoit Forget, and Kyle Felker,
|
||||
"`Multi-core performance studies of a Monte Carlo neutron transport code
|
||||
<http://dx.doi.org/10.1177/1094342013492179>`_," *Int. J. High
|
||||
<https://doi.org/10.1177/1094342013492179>`_," *Int. J. High
|
||||
Perform. Comput. Appl.*, **28** (1), 87--96 (2014).
|
||||
|
||||
- Paul K. Romano, Andrew R. Siegel, Benoit Forget, and Kord Smith, "`Data
|
||||
decomposition of Monte Carlo particle transport simulations via tally servers
|
||||
<http://dx.doi.org/10.1016/j.jcp.2013.06.011>`_," *J. Comput. Phys.*, **252**,
|
||||
<https://doi.org/10.1016/j.jcp.2013.06.011>`_," *J. Comput. Phys.*, **252**,
|
||||
20--36 (2013).
|
||||
|
||||
- Andrew R. Siegel, Kord Smith, Paul K. Romano, Benoit Forget, and Kyle Felker,
|
||||
"`The effect of load imbalances on the performance of Monte Carlo codes in LWR
|
||||
analysis <http://dx.doi.org/10.1016/j.jcp.2012.06.012>`_," *J. Comput. Phys.*,
|
||||
analysis <https://doi.org/10.1016/j.jcp.2012.06.012>`_," *J. Comput. Phys.*,
|
||||
**235**, 901--911 (2013).
|
||||
|
||||
|
||||
|
|
@ -372,13 +409,18 @@ Parallelism
|
|||
519--522 (2012).
|
||||
|
||||
- Paul K. Romano and Benoit Forget, "`Parallel Fission Bank Algorithms in Monte
|
||||
Carlo Criticality Calculations <http://dx.doi.org/10.13182/NSE10-98>`_,"
|
||||
Carlo Criticality Calculations <https://doi.org/10.13182/NSE10-98>`_,"
|
||||
*Nucl. Sci. Eng.*, **170**, 125--135 (2012).
|
||||
|
||||
---------
|
||||
Depletion
|
||||
---------
|
||||
|
||||
- Colin Josey, Benoit Forget, and Kord Smith, "`High order methods for the
|
||||
integration of the Bateman equations and other problems of the form of y' =
|
||||
F(y,t)y <https://doi.org/10.1016/j.jcp.2017.08.025>`_," *J. Comput. Phys.*,
|
||||
**350**, 296-313 (2017).
|
||||
|
||||
- Matthew S. Ellis, Colin Josey, Benoit Forget, and Kord Smith, "`Spatially
|
||||
Continuous Depletion Algorithm for Monte Carlo Simulations
|
||||
<http://hdl.handle.net/1721.1/107880>`_," *Trans. Am. Nucl. Soc.*, **115**,
|
||||
|
|
@ -386,7 +428,7 @@ Depletion
|
|||
|
||||
- Anas Gul, K. S. Chaudri, R. Khan, and M. Azeen, "`Development and verification
|
||||
of LOOP: A Linkage of ORIGEN2.2 and OpenMC
|
||||
<http://dx.doi.org/10.1016/j.anucene.2016.09.016>`_," *Ann. Nucl. Energy*,
|
||||
<https://doi.org/10.1016/j.anucene.2016.09.016>`_," *Ann. Nucl. Energy*,
|
||||
**99**, 321--327 (2017).
|
||||
|
||||
- Kai Huang, Hongchun Wu, Yunzhao Li, and Liangzhi Cao, "Generalized depletion
|
||||
|
|
|
|||
|
|
@ -91,18 +91,6 @@ Many of the above classes are derived from several abstract classes:
|
|||
openmc.Region
|
||||
openmc.Lattice
|
||||
|
||||
Two helper function are also available to create rectangular and hexagonal
|
||||
prisms defined by the intersection of four and six surface half-spaces,
|
||||
respectively.
|
||||
|
||||
.. autosummary::
|
||||
:toctree: generated
|
||||
:nosignatures:
|
||||
:template: myfunction.rst
|
||||
|
||||
openmc.get_hexagonal_prism
|
||||
openmc.get_rectangular_prism
|
||||
|
||||
.. _pythonapi_tallies:
|
||||
|
||||
Constructing Tallies
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
---------------------------------------------------
|
||||
:data:`openmc.capi` -- Python bindings to the C API
|
||||
---------------------------------------------------
|
||||
--------------------------------------------------
|
||||
:mod:`openmc.capi` -- Python bindings to the C API
|
||||
--------------------------------------------------
|
||||
|
||||
.. automodule:: openmc.capi
|
||||
|
||||
|
|
@ -12,18 +12,25 @@ Functions
|
|||
:nosignatures:
|
||||
:template: myfunction.rst
|
||||
|
||||
openmc.capi.calculate_volumes
|
||||
openmc.capi.finalize
|
||||
openmc.capi.find_cell
|
||||
openmc.capi.find_material
|
||||
openmc.capi.hard_reset
|
||||
openmc.capi.init
|
||||
openmc.capi.keff
|
||||
openmc.capi.load_nuclide
|
||||
openmc.capi.plot_geometry
|
||||
openmc.capi.reset
|
||||
openmc.capi.run
|
||||
openmc.capi.run_in_memory
|
||||
calculate_volumes
|
||||
finalize
|
||||
find_cell
|
||||
find_material
|
||||
hard_reset
|
||||
init
|
||||
iter_batches
|
||||
keff
|
||||
load_nuclide
|
||||
next_batch
|
||||
num_realizations
|
||||
plot_geometry
|
||||
reset
|
||||
run
|
||||
run_in_memory
|
||||
simulation_init
|
||||
simulation_finalize
|
||||
source_bank
|
||||
statepoint_write
|
||||
|
||||
Classes
|
||||
-------
|
||||
|
|
@ -33,9 +40,9 @@ Classes
|
|||
:nosignatures:
|
||||
:template: myclass.rst
|
||||
|
||||
openmc.capi.Cell
|
||||
openmc.capi.EnergyFilter
|
||||
openmc.capi.MaterialFilter
|
||||
openmc.capi.Material
|
||||
openmc.capi.Nuclide
|
||||
openmc.capi.Tally
|
||||
Cell
|
||||
EnergyFilter
|
||||
MaterialFilter
|
||||
Material
|
||||
Nuclide
|
||||
Tally
|
||||
|
|
|
|||
|
|
@ -35,9 +35,12 @@ Core Functions
|
|||
:template: myfunction.rst
|
||||
|
||||
openmc.data.atomic_mass
|
||||
openmc.data.gnd_name
|
||||
openmc.data.linearize
|
||||
openmc.data.thin
|
||||
openmc.data.water_density
|
||||
openmc.data.write_compact_458_library
|
||||
openmc.data.zam
|
||||
|
||||
Angle-Energy Distributions
|
||||
--------------------------
|
||||
|
|
|
|||
85
docs/source/pythonapi/deplete.rst
Normal file
85
docs/source/pythonapi/deplete.rst
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
.. _pythonapi_deplete:
|
||||
|
||||
----------------------------------
|
||||
:mod:`openmc.deplete` -- Depletion
|
||||
----------------------------------
|
||||
|
||||
.. module:: openmc.deplete
|
||||
|
||||
Two functions are provided that implement different time-integration algorithms
|
||||
for depletion calculations.
|
||||
|
||||
.. autosummary::
|
||||
:toctree: generated
|
||||
:nosignatures:
|
||||
:template: myfunction.rst
|
||||
|
||||
integrator.predictor
|
||||
integrator.cecm
|
||||
|
||||
Each of these functions expects a "transport operator" to be passed. An operator
|
||||
specific to OpenMC is available using the following class:
|
||||
|
||||
.. autosummary::
|
||||
:toctree: generated
|
||||
:nosignatures:
|
||||
:template: myclass.rst
|
||||
|
||||
Operator
|
||||
|
||||
When running in parallel using `mpi4py <http://mpi4py.scipy.org>`_, the MPI
|
||||
intercommunicator used can be changed by modifying the following module
|
||||
variable. If it is not explicitly modified, it defaults to
|
||||
``mpi4py.MPI.COMM_WORLD``.
|
||||
|
||||
.. data:: comm
|
||||
|
||||
MPI intercommunicator used to call OpenMC library
|
||||
|
||||
:type: mpi4py.MPI.Comm
|
||||
|
||||
Internal Classes and Functions
|
||||
------------------------------
|
||||
|
||||
During a depletion calculation, the depletion chain, reaction rates, and number
|
||||
densities are managed through a series of internal classes that are not normally
|
||||
visible to a user. However, should you find yourself wondering about these
|
||||
classes (e.g., if you want to know what decay modes or reactions are present in
|
||||
a depletion chain), they are documented here. The following classes store data
|
||||
for a depletion chain:
|
||||
|
||||
.. autosummary::
|
||||
:toctree: generated
|
||||
:nosignatures:
|
||||
:template: myclass.rst
|
||||
|
||||
Chain
|
||||
DecayTuple
|
||||
Nuclide
|
||||
ReactionTuple
|
||||
|
||||
The following classes are used during a depletion simulation and store auxiliary
|
||||
data, such as number densities and reaction rates for each material.
|
||||
|
||||
.. autosummary::
|
||||
:toctree: generated
|
||||
:nosignatures:
|
||||
:template: myclass.rst
|
||||
|
||||
AtomNumber
|
||||
OperatorResult
|
||||
ReactionRates
|
||||
Results
|
||||
ResultsList
|
||||
TransportOperator
|
||||
|
||||
Each of the integrator functions also relies on a number of "helper" functions
|
||||
as follows:
|
||||
|
||||
.. autosummary::
|
||||
:toctree: generated
|
||||
:nosignatures:
|
||||
:template: myfunction.rst
|
||||
|
||||
integrator.CRAM16
|
||||
integrator.CRAM48
|
||||
|
|
@ -15,14 +15,15 @@ there are many substantial benefits to using the Python API, including:
|
|||
- The ability to define dimensions using variables.
|
||||
- Availability of standard-library modules for working with files.
|
||||
- An entire ecosystem of third-party packages for scientific computing.
|
||||
- Ability to create materials based on natural elements or uranium enrichment
|
||||
- Automated multi-group cross section generation (:mod:`openmc.mgxs`)
|
||||
- A fully-featured nuclear data interface (:mod:`openmc.data`)
|
||||
- Depletion capability (:mod:`openmc.deplete`)
|
||||
- Convenience functions (e.g., a function returning a hexagonal region)
|
||||
- Ability to plot individual universes as geometry is being created
|
||||
- A :math:`k_\text{eff}` search function (:func:`openmc.search_for_keff`)
|
||||
- Random sphere packing for generating TRISO particle locations
|
||||
(:func:`openmc.model.pack_trisos`)
|
||||
- A fully-featured nuclear data interface (:mod:`openmc.data`)
|
||||
- Ability to create materials based on natural elements or uranium enrichment
|
||||
|
||||
For those new to Python, there are many good tutorials available online. We
|
||||
recommend going through the modules from `Codecademy
|
||||
|
|
@ -40,13 +41,14 @@ Modules
|
|||
-------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:maxdepth: 1
|
||||
|
||||
base
|
||||
stats
|
||||
mgxs
|
||||
model
|
||||
examples
|
||||
deplete
|
||||
mgxs
|
||||
stats
|
||||
data
|
||||
capi
|
||||
examples
|
||||
openmoc
|
||||
|
|
|
|||
|
|
@ -2,6 +2,19 @@
|
|||
:mod:`openmc.model` -- Model Building
|
||||
-------------------------------------
|
||||
|
||||
Convenience Functions
|
||||
---------------------
|
||||
|
||||
.. autosummary::
|
||||
:toctree: generated
|
||||
:nosignatures:
|
||||
:template: myfunction.rst
|
||||
|
||||
openmc.model.borated_water
|
||||
openmc.model.get_hexagonal_prism
|
||||
openmc.model.get_rectangular_prism
|
||||
openmc.model.subdivide
|
||||
|
||||
TRISO Fuel Modeling
|
||||
-------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -44,20 +44,19 @@ Next, resynchronize the package index files:
|
|||
|
||||
.. code-block:: sh
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt update
|
||||
|
||||
Now OpenMC should be recognized within the repository and can be installed:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
sudo apt-get install openmc
|
||||
sudo apt install openmc
|
||||
|
||||
Binary packages from this PPA may exist for earlier versions of Ubuntu, but they
|
||||
are no longer supported.
|
||||
|
||||
.. _Personal Package Archive: https://launchpad.net/~paulromano/+archive/staging
|
||||
.. _APT package manager: https://help.ubuntu.com/community/AptGet/Howto
|
||||
.. _HDF5: http://www.hdfgroup.org/HDF5/
|
||||
|
||||
---------------------------------------
|
||||
Installing from Source on Ubuntu 15.04+
|
||||
|
|
@ -69,9 +68,7 @@ installed directly from the package manager.
|
|||
|
||||
.. code-block:: sh
|
||||
|
||||
sudo apt-get install gfortran
|
||||
sudo apt-get install cmake
|
||||
sudo apt-get install libhdf5-dev
|
||||
sudo apt install gfortran g++ cmake libhdf5-dev
|
||||
|
||||
After the packages have been installed, follow the instructions below for
|
||||
building and installing OpenMC from source.
|
||||
|
|
@ -85,9 +82,12 @@ building and installing OpenMC from source.
|
|||
Installing from Source on Linux or Mac OS X
|
||||
-------------------------------------------
|
||||
|
||||
All OpenMC source code is hosted on GitHub_. If you have git_, the gfortran_
|
||||
compiler, CMake_, and HDF5_ installed, you can download and install OpenMC be
|
||||
entering the following commands in a terminal:
|
||||
All OpenMC source code is hosted on `GitHub
|
||||
<https://github.com/mit-crpg/openmc>`_. If you have `git
|
||||
<https://git-scm.com>`_, the `gcc <https://gcc.gnu.org/>`_ compiler suite,
|
||||
`CMake <http://www.cmake.org>`_, and `HDF5 <https://www.hdfgroup.org/HDF5/>`_
|
||||
installed, you can download and install OpenMC be entering the following
|
||||
commands in a terminal:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
|
|
@ -106,11 +106,15 @@ should specify an installation directory where you have write access, e.g.
|
|||
|
||||
cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local ..
|
||||
|
||||
The :mod:`openmc` Python package must be installed separately. The easiest way
|
||||
to install it is using `pip <https://pip.pypa.io/en/stable/>`_, which is
|
||||
included by default in Python 2.7 and Python 3.4+. From the root directory of
|
||||
the OpenMC distribution/repository, run:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
pip install .
|
||||
|
||||
If you want to build a parallel version of OpenMC (using OpenMP or MPI),
|
||||
directions can be found in the :ref:`detailed installation instructions
|
||||
<usersguide_build>`.
|
||||
|
||||
.. _GitHub: https://github.com/mit-crpg/openmc
|
||||
.. _git: http://git-scm.com
|
||||
.. _gfortran: http://gcc.gnu.org/wiki/GFortran
|
||||
.. _CMake: http://www.cmake.org
|
||||
|
|
|
|||
|
|
@ -1,59 +1,41 @@
|
|||
.. _releasenotes:
|
||||
|
||||
==============================
|
||||
Release Notes for OpenMC 0.9.0
|
||||
==============================
|
||||
===============================
|
||||
Release Notes for OpenMC 0.10.0
|
||||
===============================
|
||||
|
||||
.. currentmodule:: openmc
|
||||
|
||||
This release of OpenMC is the first release to use a new native HDF5 cross
|
||||
section format rather than ACE format cross sections. Other significant new
|
||||
features include a nuclear data interface in the Python API (:mod:`openmc.data`)
|
||||
a stochastic volume calculation capability, a random sphere packing algorithm
|
||||
that can handle packing fractions up to 60%, and a new XML parser with
|
||||
significantly better performance than the parser used previously.
|
||||
|
||||
.. caution:: With the new cross section format, the default energy units are now
|
||||
**electronvolts (eV)** rather than megaelectronvolts (MeV)! If you
|
||||
are specifying an energy filter for a tally, make sure you use
|
||||
units of eV now.
|
||||
This release of OpenMC includes several new features, performance improvements,
|
||||
and bug fixes compared to version 0.9.0. Notably, a C API has been added that
|
||||
enables in-memory coupling of neutronics to other physics fields, e.g., burnup
|
||||
calculations and thermal-hydraulics. The C API is also backed by Python bindings
|
||||
in a new :mod:`openmc.capi` package. Users should be forewarned that the C API
|
||||
is still in an experimental state and the interface is likely to undergo changes
|
||||
in future versions.
|
||||
|
||||
The Python API continues to improve over time; several backwards incompatible
|
||||
changes were made in the API which users of previous versions should take note
|
||||
of:
|
||||
|
||||
- Each type of tally filter is now specified with a separate class. For example::
|
||||
- To indicate that nuclides in a material should be treated such that elastic
|
||||
scattering is isotropic in the laboratory system, there is a new
|
||||
:attr:`Material.isotropic` property::
|
||||
|
||||
energy_filter = openmc.EnergyFilter([0.0, 0.625, 4.0, 1.0e6, 20.0e6])
|
||||
mat = openmc.Material()
|
||||
mat.add_nuclide('H1', 1.0)
|
||||
mat.isotropic = ['H1']
|
||||
|
||||
- Several attributes of the :class:`Plot` class have changed (``color`` ->
|
||||
``color_by`` and ``col_spec`` > ``colors``). :attr:`Plot.colors` now accepts a
|
||||
dictionary mapping :class:`Cell` or :class:`Material` instances to RGB
|
||||
3-tuples or string colors names, e.g.::
|
||||
To treat all nuclides in a material this way, the
|
||||
:meth:`Material.make_isotropic_in_lab` method can still be used.
|
||||
|
||||
plot.colors = {
|
||||
fuel: 'yellow',
|
||||
water: 'blue'
|
||||
}
|
||||
- The initializers for :class:`openmc.Intersection` and :class:`openmc.Union`
|
||||
now expect an iterable.
|
||||
|
||||
- ``make_hexagon_region`` is now :func:`get_hexagonal_prism`
|
||||
- Several changes in :class:`Settings` attributes:
|
||||
- Auto-generated unique IDs for classes now start from 1 rather than 10000.
|
||||
|
||||
- ``weight`` is now set as ``Settings.cutoff['weight']``
|
||||
- Shannon entropy is now specified by passing a :class:`openmc.Mesh` to
|
||||
:attr:`Settings.entropy_mesh`
|
||||
- Uniform fission site method is now specified by passing a
|
||||
:class:`openmc.Mesh` to :attr:`Settings.ufs_mesh`
|
||||
- All ``sourcepoint_*`` options are now specified in a
|
||||
:attr:`Settings.sourcepoint` dictionary
|
||||
- Resonance scattering method is now specified as a dictionary in
|
||||
:attr:`Settings.resonance_scattering`
|
||||
- Multipole is now turned on by setting ``Settings.temperature['multipole'] =
|
||||
True``
|
||||
- The ``output_path`` attribute is now ``Settings.output['path']``
|
||||
|
||||
- All the ``openmc.mgxs.Nu*`` classes are gone. Instead, a ``nu`` argument was
|
||||
added to the constructor of the corresponding classes.
|
||||
.. attention:: This is the last release of OpenMC that will support Python
|
||||
2.7. Future releases of OpenMC will require Python 3.4 or later.
|
||||
|
||||
-------------------
|
||||
System Requirements
|
||||
|
|
@ -69,69 +51,34 @@ problem at hand (mostly on the number of nuclides and tallies in the problem).
|
|||
New Features
|
||||
------------
|
||||
|
||||
- Stochastic volume calculations
|
||||
- Multi-delayed group cross section generation
|
||||
- Ability to calculate multi-group cross sections over meshes
|
||||
- Temperature interpolation on cross section data
|
||||
- Nuclear data interface in Python API, :mod:`openmc.data`
|
||||
- Allow cutoff energy via :attr:`Settings.cutoff`
|
||||
- Ability to define fuel by enrichment (see :meth:`Material.add_element`)
|
||||
- Random sphere packing for TRISO particle generation,
|
||||
:func:`openmc.model.pack_trisos`
|
||||
- Critical eigenvalue search, :func:`openmc.search_for_keff`
|
||||
- Model container, :class:`openmc.model.Model`
|
||||
- In-line plotting in Jupyter, :func:`openmc.plot_inline`
|
||||
- Energy function tally filters, :class:`openmc.EnergyFunctionFilter`
|
||||
- Replaced FoX XML parser with `pugixml <http://pugixml.org/>`_
|
||||
- Cell/material instance counting, :meth:`Geometry.determine_paths`
|
||||
- Differential tallies (see :class:`openmc.TallyDerivative`)
|
||||
- Consistent multi-group scattering matrices
|
||||
- Improved documentation and new Jupyter notebooks
|
||||
- OpenMOC compatibility module, :mod:`openmc.openmoc_compatible`
|
||||
- Rotationally-periodic boundary conditions
|
||||
- C API (with Python bindings) for in-memory coupling
|
||||
- Improved correlation for Uranium enrichment
|
||||
- Support for partial S(a,b) tables
|
||||
- Improved handling of autogenerated IDs
|
||||
- Many performance/memory improvements
|
||||
|
||||
---------
|
||||
Bug Fixes
|
||||
---------
|
||||
|
||||
- c5df6c_: Fix mesh filter max iterator check
|
||||
- 1cfa39_: Reject external source only if 95% of sites are rejected
|
||||
- 335359_: Fix bug in plotting meshlines
|
||||
- 17c678_: Make sure system_clock uses high-resolution timer
|
||||
- 23ec0b_: Fix use of S(a,b) with multipole data
|
||||
- 7eefb7_: Fix several bugs in tally module
|
||||
- 7880d4_: Allow plotting calculation with no boundary conditions
|
||||
- ad2d9f_: Fix filter weight missing when scoring all nuclides
|
||||
- 59fdca_: Fix use of source files for fixed source calculations
|
||||
- 9eff5b_: Fix thermal scattering bugs
|
||||
- 7848a9_: Fix combined k-eff estimator producing NaN
|
||||
- f139ce_: Fix printing bug for tallies with AggregateNuclide
|
||||
- b8ddfa_: Bugfix for short tracks near tally mesh edges
|
||||
- ec3cfb_: Fix inconsistency in filter weights
|
||||
- 5e9b06_: Fix XML representation for verbosity
|
||||
- c39990_: Fix bug tallying reaction rates with multipole on
|
||||
- c6b67e_: Fix fissionable source sampling bug
|
||||
- 489540_: Check for void materials in tracklength tallies
|
||||
- f0214f_: Fixes/improvements to the ARES algorithm
|
||||
- 937469_: Fix energy group sampling for multi-group simulations
|
||||
- a149ef_: Ensure mutable objects are not hashable
|
||||
- 2c9b21_: Preserve backwards compatibility for generated HDF5 libraries
|
||||
- 8047f6_: Handle units of division for tally arithmetic correctly
|
||||
- 0beb4c_: Compatibility with newer versions of Pandas
|
||||
- f124be_: Fix generating 0K data with openmc.data.njoy module
|
||||
- 0c6915_: Bugfix for generating thermal scattering data
|
||||
- 61ecb4_: Fix bugs in Python multipole objects
|
||||
|
||||
.. _c5df6c: https://github.com/mit-crpg/openmc/commit/c5df6c
|
||||
.. _1cfa39: https://github.com/mit-crpg/openmc/commit/1cfa39
|
||||
.. _335359: https://github.com/mit-crpg/openmc/commit/335359
|
||||
.. _17c678: https://github.com/mit-crpg/openmc/commit/17c678
|
||||
.. _23ec0b: https://github.com/mit-crpg/openmc/commit/23ec0b
|
||||
.. _7eefb7: https://github.com/mit-crpg/openmc/commit/7eefb7
|
||||
.. _7880d4: https://github.com/mit-crpg/openmc/commit/7880d4
|
||||
.. _ad2d9f: https://github.com/mit-crpg/openmc/commit/ad2d9f
|
||||
.. _59fdca: https://github.com/mit-crpg/openmc/commit/59fdca
|
||||
.. _9eff5b: https://github.com/mit-crpg/openmc/commit/9eff5b
|
||||
.. _7848a9: https://github.com/mit-crpg/openmc/commit/7848a9
|
||||
.. _f139ce: https://github.com/mit-crpg/openmc/commit/f139ce
|
||||
.. _b8ddfa: https://github.com/mit-crpg/openmc/commit/b8ddfa
|
||||
.. _ec3cfb: https://github.com/mit-crpg/openmc/commit/ec3cfb
|
||||
.. _5e9b06: https://github.com/mit-crpg/openmc/commit/5e9b06
|
||||
.. _c39990: https://github.com/mit-crpg/openmc/commit/c39990
|
||||
.. _c6b67e: https://github.com/mit-crpg/openmc/commit/c6b67e
|
||||
.. _489540: https://github.com/mit-crpg/openmc/commit/489540
|
||||
.. _f0214f: https://github.com/mit-crpg/openmc/commit/f0214f
|
||||
.. _937469: https://github.com/mit-crpg/openmc/commit/937469
|
||||
.. _a149ef: https://github.com/mit-crpg/openmc/commit/a149ef
|
||||
.. _2c9b21: https://github.com/mit-crpg/openmc/commit/2c9b21
|
||||
.. _8047f6: https://github.com/mit-crpg/openmc/commit/8047f6
|
||||
.. _0beb4c: https://github.com/mit-crpg/openmc/commit/0beb4c
|
||||
.. _f124be: https://github.com/mit-crpg/openmc/commit/f124be
|
||||
.. _0c6915: https://github.com/mit-crpg/openmc/commit/0c6915
|
||||
.. _61ecb4: https://github.com/mit-crpg/openmc/commit/61ecb4
|
||||
|
||||
------------
|
||||
Contributors
|
||||
|
|
@ -139,14 +86,19 @@ Contributors
|
|||
|
||||
This release contains new contributions from the following people:
|
||||
|
||||
- `Brody Bassett <brbass@umich.edu>`_
|
||||
- `Will Boyd <wbinventor@gmail.com>`_
|
||||
- `Guillaume Giudicelli <g_giud@mit.edu>`_
|
||||
- `Brittany Grayson <graybri3@isu.edu>`_
|
||||
- `Sterling Harper <sterlingmharper@gmail.com>`_
|
||||
- `Qingming He <906459647@qq.com>`_
|
||||
- `Colin Josey <cjosey@mit.edu>`_
|
||||
- `Travis Labossiere-Hickman <tjlaboss@mit.edu>`_
|
||||
- `Jingang Liang <liangjg2008@gmail.com>`_
|
||||
- `Alex Lindsay <alexlindsay239@gmail.com>`_
|
||||
- `Johnny Liu <johnny16.21@gmail.com>`_
|
||||
- `Amanda Lund <alund@anl.gov>`_
|
||||
- `April Novak <novak@berkeley.edu>`_
|
||||
- `Adam Nelson <nelsonag@umich.edu>`_
|
||||
- `Jose Salcedo Perez <salcedop@mit.edu>`_
|
||||
- `Paul Romano <paul.k.romano@gmail.com>`_
|
||||
- `Sam Shaner <samuelshaner@gmail.com>`_
|
||||
- `Jon Walsh <jonathan.a.walsh@gmail.com>`_
|
||||
|
|
|
|||
|
|
@ -151,8 +151,8 @@ and `Volume II`_. You may also find it helpful to review the following terms:
|
|||
.. _git: http://git-scm.com/
|
||||
.. _git tutorials: http://git-scm.com/documentation
|
||||
.. _Reactor Concepts Manual: http://www.tayloredge.com/periodic/trivia/ReactorConcepts.pdf
|
||||
.. _Volume I: http://energy.gov/sites/prod/files/2013/06/f2/h1019v1.pdf
|
||||
.. _Volume II: http://energy.gov/sites/prod/files/2013/06/f2/h1019v2.pdf
|
||||
.. _Volume I: https://www.standards.doe.gov/standards-documents/1000/1019-bhdbk-1993-v1
|
||||
.. _Volume II: https://www.standards.doe.gov/standards-documents/1000/1019-bhdbk-1993-v2
|
||||
.. _OpenMC source code: https://github.com/mit-crpg/openmc
|
||||
.. _GitHub: https://github.com/
|
||||
.. _bug reports: https://github.com/mit-crpg/openmc/issues
|
||||
|
|
|
|||
|
|
@ -222,6 +222,13 @@ named ``njoy`` available on your path. If you want to explicitly name the
|
|||
executable, the ``njoy_exec`` optional argument can be used. Additionally, the
|
||||
``stdout`` argument can be used to show the progress of the NJOY run.
|
||||
|
||||
To generate a thermal scattering file, you need to specify both an ENDF incident
|
||||
neutron sub-library file as well as a thermal neutron scattering sub-library
|
||||
file; for example::
|
||||
|
||||
light_water = openmc.data.ThermalScattering.from_njoy(
|
||||
'neutrons/n-001_H_001.endf', 'thermal_scatt/tsl-HinH2O.endf')
|
||||
|
||||
Once you have instances of :class:`IncidentNeutron` and
|
||||
:class:`ThermalScattering`, a library can be created by using the
|
||||
``export_to_hdf5()`` methods and the :class:`DataLibrary` class as described in
|
||||
|
|
|
|||
|
|
@ -6,17 +6,18 @@ Installation and Configuration
|
|||
|
||||
.. currentmodule:: openmc
|
||||
|
||||
.. _install_conda:
|
||||
|
||||
----------------------------------------
|
||||
Installing on Linux/Mac with conda-forge
|
||||
----------------------------------------
|
||||
|
||||
`Conda <http://conda.pydata.org/docs/>`_ is an open source package management
|
||||
system and environment management system for installing multiple versions of
|
||||
software packages and their dependencies and switching easily between
|
||||
them. `conda-forge <https://conda-forge.github.io/>`_ is a community-led conda
|
||||
channel of installable packages. For instructions on installing conda, please
|
||||
consult their `documentation
|
||||
<http://conda.pydata.org/docs/install/quick.html>`_.
|
||||
Conda_ is an open source package management system and environment management
|
||||
system for installing multiple versions of software packages and their
|
||||
dependencies and switching easily between them. `conda-forge
|
||||
<https://conda-forge.github.io/>`_ is a community-led conda channel of
|
||||
installable packages. For instructions on installing conda, please consult their
|
||||
`documentation <http://conda.pydata.org/docs/install/quick.html>`_.
|
||||
|
||||
Once you have `conda` installed on your system, add the `conda-forge` channel to
|
||||
your configuration with:
|
||||
|
|
@ -38,6 +39,8 @@ It is possible to list all of the versions of OpenMC available on your platform
|
|||
|
||||
conda search openmc --channel conda-forge
|
||||
|
||||
.. _install_ppa:
|
||||
|
||||
-----------------------------
|
||||
Installing on Ubuntu with PPA
|
||||
-----------------------------
|
||||
|
|
@ -68,9 +71,11 @@ are no longer supported.
|
|||
.. _Personal Package Archive: https://launchpad.net/~paulromano/+archive/staging
|
||||
.. _APT package manager: https://help.ubuntu.com/community/AptGet/Howto
|
||||
|
||||
--------------------
|
||||
Building from Source
|
||||
--------------------
|
||||
.. _install_source:
|
||||
|
||||
----------------------
|
||||
Installing from Source
|
||||
----------------------
|
||||
|
||||
.. _prerequisites:
|
||||
|
||||
|
|
@ -95,10 +100,10 @@ Prerequisites
|
|||
|
||||
* A C/C++ compiler such as gcc_
|
||||
|
||||
OpenMC includes two libraries written in C and C++, respectively. These
|
||||
libraries have been tested to work with a wide variety of compilers. If
|
||||
you are using a Debian-based distribution, you can install the g++
|
||||
compiler using the following command::
|
||||
OpenMC includes various source files written in C and C++,
|
||||
respectively. These source files have been tested to work with a wide
|
||||
variety of compilers. If you are using a Debian-based distribution, you
|
||||
can install the g++ compiler using the following command::
|
||||
|
||||
sudo apt install g++
|
||||
|
||||
|
|
@ -113,34 +118,38 @@ Prerequisites
|
|||
|
||||
* HDF5_ Library for portable binary output format
|
||||
|
||||
OpenMC uses HDF5 for binary output files. As such, you will need to have
|
||||
HDF5 installed on your computer. The installed version will need to have
|
||||
been compiled with the same compiler you intend to compile OpenMC with. If
|
||||
you are using HDF5 in conjunction with MPI, we recommend that your HDF5
|
||||
installation be built with parallel I/O features. An example of
|
||||
configuring HDF5_ is listed below::
|
||||
OpenMC uses HDF5 for many input/output files. As such, you will need to
|
||||
have HDF5 installed on your computer. The installed version will need to
|
||||
have been compiled with the same compiler you intend to compile OpenMC
|
||||
with. If compiling with gcc from the APT repositories, users of Debian
|
||||
derivatives can install HDF5 and/or parallel HDF5 through the package
|
||||
manager::
|
||||
|
||||
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
|
||||
sudo apt install libhdf5-dev
|
||||
|
||||
Parallel versions of the HDF5 library called `libhdf5-mpich-dev` and
|
||||
`libhdf5-openmpi-dev` exist which are built against MPICH and OpenMPI,
|
||||
respectively. To link against a parallel HDF5 library, make sure to set
|
||||
the HDF5_PREFER_PARALLEL CMake option, e.g.::
|
||||
|
||||
FC=mpifort.mpich cmake -DHDF5_PREFER_PARALLEL=on ..
|
||||
|
||||
Note that the exact package names may vary depending on your particular
|
||||
distribution and version.
|
||||
|
||||
If you are using building HDF5 from source in conjunction with MPI, we
|
||||
recommend that your HDF5 installation be built with parallel I/O
|
||||
features. An example of configuring HDF5_ is listed below::
|
||||
|
||||
FC=mpifort ./configure --enable-fortran --enable-parallel
|
||||
|
||||
You may omit ``--enable-parallel`` if you want to compile HDF5_ in serial.
|
||||
|
||||
.. important::
|
||||
|
||||
OpenMC uses various parts of the HDF5 Fortran 2003 API; as such you
|
||||
must include ``--enable-fortran2003`` or else OpenMC will not be able
|
||||
to compile.
|
||||
|
||||
On Debian derivatives, HDF5 and/or parallel HDF5 can be installed through
|
||||
the APT package manager:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
sudo apt install libhdf5-dev hdf5-helpers
|
||||
|
||||
Note that the exact package names may vary depending on your particular
|
||||
distribution and version.
|
||||
If you are building HDF5 version 1.8.x or earlier, you must include
|
||||
``--enable-fortran2003`` when configuring HDF5 or else OpenMC will not
|
||||
be able to compile.
|
||||
|
||||
.. admonition:: Optional
|
||||
:class: note
|
||||
|
|
@ -163,7 +172,7 @@ Prerequisites
|
|||
.. _CMake: http://www.cmake.org
|
||||
.. _OpenMPI: http://www.open-mpi.org
|
||||
.. _MPICH: http://www.mpich.org
|
||||
.. _HDF5: http://www.hdfgroup.org/HDF5/
|
||||
.. _HDF5: https://www.hdfgroup.org/solutions/hdf5/
|
||||
|
||||
Obtaining the Source
|
||||
--------------------
|
||||
|
|
@ -187,8 +196,8 @@ switch to the source of the latest stable release, run the following commands::
|
|||
git checkout master
|
||||
|
||||
.. _GitHub: https://github.com/mit-crpg/openmc
|
||||
.. _git: http://git-scm.com
|
||||
.. _ssh: http://en.wikipedia.org/wiki/Secure_Shell
|
||||
.. _git: https://git-scm.com
|
||||
.. _ssh: https://en.wikipedia.org/wiki/Secure_Shell
|
||||
|
||||
.. _usersguide_build:
|
||||
|
||||
|
|
@ -254,14 +263,15 @@ should be used:
|
|||
Compiling with MPI
|
||||
++++++++++++++++++
|
||||
|
||||
To compile with MPI, set the :envvar:`FC` and :envvar:`CC` environment variables
|
||||
to the path to the MPI Fortran and C wrappers, respectively. For example, in a
|
||||
bash shell:
|
||||
To compile with MPI, set the :envvar:`FC`, :envvar:`CC`, and :envvar:`CXX`
|
||||
environment variables to the path to the MPI Fortran, C, and C++ wrappers,
|
||||
respectively. For example, in a bash shell:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
export FC=mpif90
|
||||
export FC=mpifort
|
||||
export CC=mpicc
|
||||
export CXX=mpicxx
|
||||
cmake /path/to/openmc
|
||||
|
||||
Note that in many shells, environment variables can be set for a single command,
|
||||
|
|
@ -269,7 +279,7 @@ i.e.
|
|||
|
||||
.. code-block:: sh
|
||||
|
||||
FC=mpif90 CC=mpicc cmake /path/to/openmc
|
||||
FC=mpifort CC=mpicc CXX=mpicxx cmake /path/to/openmc
|
||||
|
||||
Selecting HDF5 Installation
|
||||
+++++++++++++++++++++++++++
|
||||
|
|
@ -345,7 +355,7 @@ follows:
|
|||
.. code-block:: sh
|
||||
|
||||
mkdir build && cd build
|
||||
FC=ifort CC=icc FFLAGS=-mmic cmake -Dopenmp=on ..
|
||||
FC=ifort CC=icc CXX=icpc FFLAGS=-mmic cmake -Dopenmp=on ..
|
||||
make
|
||||
|
||||
Note that unless an HDF5 build for the Intel Xeon Phi (Knights Corner) is
|
||||
|
|
@ -358,45 +368,59 @@ workarounds.
|
|||
Testing Build
|
||||
-------------
|
||||
|
||||
If you have ENDF/B-VII.1 cross sections from NNDC_ you can test your build.
|
||||
Make sure the **OPENMC_CROSS_SECTIONS** environmental variable is set to the
|
||||
*cross_sections.xml* file in the *data/nndc* directory.
|
||||
There are two ways to run tests. The first is to use the Makefile present in
|
||||
the source directory and run the following:
|
||||
To run the test suite, you will first need to download a pre-generated cross
|
||||
section library along with windowed multipole data. Please refer to our
|
||||
:ref:`devguide_tests` documentation for further details.
|
||||
|
||||
---------------------
|
||||
Installing Python API
|
||||
---------------------
|
||||
|
||||
If you installed OpenMC using :ref:`Conda <install_conda>` or :ref:`PPA
|
||||
<install_ppa>`, no further steps are necessary in order to use OpenMC's
|
||||
:ref:`Python API <pythonapi>`. However, if you are :ref:`installing from source
|
||||
<install_source>`, the Python API is not installed by default when ``make
|
||||
install`` is run because in many situations it doesn't make sense to install a
|
||||
Python package in the same location as the ``openmc`` executable (for example,
|
||||
if you are installing the package into a `virtual environment
|
||||
<https://docs.python.org/3/tutorial/venv.html>`_). The easiest way to install
|
||||
the :mod:`openmc` Python package is to use pip_, which is included by default in
|
||||
Python 3.4+. From the root directory of the OpenMC distribution/repository, run:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
make test
|
||||
pip install .
|
||||
|
||||
If you want more options for testing you can use ctest_ command. For example,
|
||||
if we wanted to run only the plot tests with 4 processors, we run:
|
||||
pip will first check that all :ref:`required third-party packages
|
||||
<usersguide_python_prereqs>` have been installed, and if they are not present,
|
||||
they will be installed by downloading the appropriate packages from the Python
|
||||
Package Index (`PyPI <https://pypi.org/>`_). However, do note that since pip
|
||||
runs the ``setup.py`` script which requires NumPy, you will have to first
|
||||
install NumPy:
|
||||
|
||||
.. code-block:: sh
|
||||
|
||||
cd build
|
||||
ctest -j 4 -R plot
|
||||
pip install numpy
|
||||
|
||||
If you want to run the full test suite with different build options please
|
||||
refer to our :ref:`test suite` documentation.
|
||||
Installing in "Development" Mode
|
||||
--------------------------------
|
||||
|
||||
--------------------
|
||||
Python Prerequisites
|
||||
--------------------
|
||||
If you are primarily doing development with OpenMC, it is strongly recommended
|
||||
to install the Python package in :ref:`"editable" mode <devguide_editable>`.
|
||||
|
||||
OpenMC's :ref:`Python API <pythonapi>` works with either Python 2.7 or Python
|
||||
3.2+. In addition to Python itself, the API relies on a number of third-party
|
||||
packages. All prerequisites can be installed using `conda
|
||||
<http://conda.pydata.org/docs/>`_ (recommended), `pip
|
||||
<https://pip.pypa.io/en/stable/>`_, or through the package manager in most Linux
|
||||
.. _usersguide_python_prereqs:
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
The Python API works with Python 3.4+. In addition to Python itself, the API
|
||||
relies on a number of third-party packages. All prerequisites can be installed
|
||||
using Conda_ (recommended), pip_, or through the package manager in most Linux
|
||||
distributions.
|
||||
|
||||
.. admonition:: Required
|
||||
:class: error
|
||||
|
||||
`six <https://pythonhosted.org/six/>`_
|
||||
The Python API works with both Python 2.7+ and 3.2+. To do so, the six
|
||||
compatibility library is used.
|
||||
|
||||
`NumPy <http://www.numpy.org/>`_
|
||||
NumPy is used extensively within the Python API for its powerful
|
||||
N-dimensional array.
|
||||
|
|
@ -428,6 +452,11 @@ distributions.
|
|||
.. admonition:: Optional
|
||||
:class: note
|
||||
|
||||
`mpi4py <http://mpi4py.scipy.org/>`_
|
||||
mpi4py provides Python bindings to MPI for running distributed-memory
|
||||
parallel runs. This package is needed if you plan on running depletion
|
||||
simulations in parallel using MPI.
|
||||
|
||||
`Cython <http://cython.org/>`_
|
||||
Cython is used for resonance reconstruction for ENDF data converted to
|
||||
:class:`openmc.data.IncidentNeutron`.
|
||||
|
|
@ -470,3 +499,5 @@ schemas.xml file in your own OpenMC source directory.
|
|||
.. _RELAX NG: http://relaxng.org/
|
||||
.. _NNDC: http://www.nndc.bnl.gov/endf/b7.1/acefiles.html
|
||||
.. _ctest: http://www.cmake.org/cmake/help/v2.8.12/ctest.html
|
||||
.. _Conda: https://conda.io/docs/
|
||||
.. _pip: https://pip.pypa.io/en/stable/
|
||||
|
|
|
|||
|
|
@ -168,8 +168,8 @@ ENDF/B-VII.1. It has the following optional arguments:
|
|||
|
||||
This script downloads `ENDF/B-VII.1 ACE data
|
||||
<http://www.nndc.bnl.gov/endf/b7.1/acefiles.html>`_ from NNDC and converts it to
|
||||
an HDF5 library for use with OpenMC. This data is used for OpenMC's regression
|
||||
test suite. This script has the following optional arguments:
|
||||
an HDF5 library for use with OpenMC. This script has the following optional
|
||||
arguments:
|
||||
|
||||
-b, --batch Suppress standard in
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ be specified:
|
|||
'plot'
|
||||
Generates slice or voxel plots (see :ref:`usersguide_plots`).
|
||||
|
||||
'particle_restart'
|
||||
'particle restart'
|
||||
Simulate a single source particle using a particle restart file.
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue