mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Address easy comments from @wbinventor
This commit is contained in:
parent
8059854a77
commit
58bb9c18ee
9 changed files with 53 additions and 64 deletions
|
|
@ -19,10 +19,10 @@ The current version of the statepoint file format is 16.0.
|
|||
- **path** (*char[]*) -- Path to directory containing input files.
|
||||
- **cmfd_on** (*int*) -- Flag indicating whether CMFD is on (1) or
|
||||
off (0).
|
||||
- **tallies_present** (*int*) -- Flag indicating if tallies are
|
||||
present in the file.
|
||||
- **source_present** (*int*) -- Flag indicating if source bank is
|
||||
present in the file.
|
||||
- **tallies_present** (*int*) -- Flag indicating whether tallies
|
||||
are present (1) or not (0).
|
||||
- **source_present** (*int*) -- Flag indicating whether the source
|
||||
bank is present (1) or not (0).
|
||||
|
||||
:Datasets: - **seed** (*int8_t*) -- Pseudo-random number generator seed.
|
||||
- **energy_mode** (*char[]*) -- Energy mode of the run, either
|
||||
|
|
@ -79,7 +79,7 @@ The current version of the statepoint file format is 16.0.
|
|||
**/tallies/meshes/**
|
||||
|
||||
:Attributes: - **n_meshes** (*int*) -- Number of meshes in the problem.
|
||||
- **ids** (*int[]*) -- User-identified unique ID of each mesh.
|
||||
- **ids** (*int[]*) -- User-defined unique ID of each mesh.
|
||||
|
||||
**/tallies/meshes/mesh <uid>/**
|
||||
|
||||
|
|
@ -143,37 +143,32 @@ The current version of the statepoint file format is 16.0.
|
|||
|
||||
**/runtime/**
|
||||
|
||||
:Datasets: - **total initialization** (*double*) -- Time (in seconds on the
|
||||
master process) spent reading inputs, allocating arrays, etc.
|
||||
- **reading cross sections** (*double*) -- Time (in seconds on the
|
||||
master process) spent loading cross section libraries (this is a
|
||||
subset of initialization).
|
||||
- **simulation** (*double*) -- Time (in seconds on the master
|
||||
process) spent between initialization and finalization.
|
||||
- **transport** (*double*) -- Time (in seconds on the master process)
|
||||
spent transporting particles.
|
||||
- **inactive batches** (*double*) -- Time (in seconds on the master
|
||||
process) spent in the inactive batches (including non-transport
|
||||
activities like communcating sites).
|
||||
- **active batches** (*double*) -- Time (in seconds on the master
|
||||
process) spent in the active batches (including non-transport
|
||||
activities like communicating sites).
|
||||
- **synchronizing fission bank** (*double*) -- Time (in seconds on
|
||||
the master process) spent sampling source particles from fission
|
||||
sites and communicating them to other processes for load balancing.
|
||||
- **sampling source sites** (*double*) -- Time (in seconds on the
|
||||
master process) spent sampling source particles from fission sites.
|
||||
- **SEND-RECV source sites** (*double*) -- Time (in seconds on the
|
||||
master process) spent communicating source sites between processes
|
||||
for load balancing.
|
||||
- **accumulating tallies** (*double*) -- Time (in seconds on the
|
||||
master process) spent communicating tally results and evaluating
|
||||
their statistics.
|
||||
- **CMFD** (*double*) -- Time (in seconds on the master process)
|
||||
spent evaluating CMFD.
|
||||
- **CMFD building matrices** (*double*) -- Time (in seconds on the
|
||||
master process) spent buliding CMFD matrices.
|
||||
- **CMFD solving matrices** (*double*) -- Time (in seconds on the
|
||||
master process) spent solving CMFD matrices.
|
||||
- **total** (*double*) -- Total time spent (in seconds on the master
|
||||
process) in the program.
|
||||
All values are given in seconds and are measured on the master process.
|
||||
|
||||
:Datasets: - **total initialization** (*double*) -- Time spent reading inputs,
|
||||
allocating arrays, etc.
|
||||
- **reading cross sections** (*double*) -- Time spent loading cross
|
||||
section libraries (this is a subset of initialization).
|
||||
- **simulation** (*double*) -- Time spent between initialization and
|
||||
finalization.
|
||||
- **transport** (*double*) -- Time spent transporting particles.
|
||||
- **inactive batches** (*double*) -- Time spent in the inactive
|
||||
batches (including non-transport activities like communcating
|
||||
sites).
|
||||
- **active batches** (*double*) -- Time spent in the active batches
|
||||
(including non-transport activities like communicating sites).
|
||||
- **synchronizing fission bank** (*double*) -- Time spent sampling
|
||||
source particles from fission sites and communicating them to other
|
||||
processes for load balancing.
|
||||
- **sampling source sites** (*double*) -- Time spent sampling source
|
||||
particles from fission sites.
|
||||
- **SEND-RECV source sites** (*double*) -- Time spent communicating
|
||||
source sites between processes for load balancing.
|
||||
- **accumulating tallies** (*double*) -- Time spent communicating
|
||||
tally results and evaluating their statistics.
|
||||
- **CMFD** (*double*) -- Time spent evaluating CMFD.
|
||||
- **CMFD building matrices** (*double*) -- Time spent buliding CMFD
|
||||
matrices.
|
||||
- **CMFD solving matrices** (*double*) -- Time spent solving CMFD
|
||||
matrices.
|
||||
- **total** (*double*) -- Total time spent in the program.
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ The current version of the summary file format is 5.0.
|
|||
|
||||
**/geometry/cells/cell <uid>/**
|
||||
|
||||
:Datasets: - **name** (*char[]*) -- Name of the cell.
|
||||
:Datasets: - **name** (*char[]*) -- User-defined name of the cell.
|
||||
- **universe** (*int*) -- Universe assigned to the cell. If none is
|
||||
specified, the default universe (0) is assigned.
|
||||
- **fill_type** (*char[]*) -- Type of fill for the cell. Can be
|
||||
|
|
|
|||
|
|
@ -1303,7 +1303,7 @@
|
|||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Create an OpenMOC Geometry from the OpenCG Geometry\n",
|
||||
"# Create an OpenMOC Geometry from an equivalent OpenCG Geometry\n",
|
||||
"opencg_geometry = get_opencg_geometry(mgxs_lib.geometry)\n",
|
||||
"openmoc_geometry = get_openmoc_geometry(opencg_geometry)"
|
||||
]
|
||||
|
|
|
|||
|
|
@ -263,9 +263,10 @@ def check_filetype_version(obj, expected_type, expected_version):
|
|||
|
||||
# Check version
|
||||
if this_version[0] != expected_version:
|
||||
raise IOError('Statepoint file has a version of {} which is not '
|
||||
raise IOError('{} file has a version of {} which is not '
|
||||
'consistent with the version expected by OpenMC, {}'
|
||||
.format('.'.join(this_version), expected_version))
|
||||
.format(this_filetype, '.'.join(this_version),
|
||||
expected_version))
|
||||
except AttributeError:
|
||||
raise IOError('Could not read {} file. This most likely means the {} '
|
||||
'file was produced by a different version of OpenMC than '
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ class StatePoint(object):
|
|||
self._f = h5py.File(filename, 'r')
|
||||
self._meshes = {}
|
||||
self._tallies = {}
|
||||
self._derivs = {}
|
||||
|
||||
# Check filetype and version
|
||||
cv.check_filetype_version(self._f, 'statepoint', _VERSION_STATEPOINT)
|
||||
|
|
@ -326,7 +327,7 @@ class StatePoint(object):
|
|||
|
||||
# Read a list of the IDs for each Tally
|
||||
if n_tallies > 0:
|
||||
# Tally used-defined IDs
|
||||
# Tally user-defined IDs
|
||||
tally_ids = tallies_group.attrs['ids']
|
||||
else:
|
||||
tally_ids = []
|
||||
|
|
@ -405,11 +406,6 @@ class StatePoint(object):
|
|||
@property
|
||||
def tally_derivatives(self):
|
||||
if not self._derivs_read:
|
||||
# Initialize dictionaries for the Meshes
|
||||
# Keys - Derivative IDs
|
||||
# Values - TallyDerivative objects
|
||||
self._derivs = {}
|
||||
|
||||
# Populate the dictionary if any derivatives are present.
|
||||
if 'derivatives' in self._f['tallies']:
|
||||
# Read the derivative ids.
|
||||
|
|
@ -429,9 +425,6 @@ class StatePoint(object):
|
|||
deriv.nuclide = group['nuclide'].value.decode()
|
||||
elif deriv.variable == 'temperature':
|
||||
deriv.material = group['material'].value
|
||||
else:
|
||||
raise ValueError('Unrecognized tally differential '
|
||||
'variable')
|
||||
self._derivs[d_id] = deriv
|
||||
|
||||
self._derivs_read = True
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ from openmc.region import Region, Intersection, Union
|
|||
# A static variable for auto-generated Surface IDs
|
||||
AUTO_SURFACE_ID = 10000
|
||||
|
||||
_BC_TYPES = ['transmission', 'vacuum', 'reflective', 'periodic']
|
||||
_BOUNDARY_TYPES = ['transmission', 'vacuum', 'reflective', 'periodic']
|
||||
|
||||
|
||||
def reset_auto_surface_id():
|
||||
|
|
@ -141,7 +141,7 @@ class Surface(object):
|
|||
@boundary_type.setter
|
||||
def boundary_type(self, boundary_type):
|
||||
check_type('boundary type', boundary_type, string_types)
|
||||
check_value('boundary type', boundary_type, _BC_TYPES)
|
||||
check_value('boundary type', boundary_type, _BOUNDARY_TYPES)
|
||||
self._boundary_type = boundary_type
|
||||
|
||||
def bounding_box(self, side):
|
||||
|
|
@ -204,7 +204,7 @@ class Surface(object):
|
|||
surface_id = int(group.name.split('/')[-1].lstrip('surface '))
|
||||
name = group['name'].value.decode()
|
||||
surf_type = group['type'].value.decode()
|
||||
bc = group['boundary_condition'].value.decode()
|
||||
bc = group['boundary_type'].value.decode()
|
||||
coeffs = group['coefficients'][...]
|
||||
|
||||
# Create the Surface based on its type
|
||||
|
|
|
|||
|
|
@ -2067,7 +2067,7 @@ contains
|
|||
call h5tcopy_f(H5T_C_S1, filetype, hdf5_err)
|
||||
call h5tset_size_f(filetype, n, hdf5_err)
|
||||
|
||||
! Crate memory space and attribute
|
||||
! Create memory space and attribute
|
||||
call h5screate_f(H5S_SCALAR_F, dspace_id, hdf5_err)
|
||||
call h5acreate_f(obj_id, trim(name), filetype, dspace_id, &
|
||||
attr_id, hdf5_err)
|
||||
|
|
|
|||
|
|
@ -13,18 +13,18 @@ module initialize
|
|||
use set_header, only: SetInt
|
||||
use energy_grid, only: logarithmic_grid, grid_method
|
||||
use error, only: fatal_error, warning
|
||||
use geometry, only: neighbor_lists, count_instance, calc_offsets, &
|
||||
use geometry, only: neighbor_lists, count_instance, calc_offsets, &
|
||||
maximum_levels
|
||||
use geometry_header, only: Cell, Universe, Lattice, RectLattice, HexLattice,&
|
||||
&BASE_UNIVERSE
|
||||
use global
|
||||
use hdf5_interface, only: file_open, read_attribute, file_close, &
|
||||
use hdf5_interface, only: file_open, read_attribute, file_close, &
|
||||
hdf5_bank_t, hdf5_integer8_t
|
||||
use input_xml, only: read_input_xml, cells_in_univ_dict, read_plots_xml
|
||||
use material_header, only: Material
|
||||
use message_passing
|
||||
use mgxs_data, only: read_mgxs, create_macro_xs
|
||||
use output, only: title, header, print_version, write_message, &
|
||||
use output, only: title, header, print_version, write_message, &
|
||||
print_usage, print_plot
|
||||
use random_lcg, only: initialize_prng
|
||||
use state_point, only: load_state_point
|
||||
|
|
|
|||
|
|
@ -329,16 +329,16 @@ contains
|
|||
call write_dataset(surface_group, "coefficients", coeffs)
|
||||
deallocate(coeffs)
|
||||
|
||||
! Write boundary condition
|
||||
! Write boundary type
|
||||
select case (s%bc)
|
||||
case (BC_TRANSMIT)
|
||||
call write_dataset(surface_group, "boundary_condition", "transmission")
|
||||
call write_dataset(surface_group, "boundary_type", "transmission")
|
||||
case (BC_VACUUM)
|
||||
call write_dataset(surface_group, "boundary_condition", "vacuum")
|
||||
call write_dataset(surface_group, "boundary_type", "vacuum")
|
||||
case (BC_REFLECT)
|
||||
call write_dataset(surface_group, "boundary_condition", "reflective")
|
||||
call write_dataset(surface_group, "boundary_type", "reflective")
|
||||
case (BC_PERIODIC)
|
||||
call write_dataset(surface_group, "boundary_condition", "periodic")
|
||||
call write_dataset(surface_group, "boundary_type", "periodic")
|
||||
end select
|
||||
|
||||
call close_group(surface_group)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue