diff --git a/docs/source/conf.py b/docs/source/conf.py index ea084a66e8..f3553c33e1 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -48,7 +48,7 @@ copyright = u'2011-2013, Massachusetts Institute of Technology' # The short X.Y version. version = "0.5" # The full version, including alpha/beta/rc tags. -release = "0.5.1" +release = "0.5.2" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/releasenotes/index.rst b/docs/source/releasenotes/index.rst index 1fb7c0e15c..876d953ff8 100644 --- a/docs/source/releasenotes/index.rst +++ b/docs/source/releasenotes/index.rst @@ -10,6 +10,7 @@ bugs fixed, and known issues for each successive release. .. toctree:: :maxdepth: 1 + notes_0.5.2 notes_0.5.1 notes_0.5.0 notes_0.4.4 diff --git a/docs/source/releasenotes/notes_0.5.2.rst b/docs/source/releasenotes/notes_0.5.2.rst new file mode 100644 index 0000000000..c50ca2fd19 --- /dev/null +++ b/docs/source/releasenotes/notes_0.5.2.rst @@ -0,0 +1,55 @@ +.. _notes_0.5.2: + +============================== +Release Notes for OpenMC 0.5.2 +============================== + +------------------- +System Requirements +------------------- + +There are no special requirements for running the OpenMC code. As of this +release, OpenMC has been tested on a variety of Linux distributions, Mac OS X, +and Microsoft Windows 7. Memory requirements will vary depending on the size of +the problem at hand (mostly on the number of nuclides in the problem). + +------------ +New Features +------------ + +- Python script for mesh tally plotting +- Isotopic abundances based on IUPAC 2009 when using +- Particle restart file +- Code will abort after certain number of lost particles (defaults to 10) +- Region outside lattice can be filled with material (void by default) +- 3D voxel plots +- Full HDF5/PHDF5 support (including support in statepoint.py) +- Cell overlap checking with -g command line flag (or when plotting) + +--------- +Bug Fixes +--------- + +- 7632f3_: Fixed bug in statepoint.py for multiple generations per batch. +- f85ac4_: Fix infinite loop bug in error module. +- 49c36b_: Don't convert surface ids if surface filter is for current tallies. +- 5ccc78_: Fix bug in reassignment of bins for mesh filter. +- b1f52f_: Fixed bug in plot color specification. +- eae7e5_: Fixed many memory leaks. +- 10c1cc_: Minor CMFD fixes. +- afdb50_: Add compatibility for XML comments without whitespace. +- a3c593_: Fixed bug in use of free gas scattering for H-1. +- 3a66e3_: Fixed bug in 2D mesh tally implementation. +- ab0793_: Corrected PETSC_NULL references to their correct types. + +.. _7632f3: https://github.com/mit-crpg/openmc/commit/7632f3 +.. _f85ac4: https://github.com/mit-crpg/openmc/commit/f85ac4 +.. _49c36b: https://github.com/mit-crpg/openmc/commit/49c36b +.. _5ccc78: https://github.com/mit-crpg/openmc/commit/5ccc78 +.. _b1f52f: https://github.com/mit-crpg/openmc/commit/b1f52f +.. _eae7e5: https://github.com/mit-crpg/openmc/commit/eae7e5 +.. _10c1cc: https://github.com/mit-crpg/openmc/commit/10c1cc +.. _afdb50: https://github.com/mit-crpg/openmc/commit/afdb50 +.. _a3c593: https://github.com/mit-crpg/openmc/commit/a3c593 +.. _3a66e3: https://github.com/mit-crpg/openmc/commit/3a66e3 +.. _ab0793: https://github.com/mit-crpg/openmc/commit/ab0793 diff --git a/docs/source/usersguide/processing.rst b/docs/source/usersguide/processing.rst index 874290465d..7105e9f7d1 100644 --- a/docs/source/usersguide/processing.rst +++ b/docs/source/usersguide/processing.rst @@ -288,7 +288,7 @@ SILO file can be created with: import silomesh as sm sm.init_silo("fluxtally.silo") - sm.init_mesh('tally_mesh',*mesh.dimension, *mesh.lower_left, *mesh.upper_right) + sm.init_mesh('tally_mesh', *mesh.dimension, *mesh.lower_left, *mesh.upper_right) sm.init_var('flux_tally_thermal') for x in range(1,nx+1): for y in range(1,ny+1): diff --git a/docs/source/usersguide/troubleshoot.rst b/docs/source/usersguide/troubleshoot.rst index 64b955593e..49cf41c8de 100644 --- a/docs/source/usersguide/troubleshoot.rst +++ b/docs/source/usersguide/troubleshoot.rst @@ -98,8 +98,38 @@ with the :envvar:`CROSS_SECTIONS` environment variable. It is recommended to add a line in your ``.profile`` or ``.bash_profile`` setting the :envvar:`CROSS_SECTIONS` environment variable. +Geometry Debugging +****************** + +Overlapping Cells +^^^^^^^^^^^^^^^^^ + +For fast run times, normal simulations do not check if the geometry is +incorrectly defined to have overlapping cells. This can lead to incorrect +results that may or may not be obvious when there are errors in the geometry +input file. The built-in 2D and 3D plotters will check for cell overlaps at +the center of every pixel or voxel position they process, however this might +not be a sufficient check to ensure correctly defined geometry. For instance, +if an overlap is of small aspect ratio, the plotting resolution might not be +high enough to produce any pixels in the overlapping area. + +To reliably validate a geometry input, it is best to run the problem in +geometry debugging mode with the ``-g``, ``-geometry-debug``, or +``--geometry-debug`` command-line options. This will enable checks for +overlapping cells at every move of esch simulated particle. Depending on the +complexity of the geometry input file, this could add considerable overhead to +the run (these runs can still be done in parallel). As a result, for this run +mode the user will probably want to run fewer particles than a normal +simulation run. In this case it is important to be aware of how much coverage +each area of the geometry is getting. For instance, if certain regions do not +have many particles travelling through them there will not be many locations +where overlaps are checked for in that region. The user should refer to the +output after a geometry debug run to see how many checks were performed in each +cell, and then adjust the number of starting particles or starting source +distributions accordingly to achieve good coverage. + ERROR: After particle __ crossed surface __ it could not be located in any cell and it did not leak. -**************************************************************************************************** +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This error can arise either if a problem is specified with no boundary conditions or if there is an error in the geometry itself. First check to ensure @@ -120,5 +150,10 @@ has a collision. For example, if you received this error at cycle 5, generation 5 1 4032 +For large runs it is often advantageous to run only the offending particle by +using particle restart mode with the ``-s``, ``-particle``, or ``--particle`` +command-line options in conjunction with the particle restart files that are +created when particles are lost with this error. + .. _gfortran: http://gcc.gnu.org/wiki/GFortran .. _mailing list: https://groups.google.com/forum/?fromgroups=#!forum/openmc-users diff --git a/man/man1/openmc.1 b/man/man1/openmc.1 index b8a9d9c44c..eb8981f38f 100644 --- a/man/man1/openmc.1 +++ b/man/man1/openmc.1 @@ -13,15 +13,16 @@ It is assumed that if no is specified, the XML input files are present in the current directory. .SH OPTIONS .TP +.B "\-g\fR, \fP\-\-geometry-debug" +Run in geometry debugging mode, where cell overlaps are checked for after each +move of a particle +.TP .B "\-p\fR, \fP\-\-plot" Run in plotting mode .TP -.BI \-r " statepoint" "\fR,\fP \-\-restart" " statepoint" -Restart a previous run using data stored in \fIstatepoint\fP. -.TP -.BI \-s " particleFile" "\fR,\fP \-\-particle" " particleFile" -Run a single particle history from a particle restart file named -\fIparticleFile\fP. +.BI \-r " binaryFile" "\fR,\fP \-\-restart" " binaryFile" +Restart a previous run from a state point or a particle restart file named +\fIbinaryFile\fP. .TP .B "\-v\fR, \fP\-\-version" Show version information. diff --git a/src/DEPENDENCIES b/src/DEPENDENCIES index fcabd989e0..e8cc541f4f 100644 --- a/src/DEPENDENCIES +++ b/src/DEPENDENCIES @@ -99,7 +99,6 @@ eigenvalue.o: cmfd_execute.o eigenvalue.o: constants.o eigenvalue.o: error.o eigenvalue.o: global.o -eigenvalue.o: hdf5_interface.o eigenvalue.o: math.o eigenvalue.o: mesh.o eigenvalue.o: mesh_header.o @@ -137,7 +136,6 @@ fission.o: search.o fixed_source.o: constants.o fixed_source.o: global.o -fixed_source.o: hdf5_interface.o fixed_source.o: output.o fixed_source.o: physics.o fixed_source.o: random_lcg.o @@ -177,8 +175,9 @@ hdf5_summary.o: constants.o hdf5_summary.o: endf.o hdf5_summary.o: geometry_header.o hdf5_summary.o: global.o -hdf5_summary.o: hdf5_interface.o hdf5_summary.o: material_header.o +hdf5_summary.o: mesh_header.o +hdf5_summary.o: output_interface.o hdf5_summary.o: output.o hdf5_summary.o: string.o hdf5_summary.o: tally_header.o @@ -193,7 +192,9 @@ initialize.o: geometry.o initialize.o: geometry_header.o initialize.o: global.o initialize.o: hdf5_interface.o +initialize.o: hdf5_summary.o initialize.o: input_xml.o +initialize.o: output_interface.o initialize.o: output.o initialize.o: random_lcg.o initialize.o: source.o @@ -262,8 +263,12 @@ output.o: plot_header.o output.o: string.o output.o: tally_header.o +output_interface.o: constants.o +output_interface.o: error.o +output_interface.o: global.o output_interface.o: hdf5_interface.o output_interface.o: mpiio_interface.o +output_interface.o: tally_header.o particle_header.o: constants.o @@ -334,9 +339,9 @@ source.o: output.o source.o: particle_header.o source.o: physics.o source.o: random_lcg.o -source.o: state_point.o source.o: string.o +state_point.o: constants.o state_point.o: error.o state_point.o: global.o state_point.o: output.o diff --git a/src/Makefile b/src/Makefile index 780b45ce7d..05cb7df6e8 100644 --- a/src/Makefile +++ b/src/Makefile @@ -28,8 +28,9 @@ PETSC = no # External Library Paths #=============================================================================== -MPI_DIR = /opt/mpich/3.0.2-$(COMPILER) -HDF5_DIR = /opt/hdf5/1.8.10-patch1-$(COMPILER) +MPI_DIR = /opt/mpich/3.0.4-$(COMPILER) +HDF5_DIR = /opt/hdf5/1.8.11-$(COMPILER) +PHDF5_DIR = /opt/phdf5/1.8.11-$(COMPILER) PETSC_DIR = /opt/petsc/3.3-p6-$(COMPILER) #=============================================================================== @@ -44,7 +45,7 @@ GIT_SHA1 = $(shell git log -1 2>/dev/null | head -n 1 | awk '{print $$2}') ifeq ($(COMPILER),gnu) F90 = gfortran - F90FLAGS := -cpp -fbacktrace -DNO_F2008 + F90FLAGS := -cpp -fbacktrace LDFLAGS = # Debugging @@ -165,20 +166,21 @@ endif # Setup External Libraries #=============================================================================== -# MPI for distributed-memory parallelism +# MPI for distributed-memory parallelism and HDF5 for I/O ifeq ($(MPI),yes) - F90 = $(MPI_DIR)/bin/mpif90 + ifeq ($(HDF5),yes) + F90 = $(PHDF5_DIR)/bin/h5pfc + F90FLAGS += -DHDF5 + else + F90 = $(MPI_DIR)/bin/mpif90 + endif F90FLAGS += -DMPI -endif - -# HDF5 for I/O - -ifeq ($(HDF5),yes) - F90FLAGS += -DHDF5 -I$(HDF5_DIR)/include - LDFLAGS += -L$(HDF5_DIR)/lib $(HDF5_DIR)/lib/libhdf5hl_fortran.a \ - $(HDF5_DIR)/lib/libhdf5_hl.a $(HDF5_DIR)/lib/libhdf5_fortran.a \ - $(HDF5_DIR)/lib/libhdf5.a -lz -lrt -lm -Wl,-rpath -Wl,$(HDF5_DIR)/lib +else + ifeq ($(HDF5),yes) + F90 = $(HDF5_DIR)/bin/h5fc + F90FLAGS += -DHDF5 + endif endif # PETSC for CMFD functionality diff --git a/src/constants.F90 b/src/constants.F90 index b6c1d44eca..d80365d8e7 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -8,7 +8,7 @@ module constants ! OpenMC major, minor, and release numbers integer, parameter :: VERSION_MAJOR = 0 integer, parameter :: VERSION_MINOR = 5 - integer, parameter :: VERSION_RELEASE = 1 + integer, parameter :: VERSION_RELEASE = 2 ! Revision numbers for binary files integer, parameter :: REVISION_STATEPOINT = 9 diff --git a/src/error.F90 b/src/error.F90 index ec8b9f2fad..2f3813fda7 100644 --- a/src/error.F90 +++ b/src/error.F90 @@ -29,7 +29,7 @@ contains if (.not. master) return ! Write warning at beginning - write(OUTPUT_UNIT, fmt='(1X,A)', advance='no') 'WARNING: ' + write(ERROR_UNIT, fmt='(1X,A)', advance='no') 'WARNING: ' ! Set line wrapping and indentation line_wrap = 80 @@ -42,7 +42,7 @@ contains do if (length - i_start < line_wrap - indent + 1) then ! Remainder of message will fit on line - write(OUTPUT_UNIT, fmt='(A)') message(i_start+1:length) + write(ERROR_UNIT, fmt='(A)') message(i_start+1:length) exit else @@ -58,7 +58,7 @@ contains i_end = i_end - 1 else ! Write up to last space - write(OUTPUT_UNIT, fmt='(A/A)', advance='no') & + write(ERROR_UNIT, fmt='(A/A)', advance='no') & message(i_start+1:i_end-1), repeat(' ', indent) end if diff --git a/src/finalize.F90 b/src/finalize.F90 index bf0c752ffb..adffe7b711 100644 --- a/src/finalize.F90 +++ b/src/finalize.F90 @@ -4,7 +4,8 @@ module finalize use cmfd_output, only: finalize_cmfd # endif use global - use output, only: print_runtime, print_results, write_tallies + use output, only: print_runtime, print_results, & + print_overlap_check, write_tallies use tally, only: tally_statistics #ifdef MPI @@ -35,6 +36,7 @@ contains if (output_tallies) then if (master) call write_tallies() end if + if (check_overlaps) call reduce_overlap_count() end if #ifdef PETSC @@ -50,6 +52,7 @@ contains run_mode /= MODE_PARTICLE)) then call print_runtime() call print_results() + if (check_overlaps) call print_overlap_check() end if ! deallocate arrays @@ -71,4 +74,22 @@ contains end subroutine finalize_run +!=============================================================================== +! REDUCE_OVERLAP_COUNT accumulates cell overlap check counts to master +!=============================================================================== + + subroutine reduce_overlap_count() + +#ifdef MPI + if (master) then + call MPI_REDUCE(MPI_IN_PLACE, overlap_check_cnt, n_cells, & + MPI_INTEGER8, MPI_SUM, 0, MPI_COMM_WORLD, mpi_err) + else + call MPI_REDUCE(overlap_check_cnt, overlap_check_cnt, n_cells, & + MPI_INTEGER8, MPI_SUM, 0, MPI_COMM_WORLD, mpi_err) + end if +#endif + + end subroutine reduce_overlap_count + end module finalize diff --git a/src/geometry.F90 b/src/geometry.F90 index 448691ca2d..cb90997846 100644 --- a/src/geometry.F90 +++ b/src/geometry.F90 @@ -62,6 +62,58 @@ contains end function simple_cell_contains + +!=============================================================================== +! CHECK_CELL_OVERLAP checks for overlapping cells at the current particle's +! position using simple_cell_contains and the LocalCoord's built up by find_cell +!=============================================================================== + + subroutine check_cell_overlap() + + integer :: i ! cell loop index on a level + integer :: n ! number of cells to search on a level + integer :: index_cell ! index in cells array + type(Cell), pointer :: c ! pointer to cell + type(Universe), pointer :: univ ! universe to search in + type(LocalCoord), pointer :: coord ! particle coordinate to search on + + coord => p % coord0 + + ! loop through each coordinate level + do while (associated(coord)) + + p % coord => coord + + univ => universes(coord % universe) + n = univ % n_cells + + ! loop through each cell on this level + do i = 1, n + index_cell = univ % cells(i) + c => cells(index_cell) + + if (simple_cell_contains(c)) then + ! the particle should only be contained in one cell per level + if (index_cell /= coord % cell) then + message = "Overlapping cells detected: " // & + trim(to_str(cells(index_cell) % id)) // ", " // & + trim(to_str(cells(coord % cell) % id)) // & + " on universe " // trim(to_str(univ % id)) + call fatal_error() + end if + + overlap_check_cnt(index_cell) = overlap_check_cnt(index_cell) + 1 + + end if + + end do + + coord => coord % next + + end do + + end subroutine check_cell_overlap + !=============================================================================== ! FIND_CELL determines what cell a source particle is in within a particular ! universe. If the base universe is passed, the particle should be found as long diff --git a/src/global.F90 b/src/global.F90 index 0114019f25..a45704f399 100644 --- a/src/global.F90 +++ b/src/global.F90 @@ -274,6 +274,10 @@ module global ! screen and in logs integer :: verbosity = 7 + ! Flag for enabling cell overlap checking during transport + logical :: check_overlaps = .false. + integer(8), allocatable :: overlap_check_cnt(:) + ! Trace for single particle logical :: trace integer :: trace_batch @@ -399,6 +403,9 @@ contains if (allocated(materials)) deallocate(materials) if (allocated(plots)) deallocate(plots) + ! Deallocate geometry debugging information + if (allocated(overlap_check_cnt)) deallocate(overlap_check_cnt) + ! Deallocate cross section data, listings, and cache if (allocated(nuclides)) then ! First call the clear routines diff --git a/src/initialize.F90 b/src/initialize.F90 index 992ef223a9..ce5c457e80 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -5,14 +5,15 @@ module initialize use constants use dict_header, only: DictIntInt, ElemKeyValueII use energy_grid, only: unionized_grid - use error, only: fatal_error + use error, only: fatal_error, warning use geometry, only: neighbor_lists use geometry_header, only: Cell, Universe, Lattice, BASE_UNIVERSE use global use input_xml, only: read_input_xml, read_cross_sections_xml, & cells_in_univ_dict, read_plots_xml use output, only: title, header, write_summary, print_version, & - print_usage, write_xs_summary, print_plot + print_usage, write_xs_summary, print_plot, & + write_message use output_interface, only: file_open, file_close, read_data use random_lcg, only: initialize_prng use source, only: initialize_source @@ -142,9 +143,17 @@ contains end if end if - ! check for particle restart run + ! Check for particle restart run if (particle_restart_run) run_mode = MODE_PARTICLE + ! Warn if overlap checking is on + if (master .and. check_overlaps) then + message = "" + call write_message() + message = "Cell overlap checking is ON" + call warning() + end if + ! Stop initialization timer call time_initialize % stop() @@ -316,6 +325,8 @@ contains select case (argv(i)) case ('-p', '-plot', '--plot') run_mode = MODE_PLOTTING + check_overlaps = .true. + case ('-n', '-n_particles', '--n_particles') ! Read number of particles per cycle i = i + 1 @@ -354,6 +365,9 @@ contains path_state_point = argv(i) restart_run = .true. + case ('-g', '-geometry-debug', '--geometry-debug') + check_overlaps = .true. + case ('-?', '-help', '--help') call print_usage() stop diff --git a/src/input_xml.F90 b/src/input_xml.F90 index a9b62d4905..45abaf9a2e 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -626,6 +626,11 @@ contains ! Allocate cells array allocate(cells(n_cells)) + if (check_overlaps) then + allocate(overlap_check_cnt(n_cells)) + overlap_check_cnt = 0 + end if + n_universes = 0 do i = 1, n_cells c => cells(i) diff --git a/src/output.F90 b/src/output.F90 index e2114c8b48..504630d799 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -165,12 +165,13 @@ contains write(OUTPUT_UNIT,*) 'Usage: openmc [options] [directory]' write(OUTPUT_UNIT,*) write(OUTPUT_UNIT,*) 'Options:' - write(OUTPUT_UNIT,*) ' -p, --plot Run in plotting mode' - write(OUTPUT_UNIT,*) ' -r, --restart Restart a previous run from a state point' - write(OUTPUT_UNIT,*) ' or a particle restart file' - write(OUTPUT_UNIT,*) ' -t, --tallies Write tally results from state point' - write(OUTPUT_UNIT,*) ' -v, --version Show version information' - write(OUTPUT_UNIT,*) ' -?, --help Show this message' + write(OUTPUT_UNIT,*) ' -g, --geometry-debug Run in geometry debugging mode' + write(OUTPUT_UNIT,*) ' -p, --plot Run in plotting mode' + write(OUTPUT_UNIT,*) ' -r, --restart Restart a previous run from a state point' + write(OUTPUT_UNIT,*) ' or a particle restart file' + write(OUTPUT_UNIT,*) ' -t, --tallies Write tally results from state point' + write(OUTPUT_UNIT,*) ' -v, --version Show version information' + write(OUTPUT_UNIT,*) ' -?, --help Show this message' end if end subroutine print_usage @@ -1478,6 +1479,42 @@ contains end subroutine print_results +!=============================================================================== +! PRINT_OVERLAP_DEBUG displays information regarding overlap checking results +!=============================================================================== + + subroutine print_overlap_check + + integer :: i, j + integer :: num_sparse = 0 + + ! display header block for geometry debugging section + call header("Cell Overlap Check Summary") + + write(ou,100) 'Cell ID','No. Overlap Checks' + + do i = 1, n_cells + write(ou,101) cells(i) % id, overlap_check_cnt(i) + if (overlap_check_cnt(i) < 10) num_sparse = num_sparse + 1 + end do + write(ou,*) + write(ou,'(1X,A)') 'There were ' // trim(to_str(num_sparse)) // & + ' cells with less than 10 overlap checks' + j = 0 + do i = 1, n_cells + if (overlap_check_cnt(i) < 10) then + j = j + 1 + write(ou,'(1X,A8)', advance='no') trim(to_str(cells(i) % id)) + if (modulo(j,8) == 0) write(ou,*) + end if + end do + write(ou,*) + +100 format (1X,A,T15,A) +101 format (1X,I8,T15,I12) + + end subroutine print_overlap_check + !=============================================================================== ! WRITE_TALLIES creates an output file and writes out the mean values of all ! tallies and their standard deviations diff --git a/src/physics.F90 b/src/physics.F90 index a5f3318538..8b67642003 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -7,7 +7,8 @@ module physics use error, only: fatal_error, warning use fission, only: nu_total, nu_delayed use geometry, only: find_cell, distance_to_boundary, & - cross_surface, cross_lattice + cross_surface, cross_lattice, & + check_cell_overlap use geometry_header, only: Universe, BASE_UNIVERSE use global use interpolation, only: interpolate_tab1 @@ -17,7 +18,6 @@ module physics write_particle_track, & finalize_particle_track use particle_header, only: LocalCoord -! use particle_restart, only: write_particle_track use particle_restart_write, only: write_particle_restart use random_lcg, only: prn use search, only: binary_search @@ -84,9 +84,9 @@ contains do while (p % alive) ! Write particle track. - if (write_track) then - call write_particle_track() - endif + if (write_track) call write_particle_track() + + if (check_overlaps) call check_cell_overlap() ! Calculate microscopic and macroscopic cross sections -- note: if the ! material is the same as the last material and the energy of the diff --git a/src/plot.F90 b/src/plot.F90 index c38788402a..e7b8a235a6 100644 --- a/src/plot.F90 +++ b/src/plot.F90 @@ -2,8 +2,8 @@ module plot use constants use error, only: fatal_error - use geometry, only: find_cell - use geometry_header, only: Universe, BASE_UNIVERSE + use geometry, only: find_cell, check_cell_overlap + use geometry_header, only: Cell, BASE_UNIVERSE use global use output, only: write_message use particle_header, only: deallocate_coord @@ -62,6 +62,7 @@ contains p % coord => p % coord0 call find_cell(found_cell) + if (check_overlaps) call check_cell_overlap() if (.not. found_cell) then ! If no cell, revert to default color diff --git a/src/utils/build_dependencies.py b/src/utils/build_dependencies.py index 37cd76bea4..44a5c5ccaf 100755 --- a/src/utils/build_dependencies.py +++ b/src/utils/build_dependencies.py @@ -20,9 +20,7 @@ for src in glob.iglob('*.F90'): dependencies[module] = sorted(list(deps)) -keys = dependencies.keys() -keys.sort() -for module in keys: +for module in dependencies.keys(): for dep in dependencies[module]: print("{0}.o: {1}.o".format(module, dep)) print('') diff --git a/src/utils/convert_xsdir.py b/src/utils/convert_xsdir.py index 90fa3ee891..b7fa9cc187 100755 --- a/src/utils/convert_xsdir.py +++ b/src/utils/convert_xsdir.py @@ -212,21 +212,24 @@ class XsdirTable(object): @property def alias(self): zaid = self.zaid - Z = int(zaid[:-3]) - A = zaid[-3:] + if zaid: + Z = int(zaid[:-3]) + A = zaid[-3:] - if A == '000': - s = 'Nat' - elif zaid == '95242': - s = '242m' - elif zaid == '95642': - s = '242' - elif int(A) > 300: - s = str(int(A) - 400) + "m" + if A == '000': + s = 'Nat' + elif zaid == '95242': + s = '242m' + elif zaid == '95642': + s = '242' + elif int(A) > 300: + s = str(int(A) - 400) + "m" + else: + s = str(int(A)) + + return "{0}-{1}.{2}".format(elements[Z], s, self.xs) else: - s = str(int(A)) - - return "{0}-{1}.{2}".format(elements[Z], s, self.xs) + return None @property def zaid(self): diff --git a/src/utils/memory_usage.py b/src/utils/memory_usage.py index 757fadaa86..b4f62e68b0 100755 --- a/src/utils/memory_usage.py +++ b/src/utils/memory_usage.py @@ -5,7 +5,6 @@ import sys import os -import matplotlib.pyplot as pyplot if len(sys.argv) > 1: # Get path to cross_sections.out file from command line argument @@ -56,8 +55,3 @@ print(' Secondary Energy Distributions = ' + str(sum(memory_energy))) print(' Probability Tables = ' + str(sum(memory_urr))) print(' S(a,b) Tables = ' + str(sum(memory_sab))) print(' Total = ' + str(sum(memory_total))) - -# Histograms -# pyplot.hist(memory_xs,100) -# pyplot.title('Memory for Cross Sections') -# pyplot.show() diff --git a/src/utils/read_source.py b/src/utils/read_source.py deleted file mode 100755 index 347ae0a182..0000000000 --- a/src/utils/read_source.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env python2 - -import struct - -class SourceFile(object): - def __init__(self, filename): - # Open source file for reading - self.f = open(filename, 'r') - - # Read number of source sites - self.n_sites = struct.unpack('q', self.f.read(8))[0] - - # Create list to store source sites - self.sites = [] - - for i in range(self.n_sites): - # Read position, angle, and energy - (weight,) = struct.unpack('d', self.f.read(8)) - xyz = struct.unpack('3d', self.f.read(24)) - uvw = struct.unpack('3d', self.f.read(24)) - (E,) = struct.unpack('d', self.f.read(8)) - - # Create source site and append to list - self.sites.append(SourceSite(weight, xyz, uvw, E)) - -class SourceSite(object): - def __init__(self, weight, xyz, uvw, E): - self.weight = weight - self.xyz = xyz - self.uvw = uvw - self.E = E - - def __repr__(self): - return "".format(self.xyz, self.E) diff --git a/src/utils/split_nuclide.py b/src/utils/split_nuclide.py index 6e028fb80f..beadbd70bd 100755 --- a/src/utils/split_nuclide.py +++ b/src/utils/split_nuclide.py @@ -3,7 +3,7 @@ import sys if len(sys.argv) != 3: - print "Must supply element and atom/b-cm" + print("Must supply element and atom/b-cm") exit element = sys.argv[1] diff --git a/tests/test_particle_restart/geometry.xml b/tests/test_particle_restart/geometry.xml index 3dc9f24c1c..52fea4df64 100644 --- a/tests/test_particle_restart/geometry.xml +++ b/tests/test_particle_restart/geometry.xml @@ -1,12 +1,9 @@ - - - - - - - - + + + + + diff --git a/tests/test_particle_restart/materials.xml b/tests/test_particle_restart/materials.xml index 1f85510e0d..003e8ebc9a 100644 --- a/tests/test_particle_restart/materials.xml +++ b/tests/test_particle_restart/materials.xml @@ -2,7 +2,7 @@ - + diff --git a/tests/test_particle_restart/settings.xml b/tests/test_particle_restart/settings.xml index f278bb5b07..a6b5abbbae 100644 --- a/tests/test_particle_restart/settings.xml +++ b/tests/test_particle_restart/settings.xml @@ -9,7 +9,7 @@ - -20 -20 -5 20 20 5 + -10 -10 -5 10 10 5 diff --git a/tests/test_particle_restart/test_particle_restart.py b/tests/test_particle_restart/test_particle_restart.py index b1f9a01088..b3a8b3396c 100644 --- a/tests/test_particle_restart/test_particle_restart.py +++ b/tests/test_particle_restart/test_particle_restart.py @@ -15,16 +15,16 @@ def test_run(): assert stderr != '' def test_created_restart(): - assert os.path.exists(pwd + '/particle_0.binary') + assert os.path.exists(pwd + '/particle_10_638.binary') def test_run_restart(): - proc = Popen([pwd + '/../../src/openmc -s particle_0.binary'], + proc = Popen([pwd + '/../../src/openmc -s particle_10_638.binary'], stderr=PIPE, stdout=PIPE, shell=True) stdout, stderr = proc.communicate() assert stderr != '' def teardown(): - output = [pwd + '/particle_0.binary'] + output = [pwd + '/particle_10_638.binary'] for f in output: if os.path.exists(f): os.remove(f)