From 9149e0e0ef3420049a64bb03a515c9d01b03e483 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Sun, 4 Feb 2018 15:39:54 -0500 Subject: [PATCH 001/231] Moved cross_sections.F90 functionality into Material and Nuclide --- CMakeLists.txt | 1 - src/cross_section.F90 | 936 ---------------------------------------- src/material_header.F90 | 111 +++++ src/mgxs_header.F90 | 21 +- src/nuclide_header.F90 | 764 +++++++++++++++++++++++++++++++- src/physics.F90 | 3 +- src/sab_header.F90 | 103 ++++- src/tallies/tally.F90 | 5 +- src/tracking.F90 | 45 +- 9 files changed, 1006 insertions(+), 983 deletions(-) delete mode 100644 src/cross_section.F90 diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f5b2168fe..cf44c500ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -347,7 +347,6 @@ set(LIBOPENMC_FORTRAN_SRC src/cmfd_prod_operator.F90 src/cmfd_solver.F90 src/constants.F90 - src/cross_section.F90 src/dict_header.F90 src/distribution_multivariate.F90 src/distribution_univariate.F90 diff --git a/src/cross_section.F90 b/src/cross_section.F90 deleted file mode 100644 index 47e1c4fc5d..0000000000 --- a/src/cross_section.F90 +++ /dev/null @@ -1,936 +0,0 @@ -module cross_section - - use algorithm, only: binary_search - use constants - use error, only: fatal_error - use list_header, only: ListElemInt - use material_header, only: Material, materials - use math, only: faddeeva, w_derivative, broaden_wmp_polynomials - use multipole_header, only: FORM_RM, FORM_MLBW, MP_EA, RM_RT, RM_RA, RM_RF, & - MLBW_RT, MLBW_RX, MLBW_RA, MLBW_RF, FIT_T, FIT_A,& - FIT_F, MultipoleArray - use nuclide_header - use particle_header, only: Particle - use random_lcg, only: prn, future_prn, prn_set_stream - use sab_header, only: SAlphaBeta, sab_tables - use settings - use simulation_header - use tally_header, only: active_tallies - - implicit none - -contains - -!=============================================================================== -! CALCULATE_XS determines the macroscopic cross sections for the material the -! particle is currently traveling through. -!=============================================================================== - - subroutine calculate_xs(p) - - type(Particle), intent(inout) :: p - - integer :: i ! loop index over nuclides - integer :: i_nuclide ! index into nuclides array - integer :: i_sab ! index into sab_tables array - integer :: j ! index in mat % i_sab_nuclides - integer :: i_grid ! index into logarithmic mapping array or material - ! union grid - real(8) :: atom_density ! atom density of a nuclide - real(8) :: sab_frac ! fraction of atoms affected by S(a,b) - logical :: check_sab ! should we check for S(a,b) table? - - ! Set all material macroscopic cross sections to zero - material_xs % total = ZERO - material_xs % absorption = ZERO - material_xs % fission = ZERO - material_xs % nu_fission = ZERO - - ! Exit subroutine if material is void - if (p % material == MATERIAL_VOID) return - - associate (mat => materials(p % material)) - ! Find energy index on energy grid - i_grid = int(log(p % E/energy_min_neutron)/log_spacing) - - ! Determine if this material has S(a,b) tables - check_sab = (mat % n_sab > 0) - - ! Initialize position in i_sab_nuclides - j = 1 - - ! Add contribution from each nuclide in material - do i = 1, mat % n_nuclides - ! ====================================================================== - ! CHECK FOR S(A,B) TABLE - - i_sab = 0 - sab_frac = ZERO - - ! Check if this nuclide matches one of the S(a,b) tables specified. - ! This relies on i_sab_nuclides being in sorted order - if (check_sab) then - if (i == mat % i_sab_nuclides(j)) then - ! Get index in sab_tables - i_sab = mat % i_sab_tables(j) - sab_frac = mat % sab_fracs(j) - - ! If particle energy is greater than the highest energy for the - ! S(a,b) table, then don't use the S(a,b) table - if (p % E > sab_tables(i_sab) % data(1) % threshold_inelastic) then - i_sab = 0 - end if - - ! Increment position in i_sab_nuclides - j = j + 1 - - ! Don't check for S(a,b) tables if there are no more left - if (j > size(mat % i_sab_tables)) check_sab = .false. - end if - end if - - ! ====================================================================== - ! CALCULATE MICROSCOPIC CROSS SECTION - - ! Determine microscopic cross sections for this nuclide - i_nuclide = mat % nuclide(i) - - ! Calculate microscopic cross section for this nuclide - if (p % E /= micro_xs(i_nuclide) % last_E & - .or. p % sqrtkT /= micro_xs(i_nuclide) % last_sqrtkT & - .or. i_sab /= micro_xs(i_nuclide) % index_sab & - .or. sab_frac /= micro_xs(i_nuclide) % sab_frac) then - call calculate_nuclide_xs(i_nuclide, i_sab, p % E, i_grid, & - p % sqrtkT, sab_frac) - end if - - ! ====================================================================== - ! ADD TO MACROSCOPIC CROSS SECTION - - ! Copy atom density of nuclide in material - atom_density = mat % atom_density(i) - - ! Add contributions to material macroscopic total cross section - material_xs % total = material_xs % total + & - atom_density * micro_xs(i_nuclide) % total - - ! Add contributions to material macroscopic absorption cross section - material_xs % absorption = material_xs % absorption + & - atom_density * micro_xs(i_nuclide) % absorption - - ! Add contributions to material macroscopic fission cross section - material_xs % fission = material_xs % fission + & - atom_density * micro_xs(i_nuclide) % fission - - ! Add contributions to material macroscopic nu-fission cross section - material_xs % nu_fission = material_xs % nu_fission + & - atom_density * micro_xs(i_nuclide) % nu_fission - end do - end associate - - end subroutine calculate_xs - -!=============================================================================== -! CALCULATE_NUCLIDE_XS determines microscopic cross sections for a nuclide of a -! given index in the nuclides array at the energy of the given particle -!=============================================================================== - - subroutine calculate_nuclide_xs(i_nuclide, i_sab, E, i_log_union, sqrtkT, & - sab_frac) - integer, intent(in) :: i_nuclide ! index into nuclides array - integer, intent(in) :: i_sab ! index into sab_tables array - real(8), intent(in) :: E ! energy - integer, intent(in) :: i_log_union ! index into logarithmic mapping array or - ! material union energy grid - real(8), intent(in) :: sqrtkT ! square root of kT, material dependent - real(8), intent(in) :: sab_frac ! fraction of atoms affected by S(a,b) - - logical :: use_mp ! true if XS can be calculated with windowed multipole - integer :: i_temp ! index for temperature - integer :: i_grid ! index on nuclide energy grid - integer :: i_low ! lower logarithmic mapping index - integer :: i_high ! upper logarithmic mapping index - integer :: i_rxn ! reaction index - integer :: j ! index in DEPLETION_RX - real(8) :: f ! interp factor on nuclide energy grid - real(8) :: kT ! temperature in eV - real(8) :: sig_t, sig_a, sig_f ! Intermediate multipole variables - - ! Initialize cached cross sections to zero - micro_xs(i_nuclide) % elastic = CACHE_INVALID - micro_xs(i_nuclide) % thermal = ZERO - micro_xs(i_nuclide) % thermal_elastic = ZERO - - associate (nuc => nuclides(i_nuclide)) - ! Check to see if there is multipole data present at this energy - use_mp = .false. - if (nuc % mp_present) then - if (E >= nuc % multipole % start_E .and. & - E <= nuc % multipole % end_E) then - use_mp = .true. - end if - end if - - ! Evaluate multipole or interpolate - if (use_mp) then - ! Call multipole kernel - call multipole_eval(nuc % multipole, E, sqrtkT, sig_t, sig_a, sig_f) - - micro_xs(i_nuclide) % total = sig_t - micro_xs(i_nuclide) % absorption = sig_a - micro_xs(i_nuclide) % fission = sig_f - - if (nuc % fissionable) then - micro_xs(i_nuclide) % nu_fission = sig_f * nuc % nu(E, EMISSION_TOTAL) - else - micro_xs(i_nuclide) % nu_fission = ZERO - end if - - if (need_depletion_rx) then - ! Initialize all reaction cross sections to zero - micro_xs(i_nuclide) % reaction(:) = ZERO - - ! Only non-zero reaction is (n,gamma) - micro_xs(i_nuclide) % reaction(4) = sig_a - sig_f - end if - - ! Ensure these values are set - ! Note, the only time either is used is in one of 4 places: - ! 1. physics.F90 - scatter - For inelastic scatter. - ! 2. physics.F90 - sample_fission - For partial fissions. - ! 3. tally.F90 - score_general - For tallying on MTxxx reactions. - ! 4. cross_section.F90 - calculate_urr_xs - For unresolved purposes. - ! It is worth noting that none of these occur in the resolved - ! resonance range, so the value here does not matter. index_temp is - ! set to -1 to force a segfault in case a developer messes up and tries - ! to use it with multipole. - micro_xs(i_nuclide) % index_temp = -1 - micro_xs(i_nuclide) % index_grid = 0 - micro_xs(i_nuclide) % interp_factor = ZERO - - else - ! Find the appropriate temperature index. - kT = sqrtkT**2 - select case (temperature_method) - case (TEMPERATURE_NEAREST) - i_temp = minloc(abs(nuclides(i_nuclide) % kTs - kT), dim=1) - - case (TEMPERATURE_INTERPOLATION) - ! Find temperatures that bound the actual temperature - do i_temp = 1, size(nuc % kTs) - 1 - if (nuc % kTs(i_temp) <= kT .and. kT < nuc % kTs(i_temp + 1)) exit - end do - - ! Randomly sample between temperature i and i+1 - f = (kT - nuc % kTs(i_temp)) / & - (nuc % kTs(i_temp + 1) - nuc % kTs(i_temp)) - if (f > prn()) i_temp = i_temp + 1 - end select - - associate (grid => nuc % grid(i_temp), xs => nuc % xs(i_temp)) - ! Determine the energy grid index using a logarithmic mapping to - ! reduce the energy range over which a binary search needs to be - ! performed - - if (E < grid % energy(1)) then - i_grid = 1 - elseif (E > grid % energy(size(grid % energy))) then - i_grid = size(grid % energy) - 1 - else - ! Determine bounding indices based on which equal log-spaced - ! interval the energy is in - i_low = grid % grid_index(i_log_union) - i_high = grid % grid_index(i_log_union + 1) + 1 - - ! Perform binary search over reduced range - i_grid = binary_search(grid % energy(i_low:i_high), & - i_high - i_low + 1, E) + i_low - 1 - end if - - ! check for rare case where two energy points are the same - if (grid % energy(i_grid) == grid % energy(i_grid + 1)) & - i_grid = i_grid + 1 - - ! calculate interpolation factor - f = (E - grid % energy(i_grid)) / & - (grid % energy(i_grid + 1) - grid % energy(i_grid)) - - micro_xs(i_nuclide) % index_temp = i_temp - micro_xs(i_nuclide) % index_grid = i_grid - micro_xs(i_nuclide) % interp_factor = f - - ! Calculate microscopic nuclide total cross section - micro_xs(i_nuclide) % total = (ONE - f) * xs % value(XS_TOTAL,i_grid) & - + f * xs % value(XS_TOTAL,i_grid + 1) - - ! Calculate microscopic nuclide absorption cross section - micro_xs(i_nuclide) % absorption = (ONE - f) * xs % value(XS_ABSORPTION, & - i_grid) + f * xs % value(XS_ABSORPTION,i_grid + 1) - - if (nuc % fissionable) then - ! Calculate microscopic nuclide total cross section - micro_xs(i_nuclide) % fission = (ONE - f) * xs % value(XS_FISSION,i_grid) & - + f * xs % value(XS_FISSION,i_grid + 1) - - ! Calculate microscopic nuclide nu-fission cross section - micro_xs(i_nuclide) % nu_fission = (ONE - f) * xs % value(XS_NU_FISSION, & - i_grid) + f * xs % value(XS_NU_FISSION,i_grid + 1) - else - micro_xs(i_nuclide) % fission = ZERO - micro_xs(i_nuclide) % nu_fission = ZERO - end if - end associate - - ! Depletion-related reactions - if (need_depletion_rx) then - do j = 1, 6 - ! Initialize reaction xs to zero - micro_xs(i_nuclide) % reaction(j) = ZERO - - ! If reaction is present and energy is greater than threshold, set - ! the reaction xs appropriately - i_rxn = nuc % reaction_index(DEPLETION_RX(j)) - if (i_rxn > 0) then - associate (xs => nuc % reactions(i_rxn) % xs(i_temp)) - if (i_grid >= xs % threshold) then - micro_xs(i_nuclide) % reaction(j) = (ONE - f) * & - xs % value(i_grid - xs % threshold + 1) + & - f * xs % value(i_grid - xs % threshold + 2) - end if - end associate - end if - end do - end if - - end if - - ! Initialize sab treatment to false - micro_xs(i_nuclide) % index_sab = NONE - micro_xs(i_nuclide) % sab_frac = ZERO - - ! Initialize URR probability table treatment to false - micro_xs(i_nuclide) % use_ptable = .false. - - ! If there is S(a,b) data for this nuclide, we need to set the sab_scatter - ! and sab_elastic cross sections and correct the total and elastic cross - ! sections. - - if (i_sab > 0) then - call calculate_sab_xs(i_nuclide, i_sab, E, sqrtkT, sab_frac) - end if - - ! If the particle is in the unresolved resonance range and there are - ! probability tables, we need to determine cross sections from the table - - if (urr_ptables_on .and. nuc % urr_present .and. .not. use_mp) then - if (E > nuc % urr_data(i_temp) % energy(1) .and. E < nuc % & - urr_data(i_temp) % energy(nuc % urr_data(i_temp) % n_energy)) then - call calculate_urr_xs(i_nuclide, i_temp, E) - end if - end if - - micro_xs(i_nuclide) % last_E = E - micro_xs(i_nuclide) % last_sqrtkT = sqrtkT - end associate - - end subroutine calculate_nuclide_xs - -!=============================================================================== -! CALCULATE_SAB_XS determines the elastic and inelastic scattering -! cross-sections in the thermal energy range. These cross sections replace a -! fraction of whatever data were taken from the normal Nuclide table. -!=============================================================================== - - subroutine calculate_sab_xs(i_nuclide, i_sab, E, sqrtkT, sab_frac) - integer, intent(in) :: i_nuclide ! index into nuclides array - integer, intent(in) :: i_sab ! index into sab_tables array - real(8), intent(in) :: E ! energy - real(8), intent(in) :: sqrtkT ! temperature - real(8), intent(in) :: sab_frac ! fraction of atoms affected by S(a,b) - - integer :: i_grid ! index on S(a,b) energy grid - integer :: i_temp ! temperature index - real(8) :: f ! interp factor on S(a,b) energy grid - real(8) :: inelastic ! S(a,b) inelastic cross section - real(8) :: elastic ! S(a,b) elastic cross section - real(8) :: kT - - ! Set flag that S(a,b) treatment should be used for scattering - micro_xs(i_nuclide) % index_sab = i_sab - - ! Determine temperature for S(a,b) table - kT = sqrtkT**2 - if (temperature_method == TEMPERATURE_NEAREST) then - ! If using nearest temperature, do linear search on temperature - do i_temp = 1, size(sab_tables(i_sab) % kTs) - if (abs(sab_tables(i_sab) % kTs(i_temp) - kT) < & - K_BOLTZMANN*temperature_tolerance) exit - end do - else - ! Find temperatures that bound the actual temperature - do i_temp = 1, size(sab_tables(i_sab) % kTs) - 1 - if (sab_tables(i_sab) % kTs(i_temp) <= kT .and. & - kT < sab_tables(i_sab) % kTs(i_temp + 1)) exit - end do - - ! Randomly sample between temperature i and i+1 - f = (kT - sab_tables(i_sab) % kTs(i_temp)) / & - (sab_tables(i_sab) % kTs(i_temp + 1) & - - sab_tables(i_sab) % kTs(i_temp)) - if (f > prn()) i_temp = i_temp + 1 - end if - - - ! Get pointer to S(a,b) table - associate (sab => sab_tables(i_sab) % data(i_temp)) - - ! Get index and interpolation factor for inelastic grid - if (E < sab % inelastic_e_in(1)) then - i_grid = 1 - f = ZERO - else - i_grid = binary_search(sab % inelastic_e_in, sab % n_inelastic_e_in, E) - f = (E - sab%inelastic_e_in(i_grid)) / & - (sab%inelastic_e_in(i_grid+1) - sab%inelastic_e_in(i_grid)) - end if - - ! Calculate S(a,b) inelastic scattering cross section - inelastic = (ONE - f) * sab % inelastic_sigma(i_grid) + & - f * sab % inelastic_sigma(i_grid + 1) - - ! Check for elastic data - if (E < sab % threshold_elastic) then - ! Determine whether elastic scattering is given in the coherent or - ! incoherent approximation. For coherent, the cross section is - ! represented as P/E whereas for incoherent, it is simply P - - if (sab % elastic_mode == SAB_ELASTIC_EXACT) then - if (E < sab % elastic_e_in(1)) then - ! If energy is below that of the lowest Bragg peak, the elastic - ! cross section will be zero - elastic = ZERO - else - i_grid = binary_search(sab % elastic_e_in, & - sab % n_elastic_e_in, E) - elastic = sab % elastic_P(i_grid) / E - end if - else - ! Determine index on elastic energy grid - if (E < sab % elastic_e_in(1)) then - i_grid = 1 - else - i_grid = binary_search(sab % elastic_e_in, & - sab % n_elastic_e_in, E) - end if - - ! Get interpolation factor for elastic grid - f = (E - sab%elastic_e_in(i_grid))/(sab%elastic_e_in(i_grid+1) - & - sab%elastic_e_in(i_grid)) - - ! Calculate S(a,b) elastic scattering cross section - elastic = (ONE - f) * sab % elastic_P(i_grid) + & - f * sab % elastic_P(i_grid + 1) - end if - else - ! No elastic data - elastic = ZERO - end if - end associate - - ! Store the S(a,b) cross sections. - micro_xs(i_nuclide) % thermal = sab_frac * (elastic + inelastic) - micro_xs(i_nuclide) % thermal_elastic = sab_frac * elastic - - ! Calculate free atom elastic cross section - call calculate_elastic_xs(i_nuclide) - - ! Correct total and elastic cross sections - micro_xs(i_nuclide) % total = micro_xs(i_nuclide) % total & - + micro_xs(i_nuclide) % thermal & - - sab_frac * micro_xs(i_nuclide) % elastic - micro_xs(i_nuclide) % elastic = micro_xs(i_nuclide) % thermal & - + (ONE - sab_frac) * micro_xs(i_nuclide) % elastic - - ! Save temperature index and thermal fraction - micro_xs(i_nuclide) % index_temp_sab = i_temp - micro_xs(i_nuclide) % sab_frac = sab_frac - - end subroutine calculate_sab_xs - -!=============================================================================== -! CALCULATE_URR_XS determines cross sections in the unresolved resonance range -! from probability tables -!=============================================================================== - - subroutine calculate_urr_xs(i_nuclide, i_temp, E) - integer, intent(in) :: i_nuclide ! index into nuclides array - integer, intent(in) :: i_temp ! temperature index - real(8), intent(in) :: E ! energy - - integer :: i_energy ! index for energy - integer :: i_low ! band index at lower bounding energy - integer :: i_up ! band index at upper bounding energy - real(8) :: f ! interpolation factor - real(8) :: r ! pseudo-random number - real(8) :: elastic ! elastic cross section - real(8) :: capture ! (n,gamma) cross section - real(8) :: fission ! fission cross section - real(8) :: inelastic ! inelastic cross section - - micro_xs(i_nuclide) % use_ptable = .true. - - associate (nuc => nuclides(i_nuclide), urr => nuclides(i_nuclide) % urr_data(i_temp)) - ! determine energy table - i_energy = 1 - do - if (E < urr % energy(i_energy + 1)) exit - i_energy = i_energy + 1 - end do - - ! determine interpolation factor on table - f = (E - urr % energy(i_energy)) / & - (urr % energy(i_energy + 1) - urr % energy(i_energy)) - - ! sample probability table using the cumulative distribution - - ! Random numbers for xs calculation are sampled from a separated stream. - ! This guarantees the randomness and, at the same time, makes sure we reuse - ! random number for the same nuclide at different temperatures, therefore - ! preserving correlation of temperature in probability tables. - call prn_set_stream(STREAM_URR_PTABLE) - r = future_prn(int(i_nuclide, 8)) - call prn_set_stream(STREAM_TRACKING) - - i_low = 1 - do - if (urr % prob(i_energy, URR_CUM_PROB, i_low) > r) exit - i_low = i_low + 1 - end do - i_up = 1 - do - if (urr % prob(i_energy + 1, URR_CUM_PROB, i_up) > r) exit - i_up = i_up + 1 - end do - - ! determine elastic, fission, and capture cross sections from probability - ! table - if (urr % interp == LINEAR_LINEAR) then - elastic = (ONE - f) * urr % prob(i_energy, URR_ELASTIC, i_low) + & - f * urr % prob(i_energy + 1, URR_ELASTIC, i_up) - fission = (ONE - f) * urr % prob(i_energy, URR_FISSION, i_low) + & - f * urr % prob(i_energy + 1, URR_FISSION, i_up) - capture = (ONE - f) * urr % prob(i_energy, URR_N_GAMMA, i_low) + & - f * urr % prob(i_energy + 1, URR_N_GAMMA, i_up) - elseif (urr % interp == LOG_LOG) then - ! Get logarithmic interpolation factor - f = log(E / urr % energy(i_energy)) / & - log(urr % energy(i_energy + 1) / urr % energy(i_energy)) - - ! Calculate elastic cross section/factor - elastic = ZERO - if (urr % prob(i_energy, URR_ELASTIC, i_low) > ZERO .and. & - urr % prob(i_energy + 1, URR_ELASTIC, i_up) > ZERO) then - elastic = exp((ONE - f) * log(urr % prob(i_energy, URR_ELASTIC, & - i_low)) + f * log(urr % prob(i_energy + 1, URR_ELASTIC, & - i_up))) - end if - - ! Calculate fission cross section/factor - fission = ZERO - if (urr % prob(i_energy, URR_FISSION, i_low) > ZERO .and. & - urr % prob(i_energy + 1, URR_FISSION, i_up) > ZERO) then - fission = exp((ONE - f) * log(urr % prob(i_energy, URR_FISSION, & - i_low)) + f * log(urr % prob(i_energy + 1, URR_FISSION, & - i_up))) - end if - - ! Calculate capture cross section/factor - capture = ZERO - if (urr % prob(i_energy, URR_N_GAMMA, i_low) > ZERO .and. & - urr % prob(i_energy + 1, URR_N_GAMMA, i_up) > ZERO) then - capture = exp((ONE - f) * log(urr % prob(i_energy, URR_N_GAMMA, & - i_low)) + f * log(urr % prob(i_energy + 1, URR_N_GAMMA, & - i_up))) - end if - end if - - ! Determine treatment of inelastic scattering - inelastic = ZERO - if (urr % inelastic_flag > 0) then - ! Get index on energy grid and interpolation factor - i_energy = micro_xs(i_nuclide) % index_grid - f = micro_xs(i_nuclide) % interp_factor - - ! Determine inelastic scattering cross section - associate (xs => nuc % reactions(nuc % urr_inelastic) % xs(i_temp)) - if (i_energy >= xs % threshold) then - inelastic = (ONE - f) * xs % value(i_energy - xs % threshold + 1) + & - f * xs % value(i_energy - xs % threshold + 2) - end if - end associate - end if - - ! Multiply by smooth cross-section if needed - if (urr % multiply_smooth) then - call calculate_elastic_xs(i_nuclide) - elastic = elastic * micro_xs(i_nuclide) % elastic - capture = capture * (micro_xs(i_nuclide) % absorption - & - micro_xs(i_nuclide) % fission) - fission = fission * micro_xs(i_nuclide) % fission - end if - - ! Check for negative values - if (elastic < ZERO) elastic = ZERO - if (fission < ZERO) fission = ZERO - if (capture < ZERO) capture = ZERO - - ! Set elastic, absorption, fission, and total cross sections. Note that the - ! total cross section is calculated as sum of partials rather than using the - ! table-provided value - micro_xs(i_nuclide) % elastic = elastic - micro_xs(i_nuclide) % absorption = capture + fission - micro_xs(i_nuclide) % fission = fission - micro_xs(i_nuclide) % total = elastic + inelastic + capture + fission - - ! Determine nu-fission cross section - if (nuc % fissionable) then - micro_xs(i_nuclide) % nu_fission = nuc % nu(E, EMISSION_TOTAL) * & - micro_xs(i_nuclide) % fission - end if - end associate - - end subroutine calculate_urr_xs - -!=============================================================================== -! CALCULATE_ELASTIC_XS precalculates the free atom elastic scattering cross -! section. Normally it is not needed until a collision actually occurs in a -! material. However, in the thermal and unresolved resonance regions, we have to -! calculate it early to adjust the total cross section correctly. -!=============================================================================== - - subroutine calculate_elastic_xs(i_nuclide) - integer, intent(in) :: i_nuclide - - integer :: i_temp - integer :: i_grid - real(8) :: f - - ! Get temperature index, grid index, and interpolation factor - i_temp = micro_xs(i_nuclide) % index_temp - i_grid = micro_xs(i_nuclide) % index_grid - f = micro_xs(i_nuclide) % interp_factor - - if (i_temp > 0) then - associate (xs => nuclides(i_nuclide) % reactions(1) % xs(i_temp) % value) - micro_xs(i_nuclide) % elastic = (ONE - f)*xs(i_grid) + f*xs(i_grid + 1) - end associate - else - ! For multipole, elastic is total - absorption - micro_xs(i_nuclide) % elastic = micro_xs(i_nuclide) % total - & - micro_xs(i_nuclide) % absorption - end if - end subroutine calculate_elastic_xs - -!=============================================================================== -! MULTIPOLE_EVAL evaluates the windowed multipole equations for cross -! sections in the resolved resonance regions -!=============================================================================== - - subroutine multipole_eval(multipole, E, sqrtkT, sig_t, sig_a, sig_f) - type(MultipoleArray), intent(in) :: multipole ! The windowed multipole - ! object to process. - real(8), intent(in) :: E ! The energy at which to - ! evaluate the cross section - real(8), intent(in) :: sqrtkT ! The temperature in the form - ! sqrt(kT), at which - ! to evaluate the XS. - real(8), intent(out) :: sig_t ! Total cross section - real(8), intent(out) :: sig_a ! Absorption cross section - real(8), intent(out) :: sig_f ! Fission cross section - complex(8) :: psi_chi ! The value of the psi-chi function for the - ! asymptotic form - complex(8) :: c_temp ! complex temporary variable - complex(8) :: w_val ! The faddeeva function evaluated at Z - complex(8) :: Z ! sqrt(atomic weight ratio / kT) * (sqrt(E) - pole) - complex(8) :: sig_t_factor(multipole % num_l) - real(8) :: broadened_polynomials(multipole % fit_order + 1) - real(8) :: sqrtE ! sqrt(E), eV - real(8) :: invE ! 1/E, eV - real(8) :: dopp ! sqrt(atomic weight ratio / kT) = 1 / (2 sqrt(xi)) - real(8) :: temp ! real temporary value - integer :: i_pole ! index of pole - integer :: i_poly ! index of curvefit - integer :: i_window ! index of window - integer :: startw ! window start pointer (for poles) - integer :: endw ! window end pointer - - ! ========================================================================== - ! Bookkeeping - - ! Define some frequently used variables. - sqrtE = sqrt(E) - invE = ONE / E - - ! Locate us. - i_window = floor((sqrtE - sqrt(multipole % start_E)) / multipole % spacing & - + ONE) - startw = multipole % w_start(i_window) - endw = multipole % w_end(i_window) - - ! Fill in factors. - if (startw <= endw) then - call compute_sig_t_factor(multipole, sqrtE, sig_t_factor) - end if - - ! Initialize the ouptut cross sections. - sig_t = ZERO - sig_a = ZERO - sig_f = ZERO - - ! ========================================================================== - ! Add the contribution from the curvefit polynomial. - - if (sqrtkT /= ZERO .and. multipole % broaden_poly(i_window) == 1) then - ! Broaden the curvefit. - dopp = multipole % sqrtAWR / sqrtkT - call broaden_wmp_polynomials(E, dopp, multipole % fit_order + 1, & - broadened_polynomials) - do i_poly = 1, multipole % fit_order+1 - sig_t = sig_t + multipole % curvefit(FIT_T, i_poly, i_window) & - * broadened_polynomials(i_poly) - sig_a = sig_a + multipole % curvefit(FIT_A, i_poly, i_window) & - * broadened_polynomials(i_poly) - if (multipole % fissionable) then - sig_f = sig_f + multipole % curvefit(FIT_F, i_poly, i_window) & - * broadened_polynomials(i_poly) - end if - end do - else ! Evaluate as if it were a polynomial - temp = invE - do i_poly = 1, multipole % fit_order+1 - sig_t = sig_t + multipole % curvefit(FIT_T, i_poly, i_window) * temp - sig_a = sig_a + multipole % curvefit(FIT_A, i_poly, i_window) * temp - if (multipole % fissionable) then - sig_f = sig_f + multipole % curvefit(FIT_F, i_poly, i_window) * temp - end if - temp = temp * sqrtE - end do - end if - - ! ========================================================================== - ! Add the contribution from the poles in this window. - - if (sqrtkT == ZERO) then - ! If at 0K, use asymptotic form. - do i_pole = startw, endw - psi_chi = -ONEI / (multipole % data(MP_EA, i_pole) - sqrtE) - c_temp = psi_chi / E - if (multipole % formalism == FORM_MLBW) then - sig_t = sig_t + real(multipole % data(MLBW_RT, i_pole) * c_temp * & - sig_t_factor(multipole % l_value(i_pole))) & - + real(multipole % data(MLBW_RX, i_pole) * c_temp) - sig_a = sig_a + real(multipole % data(MLBW_RA, i_pole) * c_temp) - if (multipole % fissionable) then - sig_f = sig_f + real(multipole % data(MLBW_RF, i_pole) * c_temp) - end if - else if (multipole % formalism == FORM_RM) then - sig_t = sig_t + real(multipole % data(RM_RT, i_pole) * c_temp * & - sig_t_factor(multipole % l_value(i_pole))) - sig_a = sig_a + real(multipole % data(RM_RA, i_pole) * c_temp) - if (multipole % fissionable) then - sig_f = sig_f + real(multipole % data(RM_RF, i_pole) * c_temp) - end if - end if - end do - else - ! At temperature, use Faddeeva function-based form. - dopp = multipole % sqrtAWR / sqrtkT - if (endw >= startw) then - do i_pole = startw, endw - Z = (sqrtE - multipole % data(MP_EA, i_pole)) * dopp - w_val = faddeeva(Z) * dopp * invE * SQRT_PI - if (multipole % formalism == FORM_MLBW) then - sig_t = sig_t + real((multipole % data(MLBW_RT, i_pole) * & - sig_t_factor(multipole % l_value(i_pole)) + & - multipole % data(MLBW_RX, i_pole)) * w_val) - sig_a = sig_a + real(multipole % data(MLBW_RA, i_pole) * w_val) - if (multipole % fissionable) then - sig_f = sig_f + real(multipole % data(MLBW_RF, i_pole) * w_val) - end if - else if (multipole % formalism == FORM_RM) then - sig_t = sig_t + real(multipole % data(RM_RT, i_pole) * w_val * & - sig_t_factor(multipole % l_value(i_pole))) - sig_a = sig_a + real(multipole % data(RM_RA, i_pole) * w_val) - if (multipole % fissionable) then - sig_f = sig_f + real(multipole % data(RM_RF, i_pole) * w_val) - end if - end if - end do - end if - end if - end subroutine multipole_eval - -!=============================================================================== -! MULTIPOLE_DERIV_EVAL evaluates the windowed multipole equations for the -! derivative of cross sections in the resolved resonance regions with respect to -! temperature. -!=============================================================================== - - subroutine multipole_deriv_eval(multipole, E, sqrtkT, sig_t, sig_a, sig_f) - type(MultipoleArray), intent(in) :: multipole ! The windowed multipole - ! object to process. - real(8), intent(in) :: E ! The energy at which to - ! evaluate the cross section - real(8), intent(in) :: sqrtkT ! The temperature in the form - ! sqrt(kT), at which to - ! evaluate the XS. - real(8), intent(out) :: sig_t ! Total cross section - real(8), intent(out) :: sig_a ! Absorption cross section - real(8), intent(out) :: sig_f ! Fission cross section - complex(8) :: w_val ! The faddeeva function evaluated at Z - complex(8) :: Z ! sqrt(atomic weight ratio / kT) * (sqrt(E) - pole) - complex(8) :: sig_t_factor(multipole % num_l) - real(8) :: sqrtE ! sqrt(E), eV - real(8) :: invE ! 1/E, eV - real(8) :: dopp ! sqrt(atomic weight ratio / kT) - integer :: i_pole ! index of pole - integer :: i_window ! index of window - integer :: startw ! window start pointer (for poles) - integer :: endw ! window end pointer - real(8) :: T - - ! ========================================================================== - ! Bookkeeping - - ! Define some frequently used variables. - sqrtE = sqrt(E) - invE = ONE / E - T = sqrtkT**2 / K_BOLTZMANN - - if (sqrtkT == ZERO) call fatal_error("Windowed multipole temperature & - &derivatives are not implemented for 0 Kelvin cross sections.") - - ! Locate us - i_window = floor((sqrtE - sqrt(multipole % start_E)) / multipole % spacing & - + ONE) - startw = multipole % w_start(i_window) - endw = multipole % w_end(i_window) - - ! Fill in factors. - if (startw <= endw) then - call compute_sig_t_factor(multipole, sqrtE, sig_t_factor) - end if - - ! Initialize the ouptut cross sections. - sig_t = ZERO - sig_a = ZERO - sig_f = ZERO - - ! TODO Polynomials: Some of the curvefit polynomials Doppler broaden so - ! rigorously we should be computing the derivative of those. But in - ! practice, those derivatives are only large at very low energy and they - ! have no effect on reactor calculations. - - ! ========================================================================== - ! Add the contribution from the poles in this window. - - dopp = multipole % sqrtAWR / sqrtkT - if (endw >= startw) then - do i_pole = startw, endw - Z = (sqrtE - multipole % data(MP_EA, i_pole)) * dopp - w_val = -invE * SQRT_PI * HALF * w_derivative(Z, 2) - if (multipole % formalism == FORM_MLBW) then - sig_t = sig_t + real((multipole % data(MLBW_RT, i_pole) * & - sig_t_factor(multipole%l_value(i_pole)) + & - multipole % data(MLBW_RX, i_pole)) * w_val) - sig_a = sig_a + real(multipole % data(MLBW_RA, i_pole) * w_val) - if (multipole % fissionable) then - sig_f = sig_f + real(multipole % data(MLBW_RF, i_pole) * w_val) - end if - else if (multipole % formalism == FORM_RM) then - sig_t = sig_t + real(multipole % data(RM_RT, i_pole) * w_val * & - sig_t_factor(multipole % l_value(i_pole))) - sig_a = sig_a + real(multipole % data(RM_RA, i_pole) * w_val) - if (multipole % fissionable) then - sig_f = sig_f + real(multipole % data(RM_RF, i_pole) * w_val) - end if - end if - end do - sig_t = -HALF*multipole % sqrtAWR / sqrt(K_BOLTZMANN) * T**(-1.5) * sig_t - sig_a = -HALF*multipole % sqrtAWR / sqrt(K_BOLTZMANN) * T**(-1.5) * sig_a - sig_f = -HALF*multipole % sqrtAWR / sqrt(K_BOLTZMANN) * T**(-1.5) * sig_f - end if - end subroutine multipole_deriv_eval - -!=============================================================================== -! COMPUTE_SIG_T_FACTOR calculates the sig_t_factor, a factor inside of the sig_t -! equation not present in the sig_a and sig_f equations. -!=============================================================================== - - subroutine compute_sig_t_factor(multipole, sqrtE, sig_t_factor) - type(MultipoleArray), intent(in) :: multipole - real(8), intent(in) :: sqrtE - complex(8), intent(out) :: sig_t_factor(multipole % num_l) - - integer :: iL - real(8) :: twophi(multipole % num_l) - real(8) :: arg - - do iL = 1, multipole % num_l - twophi(iL) = multipole % pseudo_k0RS(iL) * sqrtE - if (iL == 2) then - twophi(iL) = twophi(iL) - atan(twophi(iL)) - else if (iL == 3) then - arg = 3.0_8 * twophi(iL) / (3.0_8 - twophi(iL)**2) - twophi(iL) = twophi(iL) - atan(arg) - else if (iL == 4) then - arg = twophi(iL) * (15.0_8 - twophi(iL)**2) & - / (15.0_8 - 6.0_8 * twophi(iL)**2) - twophi(iL) = twophi(iL) - atan(arg) - end if - end do - - twophi = 2.0_8 * twophi - sig_t_factor = cmplx(cos(twophi), -sin(twophi), KIND=8) - end subroutine compute_sig_t_factor - -!=============================================================================== -! 0K_ELASTIC_XS determines the microscopic 0K elastic cross section -! for a given nuclide at the trial relative energy used in resonance scattering -!=============================================================================== - - pure function elastic_xs_0K(E, nuc) result(xs_out) - real(8), intent(in) :: E ! trial energy - type(Nuclide), intent(in) :: nuc ! target nuclide at temperature - real(8) :: xs_out ! 0K xs at trial energy - - integer :: i_grid ! index on nuclide energy grid - integer :: n_grid - real(8) :: f ! interp factor on nuclide energy grid - - ! Determine index on nuclide energy grid - n_grid = size(nuc % energy_0K) - if (E < nuc % energy_0K(1)) then - i_grid = 1 - elseif (E > nuc % energy_0K(n_grid)) then - i_grid = n_grid - 1 - else - i_grid = binary_search(nuc % energy_0K, n_grid, E) - end if - - ! check for rare case where two energy points are the same - if (nuc % energy_0K(i_grid) == nuc % energy_0K(i_grid+1)) then - i_grid = i_grid + 1 - end if - - ! calculate interpolation factor - f = (E - nuc % energy_0K(i_grid)) & - & / (nuc % energy_0K(i_grid + 1) - nuc % energy_0K(i_grid)) - - ! Calculate microscopic nuclide elastic cross section - xs_out = (ONE - f) * nuc % elastic_0K(i_grid) & - & + f * nuc % elastic_0K(i_grid + 1) - - end function elastic_xs_0K - -end module cross_section diff --git a/src/material_header.F90 b/src/material_header.F90 index a3ce32db3d..ae15ec5700 100644 --- a/src/material_header.F90 +++ b/src/material_header.F90 @@ -7,6 +7,7 @@ module material_header use error use nuclide_header use sab_header + use simulation_header, only: log_spacing use stl_vector, only: VectorReal, VectorInt use string, only: to_str @@ -64,6 +65,7 @@ module material_header procedure :: set_density => material_set_density procedure :: init_nuclide_index => material_init_nuclide_index procedure :: assign_sab_tables => material_assign_sab_tables + procedure :: calculate_xs => material_calculate_xs end type Material integer(C_INT32_T), public, bind(C) :: n_materials ! # of materials @@ -248,6 +250,115 @@ contains if (allocated(this % names)) deallocate(this % names) end subroutine material_assign_sab_tables +!=============================================================================== +! MATERIAL_CALCULATE_XS determines the macroscopic cross sections for the material the +! particle is currently traveling through. +!=============================================================================== + + subroutine material_calculate_xs(this, E, sqrtkT, micro_xs, nuclides, & + material_xs) + class(Material), intent(in) :: this + real(8), intent(in) :: E ! Particle energy + real(8), intent(in) :: sqrtkT ! Last temperature sampled + type(Nuclide), allocatable, intent(in) :: nuclides(:) + type(NuclideMicroXS), allocatable, intent(inout) :: micro_xs(:) ! Cache for each nuclide + type(MaterialMacroXS), intent(inout) :: material_xs ! Cache for current material + + integer :: i ! loop index over nuclides + integer :: i_nuclide ! index into nuclides array + integer :: i_sab ! index into sab_tables array + integer :: j ! index in this % i_sab_nuclides + integer :: i_grid ! index into logarithmic mapping array or material + ! union grid + real(8) :: atom_density ! atom density of a nuclide + real(8) :: sab_frac ! fraction of atoms affected by S(a,b) + logical :: check_sab ! should we check for S(a,b) table? + + ! Set all material macroscopic cross sections to zero + material_xs % total = ZERO + material_xs % absorption = ZERO + material_xs % fission = ZERO + material_xs % nu_fission = ZERO + + ! Find energy index on energy grid + i_grid = int(log(E/energy_min_neutron)/log_spacing) + + ! Determine if this material has S(a,b) tables + check_sab = (this % n_sab > 0) + + ! Initialize position in i_sab_nuclides + j = 1 + + ! Add contribution from each nuclide in material + do i = 1, this % n_nuclides + ! ====================================================================== + ! CHECK FOR S(A,B) TABLE + + i_sab = 0 + sab_frac = ZERO + + ! Check if this nuclide matches one of the S(a,b) tables specified. + ! This relies on i_sab_nuclides being in sorted order + if (check_sab) then + if (i == this % i_sab_nuclides(j)) then + ! Get index in sab_tables + i_sab = this % i_sab_tables(j) + sab_frac = this % sab_fracs(j) + + ! If particle energy is greater than the highest energy for the + ! S(a,b) table, then don't use the S(a,b) table + if (E > sab_tables(i_sab) % data(1) % threshold_inelastic) then + i_sab = 0 + end if + + ! Increment position in i_sab_nuclides + j = j + 1 + + ! Don't check for S(a,b) tables if there are no more left + if (j > size(this % i_sab_tables)) check_sab = .false. + end if + end if + + ! ====================================================================== + ! CALCULATE MICROSCOPIC CROSS SECTION + + ! Determine microscopic cross sections for this nuclide + i_nuclide = this % nuclide(i) + + ! Calculate microscopic cross section for this nuclide + if (E /= micro_xs(i_nuclide) % last_E & + .or. sqrtkT /= micro_xs(i_nuclide) % last_sqrtkT & + .or. i_sab /= micro_xs(i_nuclide) % index_sab & + .or. sab_frac /= micro_xs(i_nuclide) % sab_frac) then + call nuclides(i_nuclide) % calculate_xs(i_sab, E, i_grid, & + sqrtkT, sab_frac, i_nuclide, micro_xs(i_nuclide)) + end if + + ! ====================================================================== + ! ADD TO MACROSCOPIC CROSS SECTION + + ! Copy atom density of nuclide in material + atom_density = this % atom_density(i) + + ! Add contributions to material macroscopic total cross section + material_xs % total = material_xs % total + & + atom_density * micro_xs(i_nuclide) % total + + ! Add contributions to material macroscopic absorption cross section + material_xs % absorption = material_xs % absorption + & + atom_density * micro_xs(i_nuclide) % absorption + + ! Add contributions to material macroscopic fission cross section + material_xs % fission = material_xs % fission + & + atom_density * micro_xs(i_nuclide) % fission + + ! Add contributions to material macroscopic nu-fission cross section + material_xs % nu_fission = material_xs % nu_fission + & + atom_density * micro_xs(i_nuclide) % nu_fission + end do + + end subroutine material_calculate_xs + !=============================================================================== ! FREE_MEMORY_MATERIAL deallocates global arrays defined in this module !=============================================================================== diff --git a/src/mgxs_header.F90 b/src/mgxs_header.F90 index a99939f4c3..6eabefae3c 100644 --- a/src/mgxs_header.F90 +++ b/src/mgxs_header.F90 @@ -163,10 +163,11 @@ module mgxs_header real(8), intent(inout) :: wgt ! Particle weight end subroutine mgxs_sample_scatter_ - subroutine mgxs_calculate_xs_(this, gin, uvw, xs) + subroutine mgxs_calculate_xs_(this, gin, sqrtkT, uvw, xs) import Mgxs, MaterialMacroXS - class(Mgxs), intent(in) :: this + class(Mgxs), intent(inout) :: this integer, intent(in) :: gin ! Incoming neutron group + real(8), intent(in) :: sqrtkT ! Material temperature real(8), intent(in) :: uvw(3) ! Incoming neutron direction type(MaterialMacroXS), intent(inout) :: xs ! Resultant Mgxs Data end subroutine mgxs_calculate_xs_ @@ -3481,12 +3482,16 @@ contains ! for the material the particle is currently traveling through. !=============================================================================== - subroutine mgxsiso_calculate_xs(this, gin, uvw, xs) - class(MgxsIso), intent(in) :: this + subroutine mgxsiso_calculate_xs(this, gin, sqrtkT, uvw, xs) + class(MgxsIso), intent(inout) :: this integer, intent(in) :: gin ! Incoming neutron group + real(8), intent(in) :: sqrtkT ! Material temperature real(8), intent(in) :: uvw(3) ! Incoming neutron direction type(MaterialMacroXS), intent(inout) :: xs ! Resultant Mgxs Data + ! Update the temperature index + call this % find_temperature(sqrtkT) + xs % total = this % xs(this % index_temp) % total(gin) xs % absorption = this % xs(this % index_temp) % absorption(gin) xs % nu_fission = & @@ -3495,15 +3500,19 @@ contains end subroutine mgxsiso_calculate_xs - subroutine mgxsang_calculate_xs(this, gin, uvw, xs) - class(MgxsAngle), intent(in) :: this + subroutine mgxsang_calculate_xs(this, gin, sqrtkT, uvw, xs) + class(MgxsAngle), intent(inout) :: this integer, intent(in) :: gin ! Incoming neutron group + real(8), intent(in) :: sqrtkT ! Material temperature real(8), intent(in) :: uvw(3) ! Incoming neutron direction type(MaterialMacroXS), intent(inout) :: xs ! Resultant Mgxs Data integer :: iazi, ipol + ! Update the temperature and angle indices + call this % find_temperature(sqrtkT) call find_angle(this % polar, this % azimuthal, uvw, iazi, ipol) + xs % total = this % xs(this % index_temp) % & total(gin, iazi, ipol) xs % absorption = this % xs(this % index_temp) % & diff --git a/src/nuclide_header.F90 b/src/nuclide_header.F90 index 1ca5849146..9949610255 100644 --- a/src/nuclide_header.F90 +++ b/src/nuclide_header.F90 @@ -3,26 +3,33 @@ module nuclide_header use, intrinsic :: ISO_FORTRAN_ENV use, intrinsic :: ISO_C_BINDING - use hdf5, only: HID_T, HSIZE_T, SIZE_T + use hdf5, only: HID_T, HSIZE_T, SIZE_T - use algorithm, only: sort, find + use algorithm, only: sort, find, binary_search use constants - use dict_header, only: DictIntInt, DictCharInt - use endf, only: reaction_name, is_fission, is_disappearance - use endf_header, only: Function1D, Polynomial, Tabulated1D + use dict_header, only: DictIntInt, DictCharInt + use endf, only: reaction_name, is_fission, is_disappearance + use endf_header, only: Function1D, Polynomial, Tabulated1D use error use hdf5_interface - use list_header, only: ListInt - use math, only: evaluate_legendre + use list_header, only: ListInt + use math, only: faddeeva, w_derivative, & + broaden_wmp_polynomials + use multipole_header, only: FORM_RM, FORM_MLBW, MP_EA, RM_RT, RM_RA, & + RM_RF, MLBW_RT, MLBW_RX, MLBW_RA, MLBW_RF, & + FIT_T, FIT_A, FIT_F, MultipoleArray use message_passing - use multipole_header, only: MultipoleArray - use product_header, only: AngleEnergyContainer - use reaction_header, only: Reaction + use multipole_header, only: MultipoleArray + use product_header, only: AngleEnergyContainer + use random_lcg, only: prn, future_prn, prn_set_stream + use reaction_header, only: Reaction + use sab_header, only: SAlphaBeta, sab_tables use secondary_uncorrelated, only: UncorrelatedAngleEnergy use settings - use stl_vector, only: VectorInt, VectorReal + use stl_vector, only: VectorInt, VectorReal use string - use urr_header, only: UrrData + use simulation_header, only: need_depletion_rx + use urr_header, only: UrrData implicit none @@ -108,6 +115,8 @@ module nuclide_header procedure :: init_grid => nuclide_init_grid procedure :: nu => nuclide_nu procedure, private :: create_derived => nuclide_create_derived + procedure :: calculate_xs => nuclide_calculate_xs + procedure :: calculate_elastic_xs => nuclide_calculate_elastic_xs end type Nuclide !=============================================================================== @@ -800,6 +809,737 @@ contains end subroutine nuclide_init_grid +!=============================================================================== +! NUCLIDE_CALCULATE_XS determines microscopic cross sections for the nuclide +! at the energy of the given particle +!=============================================================================== + + subroutine nuclide_calculate_xs(this, i_sab, E, i_log_union, sqrtkT, & + sab_frac, i_nuclide, micro_xs) + class(Nuclide), intent(in) :: this ! Nuclide object + integer, intent(in) :: i_sab ! index into sab_tables array + real(8), intent(in) :: E ! energy + integer, intent(in) :: i_log_union ! index into logarithmic mapping array or + ! material union energy grid + real(8), intent(in) :: sqrtkT ! square root of kT, material dependent + real(8), intent(in) :: sab_frac ! fraction of atoms affected by S(a,b) + !!!TODO: i_nuclide is only needed to keep the URR prn stream consistent + !!! to ensure tests pass; this can be removed when this requirement can be + !!! relaxed + integer, intent(in) :: i_nuclide ! Index of this in the nuclides array + type(NuclideMicroXS), intent(inout) :: micro_xs ! Cross section cache + + logical :: use_mp ! true if XS can be calculated with windowed multipole + integer :: i_temp ! index for temperature + integer :: i_grid ! index on nuclide energy grid + integer :: i_low ! lower logarithmic mapping index + integer :: i_high ! upper logarithmic mapping index + integer :: i_rxn ! reaction index + integer :: j ! index in DEPLETION_RX + real(8) :: f ! interp factor on nuclide energy grid + real(8) :: kT ! temperature in eV + real(8) :: sig_t, sig_a, sig_f ! Intermediate multipole variables + + ! Initialize cached cross sections to zero + micro_xs % elastic = CACHE_INVALID + micro_xs % thermal = ZERO + micro_xs % thermal_elastic = ZERO + + ! Check to see if there is multipole data present at this energy + use_mp = .false. + if (this % mp_present) then + if (E >= this % multipole % start_E .and. & + E <= this % multipole % end_E) then + use_mp = .true. + end if + end if + + ! Evaluate multipole or interpolate + if (use_mp) then + ! Call multipole kernel + call multipole_eval(this % multipole, E, sqrtkT, sig_t, sig_a, sig_f) + + micro_xs % total = sig_t + micro_xs % absorption = sig_a + micro_xs % fission = sig_f + + if (this % fissionable) then + micro_xs % nu_fission = sig_f * this % nu(E, EMISSION_TOTAL) + else + micro_xs % nu_fission = ZERO + end if + + if (need_depletion_rx) then + ! Initialize all reaction cross sections to zero + micro_xs % reaction(:) = ZERO + + ! Only non-zero reaction is (n,gamma) + micro_xs % reaction(4) = sig_a - sig_f + end if + + ! Ensure these values are set + ! Note, the only time either is used is in one of 4 places: + ! 1. physics.F90 - scatter - For inelastic scatter. + ! 2. physics.F90 - sample_fission - For partial fissions. + ! 3. tally.F90 - score_general - For tallying on MTxxx reactions. + ! 4. cross_section.F90 - calculate_urr_xs - For unresolved purposes. + ! It is worth noting that none of these occur in the resolved + ! resonance range, so the value here does not matter. index_temp is + ! set to -1 to force a segfault in case a developer messes up and tries + ! to use it with multipole. + micro_xs % index_temp = -1 + micro_xs % index_grid = 0 + micro_xs % interp_factor = ZERO + + else + ! Find the appropriate temperature index. + kT = sqrtkT**2 + select case (temperature_method) + case (TEMPERATURE_NEAREST) + i_temp = minloc(abs(this % kTs - kT), dim=1) + + case (TEMPERATURE_INTERPOLATION) + ! Find temperatures that bound the actual temperature + do i_temp = 1, size(this % kTs) - 1 + if (this % kTs(i_temp) <= kT .and. kT < this % kTs(i_temp + 1)) exit + end do + + ! Randomly sample between temperature i and i+1 + f = (kT - this % kTs(i_temp)) / & + (this % kTs(i_temp + 1) - this % kTs(i_temp)) + if (f > prn()) i_temp = i_temp + 1 + end select + + associate (grid => this % grid(i_temp), xs => this % xs(i_temp)) + ! Determine the energy grid index using a logarithmic mapping to + ! reduce the energy range over which a binary search needs to be + ! performed + + if (E < grid % energy(1)) then + i_grid = 1 + elseif (E > grid % energy(size(grid % energy))) then + i_grid = size(grid % energy) - 1 + else + ! Determine bounding indices based on which equal log-spaced + ! interval the energy is in + i_low = grid % grid_index(i_log_union) + i_high = grid % grid_index(i_log_union + 1) + 1 + + ! Perform binary search over reduced range + i_grid = binary_search(grid % energy(i_low:i_high), & + i_high - i_low + 1, E) + i_low - 1 + end if + + ! check for rare case where two energy points are the same + if (grid % energy(i_grid) == grid % energy(i_grid + 1)) & + i_grid = i_grid + 1 + + ! calculate interpolation factor + f = (E - grid % energy(i_grid)) / & + (grid % energy(i_grid + 1) - grid % energy(i_grid)) + + micro_xs % index_temp = i_temp + micro_xs % index_grid = i_grid + micro_xs % interp_factor = f + + ! Calculate microscopic nuclide total cross section + micro_xs % total = (ONE - f) * xs % value(XS_TOTAL,i_grid) & + + f * xs % value(XS_TOTAL,i_grid + 1) + + ! Calculate microscopic nuclide absorption cross section + micro_xs % absorption = (ONE - f) * xs % value(XS_ABSORPTION, & + i_grid) + f * xs % value(XS_ABSORPTION,i_grid + 1) + + if (this % fissionable) then + ! Calculate microscopic nuclide total cross section + micro_xs % fission = (ONE - f) * xs % value(XS_FISSION,i_grid) & + + f * xs % value(XS_FISSION,i_grid + 1) + + ! Calculate microscopic nuclide nu-fission cross section + micro_xs % nu_fission = (ONE - f) * xs % value(XS_NU_FISSION, & + i_grid) + f * xs % value(XS_NU_FISSION,i_grid + 1) + else + micro_xs % fission = ZERO + micro_xs % nu_fission = ZERO + end if + end associate + + ! Depletion-related reactions + if (need_depletion_rx) then + do j = 1, 6 + ! Initialize reaction xs to zero + micro_xs % reaction(j) = ZERO + + ! If reaction is present and energy is greater than threshold, set + ! the reaction xs appropriately + i_rxn = this % reaction_index(DEPLETION_RX(j)) + if (i_rxn > 0) then + associate (xs => this % reactions(i_rxn) % xs(i_temp)) + if (i_grid >= xs % threshold) then + micro_xs % reaction(j) = (ONE - f) * & + xs % value(i_grid - xs % threshold + 1) + & + f * xs % value(i_grid - xs % threshold + 2) + end if + end associate + end if + end do + end if + + end if + + ! Initialize sab treatment to false + micro_xs % index_sab = NONE + micro_xs % sab_frac = ZERO + + ! Initialize URR probability table treatment to false + micro_xs % use_ptable = .false. + + ! If there is S(a,b) data for this nuclide, we need to set the sab_scatter + ! and sab_elastic cross sections and correct the total and elastic cross + ! sections. + + if (i_sab > 0) then + call calculate_sab_xs(this, i_sab, E, sqrtkT, sab_frac, micro_xs) + end if + + ! If the particle is in the unresolved resonance range and there are + ! probability tables, we need to determine cross sections from the table + + if (urr_ptables_on .and. this % urr_present .and. .not. use_mp) then + if (E > this % urr_data(i_temp) % energy(1) .and. E < this % & + urr_data(i_temp) % energy(this % urr_data(i_temp) % n_energy)) then + call calculate_urr_xs(this, i_temp, E, i_nuclide, micro_xs) + end if + end if + + micro_xs % last_E = E + micro_xs % last_sqrtkT = sqrtkT + + end subroutine nuclide_calculate_xs + +!=============================================================================== +! NUCLIDE_CALCULATE_ELASTIC_XS precalculates the free atom elastic scattering +! cross section. Normally it is not needed until a collision actually occurs in +! a material. However, in the thermal and unresolved resonance regions, we have +! to calculate it early to adjust the total cross section correctly. +!=============================================================================== + + subroutine nuclide_calculate_elastic_xs(this, micro_xs) + class(Nuclide), intent(in) :: this + type(NuclideMicroXS), intent(inout) :: micro_xs ! Cross section cache + + integer :: i_temp + integer :: i_grid + real(8) :: f + + ! Get temperature index, grid index, and interpolation factor + i_temp = micro_xs % index_temp + i_grid = micro_xs % index_grid + f = micro_xs % interp_factor + + if (i_temp > 0) then + associate (xs => this % reactions(1) % xs(i_temp) % value) + micro_xs % elastic = (ONE - f) * xs(i_grid) + f * xs(i_grid + 1) + end associate + else + ! For multipole, elastic is total - absorption + micro_xs % elastic = micro_xs % total - micro_xs % absorption + end if + end subroutine nuclide_calculate_elastic_xs + +!=============================================================================== +! CALCULATE_SAB_XS determines the elastic and inelastic scattering +! cross-sections in the thermal energy range. These cross sections replace a +! fraction of whatever data were taken from the normal Nuclide table. +!=============================================================================== + + subroutine calculate_sab_xs(this, i_sab, E, sqrtkT, sab_frac, micro_xs) + class(Nuclide), intent(in) :: this ! Nuclide object + integer, intent(in) :: i_sab ! index into sab_tables array + real(8), intent(in) :: E ! energy + real(8), intent(in) :: sqrtkT ! temperature + real(8), intent(in) :: sab_frac ! fraction of atoms affected by S(a,b) + type(NuclideMicroXS), intent(inout) :: micro_xs ! Cross section cache + + integer :: i_temp ! temperature index + real(8) :: inelastic ! S(a,b) inelastic cross section + real(8) :: elastic ! S(a,b) elastic cross section + + ! Set flag that S(a,b) treatment should be used for scattering + micro_xs % index_sab = i_sab + + ! Calculate the S(a,b) cross section + call sab_tables(i_sab) % calculate_xs(E, sqrtkT, i_temp, elastic, inelastic) + + ! Store the S(a,b) cross sections. + micro_xs % thermal = sab_frac * (elastic + inelastic) + micro_xs % thermal_elastic = sab_frac * elastic + + ! Calculate free atom elastic cross section + call this % calculate_elastic_xs(micro_xs) + + ! Correct total and elastic cross sections + micro_xs % total = micro_xs % total + micro_xs % thermal - & + sab_frac * micro_xs % elastic + micro_xs % elastic = micro_xs % thermal + (ONE - sab_frac) * & + micro_xs % elastic + + ! Save temperature index and thermal fraction + micro_xs % index_temp_sab = i_temp + micro_xs % sab_frac = sab_frac + + end subroutine calculate_sab_xs + +!=============================================================================== +! MULTIPOLE_EVAL evaluates the windowed multipole equations for cross +! sections in the resolved resonance regions +!=============================================================================== + + subroutine multipole_eval(multipole, E, sqrtkT, sig_t, sig_a, sig_f) + type(MultipoleArray), intent(in) :: multipole ! The windowed multipole + ! object to process. + real(8), intent(in) :: E ! The energy at which to + ! evaluate the cross section + real(8), intent(in) :: sqrtkT ! The temperature in the form + ! sqrt(kT), at which + ! to evaluate the XS. + real(8), intent(out) :: sig_t ! Total cross section + real(8), intent(out) :: sig_a ! Absorption cross section + real(8), intent(out) :: sig_f ! Fission cross section + complex(8) :: psi_chi ! The value of the psi-chi function for the + ! asymptotic form + complex(8) :: c_temp ! complex temporary variable + complex(8) :: w_val ! The faddeeva function evaluated at Z + complex(8) :: Z ! sqrt(atomic weight ratio / kT) * (sqrt(E) - pole) + complex(8) :: sig_t_factor(multipole % num_l) + real(8) :: broadened_polynomials(multipole % fit_order + 1) + real(8) :: sqrtE ! sqrt(E), eV + real(8) :: invE ! 1/E, eV + real(8) :: dopp ! sqrt(atomic weight ratio / kT) = 1 / (2 sqrt(xi)) + real(8) :: temp ! real temporary value + integer :: i_pole ! index of pole + integer :: i_poly ! index of curvefit + integer :: i_window ! index of window + integer :: startw ! window start pointer (for poles) + integer :: endw ! window end pointer + + ! ========================================================================== + ! Bookkeeping + + ! Define some frequently used variables. + sqrtE = sqrt(E) + invE = ONE / E + + ! Locate us. + i_window = floor((sqrtE - sqrt(multipole % start_E)) / multipole % spacing & + + ONE) + startw = multipole % w_start(i_window) + endw = multipole % w_end(i_window) + + ! Fill in factors. + if (startw <= endw) then + call compute_sig_t_factor(multipole, sqrtE, sig_t_factor) + end if + + ! Initialize the ouptut cross sections. + sig_t = ZERO + sig_a = ZERO + sig_f = ZERO + + ! ========================================================================== + ! Add the contribution from the curvefit polynomial. + + if (sqrtkT /= ZERO .and. multipole % broaden_poly(i_window) == 1) then + ! Broaden the curvefit. + dopp = multipole % sqrtAWR / sqrtkT + call broaden_wmp_polynomials(E, dopp, multipole % fit_order + 1, & + broadened_polynomials) + do i_poly = 1, multipole % fit_order+1 + sig_t = sig_t + multipole % curvefit(FIT_T, i_poly, i_window) & + * broadened_polynomials(i_poly) + sig_a = sig_a + multipole % curvefit(FIT_A, i_poly, i_window) & + * broadened_polynomials(i_poly) + if (multipole % fissionable) then + sig_f = sig_f + multipole % curvefit(FIT_F, i_poly, i_window) & + * broadened_polynomials(i_poly) + end if + end do + else ! Evaluate as if it were a polynomial + temp = invE + do i_poly = 1, multipole % fit_order+1 + sig_t = sig_t + multipole % curvefit(FIT_T, i_poly, i_window) * temp + sig_a = sig_a + multipole % curvefit(FIT_A, i_poly, i_window) * temp + if (multipole % fissionable) then + sig_f = sig_f + multipole % curvefit(FIT_F, i_poly, i_window) * temp + end if + temp = temp * sqrtE + end do + end if + + ! ========================================================================== + ! Add the contribution from the poles in this window. + + if (sqrtkT == ZERO) then + ! If at 0K, use asymptotic form. + do i_pole = startw, endw + psi_chi = -ONEI / (multipole % data(MP_EA, i_pole) - sqrtE) + c_temp = psi_chi / E + if (multipole % formalism == FORM_MLBW) then + sig_t = sig_t + real(multipole % data(MLBW_RT, i_pole) * c_temp * & + sig_t_factor(multipole % l_value(i_pole))) & + + real(multipole % data(MLBW_RX, i_pole) * c_temp) + sig_a = sig_a + real(multipole % data(MLBW_RA, i_pole) * c_temp) + if (multipole % fissionable) then + sig_f = sig_f + real(multipole % data(MLBW_RF, i_pole) * c_temp) + end if + else if (multipole % formalism == FORM_RM) then + sig_t = sig_t + real(multipole % data(RM_RT, i_pole) * c_temp * & + sig_t_factor(multipole % l_value(i_pole))) + sig_a = sig_a + real(multipole % data(RM_RA, i_pole) * c_temp) + if (multipole % fissionable) then + sig_f = sig_f + real(multipole % data(RM_RF, i_pole) * c_temp) + end if + end if + end do + else + ! At temperature, use Faddeeva function-based form. + dopp = multipole % sqrtAWR / sqrtkT + if (endw >= startw) then + do i_pole = startw, endw + Z = (sqrtE - multipole % data(MP_EA, i_pole)) * dopp + w_val = faddeeva(Z) * dopp * invE * SQRT_PI + if (multipole % formalism == FORM_MLBW) then + sig_t = sig_t + real((multipole % data(MLBW_RT, i_pole) * & + sig_t_factor(multipole % l_value(i_pole)) + & + multipole % data(MLBW_RX, i_pole)) * w_val) + sig_a = sig_a + real(multipole % data(MLBW_RA, i_pole) * w_val) + if (multipole % fissionable) then + sig_f = sig_f + real(multipole % data(MLBW_RF, i_pole) * w_val) + end if + else if (multipole % formalism == FORM_RM) then + sig_t = sig_t + real(multipole % data(RM_RT, i_pole) * w_val * & + sig_t_factor(multipole % l_value(i_pole))) + sig_a = sig_a + real(multipole % data(RM_RA, i_pole) * w_val) + if (multipole % fissionable) then + sig_f = sig_f + real(multipole % data(RM_RF, i_pole) * w_val) + end if + end if + end do + end if + end if + end subroutine multipole_eval + +!=============================================================================== +! MULTIPOLE_DERIV_EVAL evaluates the windowed multipole equations for the +! derivative of cross sections in the resolved resonance regions with respect to +! temperature. +!=============================================================================== + + subroutine multipole_deriv_eval(multipole, E, sqrtkT, sig_t, sig_a, sig_f) + type(MultipoleArray), intent(in) :: multipole ! The windowed multipole + ! object to process. + real(8), intent(in) :: E ! The energy at which to + ! evaluate the cross section + real(8), intent(in) :: sqrtkT ! The temperature in the form + ! sqrt(kT), at which to + ! evaluate the XS. + real(8), intent(out) :: sig_t ! Total cross section + real(8), intent(out) :: sig_a ! Absorption cross section + real(8), intent(out) :: sig_f ! Fission cross section + complex(8) :: w_val ! The faddeeva function evaluated at Z + complex(8) :: Z ! sqrt(atomic weight ratio / kT) * (sqrt(E) - pole) + complex(8) :: sig_t_factor(multipole % num_l) + real(8) :: sqrtE ! sqrt(E), eV + real(8) :: invE ! 1/E, eV + real(8) :: dopp ! sqrt(atomic weight ratio / kT) + integer :: i_pole ! index of pole + integer :: i_window ! index of window + integer :: startw ! window start pointer (for poles) + integer :: endw ! window end pointer + real(8) :: T + + ! ========================================================================== + ! Bookkeeping + + ! Define some frequently used variables. + sqrtE = sqrt(E) + invE = ONE / E + T = sqrtkT**2 / K_BOLTZMANN + + if (sqrtkT == ZERO) call fatal_error("Windowed multipole temperature & + &derivatives are not implemented for 0 Kelvin cross sections.") + + ! Locate us + i_window = floor((sqrtE - sqrt(multipole % start_E)) / multipole % spacing & + + ONE) + startw = multipole % w_start(i_window) + endw = multipole % w_end(i_window) + + ! Fill in factors. + if (startw <= endw) then + call compute_sig_t_factor(multipole, sqrtE, sig_t_factor) + end if + + ! Initialize the ouptut cross sections. + sig_t = ZERO + sig_a = ZERO + sig_f = ZERO + + ! TODO Polynomials: Some of the curvefit polynomials Doppler broaden so + ! rigorously we should be computing the derivative of those. But in + ! practice, those derivatives are only large at very low energy and they + ! have no effect on reactor calculations. + + ! ========================================================================== + ! Add the contribution from the poles in this window. + + dopp = multipole % sqrtAWR / sqrtkT + if (endw >= startw) then + do i_pole = startw, endw + Z = (sqrtE - multipole % data(MP_EA, i_pole)) * dopp + w_val = -invE * SQRT_PI * HALF * w_derivative(Z, 2) + if (multipole % formalism == FORM_MLBW) then + sig_t = sig_t + real((multipole % data(MLBW_RT, i_pole) * & + sig_t_factor(multipole%l_value(i_pole)) + & + multipole % data(MLBW_RX, i_pole)) * w_val) + sig_a = sig_a + real(multipole % data(MLBW_RA, i_pole) * w_val) + if (multipole % fissionable) then + sig_f = sig_f + real(multipole % data(MLBW_RF, i_pole) * w_val) + end if + else if (multipole % formalism == FORM_RM) then + sig_t = sig_t + real(multipole % data(RM_RT, i_pole) * w_val * & + sig_t_factor(multipole % l_value(i_pole))) + sig_a = sig_a + real(multipole % data(RM_RA, i_pole) * w_val) + if (multipole % fissionable) then + sig_f = sig_f + real(multipole % data(RM_RF, i_pole) * w_val) + end if + end if + end do + sig_t = -HALF*multipole % sqrtAWR / sqrt(K_BOLTZMANN) * T**(-1.5) * sig_t + sig_a = -HALF*multipole % sqrtAWR / sqrt(K_BOLTZMANN) * T**(-1.5) * sig_a + sig_f = -HALF*multipole % sqrtAWR / sqrt(K_BOLTZMANN) * T**(-1.5) * sig_f + end if + end subroutine multipole_deriv_eval + +!=============================================================================== +! COMPUTE_SIG_T_FACTOR calculates the sig_t_factor, a factor inside of the sig_t +! equation not present in the sig_a and sig_f equations. +!=============================================================================== + + subroutine compute_sig_t_factor(multipole, sqrtE, sig_t_factor) + type(MultipoleArray), intent(in) :: multipole + real(8), intent(in) :: sqrtE + complex(8), intent(out) :: sig_t_factor(multipole % num_l) + + integer :: iL + real(8) :: twophi(multipole % num_l) + real(8) :: arg + + do iL = 1, multipole % num_l + twophi(iL) = multipole % pseudo_k0RS(iL) * sqrtE + if (iL == 2) then + twophi(iL) = twophi(iL) - atan(twophi(iL)) + else if (iL == 3) then + arg = 3.0_8 * twophi(iL) / (3.0_8 - twophi(iL)**2) + twophi(iL) = twophi(iL) - atan(arg) + else if (iL == 4) then + arg = twophi(iL) * (15.0_8 - twophi(iL)**2) & + / (15.0_8 - 6.0_8 * twophi(iL)**2) + twophi(iL) = twophi(iL) - atan(arg) + end if + end do + + twophi = 2.0_8 * twophi + sig_t_factor = cmplx(cos(twophi), -sin(twophi), KIND=8) + end subroutine compute_sig_t_factor + +!=============================================================================== +! 0K_ELASTIC_XS determines the microscopic 0K elastic cross section +! for a given nuclide at the trial relative energy used in resonance scattering +!=============================================================================== + + pure function elastic_xs_0K(E, nuc) result(xs_out) + real(8), intent(in) :: E ! trial energy + type(Nuclide), intent(in) :: nuc ! target nuclide at temperature + real(8) :: xs_out ! 0K xs at trial energy + + integer :: i_grid ! index on nuclide energy grid + integer :: n_grid + real(8) :: f ! interp factor on nuclide energy grid + + ! Determine index on nuclide energy grid + n_grid = size(nuc % energy_0K) + if (E < nuc % energy_0K(1)) then + i_grid = 1 + elseif (E > nuc % energy_0K(n_grid)) then + i_grid = n_grid - 1 + else + i_grid = binary_search(nuc % energy_0K, n_grid, E) + end if + + ! check for rare case where two energy points are the same + if (nuc % energy_0K(i_grid) == nuc % energy_0K(i_grid+1)) then + i_grid = i_grid + 1 + end if + + ! calculate interpolation factor + f = (E - nuc % energy_0K(i_grid)) & + & / (nuc % energy_0K(i_grid + 1) - nuc % energy_0K(i_grid)) + + ! Calculate microscopic nuclide elastic cross section + xs_out = (ONE - f) * nuc % elastic_0K(i_grid) & + & + f * nuc % elastic_0K(i_grid + 1) + + end function elastic_xs_0K + +!=============================================================================== +! CALCULATE_URR_XS determines cross sections in the unresolved resonance range +! from probability tables +!=============================================================================== + + subroutine calculate_urr_xs(this, i_temp, E, i_nuclide, micro_xs) + class(Nuclide), intent(in) :: this ! Nuclide object + integer, intent(in) :: i_temp ! temperature index + real(8), intent(in) :: E ! energy + !!!TODO: i_nuclide is only needed to keep the URR prn stream consistent + !!! to ensure tests pass; this can be removed when this requirement can be + !!! relaxed + integer, intent(in) :: i_nuclide ! Index of this in the nuclides array + type(NuclideMicroXS), intent(inout) :: micro_xs ! Cross section cache + + integer :: i_energy ! index for energy + integer :: i_low ! band index at lower bounding energy + integer :: i_up ! band index at upper bounding energy + real(8) :: f ! interpolation factor + real(8) :: r ! pseudo-random number + real(8) :: elastic ! elastic cross section + real(8) :: capture ! (n,gamma) cross section + real(8) :: fission ! fission cross section + real(8) :: inelastic ! inelastic cross section + + micro_xs % use_ptable = .true. + + associate (urr => this % urr_data(i_temp)) + ! determine energy table + i_energy = 1 + do + if (E < urr % energy(i_energy + 1)) exit + i_energy = i_energy + 1 + end do + + ! determine interpolation factor on table + f = (E - urr % energy(i_energy)) / & + (urr % energy(i_energy + 1) - urr % energy(i_energy)) + + ! sample probability table using the cumulative distribution + + ! Random numbers for xs calculation are sampled from a separated stream. + ! This guarantees the randomness and, at the same time, makes sure we reuse + ! random number for the same nuclide at different temperatures, therefore + ! preserving correlation of temperature in probability tables. + call prn_set_stream(STREAM_URR_PTABLE) + r = future_prn(int(i_nuclide, 8)) + call prn_set_stream(STREAM_TRACKING) + + i_low = 1 + do + if (urr % prob(i_energy, URR_CUM_PROB, i_low) > r) exit + i_low = i_low + 1 + end do + i_up = 1 + do + if (urr % prob(i_energy + 1, URR_CUM_PROB, i_up) > r) exit + i_up = i_up + 1 + end do + + ! determine elastic, fission, and capture cross sections from probability + ! table + if (urr % interp == LINEAR_LINEAR) then + elastic = (ONE - f) * urr % prob(i_energy, URR_ELASTIC, i_low) + & + f * urr % prob(i_energy + 1, URR_ELASTIC, i_up) + fission = (ONE - f) * urr % prob(i_energy, URR_FISSION, i_low) + & + f * urr % prob(i_energy + 1, URR_FISSION, i_up) + capture = (ONE - f) * urr % prob(i_energy, URR_N_GAMMA, i_low) + & + f * urr % prob(i_energy + 1, URR_N_GAMMA, i_up) + elseif (urr % interp == LOG_LOG) then + ! Get logarithmic interpolation factor + f = log(E / urr % energy(i_energy)) / & + log(urr % energy(i_energy + 1) / urr % energy(i_energy)) + + ! Calculate elastic cross section/factor + elastic = ZERO + if (urr % prob(i_energy, URR_ELASTIC, i_low) > ZERO .and. & + urr % prob(i_energy + 1, URR_ELASTIC, i_up) > ZERO) then + elastic = exp((ONE - f) * log(urr % prob(i_energy, URR_ELASTIC, & + i_low)) + f * log(urr % prob(i_energy + 1, URR_ELASTIC, & + i_up))) + end if + + ! Calculate fission cross section/factor + fission = ZERO + if (urr % prob(i_energy, URR_FISSION, i_low) > ZERO .and. & + urr % prob(i_energy + 1, URR_FISSION, i_up) > ZERO) then + fission = exp((ONE - f) * log(urr % prob(i_energy, URR_FISSION, & + i_low)) + f * log(urr % prob(i_energy + 1, URR_FISSION, & + i_up))) + end if + + ! Calculate capture cross section/factor + capture = ZERO + if (urr % prob(i_energy, URR_N_GAMMA, i_low) > ZERO .and. & + urr % prob(i_energy + 1, URR_N_GAMMA, i_up) > ZERO) then + capture = exp((ONE - f) * log(urr % prob(i_energy, URR_N_GAMMA, & + i_low)) + f * log(urr % prob(i_energy + 1, URR_N_GAMMA, & + i_up))) + end if + end if + + ! Determine treatment of inelastic scattering + inelastic = ZERO + if (urr % inelastic_flag > 0) then + ! Get index on energy grid and interpolation factor + i_energy = micro_xs % index_grid + f = micro_xs % interp_factor + + ! Determine inelastic scattering cross section + associate (xs => this % reactions(this % urr_inelastic) % xs(i_temp)) + if (i_energy >= xs % threshold) then + inelastic = (ONE - f) * xs % value(i_energy - xs % threshold + 1) + & + f * xs % value(i_energy - xs % threshold + 2) + end if + end associate + end if + + ! Multiply by smooth cross-section if needed + if (urr % multiply_smooth) then + call this % calculate_elastic_xs(micro_xs) + elastic = elastic * micro_xs % elastic + capture = capture * (micro_xs % absorption - micro_xs % fission) + fission = fission * micro_xs % fission + end if + + ! Check for negative values + if (elastic < ZERO) elastic = ZERO + if (fission < ZERO) fission = ZERO + if (capture < ZERO) capture = ZERO + + ! Set elastic, absorption, fission, and total cross sections. Note that the + ! total cross section is calculated as sum of partials rather than using the + ! table-provided value + micro_xs % elastic = elastic + micro_xs % absorption = capture + fission + micro_xs % fission = fission + micro_xs % total = elastic + inelastic + capture + fission + + ! Determine nu-fission cross section + if (this % fissionable) then + micro_xs % nu_fission = this % nu(E, EMISSION_TOTAL) * & + micro_xs % fission + end if + end associate + + end subroutine calculate_urr_xs + !=============================================================================== ! CHECK_DATA_VERSION checks for the right version of nuclear data within HDF5 ! files diff --git a/src/physics.F90 b/src/physics.F90 index fe242dbb78..98fef8b921 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -2,7 +2,6 @@ module physics use algorithm, only: binary_search use constants - use cross_section, only: elastic_xs_0K, calculate_elastic_xs use endf, only: reaction_name use error, only: fatal_error, warning, write_message use material_header, only: Material, materials @@ -340,7 +339,7 @@ contains ! Calculate elastic cross section if it wasn't precalculated if (micro_xs(i_nuclide) % elastic == CACHE_INVALID) then - call calculate_elastic_xs(i_nuclide) + call nuc % calculate_elastic_xs(micro_xs(i_nuclide)) end if prob = micro_xs(i_nuclide) % elastic - micro_xs(i_nuclide) % thermal diff --git a/src/sab_header.F90 b/src/sab_header.F90 index 6dd617790b..eca8e555a1 100644 --- a/src/sab_header.F90 +++ b/src/sab_header.F90 @@ -3,7 +3,7 @@ module sab_header use, intrinsic :: ISO_C_BINDING use, intrinsic :: ISO_FORTRAN_ENV - use algorithm, only: find, sort + use algorithm, only: find, sort, binary_search use constants use dict_header, only: DictIntInt, DictCharInt use distribution_univariate, only: Tabular @@ -12,7 +12,9 @@ module sab_header use hdf5_interface, only: read_attribute, get_shape, open_group, close_group, & open_dataset, read_dataset, close_dataset, get_datasets, object_exists, & get_name + use random_lcg, only: prn use secondary_correlated, only: CorrelatedAngleEnergy + use settings use stl_vector, only: VectorInt, VectorReal use string, only: to_str, str_to_int @@ -77,6 +79,7 @@ module sab_header type(SabData), allocatable :: data(:) contains procedure :: from_hdf5 => salphabeta_from_hdf5 + procedure :: calculate_xs => sab_calculate_xs end type SAlphaBeta ! S(a,b) tables @@ -360,6 +363,104 @@ contains call close_group(kT_group) end subroutine salphabeta_from_hdf5 +!=============================================================================== +! SAB_CALCULATE_XS determines the elastic and inelastic scattering +! cross-sections in the thermal energy range. +!=============================================================================== + + subroutine sab_calculate_xs(this, E, sqrtkT, i_temp, elastic, inelastic) + class(SAlphaBeta), intent(in) :: this ! S(a,b) object + real(8), intent(in) :: E ! energy + real(8), intent(in) :: sqrtkT ! temperature + integer, intent(out) :: i_temp ! index in the S(a,b)'s temperature + real(8), intent(out) :: elastic ! thermal elastic cross section + real(8), intent(out) :: inelastic ! thermal inelastic cross section + + integer :: i_grid ! index on S(a,b) energy grid + real(8) :: f ! interp factor on S(a,b) energy grid + real(8) :: kT + + ! Determine temperature for S(a,b) table + kT = sqrtkT**2 + if (temperature_method == TEMPERATURE_NEAREST) then + ! If using nearest temperature, do linear search on temperature + do i_temp = 1, size(this % kTs) + if (abs(this % kTs(i_temp) - kT) < & + K_BOLTZMANN*temperature_tolerance) exit + end do + else + ! Find temperatures that bound the actual temperature + do i_temp = 1, size(this % kTs) - 1 + if (this % kTs(i_temp) <= kT .and. & + kT < this % kTs(i_temp + 1)) exit + end do + + ! Randomly sample between temperature i and i+1 + f = (kT - this % kTs(i_temp)) / & + (this % kTs(i_temp + 1) - this % kTs(i_temp)) + if (f > prn()) i_temp = i_temp + 1 + end if + + + ! Get pointer to S(a,b) table + associate (sab => this % data(i_temp)) + + ! Get index and interpolation factor for inelastic grid + if (E < sab % inelastic_e_in(1)) then + i_grid = 1 + f = ZERO + else + i_grid = binary_search(sab % inelastic_e_in, sab % n_inelastic_e_in, E) + f = (E - sab%inelastic_e_in(i_grid)) / & + (sab%inelastic_e_in(i_grid+1) - sab%inelastic_e_in(i_grid)) + end if + + ! Calculate S(a,b) inelastic scattering cross section + inelastic = (ONE - f) * sab % inelastic_sigma(i_grid) + & + f * sab % inelastic_sigma(i_grid + 1) + + ! Check for elastic data + if (E < sab % threshold_elastic) then + ! Determine whether elastic scattering is given in the coherent or + ! incoherent approximation. For coherent, the cross section is + ! represented as P/E whereas for incoherent, it is simply P + + if (sab % elastic_mode == SAB_ELASTIC_EXACT) then + if (E < sab % elastic_e_in(1)) then + ! If energy is below that of the lowest Bragg peak, the elastic + ! cross section will be zero + elastic = ZERO + else + i_grid = binary_search(sab % elastic_e_in, & + sab % n_elastic_e_in, E) + elastic = sab % elastic_P(i_grid) / E + end if + else + ! Determine index on elastic energy grid + if (E < sab % elastic_e_in(1)) then + i_grid = 1 + else + i_grid = binary_search(sab % elastic_e_in, & + sab % n_elastic_e_in, E) + end if + + ! Get interpolation factor for elastic grid + f = (E - sab%elastic_e_in(i_grid))/(sab%elastic_e_in(i_grid+1) - & + sab%elastic_e_in(i_grid)) + + ! Calculate S(a,b) elastic scattering cross section + elastic = (ONE - f) * sab % elastic_P(i_grid) + & + f * sab % elastic_P(i_grid + 1) + end if + else + ! No elastic data + elastic = ZERO + end if + end associate + + end subroutine sab_calculate_xs + + !=============================================================================== ! FREE_MEMORY_SAB deallocates global arrays defined in this module !=============================================================================== diff --git a/src/tallies/tally.F90 b/src/tallies/tally.F90 index da0d8929c1..a9a5fd8bfc 100644 --- a/src/tallies/tally.F90 +++ b/src/tallies/tally.F90 @@ -4,7 +4,6 @@ module tally use algorithm, only: binary_search use constants - use cross_section, only: multipole_deriv_eval, calculate_elastic_xs use dict_header, only: EMPTY use error, only: fatal_error use geometry_header @@ -1018,7 +1017,7 @@ contains else if (i_nuclide > 0) then if (micro_xs(i_nuclide) % elastic == CACHE_INVALID) then - call calculate_elastic_xs(i_nuclide) + call nuclides(i_nuclide) % calculate_elastic_xs(micro_xs(i_nuclide)) end if score = micro_xs(i_nuclide) % elastic * atom_density * flux else @@ -1031,7 +1030,7 @@ contains ! Get index in nuclides array i_nuc = materials(p % material) % nuclide(l) if (micro_xs(i_nuc) % elastic == CACHE_INVALID) then - call calculate_elastic_xs(i_nuc) + call nuclides(i_nuc) % calculate_elastic_xs(micro_xs(i_nuc)) end if score = score + micro_xs(i_nuc) % elastic * atom_density_ * flux diff --git a/src/tracking.F90 b/src/tracking.F90 index 127da02226..40f20bbb07 100644 --- a/src/tracking.F90 +++ b/src/tracking.F90 @@ -1,11 +1,11 @@ module tracking use constants - use cross_section, only: calculate_xs use error, only: warning, write_message use geometry_header, only: cells use geometry, only: find_cell, distance_to_boundary, cross_lattice,& check_cell_overlap + use material_header, only: materials, Material use message_passing use mgxs_header use nuclide_header @@ -100,29 +100,30 @@ contains if (check_overlaps) call check_cell_overlap(p) ! Calculate microscopic and macroscopic cross sections - if (run_CE) then - ! If the material is the same as the last material and the temperature - ! hasn't changed, we don't need to lookup cross sections again. - if (p % material /= p % last_material .or. & - p % sqrtkT /= p % last_sqrtkT) call calculate_xs(p) - else - ! Since the MGXS can be angle dependent, this needs to be done - ! After every collision for the MGXS mode - if (p % material /= MATERIAL_VOID) then - ! Update the temperature index - call macro_xs(p % material) % obj % find_temperature(p % sqrtkT) - ! Get the data - call macro_xs(p % material) % obj % calculate_xs(p % g, & - p % coord(p % n_coord) % uvw, material_xs) + if (p % material /= MATERIAL_VOID) then + if (run_CE) then + if (p % material /= p % last_material .or. & + p % sqrtkT /= p % last_sqrtkT) then + ! If the material is the same as the last material and the + ! temperature hasn't changed, we don't need to lookup cross + ! sections again. + call materials(p % material) % calculate_xs(p % E, p % sqrtkT, & + micro_xs, nuclides, material_xs) + end if else - material_xs % total = ZERO - material_xs % absorption = ZERO - material_xs % nu_fission = ZERO - end if + ! Get the MG data + call macro_xs(p % material) % obj % calculate_xs(p % g, p % sqrtkT, & + p % coord(p % n_coord) % uvw, material_xs) - ! Finally, update the particle group while we have already checked for - ! if multi-group - p % last_g = p % g + ! Finally, update the particle group while we have already checked + ! for if multi-group + p % last_g = p % g + end if + else + material_xs % total = ZERO + material_xs % absorption = ZERO + material_xs % fission = ZERO + material_xs % nu_fission = ZERO end if ! Find the distance to the nearest boundary From 467f203bdb0a43a4a324346a6eff7dcb071c15f6 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Sun, 4 Feb 2018 17:27:58 -0500 Subject: [PATCH 002/231] Cleaning up --- src/input_xml.F90 | 2 +- src/material_header.F90 | 2 +- src/nuclide_header.F90 | 27 ++++++++++++--------------- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 0b7790a51c..34a2fdd718 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -4191,7 +4191,7 @@ contains group_id = open_group(file_id, name) call nuclides(i_nuclide) % from_hdf5(group_id, nuc_temps(i_nuclide), & temperature_method, temperature_tolerance, temperature_range, & - master) + master, i_nuclide) call close_group(group_id) call file_close(file_id) diff --git a/src/material_header.F90 b/src/material_header.F90 index ae15ec5700..038e529bee 100644 --- a/src/material_header.F90 +++ b/src/material_header.F90 @@ -331,7 +331,7 @@ contains .or. i_sab /= micro_xs(i_nuclide) % index_sab & .or. sab_frac /= micro_xs(i_nuclide) % sab_frac) then call nuclides(i_nuclide) % calculate_xs(i_sab, E, i_grid, & - sqrtkT, sab_frac, i_nuclide, micro_xs(i_nuclide)) + sqrtkT, sab_frac, micro_xs(i_nuclide)) end if ! ====================================================================== diff --git a/src/nuclide_header.F90 b/src/nuclide_header.F90 index 9949610255..fd2577508a 100644 --- a/src/nuclide_header.F90 +++ b/src/nuclide_header.F90 @@ -64,6 +64,7 @@ module nuclide_header integer :: A ! mass number integer :: metastable ! metastable state real(8) :: awr ! Atomic Weight Ratio + integer :: i_nuclide ! The nuclides index in the nuclides array real(8), allocatable :: kTs(:) ! temperature in eV (k*T) ! Fission information @@ -268,7 +269,7 @@ contains end subroutine nuclide_clear subroutine nuclide_from_hdf5(this, group_id, temperature, method, tolerance, & - minmax, master) + minmax, master, i_nuclide) class(Nuclide), intent(inout) :: this integer(HID_T), intent(in) :: group_id type(VectorReal), intent(in) :: temperature ! list of desired temperatures @@ -276,6 +277,7 @@ contains real(8), intent(in) :: tolerance real(8), intent(in) :: minmax(2) ! range of temperatures logical, intent(in) :: master ! if this is the master proc + integer, intent(in) :: i_nuclide ! Nuclide index in nuclides integer :: i integer :: i_closest @@ -569,6 +571,9 @@ contains ! Create derived cross section data call this % create_derived() + ! Finalize with the nuclide index + this % i_nuclide = i_nuclide + end subroutine nuclide_from_hdf5 subroutine nuclide_create_derived(this) @@ -815,7 +820,7 @@ contains !=============================================================================== subroutine nuclide_calculate_xs(this, i_sab, E, i_log_union, sqrtkT, & - sab_frac, i_nuclide, micro_xs) + sab_frac, micro_xs) class(Nuclide), intent(in) :: this ! Nuclide object integer, intent(in) :: i_sab ! index into sab_tables array real(8), intent(in) :: E ! energy @@ -823,10 +828,6 @@ contains ! material union energy grid real(8), intent(in) :: sqrtkT ! square root of kT, material dependent real(8), intent(in) :: sab_frac ! fraction of atoms affected by S(a,b) - !!!TODO: i_nuclide is only needed to keep the URR prn stream consistent - !!! to ensure tests pass; this can be removed when this requirement can be - !!! relaxed - integer, intent(in) :: i_nuclide ! Index of this in the nuclides array type(NuclideMicroXS), intent(inout) :: micro_xs ! Cross section cache logical :: use_mp ! true if XS can be calculated with windowed multipole @@ -882,7 +883,7 @@ contains ! 1. physics.F90 - scatter - For inelastic scatter. ! 2. physics.F90 - sample_fission - For partial fissions. ! 3. tally.F90 - score_general - For tallying on MTxxx reactions. - ! 4. cross_section.F90 - calculate_urr_xs - For unresolved purposes. + ! 4. nuclide_header.F90 - calculate_urr_xs - For unresolved purposes. ! It is worth noting that none of these occur in the resolved ! resonance range, so the value here does not matter. index_temp is ! set to -1 to force a segfault in case a developer messes up and tries @@ -1008,7 +1009,7 @@ contains if (urr_ptables_on .and. this % urr_present .and. .not. use_mp) then if (E > this % urr_data(i_temp) % energy(1) .and. E < this % & urr_data(i_temp) % energy(this % urr_data(i_temp) % n_energy)) then - call calculate_urr_xs(this, i_temp, E, i_nuclide, micro_xs) + call calculate_urr_xs(this, i_temp, E, micro_xs) end if end if @@ -1397,14 +1398,10 @@ contains ! from probability tables !=============================================================================== - subroutine calculate_urr_xs(this, i_temp, E, i_nuclide, micro_xs) + subroutine calculate_urr_xs(this, i_temp, E, micro_xs) class(Nuclide), intent(in) :: this ! Nuclide object integer, intent(in) :: i_temp ! temperature index real(8), intent(in) :: E ! energy - !!!TODO: i_nuclide is only needed to keep the URR prn stream consistent - !!! to ensure tests pass; this can be removed when this requirement can be - !!! relaxed - integer, intent(in) :: i_nuclide ! Index of this in the nuclides array type(NuclideMicroXS), intent(inout) :: micro_xs ! Cross section cache integer :: i_energy ! index for energy @@ -1438,7 +1435,7 @@ contains ! random number for the same nuclide at different temperatures, therefore ! preserving correlation of temperature in probability tables. call prn_set_stream(STREAM_URR_PTABLE) - r = future_prn(int(i_nuclide, 8)) + r = future_prn(int(this % i_nuclide, 8)) call prn_set_stream(STREAM_TRACKING) i_low = 1 @@ -1657,7 +1654,7 @@ contains group_id = open_group(file_id, name_) call nuclides(n) % from_hdf5(group_id, temperature, & temperature_method, temperature_tolerance, minmax, & - master) + master, n) call close_group(group_id) call file_close(file_id) From 160c533ae984987c17a5db5e8d6b64166cbda3a1 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Sun, 4 Feb 2018 19:00:39 -0500 Subject: [PATCH 003/231] fixed mis-indented line --- src/tracking.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tracking.F90 b/src/tracking.F90 index 40f20bbb07..f5839eb8e9 100644 --- a/src/tracking.F90 +++ b/src/tracking.F90 @@ -103,7 +103,7 @@ contains if (p % material /= MATERIAL_VOID) then if (run_CE) then if (p % material /= p % last_material .or. & - p % sqrtkT /= p % last_sqrtkT) then + p % sqrtkT /= p % last_sqrtkT) then ! If the material is the same as the last material and the ! temperature hasn't changed, we don't need to lookup cross ! sections again. From ddc60ec6f0521b5d67f8a5bc99205118efb61038 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Tue, 6 Feb 2018 19:27:39 -0500 Subject: [PATCH 004/231] Inelastic scattering index list --- src/nuclide_header.F90 | 18 ++++++++++++++++++ src/physics.F90 | 22 ++++++---------------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/nuclide_header.F90 b/src/nuclide_header.F90 index fd2577508a..8bbf103e3e 100644 --- a/src/nuclide_header.F90 +++ b/src/nuclide_header.F90 @@ -100,6 +100,7 @@ module nuclide_header ! Reactions type(Reaction), allocatable :: reactions(:) + integer, allocatable :: index_inelastic_scatter(:) ! Array that maps MT values to index in reactions; used at tally-time. Note ! that ENDF-102 does not assign any MT values above 891. @@ -302,6 +303,7 @@ contains real(8) :: temp_actual type(VectorInt) :: MTs type(VectorInt) :: temps_to_read + type(VectorInt) :: index_inelastic_scatter_vector ! Get name of nuclide from group name_len = len(this % name) @@ -469,10 +471,26 @@ contains end if end if + ! Add the reaction index to the scattering array if this is an inelastic + ! scatter reaction + if (MTs % data(i) /= N_FISSION .and. MTs % data(i) /= N_F .and. & + MTs % data(i) /= N_NF .and. MTs % data(i) /= N_2NF .and. & + MTs % data(i) /= N_3NF .and. MTs % data(i) < 200 .and. & + MTs % data(i) /= N_LEVEL .and. MTs % data(i) /= ELASTIC) then + + call index_inelastic_scatter_vector % push_back(i) + end if + call close_group(rx_group) end do call close_group(rxs_group) + ! Recast to a regular array to save space + allocate(this % index_inelastic_scatter( & + index_inelastic_scatter_vector % size())) + this % index_inelastic_scatter = index_inelastic_scatter_vector % data(:) + call index_inelastic_scatter_vector % clear() + ! Read unresolved resonance probability tables if present if (object_exists(group_id, 'urr')) then this % urr_present = .true. diff --git a/src/physics.F90 b/src/physics.F90 index 98fef8b921..721e3dd6c1 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -310,6 +310,7 @@ contains integer, intent(in) :: i_nuc_mat integer :: i + integer :: j integer :: i_temp integer :: i_grid real(8) :: f @@ -378,11 +379,10 @@ contains ! ======================================================================= ! INELASTIC SCATTERING - ! note that indexing starts from 2 since nuc % reactions(1) is elastic - ! scattering - i = 1 + j = 0 do while (prob < cutoff) - i = i + 1 + j = j + 1 + i = nuc % index_inelastic_scatter(j) ! Check to make sure inelastic scattering reaction sampled if (i > size(nuc % reactions)) then @@ -391,24 +391,14 @@ contains &// trim(nuc % name)) end if - associate (rx => nuc % reactions(i)) - ! Skip fission reactions - if (rx % MT == N_FISSION .or. rx % MT == N_F .or. rx % MT == N_NF & - .or. rx % MT == N_2NF .or. rx % MT == N_3NF) cycle - - ! Some materials have gas production cross sections with MT > 200 that - ! are duplicates. Also MT=4 is total level inelastic scattering which - ! should be skipped - if (rx % MT >= 200 .or. rx % MT == N_LEVEL) cycle - - associate (xs => rx % xs(i_temp)) + associate (rx => nuc % reactions(i), & + xs => nuc % reactions(i) % xs(i_temp)) ! if energy is below threshold for this reaction, skip it if (i_grid < xs % threshold) cycle ! add to cumulative probability prob = prob + ((ONE - f)*xs % value(i_grid - xs % threshold + 1) & + f*(xs % value(i_grid - xs % threshold + 2))) - end associate end associate end do From 7d4cc0094eb2dc885710d3691e4f52c3fd1e50a8 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Tue, 6 Feb 2018 19:33:58 -0500 Subject: [PATCH 005/231] Fixing further misidentations --- src/nuclide_header.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nuclide_header.F90 b/src/nuclide_header.F90 index 8bbf103e3e..c0c5c2627d 100644 --- a/src/nuclide_header.F90 +++ b/src/nuclide_header.F90 @@ -474,9 +474,9 @@ contains ! Add the reaction index to the scattering array if this is an inelastic ! scatter reaction if (MTs % data(i) /= N_FISSION .and. MTs % data(i) /= N_F .and. & - MTs % data(i) /= N_NF .and. MTs % data(i) /= N_2NF .and. & - MTs % data(i) /= N_3NF .and. MTs % data(i) < 200 .and. & - MTs % data(i) /= N_LEVEL .and. MTs % data(i) /= ELASTIC) then + MTs % data(i) /= N_NF .and. MTs % data(i) /= N_2NF .and. & + MTs % data(i) /= N_3NF .and. MTs % data(i) < 200 .and. & + MTs % data(i) /= N_LEVEL .and. MTs % data(i) /= ELASTIC) then call index_inelastic_scatter_vector % push_back(i) end if From dacf650eaf74ce6b138c0225cfcc83d4c622a39d Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 8 Feb 2018 14:32:28 -0600 Subject: [PATCH 006/231] Fix bug with clearing k_generation and entropy --- src/simulation.F90 | 2 ++ tests/__init__.py | 15 +++++++++++++++ tests/unit_tests/test_capi.py | 33 ++++++++++++++++++++------------- 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/src/simulation.F90 b/src/simulation.F90 index 424c55e9bd..0204aaf796 100644 --- a/src/simulation.F90 +++ b/src/simulation.F90 @@ -454,6 +454,8 @@ contains ! Reset global variables current_batch = 0 + call k_generation % clear() + call entropy % clear() need_depletion_rx = .false. ! Set flag indicating initialization is done diff --git a/tests/__init__.py b/tests/__init__.py index e69de29bb2..5c21cd9380 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1,15 @@ +from contextlib import contextmanager +import os +import tempfile + + +@contextmanager +def cdtemp(): + """Context manager to change to/return from a tmpdir.""" + with tempfile.TemporaryDirectory() as tmpdir: + cwd = os.getcwd() + try: + os.chdir(tmpdir) + yield + finally: + os.chdir(cwd) diff --git a/tests/unit_tests/test_capi.py b/tests/unit_tests/test_capi.py index e1e87e27b3..618f54e4f9 100644 --- a/tests/unit_tests/test_capi.py +++ b/tests/unit_tests/test_capi.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - from collections import Mapping import os @@ -8,12 +6,15 @@ import pytest import openmc import openmc.capi +from tests import cdtemp + @pytest.fixture(scope='module') def pincell_model(): """Set up a model to test with and delete files when done""" openmc.reset_auto_ids() pincell = openmc.examples.pwr_pin_cell() + pincell.settings.verbosity = 1 # Add a tally filter1 = openmc.MaterialFilter(pincell.materials) @@ -24,17 +25,10 @@ def pincell_model(): mat_tally.scores = ['total', 'elastic', '(n,gamma)'] pincell.tallies.append(mat_tally) - # Write XML files - pincell.export_to_xml() - - yield - - # Delete generated files - files = ['geometry.xml', 'materials.xml', 'settings.xml', 'tallies.xml', - 'statepoint.10.h5', 'summary.h5', 'test_sp.h5'] - for f in files: - if os.path.exists(f): - os.remove(f) + # Write XML files in tmpdir + with cdtemp(): + pincell.export_to_xml() + yield @pytest.fixture(scope='module') @@ -229,6 +223,19 @@ def test_by_batch(capi_run): openmc.capi.simulation_finalize() +def test_reproduce_keff(capi_init): + # Get k-effective after run + openmc.capi.hard_reset() + openmc.capi.run() + keff0 = openmc.capi.keff() + + # Reset, run again, and get k-effective again. they should match + openmc.capi.hard_reset() + openmc.capi.run() + keff1 = openmc.capi.keff() + assert keff0 == pytest.approx(keff1) + + def test_find_cell(capi_init): cell, instance = openmc.capi.find_cell((0., 0., 0.)) assert cell is openmc.capi.cells[1] From 899b6b67996489ae6e3369156ce7017e902031a1 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 8 Feb 2018 15:34:39 -0600 Subject: [PATCH 007/231] Make sure k_generation and entropy are cleared before loading state point --- src/simulation.F90 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/simulation.F90 b/src/simulation.F90 index 0204aaf796..34c4336944 100644 --- a/src/simulation.F90 +++ b/src/simulation.F90 @@ -434,6 +434,13 @@ contains allocate(filter_matches(n_filters)) !$omp end parallel + ! Reset global variables -- this is done before loading state point (as that + ! will potentially populate k_generation and entropy) + current_batch = 0 + call k_generation % clear() + call entropy % clear() + need_depletion_rx = .false. + ! If this is a restart run, load the state point data and binary source ! file if (restart_run) then @@ -452,12 +459,6 @@ contains end if end if - ! Reset global variables - current_batch = 0 - call k_generation % clear() - call entropy % clear() - need_depletion_rx = .false. - ! Set flag indicating initialization is done simulation_initialized = .true. From 4298c50c3fdf2796b0d6020b00889b8c1db691d9 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 9 Feb 2018 09:28:09 -0600 Subject: [PATCH 008/231] Use numpy 1.13 when testing since float formatting changed in 1.14 --- tools/ci/travis-install.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/ci/travis-install.sh b/tools/ci/travis-install.sh index 3efadd6f36..4921534db9 100755 --- a/tools/ci/travis-install.sh +++ b/tools/ci/travis-install.sh @@ -4,8 +4,11 @@ set -ex # Install NJOY 2016 ./tools/ci/travis-install-njoy.sh -# Running OpenMC's setup.py requires numpy/cython already -pip install numpy cython +# Running OpenMC's setup.py requires numpy/cython already. NumPy float +# formatting changed in version 1.14, so stick with a lower version until we can +# handle it in our test suite +pip install 'numpy<1.14' +pip install cython # pytest installed by default -- make sure we get latest pip install --upgrade pytest From 563b1658919c43409e99c9618b3860d9efe54714 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Fri, 9 Feb 2018 18:56:39 -0500 Subject: [PATCH 009/231] Adjusted indentation --- src/physics.F90 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/physics.F90 b/src/physics.F90 index 721e3dd6c1..53a2cc2320 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -392,13 +392,13 @@ contains end if associate (rx => nuc % reactions(i), & - xs => nuc % reactions(i) % xs(i_temp)) - ! if energy is below threshold for this reaction, skip it - if (i_grid < xs % threshold) cycle + xs => nuc % reactions(i) % xs(i_temp)) + ! if energy is below threshold for this reaction, skip it + if (i_grid < xs % threshold) cycle - ! add to cumulative probability - prob = prob + ((ONE - f)*xs % value(i_grid - xs % threshold + 1) & - + f*(xs % value(i_grid - xs % threshold + 2))) + ! add to cumulative probability + prob = prob + ((ONE - f)*xs % value(i_grid - xs % threshold + 1) & + + f*(xs % value(i_grid - xs % threshold + 2))) end associate end do From bb4ac5a7b2365983bca8250d97d151426b7cbedb Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Sat, 10 Feb 2018 01:04:45 -0500 Subject: [PATCH 010/231] Add IAPWS water density data --- openmc/data/data.py | 107 +++++++++++++++++++++++++++++ tests/unit_tests/test_data_misc.py | 10 +++ 2 files changed, 117 insertions(+) diff --git a/openmc/data/data.py b/openmc/data/data.py index ded6870188..8c0ed63728 100644 --- a/openmc/data/data.py +++ b/openmc/data/data.py @@ -1,6 +1,9 @@ import itertools import os import re +from warnings import warn + +from numpy import sqrt # Isotopic abundances from Meija J, Coplen T B, et al, "Isotopic compositions @@ -208,6 +211,110 @@ def atomic_weight(element): return None if weight == 0. else weight +def water_density(temperature, pressure=0.1013): + """Return the density of liquid water at a given temperature and pressure. + + The density is calculated from a polynomial fit using equations and values + from the 2012 version of the IAPWS-IF97 formulation. Only the equations + for region 1 are implemented here. + + Results are invalid for water vapor; pressures above 100 [MPa]; and + temperatures below 273.15 [K], above 623.15 [K], or above saturation. + + Reference: International Association for the Properties of Water and Steam, + "Revised Release on the IAPWS Industrial Formulation 1997 for the + Thermodynamic Properties of Water and Steam", IAPWS R7-97(2012). + + Parameters + ---------- + temperature : float + Water temperature in units of [K] + pressure : float + Water pressure in units of [MPa] + + Returns + ------- + float + Water density in units of [g / cm^3] + + """ + + # Make sure the temperature and pressure are inside the min/max region 1 + # bounds. (Relax the 273.15 bound to 273 in case a user wants 0 deg C data + # but they only use 3 digits for their conversion to K.) + if pressure > 100.0: + warn("Results are not valid for pressures above 100 MPa.") + if pressure < 0.0: + warn("Results are not valid for pressures below zero.") + if temperature < 273: + warn("Results are not valid for temperatures below 273.15 K.") + if temperature > 623.15: + warn("Results are not valid for temperatures above 623.15 K.") + + # IAPWS region 4 parameters + _n4 = [0.11670521452767e4, -0.72421316703206e6, -0.17073846940092e2, + 0.12020824702470e5, -0.32325550322333e7, 0.14915108613530e2, + -0.48232657361591e4, 0.40511340542057e6, -0.23855557567849, + 0.65017534844798e3] + + # Compute the saturation temperature at the given pressure. + beta = pressure**(0.25) + E = beta**2 + _n4[2] * beta + _n4[5] + F = _n4[0] * beta**2 + _n4[3] * beta + _n4[6] + G = _n4[1] * beta**2 + _n4[4] * beta + _n4[7] + D = 2.0 * G / (-F - sqrt(F**2 - 4 * E * G)) + T_sat = 0.5 * (_n4[9] + D + - sqrt((_n4[9] + D)**2 - 4.0 * (_n4[8] + _n4[9] * D))) + + # Make sure we aren't above saturation. (Relax this bound by .2 degrees + # for deg C to K conversions.) + if temperature > T_sat + 0.2: + warn("Results are not valid for temperatures above saturation " + "(above the boiling point).") + + # IAPWS region 1 parameters + R_GAS_CONSTANT = 0.461526 # kJ / kg / K + _ref_p = 16.53 # MPa + _ref_T = 1386 # K + _n1f = [0.14632971213167, -0.84548187169114, -0.37563603672040e1, + 0.33855169168385e1, -0.95791963387872, 0.15772038513228, + -0.16616417199501e-1, 0.81214629983568e-3, 0.28319080123804e-3, + -0.60706301565874e-3, -0.18990068218419e-1, -0.32529748770505e-1, + -0.21841717175414e-1, -0.52838357969930e-4, -0.47184321073267e-3, + -0.30001780793026e-3, 0.47661393906987e-4, -0.44141845330846e-5, + -0.72694996297594e-15, -0.31679644845054e-4, -0.28270797985312e-5, + -0.85205128120103e-9, -0.22425281908000e-5, -0.65171222895601e-6, + -0.14341729937924e-12, -0.40516996860117e-6, -0.12734301741641e-8, + -0.17424871230634e-9, -0.68762131295531e-18, 0.14478307828521e-19, + 0.26335781662795e-22, -0.11947622640071e-22, 0.18228094581404e-23, + -0.93537087292458e-25] + _I1f = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 4, + 4, 4, 5, 8, 8, 21, 23, 29, 30, 31, 32] + _J1f = [-2, -1, 0, 1, 2, 3, 4, 5, -9, -7, -1, 0, 1, 3, -3, 0, 1, 3, 17, -4, + 0, 6, -5, -2, 10, -8, -11, -6, -29, -31, -38, -39, -40, -41] + + # Nondimensionalize the pressure and temperature. + pi = pressure / _ref_p + tau = _ref_T / temperature + + # Compute the derivative of gamma (dimensionless Gibbs free energy) with + # respect to pi. + gamma1_pi = 0.0 + for i in range(34): + gamma1_pi -= (_n1f[i] * _I1f[i] * (7.1 - pi)**(_I1f[i] - 1) + * (tau - 1.222)**_J1f[i]) + + # Compute the leading coefficient. This sets the units at + # 1 [MPa] * [kg K / kJ] / [1 / K] + # = 1e6 [N / m^2] * 1e-3 [kg K / N / m] * [1 / K] + # = 1e3 [kg / m^3] + # = 1 [g / cm^3] + coeff = pressure / R_GAS_CONSTANT / temperature + + # Compute and return the density. + return coeff / pi / gamma1_pi + + # Values here are from the Committee on Data for Science and Technology # (CODATA) 2014 recommendation (doi:10.1103/RevModPhys.88.035009). diff --git a/tests/unit_tests/test_data_misc.py b/tests/unit_tests/test_data_misc.py index aeeb04c0fb..b33ef996fe 100644 --- a/tests/unit_tests/test_data_misc.py +++ b/tests/unit_tests/test_data_misc.py @@ -48,3 +48,13 @@ def test_thin(): x_thin, y_thin = openmc.data.thin(x, y) f = openmc.data.Tabulated1D(x_thin, y_thin) assert f(1.0) == pytest.approx(np.sin(1.0), 0.001) + + +def test_water_density(): + dens = openmc.data.water_density + # These test values are from IAPWS R7-97(2012). They are actually specific + # volumes so they need to be inverted. They also need to be divided by 1000 + # to convert from [kg / m^3] to [g / cm^2]. + assert dens(300.0, 3.0) == pytest.approx(1e-3/0.100215168e-2, 1e-6) + assert dens(300.0, 80.0) == pytest.approx(1e-3/0.971180894e-3, 1e-6) + assert dens(500.0, 3.0) == pytest.approx(1e-3/0.120241800e-2, 1e-6) From a06190ee407c14fd7a82cd0edf2fd89ce7e956d1 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Sat, 10 Feb 2018 02:23:50 -0500 Subject: [PATCH 011/231] Add convenience function for boric acid Materials --- openmc/material.py | 70 +++++++++++++++++++++++++++++++ tests/unit_tests/test_material.py | 18 ++++++++ 2 files changed, 88 insertions(+) diff --git a/openmc/material.py b/openmc/material.py index e409d6536c..32b7d3a80d 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -973,3 +973,73 @@ class Materials(cv.CheckedList): # Write the XML Tree to the materials.xml file tree = ET.ElementTree(root_element) tree.write(path, xml_declaration=True, encoding='utf-8') + + +def make_boric_acid(boron_ppm, temperature=293., pressure=0.1013, density=None, + **kwargs): + """Return a Material with the composition of boric acid. + + The water density can either be given directly, or it can be determined from + a temperature and pressure. + + Parameters + ---------- + boron_ppm : float + The weight fraction in parts-per-million of elemental boron in the acid. + temperature : float + Water temperature in [K] used to compute water density. + pressure : float + Water pressure in [MPa] used to compute water density. + density : float + Water density in [g / cm^3]. If specified, this value overrides the + temperature and pressure arguments. + **kwargs + All keyword arguments are passed to the created Material object. + + Returns + ------- + openmc.Material + + """ + # Set the density of water, either from an explicitly given density or from + # temperature and pressure. + if density is not None: + water_density = density + else: + water_density = openmc.data.water_density(temperature, pressure) + + # Compute the density of the boric acid. + acid_density = water_density / (1 - boron_ppm * 1e-6) + + # Compute the molar mass of pure water. + hydrogen = openmc.Element('H') + oxygen = openmc.Element('O') + M_H2O = 0.0 + for iso_name, frac, junk in hydrogen.expand(2.0, 'ao'): + M_H2O += frac * openmc.data.atomic_mass(iso_name) + for iso_name, frac, junk in oxygen.expand(1.0, 'ao'): + M_H2O += frac * openmc.data.atomic_mass(iso_name) + + # Compute the molar mass of boron. + boron = openmc.Element('B') + M_B = 0.0 + for iso_name, frac, junk in boron.expand(1.0, 'ao'): + M_B += frac * openmc.data.atomic_mass(iso_name) + + # Compute the number fractions of each element. + frac_H2O = (1 - boron_ppm * 1e-6) / M_H2O + frac_H = 2 * frac_H2O + frac_O = frac_H2O + frac_B = boron_ppm * 1e-6 / M_B + + # Build the material. + if density is None: + out = openmc.Material(temperature=temperature, **kwargs) + else: + out = openmc.Material(**kwargs) + out.add_element('H', frac_H, 'ao') + out.add_element('O', frac_O, 'ao') + out.add_element('B', frac_B, 'ao') + out.set_density('g/cc', acid_density) + out.add_s_alpha_beta('c_H_in_H2O') + return out diff --git a/tests/unit_tests/test_material.py b/tests/unit_tests/test_material.py index e92a2ac088..38495cb1ab 100644 --- a/tests/unit_tests/test_material.py +++ b/tests/unit_tests/test_material.py @@ -139,3 +139,21 @@ def test_materials(run_in_tmpdir): mats.cross_sections = '/some/fake/cross_sections.xml' mats.multipole_library = '/some/awesome/mp_lib/' mats.export_to_xml() + + +def test_boric_acid(): + # Test against reference values from the BEAVRS benchmark. + m = openmc.make_boric_acid(975, 566.5, 15.51, material_id=50) + assert m.density == pytest.approx(0.7405, 1e-3) + assert m.temperature == pytest.approx(566.5) + assert m._sab[0][0] == 'c_H_in_H2O' + ref_dens = {'B10':8.0023e-06, 'B11':3.2210e-05, 'H1':4.9458e-02, + 'O16':2.4672e-02} + nuc_dens = m.get_nuclide_atom_densities() + for nuclide in ref_dens: + assert nuc_dens[nuclide][1] == pytest.approx(ref_dens[nuclide], 1e-2) + assert m.id == 50 + + # Make sure the density override works + m = openmc.make_boric_acid(975, 566.5, 15.51, 0.9) + assert m.density == pytest.approx(0.9, 1e-3) From 9c53c085d6b81125f8cd3835ee40c2fc7f207f63 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Sun, 11 Feb 2018 15:01:51 -0500 Subject: [PATCH 012/231] Change boric_acid to borated_water; add more units --- openmc/data/data.py | 7 +-- openmc/material.py | 70 ----------------------- openmc/model/funcs.py | 95 +++++++++++++++++++++++++++++++ tests/unit_tests/test_material.py | 16 ++++-- 4 files changed, 110 insertions(+), 78 deletions(-) diff --git a/openmc/data/data.py b/openmc/data/data.py index 8c0ed63728..45a4406dbe 100644 --- a/openmc/data/data.py +++ b/openmc/data/data.py @@ -216,10 +216,9 @@ def water_density(temperature, pressure=0.1013): The density is calculated from a polynomial fit using equations and values from the 2012 version of the IAPWS-IF97 formulation. Only the equations - for region 1 are implemented here. - - Results are invalid for water vapor; pressures above 100 [MPa]; and - temperatures below 273.15 [K], above 623.15 [K], or above saturation. + for region 1 are implemented here. Region 1 is limited to liquid water + below 100 [MPa] with a temperature above 273.15 [K], below 623.15 [K], and + below saturation. Reference: International Association for the Properties of Water and Steam, "Revised Release on the IAPWS Industrial Formulation 1997 for the diff --git a/openmc/material.py b/openmc/material.py index 32b7d3a80d..e409d6536c 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -973,73 +973,3 @@ class Materials(cv.CheckedList): # Write the XML Tree to the materials.xml file tree = ET.ElementTree(root_element) tree.write(path, xml_declaration=True, encoding='utf-8') - - -def make_boric_acid(boron_ppm, temperature=293., pressure=0.1013, density=None, - **kwargs): - """Return a Material with the composition of boric acid. - - The water density can either be given directly, or it can be determined from - a temperature and pressure. - - Parameters - ---------- - boron_ppm : float - The weight fraction in parts-per-million of elemental boron in the acid. - temperature : float - Water temperature in [K] used to compute water density. - pressure : float - Water pressure in [MPa] used to compute water density. - density : float - Water density in [g / cm^3]. If specified, this value overrides the - temperature and pressure arguments. - **kwargs - All keyword arguments are passed to the created Material object. - - Returns - ------- - openmc.Material - - """ - # Set the density of water, either from an explicitly given density or from - # temperature and pressure. - if density is not None: - water_density = density - else: - water_density = openmc.data.water_density(temperature, pressure) - - # Compute the density of the boric acid. - acid_density = water_density / (1 - boron_ppm * 1e-6) - - # Compute the molar mass of pure water. - hydrogen = openmc.Element('H') - oxygen = openmc.Element('O') - M_H2O = 0.0 - for iso_name, frac, junk in hydrogen.expand(2.0, 'ao'): - M_H2O += frac * openmc.data.atomic_mass(iso_name) - for iso_name, frac, junk in oxygen.expand(1.0, 'ao'): - M_H2O += frac * openmc.data.atomic_mass(iso_name) - - # Compute the molar mass of boron. - boron = openmc.Element('B') - M_B = 0.0 - for iso_name, frac, junk in boron.expand(1.0, 'ao'): - M_B += frac * openmc.data.atomic_mass(iso_name) - - # Compute the number fractions of each element. - frac_H2O = (1 - boron_ppm * 1e-6) / M_H2O - frac_H = 2 * frac_H2O - frac_O = frac_H2O - frac_B = boron_ppm * 1e-6 / M_B - - # Build the material. - if density is None: - out = openmc.Material(temperature=temperature, **kwargs) - else: - out = openmc.Material(**kwargs) - out.add_element('H', frac_H, 'ao') - out.add_element('O', frac_O, 'ao') - out.add_element('B', frac_B, 'ao') - out.set_density('g/cc', acid_density) - out.add_s_alpha_beta('c_H_in_H2O') - return out diff --git a/openmc/model/funcs.py b/openmc/model/funcs.py index 6013f6caee..b8984ada03 100644 --- a/openmc/model/funcs.py +++ b/openmc/model/funcs.py @@ -5,6 +5,7 @@ from numbers import Real from openmc import XPlane, YPlane, Plane, ZCylinder from openmc.checkvalue import check_type, check_value +import openmc.data def get_rectangular_prism(width, height, axis='z', origin=(0., 0.), @@ -252,6 +253,100 @@ def get_hexagonal_prism(edge_length=1., orientation='y', origin=(0., 0.), return prism +def make_borated_water(boron_ppm, temperature=293., pressure=0.1013, + temp_unit='K', press_unit='MPa', density=None, **kwargs): + """Return a Material with the composition of boron dissolved in water. + + The water density can be determined from a temperature and pressure, or it + can be set directly. + + The concentration of boron has no effect on the stoichometric ratio of H + and O---they are fixed at 2-1. + + Parameters + ---------- + boron_ppm : float + The weight fraction in parts-per-million of elemental boron in the + water. + temperature : float + Temperature in [K] used to compute water density. + pressure : float + Pressure in [MPa] used to compute water density. + temp_unit : str + The units used for the `temperature` argument. Valid units are 'K', + 'C', and 'F'. + press_unit : str + The units used for the `pressure` argument. Valid units are 'MPa' and + 'psi'. + density : float + Water density in [g / cm^3]. If specified, this value overrides the + temperature and pressure arguments. + **kwargs + All keyword arguments are passed to the created Material object. + + Returns + ------- + openmc.Material + + """ + # Perform any necessary unit conversions. + check_value('temperature unit', temp_unit, ('K', 'C', 'F')) + if temp_unit == 'K': + T = temperature + elif temp_unit == 'C': + T = temperature + 273.15 + elif temp_unit == 'F': + T = (temperature + 459.67) * 5.0 / 9.0 + check_value('pressure unit', press_unit, ('MPa', 'psi')) + if press_unit == 'MPa': + P = pressure + elif press_unit == 'psi': + P = pressure * 0.006895 + + # Set the density of water, either from an explicitly given density or from + # temperature and pressure. + if density is not None: + water_density = density + else: + water_density = openmc.data.water_density(T, P) + + # Compute the density of the solution. + solution_density = water_density / (1 - boron_ppm * 1e-6) + + # Compute the molar mass of pure water. + hydrogen = openmc.Element('H') + oxygen = openmc.Element('O') + M_H2O = 0.0 + for iso_name, frac, junk in hydrogen.expand(2.0, 'ao'): + M_H2O += frac * openmc.data.atomic_mass(iso_name) + for iso_name, frac, junk in oxygen.expand(1.0, 'ao'): + M_H2O += frac * openmc.data.atomic_mass(iso_name) + + # Compute the molar mass of boron. + boron = openmc.Element('B') + M_B = 0.0 + for iso_name, frac, junk in boron.expand(1.0, 'ao'): + M_B += frac * openmc.data.atomic_mass(iso_name) + + # Compute the number fractions of each element. + frac_H2O = (1 - boron_ppm * 1e-6) / M_H2O + frac_H = 2 * frac_H2O + frac_O = frac_H2O + frac_B = boron_ppm * 1e-6 / M_B + + # Build the material. + if density is None: + out = openmc.Material(temperature=T, **kwargs) + else: + out = openmc.Material(**kwargs) + out.add_element('H', frac_H, 'ao') + out.add_element('O', frac_O, 'ao') + out.add_element('B', frac_B, 'ao') + out.set_density('g/cc', solution_density) + out.add_s_alpha_beta('c_H_in_H2O') + return out + + def subdivide(surfaces): """Create regions separated by a series of surfaces. diff --git a/tests/unit_tests/test_material.py b/tests/unit_tests/test_material.py index 38495cb1ab..295153a9c1 100644 --- a/tests/unit_tests/test_material.py +++ b/tests/unit_tests/test_material.py @@ -141,9 +141,9 @@ def test_materials(run_in_tmpdir): mats.export_to_xml() -def test_boric_acid(): +def test_borated_water(): # Test against reference values from the BEAVRS benchmark. - m = openmc.make_boric_acid(975, 566.5, 15.51, material_id=50) + m = openmc.model.make_borated_water(975, 566.5, 15.51, material_id=50) assert m.density == pytest.approx(0.7405, 1e-3) assert m.temperature == pytest.approx(566.5) assert m._sab[0][0] == 'c_H_in_H2O' @@ -154,6 +154,14 @@ def test_boric_acid(): assert nuc_dens[nuclide][1] == pytest.approx(ref_dens[nuclide], 1e-2) assert m.id == 50 - # Make sure the density override works - m = openmc.make_boric_acid(975, 566.5, 15.51, 0.9) + # Test the Celsius conversion. + m = openmc.model.make_borated_water(975, 293.35, 15.51, 'C') + assert m.density == pytest.approx(0.7405, 1e-3) + + # Test Fahrenheit and psi conversions. + m = openmc.model.make_borated_water(975, 560.0, 2250.0, 'F', 'psi') + assert m.density == pytest.approx(0.7405, 1e-3) + + # Test the density override + m = openmc.model.make_borated_water(975, 566.5, 15.51, density=0.9) assert m.density == pytest.approx(0.9, 1e-3) From e0d6640c4fb43edf3213efe62c05c1106575c5d9 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Sun, 11 Feb 2018 15:03:48 -0500 Subject: [PATCH 013/231] Add make_borated_water and water_density to docs --- docs/source/pythonapi/data.rst | 1 + docs/source/pythonapi/model.rst | 6 +----- tests/unit_tests/test_data_misc.py | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/source/pythonapi/data.rst b/docs/source/pythonapi/data.rst index 7f75ddaaaf..3c221906db 100644 --- a/docs/source/pythonapi/data.rst +++ b/docs/source/pythonapi/data.rst @@ -34,6 +34,7 @@ Core Functions openmc.data.atomic_mass openmc.data.linearize openmc.data.thin + openmc.data.water_density openmc.data.write_compact_458_library Angle-Energy Distributions diff --git a/docs/source/pythonapi/model.rst b/docs/source/pythonapi/model.rst index 4ba247468a..6aff6d4c25 100644 --- a/docs/source/pythonapi/model.rst +++ b/docs/source/pythonapi/model.rst @@ -5,11 +5,6 @@ Convenience Functions --------------------- -Several helper functions are available here. Ther first two create rectangular -and hexagonal prisms defined by the intersection of four and six surface -half-spaces, respectively. The last function takes a sequence of surfaces and -returns the regions that separate them. - .. autosummary:: :toctree: generated :nosignatures: @@ -17,6 +12,7 @@ returns the regions that separate them. openmc.model.get_hexagonal_prism openmc.model.get_rectangular_prism + openmc.model.make_borated_water openmc.model.subdivide TRISO Fuel Modeling diff --git a/tests/unit_tests/test_data_misc.py b/tests/unit_tests/test_data_misc.py index b33ef996fe..433d34adb9 100644 --- a/tests/unit_tests/test_data_misc.py +++ b/tests/unit_tests/test_data_misc.py @@ -54,7 +54,7 @@ def test_water_density(): dens = openmc.data.water_density # These test values are from IAPWS R7-97(2012). They are actually specific # volumes so they need to be inverted. They also need to be divided by 1000 - # to convert from [kg / m^3] to [g / cm^2]. + # to convert from [kg / m^3] to [g / cm^3]. assert dens(300.0, 3.0) == pytest.approx(1e-3/0.100215168e-2, 1e-6) assert dens(300.0, 80.0) == pytest.approx(1e-3/0.971180894e-3, 1e-6) assert dens(500.0, 3.0) == pytest.approx(1e-3/0.120241800e-2, 1e-6) From d34bdf9b98bd2c06da5e5282d9516cce041be4cc Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Sun, 11 Feb 2018 18:39:06 -0500 Subject: [PATCH 014/231] Address #967 comments --- docs/source/pythonapi/model.rst | 2 +- openmc/data/data.py | 65 +++++------ openmc/model/funcs.py | 186 +++++++++++++++--------------- tests/unit_tests/test_material.py | 8 +- 4 files changed, 129 insertions(+), 132 deletions(-) diff --git a/docs/source/pythonapi/model.rst b/docs/source/pythonapi/model.rst index 6aff6d4c25..9ed77f3666 100644 --- a/docs/source/pythonapi/model.rst +++ b/docs/source/pythonapi/model.rst @@ -10,9 +10,9 @@ Convenience Functions :nosignatures: :template: myfunction.rst + openmc.model.borated_water openmc.model.get_hexagonal_prism openmc.model.get_rectangular_prism - openmc.model.make_borated_water openmc.model.subdivide TRISO Fuel Modeling diff --git a/openmc/data/data.py b/openmc/data/data.py index 45a4406dbe..a7c0e536f6 100644 --- a/openmc/data/data.py +++ b/openmc/data/data.py @@ -251,19 +251,19 @@ def water_density(temperature, pressure=0.1013): warn("Results are not valid for temperatures above 623.15 K.") # IAPWS region 4 parameters - _n4 = [0.11670521452767e4, -0.72421316703206e6, -0.17073846940092e2, - 0.12020824702470e5, -0.32325550322333e7, 0.14915108613530e2, - -0.48232657361591e4, 0.40511340542057e6, -0.23855557567849, - 0.65017534844798e3] + n4 = [0.11670521452767e4, -0.72421316703206e6, -0.17073846940092e2, + 0.12020824702470e5, -0.32325550322333e7, 0.14915108613530e2, + -0.48232657361591e4, 0.40511340542057e6, -0.23855557567849, + 0.65017534844798e3] # Compute the saturation temperature at the given pressure. beta = pressure**(0.25) - E = beta**2 + _n4[2] * beta + _n4[5] - F = _n4[0] * beta**2 + _n4[3] * beta + _n4[6] - G = _n4[1] * beta**2 + _n4[4] * beta + _n4[7] + E = beta**2 + n4[2] * beta + n4[5] + F = n4[0] * beta**2 + n4[3] * beta + n4[6] + G = n4[1] * beta**2 + n4[4] * beta + n4[7] D = 2.0 * G / (-F - sqrt(F**2 - 4 * E * G)) - T_sat = 0.5 * (_n4[9] + D - - sqrt((_n4[9] + D)**2 - 4.0 * (_n4[8] + _n4[9] * D))) + T_sat = 0.5 * (n4[9] + D + - sqrt((n4[9] + D)**2 - 4.0 * (n4[8] + n4[9] * D))) # Make sure we aren't above saturation. (Relax this bound by .2 degrees # for deg C to K conversions.) @@ -273,38 +273,37 @@ def water_density(temperature, pressure=0.1013): # IAPWS region 1 parameters R_GAS_CONSTANT = 0.461526 # kJ / kg / K - _ref_p = 16.53 # MPa - _ref_T = 1386 # K - _n1f = [0.14632971213167, -0.84548187169114, -0.37563603672040e1, - 0.33855169168385e1, -0.95791963387872, 0.15772038513228, - -0.16616417199501e-1, 0.81214629983568e-3, 0.28319080123804e-3, - -0.60706301565874e-3, -0.18990068218419e-1, -0.32529748770505e-1, - -0.21841717175414e-1, -0.52838357969930e-4, -0.47184321073267e-3, - -0.30001780793026e-3, 0.47661393906987e-4, -0.44141845330846e-5, - -0.72694996297594e-15, -0.31679644845054e-4, -0.28270797985312e-5, - -0.85205128120103e-9, -0.22425281908000e-5, -0.65171222895601e-6, - -0.14341729937924e-12, -0.40516996860117e-6, -0.12734301741641e-8, - -0.17424871230634e-9, -0.68762131295531e-18, 0.14478307828521e-19, - 0.26335781662795e-22, -0.11947622640071e-22, 0.18228094581404e-23, - -0.93537087292458e-25] - _I1f = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 4, - 4, 4, 5, 8, 8, 21, 23, 29, 30, 31, 32] - _J1f = [-2, -1, 0, 1, 2, 3, 4, 5, -9, -7, -1, 0, 1, 3, -3, 0, 1, 3, 17, -4, - 0, 6, -5, -2, 10, -8, -11, -6, -29, -31, -38, -39, -40, -41] + ref_p = 16.53 # MPa + ref_T = 1386 # K + n1f = [0.14632971213167, -0.84548187169114, -0.37563603672040e1, + 0.33855169168385e1, -0.95791963387872, 0.15772038513228, + -0.16616417199501e-1, 0.81214629983568e-3, 0.28319080123804e-3, + -0.60706301565874e-3, -0.18990068218419e-1, -0.32529748770505e-1, + -0.21841717175414e-1, -0.52838357969930e-4, -0.47184321073267e-3, + -0.30001780793026e-3, 0.47661393906987e-4, -0.44141845330846e-5, + -0.72694996297594e-15, -0.31679644845054e-4, -0.28270797985312e-5, + -0.85205128120103e-9, -0.22425281908000e-5, -0.65171222895601e-6, + -0.14341729937924e-12, -0.40516996860117e-6, -0.12734301741641e-8, + -0.17424871230634e-9, -0.68762131295531e-18, 0.14478307828521e-19, + 0.26335781662795e-22, -0.11947622640071e-22, 0.18228094581404e-23, + -0.93537087292458e-25] + I1f = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 4, + 4, 4, 5, 8, 8, 21, 23, 29, 30, 31, 32] + J1f = [-2, -1, 0, 1, 2, 3, 4, 5, -9, -7, -1, 0, 1, 3, -3, 0, 1, 3, 17, -4, + 0, 6, -5, -2, 10, -8, -11, -6, -29, -31, -38, -39, -40, -41] # Nondimensionalize the pressure and temperature. - pi = pressure / _ref_p - tau = _ref_T / temperature + pi = pressure / ref_p + tau = ref_T / temperature # Compute the derivative of gamma (dimensionless Gibbs free energy) with # respect to pi. gamma1_pi = 0.0 - for i in range(34): - gamma1_pi -= (_n1f[i] * _I1f[i] * (7.1 - pi)**(_I1f[i] - 1) - * (tau - 1.222)**_J1f[i]) + for n, I, J in zip(n1f, I1f, J1f): + gamma1_pi -= n * I * (7.1 - pi)**(I - 1) * (tau - 1.222)**J # Compute the leading coefficient. This sets the units at - # 1 [MPa] * [kg K / kJ] / [1 / K] + # 1 [MPa] * [kg K / kJ] * [1 / K] # = 1e6 [N / m^2] * 1e-3 [kg K / N / m] * [1 / K] # = 1e3 [kg / m^3] # = 1 [g / cm^3] diff --git a/openmc/model/funcs.py b/openmc/model/funcs.py index b8984ada03..e974f93b1b 100644 --- a/openmc/model/funcs.py +++ b/openmc/model/funcs.py @@ -8,6 +8,98 @@ from openmc.checkvalue import check_type, check_value import openmc.data +def borated_water(boron_ppm, temperature=293., pressure=0.1013, temp_unit='K', + press_unit='MPa', density=None, **kwargs): + """Return a Material with the composition of boron dissolved in water. + + The water density can be determined from a temperature and pressure, or it + can be set directly. + + The concentration of boron has no effect on the stoichiometric ratio of H + and O---they are fixed at 2-1. + + Parameters + ---------- + boron_ppm : float + The weight fraction in parts-per-million of elemental boron in the + water. + temperature : float + Temperature in [K] used to compute water density. + pressure : float + Pressure in [MPa] used to compute water density. + temp_unit : {'K', 'C', 'F'} + The units used for the `temperature` argument. + press_unit : {'MPa', 'psi'} + The units used for the `pressure` argument. + density : float + Water density in [g / cm^3]. If specified, this value overrides the + temperature and pressure arguments. + **kwargs + All keyword arguments are passed to the created Material object. + + Returns + ------- + openmc.Material + + """ + # Perform any necessary unit conversions. + check_value('temperature unit', temp_unit, ('K', 'C', 'F')) + if temp_unit == 'K': + T = temperature + elif temp_unit == 'C': + T = temperature + 273.15 + elif temp_unit == 'F': + T = (temperature + 459.67) * 5.0 / 9.0 + check_value('pressure unit', press_unit, ('MPa', 'psi')) + if press_unit == 'MPa': + P = pressure + elif press_unit == 'psi': + P = pressure * 0.006895 + + # Set the density of water, either from an explicitly given density or from + # temperature and pressure. + if density is not None: + water_density = density + else: + water_density = openmc.data.water_density(T, P) + + # Compute the density of the solution. + solution_density = water_density / (1 - boron_ppm * 1e-6) + + # Compute the molar mass of pure water. + hydrogen = openmc.Element('H') + oxygen = openmc.Element('O') + M_H2O = 0.0 + for iso_name, frac, junk in hydrogen.expand(2.0, 'ao'): + M_H2O += frac * openmc.data.atomic_mass(iso_name) + for iso_name, frac, junk in oxygen.expand(1.0, 'ao'): + M_H2O += frac * openmc.data.atomic_mass(iso_name) + + # Compute the molar mass of boron. + boron = openmc.Element('B') + M_B = 0.0 + for iso_name, frac, junk in boron.expand(1.0, 'ao'): + M_B += frac * openmc.data.atomic_mass(iso_name) + + # Compute the number fractions of each element. + frac_H2O = (1 - boron_ppm * 1e-6) / M_H2O + frac_H = 2 * frac_H2O + frac_O = frac_H2O + frac_B = boron_ppm * 1e-6 / M_B + + # Build the material. + if density is None: + out = openmc.Material(temperature=T, **kwargs) + else: + out = openmc.Material(**kwargs) + out.add_element('H', frac_H, 'ao') + out.add_element('O', frac_O, 'ao') + out.add_element('B', frac_B, 'ao') + out.set_density('g/cc', solution_density) + out.add_s_alpha_beta('c_H_in_H2O') + return out + + def get_rectangular_prism(width, height, axis='z', origin=(0., 0.), boundary_type='transmission', corner_radius=0.): """Get an infinite rectangular prism from four planar surfaces. @@ -253,100 +345,6 @@ def get_hexagonal_prism(edge_length=1., orientation='y', origin=(0., 0.), return prism -def make_borated_water(boron_ppm, temperature=293., pressure=0.1013, - temp_unit='K', press_unit='MPa', density=None, **kwargs): - """Return a Material with the composition of boron dissolved in water. - - The water density can be determined from a temperature and pressure, or it - can be set directly. - - The concentration of boron has no effect on the stoichometric ratio of H - and O---they are fixed at 2-1. - - Parameters - ---------- - boron_ppm : float - The weight fraction in parts-per-million of elemental boron in the - water. - temperature : float - Temperature in [K] used to compute water density. - pressure : float - Pressure in [MPa] used to compute water density. - temp_unit : str - The units used for the `temperature` argument. Valid units are 'K', - 'C', and 'F'. - press_unit : str - The units used for the `pressure` argument. Valid units are 'MPa' and - 'psi'. - density : float - Water density in [g / cm^3]. If specified, this value overrides the - temperature and pressure arguments. - **kwargs - All keyword arguments are passed to the created Material object. - - Returns - ------- - openmc.Material - - """ - # Perform any necessary unit conversions. - check_value('temperature unit', temp_unit, ('K', 'C', 'F')) - if temp_unit == 'K': - T = temperature - elif temp_unit == 'C': - T = temperature + 273.15 - elif temp_unit == 'F': - T = (temperature + 459.67) * 5.0 / 9.0 - check_value('pressure unit', press_unit, ('MPa', 'psi')) - if press_unit == 'MPa': - P = pressure - elif press_unit == 'psi': - P = pressure * 0.006895 - - # Set the density of water, either from an explicitly given density or from - # temperature and pressure. - if density is not None: - water_density = density - else: - water_density = openmc.data.water_density(T, P) - - # Compute the density of the solution. - solution_density = water_density / (1 - boron_ppm * 1e-6) - - # Compute the molar mass of pure water. - hydrogen = openmc.Element('H') - oxygen = openmc.Element('O') - M_H2O = 0.0 - for iso_name, frac, junk in hydrogen.expand(2.0, 'ao'): - M_H2O += frac * openmc.data.atomic_mass(iso_name) - for iso_name, frac, junk in oxygen.expand(1.0, 'ao'): - M_H2O += frac * openmc.data.atomic_mass(iso_name) - - # Compute the molar mass of boron. - boron = openmc.Element('B') - M_B = 0.0 - for iso_name, frac, junk in boron.expand(1.0, 'ao'): - M_B += frac * openmc.data.atomic_mass(iso_name) - - # Compute the number fractions of each element. - frac_H2O = (1 - boron_ppm * 1e-6) / M_H2O - frac_H = 2 * frac_H2O - frac_O = frac_H2O - frac_B = boron_ppm * 1e-6 / M_B - - # Build the material. - if density is None: - out = openmc.Material(temperature=T, **kwargs) - else: - out = openmc.Material(**kwargs) - out.add_element('H', frac_H, 'ao') - out.add_element('O', frac_O, 'ao') - out.add_element('B', frac_B, 'ao') - out.set_density('g/cc', solution_density) - out.add_s_alpha_beta('c_H_in_H2O') - return out - - def subdivide(surfaces): """Create regions separated by a series of surfaces. diff --git a/tests/unit_tests/test_material.py b/tests/unit_tests/test_material.py index 295153a9c1..2265215417 100644 --- a/tests/unit_tests/test_material.py +++ b/tests/unit_tests/test_material.py @@ -143,7 +143,7 @@ def test_materials(run_in_tmpdir): def test_borated_water(): # Test against reference values from the BEAVRS benchmark. - m = openmc.model.make_borated_water(975, 566.5, 15.51, material_id=50) + m = openmc.model.borated_water(975, 566.5, 15.51, material_id=50) assert m.density == pytest.approx(0.7405, 1e-3) assert m.temperature == pytest.approx(566.5) assert m._sab[0][0] == 'c_H_in_H2O' @@ -155,13 +155,13 @@ def test_borated_water(): assert m.id == 50 # Test the Celsius conversion. - m = openmc.model.make_borated_water(975, 293.35, 15.51, 'C') + m = openmc.model.borated_water(975, 293.35, 15.51, 'C') assert m.density == pytest.approx(0.7405, 1e-3) # Test Fahrenheit and psi conversions. - m = openmc.model.make_borated_water(975, 560.0, 2250.0, 'F', 'psi') + m = openmc.model.borated_water(975, 560.0, 2250.0, 'F', 'psi') assert m.density == pytest.approx(0.7405, 1e-3) # Test the density override - m = openmc.model.make_borated_water(975, 566.5, 15.51, density=0.9) + m = openmc.model.borated_water(975, 566.5, 15.51, density=0.9) assert m.density == pytest.approx(0.9, 1e-3) From 718474fb494cf9db307594d1fff867cd7ed80b31 Mon Sep 17 00:00:00 2001 From: Adam Nelson Date: Tue, 13 Feb 2018 06:35:50 -0500 Subject: [PATCH 015/231] Cleaned up index_inelastic_scatter a bit to address comments in #963" --- src/nuclide_header.F90 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/nuclide_header.F90 b/src/nuclide_header.F90 index c0c5c2627d..8362f5d41e 100644 --- a/src/nuclide_header.F90 +++ b/src/nuclide_header.F90 @@ -303,7 +303,7 @@ contains real(8) :: temp_actual type(VectorInt) :: MTs type(VectorInt) :: temps_to_read - type(VectorInt) :: index_inelastic_scatter_vector + type(VectorInt) :: index_inelastic_scatter ! Get name of nuclide from group name_len = len(this % name) @@ -478,7 +478,7 @@ contains MTs % data(i) /= N_3NF .and. MTs % data(i) < 200 .and. & MTs % data(i) /= N_LEVEL .and. MTs % data(i) /= ELASTIC) then - call index_inelastic_scatter_vector % push_back(i) + call index_inelastic_scatter % push_back(i) end if call close_group(rx_group) @@ -486,10 +486,9 @@ contains call close_group(rxs_group) ! Recast to a regular array to save space - allocate(this % index_inelastic_scatter( & - index_inelastic_scatter_vector % size())) - this % index_inelastic_scatter = index_inelastic_scatter_vector % data(:) - call index_inelastic_scatter_vector % clear() + allocate(this % index_inelastic_scatter(index_inelastic_scatter % size())) + this % index_inelastic_scatter = & + index_inelastic_scatter % data(1: index_inelastic_scatter % size()) ! Read unresolved resonance probability tables if present if (object_exists(group_id, 'urr')) then From f8764416d2c727c5b1693c297c3f7994c8314d1b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 9 Feb 2018 13:29:04 -0600 Subject: [PATCH 016/231] Copy OpenDeplete files from commit 2d804c227a --- chains/chain_simple.xml | 49 + chains/chain_test.xml | 23 + docs/source/pythonapi/deplete/index.rst | 56 ++ .../pythonapi/deplete/integrator.CRAM16.rst | 6 + .../pythonapi/deplete/integrator.CRAM48.rst | 6 + .../pythonapi/deplete/integrator.cecm.rst | 6 + .../deplete/integrator.predictor.rst | 6 + .../deplete/integrator.save_results.rst | 6 + .../deplete/opendeplete.Concentrations.rst | 30 + .../deplete/opendeplete.ReactionRates.rst | 30 + .../pythonapi/deplete/opendeplete.Results.rst | 22 + openmc/deplete/__init__.py | 24 + openmc/deplete/atom_number.py | 236 +++++ openmc/deplete/depletion_chain.py | 472 ++++++++++ openmc/deplete/dummy_comm.py | 27 + openmc/deplete/function.py | 114 +++ openmc/deplete/integrator/__init__.py | 11 + openmc/deplete/integrator/cecm.py | 133 +++ openmc/deplete/integrator/cram.py | 185 ++++ openmc/deplete/integrator/predictor.py | 100 ++ openmc/deplete/integrator/save_results.py | 46 + openmc/deplete/nuclide.py | 178 ++++ openmc/deplete/openmc_wrapper.py | 853 ++++++++++++++++++ openmc/deplete/reaction_rates.py | 113 +++ openmc/deplete/results.py | 454 ++++++++++ openmc/deplete/utilities.py | 98 ++ scripts/example_geometry.py | 358 ++++++++ scripts/example_plot.py | 46 + scripts/example_run.py | 39 + scripts/make_chain.py | 60 ++ tests/deplete_tests/__init__.py | 0 tests/deplete_tests/dummy_geometry.py | 165 ++++ tests/deplete_tests/example_geometry.py | 1 + tests/deplete_tests/test_atom_number.py | 180 ++++ tests/deplete_tests/test_cecm_regression.py | 69 ++ tests/deplete_tests/test_cram.py | 48 + tests/deplete_tests/test_depletion_chain.py | 197 ++++ tests/deplete_tests/test_full.py | 119 +++ tests/deplete_tests/test_integrator.py | 116 +++ tests/deplete_tests/test_nuclide.py | 121 +++ .../test_predictor_regression.py | 68 ++ tests/deplete_tests/test_reaction_rates.py | 86 ++ tests/deplete_tests/test_reference.h5 | Bin 0 -> 165384 bytes tests/deplete_tests/test_utilities.py | 68 ++ 44 files changed, 5025 insertions(+) create mode 100644 chains/chain_simple.xml create mode 100644 chains/chain_test.xml create mode 100644 docs/source/pythonapi/deplete/index.rst create mode 100644 docs/source/pythonapi/deplete/integrator.CRAM16.rst create mode 100644 docs/source/pythonapi/deplete/integrator.CRAM48.rst create mode 100644 docs/source/pythonapi/deplete/integrator.cecm.rst create mode 100644 docs/source/pythonapi/deplete/integrator.predictor.rst create mode 100644 docs/source/pythonapi/deplete/integrator.save_results.rst create mode 100644 docs/source/pythonapi/deplete/opendeplete.Concentrations.rst create mode 100644 docs/source/pythonapi/deplete/opendeplete.ReactionRates.rst create mode 100644 docs/source/pythonapi/deplete/opendeplete.Results.rst create mode 100644 openmc/deplete/__init__.py create mode 100644 openmc/deplete/atom_number.py create mode 100644 openmc/deplete/depletion_chain.py create mode 100644 openmc/deplete/dummy_comm.py create mode 100644 openmc/deplete/function.py create mode 100644 openmc/deplete/integrator/__init__.py create mode 100644 openmc/deplete/integrator/cecm.py create mode 100644 openmc/deplete/integrator/cram.py create mode 100644 openmc/deplete/integrator/predictor.py create mode 100644 openmc/deplete/integrator/save_results.py create mode 100644 openmc/deplete/nuclide.py create mode 100644 openmc/deplete/openmc_wrapper.py create mode 100644 openmc/deplete/reaction_rates.py create mode 100644 openmc/deplete/results.py create mode 100644 openmc/deplete/utilities.py create mode 100644 scripts/example_geometry.py create mode 100644 scripts/example_plot.py create mode 100644 scripts/example_run.py create mode 100644 scripts/make_chain.py create mode 100644 tests/deplete_tests/__init__.py create mode 100644 tests/deplete_tests/dummy_geometry.py create mode 120000 tests/deplete_tests/example_geometry.py create mode 100644 tests/deplete_tests/test_atom_number.py create mode 100644 tests/deplete_tests/test_cecm_regression.py create mode 100644 tests/deplete_tests/test_cram.py create mode 100644 tests/deplete_tests/test_depletion_chain.py create mode 100644 tests/deplete_tests/test_full.py create mode 100644 tests/deplete_tests/test_integrator.py create mode 100644 tests/deplete_tests/test_nuclide.py create mode 100644 tests/deplete_tests/test_predictor_regression.py create mode 100644 tests/deplete_tests/test_reaction_rates.py create mode 100644 tests/deplete_tests/test_reference.h5 create mode 100644 tests/deplete_tests/test_utilities.py diff --git a/chains/chain_simple.xml b/chains/chain_simple.xml new file mode 100644 index 0000000000..345da2237d --- /dev/null +++ b/chains/chain_simple.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + 2.53000e-02 + + Gd157 Gd156 I135 Xe135 Xe136 Cs135 + 1.093250e-04 2.087260e-04 2.780820e-02 6.759540e-03 2.392300e-02 4.356330e-05 + + + + + + + 2.53000e-02 + + Gd157 Gd156 I135 Xe135 Xe136 Cs135 + 6.142710e-5 1.483250e-04 0.0292737 0.002566345 0.0219242 4.9097e-6 + + + + + + + 2.53000e-02 + + Gd157 Gd156 I135 Xe135 Xe136 Cs135 + 4.141120e-04 7.605360e-04 0.0135457 0.00026864 0.0024432 3.7100E-07 + + + + diff --git a/chains/chain_test.xml b/chains/chain_test.xml new file mode 100644 index 0000000000..5985704063 --- /dev/null +++ b/chains/chain_test.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + 0.0253 + + A B + 0.0292737 0.002566345 + + + + diff --git a/docs/source/pythonapi/deplete/index.rst b/docs/source/pythonapi/deplete/index.rst new file mode 100644 index 0000000000..55380c7a1c --- /dev/null +++ b/docs/source/pythonapi/deplete/index.rst @@ -0,0 +1,56 @@ +.. _api: + +================= +API Documentation +================= + +Integrators +----------- + +.. toctree:: + :maxdepth: 2 + + integrator.predictor + integrator.cecm + +Integrator Helper Functions +--------------------------- +.. toctree:: + :maxdepth: 2 + + integrator.CRAM16 + integrator.CRAM48 + integrator.save_results + +Metaclasses +----------- + +.. autosummary:: + :toctree: generated + :nosignatures: + + opendeplete.Settings + opendeplete.Operator + +OpenMC Classes +-------------- + +.. autosummary:: + :toctree: generated + :nosignatures: + + opendeplete.OpenMCSettings + opendeplete.Materials + opendeplete.OpenMCOperator + +Data Classes +------------ +.. autosummary:: + :toctree: generated + :nosignatures: + + opendeplete.AtomNumber + opendeplete.DepletionChain + opendeplete.Nuclide + opendeplete.ReactionRates + opendeplete.Results diff --git a/docs/source/pythonapi/deplete/integrator.CRAM16.rst b/docs/source/pythonapi/deplete/integrator.CRAM16.rst new file mode 100644 index 0000000000..f9eba273ed --- /dev/null +++ b/docs/source/pythonapi/deplete/integrator.CRAM16.rst @@ -0,0 +1,6 @@ +integrator\.CRAM16 +================== + +.. currentmodule:: opendeplete.integrator + +.. autofunction:: CRAM16 diff --git a/docs/source/pythonapi/deplete/integrator.CRAM48.rst b/docs/source/pythonapi/deplete/integrator.CRAM48.rst new file mode 100644 index 0000000000..d7467a418a --- /dev/null +++ b/docs/source/pythonapi/deplete/integrator.CRAM48.rst @@ -0,0 +1,6 @@ +integrator\.CRAM48 +================== + +.. currentmodule:: opendeplete.integrator + +.. autofunction:: CRAM48 diff --git a/docs/source/pythonapi/deplete/integrator.cecm.rst b/docs/source/pythonapi/deplete/integrator.cecm.rst new file mode 100644 index 0000000000..507a638f69 --- /dev/null +++ b/docs/source/pythonapi/deplete/integrator.cecm.rst @@ -0,0 +1,6 @@ +integrator\.cecm +================= + +.. currentmodule:: opendeplete.integrator + +.. autofunction:: cecm diff --git a/docs/source/pythonapi/deplete/integrator.predictor.rst b/docs/source/pythonapi/deplete/integrator.predictor.rst new file mode 100644 index 0000000000..d6c0fd827c --- /dev/null +++ b/docs/source/pythonapi/deplete/integrator.predictor.rst @@ -0,0 +1,6 @@ +integrator\.predictor +===================== + +.. currentmodule:: opendeplete.integrator + +.. autofunction:: predictor diff --git a/docs/source/pythonapi/deplete/integrator.save_results.rst b/docs/source/pythonapi/deplete/integrator.save_results.rst new file mode 100644 index 0000000000..5c21dcb664 --- /dev/null +++ b/docs/source/pythonapi/deplete/integrator.save_results.rst @@ -0,0 +1,6 @@ +integrator\.save_results +======================== + +.. currentmodule:: opendeplete.integrator + +.. autofunction:: save_results diff --git a/docs/source/pythonapi/deplete/opendeplete.Concentrations.rst b/docs/source/pythonapi/deplete/opendeplete.Concentrations.rst new file mode 100644 index 0000000000..6fa07a970b --- /dev/null +++ b/docs/source/pythonapi/deplete/opendeplete.Concentrations.rst @@ -0,0 +1,30 @@ +opendeplete.Concentrations +========================== + +.. currentmodule:: opendeplete + +.. autoclass:: Concentrations + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~Concentrations.__init__ + ~Concentrations.convert_nested_dict + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~Concentrations.n_cell + ~Concentrations.n_nuc + + \ No newline at end of file diff --git a/docs/source/pythonapi/deplete/opendeplete.ReactionRates.rst b/docs/source/pythonapi/deplete/opendeplete.ReactionRates.rst new file mode 100644 index 0000000000..99e048b565 --- /dev/null +++ b/docs/source/pythonapi/deplete/opendeplete.ReactionRates.rst @@ -0,0 +1,30 @@ +opendeplete.ReactionRates +========================= + +.. currentmodule:: opendeplete + +.. autoclass:: ReactionRates + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~ReactionRates.__init__ + + + + + + .. rubric:: Attributes + + .. autosummary:: + + ~ReactionRates.n_cell + ~ReactionRates.n_nuc + ~ReactionRates.n_react + + \ No newline at end of file diff --git a/docs/source/pythonapi/deplete/opendeplete.Results.rst b/docs/source/pythonapi/deplete/opendeplete.Results.rst new file mode 100644 index 0000000000..0ab8a1f711 --- /dev/null +++ b/docs/source/pythonapi/deplete/opendeplete.Results.rst @@ -0,0 +1,22 @@ +opendeplete.Results +=================== + +.. currentmodule:: opendeplete + +.. autoclass:: Results + + + .. automethod:: __init__ + + + .. rubric:: Methods + + .. autosummary:: + + ~Results.__init__ + + + + + + \ No newline at end of file diff --git a/openmc/deplete/__init__.py b/openmc/deplete/__init__.py new file mode 100644 index 0000000000..994a51e12c --- /dev/null +++ b/openmc/deplete/__init__.py @@ -0,0 +1,24 @@ +""" +OpenDeplete +=========== + +A simple depletion front-end tool. +""" + +from .dummy_comm import DummyCommunicator +try: + from mpi4py import MPI + comm = MPI.COMM_WORLD + have_mpi = True +except ImportError: + comm = DummyCommunicator() + have_mpi = False + +from .nuclide import * +from .depletion_chain import * +from .openmc_wrapper import * +from .reaction_rates import * +from .function import * +from .results import * +from .integrator import * +from .utilities import * diff --git a/openmc/deplete/atom_number.py b/openmc/deplete/atom_number.py new file mode 100644 index 0000000000..03bedbf531 --- /dev/null +++ b/openmc/deplete/atom_number.py @@ -0,0 +1,236 @@ +"""AtomNumber module. + +An ndarray to store atom densities with string, integer, or slice indexing. +""" + +import numpy as np + + +class AtomNumber(object): + """ AtomNumber module. + + An ndarray to store atom densities with string, integer, or slice indexing. + + Parameters + ---------- + mat_to_ind : OrderedDict of str to int + A dictionary mapping material ID as string to index. + nuc_to_ind : OrderedDict of str to int + A dictionary mapping nuclide name as string to index. + volume : OrderedDict of int to float + Volume of geometry. + n_mat_burn : int + Number of materials to be burned. + n_nuc_burn : int + Number of nuclides to be burned. + + Attributes + ---------- + mat_to_ind : OrderedDict of str to int + A dictionary mapping cell ID as string to index. + nuc_to_ind : OrderedDict of str to int + A dictionary mapping nuclide name as string to index. + volume : numpy.array + Volume of geometry indexed by mat_to_ind. If a volume is not found, + it defaults to 1 so that reading density still works correctly. + n_mat_burn : int + Number of materials to be burned. + n_nuc_burn : int + Number of nuclides to be burned. + n_mat : int + Number of materials. + n_nuc : int + Number of nucs. + number : numpy.array + Array storing total atoms indexed by the above dictionaries. + burn_nuc_list : list of str + A list of all nuclide material names. Used for sorting the simulation. + burn_mat_list : list of str + A list of all burning material names. Used for sorting the simulation. + """ + + def __init__(self, mat_to_ind, nuc_to_ind, volume, n_mat_burn, n_nuc_burn): + + self.mat_to_ind = mat_to_ind + self.nuc_to_ind = nuc_to_ind + + self.volume = np.ones(self.n_mat) + + for mat in volume: + if str(mat) in self.mat_to_ind: + ind = self.mat_to_ind[str(mat)] + self.volume[ind] = volume[mat] + + self.n_mat_burn = n_mat_burn + self.n_nuc_burn = n_nuc_burn + + self.number = np.zeros((self.n_mat, self.n_nuc)) + + # For performance, create storage for burn_nuc_list, burn_mat_list + self._burn_nuc_list = None + self._burn_mat_list = None + + def __getitem__(self, pos): + """ Retrieves total atom number from AtomNumber. + + Parameters + ---------- + pos : tuple + A two-length tuple containing a material index and a nuc index. + These indexes can be strings (which get converted to integers via + the dictionaries), integers used directly, or slices. + + Returns + ------- + numpy.array + The value indexed from self.number. + """ + + mat, nuc = pos + if isinstance(mat, str): + mat = self.mat_to_ind[mat] + if isinstance(nuc, str): + nuc = self.nuc_to_ind[nuc] + + return self.number[mat, nuc] + + def __setitem__(self, pos, val): + """ Sets total atom number into AtomNumber. + + Parameters + ---------- + pos : tuple + A two-length tuple containing a material index and a nuc index. + These indexes can be strings (which get converted to integers via + the dictionaries), integers used directly, or slices. + val : float + The value to set the array to. + """ + + mat, nuc = pos + if isinstance(mat, str): + mat = self.mat_to_ind[mat] + if isinstance(nuc, str): + nuc = self.nuc_to_ind[nuc] + + self.number[mat, nuc] = val + + def get_atom_density(self, mat, nuc): + """ Accesses atom density instead of total number. + + Parameters + ---------- + mat : str, int or slice + Material index. + nuc : str, int or slice + Nuclide index. + + Returns + ------- + numpy.array + The density indexed. + """ + + if isinstance(mat, str): + mat = self.mat_to_ind[mat] + if isinstance(nuc, str): + nuc = self.nuc_to_ind[nuc] + + return self[mat, nuc] / self.volume[mat] + + def set_atom_density(self, mat, nuc, val): + """ Sets atom density instead of total number. + + Parameters + ---------- + mat : str, int or slice + Material index. + nuc : str, int or slice + Nuclide index. + val : numpy.array + Array of values to set. + """ + + if isinstance(mat, str): + mat = self.mat_to_ind[mat] + if isinstance(nuc, str): + nuc = self.nuc_to_ind[nuc] + + self[mat, nuc] = val * self.volume[mat] + + def get_mat_slice(self, mat): + """ Gets atom quantity indexed by mats for all burned nuclides + + Parameters + ---------- + mat : str, int or slice + Material index. + + Returns + ------- + numpy.array + The slice requested. + """ + + if isinstance(mat, str): + mat = self.mat_to_ind[mat] + + return self[mat, 0:self.n_nuc_burn] + + def set_mat_slice(self, mat, val): + """ Sets atom quantity indexed by mats for all burned nuclides + + Parameters + ---------- + mat : str, int or slice + Material index. + val : numpy.array + The slice to set. + """ + + if isinstance(mat, str): + mat = self.mat_to_ind[mat] + + self[mat, 0:self.n_nuc_burn] = val + + @property + def n_mat(self): + """Number of materials.""" + return len(self.mat_to_ind) + + @property + def n_nuc(self): + """Number of nuclides.""" + return len(self.nuc_to_ind) + + @property + def burn_nuc_list(self): + """ burn_nuc_list : list of str + A list of all nuclide material names. Used for sorting the simulation. + """ + + if self._burn_nuc_list is None: + self._burn_nuc_list = [None] * self.n_nuc_burn + + for nuc in self.nuc_to_ind: + ind = self.nuc_to_ind[nuc] + if ind < self.n_nuc_burn: + self._burn_nuc_list[ind] = nuc + + return self._burn_nuc_list + + @property + def burn_mat_list(self): + """ burn_mat_list : list of str + A list of all burning material names. Used for sorting the simulation. + """ + + if self._burn_mat_list is None: + self._burn_mat_list = [None] * self.n_mat_burn + + for mat in self.mat_to_ind: + ind = self.mat_to_ind[mat] + if ind < self.n_mat_burn: + self._burn_mat_list[ind] = mat + + return self._burn_mat_list diff --git a/openmc/deplete/depletion_chain.py b/openmc/deplete/depletion_chain.py new file mode 100644 index 0000000000..05cc9db435 --- /dev/null +++ b/openmc/deplete/depletion_chain.py @@ -0,0 +1,472 @@ +"""depletion_chain module. + +This module contains information about a depletion chain. A depletion chain is +loaded from an .xml file and all the nuclides are linked together. +""" + +from collections import OrderedDict, defaultdict +from io import StringIO +from itertools import chain +import math +import re +import os + +from tqdm import tqdm +import scipy.sparse as sp +import openmc.data +# Try to use lxml if it is available. It preserves the order of attributes and +# provides a pretty-printer by default. If not available, use OpenMC function to +# pretty print. +try: + import lxml.etree as ET + _have_lxml = True +except ImportError: + import xml.etree.ElementTree as ET + from openmc.clean_xml import clean_xml_indentation + _have_lxml = False + +from .nuclide import Nuclide, DecayTuple, ReactionTuple + + +# tuple of (reaction name, possible MT values, (dA, dZ)) where dA is the change +# in the mass number and dZ is the change in the atomic number +_REACTIONS = [ + ('(n,2n)', set(chain([16], range(875, 892))), (-1, 0)), + ('(n,3n)', {17}, (-2, 0)), + ('(n,4n)', {37}, (-3, 0)), + ('(n,gamma)', {102}, (1, 0)), + ('(n,p)', set(chain([103], range(600, 650))), (0, -1)), + ('(n,a)', set(chain([107], range(800, 850))), (-3, -2)) +] + + +def _get_zai(s): + """Get ZAI value (10000*z + 10*A + metastable state) for sorting purposes""" + symbol, A, state = re.match(r'([A-Zn][a-z]*)(\d+)((?:_[em]\d+)?)', s).groups() + Z = openmc.data.ATOMIC_NUMBER[symbol] + A = int(A) + state = int(state[2:]) if state else 0 + return 10000*Z + 10*A + state + + +def replace_missing(product, decay_data): + """Replace missing product with suitable decay daughter. + + Parameters + ---------- + product : str + Name of product in GND format, e.g. 'Y86_m1'. + decay_data : dict + Dictionary of decay data + + Returns + ------- + product : str + Replacement for missing product in GND format. + + """ + + symbol, A, state = re.match(r'([A-Zn][a-z]*)(\d+)((?:_m\d+)?)', + product).groups() + Z = openmc.data.ATOMIC_NUMBER[symbol] + A = int(A) + + # First check if ground state is available + if state: + metastable_state = int(state[2:]) + product = '{}{}'.format(symbol, A) + + # Find isotope with longest half-life + half_life = 0.0 + for nuclide, data in decay_data.items(): + m = re.match(r'{}(\d+)(?:_m\d+)?'.format(symbol), nuclide) + if m: + # If we find a stable nuclide, stop search + if data.nuclide['stable']: + mass_longest_lived = int(m.group(1)) + break + if data.half_life.nominal_value > half_life: + mass_longest_lived = int(m.group(1)) + half_life = data.half_life.nominal_value + + # If mass number of longest-lived isotope is less than that of missing + # product, assume it undergoes beta-. Otherwise assume beta+. + beta_minus = (mass_longest_lived < A) + + # Iterate until we find an existing nuclide + while product not in decay_data: + if Z > 98: + Z -= 2 + A -= 4 + else: + if beta_minus: + Z += 1 + else: + Z -= 1 + product = '{}{}'.format(openmc.data.ATOMIC_SYMBOL[Z], A) + + return product + + +class DepletionChain(object): + """ The DepletionChain class. + + This class contains a full representation of a depletion chain. + + Attributes + ---------- + n_nuclides : int + Number of nuclides in chain. + nuclides : list of Nuclide + List of nuclides in chain. + nuclide_dict : OrderedDict of str to int + Maps a nuclide name to an index in nuclides. + nuc_to_react_ind : OrderedDict of str to int + Dictionary mapping a nuclide name to an index in ReactionRates. + react_to_ind : OrderedDict of str to int + Dictionary mapping a reaction name to an index in ReactionRates. + + """ + + def __init__(self): + self.nuclides = [] + self.nuclide_dict = OrderedDict() + self.nuc_to_react_ind = OrderedDict() + self.react_to_ind = OrderedDict() + + @property + def n_nuclides(self): + """Number of nuclides in chain.""" + return len(self.nuclides) + + @classmethod + def from_endf(cls, decay_files, fpy_files, neutron_files): + """Create a depletion chain from ENDF files. + + Parameters + ---------- + decay_files : list of str + List of ENDF decay sub-library files + fpy_files : list of str + List of ENDF neutron-induced fission product yield sub-library files + neutron_files : list of str + List of ENDF neutron reaction sub-library files + + """ + depl_chain = cls() + + # Create dictionary mapping target to filename + reactions = {} + with tqdm(neutron_files) as pbar: + for f in pbar: + pbar.set_description('Processing {}'.format(os.path.basename(f))) + evaluation = openmc.data.endf.Evaluation(f) + name = evaluation.gnd_name + reactions[name] = {} + for mf, mt, nc, mod in evaluation.reaction_list: + if mf == 3: + file_obj = StringIO(evaluation.section[3, mt]) + openmc.data.endf.get_head_record(file_obj) + q_value = openmc.data.endf.get_cont_record(file_obj)[1] + reactions[name][mt] = q_value + + # Determine what decay and FPY nuclides are available + decay_data = {} + with tqdm(decay_files) as pbar: + for f in pbar: + pbar.set_description('Processing {}'.format(os.path.basename(f))) + data = openmc.data.Decay(f) + decay_data[data.nuclide['name']] = data + + fpy_data = {} + with tqdm(fpy_files) as pbar: + for f in pbar: + pbar.set_description('Processing {}'.format(os.path.basename(f))) + data = openmc.data.FissionProductYields(f) + fpy_data[data.nuclide['name']] = data + + print('Creating depletion_chain...') + missing_daughter = [] + missing_rx_product = [] + missing_fpy = [] + missing_fp = [] + + reaction_index = 0 + for idx, parent in enumerate(sorted(decay_data, key=_get_zai)): + data = decay_data[parent] + + nuclide = Nuclide() + nuclide.name = parent + + depl_chain.nuclides.append(nuclide) + depl_chain.nuclide_dict[parent] = idx + + if not data.nuclide['stable'] and data.half_life.nominal_value != 0.0: + nuclide.half_life = data.half_life.nominal_value + nuclide.decay_energy = sum(E.nominal_value for E in + data.average_energies.values()) + sum_br = 0.0 + for i, mode in enumerate(data.modes): + type_ = ','.join(mode.modes) + if mode.daughter in decay_data: + target = mode.daughter + else: + print('missing {} {} {}'.format(parent, ','.join(mode.modes), mode.daughter)) + target = replace_missing(mode.daughter, decay_data) + + # Write branching ratio, taking care to ensure sum is unity + br = mode.branching_ratio.nominal_value + sum_br += br + if i == len(data.modes) - 1 and sum_br != 1.0: + br = 1.0 - sum(m.branching_ratio.nominal_value + for m in data.modes[:-1]) + + # Append decay mode + nuclide.decay_modes.append(DecayTuple(type_, target, br)) + + if parent in reactions: + reactions_available = set(reactions[parent].keys()) + for name, mts, changes in _REACTIONS: + if mts & reactions_available: + delta_A, delta_Z = changes + A = data.nuclide['mass_number'] + delta_A + Z = data.nuclide['atomic_number'] + delta_Z + daughter = '{}{}'.format(openmc.data.ATOMIC_SYMBOL[Z], A) + + if name not in depl_chain.react_to_ind: + depl_chain.react_to_ind[name] = reaction_index + reaction_index += 1 + + if daughter not in decay_data: + missing_rx_product.append((parent, name, daughter)) + + # Store Q value + for mt in sorted(mts): + if mt in reactions[parent]: + q_value = reactions[parent][mt] + break + else: + q_value = 0.0 + + nuclide.reactions.append(ReactionTuple( + name, daughter, q_value, 1.0)) + + if any(mt in reactions_available for mt in [18, 19, 20, 21, 38]): + if parent in fpy_data: + q_value = reactions[parent][18] + nuclide.reactions.append( + ReactionTuple('fission', 0, q_value, 1.0)) + + if 'fission' not in depl_chain.react_to_ind: + depl_chain.react_to_ind['fission'] = reaction_index + reaction_index += 1 + else: + missing_fpy.append(parent) + + if parent in fpy_data: + fpy = fpy_data[parent] + + if fpy.energies is not None: + nuclide.yield_energies = fpy.energies + else: + nuclide.yield_energies = [0.0] + + for E, table in zip(nuclide.yield_energies, fpy.independent): + yield_replace = 0.0 + yields = defaultdict(float) + for product, y in table.items(): + # Handle fission products that have no decay data available + if product not in decay_data: + daughter = replace_missing(product, decay_data) + product = daughter + yield_replace += y.nominal_value + + yields[product] += y.nominal_value + + if yield_replace > 0.0: + missing_fp.append((parent, E, yield_replace)) + + nuclide.yield_data[E] = [] + for k in sorted(yields, key=_get_zai): + nuclide.yield_data[E].append((k, yields[k])) + + # Display warnings + if missing_daughter: + print('The following decay modes have daughters with no decay data:') + for mode in missing_daughter: + print(' {}'.format(mode)) + print('') + + if missing_rx_product: + print('The following reaction products have no decay data:') + for vals in missing_rx_product: + print('{} {} -> {}'.format(*vals)) + print('') + + if missing_fpy: + print('The following fissionable nuclides have no fission product yields:') + for parent in missing_fpy: + print(' ' + parent) + print('') + + if missing_fp: + print('The following nuclides have fission products with no decay data:') + for vals in missing_fp: + print(' {}, E={} eV (total yield={})'.format(*vals)) + + return depl_chain + + @classmethod + def xml_read(cls, filename): + """Reads a depletion chain XML file. + + Parameters + ---------- + filename : str + The path to the depletion chain XML file. + + Todo + ---- + Allow for branching on capture, etc. + """ + depl_chain = cls() + + # Load XML tree + try: + root = ET.parse(filename) + except: + if filename is None: + print("No chain specified, either manually or in environment variable OPENDEPLETE_CHAIN.") + else: + print('Decay chain "', filename, '" is invalid.') + raise + + reaction_index = 0 + for i, nuclide_elem in enumerate(root.findall('nuclide_table')): + nuc = Nuclide.xml_read(nuclide_elem) + depl_chain.nuclide_dict[nuc.name] = i + + # Check for reaction paths + for rx in nuc.reactions: + if rx.type not in depl_chain.react_to_ind: + depl_chain.react_to_ind[rx.type] = reaction_index + reaction_index += 1 + + depl_chain.nuclides.append(nuc) + + return depl_chain + + def xml_write(self, filename): + """Writes a depletion chain XML file. + + Parameters + ---------- + filename : str + The path to the depletion chain XML file. + + """ + + root_elem = ET.Element('depletion') + for nuclide in self.nuclides: + root_elem.append(nuclide.xml_write()) + + tree = ET.ElementTree(root_elem) + if _have_lxml: + tree.write(filename, encoding='utf-8', pretty_print=True) + else: + clean_xml_indentation(root_elem, spaces_per_level=2) + tree.write(filename, encoding='utf-8') + + def form_matrix(self, rates): + """ Forms depletion matrix. + + Parameters + ---------- + rates : numpy.ndarray + 2D array indexed by nuclide then by cell. + + Returns + ------- + scipy.sparse.csr_matrix + Sparse matrix representing depletion. + """ + + matrix = defaultdict(float) + reactions = set() + + for i, nuc in enumerate(self.nuclides): + + if nuc.n_decay_modes != 0: + # Decay paths + # Loss + decay_constant = math.log(2) / nuc.half_life + + if decay_constant != 0.0: + matrix[i, i] -= decay_constant + + # Gain + for _, target, branching_ratio in nuc.decay_modes: + # Allow for total annihilation for debug purposes + if target != 'Nothing': + branch_val = branching_ratio * decay_constant + + if branch_val != 0.0: + k = self.nuclide_dict[target] + matrix[k, i] += branch_val + + if nuc.name in self.nuc_to_react_ind: + # Extract all reactions for this nuclide in this cell + nuc_ind = self.nuc_to_react_ind[nuc.name] + nuc_rates = rates[nuc_ind, :] + + for r_type, target, _, br in nuc.reactions: + # Extract reaction index, and then final reaction rate + r_id = self.react_to_ind[r_type] + path_rate = nuc_rates[r_id] + + # Loss term -- make sure we only count loss once for + # reactions with branching ratios + if r_type not in reactions: + reactions.add(r_type) + if path_rate != 0.0: + matrix[i, i] -= path_rate + + # Gain term; allow for total annihilation for debug purposes + if target != 'Nothing': + if r_type != 'fission': + if path_rate != 0.0: + k = self.nuclide_dict[target] + matrix[k, i] += path_rate * br + else: + # Assume that we should always use thermal fission + # yields. At some point it would be nice to account + # for the energy-dependence.. + energy, data = sorted(nuc.yield_data.items())[0] + for product, y in data: + yield_val = y * path_rate + if yield_val != 0.0: + k = self.nuclide_dict[product] + matrix[k, i] += yield_val + + # Clear set of reactions + reactions.clear() + + # Use DOK matrix as intermediate representation, then convert to CSR and return + matrix_dok = sp.dok_matrix((self.n_nuclides, self.n_nuclides)) + dict.update(matrix_dok, matrix) + return matrix_dok.tocsr() + + def nuc_by_ind(self, ind): + """ Extracts nuclides from the list by dictionary key. + + Parameters + ---------- + ind : str + Name of nuclide. + + Returns + ------- + Nuclide + Nuclide object that corresponds to ind. + """ + return self.nuclides[self.nuclide_dict[ind]] diff --git a/openmc/deplete/dummy_comm.py b/openmc/deplete/dummy_comm.py new file mode 100644 index 0000000000..b3fa272648 --- /dev/null +++ b/openmc/deplete/dummy_comm.py @@ -0,0 +1,27 @@ +class DummyCommunicator(object): + rank = 0 + size = 1 + + def allgather(self, sendobj): + return [sendobj] + + def allreduce(self, sendobj, op=None): + return sendobj + + def barrier(self): + pass + + def bcast(self, obj, root=0): + return obj + + def gather(self, sendobj, root=0): + return [sendobj] + + def py2f(self): + return 0 + + def reduce(self, sendobj, op=None, root=0): + return sendobj + + def scatter(self, sendobj, root=0): + return sendobj[0] diff --git a/openmc/deplete/function.py b/openmc/deplete/function.py new file mode 100644 index 0000000000..74eb92422b --- /dev/null +++ b/openmc/deplete/function.py @@ -0,0 +1,114 @@ +"""function module. + +This module contains the Operator class, which is then passed to an integrator +to run a full depletion simulation. +""" + +from abc import ABCMeta, abstractmethod + +class Settings(object): + """ The Settings class. + + Contains all parameters necessary for the integrator. + + Attributes + ---------- + dt_vec : numpy.array + Array of time steps to take. + output_dir : str + Path to output directory to save results. + """ + + def __init__(self): + # Integrator specific + self.dt_vec = None + self.output_dir = None + +class Operator(metaclass=ABCMeta): + """ The Operator metaclass. + + This defines all functions that the integrator needs to operate. + + Attributes + ---------- + settings : Settings + Settings object. + """ + + def __init__(self, settings): + self.settings = settings + + @abstractmethod + def initial_condition(self): + """ Performs final setup and returns initial condition. + + Returns + ------- + list of numpy.array + Total density for initial conditions. + """ + + pass + + @abstractmethod + def eval(self, vec, print_out=True): + """ Runs a simulation. + + Parameters + ---------- + vec : list of numpy.array + Total atoms to be used in function. + print_out : bool, optional + Whether or not to print out time. + + Returns + ------- + k : float + Eigenvalue of the problem. + rates : ReactionRates + Reaction rates from this simulation. + seed : int + Seed for this simulation. + """ + + pass + + @abstractmethod + def get_results_info(self): + """ Returns volume list, cell lists, and nuc lists. + + Returns + ------- + volume : list of float + Volumes corresponding to materials in burn_list + nuc_list : list of str + A list of all nuclide names. Used for sorting the simulation. + burn_list : list of int + A list of all cell IDs to be burned. Used for sorting the simulation. + full_burn_list : list of int + All burnable materials in the geometry. + """ + + pass + + @abstractmethod + def form_matrix(self, y, mat): + """ Forms the f(y) matrix in y' = f(y)y. + + Nominally a depletion matrix, this is abstracted on the off chance + that the function f has nothing to do with depletion at all. + + Parameters + ---------- + y : numpy.ndarray + An array representing y. + mat : int + Material id. + + Returns + ------- + scipy.sparse.csr_matrix + Sparse matrix representing f(y). + """ + + pass diff --git a/openmc/deplete/integrator/__init__.py b/openmc/deplete/integrator/__init__.py new file mode 100644 index 0000000000..607650dc69 --- /dev/null +++ b/openmc/deplete/integrator/__init__.py @@ -0,0 +1,11 @@ +""" +Integrator +=========== + +The integrator subcomponents. +""" + +from .cecm import * +from .cram import * +from .predictor import * +from .save_results import * diff --git a/openmc/deplete/integrator/cecm.py b/openmc/deplete/integrator/cecm.py new file mode 100644 index 0000000000..4d9baebb2e --- /dev/null +++ b/openmc/deplete/integrator/cecm.py @@ -0,0 +1,133 @@ +""" The CE/CM integrator.""" + +import copy +from itertools import repeat +import os +from multiprocessing import Pool +import time + +from .. import comm +from .cram import CRAM48, cram_wrapper +from .save_results import save_results + + +def cecm(operator, print_out=True): + """The CE/CM integrator. + + Implements the second order CE/CM Predictor-Corrector algorithm [ref]_. + This algorithm is mathematically defined as: + + .. math:: + y' &= A(y, t) y(t) + + A_p &= A(y_n, t_n) + + y_m &= \\text{expm}(A_p h/2) y_n + + A_c &= A(y_m, t_n + h/2) + + y_{n+1} &= \\text{expm}(A_c h) y_n + + .. [ref] + Isotalo, Aarno. "Comparison of Neutronics-Depletion Coupling Schemes + for Burnup Calculations—Continued Study." Nuclear Science and + Engineering 180.3 (2015): 286-300. + + Parameters + ---------- + operator : Operator + The operator object to simulate on. + print_out : bool, optional + Whether or not to print out time. + """ + + # Save current directory + dir_home = os.getcwd() + + # Move to folder + os.makedirs(operator.settings.output_dir, exist_ok=True) + os.chdir(operator.settings.output_dir) + + # Generate initial conditions + vec = operator.initial_condition() + + n_mats = len(vec) + + t = 0.0 + + for i, dt in enumerate(operator.settings.dt_vec): + # Create vectors + x = [copy.deepcopy(vec)] + seeds = [] + eigvls = [] + rates_array = [] + + eigvl, rates, seed = operator.eval(x[0]) + + eigvls.append(eigvl) + seeds.append(seed) + rates_array.append(rates) + + t_start = time.time() + + chains = repeat(operator.chain, n_mats) + vecs = (x[0][i] for i in range(n_mats)) + rates = (rates_array[0][i, :, :] for i in range(n_mats)) + dts = repeat(dt/2, n_mats) + + with Pool() as pool: + iters = zip(chains, vecs, rates, dts) + x_result = list(pool.starmap(cram_wrapper, iters)) + + t_end = time.time() + if comm.rank == 0: + if print_out: + print("Time to matexp: ", t_end - t_start) + + x.append(x_result) + + eigvl, rates, seed = operator.eval(x[1]) + + eigvls.append(eigvl) + seeds.append(seed) + rates_array.append(rates) + + t_start = time.time() + + chains = repeat(operator.chain, n_mats) + vecs = (x[0][i] for i in range(n_mats)) + rates = (rates_array[1][i, :, :] for i in range(n_mats)) + dts = repeat(dt, n_mats) + + with Pool() as pool: + iters = zip(chains, vecs, rates, dts) + x_result = list(pool.starmap(cram_wrapper, iters)) + + t_end = time.time() + if comm.rank == 0: + if print_out: + print("Time to matexp: ", t_end - t_start) + + # Create results, write to disk + save_results(operator, x, rates_array, eigvls, seeds, [t, t + dt], i) + + t += dt + vec = copy.deepcopy(x_result) + + # Perform one last simulation + x = [copy.deepcopy(vec)] + seeds = [] + eigvls = [] + rates_array = [] + eigvl, rates, seed = operator.eval(x[0]) + + eigvls.append(eigvl) + seeds.append(seed) + rates_array.append(rates) + + # Create results, write to disk + save_results(operator, x, rates_array, eigvls, seeds, [t, t], + len(operator.settings.dt_vec)) + + # Return to origin + os.chdir(dir_home) diff --git a/openmc/deplete/integrator/cram.py b/openmc/deplete/integrator/cram.py new file mode 100644 index 0000000000..a18d8450c3 --- /dev/null +++ b/openmc/deplete/integrator/cram.py @@ -0,0 +1,185 @@ +""" Chebyshev Rational Approximation Method module + +Implements two different forms of CRAM for use in opendeplete. +""" + +import numpy as np +import scipy.sparse as sp +import scipy.sparse.linalg as sla + + +def cram_wrapper(chain, n0, rates, dt): + """Wraps depletion matrix creation / CRAM solve for multiprocess execution + + Parameters + ---------- + chain : DepletionChain + Depletion chain used to construct the burnup matrix + n0 : numpy.array + Vector to operate a matrix exponent on. + rates : numpy.ndarray + 2D array indexed by nuclide then by cell. + dt : float + Time to integrate to. + + Returns + ------- + numpy.array + Results of the matrix exponent. + """ + A = chain.form_matrix(rates) + return CRAM48(A, n0, dt) + + +def CRAM16(A, n0, dt): + """ Chebyshev Rational Approximation Method, order 16 + + Algorithm is the 16th order Chebyshev Rational Approximation Method, + implemented in the more stable incomplete partial fraction (IPF) form + [cram16]_. + + .. [cram16] + Pusa, Maria. "Higher-Order Chebyshev Rational Approximation Method and + Application to Burnup Equations." Nuclear Science and Engineering 182.3 + (2016). + + Parameters + ---------- + A : scipy.linalg.csr_matrix + Matrix to take exponent of. + n0 : numpy.array + Vector to operate a matrix exponent on. + dt : float + Time to integrate to. + + Returns + ------- + numpy.array + Results of the matrix exponent. + """ + + alpha = np.array([+2.124853710495224e-16, + +5.464930576870210e+3 - 3.797983575308356e+4j, + +9.045112476907548e+1 - 1.115537522430261e+3j, + +2.344818070467641e+2 - 4.228020157070496e+2j, + +9.453304067358312e+1 - 2.951294291446048e+2j, + +7.283792954673409e+2 - 1.205646080220011e+5j, + +3.648229059594851e+1 - 1.155509621409682e+2j, + +2.547321630156819e+1 - 2.639500283021502e+1j, + +2.394538338734709e+1 - 5.650522971778156e+0j], + dtype=np.complex128) + theta = np.array([+0.0, + +3.509103608414918 + 8.436198985884374j, + +5.948152268951177 + 3.587457362018322j, + -5.264971343442647 + 16.22022147316793j, + +1.419375897185666 + 10.92536348449672j, + +6.416177699099435 + 1.194122393370139j, + +4.993174737717997 + 5.996881713603942j, + -1.413928462488886 + 13.49772569889275j, + -10.84391707869699 + 19.27744616718165j], + dtype=np.complex128) + + n = A.shape[0] + + alpha0 = 2.124853710495224e-16 + + k = 8 + + y = np.array(n0, dtype=np.float64) + for l in range(1, k+1): + y = 2.0*np.real(alpha[l]*sla.spsolve(A*dt - theta[l]*sp.eye(n), y)) + y + + y *= alpha0 + return y + + +def CRAM48(A, n0, dt): + """ Chebyshev Rational Approximation Method, order 48 + + Algorithm is the 48th order Chebyshev Rational Approximation Method, + implemented in the more stable incomplete partial fraction (IPF) form + [cram48]_. + + .. [cram48] + Pusa, Maria. "Higher-Order Chebyshev Rational Approximation Method and + Application to Burnup Equations." Nuclear Science and Engineering 182.3 + (2016). + + Parameters + ---------- + A : scipy.linalg.csr_matrix + Matrix to take exponent of. + n0 : numpy.array + Vector to operate a matrix exponent on. + dt : float + Time to integrate to. + + Returns + ------- + numpy.array + Results of the matrix exponent. + """ + + theta_r = np.array([-4.465731934165702e+1, -5.284616241568964e+0, + -8.867715667624458e+0, +3.493013124279215e+0, + +1.564102508858634e+1, +1.742097597385893e+1, + -2.834466755180654e+1, +1.661569367939544e+1, + +8.011836167974721e+0, -2.056267541998229e+0, + +1.449208170441839e+1, +1.853807176907916e+1, + +9.932562704505182e+0, -2.244223871767187e+1, + +8.590014121680897e-1, -1.286192925744479e+1, + +1.164596909542055e+1, +1.806076684783089e+1, + +5.870672154659249e+0, -3.542938819659747e+1, + +1.901323489060250e+1, +1.885508331552577e+1, + -1.734689708174982e+1, +1.316284237125190e+1]) + theta_i = np.array([+6.233225190695437e+1, +4.057499381311059e+1, + +4.325515754166724e+1, +3.281615453173585e+1, + +1.558061616372237e+1, +1.076629305714420e+1, + +5.492841024648724e+1, +1.316994930024688e+1, + +2.780232111309410e+1, +3.794824788914354e+1, + +1.799988210051809e+1, +5.974332563100539e+0, + +2.532823409972962e+1, +5.179633600312162e+1, + +3.536456194294350e+1, +4.600304902833652e+1, + +2.287153304140217e+1, +8.368200580099821e+0, + +3.029700159040121e+1, +5.834381701800013e+1, + +1.194282058271408e+0, +3.583428564427879e+0, + +4.883941101108207e+1, +2.042951874827759e+1]) + theta = np.array(theta_r + theta_i * 1j, dtype=np.complex128) + + alpha_r = np.array([+6.387380733878774e+2, +1.909896179065730e+2, + +4.236195226571914e+2, +4.645770595258726e+2, + +7.765163276752433e+2, +1.907115136768522e+3, + +2.909892685603256e+3, +1.944772206620450e+2, + +1.382799786972332e+5, +5.628442079602433e+3, + +2.151681283794220e+2, +1.324720240514420e+3, + +1.617548476343347e+4, +1.112729040439685e+2, + +1.074624783191125e+2, +8.835727765158191e+1, + +9.354078136054179e+1, +9.418142823531573e+1, + +1.040012390717851e+2, +6.861882624343235e+1, + +8.766654491283722e+1, +1.056007619389650e+2, + +7.738987569039419e+1, +1.041366366475571e+2]) + alpha_i = np.array([-6.743912502859256e+2, -3.973203432721332e+2, + -2.041233768918671e+3, -1.652917287299683e+3, + -1.783617639907328e+4, -5.887068595142284e+4, + -9.953255345514560e+3, -1.427131226068449e+3, + -3.256885197214938e+6, -2.924284515884309e+4, + -1.121774011188224e+3, -6.370088443140973e+4, + -1.008798413156542e+6, -8.837109731680418e+1, + -1.457246116408180e+2, -6.388286188419360e+1, + -2.195424319460237e+2, -6.719055740098035e+2, + -1.693747595553868e+2, -1.177598523430493e+1, + -4.596464999363902e+3, -1.738294585524067e+3, + -4.311715386228984e+1, -2.777743732451969e+2]) + alpha = np.array(alpha_r + alpha_i * 1j, dtype=np.complex128) + n = A.shape[0] + + alpha0 = 2.258038182743983e-47 + + k = 24 + + y = np.array(n0, dtype=np.float64) + for l in range(k): + y = 2.0*np.real(alpha[l]*sla.spsolve(A*dt - theta[l]*sp.eye(n), y)) + y + + y *= alpha0 + return y diff --git a/openmc/deplete/integrator/predictor.py b/openmc/deplete/integrator/predictor.py new file mode 100644 index 0000000000..6c9d538fd6 --- /dev/null +++ b/openmc/deplete/integrator/predictor.py @@ -0,0 +1,100 @@ +""" The Predictor algorithm.""" + +import copy +from itertools import repeat +import os +from multiprocessing import Pool +import time + +from .. import comm +from .cram import CRAM48, cram_wrapper +from .save_results import save_results + + +def predictor(operator, print_out=True): + """The basic predictor integrator. + + Implements the first order predictor algorithm. This algorithm is + mathematically defined as: + + .. math:: + y' &= A(y, t) y(t) + + A_p &= A(y_n, t_n) + + y_{n+1} &= \\text{expm}(A_p h) y_n + + Parameters + ---------- + operator : Operator + The operator object to simulate on. + print_out : bool, optional + Whether or not to print out time. + """ + + # Save current directory + dir_home = os.getcwd() + + # Move to folder + os.makedirs(operator.settings.output_dir, exist_ok=True) + os.chdir(operator.settings.output_dir) + + # Generate initial conditions + vec = operator.initial_condition() + + n_mats = len(vec) + + t = 0.0 + + for i, dt in enumerate(operator.settings.dt_vec): + # Create vectors + x = [copy.deepcopy(vec)] + seeds = [] + eigvls = [] + rates_array = [] + + eigvl, rates, seed = operator.eval(x[0]) + + eigvls.append(eigvl) + seeds.append(seed) + rates_array.append(rates) + + # Create results, write to disk + save_results(operator, x, rates_array, eigvls, seeds, [t, t + dt], i) + + t_start = time.time() + + chains = repeat(operator.chain, n_mats) + vecs = (x[0][i] for i in range(n_mats)) + rates = (rates_array[0][i, :, :] for i in range(n_mats)) + dts = repeat(dt, n_mats) + + with Pool() as pool: + iters = zip(chains, vecs, rates, dts) + x_result = list(pool.starmap(cram_wrapper, iters)) + + t_end = time.time() + if comm.rank == 0: + if print_out: + print("Time to matexp: ", t_end - t_start) + + t += dt + vec = copy.deepcopy(x_result) + + # Perform one last simulation + x = [copy.deepcopy(vec)] + seeds = [] + eigvls = [] + rates_array = [] + eigvl, rates, seed = operator.eval(x[0]) + + eigvls.append(eigvl) + seeds.append(seed) + rates_array.append(rates) + + # Create results, write to disk + save_results(operator, x, rates_array, eigvls, seeds, [t, t], + len(operator.settings.dt_vec)) + + # Return to origin + os.chdir(dir_home) diff --git a/openmc/deplete/integrator/save_results.py b/openmc/deplete/integrator/save_results.py new file mode 100644 index 0000000000..35cbc7f3f1 --- /dev/null +++ b/openmc/deplete/integrator/save_results.py @@ -0,0 +1,46 @@ +""" Generic result saving code for integrators. + +""" +from opendeplete.results import Results, write_results + +def save_results(op, x, rates, eigvls, seeds, t, step_ind): + """ Creates and writes results to disk + + Parameters + ---------- + op : Function + The operator used to generate these results. + x : list of list of numpy.array + The prior x vectors. Indexed [i][cell] using the above equation. + rates : list of ReactionRates + The reaction rates for each substep. + eigvls : list of float + Eigenvalue for each substep + seeds : list of int + Seeds for each substep. + t : list of float + Time indices. + step_ind : int + Step index. + """ + + # Get indexing terms + vol_list, nuc_list, burn_list, full_burn_list = op.get_results_info() + + # Create results + stages = len(x) + results = Results() + results.allocate(vol_list, nuc_list, burn_list, full_burn_list, stages) + + n_mat = len(burn_list) + + for i in range(stages): + for mat_i in range(n_mat): + results[i, mat_i, :] = x[i][mat_i][:] + + results.k = eigvls + results.seeds = seeds + results.time = t + results.rates = rates + + write_results(results, "results.h5", step_ind) diff --git a/openmc/deplete/nuclide.py b/openmc/deplete/nuclide.py new file mode 100644 index 0000000000..1208a9b3c3 --- /dev/null +++ b/openmc/deplete/nuclide.py @@ -0,0 +1,178 @@ +"""Nuclide module. + +Contains the per-nuclide components of a depletion chain. +""" + +from collections import namedtuple +try: + import lxml.etree as ET +except ImportError: + import xml.etree.ElementTree as ET + +DecayTuple = namedtuple('DecayTuple', 'type target branching_ratio') +ReactionTuple = namedtuple('ReactionTuple', 'type target Q branching_ratio') + + +class Nuclide(object): + """The Nuclide class. + + Contains everything in a depletion chain relating to a single nuclide. + + Attributes + ---------- + name : str + Name of nuclide. + half_life : float + Half life of nuclide in s^-1. + decay_energy : float + Energy deposited from decay in eV. + n_decay_modes : int + Number of decay pathways. + decay_modes : list of DecayTuple + Decay mode information. Each element of the list is a named tuple with + attributes 'type', 'target', and 'branching_ratio'. + n_reaction_paths : int + Number of possible reaction pathways. + reactions : list of ReactionTuple + Reaction information. Each element of the list is a named tuple with + attribute 'type', 'target', 'Q', and 'branching_ratio'. + yield_data : dict of float to list + Maps tabulated energy to list of (product, yield) for all + neutron-induced fission products. + yield_energies : list of float + Energies at which fission product yiels exist + + """ + + def __init__(self): + # Information about the nuclide + self.name = None + self.half_life = None + self.decay_energy = 0.0 + + # Decay paths + self.decay_modes = [] + + # Reaction paths + self.reactions = [] + + # Neutron fission yields, if present + self.yield_data = {} + self.yield_energies = [] + + @property + def n_decay_modes(self): + """Number of decay modes.""" + return len(self.decay_modes) + + @property + def n_reaction_paths(self): + """Number of possible reaction pathways.""" + return len(self.reactions) + + @classmethod + def xml_read(cls, element): + """Read nuclide from an XML element. + + Parameters + ---------- + element : xml.etree.ElementTree.Element + XML element to write nuclide data to + + Returns + ------- + nuc : Nuclide + Instance of a nuclide + + """ + nuc = cls() + nuc.name = element.get('name') + + # Check for half-life + if 'half_life' in element.attrib: + nuc.half_life = float(element.get('half_life')) + nuc.decay_energy = float(element.get('decay_energy', '0')) + + # Check for decay paths + for decay_elem in element.iter('decay_type'): + d_type = decay_elem.get('type') + target = decay_elem.get('target') + branching_ratio = float(decay_elem.get('branching_ratio')) + nuc.decay_modes.append(DecayTuple(d_type, target, branching_ratio)) + + # Check for reaction paths + for reaction_elem in element.iter('reaction_type'): + r_type = reaction_elem.get('type') + Q = float(reaction_elem.get('Q', '0')) + branching_ratio = float(reaction_elem.get('branching_ratio', '1')) + + # If the type is not fission, get target and Q value, otherwise + # just set null values + if r_type != 'fission': + target = reaction_elem.get('target') + else: + target = None + + # Append reaction + nuc.reactions.append(ReactionTuple( + r_type, target, Q, branching_ratio)) + + fpy_elem = element.find('neutron_fission_yields') + if fpy_elem is not None: + for yields_elem in fpy_elem.iter('fission_yields'): + E = float(yields_elem.get('energy')) + products = yields_elem.find('products').text.split() + yields = [float(y) for y in + yields_elem.find('data').text.split()] + nuc.yield_data[E] = list(zip(products, yields)) + nuc.yield_energies = list(sorted(nuc.yield_data.keys())) + + return nuc + + def xml_write(self): + """Write nuclide to XML element. + + Returns + ------- + elem : xml.etree.ElementTree.Element + XML element to write nuclide data to + + """ + elem = ET.Element('nuclide_table') + elem.set('name', self.name) + + if self.half_life is not None: + elem.set('half_life', str(self.half_life)) + elem.set('decay_modes', str(len(self.decay_modes))) + elem.set('decay_energy', str(self.decay_energy)) + for mode, daughter, br in self.decay_modes: + mode_elem = ET.SubElement(elem, 'decay_type') + mode_elem.set('type', mode) + mode_elem.set('target', daughter) + mode_elem.set('branching_ratio', str(br)) + + elem.set('reactions', str(len(self.reactions))) + for rx, daughter, Q, br in self.reactions: + rx_elem = ET.SubElement(elem, 'reaction_type') + rx_elem.set('type', rx) + rx_elem.set('Q', str(Q)) + if rx != 'fission': + rx_elem.set('target', daughter) + if br != 1.0: + rx_elem.set('branching_ratio', str(br)) + + if self.yield_data: + fpy_elem = ET.SubElement(elem, 'neutron_fission_yields') + energy_elem = ET.SubElement(fpy_elem, 'energies') + energy_elem.text = ' '.join(str(E) for E in self.yield_energies) + + for E in self.yield_energies: + yields_elem = ET.SubElement(fpy_elem, 'fission_yields') + yields_elem.set('energy', str(E)) + + products_elem = ET.SubElement(yields_elem, 'products') + products_elem.text = ' '.join(x[0] for x in self.yield_data[E]) + data_elem = ET.SubElement(yields_elem, 'data') + data_elem.text = ' '.join(str(x[1]) for x in self.yield_data[E]) + + return elem diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py new file mode 100644 index 0000000000..347dc71857 --- /dev/null +++ b/openmc/deplete/openmc_wrapper.py @@ -0,0 +1,853 @@ +""" The OpenMC wrapper module. + +This module implements the OpenDeplete -> OpenMC linkage. +""" + +import copy +from collections import OrderedDict +import os +import random +import sys +import time +try: + import lxml.etree as ET + _have_lxml = True +except ImportError: + import xml.etree.ElementTree as ET + from openmc.clean_xml import clean_xml_indentation + _have_lxml = False + +import h5py +import numpy as np +import openmc +import openmc.capi + +from . import comm +from .atom_number import AtomNumber +from .depletion_chain import DepletionChain +from .reaction_rates import ReactionRates +from .function import Settings, Operator + + +_JOULE_PER_EV = 1.6021766208e-19 + + +def chunks(items, n): + min_size, extra = divmod(len(items), n) + j = 0 + chunk_list = [] + for i in range(n): + chunk_size = min_size + int(i < extra) + chunk_list.append(items[j:j + chunk_size]) + j += chunk_size + return chunk_list + + +class OpenMCSettings(Settings): + """The OpenMCSettings class. + + Extends Settings to provide information OpenMC needs to run. + + Attributes + ---------- + dt_vec : numpy.array + Array of time steps to take. (From Settings) + tol : float + Tolerance for adaptive time stepping. (From Settings) + output_dir : str + Path to output directory to save results. (From Settings) + chain_file : str + Path to the depletion chain xml file. Defaults to the environment + variable "OPENDEPLETE_CHAIN" if it exists. + openmc_call : str + OpenMC executable path. Defaults to "openmc". + particles : int + Number of particles to simulate per batch. + batches : int + Number of batches. + inactive : int + Number of inactive batches. + lower_left : list of float + Coordinate of lower left of bounding box of geometry. + upper_right : list of float + Coordinate of upper right of bounding box of geometry. + entropy_dimension : list of int + Grid size of entropy. + dilute_initial : float, default 1.0e3 + Initial atom density to add for nuclides that are zero in initial + condition to ensure they exist in the decay chain. Only done for + nuclides with reaction rates. + round_number : bool + Whether or not to round output to OpenMC to 8 digits. + Useful in testing, as OpenMC is incredibly sensitive to exact values. + constant_seed : int + If present, all runs will be performed with this seed. + power : float + Power of the reactor in W. For a 2D problem, the power can be given in + W/cm as long as the "volume" assigned to a depletion material is + actually an area in cm^2. + """ + + def __init__(self): + super().__init__() + # OpenMC specific + try: + self.chain_file = os.environ["OPENDEPLETE_CHAIN"] + except KeyError: + self.chain_file = None + self.openmc_call = "openmc" + self.particles = None + self.batches = None + self.inactive = None + self.lower_left = None + self.upper_right = None + self.entropy_dimension = None + self.dilute_initial = 1.0e3 + + # OpenMC testing specific + self.round_number = False + self.constant_seed = None + + # Depletion problem specific + self.power = None + + +class Materials(object): + """The Materials class. + + Contains information about cross sections for a cell. + + Attributes + ---------- + temperature : float + Temperature in Kelvin for each region. + sab : str or list of str + ENDF S(a,b) name for a region that needs S(a,b) data. Not set if no + S(a,b) needed for region. + """ + + def __init__(self): + self.temperature = None + self.sab = None + + +class OpenMCOperator(Operator): + """The OpenMC Operator class. + + Provides Operator functions for OpenMC. + + Parameters + ---------- + geometry : openmc.Geometry + The OpenMC geometry object. + settings : OpenMCSettings + Settings object. + + Attributes + ---------- + settings : OpenMCSettings + Settings object. (From Operator) + geometry : openmc.Geometry + The OpenMC geometry object. + materials : list of Materials + Materials to be used for this simulation. + seed : int + The RNG seed used in last OpenMC run. + number : AtomNumber + Total number of atoms in simulation. + participating_nuclides : set of str + A set listing all unique nuclides available from cross_sections.xml. + chain : DepletionChain + The depletion chain information necessary to form matrices and tallies. + reaction_rates : ReactionRates + Reaction rates from the last operator step. + power : OrderedDict of str to float + Material-by-Material power. Indexed by material ID. + mat_name : OrderedDict of str to int + The name of region each material is set to. Indexed by material ID. + burn_mat_to_id : OrderedDict of str to int + Dictionary mapping material ID (as a string) to an index in reaction_rates. + burn_nuc_to_id : OrderedDict of str to int + Dictionary mapping nuclide name (as a string) to an index in + reaction_rates. + n_nuc : int + Number of nuclides considered in the decay chain. + mat_tally_ind : OrderedDict of str to int + Dictionary mapping material ID to index in tally. + """ + + def __init__(self, geometry, settings): + super().__init__(settings) + + self.geometry = geometry + self.seed = 0 + self.number = None + self.participating_nuclides = None + self.reaction_rates = None + self.power = None + self.mat_name = OrderedDict() + self.burn_mat_to_ind = OrderedDict() + self.burn_nuc_to_ind = None + + # Read depletion chain + self.chain = DepletionChain.xml_read(settings.chain_file) + + # Clear out OpenMC, create task lists, distribute + if comm.rank == 0: + clean_up_openmc() + mat_burn_list, mat_not_burn_list, volume, self.mat_tally_ind, \ + nuc_dict = self.extract_mat_ids() + else: + # Dummy variables + mat_burn_list = None + mat_not_burn_list = None + volume = None + nuc_dict = None + self.mat_tally_ind = None + + mat_burn = comm.scatter(mat_burn_list) + mat_not_burn = comm.scatter(mat_not_burn_list) + nuc_dict = comm.bcast(nuc_dict) + volume = comm.bcast(volume) + self.mat_tally_ind = comm.bcast(self.mat_tally_ind) + + # Load participating nuclides + self.load_participating() + + # Extract number densities from the geometry + self.extract_number(mat_burn, mat_not_burn, volume, nuc_dict) + + # Create reaction rate tables + self.initialize_reaction_rates() + + def __del__(self): + openmc.capi.finalize() + + def extract_mat_ids(self): + """ Extracts materials and assigns them to processes. + + Returns + ------- + mat_burn_lists : list of list of int + List of burnable materials indexed by rank. + mat_not_burn_lists : list of list of int + List of non-burnable materials indexed by rank. + volume : OrderedDict of str to float + Volume of each cell + mat_tally_ind : OrderedDict of str to int + Dictionary mapping material ID to index in tally. + nuc_dict : OrderedDict of str to int + Nuclides in order of how they'll appear in the simulation. + """ + + mat_burn = set() + mat_not_burn = set() + nuc_set = set() + + volume = OrderedDict() + + # Iterate once through the geometry to get dictionaries + cells = self.geometry.get_all_material_cells() + for cell in cells.values(): + name = cell.name + + if isinstance(cell.fill, openmc.Material): + mat = cell.fill + for nuclide in mat.get_nuclide_densities(): + nuc_set.add(nuclide) + if mat.depletable: + mat_burn.add(str(mat.id)) + volume[str(mat.id)] = mat.volume + else: + mat_not_burn.add(str(mat.id)) + self.mat_name[mat.id] = name + else: + for mat in cell.fill: + for nuclide in mat.get_nuclide_densities(): + nuc_set.add(nuclide) + if mat.depletable: + mat_burn.add(str(mat.id)) + volume[str(mat.id)] = mat.volume + else: + mat_not_burn.add(str(mat.id)) + self.mat_name[mat.id] = name + + need_vol = [] + + for mat_id in volume: + if volume[mat_id] is None: + need_vol.append(mat_id) + + if need_vol: + exit("Need volumes for materials: " + str(need_vol)) + + # Sort the sets + mat_burn = sorted(mat_burn, key=int) + mat_not_burn = sorted(mat_not_burn, key=int) + nuc_set = sorted(nuc_set) + + # Construct a global nuclide dictionary, burned first + nuc_dict = copy.deepcopy(self.chain.nuclide_dict) + + i = len(nuc_dict) + + for nuc in nuc_set: + if nuc not in nuc_dict: + nuc_dict[nuc] = i + i += 1 + + # Decompose geometry + mat_burn_lists = chunks(mat_burn, comm.size) + mat_not_burn_lists = chunks(mat_not_burn, comm.size) + + mat_tally_ind = OrderedDict() + + for i, mat in enumerate(mat_burn): + mat_tally_ind[mat] = i + + return mat_burn_lists, mat_not_burn_lists, volume, mat_tally_ind, nuc_dict + + def extract_number(self, mat_burn, mat_not_burn, volume, nuc_dict): + """ Construct self.number read from geometry + + Parameters + ---------- + mat_burn : list of int + Materials to be burned managed by this thread. + mat_not_burn + Materials not to be burned managed by this thread. + volume : OrderedDict of str to float + Volumes for the above materials. + nuc_dict : OrderedDict of str to int + Nuclides to be used in the simulation. + """ + + # Same with materials + mat_dict = OrderedDict() + self.burn_mat_to_ind = OrderedDict() + i = 0 + for mat in mat_burn: + mat_dict[mat] = i + self.burn_mat_to_ind[mat] = i + i += 1 + + for mat in mat_not_burn: + mat_dict[mat] = i + i += 1 + + n_mat_burn = len(mat_burn) + n_nuc_burn = len(self.chain.nuclide_dict) + + self.number = AtomNumber(mat_dict, nuc_dict, volume, n_mat_burn, n_nuc_burn) + + if self.settings.dilute_initial != 0.0: + for nuc in self.burn_nuc_to_ind: + self.number.set_atom_density(np.s_[:], nuc, self.settings.dilute_initial) + + # Now extract the number densities and store + cells = self.geometry.get_all_material_cells() + for cell in cells.values(): + if isinstance(cell.fill, openmc.Material): + if str(cell.fill.id) in mat_dict: + self.set_number_from_mat(cell.fill) + else: + for mat in cell.fill: + if str(mat.id) in mat_dict: + self.set_number_from_mat(mat) + + def set_number_from_mat(self, mat): + """ Extracts material and number densities from openmc.Material + + Parameters + ---------- + mat : openmc.Materials + The material to read from + """ + + mat_id = str(mat.id) + mat_ind = self.number.mat_to_ind[mat_id] + + nuc_dens = mat.get_nuclide_atom_densities() + for nuclide in nuc_dens: + name = nuclide.name + number = nuc_dens[nuclide][1] * 1.0e24 + self.number.set_atom_density(mat_id, name, number) + + def initialize_reaction_rates(self): + """ Create reaction rates object. """ + self.reaction_rates = ReactionRates( + self.burn_mat_to_ind, + self.burn_nuc_to_ind, + self.chain.react_to_ind) + + self.chain.nuc_to_react_ind = self.burn_nuc_to_ind + + def eval(self, vec, print_out=True): + """ Runs a simulation. + + Parameters + ---------- + vec : list of numpy.array + Total atoms to be used in function. + print_out : bool, optional + Whether or not to print out time. + + Returns + ------- + mat : list of scipy.sparse.csr_matrix + Matrices for the next step. + k : float + Eigenvalue of the problem. + rates : ReactionRates + Reaction rates from this simulation. + seed : int + Seed for this simulation. + """ + + # Prevent OpenMC from complaining about re-creating tallies + clean_up_openmc() + + # Update status + self.set_density(vec) + + time_start = time.time() + + # Update material compositions and tally nuclides + self._update_materials() + openmc.capi.tallies[1].nuclides = self._get_tally_nuclides() + + # Run OpenMC + openmc.capi.reset() + openmc.capi.run() + + time_openmc = time.time() + + # Extract results + k = self.unpack_tallies_and_normalize() + + if comm.rank == 0: + time_unpack = time.time() + + if print_out: + print("Time to openmc: ", time_openmc - time_start) + print("Time to unpack: ", time_unpack - time_openmc) + + return k, copy.deepcopy(self.reaction_rates), self.seed + + def form_matrix(self, y, mat): + """ Forms the depletion matrix. + + Parameters + ---------- + y : numpy.ndarray + An array representing reaction rates for this cell. + mat : int + Material id. + + Returns + ------- + scipy.sparse.csr_matrix + Sparse matrix representing the depletion matrix. + """ + + return copy.deepcopy(self.chain.form_matrix(y[mat, :, :])) + + def initial_condition(self): + """ Performs final setup and returns initial condition. + + Returns + ------- + list of numpy.array + Total density for initial conditions. + """ + + # Create XML files + if comm.rank == 0: + self.geometry.export_to_xml() + self.generate_settings_xml() + self.generate_materials_xml() + + # Initialize OpenMC library + comm.barrier() + openmc.capi.init(comm) + + # Generate tallies in memory + self.generate_tallies() + + # Return number density vector + return self.total_density_list() + + def _update_materials(self): + """Updates material compositions in OpenMC on all processes.""" + + for rank in range(comm.size): + number_i = comm.bcast(self.number, root=rank) + + for mat in number_i.mat_to_ind: + nuclides = [] + densities = [] + for nuc in number_i.nuc_to_ind: + if nuc in self.participating_nuclides: + val = 1.0e-24 * number_i.get_atom_density(mat, nuc) + + # If nuclide is zero, do not add to the problem. + if val > 0.0: + if self.settings.round_number: + val_magnitude = np.floor(np.log10(val)) + val_scaled = val / 10**val_magnitude + val_round = round(val_scaled, 8) + + val = val_round * 10**val_magnitude + + nuclides.append(nuc) + densities.append(val) + else: + # Only output warnings if values are significantly + # negative. CRAM does not guarantee positive values. + if val < -1.0e-21: + print("WARNING: nuclide ", nuc, " in material ", mat, + " is negative (density = ", val, " at/barn-cm)") + number_i[mat, nuc] = 0.0 + + mat_internal = openmc.capi.materials[int(mat)] + mat_internal.set_densities(nuclides, densities) + + def generate_materials_xml(self): + """ Creates materials.xml from self.number. + + Due to uncertainty with how MPI interacts with OpenMC API, this + constructs the XML manually. The long term goal is to do this + through direct memory writing. + """ + + materials = openmc.Materials(self.geometry.get_all_materials() + .values()) + + # Sort nuclides according to order in AtomNumber object + nuclides = list(self.number.nuc_to_ind.keys()) + for mat in materials: + mat._nuclides.sort(key=lambda x: nuclides.index(x[0])) + + materials.export_to_xml() + + def generate_settings_xml(self): + """ Generates settings.xml. + + This function creates settings.xml using the value of the settings + variable. + + Todo + ---- + Rewrite to generalize source box. + """ + + batches = self.settings.batches + inactive = self.settings.inactive + particles = self.settings.particles + + # Just a generic settings file to get it running. + settings_file = openmc.Settings() + settings_file.batches = batches + settings_file.inactive = inactive + settings_file.particles = particles + settings_file.source = openmc.Source(space=openmc.stats.Box( + self.settings.lower_left, self.settings.upper_right)) + + if self.settings.entropy_dimension is not None: + entropy_mesh = openmc.Mesh() + entropy_mesh.lower_left = self.settings.lower_left + entropy_mesh.upper_right = self.settings.upper_right + entropy_mesh.dimension = self.settings.entropy_dimension + settings_file.entropy_mesh = entropy_mesh + + # Set seed + if self.settings.constant_seed is not None: + seed = self.settings.constant_seed + else: + seed = random.randint(1, sys.maxsize-1) + + settings_file.seed = self.seed = seed + + settings_file.export_to_xml() + + def _get_tally_nuclides(self): + nuc_set = set() + + # Create the set of all nuclides in the decay chain in cells marked for + # burning in which the number density is greater than zero. + for nuc in self.number.nuc_to_ind: + if nuc in self.participating_nuclides: + if np.sum(self.number[:, nuc]) > 0.0: + nuc_set.add(nuc) + + # Communicate which nuclides have nonzeros to rank 0 + if comm.rank == 0: + for i in range(1, comm.size): + nuc_newset = comm.recv(source=i, tag=i) + nuc_set |= nuc_newset + + else: + comm.send(nuc_set, dest=0, tag=comm.rank) + + if comm.rank == 0: + # Sort nuclides in the same order as self.number + nuc_list = [nuc for nuc in self.number.nuc_to_ind + if nuc in nuc_set] + else: + nuc_list = None + + # Store list of tally nuclides on each process + nuc_list = comm.bcast(nuc_list, root=0) + tally_nuclides = [nuc for nuc in nuc_list + if nuc in self.chain.nuclide_dict] + + return tally_nuclides + + def generate_tallies(self): + """Generates depletion tallies. + + Using information from self.depletion_chain as well as the nuclides + currently in the problem, this function automatically generates a + tally.xml for the simulation. + """ + + # Create tallies for depleting regions + materials = [openmc.capi.materials[int(i)] + for i in self.mat_tally_ind] + mat_filter = openmc.capi.MaterialFilter(materials, 1) + + # Set up a tally that has a material filter covering each depletable + # material and scores corresponding to all reactions that cause + # transmutation. The nuclides for the tally are set later when eval() is + # called. + tally_dep = openmc.capi.Tally(1) + tally_dep.scores = self.chain.react_to_ind.keys() + tally_dep.filters = [mat_filter] + + def total_density_list(self): + """ Returns a list of total density lists. + + This list is in the exact same order as depletion_matrix_list, so that + matrix exponentiation can be done easily. + + Returns + ------- + list of numpy.array + A list of np.arrays containing total atoms of each cell. + """ + + total_density = [self.number.get_mat_slice(i) for i in range(self.number.n_mat_burn)] + + return total_density + + def set_density(self, total_density): + """ Sets density. + + Sets the density in the exact same order as total_density_list outputs, + allowing for internal consistency + + Parameters + ---------- + total_density : list of numpy.array + Total atoms. + """ + + # Fill in values + for i in range(self.number.n_mat_burn): + self.number.set_mat_slice(i, total_density[i]) + + def unpack_tallies_and_normalize(self): + """ Unpack tallies from OpenMC + + This function reads the tallies generated by OpenMC (from the tally.xml + file generated in generate_tally_xml) normalizes them so that the total + power generated is new_power, and then stores them in the reaction rate + database. + + Returns + ------- + k : float + Eigenvalue of the last simulation. + + Todo + ---- + Provide units for power + """ + + rates = self.reaction_rates + rates[:, :, :] = 0.0 + + k_combined = openmc.capi.keff()[0] + + # Extract tally bins + materials = list(self.mat_tally_ind.keys()) + nuclides = openmc.capi.tallies[1].nuclides + reactions = list(self.chain.react_to_ind.keys()) + + # Form fast map + nuc_ind = [rates.nuc_to_ind[nuc] for nuc in nuclides] + react_ind = [rates.react_to_ind[react] for react in reactions] + + # Compute fission power + # TODO : improve this calculation + + # Keep track of energy produced from all reactions in eV per source + # particle + energy = 0.0 + + # Create arrays to store fission Q values, reaction rates, and nuclide + # numbers + fission_Q = np.zeros(rates.n_nuc) + rates_expanded = np.zeros((rates.n_nuc, rates.n_react)) + number = np.zeros(rates.n_nuc) + + fission_ind = rates.react_to_ind["fission"] + + for nuclide in self.chain.nuclides: + if nuclide.name in rates.nuc_to_ind: + for rx in nuclide.reactions: + if rx.type == 'fission': + ind = rates.nuc_to_ind[nuclide.name] + fission_Q[ind] = rx.Q + break + + # Extract results + for i, mat in enumerate(self.number.burn_mat_list): + # Get tally index + slab = materials.index(mat) + + # Get material results hyperslab + results = openmc.capi.tallies[1].results[slab, :, 1] + + # Zero out reaction rates and nuclide numbers + rates_expanded[:] = 0.0 + number[:] = 0.0 + + # Expand into our memory layout + j = 0 + for nuc, i_nuc_results in zip(nuclides, nuc_ind): + number[i_nuc_results] = self.number[mat, nuc] + for react in react_ind: + rates_expanded[i_nuc_results, react] = results[j] + j += 1 + + # Accumulate energy from fission + energy += np.dot(rates_expanded[:, fission_ind], fission_Q) + + # Divide by total number and store + for i_nuc_results in nuc_ind: + if number[i_nuc_results] != 0.0: + for react in react_ind: + rates_expanded[i_nuc_results, react] /= number[i_nuc_results] + + rates.rates[i, :, :] = rates_expanded + + # Reduce energy produced from all processes + energy = comm.allreduce(energy) + + # Determine power in eV/s + power = self.settings.power / _JOULE_PER_EV + + # Scale reaction rates to obtain units of reactions/sec + rates[:, :, :] *= power / energy + + return k_combined + + def load_participating(self): + """ Loads a cross_sections.xml file to find participating nuclides. + + This allows for nuclides that are important in the decay chain but not + important neutronically, or have no cross section data. + """ + + # Reads cross_sections.xml to create a dictionary containing + # participating (burning and not just decaying) nuclides. + + try: + filename = os.environ["OPENMC_CROSS_SECTIONS"] + except KeyError: + filename = None + + self.participating_nuclides = set() + + try: + tree = ET.parse(filename) + except: + if filename is None: + msg = "No cross_sections.xml specified in materials." + else: + msg = 'Cross section file "{}" is invalid.'.format(filename) + raise IOError(msg) + + root = tree.getroot() + self.burn_nuc_to_ind = OrderedDict() + nuc_ind = 0 + + for nuclide_node in root.findall('library'): + mats = nuclide_node.get('materials') + if not mats: + continue + for name in mats.split(): + # Make a burn list of the union of nuclides in cross_sections.xml + # and nuclides in depletion chain. + if name not in self.participating_nuclides: + self.participating_nuclides.add(name) + if name in self.chain.nuclide_dict: + self.burn_nuc_to_ind[name] = nuc_ind + nuc_ind += 1 + + @property + def n_nuc(self): + """Number of nuclides considered in the decay chain.""" + return len(self.chain.nuclides) + + def get_results_info(self): + """ Returns volume list, cell lists, and nuc lists. + + Returns + ------- + volume : dict of str float + Volumes corresponding to materials in full_burn_dict + nuc_list : list of str + A list of all nuclide names. Used for sorting the simulation. + burn_list : list of int + A list of all cell IDs to be burned. Used for sorting the simulation. + full_burn_dict : OrderedDict of str to int + Maps cell name to index in global geometry. + """ + + nuc_list = self.number.burn_nuc_list + burn_list = self.number.burn_mat_list + + volume = {} + for i, mat in enumerate(burn_list): + volume[mat] = self.number.volume[i] + + # Combine volume dictionaries across processes + volume_list = comm.allgather(volume) + volume = {k: v for d in volume_list for k, v in d.items()} + + return volume, nuc_list, burn_list, self.mat_tally_ind + +def density_to_mat(dens_dict): + """ Generates an OpenMC material from a cell ID and self.number_density. + Parameters + ---------- + m_id : int + Cell ID. + Returns + ------- + openmc.Material + The OpenMC material filled with nuclides. + """ + + mat = openmc.Material() + for key in dens_dict: + mat.add_nuclide(key, 1.0e-24*dens_dict[key]) + mat.set_density('sum') + + return mat + +def clean_up_openmc(): + """ Resets all automatic indexing in OpenMC, as these get in the way. """ + openmc.reset_auto_ids() diff --git a/openmc/deplete/reaction_rates.py b/openmc/deplete/reaction_rates.py new file mode 100644 index 0000000000..7b934027a5 --- /dev/null +++ b/openmc/deplete/reaction_rates.py @@ -0,0 +1,113 @@ +"""ReactionRates module. + +An ndarray to store reaction rates with string, integer, or slice indexing. +""" + +import numpy as np + + +class ReactionRates(object): + """ ReactionRates class. + + An ndarray to store reaction rates with string, integer, or slice indexing. + + Parameters + ---------- + mat_to_ind : OrderedDict of str to int + A dictionary mapping material ID as string to index. + nuc_to_ind : OrderedDict of str to int + A dictionary mapping nuclide name as string to index. + react_to_ind : OrderedDict of str to int + A dictionary mapping reaction name as string to index. + + Attributes + ---------- + mat_to_ind : OrderedDict of str to int + A dictionary mapping cell ID as string to index. + nuc_to_ind : OrderedDict of str to int + A dictionary mapping nuclide name as string to index. + react_to_ind : OrderedDict of str to int + A dictionary mapping reaction name as string to index. + n_mat : int + Number of materials. + n_nuc : int + Number of nucs. + n_react : int + Number of reactions. + rates : numpy.array + Array storing rates indexed by the above dictionaries. + """ + + def __init__(self, mat_to_ind, nuc_to_ind, react_to_ind): + + self.mat_to_ind = mat_to_ind + self.nuc_to_ind = nuc_to_ind + self.react_to_ind = react_to_ind + + self.rates = np.zeros((self.n_mat, self.n_nuc, self.n_react)) + + def __getitem__(self, pos): + """ Retrieves an item from reaction_rates. + + Parameters + ---------- + pos : tuple + A three-length tuple containing a material index, a nuc index, and a + reaction index. These indexes can be strings (which get converted + to integers via the dictionaries), integers used directly, or + slices. + + Returns + ------- + numpy.array + The value indexed from self.rates. + """ + + mat, nuc, react = pos + if isinstance(mat, str): + mat = self.mat_to_ind[mat] + if isinstance(nuc, str): + nuc = self.nuc_to_ind[nuc] + if isinstance(react, str): + react = self.react_to_ind[react] + + return self.rates[mat, nuc, react] + + def __setitem__(self, pos, val): + """ Sets an item from reaction_rates. + + Parameters + ---------- + pos : tuple + A three-length tuple containing a material index, a nuc index, and a + reaction index. These indexes can be strings (which get converted + to integers via the dictionaries), integers used directly, or + slices. + val : float + The value to set the array to. + """ + + mat, nuc, react = pos + if isinstance(mat, str): + mat = self.mat_to_ind[mat] + if isinstance(nuc, str): + nuc = self.nuc_to_ind[nuc] + if isinstance(react, str): + react = self.react_to_ind[react] + + self.rates[mat, nuc, react] = val + + @property + def n_mat(self): + """Number of cells.""" + return len(self.mat_to_ind) + + @property + def n_nuc(self): + """Number of nucs.""" + return len(self.nuc_to_ind) + + @property + def n_react(self): + """Number of reactions.""" + return len(self.react_to_ind) diff --git a/openmc/deplete/results.py b/openmc/deplete/results.py new file mode 100644 index 0000000000..c0ec1627ea --- /dev/null +++ b/openmc/deplete/results.py @@ -0,0 +1,454 @@ +""" The results module. + +Contains results generation and saving capabilities. +""" + +from collections import OrderedDict +import copy + +import numpy as np +import h5py + +from . import comm, have_mpi +from .reaction_rates import ReactionRates + +RESULTS_VERSION = 2 + +class Results(object): + """ Contains output of opendeplete. + + Attributes + ---------- + k : list of float + Eigenvalue for each substep. + seeds : list of int + Seeds for each substep. + time : list of float + Time at beginning, end of step, in seconds. + n_mat : int + Number of mats. + n_nuc : int + Number of nuclides. + rates : list of ReactionRates + The reaction rates for each substep. + volume : OrderedDict of int to float + Dictionary mapping mat id to volume. + mat_to_ind : OrderedDict of str to int + A dictionary mapping mat ID as string to index. + nuc_to_ind : OrderedDict of str to int + A dictionary mapping nuclide name as string to index. + mat_to_hdf5_ind : OrderedDict of str to int + A dictionary mapping mat ID as string to global index. + n_hdf5_mats : int + Number of materials in entire geometry. + n_stages : int + Number of stages in simulation. + data : numpy.array + Atom quantity, stored by stage, mat, then by nuclide. + """ + + def __init__(self): + self.k = None + self.seeds = None + self.time = None + self.p_terms = None + self.rates = None + self.volume = None + + self.mat_to_ind = None + self.nuc_to_ind = None + self.mat_to_hdf5_ind = None + + self.data = None + + def allocate(self, volume, nuc_list, burn_list, full_burn_dict, stages): + """ Allocates memory of Results. + + Parameters + ---------- + volume : dict of str float + Volumes corresponding to materials in full_burn_dict + nuc_list : list of str + A list of all nuclide names. Used for sorting the simulation. + burn_list : list of int + A list of all mat IDs to be burned. Used for sorting the simulation. + full_burn_dict : dict of str to int + Map of material name to id in global geometry. + stages : int + Number of stages in simulation. + """ + + self.volume = copy.deepcopy(volume) + self.nuc_to_ind = OrderedDict() + self.mat_to_ind = OrderedDict() + self.mat_to_hdf5_ind = copy.deepcopy(full_burn_dict) + + for i, mat in enumerate(burn_list): + self.mat_to_ind[mat] = i + + for i, nuc in enumerate(nuc_list): + self.nuc_to_ind[nuc] = i + + # Create storage array + self.data = np.zeros((stages, self.n_mat, self.n_nuc)) + + @property + def n_mat(self): + """Number of mats.""" + return len(self.mat_to_ind) + + @property + def n_nuc(self): + """Number of nuclides.""" + return len(self.nuc_to_ind) + + @property + def n_hdf5_mats(self): + """Number of materials in entire geometry.""" + return len(self.mat_to_hdf5_ind) + + @property + def n_stages(self): + """Number of stages in simulation.""" + return self.data.shape[0] + + def __getitem__(self, pos): + """ Retrieves an item from results. + + Parameters + ---------- + pos : tuple + A three-length tuple containing a stage index, mat index and a nuc + index. All can be integers or slices. The second two can be + strings corresponding to their respective dictionary. + + Returns + ------- + float + The atoms for stage, mat, nuc + """ + + stage, mat, nuc = pos + if isinstance(mat, str): + mat = self.mat_to_ind[mat] + if isinstance(nuc, str): + nuc = self.nuc_to_ind[nuc] + + return self.data[stage, mat, nuc] + + def __setitem__(self, pos, val): + """ Sets an item from results. + + Parameters + ---------- + pos : tuple + A three-length tuple containing a stage index, mat index and a nuc + index. All can be integers or slices. The second two can be + strings corresponding to their respective dictionary. + + val : float + The value to set data to. + """ + + stage, mat, nuc = pos + if isinstance(mat, str): + mat = self.mat_to_ind[mat] + if isinstance(nuc, str): + nuc = self.nuc_to_ind[nuc] + + self.data[stage, mat, nuc] = val + + def create_hdf5(self, handle): + """ Creates file structure for a blank HDF5 file. + + Parameters + ---------- + handle : h5py.File or h5py.Group + An hdf5 file or group type to store this in. + """ + + # Create and save the 5 dictionaries: + # quantities + # self.mat_to_ind -> self.volume (TODO: support for changing volumes) + # self.nuc_to_ind + # reactions + # self.rates[0].nuc_to_ind (can be different from above, above is superset) + # self.rates[0].react_to_ind + # these are shared by every step of the simulation, and should be deduplicated. + + # Store concentration mat and nuclide dictionaries (along with volumes) + + handle.create_dataset("version", data=RESULTS_VERSION) + + mat_int = sorted([int(mat) for mat in self.mat_to_hdf5_ind]) + mat_list = [str(mat) for mat in mat_int] + nuc_list = sorted(self.nuc_to_ind.keys()) + rxn_list = sorted(self.rates[0].react_to_ind.keys()) + + n_mats = self.n_hdf5_mats + n_nuc_number = len(nuc_list) + n_nuc_rxn = len(self.rates[0].nuc_to_ind) + n_rxn = len(rxn_list) + n_stages = self.n_stages + + mat_group = handle.create_group("cells") + + for mat in mat_list: + mat_single_group = mat_group.create_group(mat) + mat_single_group.attrs["index"] = self.mat_to_hdf5_ind[mat] + mat_single_group.attrs["volume"] = self.volume[mat] + + nuc_group = handle.create_group("nuclides") + + for nuc in nuc_list: + nuc_single_group = nuc_group.create_group(nuc) + nuc_single_group.attrs["atom number index"] = self.nuc_to_ind[nuc] + if nuc in self.rates[0].nuc_to_ind: + nuc_single_group.attrs["reaction rate index"] = self.rates[0].nuc_to_ind[nuc] + + rxn_group = handle.create_group("reactions") + + for rxn in rxn_list: + rxn_single_group = rxn_group.create_group(rxn) + rxn_single_group.attrs["index"] = self.rates[0].react_to_ind[rxn] + + # Construct array storage + + handle.create_dataset("number", (1, n_stages, n_mats, n_nuc_number), + maxshape=(None, n_stages, n_mats, n_nuc_number), + chunks=(1, 1, n_mats, n_nuc_number), + dtype='float64') + + handle.create_dataset("reaction rates", (1, n_stages, n_mats, n_nuc_rxn, n_rxn), + maxshape=(None, n_stages, n_mats, n_nuc_rxn, n_rxn), + chunks=(1, 1, n_mats, n_nuc_rxn, n_rxn), + dtype='float64') + + handle.create_dataset("eigenvalues", (1, n_stages), + maxshape=(None, n_stages), dtype='float64') + + handle.create_dataset("seeds", (1, n_stages), maxshape=(None, n_stages), dtype='int64') + + handle.create_dataset("time", (1, 2), maxshape=(None, 2), dtype='float64') + + def to_hdf5(self, handle, index): + """ Converts results object into an hdf5 object. + + Parameters + ---------- + handle : h5py.File or h5py.Group + An hdf5 file or group type to store this in. + index : int + What step is this? + """ + + if "/number" not in handle: + comm.barrier() + self.create_hdf5(handle) + + comm.barrier() + + # Grab handles + number_dset = handle["/number"] + rxn_dset = handle["/reaction rates"] + eigenvalues_dset = handle["/eigenvalues"] + seeds_dset = handle["/seeds"] + time_dset = handle["/time"] + + # Get number of results stored + number_shape = list(number_dset.shape) + number_results = number_shape[0] + + new_shape = index + 1 + + if number_results < new_shape: + # Extend first dimension by 1 + number_shape[0] = new_shape + number_dset.resize(number_shape) + + rxn_shape = list(rxn_dset.shape) + rxn_shape[0] = new_shape + rxn_dset.resize(rxn_shape) + + eigenvalues_shape = list(eigenvalues_dset.shape) + eigenvalues_shape[0] = new_shape + eigenvalues_dset.resize(eigenvalues_shape) + + seeds_shape = list(seeds_dset.shape) + seeds_shape[0] = new_shape + seeds_dset.resize(seeds_shape) + + time_shape = list(time_dset.shape) + time_shape[0] = new_shape + time_dset.resize(time_shape) + + # If nothing to write, just return + if len(self.mat_to_ind) == 0: + return + + # Add data + # Note, for the last step, self.n_stages = 1, even if n_stages != 1. + n_stages = self.n_stages + inds = [self.mat_to_hdf5_ind[mat] for mat in self.mat_to_ind] + low = min(inds) + high = max(inds) + for i in range(n_stages): + number_dset[index, i, low:high+1, :] = self.data[i, :, :] + rxn_dset[index, i, low:high+1, :, :] = self.rates[i][:, :, :] + if comm.rank == 0: + eigenvalues_dset[index, i] = self.k[i] + seeds_dset[index, i] = self.seeds[i] + if comm.rank == 0: + time_dset[index, :] = self.time + + def from_hdf5(self, handle, index): + """ Loads results object from HDF5. + + Parameters + ---------- + handle : h5py.File or h5py.Group + An hdf5 file or group type to load from. + index : int + What step is this? + """ + + # Grab handles + number_dset = handle["/number"] + eigenvalues_dset = handle["/eigenvalues"] + seeds_dset = handle["/seeds"] + time_dset = handle["/time"] + + self.data = number_dset[index, :, :, :] + self.k = eigenvalues_dset[index, :] + self.seeds = seeds_dset[index, :] + self.time = time_dset[index, :] + + # Reconstruct dictionaries + self.volume = OrderedDict() + self.mat_to_ind = OrderedDict() + self.nuc_to_ind = OrderedDict() + rxn_nuc_to_ind = OrderedDict() + rxn_to_ind = OrderedDict() + + for mat in handle["/cells"]: + mat_handle = handle["/cells/" + mat] + vol = mat_handle.attrs["volume"] + ind = mat_handle.attrs["index"] + + self.volume[mat] = vol + self.mat_to_ind[mat] = ind + + for nuc in handle["/nuclides"]: + nuc_handle = handle["/nuclides/" + nuc] + ind_atom = nuc_handle.attrs["atom number index"] + self.nuc_to_ind[nuc] = ind_atom + + if "reaction rate index" in nuc_handle.attrs: + rxn_nuc_to_ind[nuc] = nuc_handle.attrs["reaction rate index"] + + for rxn in handle["/reactions"]: + rxn_handle = handle["/reactions/" + rxn] + rxn_to_ind[rxn] = rxn_handle.attrs["index"] + + self.rates = [] + # Reconstruct reactions + for i in range(self.n_stages): + rate = ReactionRates(self.mat_to_ind, rxn_nuc_to_ind, rxn_to_ind) + + rate.rates = handle["/reaction rates"][index, i, :, :, :] + self.rates.append(rate) + + +def get_dict(number): + """ Given an operator nested dictionary, output indexing dictionaries. + + These indexing dictionaries map mat IDs and nuclide names to indices + inside of Results.data. + + Parameters + ---------- + number : AtomNumber + The object to extract dictionaries from + + Returns + ------- + mat_to_ind : OrderedDict of str to int + Maps mat strings to index in array. + nuc_to_ind : OrderedDict of str to int + Maps nuclide strings to index in array. + """ + mat_to_ind = OrderedDict() + nuc_to_ind = OrderedDict() + + for nuc in number.nuc_to_ind: + nuc_ind = number.nuc_to_ind[nuc] + if nuc_ind < number.n_nuc_burn: + nuc_to_ind[nuc] = nuc_ind + + for mat in number.mat_to_ind: + mat_ind = number.mat_to_ind[mat] + if mat_ind < number.n_mat_burn: + mat_to_ind[mat] = mat_ind + + return mat_to_ind, nuc_to_ind + + +def write_results(result, filename, index): + """ Outputs result to an .hdf5 file. + + Parameters + ---------- + result : Results + Object to be stored in a file. + filename : String + Target filename. + index : int + What step is this? + """ + + if have_mpi and h5py.get_config().mpi: + kwargs = {'driver': 'mpio', 'comm': comm} + else: + kwargs = {} + + kwargs['mode'] = "w" if index == 0 else "a" + + with h5py.File(filename, **kwargs) as handle: + result.to_hdf5(handle, index) + + +def read_results(filename): + """ Reads out a list of results objects from an hdf5 file. + + Parameters + ---------- + filename : str + The filename to read from. + + Returns + ------- + results : list of Results + The result objects. + """ + + file = h5py.File(filename, "r") + + assert file["/version"].value == RESULTS_VERSION + + # Grab handles + number_dset = file["/number"] + + # Get number of results stored + number_shape = list(number_dset.shape) + number_results = number_shape[0] + + results = [] + + for i in range(number_results): + result = Results() + result.from_hdf5(file, i) + results.append(result) + + file.close() + + return results diff --git a/openmc/deplete/utilities.py b/openmc/deplete/utilities.py new file mode 100644 index 0000000000..54632ed9c2 --- /dev/null +++ b/openmc/deplete/utilities.py @@ -0,0 +1,98 @@ +""" The utilities module. + +Contains functions that can be used to post-process objects that come out of +the results module. +""" + +import numpy as np + +def evaluate_single_nuclide(results, cell, nuc): + """ Evaluates a single nuclide in a single cell from a results list. + + Parameters + ---------- + results : list of results + The results to extract data from. Must be sorted and continuous. + cell : str + Cell name to evaluate + nuc : str + Nuclide name to evaluate + + Returns + ------- + time : numpy.array + Time vector. + concentration : numpy.array + Total number of atoms in the cell. + """ + + n_points = len(results) + time = np.zeros(n_points) + concentration = np.zeros(n_points) + + # Evaluate value in each region + for i, result in enumerate(results): + time[i] = result.time[0] + concentration[i] = result[0, cell, nuc] + + return time, concentration + +def evaluate_reaction_rate(results, cell, nuc, rxn): + """ Evaluates a single nuclide reaction rate in a single cell from a results list. + + Parameters + ---------- + results : list of Results + The results to extract data from. Must be sorted and continuous. + cell : str + Cell name to evaluate + nuc : str + Nuclide name to evaluate + rxn : str + Reaction rate to evaluate + + Returns + ------- + time : numpy.array + Time vector. + rate : numpy.array + Reaction rate. + """ + + n_points = len(results) + time = np.zeros(n_points) + rate = np.zeros(n_points) + # Evaluate value in each region + for i, result in enumerate(results): + time[i] = result.time[0] + rate[i] = result.rates[0][cell, nuc, rxn] * result[0, cell, nuc] + + return time, rate + +def evaluate_eigenvalue(results): + """ Evaluates the eigenvalue from a results list. + + Parameters + ---------- + results : list of Results + The results to extract data from. Must be sorted and continuous. + + Returns + ------- + time : numpy.array + Time vector. + eigenvalue : numpy.array + Eigenvalue. + """ + + n_points = len(results) + time = np.zeros(n_points) + eigenvalue = np.zeros(n_points) + + # Evaluate value in each region + for i, result in enumerate(results): + + time[i] = result.time[0] + eigenvalue[i] = result.k[0] + + return time, eigenvalue diff --git a/scripts/example_geometry.py b/scripts/example_geometry.py new file mode 100644 index 0000000000..9afcc0d464 --- /dev/null +++ b/scripts/example_geometry.py @@ -0,0 +1,358 @@ +"""An example file showing how to make a geometry. + +This particular example creates a 3x3 geometry, with 8 regular pins and one +Gd-157 2 wt-percent enriched. All pins are segmented. +""" + +from collections import OrderedDict +import math + +import numpy as np +import openmc + +from opendeplete import density_to_mat + + +def generate_initial_number_density(): + """ Generates initial number density. + + These results were from a CASMO5 run in which the gadolinium pin was + loaded with 2 wt percent of Gd-157. + """ + + # Concentration to be used for all fuel pins + fuel_dict = OrderedDict() + fuel_dict['U235'] = 1.05692e21 + fuel_dict['U234'] = 1.00506e19 + fuel_dict['U238'] = 2.21371e22 + fuel_dict['O16'] = 4.62954e22 + fuel_dict['O17'] = 1.127684e20 + fuel_dict['I135'] = 1.0e10 + fuel_dict['Xe135'] = 1.0e10 + fuel_dict['Xe136'] = 1.0e10 + fuel_dict['Cs135'] = 1.0e10 + fuel_dict['Gd156'] = 1.0e10 + fuel_dict['Gd157'] = 1.0e10 + # fuel_dict['O18'] = 9.51352e19 # Does not exist in ENDF71, merged into 17 + + # Concentration to be used for the gadolinium fuel pin + fuel_gd_dict = OrderedDict() + fuel_gd_dict['U235'] = 1.03579e21 + fuel_gd_dict['U238'] = 2.16943e22 + fuel_gd_dict['Gd156'] = 3.95517E+10 + fuel_gd_dict['Gd157'] = 1.08156e20 + fuel_gd_dict['O16'] = 4.64035e22 + fuel_dict['I135'] = 1.0e10 + fuel_dict['Xe136'] = 1.0e10 + fuel_dict['Xe135'] = 1.0e10 + fuel_dict['Cs135'] = 1.0e10 + # There are a whole bunch of 1e-10 stuff here. + + # Concentration to be used for cladding + clad_dict = OrderedDict() + clad_dict['O16'] = 3.07427e20 + clad_dict['O17'] = 7.48868e17 + clad_dict['Cr50'] = 3.29620e18 + clad_dict['Cr52'] = 6.35639e19 + clad_dict['Cr53'] = 7.20763e18 + clad_dict['Cr54'] = 1.79413e18 + clad_dict['Fe54'] = 5.57350e18 + clad_dict['Fe56'] = 8.74921e19 + clad_dict['Fe57'] = 2.02057e18 + clad_dict['Fe58'] = 2.68901e17 + clad_dict['Cr50'] = 3.29620e18 + clad_dict['Cr52'] = 6.35639e19 + clad_dict['Cr53'] = 7.20763e18 + clad_dict['Cr54'] = 1.79413e18 + clad_dict['Ni58'] = 2.51631e19 + clad_dict['Ni60'] = 9.69278e18 + clad_dict['Ni61'] = 4.21338e17 + clad_dict['Ni62'] = 1.34341e18 + clad_dict['Ni64'] = 3.43127e17 + clad_dict['Zr90'] = 2.18320e22 + clad_dict['Zr91'] = 4.76104e21 + clad_dict['Zr92'] = 7.27734e21 + clad_dict['Zr94'] = 7.37494e21 + clad_dict['Zr96'] = 1.18814e21 + clad_dict['Sn112'] = 4.67352e18 + clad_dict['Sn114'] = 3.17992e18 + clad_dict['Sn115'] = 1.63814e18 + clad_dict['Sn116'] = 7.00546e19 + clad_dict['Sn117'] = 3.70027e19 + clad_dict['Sn118'] = 1.16694e20 + clad_dict['Sn119'] = 4.13872e19 + clad_dict['Sn120'] = 1.56973e20 + clad_dict['Sn122'] = 2.23076e19 + clad_dict['Sn124'] = 2.78966e19 + + # Gap concentration + # Funny enough, the example problem uses air. + gap_dict = OrderedDict() + gap_dict['O16'] = 7.86548e18 + gap_dict['O17'] = 2.99548e15 + gap_dict['N14'] = 3.38646e19 + gap_dict['N15'] = 1.23717e17 + + # Concentration to be used for coolant + # No boron + cool_dict = OrderedDict() + cool_dict['H1'] = 4.68063e22 + cool_dict['O16'] = 2.33427e22 + cool_dict['O17'] = 8.89086e18 + + # Store these dictionaries in the initial conditions dictionary + initial_density = OrderedDict() + initial_density['fuel_gd'] = fuel_gd_dict + initial_density['fuel'] = fuel_dict + initial_density['gap'] = gap_dict + initial_density['clad'] = clad_dict + initial_density['cool'] = cool_dict + + # Set up libraries to use + temperature = OrderedDict() + sab = OrderedDict() + + # Toggle betweeen MCNP and NNDC data + MCNP = False + + if MCNP: + temperature['fuel_gd'] = 900.0 + temperature['fuel'] = 900.0 + # We approximate temperature of everything as 600K, even though it was + # actually 580K. + temperature['gap'] = 600.0 + temperature['clad'] = 600.0 + temperature['cool'] = 600.0 + else: + temperature['fuel_gd'] = 293.6 + temperature['fuel'] = 293.6 + temperature['gap'] = 293.6 + temperature['clad'] = 293.6 + temperature['cool'] = 293.6 + + sab['cool'] = 'c_H_in_H2O' + + # Set up burnable materials + burn = OrderedDict() + burn['fuel_gd'] = True + burn['fuel'] = True + burn['gap'] = False + burn['clad'] = False + burn['cool'] = False + + return temperature, sab, initial_density, burn + +def segment_pin(n_rings, n_wedges, r_fuel, r_gap, r_clad): + """ Calculates a segmented pin. + + Separates a pin with n_rings and n_wedges. All cells have equal volume. + Pin is centered at origin. + """ + + # Calculate all the volumes of interest + v_fuel = math.pi * r_fuel**2 + v_gap = math.pi * r_gap**2 - v_fuel + v_clad = math.pi * r_clad**2 - v_fuel - v_gap + v_ring = v_fuel / n_rings + v_segment = v_ring / n_wedges + + # Compute ring radiuses + r_rings = np.zeros(n_rings) + + for i in range(n_rings): + r_rings[i] = math.sqrt(1.0/(math.pi) * v_ring * (i+1)) + + # Compute thetas + theta = np.linspace(0, 2*math.pi, n_wedges + 1) + + # Compute surfaces + fuel_rings = [openmc.ZCylinder(x0=0, y0=0, R=r_rings[i]) + for i in range(n_rings)] + + fuel_wedges = [openmc.Plane(A=math.cos(theta[i]), B=math.sin(theta[i])) + for i in range(n_wedges)] + + gap_ring = openmc.ZCylinder(x0=0, y0=0, R=r_gap) + clad_ring = openmc.ZCylinder(x0=0, y0=0, R=r_clad) + + # Create cells + fuel_cells = [] + if n_wedges == 1: + for i in range(n_rings): + cell = openmc.Cell(name='fuel') + if i == 0: + cell.region = -fuel_rings[0] + else: + cell.region = +fuel_rings[i-1] & -fuel_rings[i] + fuel_cells.append(cell) + else: + for i in range(n_rings): + for j in range(n_wedges): + cell = openmc.Cell(name='fuel') + if i == 0: + if j != n_wedges-1: + cell.region = (-fuel_rings[0] + & +fuel_wedges[j] + & -fuel_wedges[j+1]) + else: + cell.region = (-fuel_rings[0] + & +fuel_wedges[j] + & -fuel_wedges[0]) + else: + if j != n_wedges-1: + cell.region = (+fuel_rings[i-1] + & -fuel_rings[i] + & +fuel_wedges[j] + & -fuel_wedges[j+1]) + else: + cell.region = (+fuel_rings[i-1] + & -fuel_rings[i] + & +fuel_wedges[j] + & -fuel_wedges[0]) + fuel_cells.append(cell) + + # Gap ring + gap_cell = openmc.Cell(name='gap') + gap_cell.region = +fuel_rings[-1] & -gap_ring + fuel_cells.append(gap_cell) + + # Clad ring + clad_cell = openmc.Cell(name='clad') + clad_cell.region = +gap_ring & -clad_ring + fuel_cells.append(clad_cell) + + # Moderator + mod_cell = openmc.Cell(name='cool') + mod_cell.region = +clad_ring + fuel_cells.append(mod_cell) + + # Form universe + fuel_u = openmc.Universe() + fuel_u.add_cells(fuel_cells) + + return fuel_u, v_segment, v_gap, v_clad + +def generate_geometry(n_rings, n_wedges): + """ Generates example geometry. + + This function creates the initial geometry, a 9 pin reflective problem. + One pin, containing gadolinium, is discretized into sectors. + + In addition to what one would do with the general OpenMC geometry code, it + is necessary to create a dictionary, volume, that maps a cell ID to a + volume. Further, by naming cells the same as the above materials, the code + can automatically handle the mapping. + + Parameters + ---------- + n_rings : int + Number of rings to generate for the geometry + n_wedges : int + Number of wedges to generate for the geometry + """ + + pitch = 1.26197 + r_fuel = 0.412275 + r_gap = 0.418987 + r_clad = 0.476121 + + n_pin = 3 + + # This table describes the 'fuel' to actual type mapping + # It's not necessary to do it this way. Just adjust the initial conditions + # below. + mapping = ['fuel', 'fuel', 'fuel', + 'fuel', 'fuel_gd', 'fuel', + 'fuel', 'fuel', 'fuel'] + + # Form pin cell + fuel_u, v_segment, v_gap, v_clad = segment_pin(n_rings, n_wedges, r_fuel, r_gap, r_clad) + + # Form lattice + all_water_c = openmc.Cell(name='cool') + all_water_u = openmc.Universe(cells=(all_water_c, )) + + lattice = openmc.RectLattice() + lattice.pitch = [pitch]*2 + lattice.lower_left = [-pitch*n_pin/2, -pitch*n_pin/2] + lattice_array = [[fuel_u for i in range(n_pin)] for j in range(n_pin)] + lattice.universes = lattice_array + lattice.outer = all_water_u + + # Bound universe + x_low = openmc.XPlane(x0=-pitch*n_pin/2, boundary_type='reflective') + x_high = openmc.XPlane(x0=pitch*n_pin/2, boundary_type='reflective') + y_low = openmc.YPlane(y0=-pitch*n_pin/2, boundary_type='reflective') + y_high = openmc.YPlane(y0=pitch*n_pin/2, boundary_type='reflective') + z_low = openmc.ZPlane(z0=-10, boundary_type='reflective') + z_high = openmc.ZPlane(z0=10, boundary_type='reflective') + + # Compute bounding box + lower_left = [-pitch*n_pin/2, -pitch*n_pin/2, -10] + upper_right = [pitch*n_pin/2, pitch*n_pin/2, 10] + + root_c = openmc.Cell(fill=lattice) + root_c.region = (+x_low & -x_high + & +y_low & -y_high + & +z_low & -z_high) + root_u = openmc.Universe(universe_id=0, cells=(root_c, )) + geometry = openmc.Geometry(root_u) + + v_cool = pitch**2 - (v_gap + v_clad + n_rings * n_wedges * v_segment) + + # Store volumes for later usage + volume = {'fuel': v_segment, 'gap':v_gap, 'clad':v_clad, 'cool':v_cool} + + return geometry, volume, mapping, lower_left, upper_right + +def generate_problem(n_rings=5, n_wedges=8): + """ Merges geometry and materials. + + This function initializes the materials for each cell using the dictionaries + provided by generate_initial_number_density. It is assumed a cell named + 'fuel' will have further region differentiation (see mapping). + + Parameters + ---------- + n_rings : int, optional + Number of rings to generate for the geometry + n_wedges : int, optional + Number of wedges to generate for the geometry + """ + + # Get materials dictionary, geometry, and volumes + temperature, sab, initial_density, burn = generate_initial_number_density() + geometry, volume, mapping, lower_left, upper_right = generate_geometry(n_rings, n_wedges) + + # Apply distribmats, fill geometry + cells = geometry.root_universe.get_all_cells() + for cell_id in cells: + cell = cells[cell_id] + if cell.name == 'fuel': + + omc_mats = [] + + for cell_type in mapping: + omc_mat = density_to_mat(initial_density[cell_type]) + + if cell_type in sab: + omc_mat.add_s_alpha_beta(sab[cell_type]) + omc_mat.temperature = temperature[cell_type] + omc_mat.depletable = burn[cell_type] + omc_mat.volume = volume['fuel'] + + omc_mats.append(omc_mat) + + cell.fill = omc_mats + elif cell.name != '': + omc_mat = density_to_mat(initial_density[cell.name]) + + if cell.name in sab: + omc_mat.add_s_alpha_beta(sab[cell.name]) + omc_mat.temperature = temperature[cell.name] + omc_mat.depletable = burn[cell.name] + omc_mat.volume = volume[cell.name] + + cell.fill = omc_mat + + return geometry, lower_left, upper_right diff --git a/scripts/example_plot.py b/scripts/example_plot.py new file mode 100644 index 0000000000..d2c6ee9d6a --- /dev/null +++ b/scripts/example_plot.py @@ -0,0 +1,46 @@ +"""An example file showing how to plot data from a simulation.""" + +import matplotlib.pyplot as plt + +from opendeplete import read_results, \ + evaluate_single_nuclide, \ + evaluate_reaction_rate, \ + evaluate_eigenvalue + +# Set variables for where the data is, and what we want to read out. +result_folder = "test" + +# Load data +results = read_results(result_folder + "/results.h5") + +cell = "5" +nuc = "Gd157" +rxn = "(n,gamma)" + +# Total number of nuclides +plt.figure() +# Pointwise data +x, y = evaluate_single_nuclide(results, cell, nuc) +plt.semilogy(x, y) + +plt.xlabel("Time, s") +plt.ylabel("Total Number") +plt.savefig("number.pdf") + +# Reaction rate +plt.figure() +x, y = evaluate_reaction_rate(results, cell, nuc, rxn) +plt.plot(x, y) +plt.xlabel("Time, s") +plt.ylabel("Reaction Rate, 1/s") + +plt.savefig("rate.pdf") + +# Eigenvalue +plt.figure() +x, y = evaluate_eigenvalue(results) +plt.plot(x, y) +plt.xlabel("Time, s") +plt.ylabel("Eigenvalue") + +plt.savefig("eigvl.pdf") diff --git a/scripts/example_run.py b/scripts/example_run.py new file mode 100644 index 0000000000..bb80f65820 --- /dev/null +++ b/scripts/example_run.py @@ -0,0 +1,39 @@ +"""An example file showing how to run a simulation.""" + +import numpy as np +import opendeplete + +import example_geometry + +# Load geometry from example +geometry, lower_left, upper_right = example_geometry.generate_problem() + +# Create dt vector for 5.5 months with 15 day timesteps +dt1 = 15*24*60*60 # 15 days +dt2 = 5.5*30*24*60*60 # 5.5 months +N = np.floor(dt2/dt1) + +dt = np.repeat([dt1], N) + +# Create settings variable +settings = opendeplete.OpenMCSettings() + +settings.openmc_call = "openmc" +# An example for mpiexec: +# settings.openmc_call = ["mpiexec", "openmc"] +settings.particles = 1000 +settings.batches = 100 +settings.inactive = 40 +settings.lower_left = lower_left +settings.upper_right = upper_right +settings.entropy_dimension = [10, 10, 1] + +joule_per_mev = 1.6021766208e-13 +settings.power = 2.337e15*4*joule_per_mev # MeV/second cm from CASMO +settings.dt_vec = dt +settings.output_dir = 'test' + +op = opendeplete.OpenMCOperator(geometry, settings) + +# Perform simulation using the MCNPX/MCNP6 algorithm +opendeplete.integrator.cecm(op) diff --git a/scripts/make_chain.py b/scripts/make_chain.py new file mode 100644 index 0000000000..2e0d9d3bc4 --- /dev/null +++ b/scripts/make_chain.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python + +import glob +import os +from zipfile import ZipFile + +import requests +from tqdm import tqdm +import opendeplete + + +urls = [ + 'http://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-neutrons.zip', + 'http://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-decay.zip', + 'http://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-nfy.zip' +] + + +def download_file(url): + response = requests.get(url, stream=True) + filesize = int(response.headers.get('content-length')) + + # Check if file already downloaded + basename = url.split('/')[-1] + if os.path.exists(basename): + if os.path.getsize(basename) == filesize: + return basename + else: + overwrite = input('Overwrite {}? ([y]/n) '.format(basename)) + if overwrite.lower().startswith('n'): + return basename + + with open(basename, 'wb') as f: + with tqdm(desc='Downloading {}'.format(basename), + total=filesize, unit='B', unit_scale=True) as pbar: + for i, chunk in enumerate(response.iter_content(chunk_size=4096)): + pbar.update(4096) + if chunk: + f.write(chunk) + + return basename + + +def main(): + for url in urls: + basename = download_file(url) + with ZipFile(basename, 'r') as zf: + print('Extracting {}...'.format(basename)) + zf.extractall() + + decay_files = glob.glob(os.path.join('decay', '*.endf')) + nfy_files = glob.glob(os.path.join('nfy', '*.endf')) + neutron_files = glob.glob(os.path.join('neutrons', '*.endf')) + + chain = opendeplete.DepletionChain.from_endf(decay_files, nfy_files, neutron_files) + chain.xml_write('chain_endfb71.xml') + + +if __name__ == '__main__': + main() diff --git a/tests/deplete_tests/__init__.py b/tests/deplete_tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/deplete_tests/dummy_geometry.py b/tests/deplete_tests/dummy_geometry.py new file mode 100644 index 0000000000..6101519411 --- /dev/null +++ b/tests/deplete_tests/dummy_geometry.py @@ -0,0 +1,165 @@ +""" The OpenMC wrapper module. + +This module implements the OpenDeplete -> OpenMC linkage. +""" + +import numpy as np +import scipy.sparse as sp + +from opendeplete.reaction_rates import ReactionRates +from opendeplete.function import Operator + +class DummyGeometry(Operator): + """ This is a dummy geometry class with no statistical uncertainty. + + y_1' = sin(y_2) y_1 + cos(y_1) y_2 + y_2' = -cos(y_2) y_1 + sin(y_1) y_2 + + y_1(0) = 1 + y_2(0) = 1 + + y_1(1.5) ~ 2.3197067076743316 + y_2(1.5) ~ 3.1726475740397628 + + """ + + def __init__(self, settings): + Operator.__init__(self, settings) + + @property + def chain(self): + return self + + def eval(self, vec, print_out=False): + """ Evaluates F(y) + + Parameters + ---------- + vec : list of numpy.array + Total atoms to be used in function. + print_out : bool, optional, ignored + Whether or not to print out time. + + Returns + ------- + k : float + Zero. + rates : ReactionRates + Reaction rates from this simulation. + seed : int + Zero. + """ + + cell_to_ind = {"1" : 0} + nuc_to_ind = {"1" : 0, "2" : 1} + react_to_ind = {"1" : 0} + + reaction_rates = ReactionRates(cell_to_ind, nuc_to_ind, react_to_ind) + + reaction_rates[0, 0, 0] = vec[0][0] + reaction_rates[0, 1, 0] = vec[0][1] + + # Create a fake rates object + + return 0.0, reaction_rates, 0 + + def form_matrix(self, rates): + """ Forms the f(y) matrix in y' = f(y)y. + + Nominally a depletion matrix, this is abstracted on the off chance + that the function f has nothing to do with depletion at all. + + Parameters + ---------- + rates : numpy.ndarray + Slice of reaction rates for a single material + + Returns + ------- + scipy.sparse.csr_matrix + Sparse matrix representing f(y). + """ + + y_1 = rates[0, 0] + y_2 = rates[1, 0] + + mat = np.zeros((2, 2)) + a11 = np.sin(y_2) + a12 = np.cos(y_1) + a21 = -np.cos(y_2) + a22 = np.sin(y_1) + + return sp.csr_matrix(np.array([[a11, a12], [a21, a22]])) + + @property + def volume(self): + """ + volume : dict of str float + Volumes of material + """ + + return {"1": 0.0} + + @property + def nuc_list(self): + """ + nuc_list : list of str + A list of all nuclide names. Used for sorting the simulation. + """ + + return ["1", "2"] + + @property + def burn_list(self): + """ + burn_list : list of str + A list of all cell IDs to be burned. Used for sorting the simulation. + """ + + return ["1"] + + @property + def mat_tally_ind(self): + """Maps cell name to index in global geometry.""" + return {"1": 0} + + + @property + def reaction_rates(self): + """ + reaction_rates : ReactionRates + Reaction rates from the last operator step. + """ + cell_to_ind = {"1" : 0} + nuc_to_ind = {"1" : 0, "2" : 1} + react_to_ind = {"1" : 0} + + return ReactionRates(cell_to_ind, nuc_to_ind, react_to_ind) + + def initial_condition(self): + """ Returns initial vector. + + Returns + ------- + list of numpy.array + Total density for initial conditions. + """ + + return [np.array((1.0, 1.0))] + + def get_results_info(self): + """ Returns volume list, cell lists, and nuc lists. + + Returns + ------- + volume : dict of str float + Volumes corresponding to materials in full_burn_dict + nuc_list : list of str + A list of all nuclide names. Used for sorting the simulation. + burn_list : list of int + A list of all cell IDs to be burned. Used for sorting the simulation. + full_burn_dict : OrderedDict of str to int + Maps cell name to index in global geometry. + """ + + return self.volume, self.nuc_list, self.burn_list, self.mat_tally_ind diff --git a/tests/deplete_tests/example_geometry.py b/tests/deplete_tests/example_geometry.py new file mode 120000 index 0000000000..1071aabc05 --- /dev/null +++ b/tests/deplete_tests/example_geometry.py @@ -0,0 +1 @@ +../../scripts/example_geometry.py \ No newline at end of file diff --git a/tests/deplete_tests/test_atom_number.py b/tests/deplete_tests/test_atom_number.py new file mode 100644 index 0000000000..9a17230f86 --- /dev/null +++ b/tests/deplete_tests/test_atom_number.py @@ -0,0 +1,180 @@ +""" Tests for atom_number.py. """ + +import unittest + +import numpy as np + +from opendeplete import atom_number + +class TestAtomNumber(unittest.TestCase): + """ Tests for the AtomNumber class. """ + + def test_indexing(self): + """Tests the __getitem__ and __setitem__ routines simultaneously.""" + + mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} + nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} + volume = {"10000" : 0.38, "10001" : 0.21} + + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + + number["10000", "U238"] = 1.0 + number["10001", "U238"] = 2.0 + number["10000", "U235"] = 3.0 + number["10001", "U235"] = 4.0 + + # String indexing + self.assertEqual(number["10000", "U238"], 1.0) + self.assertEqual(number["10001", "U238"], 2.0) + self.assertEqual(number["10000", "U235"], 3.0) + self.assertEqual(number["10001", "U235"], 4.0) + + # Int indexing + self.assertEqual(number[0, 0], 1.0) + self.assertEqual(number[1, 0], 2.0) + self.assertEqual(number[0, 1], 3.0) + self.assertEqual(number[1, 1], 4.0) + + number[0, 0] = 5.0 + + self.assertEqual(number[0, 0], 5.0) + self.assertEqual(number["10000", "U238"], 5.0) + + def test_n_mat(self): + """ Test number of materials property. """ + mat_to_ind = {"10000" : 0, "10001" : 1} + nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} + volume = {"10000" : 0.38, "10001" : 0.21} + + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + + self.assertEqual(number.n_mat, 2) + + def test_n_nuc(self): + """ Test number of nuclides property. """ + mat_to_ind = {"10000" : 0, "10001" : 1} + nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} + volume = {"10000" : 0.38, "10001" : 0.21} + + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + + self.assertEqual(number.n_nuc, 3) + + def test_burn_nuc_list(self): + """ Test the list of burned nuclides property """ + mat_to_ind = {"10000" : 0, "10001" : 1} + nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} + volume = {"10000" : 0.38, "10001" : 0.21} + + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + + self.assertEqual(number.burn_nuc_list, ["U238", "U235"]) + + def test_burn_mat_list(self): + """ Test the list of burned nuclides property """ + mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} + nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} + volume = {"10000" : 0.38, "10001" : 0.21} + + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + + self.assertEqual(number.burn_mat_list, ["10000", "10001"]) + + def test_density_indexing(self): + """Tests the get and set_atom_density routines simultaneously.""" + + mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} + nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} + volume = {"10000" : 0.38, "10001" : 0.21} + + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + + number.set_atom_density("10000", "U238", 1.0) + number.set_atom_density("10001", "U238", 2.0) + number.set_atom_density("10002", "U238", 3.0) + number.set_atom_density("10000", "U235", 4.0) + number.set_atom_density("10001", "U235", 5.0) + number.set_atom_density("10002", "U235", 6.0) + number.set_atom_density("10000", "U234", 7.0) + number.set_atom_density("10001", "U234", 8.0) + number.set_atom_density("10002", "U234", 9.0) + + # String indexing + self.assertEqual(number.get_atom_density("10000", "U238"), 1.0) + self.assertEqual(number.get_atom_density("10001", "U238"), 2.0) + self.assertEqual(number.get_atom_density("10002", "U238"), 3.0) + self.assertEqual(number.get_atom_density("10000", "U235"), 4.0) + self.assertEqual(number.get_atom_density("10001", "U235"), 5.0) + self.assertEqual(number.get_atom_density("10002", "U235"), 6.0) + self.assertEqual(number.get_atom_density("10000", "U234"), 7.0) + self.assertEqual(number.get_atom_density("10001", "U234"), 8.0) + self.assertEqual(number.get_atom_density("10002", "U234"), 9.0) + + # Int indexing + self.assertEqual(number.get_atom_density(0, 0), 1.0) + self.assertEqual(number.get_atom_density(1, 0), 2.0) + self.assertEqual(number.get_atom_density(2, 0), 3.0) + self.assertEqual(number.get_atom_density(0, 1), 4.0) + self.assertEqual(number.get_atom_density(1, 1), 5.0) + self.assertEqual(number.get_atom_density(2, 1), 6.0) + self.assertEqual(number.get_atom_density(0, 2), 7.0) + self.assertEqual(number.get_atom_density(1, 2), 8.0) + self.assertEqual(number.get_atom_density(2, 2), 9.0) + + + number.set_atom_density(0, 0, 5.0) + + self.assertEqual(number.get_atom_density(0, 0), 5.0) + + # Verify volume is used correctly + self.assertEqual(number[0, 0], 5.0 * 0.38) + self.assertEqual(number[1, 0], 2.0 * 0.21) + self.assertEqual(number[2, 0], 3.0 * 1.0) + self.assertEqual(number[0, 1], 4.0 * 0.38) + self.assertEqual(number[1, 1], 5.0 * 0.21) + self.assertEqual(number[2, 1], 6.0 * 1.0) + self.assertEqual(number[0, 2], 7.0 * 0.38) + self.assertEqual(number[1, 2], 8.0 * 0.21) + self.assertEqual(number[2, 2], 9.0 * 1.0) + + def test_get_mat_slice(self): + """Tests getting slices.""" + + mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} + nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} + volume = {"10000" : 0.38, "10001" : 0.21} + + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + + number.number = np.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0]]) + + sl = number.get_mat_slice(0) + + np.testing.assert_array_equal(sl, np.array([1.0, 2.0])) + + sl = number.get_mat_slice("10000") + + np.testing.assert_array_equal(sl, np.array([1.0, 2.0])) + + def test_set_mat_slice(self): + """Tests getting slices.""" + + mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} + nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} + volume = {"10000" : 0.38, "10001" : 0.21} + + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + + number.set_mat_slice(0, [1.0, 2.0]) + + self.assertEqual(number[0, 0], 1.0) + self.assertEqual(number[0, 1], 2.0) + + number.set_mat_slice("10000", [3.0, 4.0]) + + self.assertEqual(number[0, 0], 3.0) + self.assertEqual(number[0, 1], 4.0) + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/deplete_tests/test_cecm_regression.py b/tests/deplete_tests/test_cecm_regression.py new file mode 100644 index 0000000000..23a6342000 --- /dev/null +++ b/tests/deplete_tests/test_cecm_regression.py @@ -0,0 +1,69 @@ +""" Regression tests for cecm.py""" + +import os +import unittest + +import numpy as np + +import opendeplete +from opendeplete import results +from opendeplete import utilities +import test.dummy_geometry as dummy_geometry + + +class TestCECMRegression(unittest.TestCase): + """ Regression tests for opendeplete.integrator.cecm algorithm. + + These tests integrate a simple test problem described in dummy_geometry.py. + """ + + @classmethod + def setUpClass(cls): + """ Save current directory in case integrator crashes.""" + cls.cwd = os.getcwd() + cls.results = "test_integrator_regression" + + def test_cecm(self): + """ Integral regression test of integrator algorithm using CE/CM. """ + + settings = opendeplete.Settings() + settings.dt_vec = [0.75, 0.75] + settings.output_dir = self.results + + op = dummy_geometry.DummyGeometry(settings) + + # Perform simulation using the MCNPX/MCNP6 algorithm + opendeplete.cecm(op, print_out=False) + + # Load the files + res = results.read_results(settings.output_dir + "/results.h5") + + _, y1 = utilities.evaluate_single_nuclide(res, "1", "1") + _, y2 = utilities.evaluate_single_nuclide(res, "1", "2") + + # Mathematica solution + s1 = [1.86872629872102, 1.395525772416039] + s2 = [2.18097439443550, 2.69429754646747] + + tol = 1.0e-13 + + self.assertLess(np.absolute(y1[1] - s1[0]), tol) + self.assertLess(np.absolute(y2[1] - s1[1]), tol) + + self.assertLess(np.absolute(y1[2] - s2[0]), tol) + self.assertLess(np.absolute(y2[2] - s2[1]), tol) + + @classmethod + def tearDownClass(cls): + """ Clean up files""" + + os.chdir(cls.cwd) + + opendeplete.comm.barrier() + if opendeplete.comm.rank == 0: + os.remove(os.path.join(cls.results, "results.h5")) + os.rmdir(cls.results) + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/deplete_tests/test_cram.py b/tests/deplete_tests/test_cram.py new file mode 100644 index 0000000000..2744adbf48 --- /dev/null +++ b/tests/deplete_tests/test_cram.py @@ -0,0 +1,48 @@ +""" Tests for cram.py """ + +import unittest + +import numpy as np +import scipy.sparse as sp + +from opendeplete.integrator import CRAM16, CRAM48 + +class TestCram(unittest.TestCase): + """ Tests for cram.py + + Compares a few Mathematica matrix exponentials to CRAM16/CRAM48. + """ + + def test_CRAM16(self): + """ Test 16-term CRAM. """ + x = np.array([1.0, 1.0]) + mat = sp.csr_matrix([[-1.0, 0.0], [-2.0, -3.0]]) + dt = 0.1 + + z = CRAM16(mat, x, dt) + + # Solution from mathematica + z0 = np.array((0.904837418035960, 0.576799023327476)) + + tol = 1.0e-15 + + self.assertLess(np.linalg.norm(z - z0), tol) + + def test_CRAM48(self): + """ Test 48-term CRAM. """ + x = np.array([1.0, 1.0]) + mat = sp.csr_matrix([[-1.0, 0.0], [-2.0, -3.0]]) + dt = 0.1 + + z = CRAM48(mat, x, dt) + + # Solution from mathematica + z0 = np.array((0.904837418035960, 0.576799023327476)) + + tol = 1.0e-15 + + self.assertLess(np.linalg.norm(z - z0), tol) + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/deplete_tests/test_depletion_chain.py b/tests/deplete_tests/test_depletion_chain.py new file mode 100644 index 0000000000..216d1e68f7 --- /dev/null +++ b/tests/deplete_tests/test_depletion_chain.py @@ -0,0 +1,197 @@ +""" Tests for depletion_chain.py""" + +from collections import OrderedDict +import os +import unittest + +import numpy as np + +from opendeplete import comm, depletion_chain, reaction_rates, nuclide + + +class TestDepletionChain(unittest.TestCase): + """ Tests for DepletionChain class.""" + + def test__init__(self): + """ Test depletion chain initialization.""" + dep = depletion_chain.DepletionChain() + + self.assertIsInstance(dep.nuclides, list) + self.assertIsInstance(dep.nuclide_dict, OrderedDict) + self.assertIsInstance(dep.react_to_ind, OrderedDict) + + def test_n_nuclides(self): + """ Test depletion chain n_nuclides parameter. """ + dep = depletion_chain.DepletionChain() + + dep.nuclides = ["NucA", "NucB", "NucC"] + + self.assertEqual(dep.n_nuclides, 3) + + def test_from_endf(self): + """Test depletion chain building from ENDF. Empty at the moment until we figure + out a good way to unit-test this.""" + pass + + def test_xml_read(self): + """ Read chain_test.xml and ensure all values are correct. """ + # Unfortunately, this routine touches a lot of the code, but most of + # the components external to depletion_chain.py are simple storage + # types. + + dep = depletion_chain.DepletionChain.xml_read("chains/chain_test.xml") + + # Basic checks + self.assertEqual(dep.n_nuclides, 3) + + # A tests + nuc = dep.nuclides[dep.nuclide_dict["A"]] + + self.assertEqual(nuc.name, "A") + self.assertEqual(nuc.half_life, 2.36520E+04) + self.assertEqual(nuc.n_decay_modes, 2) + modes = nuc.decay_modes + self.assertEqual([m.target for m in modes], ["B", "C"]) + self.assertEqual([m.type for m in modes], ["beta1", "beta2"]) + self.assertEqual([m.branching_ratio for m in modes], [0.6, 0.4]) + self.assertEqual(nuc.n_reaction_paths, 1) + self.assertEqual([r.target for r in nuc.reactions], ["C"]) + self.assertEqual([r.type for r in nuc.reactions], ["(n,gamma)"]) + self.assertEqual([r.branching_ratio for r in nuc.reactions], [1.0]) + + # B tests + nuc = dep.nuclides[dep.nuclide_dict["B"]] + + self.assertEqual(nuc.name, "B") + self.assertEqual(nuc.half_life, 3.29040E+04) + self.assertEqual(nuc.n_decay_modes, 1) + modes = nuc.decay_modes + self.assertEqual([m.target for m in modes], ["A"]) + self.assertEqual([m.type for m in modes], ["beta"]) + self.assertEqual([m.branching_ratio for m in modes], [1.0]) + self.assertEqual(nuc.n_reaction_paths, 1) + self.assertEqual([r.target for r in nuc.reactions], ["C"]) + self.assertEqual([r.type for r in nuc.reactions], ["(n,gamma)"]) + self.assertEqual([r.branching_ratio for r in nuc.reactions], [1.0]) + + # C tests + nuc = dep.nuclides[dep.nuclide_dict["C"]] + + self.assertEqual(nuc.name, "C") + self.assertEqual(nuc.n_decay_modes, 0) + self.assertEqual(nuc.n_reaction_paths, 3) + self.assertEqual([r.target for r in nuc.reactions], [None, "A", "B"]) + self.assertEqual([r.type for r in nuc.reactions], ["fission", "(n,gamma)", "(n,gamma)"]) + self.assertEqual([r.branching_ratio for r in nuc.reactions], [1.0, 0.7, 0.3]) + + # Yield tests + self.assertEqual(nuc.yield_energies, [0.0253]) + self.assertEqual(list(nuc.yield_data.keys()), [0.0253]) + self.assertEqual(nuc.yield_data[0.0253], + [("A", 0.0292737), ("B", 0.002566345)]) + + def test_xml_write(self): + """Test writing a depletion chain to XML.""" + + # Prevent different MPI ranks from conflicting + filename = 'test%u.xml' % comm.rank + + A = nuclide.Nuclide() + A.name = "A" + A.half_life = 2.36520e4 + A.decay_modes = [ + nuclide.DecayTuple("beta1", "B", 0.6), + nuclide.DecayTuple("beta2", "C", 0.4) + ] + A.reactions = [nuclide.ReactionTuple("(n,gamma)", "C", 0.0, 1.0)] + + B = nuclide.Nuclide() + B.name = "B" + B.half_life = 3.29040e4 + B.decay_modes = [nuclide.DecayTuple("beta", "A", 1.0)] + B.reactions = [nuclide.ReactionTuple("(n,gamma)", "C", 0.0, 1.0)] + + C = nuclide.Nuclide() + C.name = "C" + C.reactions = [ + nuclide.ReactionTuple("fission", None, 2.0e8, 1.0), + nuclide.ReactionTuple("(n,gamma)", "A", 0.0, 0.7), + nuclide.ReactionTuple("(n,gamma)", "B", 0.0, 0.3) + ] + C.yield_energies = [0.0253] + C.yield_data = {0.0253: [("A", 0.0292737), ("B", 0.002566345)]} + + chain = depletion_chain.DepletionChain() + chain.nuclides = [A, B, C] + chain.xml_write(filename) + + original = open('chains/chain_test.xml', 'r').read() + chain_xml = open(filename, 'r').read() + self.assertEqual(original, chain_xml) + + os.remove(filename) + + def test_form_matrix(self): + """ Using chain_test, and a dummy reaction rate, compute the matrix. """ + # Relies on test_xml_read passing. + + dep = depletion_chain.DepletionChain.xml_read("chains/chain_test.xml") + + cell_ind = {"10000": 0, "10001": 1} + nuc_ind = {"A": 0, "B": 1, "C": 2} + react_ind = dep.react_to_ind + + react = reaction_rates.ReactionRates(cell_ind, nuc_ind, react_ind) + + dep.nuc_to_react_ind = nuc_ind + + react["10000", "C", "fission"] = 1.0 + react["10000", "A", "(n,gamma)"] = 2.0 + react["10000", "B", "(n,gamma)"] = 3.0 + react["10000", "C", "(n,gamma)"] = 4.0 + + mat = dep.form_matrix(react[0, :, :]) + # Loss A, decay, (n, gamma) + mat00 = -np.log(2) / 2.36520E+04 - 2 + # A -> B, decay, 0.6 branching ratio + mat10 = np.log(2) / 2.36520E+04 * 0.6 + # A -> C, decay, 0.4 branching ratio + (n,gamma) + mat20 = np.log(2) / 2.36520E+04 * 0.4 + 2 + + # B -> A, decay, 1.0 branching ratio + mat01 = np.log(2)/3.29040E+04 + # Loss B, decay, (n, gamma) + mat11 = -np.log(2)/3.29040E+04 - 3 + # B -> C, (n, gamma) + mat21 = 3 + + # C -> A fission, (n, gamma) + mat02 = 0.0292737 * 1.0 + 4.0 * 0.7 + # C -> B fission, (n, gamma) + mat12 = 0.002566345 * 1.0 + 4.0 * 0.3 + # Loss C, fission, (n, gamma) + mat22 = -1.0 - 4.0 + + self.assertEqual(mat[0, 0], mat00) + self.assertEqual(mat[1, 0], mat10) + self.assertEqual(mat[2, 0], mat20) + self.assertEqual(mat[0, 1], mat01) + self.assertEqual(mat[1, 1], mat11) + self.assertEqual(mat[2, 1], mat21) + self.assertEqual(mat[0, 2], mat02) + self.assertEqual(mat[1, 2], mat12) + self.assertEqual(mat[2, 2], mat22) + + def test_nuc_by_ind(self): + """ Test nuc_by_ind converter function. """ + dep = depletion_chain.DepletionChain() + + dep.nuclides = ["NucA", "NucB", "NucC"] + dep.nuclide_dict = {"NucA" : 0, "NucB" : 1, "NucC" : 2} + + self.assertEqual("NucA", dep.nuc_by_ind("NucA")) + self.assertEqual("NucB", dep.nuc_by_ind("NucB")) + self.assertEqual("NucC", dep.nuc_by_ind("NucC")) + +if __name__ == '__main__': + unittest.main() diff --git a/tests/deplete_tests/test_full.py b/tests/deplete_tests/test_full.py new file mode 100644 index 0000000000..f9a6c7493d --- /dev/null +++ b/tests/deplete_tests/test_full.py @@ -0,0 +1,119 @@ +""" Full system test suite. """ + +import shutil +import unittest + +import numpy as np + +import opendeplete +from opendeplete import results +from opendeplete import utilities +import test.example_geometry as example_geometry + + +class TestFull(unittest.TestCase): + """ Full system test suite. + + Runs an entire OpenMC simulation with depletion coupling and verifies + that the outputs match a reference file. Sensitive to changes in + OpenMC. + """ + + def test_full(self): + """ + This test runs a complete OpenMC simulation and tests the outputs. + It will take a while. + """ + + n_rings = 2 + n_wedges = 4 + + # Load geometry from example + geometry, lower_left, upper_right = \ + example_geometry.generate_problem(n_rings=n_rings, n_wedges=n_wedges) + + # Create dt vector for 3 steps with 15 day timesteps + dt1 = 15*24*60*60 # 15 days + dt2 = 1.5*30*24*60*60 # 1.5 months + N = np.floor(dt2/dt1) + + dt = np.repeat([dt1], N) + + # Create settings variable + settings = opendeplete.OpenMCSettings() + + settings.chain_file = "chains/chain_simple.xml" + settings.openmc_call = "openmc" + settings.openmc_npernode = 2 + settings.particles = 100 + settings.batches = 100 + settings.inactive = 40 + settings.lower_left = lower_left + settings.upper_right = upper_right + settings.entropy_dimension = [10, 10, 1] + + settings.round_number = True + settings.constant_seed = 1 + + joule_per_mev = 1.6021766208e-13 + settings.power = 2.337e15*4*joule_per_mev # MeV/second cm from CASMO + settings.dt_vec = dt + settings.output_dir = "test_full" + + op = opendeplete.OpenMCOperator(geometry, settings) + + # Perform simulation using the predictor algorithm + opendeplete.integrator.predictor(op) + + # Load the files + res_test = results.read_results(settings.output_dir + "/results.h5") + + # Load the reference + res_old = results.read_results("test/test_reference.h5") + + # Assert same mats + for mat in res_old[0].mat_to_ind: + self.assertIn(mat, res_test[0].mat_to_ind, + msg="Cell " + mat + " not in new results.") + for nuc in res_old[0].nuc_to_ind: + self.assertIn(nuc, res_test[0].nuc_to_ind, + msg="Nuclide " + nuc + " not in new results.") + + for mat in res_test[0].mat_to_ind: + self.assertIn(mat, res_old[0].mat_to_ind, + msg="Cell " + mat + " not in old results.") + for nuc in res_test[0].nuc_to_ind: + self.assertIn(nuc, res_old[0].nuc_to_ind, + msg="Nuclide " + nuc + " not in old results.") + + for mat in res_test[0].mat_to_ind: + for nuc in res_test[0].nuc_to_ind: + _, y_test = utilities.evaluate_single_nuclide(res_test, mat, nuc) + _, y_old = utilities.evaluate_single_nuclide(res_old, mat, nuc) + + # Test each point + + tol = 1.0e-6 + + correct = True + for i, ref in enumerate(y_old): + if ref != y_test[i]: + if ref != 0.0: + if np.abs(y_test[i] - ref) / ref > tol: + correct = False + else: + correct = False + + self.assertTrue(correct, + msg="Discrepancy in mat " + mat + " and nuc " + nuc + + "\n" + str(y_old) + "\n" + str(y_test)) + + def tearDown(self): + """ Clean up files""" + opendeplete.comm.barrier() + if opendeplete.comm.rank == 0: + shutil.rmtree("test_full", ignore_errors=True) + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/deplete_tests/test_integrator.py b/tests/deplete_tests/test_integrator.py new file mode 100644 index 0000000000..7e121ce167 --- /dev/null +++ b/tests/deplete_tests/test_integrator.py @@ -0,0 +1,116 @@ +""" Tests for integrator.py """ + +import copy +import os +import unittest +from unittest.mock import MagicMock + +import numpy as np + +from opendeplete import integrator, ReactionRates, results, comm + + +class TestIntegrator(unittest.TestCase): + """ Tests for integrator.py + + It is worth noting that opendeplete.integrate is extremely complex, to + the point I am unsure if it can be reasonably unit-tested. For the time + being, it will be left unimplemented and testing will be done via + regression (in test_integrator_regression.py) + """ + + def test_save_results(self): + """ Test data save module """ + + stages = 3 + + np.random.seed(comm.rank) + + # Mock geometry + op = MagicMock() + + vol_dict = {} + full_burn_dict = {} + + j = 0 + for i in range(comm.size): + vol_dict[str(2*i)] = 1.2 + vol_dict[str(2*i + 1)] = 1.2 + full_burn_dict[str(2*i)] = j + full_burn_dict[str(2*i + 1)] = j + 1 + j += 2 + + burn_list = [str(i) for i in range(2*comm.rank, 2*comm.rank + 2)] + nuc_list = ["na", "nb"] + + op.get_results_info.return_value = vol_dict, nuc_list, burn_list, full_burn_dict + + # Construct x + x1 = [] + x2 = [] + + for i in range(stages): + x1.append([np.random.rand(2), np.random.rand(2)]) + x2.append([np.random.rand(2), np.random.rand(2)]) + + # Construct r + cell_dict = {s:i for i, s in enumerate(burn_list)} + r1 = ReactionRates(cell_dict, {"na":0, "nb":1}, {"ra":0, "rb":1}) + r1.rates = np.random.rand(2, 2, 2) + + rate1 = [] + rate2 = [] + + for i in range(stages): + rate1.append(copy.deepcopy(r1)) + r1.rates = np.random.rand(2, 2, 2) + rate2.append(copy.deepcopy(r1)) + r1.rates = np.random.rand(2, 2, 2) + + # Create global terms + eigvl1 = np.random.rand(stages) + eigvl2 = np.random.rand(stages) + seed1 = [np.random.randint(100) for i in range(stages)] + seed2 = [np.random.randint(100) for i in range(stages)] + + eigvl1 = comm.bcast(eigvl1, root=0) + eigvl2 = comm.bcast(eigvl2, root=0) + seed1 = comm.bcast(seed1, root=0) + seed2 = comm.bcast(seed2, root=0) + + t1 = [0.0, 1.0] + t2 = [1.0, 2.0] + + integrator.save_results(op, x1, rate1, eigvl1, seed1, t1, 0) + integrator.save_results(op, x2, rate2, eigvl2, seed2, t2, 1) + + # Load the files + res = results.read_results("results.h5") + + for i in range(stages): + for mat_i, mat in enumerate(burn_list): + + for nuc_i, nuc in enumerate(nuc_list): + self.assertEqual(res[0][i, mat, nuc], x1[i][mat_i][nuc_i]) + self.assertEqual(res[1][i, mat, nuc], x2[i][mat_i][nuc_i]) + np.testing.assert_array_equal(res[0].rates[i][mat, nuc, :], + rate1[i][mat, nuc, :]) + np.testing.assert_array_equal(res[1].rates[i][mat, nuc, :], + rate2[i][mat, nuc, :]) + + np.testing.assert_array_equal(res[0].k, eigvl1) + np.testing.assert_array_equal(res[0].seeds, seed1) + np.testing.assert_array_equal(res[0].time, t1) + + np.testing.assert_array_equal(res[1].k, eigvl2) + np.testing.assert_array_equal(res[1].seeds, seed2) + np.testing.assert_array_equal(res[1].time, t2) + + # Delete files + comm.barrier() + if comm.rank == 0: + os.remove("results.h5") + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/deplete_tests/test_nuclide.py b/tests/deplete_tests/test_nuclide.py new file mode 100644 index 0000000000..c5439b2aa3 --- /dev/null +++ b/tests/deplete_tests/test_nuclide.py @@ -0,0 +1,121 @@ +""" Tests for nuclide.py. """ + +import unittest +import xml.etree.ElementTree as ET + +from opendeplete import nuclide + + +class TestNuclide(unittest.TestCase): + """ Tests for the nuclide class. """ + + def test_n_decay_modes(self): + """ Test the decay mode count parameter. """ + + nuc = nuclide.Nuclide() + + nuc.decay_modes = [ + nuclide.DecayTuple("beta1", "a", 0.5), + nuclide.DecayTuple("beta2", "b", 0.3), + nuclide.DecayTuple("beta3", "c", 0.2) + ] + + self.assertEqual(nuc.n_decay_modes, 3) + + def test_n_reaction_paths(self): + """ Test the reaction path count parameter. """ + + nuc = nuclide.Nuclide() + + nuc.reactions = [ + nuclide.ReactionTuple("(n,2n)", "a", 0.0, 1.0), + nuclide.ReactionTuple("(n,3n)", "b", 0.0, 1.0), + nuclide.ReactionTuple("(n,4n)", "c", 0.0, 1.0) + ] + + self.assertEqual(nuc.n_reaction_paths, 3) + + def test_xml_read(self): + """Test reading nuclide data from an XML element.""" + + data = """ + + + + + + + + + + 0.0253 + + Te134 Zr100 Xe138 + 0.062155 0.0497641 0.0481413 + + + + """ + + element = ET.fromstring(data) + u235 = nuclide.Nuclide.xml_read(element) + + self.assertEqual(u235.decay_modes, [ + nuclide.DecayTuple('sf', 'U235', 7.2e-11), + nuclide.DecayTuple('alpha', 'Th231', 1 - 7.2e-11) + ]) + self.assertEqual(u235.reactions, [ + nuclide.ReactionTuple('(n,2n)', 'U234', -5297781.0, 1.0), + nuclide.ReactionTuple('(n,3n)', 'U233', -12142300.0, 1.0), + nuclide.ReactionTuple('(n,4n)', 'U232', -17885600.0, 1.0), + nuclide.ReactionTuple('(n,gamma)', 'U236', 6545200.0, 1.0), + nuclide.ReactionTuple('fission', None, 193405400.0, 1.0), + ]) + self.assertEqual(u235.yield_energies, [0.0253]) + self.assertEqual(u235.yield_data, { + 0.0253: [('Te134', 0.062155), ('Zr100', 0.0497641), + ('Xe138', 0.0481413)] + }) + + def test_xml_write(self): + """Test writing nuclide data to an XML element.""" + + C = nuclide.Nuclide() + C.name = "C" + C.half_life = 0.123 + C.decay_modes = [ + nuclide.DecayTuple('beta-', 'B', 0.99), + nuclide.DecayTuple('alpha', 'D', 0.01) + ] + C.reactions = [ + nuclide.ReactionTuple('fission', None, 2.0e8, 1.0), + nuclide.ReactionTuple('(n,gamma)', 'A', 0.0, 1.0) + ] + C.yield_energies = [0.0253] + C.yield_data = {0.0253: [("A", 0.0292737), ("B", 0.002566345)]} + element = C.xml_write() + + self.assertEqual(element.get("half_life"), "0.123") + + decay_elems = element.findall("decay_type") + self.assertEqual(len(decay_elems), 2) + self.assertEqual(decay_elems[0].get("type"), "beta-") + self.assertEqual(decay_elems[0].get("target"), "B") + self.assertEqual(decay_elems[0].get("branching_ratio"), "0.99") + self.assertEqual(decay_elems[1].get("type"), "alpha") + self.assertEqual(decay_elems[1].get("target"), "D") + self.assertEqual(decay_elems[1].get("branching_ratio"), "0.01") + + rx_elems = element.findall("reaction_type") + self.assertEqual(len(rx_elems), 2) + self.assertEqual(rx_elems[0].get("type"), "fission") + self.assertEqual(float(rx_elems[0].get("Q")), 2.0e8) + self.assertEqual(rx_elems[1].get("type"), "(n,gamma)") + self.assertEqual(rx_elems[1].get("target"), "A") + self.assertEqual(float(rx_elems[1].get("Q")), 0.0) + + self.assertIsNotNone(element.find('neutron_fission_yields')) + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/deplete_tests/test_predictor_regression.py b/tests/deplete_tests/test_predictor_regression.py new file mode 100644 index 0000000000..c72ae8a475 --- /dev/null +++ b/tests/deplete_tests/test_predictor_regression.py @@ -0,0 +1,68 @@ +""" Regression tests for predictor.py""" + +import os +import unittest + +import numpy as np + +import opendeplete +from opendeplete import results +from opendeplete import utilities +import test.dummy_geometry as dummy_geometry + +class TestPredictorRegression(unittest.TestCase): + """ Regression tests for opendeplete.integrator.predictor algorithm. + + These tests integrate a simple test problem described in dummy_geometry.py. + """ + + @classmethod + def setUpClass(cls): + """ Save current directory in case integrator crashes.""" + cls.cwd = os.getcwd() + cls.results = "test_integrator_regression" + + def test_predictor(self): + """ Integral regression test of integrator algorithm using CE/CM. """ + + settings = opendeplete.Settings() + settings.dt_vec = [0.75, 0.75] + settings.output_dir = self.results + + op = dummy_geometry.DummyGeometry(settings) + + # Perform simulation using the predictor algorithm + opendeplete.predictor(op, print_out=False) + + # Load the files + res = results.read_results(settings.output_dir + "/results.h5") + + _, y1 = utilities.evaluate_single_nuclide(res, "1", "1") + _, y2 = utilities.evaluate_single_nuclide(res, "1", "2") + + # Mathematica solution + s1 = [2.46847546272295, 0.986431226850467] + s2 = [4.11525874568034, -0.0581692232513460] + + tol = 1.0e-13 + + self.assertLess(np.absolute(y1[1] - s1[0]), tol) + self.assertLess(np.absolute(y2[1] - s1[1]), tol) + + self.assertLess(np.absolute(y1[2] - s2[0]), tol) + self.assertLess(np.absolute(y2[2] - s2[1]), tol) + + @classmethod + def tearDownClass(cls): + """ Clean up files""" + + os.chdir(cls.cwd) + + opendeplete.comm.barrier() + if opendeplete.comm.rank == 0: + os.remove(os.path.join(cls.results, "results.h5")) + os.rmdir(cls.results) + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/deplete_tests/test_reaction_rates.py b/tests/deplete_tests/test_reaction_rates.py new file mode 100644 index 0000000000..4821ec18cd --- /dev/null +++ b/tests/deplete_tests/test_reaction_rates.py @@ -0,0 +1,86 @@ +""" Tests for reaction_rates.py. """ + +import unittest + +from opendeplete import reaction_rates + + +class TestReactionRates(unittest.TestCase): + """ Tests for the ReactionRates class. """ + + def test_indexing(self): + """Tests the __getitem__ and __setitem__ routines simultaneously.""" + + mat_to_ind = {"10000" : 0, "10001" : 1} + nuc_to_ind = {"U238" : 0, "U235" : 1} + react_to_ind = {"fission" : 0, "(n,gamma)" : 1} + + rates = reaction_rates.ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) + + rates["10000", "U238", "fission"] = 1.0 + rates["10001", "U238", "fission"] = 2.0 + rates["10000", "U235", "fission"] = 3.0 + rates["10001", "U235", "fission"] = 4.0 + rates["10000", "U238", "(n,gamma)"] = 5.0 + rates["10001", "U238", "(n,gamma)"] = 6.0 + rates["10000", "U235", "(n,gamma)"] = 7.0 + rates["10001", "U235", "(n,gamma)"] = 8.0 + + # String indexing + self.assertEqual(rates["10000", "U238", "fission"], 1.0) + self.assertEqual(rates["10001", "U238", "fission"], 2.0) + self.assertEqual(rates["10000", "U235", "fission"], 3.0) + self.assertEqual(rates["10001", "U235", "fission"], 4.0) + self.assertEqual(rates["10000", "U238", "(n,gamma)"], 5.0) + self.assertEqual(rates["10001", "U238", "(n,gamma)"], 6.0) + self.assertEqual(rates["10000", "U235", "(n,gamma)"], 7.0) + self.assertEqual(rates["10001", "U235", "(n,gamma)"], 8.0) + + # Int indexing + self.assertEqual(rates[0, 0, 0], 1.0) + self.assertEqual(rates[1, 0, 0], 2.0) + self.assertEqual(rates[0, 1, 0], 3.0) + self.assertEqual(rates[1, 1, 0], 4.0) + self.assertEqual(rates[0, 0, 1], 5.0) + self.assertEqual(rates[1, 0, 1], 6.0) + self.assertEqual(rates[0, 1, 1], 7.0) + self.assertEqual(rates[1, 1, 1], 8.0) + + rates[0, 0, 0] = 5.0 + + self.assertEqual(rates[0, 0, 0], 5.0) + self.assertEqual(rates["10000", "U238", "fission"], 5.0) + + def test_n_mat(self): + """ Test number of materials property. """ + mat_to_ind = {"10000" : 0, "10001" : 1} + nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} + react_to_ind = {"fission" : 0, "(n,gamma)" : 1, "(n,2n)" : 2, "(n,3n)" : 3} + + rates = reaction_rates.ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) + + self.assertEqual(rates.n_mat, 2) + + def test_n_nuc(self): + """ Test number of nuclides property. """ + mat_to_ind = {"10000" : 0, "10001" : 1} + nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} + react_to_ind = {"fission" : 0, "(n,gamma)" : 1, "(n,2n)" : 2, "(n,3n)" : 3} + + rates = reaction_rates.ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) + + self.assertEqual(rates.n_nuc, 3) + + def test_n_react(self): + """ Test number of reactions property. """ + mat_to_ind = {"10000" : 0, "10001" : 1} + nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} + react_to_ind = {"fission" : 0, "(n,gamma)" : 1, "(n,2n)" : 2, "(n,3n)" : 3} + + rates = reaction_rates.ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) + + self.assertEqual(rates.n_react, 4) + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/deplete_tests/test_reference.h5 b/tests/deplete_tests/test_reference.h5 new file mode 100644 index 0000000000000000000000000000000000000000..ef3ae0090943bc7ecdc01a1afaa70c0216e029f0 GIT binary patch literal 165384 zcmeEP2|QHY`yXo(5<+PakxKS8?ltZmOC%~qJC&lclonD_+O=p=+9Z{fii*%WC}|TF zX%{0zWi2i8ztcT;&TD?}^uBuY)9?S@>60_hxzByhbH3;KKIhz-bMI`hXW2?i_LgLD zUlI}wQHJdIx743j@RC?7{Jn~jspB5tjSwi;gEE0sX9#`&$6zRf`X0bOzn<$D8yf~g zm_ga6N^lxOPn3LT1}aqZ$QC6i1-kryjexz4wF|d{$)J}3po~tWA`evj;zEcaPDC*A z0?i09$cUp_6(Qo8`(Bo)CXX<=+6*y5;?@fb34d3WAQ-@XBSIMf+FV`kOYRSLM;eDt zU@#)d1Hakdv7?+>LVw5-L1LtX-#baXjRi85M!pXkQEz{e()jZZQTZXiAE`%aHv?ID z09nK1|0qi1&+Yy0wSw{@KYnChlogm4W#!49dVmfmW8|AKAg7Ne-^c|EF4&)#} zq+%e4tsvjj0(t!w@{KHjJMsW2t5V1H$T#lbco>_MwZQS9Gvu3OaJ=|2DHj9TrG}Ji zft>q|lx4yEkuOaipvJwp4=LM|YXADbL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1$1W`B^U#}aG~hF2k*`Y!ieBVhhov;08M-Ua!P zV%LbH+d-JGIII(UUbez~Q94MY_*Xc8hcB5VQiBI8;Jop*V*%lW6k)Vy^8}N#=P)A2 zE|zO7bPzSs82cW-s)#br7BF_dSVENNiwW&A z9qaO5LmbwtpYrYBAC80d&u0H!3s(jBJy?B0VU~DI7QMEMI|vyD{Xf4y>swqDLVuip zuW!m{({&+m?0XmqtgC9zEDIxFF|3BYMo@*x8ujGIK2Vcfo&;S4c literal 0 HcmV?d00001 diff --git a/tests/deplete_tests/test_utilities.py b/tests/deplete_tests/test_utilities.py new file mode 100644 index 0000000000..faa1a500b4 --- /dev/null +++ b/tests/deplete_tests/test_utilities.py @@ -0,0 +1,68 @@ +""" Full system test suite. """ + +import unittest + +import numpy as np + +from opendeplete import results +from opendeplete import utilities + + +class TestUtilities(unittest.TestCase): + """ Tests the utilities classes. + + This also tests the results read/write code. + """ + + def test_evaluate_single_nuclide(self): + """ Tests evaluating single nuclide utility code. + """ + + # Load the reference + res = results.read_results("test/test_reference.h5") + + x, y = utilities.evaluate_single_nuclide(res, "1", "Xe135") + + x_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] + y_ref = [6.6747328233649218e+08, 3.5519299354458244e+14, + 3.4599104054580338e+14, 3.3821165110278112e+14] + + np.testing.assert_array_equal(x, x_ref) + np.testing.assert_array_equal(y, y_ref) + + def test_evaluate_reaction_rate(self): + """ Tests evaluating reaction rate utility code. + """ + + # Load the reference + res = results.read_results("test/test_reference.h5") + + x, y = utilities.evaluate_reaction_rate(res, "1", "Xe135", "(n,gamma)") + + x_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] + xe_ref = np.array([6.6747328233649218e+08, 3.5519299354458244e+14, + 3.4599104054580338e+14, 3.3821165110278112e+14]) + r_ref = np.array([4.0643598574337784e-05, 4.1457730544386974e-05, + 3.4121248544056681e-05, 3.9204686657643301e-05]) + + np.testing.assert_array_equal(x, x_ref) + np.testing.assert_array_equal(y, xe_ref * r_ref) + + def test_evaluate_eigenvalue(self): + """ Tests evaluating eigenvalue + """ + + # Load the reference + res = results.read_results("test/test_reference.h5") + + x, y = utilities.evaluate_eigenvalue(res) + + x_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] + y_ref = [1.1921986054449838, 1.1712785643938586, 1.1927099024502694, 1.2269183590698847] + + np.testing.assert_array_equal(x, x_ref) + np.testing.assert_array_equal(y, y_ref) + + +if __name__ == '__main__': + unittest.main() From 37f552a5dcdcb2d16d9db21e95f099c214c3bda7 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 9 Feb 2018 14:01:59 -0600 Subject: [PATCH 017/231] Fix deplete imports --- openmc/deplete/__init__.py | 6 +-- openmc/deplete/atom_number.py | 18 +++---- openmc/deplete/depletion_chain.py | 18 +++---- openmc/deplete/function.py | 14 ++--- openmc/deplete/integrator/save_results.py | 3 +- openmc/deplete/openmc_wrapper.py | 52 +++++++++---------- openmc/deplete/reaction_rates.py | 6 +-- openmc/deplete/results.py | 23 ++++---- openmc/deplete/utilities.py | 10 ++-- scripts/example_geometry.py | 3 +- scripts/example_plot.py | 7 +-- scripts/example_run.py | 8 +-- scripts/make_chain.py | 4 +- tests/deplete_tests/dummy_geometry.py | 22 +++----- tests/deplete_tests/test_atom_number.py | 12 ++--- tests/deplete_tests/test_cecm_regression.py | 16 +++--- tests/deplete_tests/test_cram.py | 2 +- tests/deplete_tests/test_depletion_chain.py | 3 +- tests/deplete_tests/test_full.py | 22 ++++---- tests/deplete_tests/test_integrator.py | 3 +- tests/deplete_tests/test_nuclide.py | 2 +- .../test_predictor_regression.py | 16 +++--- tests/deplete_tests/test_reaction_rates.py | 2 +- tests/deplete_tests/test_utilities.py | 15 +++--- 24 files changed, 141 insertions(+), 146 deletions(-) diff --git a/openmc/deplete/__init__.py b/openmc/deplete/__init__.py index 994a51e12c..4bdde3935e 100644 --- a/openmc/deplete/__init__.py +++ b/openmc/deplete/__init__.py @@ -1,8 +1,8 @@ """ -OpenDeplete -=========== +openmc.deplete +============== -A simple depletion front-end tool. +A depletion front-end tool. """ from .dummy_comm import DummyCommunicator diff --git a/openmc/deplete/atom_number.py b/openmc/deplete/atom_number.py index 03bedbf531..63c9af8364 100644 --- a/openmc/deplete/atom_number.py +++ b/openmc/deplete/atom_number.py @@ -7,7 +7,7 @@ import numpy as np class AtomNumber(object): - """ AtomNumber module. + """AtomNumber module. An ndarray to store atom densities with string, integer, or slice indexing. @@ -71,7 +71,7 @@ class AtomNumber(object): self._burn_mat_list = None def __getitem__(self, pos): - """ Retrieves total atom number from AtomNumber. + """Retrieves total atom number from AtomNumber. Parameters ---------- @@ -95,7 +95,7 @@ class AtomNumber(object): return self.number[mat, nuc] def __setitem__(self, pos, val): - """ Sets total atom number into AtomNumber. + """Sets total atom number into AtomNumber. Parameters ---------- @@ -116,7 +116,7 @@ class AtomNumber(object): self.number[mat, nuc] = val def get_atom_density(self, mat, nuc): - """ Accesses atom density instead of total number. + """Accesses atom density instead of total number. Parameters ---------- @@ -139,7 +139,7 @@ class AtomNumber(object): return self[mat, nuc] / self.volume[mat] def set_atom_density(self, mat, nuc, val): - """ Sets atom density instead of total number. + """Sets atom density instead of total number. Parameters ---------- @@ -159,7 +159,7 @@ class AtomNumber(object): self[mat, nuc] = val * self.volume[mat] def get_mat_slice(self, mat): - """ Gets atom quantity indexed by mats for all burned nuclides + """Gets atom quantity indexed by mats for all burned nuclides Parameters ---------- @@ -178,7 +178,7 @@ class AtomNumber(object): return self[mat, 0:self.n_nuc_burn] def set_mat_slice(self, mat, val): - """ Sets atom quantity indexed by mats for all burned nuclides + """Sets atom quantity indexed by mats for all burned nuclides Parameters ---------- @@ -205,7 +205,7 @@ class AtomNumber(object): @property def burn_nuc_list(self): - """ burn_nuc_list : list of str + """burn_nuc_list : list of str A list of all nuclide material names. Used for sorting the simulation. """ @@ -221,7 +221,7 @@ class AtomNumber(object): @property def burn_mat_list(self): - """ burn_mat_list : list of str + """burn_mat_list : list of str A list of all burning material names. Used for sorting the simulation. """ diff --git a/openmc/deplete/depletion_chain.py b/openmc/deplete/depletion_chain.py index 05cc9db435..af126035f6 100644 --- a/openmc/deplete/depletion_chain.py +++ b/openmc/deplete/depletion_chain.py @@ -11,9 +11,6 @@ import math import re import os -from tqdm import tqdm -import scipy.sparse as sp -import openmc.data # Try to use lxml if it is available. It preserves the order of attributes and # provides a pretty-printer by default. If not available, use OpenMC function to # pretty print. @@ -22,9 +19,12 @@ try: _have_lxml = True except ImportError: import xml.etree.ElementTree as ET - from openmc.clean_xml import clean_xml_indentation _have_lxml = False +from tqdm import tqdm +import scipy.sparse as sp +import openmc.data +from openmc.clean_xml import clean_xml_indentation from .nuclide import Nuclide, DecayTuple, ReactionTuple @@ -109,7 +109,7 @@ def replace_missing(product, decay_data): class DepletionChain(object): - """ The DepletionChain class. + """The DepletionChain class. This class contains a full representation of a depletion chain. @@ -334,7 +334,7 @@ class DepletionChain(object): # Load XML tree try: root = ET.parse(filename) - except: + except Exception: if filename is None: print("No chain specified, either manually or in environment variable OPENDEPLETE_CHAIN.") else: @@ -374,11 +374,11 @@ class DepletionChain(object): if _have_lxml: tree.write(filename, encoding='utf-8', pretty_print=True) else: - clean_xml_indentation(root_elem, spaces_per_level=2) + clean_xml_indentation(root_elem) tree.write(filename, encoding='utf-8') def form_matrix(self, rates): - """ Forms depletion matrix. + """Forms depletion matrix. Parameters ---------- @@ -457,7 +457,7 @@ class DepletionChain(object): return matrix_dok.tocsr() def nuc_by_ind(self, ind): - """ Extracts nuclides from the list by dictionary key. + """Extracts nuclides from the list by dictionary key. Parameters ---------- diff --git a/openmc/deplete/function.py b/openmc/deplete/function.py index 74eb92422b..bcc055e67b 100644 --- a/openmc/deplete/function.py +++ b/openmc/deplete/function.py @@ -6,8 +6,9 @@ to run a full depletion simulation. from abc import ABCMeta, abstractmethod + class Settings(object): - """ The Settings class. + """The Settings class. Contains all parameters necessary for the integrator. @@ -24,8 +25,9 @@ class Settings(object): self.dt_vec = None self.output_dir = None + class Operator(metaclass=ABCMeta): - """ The Operator metaclass. + """The Operator metaclass. This defines all functions that the integrator needs to operate. @@ -40,7 +42,7 @@ class Operator(metaclass=ABCMeta): @abstractmethod def initial_condition(self): - """ Performs final setup and returns initial condition. + """Performs final setup and returns initial condition. Returns ------- @@ -52,7 +54,7 @@ class Operator(metaclass=ABCMeta): @abstractmethod def eval(self, vec, print_out=True): - """ Runs a simulation. + """Runs a simulation. Parameters ---------- @@ -75,7 +77,7 @@ class Operator(metaclass=ABCMeta): @abstractmethod def get_results_info(self): - """ Returns volume list, cell lists, and nuc lists. + """Returns volume list, cell lists, and nuc lists. Returns ------- @@ -93,7 +95,7 @@ class Operator(metaclass=ABCMeta): @abstractmethod def form_matrix(self, y, mat): - """ Forms the f(y) matrix in y' = f(y)y. + """Forms the f(y) matrix in y' = f(y)y. Nominally a depletion matrix, this is abstracted on the off chance that the function f has nothing to do with depletion at all. diff --git a/openmc/deplete/integrator/save_results.py b/openmc/deplete/integrator/save_results.py index 35cbc7f3f1..4f20b52fde 100644 --- a/openmc/deplete/integrator/save_results.py +++ b/openmc/deplete/integrator/save_results.py @@ -1,7 +1,8 @@ """ Generic result saving code for integrators. """ -from opendeplete.results import Results, write_results +from ..results import Results, write_results + def save_results(op, x, rates, eigvls, seeds, t, step_ind): """ Creates and writes results to disk diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 347dc71857..05b5057d20 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -1,6 +1,6 @@ -""" The OpenMC wrapper module. +"""The OpenMC wrapper module. -This module implements the OpenDeplete -> OpenMC linkage. +This module implements the depletion -> OpenMC linkage. """ import copy @@ -14,14 +14,13 @@ try: _have_lxml = True except ImportError: import xml.etree.ElementTree as ET - from openmc.clean_xml import clean_xml_indentation _have_lxml = False import h5py import numpy as np + import openmc import openmc.capi - from . import comm from .atom_number import AtomNumber from .depletion_chain import DepletionChain @@ -194,7 +193,7 @@ class OpenMCOperator(Operator): # Clear out OpenMC, create task lists, distribute if comm.rank == 0: - clean_up_openmc() + openmc.reset_auto_ids() mat_burn_list, mat_not_burn_list, volume, self.mat_tally_ind, \ nuc_dict = self.extract_mat_ids() else: @@ -224,7 +223,7 @@ class OpenMCOperator(Operator): openmc.capi.finalize() def extract_mat_ids(self): - """ Extracts materials and assigns them to processes. + """Extracts materials and assigns them to processes. Returns ------- @@ -308,7 +307,7 @@ class OpenMCOperator(Operator): return mat_burn_lists, mat_not_burn_lists, volume, mat_tally_ind, nuc_dict def extract_number(self, mat_burn, mat_not_burn, volume, nuc_dict): - """ Construct self.number read from geometry + """Construct self.number read from geometry Parameters ---------- @@ -356,7 +355,7 @@ class OpenMCOperator(Operator): self.set_number_from_mat(mat) def set_number_from_mat(self, mat): - """ Extracts material and number densities from openmc.Material + """Extracts material and number densities from openmc.Material Parameters ---------- @@ -369,12 +368,11 @@ class OpenMCOperator(Operator): nuc_dens = mat.get_nuclide_atom_densities() for nuclide in nuc_dens: - name = nuclide.name number = nuc_dens[nuclide][1] * 1.0e24 - self.number.set_atom_density(mat_id, name, number) + self.number.set_atom_density(mat_id, nuclide, number) def initialize_reaction_rates(self): - """ Create reaction rates object. """ + """Create reaction rates object. """ self.reaction_rates = ReactionRates( self.burn_mat_to_ind, self.burn_nuc_to_ind, @@ -383,7 +381,7 @@ class OpenMCOperator(Operator): self.chain.nuc_to_react_ind = self.burn_nuc_to_ind def eval(self, vec, print_out=True): - """ Runs a simulation. + """Runs a simulation. Parameters ---------- @@ -405,7 +403,7 @@ class OpenMCOperator(Operator): """ # Prevent OpenMC from complaining about re-creating tallies - clean_up_openmc() + openmc.reset_auto_ids() # Update status self.set_density(vec) @@ -435,7 +433,7 @@ class OpenMCOperator(Operator): return k, copy.deepcopy(self.reaction_rates), self.seed def form_matrix(self, y, mat): - """ Forms the depletion matrix. + """Forms the depletion matrix. Parameters ---------- @@ -453,7 +451,7 @@ class OpenMCOperator(Operator): return copy.deepcopy(self.chain.form_matrix(y[mat, :, :])) def initial_condition(self): - """ Performs final setup and returns initial condition. + """Performs final setup and returns initial condition. Returns ------- @@ -513,7 +511,7 @@ class OpenMCOperator(Operator): mat_internal.set_densities(nuclides, densities) def generate_materials_xml(self): - """ Creates materials.xml from self.number. + """Creates materials.xml from self.number. Due to uncertainty with how MPI interacts with OpenMC API, this constructs the XML manually. The long term goal is to do this @@ -531,7 +529,7 @@ class OpenMCOperator(Operator): materials.export_to_xml() def generate_settings_xml(self): - """ Generates settings.xml. + """Generates settings.xml. This function creates settings.xml using the value of the settings variable. @@ -625,7 +623,7 @@ class OpenMCOperator(Operator): tally_dep.filters = [mat_filter] def total_density_list(self): - """ Returns a list of total density lists. + """Returns a list of total density lists. This list is in the exact same order as depletion_matrix_list, so that matrix exponentiation can be done easily. @@ -641,7 +639,7 @@ class OpenMCOperator(Operator): return total_density def set_density(self, total_density): - """ Sets density. + """Sets density. Sets the density in the exact same order as total_density_list outputs, allowing for internal consistency @@ -657,7 +655,7 @@ class OpenMCOperator(Operator): self.number.set_mat_slice(i, total_density[i]) def unpack_tallies_and_normalize(self): - """ Unpack tallies from OpenMC + """Unpack tallies from OpenMC This function reads the tallies generated by OpenMC (from the tally.xml file generated in generate_tally_xml) normalizes them so that the total @@ -754,7 +752,7 @@ class OpenMCOperator(Operator): return k_combined def load_participating(self): - """ Loads a cross_sections.xml file to find participating nuclides. + """Loads a cross_sections.xml file to find participating nuclides. This allows for nuclides that are important in the decay chain but not important neutronically, or have no cross section data. @@ -772,7 +770,7 @@ class OpenMCOperator(Operator): try: tree = ET.parse(filename) - except: + except Exception: if filename is None: msg = "No cross_sections.xml specified in materials." else: @@ -802,7 +800,7 @@ class OpenMCOperator(Operator): return len(self.chain.nuclides) def get_results_info(self): - """ Returns volume list, cell lists, and nuc lists. + """Returns volume list, cell lists, and nuc lists. Returns ------- @@ -829,8 +827,10 @@ class OpenMCOperator(Operator): return volume, nuc_list, burn_list, self.mat_tally_ind + def density_to_mat(dens_dict): - """ Generates an OpenMC material from a cell ID and self.number_density. + """Generates an OpenMC material from a cell ID and self.number_density. + Parameters ---------- m_id : int @@ -847,7 +847,3 @@ def density_to_mat(dens_dict): mat.set_density('sum') return mat - -def clean_up_openmc(): - """ Resets all automatic indexing in OpenMC, as these get in the way. """ - openmc.reset_auto_ids() diff --git a/openmc/deplete/reaction_rates.py b/openmc/deplete/reaction_rates.py index 7b934027a5..de3a6a7280 100644 --- a/openmc/deplete/reaction_rates.py +++ b/openmc/deplete/reaction_rates.py @@ -7,7 +7,7 @@ import numpy as np class ReactionRates(object): - """ ReactionRates class. + """ReactionRates class. An ndarray to store reaction rates with string, integer, or slice indexing. @@ -47,7 +47,7 @@ class ReactionRates(object): self.rates = np.zeros((self.n_mat, self.n_nuc, self.n_react)) def __getitem__(self, pos): - """ Retrieves an item from reaction_rates. + """Retrieves an item from reaction_rates. Parameters ---------- @@ -74,7 +74,7 @@ class ReactionRates(object): return self.rates[mat, nuc, react] def __setitem__(self, pos, val): - """ Sets an item from reaction_rates. + """Sets an item from reaction_rates. Parameters ---------- diff --git a/openmc/deplete/results.py b/openmc/deplete/results.py index c0ec1627ea..ae096b8ce5 100644 --- a/openmc/deplete/results.py +++ b/openmc/deplete/results.py @@ -1,4 +1,4 @@ -""" The results module. +"""The results module. Contains results generation and saving capabilities. """ @@ -14,8 +14,9 @@ from .reaction_rates import ReactionRates RESULTS_VERSION = 2 + class Results(object): - """ Contains output of opendeplete. + """Contains output of opendeplete. Attributes ---------- @@ -62,7 +63,7 @@ class Results(object): self.data = None def allocate(self, volume, nuc_list, burn_list, full_burn_dict, stages): - """ Allocates memory of Results. + """Allocates memory of Results. Parameters ---------- @@ -113,7 +114,7 @@ class Results(object): return self.data.shape[0] def __getitem__(self, pos): - """ Retrieves an item from results. + """Retrieves an item from results. Parameters ---------- @@ -137,7 +138,7 @@ class Results(object): return self.data[stage, mat, nuc] def __setitem__(self, pos, val): - """ Sets an item from results. + """Sets an item from results. Parameters ---------- @@ -159,7 +160,7 @@ class Results(object): self.data[stage, mat, nuc] = val def create_hdf5(self, handle): - """ Creates file structure for a blank HDF5 file. + """Creates file structure for a blank HDF5 file. Parameters ---------- @@ -232,7 +233,7 @@ class Results(object): handle.create_dataset("time", (1, 2), maxshape=(None, 2), dtype='float64') def to_hdf5(self, handle, index): - """ Converts results object into an hdf5 object. + """Converts results object into an hdf5 object. Parameters ---------- @@ -302,7 +303,7 @@ class Results(object): time_dset[index, :] = self.time def from_hdf5(self, handle, index): - """ Loads results object from HDF5. + """Loads results object from HDF5. Parameters ---------- @@ -360,7 +361,7 @@ class Results(object): def get_dict(number): - """ Given an operator nested dictionary, output indexing dictionaries. + """Given an operator nested dictionary, output indexing dictionaries. These indexing dictionaries map mat IDs and nuclide names to indices inside of Results.data. @@ -394,7 +395,7 @@ def get_dict(number): def write_results(result, filename, index): - """ Outputs result to an .hdf5 file. + """Outputs result to an .hdf5 file. Parameters ---------- @@ -418,7 +419,7 @@ def write_results(result, filename, index): def read_results(filename): - """ Reads out a list of results objects from an hdf5 file. + """Reads out a list of results objects from an hdf5 file. Parameters ---------- diff --git a/openmc/deplete/utilities.py b/openmc/deplete/utilities.py index 54632ed9c2..5433edce44 100644 --- a/openmc/deplete/utilities.py +++ b/openmc/deplete/utilities.py @@ -1,4 +1,4 @@ -""" The utilities module. +"""The utilities module. Contains functions that can be used to post-process objects that come out of the results module. @@ -6,8 +6,9 @@ the results module. import numpy as np + def evaluate_single_nuclide(results, cell, nuc): - """ Evaluates a single nuclide in a single cell from a results list. + """Evaluates a single nuclide in a single cell from a results list. Parameters ---------- @@ -38,7 +39,7 @@ def evaluate_single_nuclide(results, cell, nuc): return time, concentration def evaluate_reaction_rate(results, cell, nuc, rxn): - """ Evaluates a single nuclide reaction rate in a single cell from a results list. + """Evaluates a single nuclide reaction rate in a single cell from a results list. Parameters ---------- @@ -69,8 +70,9 @@ def evaluate_reaction_rate(results, cell, nuc, rxn): return time, rate + def evaluate_eigenvalue(results): - """ Evaluates the eigenvalue from a results list. + """Evaluates the eigenvalue from a results list. Parameters ---------- diff --git a/scripts/example_geometry.py b/scripts/example_geometry.py index 9afcc0d464..09ce0576f1 100644 --- a/scripts/example_geometry.py +++ b/scripts/example_geometry.py @@ -9,8 +9,7 @@ import math import numpy as np import openmc - -from opendeplete import density_to_mat +from openmc.deplete import density_to_mat def generate_initial_number_density(): diff --git a/scripts/example_plot.py b/scripts/example_plot.py index d2c6ee9d6a..c92fef6bf2 100644 --- a/scripts/example_plot.py +++ b/scripts/example_plot.py @@ -1,11 +1,8 @@ """An example file showing how to plot data from a simulation.""" import matplotlib.pyplot as plt - -from opendeplete import read_results, \ - evaluate_single_nuclide, \ - evaluate_reaction_rate, \ - evaluate_eigenvalue +from openmc.deplete import (read_results, evaluate_single_nuclide, + evaluate_reaction_rate, evaluate_eigenvalue) # Set variables for where the data is, and what we want to read out. result_folder = "test" diff --git a/scripts/example_run.py b/scripts/example_run.py index bb80f65820..82d0883c3a 100644 --- a/scripts/example_run.py +++ b/scripts/example_run.py @@ -1,7 +1,7 @@ """An example file showing how to run a simulation.""" import numpy as np -import opendeplete +import openmc.deplete import example_geometry @@ -16,7 +16,7 @@ N = np.floor(dt2/dt1) dt = np.repeat([dt1], N) # Create settings variable -settings = opendeplete.OpenMCSettings() +settings = openmc.deplete.OpenMCSettings() settings.openmc_call = "openmc" # An example for mpiexec: @@ -33,7 +33,7 @@ settings.power = 2.337e15*4*joule_per_mev # MeV/second cm from CASMO settings.dt_vec = dt settings.output_dir = 'test' -op = opendeplete.OpenMCOperator(geometry, settings) +op = openmc.deplete.OpenMCOperator(geometry, settings) # Perform simulation using the MCNPX/MCNP6 algorithm -opendeplete.integrator.cecm(op) +openmc.deplete.integrator.cecm(op) diff --git a/scripts/make_chain.py b/scripts/make_chain.py index 2e0d9d3bc4..ccf4ef9b7b 100644 --- a/scripts/make_chain.py +++ b/scripts/make_chain.py @@ -6,7 +6,7 @@ from zipfile import ZipFile import requests from tqdm import tqdm -import opendeplete +import openmc.deplete urls = [ @@ -52,7 +52,7 @@ def main(): nfy_files = glob.glob(os.path.join('nfy', '*.endf')) neutron_files = glob.glob(os.path.join('neutrons', '*.endf')) - chain = opendeplete.DepletionChain.from_endf(decay_files, nfy_files, neutron_files) + chain = openmc.deplete.DepletionChain.from_endf(decay_files, nfy_files, neutron_files) chain.xml_write('chain_endfb71.xml') diff --git a/tests/deplete_tests/dummy_geometry.py b/tests/deplete_tests/dummy_geometry.py index 6101519411..614cc726e3 100644 --- a/tests/deplete_tests/dummy_geometry.py +++ b/tests/deplete_tests/dummy_geometry.py @@ -1,16 +1,11 @@ -""" The OpenMC wrapper module. - -This module implements the OpenDeplete -> OpenMC linkage. -""" - import numpy as np import scipy.sparse as sp +from openmc.deplete.reaction_rates import ReactionRates +from openmc.deplete.function import Operator -from opendeplete.reaction_rates import ReactionRates -from opendeplete.function import Operator class DummyGeometry(Operator): - """ This is a dummy geometry class with no statistical uncertainty. + """This is a dummy geometry class with no statistical uncertainty. y_1' = sin(y_2) y_1 + cos(y_1) y_2 y_2' = -cos(y_2) y_1 + sin(y_1) y_2 @@ -24,14 +19,14 @@ class DummyGeometry(Operator): """ def __init__(self, settings): - Operator.__init__(self, settings) + super().__init__(settings) @property def chain(self): return self def eval(self, vec, print_out=False): - """ Evaluates F(y) + """Evaluates F(y) Parameters ---------- @@ -60,11 +55,10 @@ class DummyGeometry(Operator): reaction_rates[0, 1, 0] = vec[0][1] # Create a fake rates object - return 0.0, reaction_rates, 0 def form_matrix(self, rates): - """ Forms the f(y) matrix in y' = f(y)y. + """Forms the f(y) matrix in y' = f(y)y. Nominally a depletion matrix, this is abstracted on the off chance that the function f has nothing to do with depletion at all. @@ -137,7 +131,7 @@ class DummyGeometry(Operator): return ReactionRates(cell_to_ind, nuc_to_ind, react_to_ind) def initial_condition(self): - """ Returns initial vector. + """Returns initial vector. Returns ------- @@ -148,7 +142,7 @@ class DummyGeometry(Operator): return [np.array((1.0, 1.0))] def get_results_info(self): - """ Returns volume list, cell lists, and nuc lists. + """Returns volume list, cell lists, and nuc lists. Returns ------- diff --git a/tests/deplete_tests/test_atom_number.py b/tests/deplete_tests/test_atom_number.py index 9a17230f86..d36b96d38d 100644 --- a/tests/deplete_tests/test_atom_number.py +++ b/tests/deplete_tests/test_atom_number.py @@ -3,11 +3,11 @@ import unittest import numpy as np +from openmc.deplete import atom_number -from opendeplete import atom_number class TestAtomNumber(unittest.TestCase): - """ Tests for the AtomNumber class. """ + """Tests for the AtomNumber class.""" def test_indexing(self): """Tests the __getitem__ and __setitem__ routines simultaneously.""" @@ -41,7 +41,7 @@ class TestAtomNumber(unittest.TestCase): self.assertEqual(number["10000", "U238"], 5.0) def test_n_mat(self): - """ Test number of materials property. """ + """Test number of materials property. """ mat_to_ind = {"10000" : 0, "10001" : 1} nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} volume = {"10000" : 0.38, "10001" : 0.21} @@ -51,7 +51,7 @@ class TestAtomNumber(unittest.TestCase): self.assertEqual(number.n_mat, 2) def test_n_nuc(self): - """ Test number of nuclides property. """ + """Test number of nuclides property.""" mat_to_ind = {"10000" : 0, "10001" : 1} nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} volume = {"10000" : 0.38, "10001" : 0.21} @@ -61,7 +61,7 @@ class TestAtomNumber(unittest.TestCase): self.assertEqual(number.n_nuc, 3) def test_burn_nuc_list(self): - """ Test the list of burned nuclides property """ + """Test the list of burned nuclides property""" mat_to_ind = {"10000" : 0, "10001" : 1} nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} volume = {"10000" : 0.38, "10001" : 0.21} @@ -71,7 +71,7 @@ class TestAtomNumber(unittest.TestCase): self.assertEqual(number.burn_nuc_list, ["U238", "U235"]) def test_burn_mat_list(self): - """ Test the list of burned nuclides property """ + """Test the list of burned nuclides property""" mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} volume = {"10000" : 0.38, "10001" : 0.21} diff --git a/tests/deplete_tests/test_cecm_regression.py b/tests/deplete_tests/test_cecm_regression.py index 23a6342000..0d6966c82c 100644 --- a/tests/deplete_tests/test_cecm_regression.py +++ b/tests/deplete_tests/test_cecm_regression.py @@ -4,11 +4,11 @@ import os import unittest import numpy as np +import openmc.deplete +from openmc.deplete import results +from openmc.deplete import utilities -import opendeplete -from opendeplete import results -from opendeplete import utilities -import test.dummy_geometry as dummy_geometry +from . import dummy_geometry class TestCECMRegression(unittest.TestCase): @@ -26,14 +26,14 @@ class TestCECMRegression(unittest.TestCase): def test_cecm(self): """ Integral regression test of integrator algorithm using CE/CM. """ - settings = opendeplete.Settings() + settings = openmc.deplete.Settings() settings.dt_vec = [0.75, 0.75] settings.output_dir = self.results op = dummy_geometry.DummyGeometry(settings) # Perform simulation using the MCNPX/MCNP6 algorithm - opendeplete.cecm(op, print_out=False) + openmc.deplete.cecm(op, print_out=False) # Load the files res = results.read_results(settings.output_dir + "/results.h5") @@ -59,8 +59,8 @@ class TestCECMRegression(unittest.TestCase): os.chdir(cls.cwd) - opendeplete.comm.barrier() - if opendeplete.comm.rank == 0: + openmc.deplete.comm.barrier() + if openmc.deplete.comm.rank == 0: os.remove(os.path.join(cls.results, "results.h5")) os.rmdir(cls.results) diff --git a/tests/deplete_tests/test_cram.py b/tests/deplete_tests/test_cram.py index 2744adbf48..10f41fe2b6 100644 --- a/tests/deplete_tests/test_cram.py +++ b/tests/deplete_tests/test_cram.py @@ -4,8 +4,8 @@ import unittest import numpy as np import scipy.sparse as sp +from openmc.deplete.integrator import CRAM16, CRAM48 -from opendeplete.integrator import CRAM16, CRAM48 class TestCram(unittest.TestCase): """ Tests for cram.py diff --git a/tests/deplete_tests/test_depletion_chain.py b/tests/deplete_tests/test_depletion_chain.py index 216d1e68f7..06abbba0f6 100644 --- a/tests/deplete_tests/test_depletion_chain.py +++ b/tests/deplete_tests/test_depletion_chain.py @@ -5,8 +5,7 @@ import os import unittest import numpy as np - -from opendeplete import comm, depletion_chain, reaction_rates, nuclide +from openmc.deplete import comm, depletion_chain, reaction_rates, nuclide class TestDepletionChain(unittest.TestCase): diff --git a/tests/deplete_tests/test_full.py b/tests/deplete_tests/test_full.py index f9a6c7493d..88c409554c 100644 --- a/tests/deplete_tests/test_full.py +++ b/tests/deplete_tests/test_full.py @@ -2,13 +2,14 @@ import shutil import unittest +from os.path import join, dirname import numpy as np +import openmc.deplete +from openmc.deplete import results +from openmc.deplete import utilities -import opendeplete -from opendeplete import results -from opendeplete import utilities -import test.example_geometry as example_geometry +from . import example_geometry class TestFull(unittest.TestCase): @@ -40,7 +41,7 @@ class TestFull(unittest.TestCase): dt = np.repeat([dt1], N) # Create settings variable - settings = opendeplete.OpenMCSettings() + settings = openmc.deplete.OpenMCSettings() settings.chain_file = "chains/chain_simple.xml" settings.openmc_call = "openmc" @@ -60,16 +61,17 @@ class TestFull(unittest.TestCase): settings.dt_vec = dt settings.output_dir = "test_full" - op = opendeplete.OpenMCOperator(geometry, settings) + op = openmc.deplete.OpenMCOperator(geometry, settings) # Perform simulation using the predictor algorithm - opendeplete.integrator.predictor(op) + openmc.deplete.integrator.predictor(op) # Load the files res_test = results.read_results(settings.output_dir + "/results.h5") # Load the reference - res_old = results.read_results("test/test_reference.h5") + filename = join(dirname(__file__), 'test_reference.h5') + res_old = results.read_results(filename) # Assert same mats for mat in res_old[0].mat_to_ind: @@ -110,8 +112,8 @@ class TestFull(unittest.TestCase): def tearDown(self): """ Clean up files""" - opendeplete.comm.barrier() - if opendeplete.comm.rank == 0: + openmc.deplete.comm.barrier() + if openmc.deplete.comm.rank == 0: shutil.rmtree("test_full", ignore_errors=True) diff --git a/tests/deplete_tests/test_integrator.py b/tests/deplete_tests/test_integrator.py index 7e121ce167..9b4cbe7802 100644 --- a/tests/deplete_tests/test_integrator.py +++ b/tests/deplete_tests/test_integrator.py @@ -6,8 +6,7 @@ import unittest from unittest.mock import MagicMock import numpy as np - -from opendeplete import integrator, ReactionRates, results, comm +from openmc.deplete import integrator, ReactionRates, results, comm class TestIntegrator(unittest.TestCase): diff --git a/tests/deplete_tests/test_nuclide.py b/tests/deplete_tests/test_nuclide.py index c5439b2aa3..2d379030d8 100644 --- a/tests/deplete_tests/test_nuclide.py +++ b/tests/deplete_tests/test_nuclide.py @@ -3,7 +3,7 @@ import unittest import xml.etree.ElementTree as ET -from opendeplete import nuclide +from openmc.deplete import nuclide class TestNuclide(unittest.TestCase): diff --git a/tests/deplete_tests/test_predictor_regression.py b/tests/deplete_tests/test_predictor_regression.py index c72ae8a475..a41ca9ce79 100644 --- a/tests/deplete_tests/test_predictor_regression.py +++ b/tests/deplete_tests/test_predictor_regression.py @@ -4,11 +4,11 @@ import os import unittest import numpy as np +import openmc.deplete +from openmc.deplete import results +from openmc.deplete import utilities -import opendeplete -from opendeplete import results -from opendeplete import utilities -import test.dummy_geometry as dummy_geometry +from . import dummy_geometry class TestPredictorRegression(unittest.TestCase): """ Regression tests for opendeplete.integrator.predictor algorithm. @@ -25,14 +25,14 @@ class TestPredictorRegression(unittest.TestCase): def test_predictor(self): """ Integral regression test of integrator algorithm using CE/CM. """ - settings = opendeplete.Settings() + settings = openmc.deplete.Settings() settings.dt_vec = [0.75, 0.75] settings.output_dir = self.results op = dummy_geometry.DummyGeometry(settings) # Perform simulation using the predictor algorithm - opendeplete.predictor(op, print_out=False) + openmc.deplete.predictor(op, print_out=False) # Load the files res = results.read_results(settings.output_dir + "/results.h5") @@ -58,8 +58,8 @@ class TestPredictorRegression(unittest.TestCase): os.chdir(cls.cwd) - opendeplete.comm.barrier() - if opendeplete.comm.rank == 0: + openmc.deplete.comm.barrier() + if openmc.deplete.comm.rank == 0: os.remove(os.path.join(cls.results, "results.h5")) os.rmdir(cls.results) diff --git a/tests/deplete_tests/test_reaction_rates.py b/tests/deplete_tests/test_reaction_rates.py index 4821ec18cd..2139be16c2 100644 --- a/tests/deplete_tests/test_reaction_rates.py +++ b/tests/deplete_tests/test_reaction_rates.py @@ -2,7 +2,7 @@ import unittest -from opendeplete import reaction_rates +from openmc.deplete import reaction_rates class TestReactionRates(unittest.TestCase): diff --git a/tests/deplete_tests/test_utilities.py b/tests/deplete_tests/test_utilities.py index faa1a500b4..fb60df5b7d 100644 --- a/tests/deplete_tests/test_utilities.py +++ b/tests/deplete_tests/test_utilities.py @@ -1,11 +1,11 @@ """ Full system test suite. """ import unittest +from os.path import join, dirname import numpy as np - -from opendeplete import results -from opendeplete import utilities +from openmc.deplete import results +from openmc.deplete import utilities class TestUtilities(unittest.TestCase): @@ -19,7 +19,8 @@ class TestUtilities(unittest.TestCase): """ # Load the reference - res = results.read_results("test/test_reference.h5") + filename = join(dirname(__file__), 'test_reference.h5') + res = results.read_results(filename) x, y = utilities.evaluate_single_nuclide(res, "1", "Xe135") @@ -35,7 +36,8 @@ class TestUtilities(unittest.TestCase): """ # Load the reference - res = results.read_results("test/test_reference.h5") + filename = join(dirname(__file__), 'test_reference.h5') + res = results.read_results(filename) x, y = utilities.evaluate_reaction_rate(res, "1", "Xe135", "(n,gamma)") @@ -53,7 +55,8 @@ class TestUtilities(unittest.TestCase): """ # Load the reference - res = results.read_results("test/test_reference.h5") + filename = join(dirname(__file__), 'test_reference.h5') + res = results.read_results(filename) x, y = utilities.evaluate_eigenvalue(res) From 0a772252cc4c64295b25832555f397bc3e431007 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 9 Feb 2018 14:51:36 -0600 Subject: [PATCH 018/231] Fix bug in openmc_tally_set_scores (for depletion reactions) --- src/tallies/tally_header.F90 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/tallies/tally_header.F90 b/src/tallies/tally_header.F90 index 474e77d1ce..9604d2382a 100644 --- a/src/tallies/tally_header.F90 +++ b/src/tallies/tally_header.F90 @@ -732,8 +732,10 @@ contains integer :: MT character(C_CHAR), pointer :: string(:) character(len=:, kind=C_CHAR), allocatable :: score_ + logical :: depletion_rx err = E_UNASSIGNED + depletion_rx = .false. if (index >= 1 .and. index <= size(tallies)) then associate (t => tallies(index) % obj) if (allocated(t % score_bins)) deallocate(t % score_bins) @@ -757,10 +759,13 @@ contains t % score_bins(i) = SCORE_NU_SCATTER case ('(n,2n)') t % score_bins(i) = N_2N + depletion_rx = .true. case ('(n,3n)') t % score_bins(i) = N_3N + depletion_rx = .true. case ('(n,4n)') t % score_bins(i) = N_4N + depletion_rx = .true. case ('absorption') t % score_bins(i) = SCORE_ABSORPTION case ('fission', '18') @@ -829,8 +834,10 @@ contains t % score_bins(i) = N_NC case ('(n,gamma)') t % score_bins(i) = N_GAMMA + depletion_rx = .true. case ('(n,p)') t % score_bins(i) = N_P + depletion_rx = .true. case ('(n,d)') t % score_bins(i) = N_D case ('(n,t)') @@ -839,6 +846,7 @@ contains t % score_bins(i) = N_3HE case ('(n,a)') t % score_bins(i) = N_A + depletion_rx = .true. case ('(n,2a)') t % score_bins(i) = N_2A case ('(n,3a)') @@ -879,6 +887,7 @@ contains end do err = 0 + t % depletion_rx = depletion_rx end associate else err = E_OUT_OF_BOUNDS From 8549f22e1408dd6e87184746b833b82f50e07d66 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 9 Feb 2018 15:42:00 -0600 Subject: [PATCH 019/231] Move depletion tests into normal regression/unit test directories --- tests/deplete_tests/__init__.py | 0 tests/{deplete_tests => }/dummy_geometry.py | 0 .../example_geometry.py | 0 .../test_deplete_full.py} | 0 .../test_deplete_utilities.py} | 0 .../test_reference.h5 | Bin .../test_deplete_atom_number.py} | 0 .../test_deplete_cecm.py} | 2 +- .../test_deplete_cram.py} | 0 .../test_deplete_integrator.py} | 0 .../test_deplete_nuclide.py} | 0 .../test_deplete_predictor.py} | 2 +- .../test_deplete_reaction.py} | 0 .../test_depletion_chain.py | 0 14 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 tests/deplete_tests/__init__.py rename tests/{deplete_tests => }/dummy_geometry.py (100%) rename tests/{deplete_tests => regression_tests}/example_geometry.py (100%) rename tests/{deplete_tests/test_full.py => regression_tests/test_deplete_full.py} (100%) rename tests/{deplete_tests/test_utilities.py => regression_tests/test_deplete_utilities.py} (100%) rename tests/{deplete_tests => regression_tests}/test_reference.h5 (100%) rename tests/{deplete_tests/test_atom_number.py => unit_tests/test_deplete_atom_number.py} (100%) rename tests/{deplete_tests/test_cecm_regression.py => unit_tests/test_deplete_cecm.py} (98%) rename tests/{deplete_tests/test_cram.py => unit_tests/test_deplete_cram.py} (100%) rename tests/{deplete_tests/test_integrator.py => unit_tests/test_deplete_integrator.py} (100%) rename tests/{deplete_tests/test_nuclide.py => unit_tests/test_deplete_nuclide.py} (100%) rename tests/{deplete_tests/test_predictor_regression.py => unit_tests/test_deplete_predictor.py} (98%) rename tests/{deplete_tests/test_reaction_rates.py => unit_tests/test_deplete_reaction.py} (100%) rename tests/{deplete_tests => unit_tests}/test_depletion_chain.py (100%) diff --git a/tests/deplete_tests/__init__.py b/tests/deplete_tests/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/deplete_tests/dummy_geometry.py b/tests/dummy_geometry.py similarity index 100% rename from tests/deplete_tests/dummy_geometry.py rename to tests/dummy_geometry.py diff --git a/tests/deplete_tests/example_geometry.py b/tests/regression_tests/example_geometry.py similarity index 100% rename from tests/deplete_tests/example_geometry.py rename to tests/regression_tests/example_geometry.py diff --git a/tests/deplete_tests/test_full.py b/tests/regression_tests/test_deplete_full.py similarity index 100% rename from tests/deplete_tests/test_full.py rename to tests/regression_tests/test_deplete_full.py diff --git a/tests/deplete_tests/test_utilities.py b/tests/regression_tests/test_deplete_utilities.py similarity index 100% rename from tests/deplete_tests/test_utilities.py rename to tests/regression_tests/test_deplete_utilities.py diff --git a/tests/deplete_tests/test_reference.h5 b/tests/regression_tests/test_reference.h5 similarity index 100% rename from tests/deplete_tests/test_reference.h5 rename to tests/regression_tests/test_reference.h5 diff --git a/tests/deplete_tests/test_atom_number.py b/tests/unit_tests/test_deplete_atom_number.py similarity index 100% rename from tests/deplete_tests/test_atom_number.py rename to tests/unit_tests/test_deplete_atom_number.py diff --git a/tests/deplete_tests/test_cecm_regression.py b/tests/unit_tests/test_deplete_cecm.py similarity index 98% rename from tests/deplete_tests/test_cecm_regression.py rename to tests/unit_tests/test_deplete_cecm.py index 0d6966c82c..34c3435a76 100644 --- a/tests/deplete_tests/test_cecm_regression.py +++ b/tests/unit_tests/test_deplete_cecm.py @@ -8,7 +8,7 @@ import openmc.deplete from openmc.deplete import results from openmc.deplete import utilities -from . import dummy_geometry +from tests import dummy_geometry class TestCECMRegression(unittest.TestCase): diff --git a/tests/deplete_tests/test_cram.py b/tests/unit_tests/test_deplete_cram.py similarity index 100% rename from tests/deplete_tests/test_cram.py rename to tests/unit_tests/test_deplete_cram.py diff --git a/tests/deplete_tests/test_integrator.py b/tests/unit_tests/test_deplete_integrator.py similarity index 100% rename from tests/deplete_tests/test_integrator.py rename to tests/unit_tests/test_deplete_integrator.py diff --git a/tests/deplete_tests/test_nuclide.py b/tests/unit_tests/test_deplete_nuclide.py similarity index 100% rename from tests/deplete_tests/test_nuclide.py rename to tests/unit_tests/test_deplete_nuclide.py diff --git a/tests/deplete_tests/test_predictor_regression.py b/tests/unit_tests/test_deplete_predictor.py similarity index 98% rename from tests/deplete_tests/test_predictor_regression.py rename to tests/unit_tests/test_deplete_predictor.py index a41ca9ce79..6ad2007d9c 100644 --- a/tests/deplete_tests/test_predictor_regression.py +++ b/tests/unit_tests/test_deplete_predictor.py @@ -8,7 +8,7 @@ import openmc.deplete from openmc.deplete import results from openmc.deplete import utilities -from . import dummy_geometry +from tests import dummy_geometry class TestPredictorRegression(unittest.TestCase): """ Regression tests for opendeplete.integrator.predictor algorithm. diff --git a/tests/deplete_tests/test_reaction_rates.py b/tests/unit_tests/test_deplete_reaction.py similarity index 100% rename from tests/deplete_tests/test_reaction_rates.py rename to tests/unit_tests/test_deplete_reaction.py diff --git a/tests/deplete_tests/test_depletion_chain.py b/tests/unit_tests/test_depletion_chain.py similarity index 100% rename from tests/deplete_tests/test_depletion_chain.py rename to tests/unit_tests/test_depletion_chain.py From 592fae536f31521d09bd68a80d465550e6b34978 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 9 Feb 2018 16:17:12 -0600 Subject: [PATCH 020/231] Fix file locations for depletion tests. Convert regression ones to pytest --- tests/conftest.py | 11 ++ tests/regression_tests/test_deplete_full.py | 156 ++++++++---------- .../test_deplete_utilities.py | 107 +++++------- tests/unit_tests/conftest.py | 9 - tests/unit_tests/test_depletion_chain.py | 10 +- 5 files changed, 133 insertions(+), 160 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 422c036fb3..dc55e8e1e9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,3 +1,5 @@ +import pytest + from tests.regression_tests import config as regression_config @@ -15,3 +17,12 @@ def pytest_configure(config): for opt in opts: if config.getoption(opt) is not None: regression_config[opt] = config.getoption(opt) + + +@pytest.fixture +def run_in_tmpdir(tmpdir): + orig = tmpdir.chdir() + try: + yield + finally: + orig.chdir() diff --git a/tests/regression_tests/test_deplete_full.py b/tests/regression_tests/test_deplete_full.py index 88c409554c..78039abc7e 100644 --- a/tests/regression_tests/test_deplete_full.py +++ b/tests/regression_tests/test_deplete_full.py @@ -1,121 +1,105 @@ """ Full system test suite. """ +from math import floor import shutil import unittest -from os.path import join, dirname +from pathlib import Path import numpy as np import openmc.deplete from openmc.deplete import results from openmc.deplete import utilities -from . import example_geometry +from .example_geometry import generate_problem -class TestFull(unittest.TestCase): - """ Full system test suite. +def test_full(run_in_tmpdir): + """Full system test suite. Runs an entire OpenMC simulation with depletion coupling and verifies that the outputs match a reference file. Sensitive to changes in OpenMC. + + This test runs a complete OpenMC simulation and tests the outputs. + It will take a while. """ - def test_full(self): - """ - This test runs a complete OpenMC simulation and tests the outputs. - It will take a while. - """ + n_rings = 2 + n_wedges = 4 - n_rings = 2 - n_wedges = 4 + # Load geometry from example + geometry, lower_left, upper_right = generate_problem(n_rings, n_wedges) - # Load geometry from example - geometry, lower_left, upper_right = \ - example_geometry.generate_problem(n_rings=n_rings, n_wedges=n_wedges) + # Create dt vector for 3 steps with 15 day timesteps + dt1 = 15.*24*60*60 # 15 days + dt2 = 1.5*30*24*60*60 # 1.5 months + N = floor(dt2/dt1) + dt = np.full(N, dt1) - # Create dt vector for 3 steps with 15 day timesteps - dt1 = 15*24*60*60 # 15 days - dt2 = 1.5*30*24*60*60 # 1.5 months - N = np.floor(dt2/dt1) + # Create settings variable + settings = openmc.deplete.OpenMCSettings() - dt = np.repeat([dt1], N) - # Create settings variable - settings = openmc.deplete.OpenMCSettings() + chain_file = str(Path(__file__).parents[2] / 'chains' / 'chain_simple.xml') + settings.chain_file = chain_file + settings.openmc_call = "openmc" + settings.openmc_npernode = 2 + settings.particles = 100 + settings.batches = 100 + settings.inactive = 40 + settings.lower_left = lower_left + settings.upper_right = upper_right + settings.entropy_dimension = [10, 10, 1] - settings.chain_file = "chains/chain_simple.xml" - settings.openmc_call = "openmc" - settings.openmc_npernode = 2 - settings.particles = 100 - settings.batches = 100 - settings.inactive = 40 - settings.lower_left = lower_left - settings.upper_right = upper_right - settings.entropy_dimension = [10, 10, 1] + settings.round_number = True + settings.constant_seed = 1 - settings.round_number = True - settings.constant_seed = 1 + joule_per_mev = 1.6021766208e-13 + settings.power = 2.337e15*4*joule_per_mev # MeV/second cm from CASMO + settings.dt_vec = dt + settings.output_dir = "test_full" - joule_per_mev = 1.6021766208e-13 - settings.power = 2.337e15*4*joule_per_mev # MeV/second cm from CASMO - settings.dt_vec = dt - settings.output_dir = "test_full" + op = openmc.deplete.OpenMCOperator(geometry, settings) - op = openmc.deplete.OpenMCOperator(geometry, settings) + # Perform simulation using the predictor algorithm + openmc.deplete.integrator.predictor(op) - # Perform simulation using the predictor algorithm - openmc.deplete.integrator.predictor(op) + # Load the files + res_test = results.read_results(settings.output_dir + "/results.h5") - # Load the files - res_test = results.read_results(settings.output_dir + "/results.h5") + # Load the reference + filename = str(Path(__file__).with_name('test_reference.h5')) + res_old = results.read_results(filename) - # Load the reference - filename = join(dirname(__file__), 'test_reference.h5') - res_old = results.read_results(filename) + # Assert same mats + for mat in res_old[0].mat_to_ind: + assert mat in res_test[0].mat_to_ind, \ + "Material {} not in new results.".format(mat) + for nuc in res_old[0].nuc_to_ind: + assert nuc in res_test[0].nuc_to_ind, \ + "Nuclide {} not in new results.".format(nuc) - # Assert same mats - for mat in res_old[0].mat_to_ind: - self.assertIn(mat, res_test[0].mat_to_ind, - msg="Cell " + mat + " not in new results.") - for nuc in res_old[0].nuc_to_ind: - self.assertIn(nuc, res_test[0].nuc_to_ind, - msg="Nuclide " + nuc + " not in new results.") + for mat in res_test[0].mat_to_ind: + assert mat in res_old[0].mat_to_ind, \ + "Material {} not in old results.".format(mat) + for nuc in res_test[0].nuc_to_ind: + assert nuc in res_old[0].nuc_to_ind, \ + "Nuclide {} not in old results.".format(nuc) - for mat in res_test[0].mat_to_ind: - self.assertIn(mat, res_old[0].mat_to_ind, - msg="Cell " + mat + " not in old results.") + tol = 1.0e-6 + for mat in res_test[0].mat_to_ind: for nuc in res_test[0].nuc_to_ind: - self.assertIn(nuc, res_old[0].nuc_to_ind, - msg="Nuclide " + nuc + " not in old results.") + _, y_test = utilities.evaluate_single_nuclide(res_test, mat, nuc) + _, y_old = utilities.evaluate_single_nuclide(res_old, mat, nuc) - for mat in res_test[0].mat_to_ind: - for nuc in res_test[0].nuc_to_ind: - _, y_test = utilities.evaluate_single_nuclide(res_test, mat, nuc) - _, y_old = utilities.evaluate_single_nuclide(res_old, mat, nuc) + # Test each point + correct = True + for i, ref in enumerate(y_old): + if ref != y_test[i]: + if ref != 0.0: + correct = np.abs(y_test[i] - ref) / ref <= tol + else: + correct = False - # Test each point - - tol = 1.0e-6 - - correct = True - for i, ref in enumerate(y_old): - if ref != y_test[i]: - if ref != 0.0: - if np.abs(y_test[i] - ref) / ref > tol: - correct = False - else: - correct = False - - self.assertTrue(correct, - msg="Discrepancy in mat " + mat + " and nuc " + nuc - + "\n" + str(y_old) + "\n" + str(y_test)) - - def tearDown(self): - """ Clean up files""" - openmc.deplete.comm.barrier() - if openmc.deplete.comm.rank == 0: - shutil.rmtree("test_full", ignore_errors=True) - - -if __name__ == '__main__': - unittest.main() + assert correct, "Discrepancy in mat {} and nuc {}\n{}\n{}".format( + mat, nuc, y_old, y_test) diff --git a/tests/regression_tests/test_deplete_utilities.py b/tests/regression_tests/test_deplete_utilities.py index fb60df5b7d..f9d34aa75a 100644 --- a/tests/regression_tests/test_deplete_utilities.py +++ b/tests/regression_tests/test_deplete_utilities.py @@ -1,71 +1,54 @@ -""" Full system test suite. """ +""" Tests the utilities classes. -import unittest -from os.path import join, dirname +This also tests the results read/write code. +""" + +from pathlib import Path import numpy as np +import pytest from openmc.deplete import results from openmc.deplete import utilities -class TestUtilities(unittest.TestCase): - """ Tests the utilities classes. - - This also tests the results read/write code. - """ - - def test_evaluate_single_nuclide(self): - """ Tests evaluating single nuclide utility code. - """ - - # Load the reference - filename = join(dirname(__file__), 'test_reference.h5') - res = results.read_results(filename) - - x, y = utilities.evaluate_single_nuclide(res, "1", "Xe135") - - x_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] - y_ref = [6.6747328233649218e+08, 3.5519299354458244e+14, - 3.4599104054580338e+14, 3.3821165110278112e+14] - - np.testing.assert_array_equal(x, x_ref) - np.testing.assert_array_equal(y, y_ref) - - def test_evaluate_reaction_rate(self): - """ Tests evaluating reaction rate utility code. - """ - - # Load the reference - filename = join(dirname(__file__), 'test_reference.h5') - res = results.read_results(filename) - - x, y = utilities.evaluate_reaction_rate(res, "1", "Xe135", "(n,gamma)") - - x_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] - xe_ref = np.array([6.6747328233649218e+08, 3.5519299354458244e+14, - 3.4599104054580338e+14, 3.3821165110278112e+14]) - r_ref = np.array([4.0643598574337784e-05, 4.1457730544386974e-05, - 3.4121248544056681e-05, 3.9204686657643301e-05]) - - np.testing.assert_array_equal(x, x_ref) - np.testing.assert_array_equal(y, xe_ref * r_ref) - - def test_evaluate_eigenvalue(self): - """ Tests evaluating eigenvalue - """ - - # Load the reference - filename = join(dirname(__file__), 'test_reference.h5') - res = results.read_results(filename) - - x, y = utilities.evaluate_eigenvalue(res) - - x_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] - y_ref = [1.1921986054449838, 1.1712785643938586, 1.1927099024502694, 1.2269183590698847] - - np.testing.assert_array_equal(x, x_ref) - np.testing.assert_array_equal(y, y_ref) +@pytest.fixture +def res(): + """Load the reference results""" + filename = str(Path(__file__).with_name('test_reference.h5')) + return results.read_results(filename) -if __name__ == '__main__': - unittest.main() +def test_evaluate_single_nuclide(res): + """Tests evaluating single nuclide utility code.""" + x, y = utilities.evaluate_single_nuclide(res, "1", "Xe135") + + x_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] + y_ref = [6.6747328233649218e+08, 3.5519299354458244e+14, + 3.4599104054580338e+14, 3.3821165110278112e+14] + + np.testing.assert_array_equal(x, x_ref) + np.testing.assert_array_equal(y, y_ref) + +def test_evaluate_reaction_rate(res): + """Tests evaluating reaction rate utility code.""" + x, y = utilities.evaluate_reaction_rate(res, "1", "Xe135", "(n,gamma)") + + x_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] + xe_ref = np.array([6.6747328233649218e+08, 3.5519299354458244e+14, + 3.4599104054580338e+14, 3.3821165110278112e+14]) + r_ref = np.array([4.0643598574337784e-05, 4.1457730544386974e-05, + 3.4121248544056681e-05, 3.9204686657643301e-05]) + + np.testing.assert_array_equal(x, x_ref) + np.testing.assert_array_equal(y, xe_ref * r_ref) + + +def test_evaluate_eigenvalue(res): + """Tests evaluating eigenvalue.""" + x, y = utilities.evaluate_eigenvalue(res) + + x_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] + y_ref = [1.1921986054449838, 1.1712785643938586, 1.1927099024502694, 1.2269183590698847] + + np.testing.assert_array_equal(x, x_ref) + np.testing.assert_array_equal(y, y_ref) diff --git a/tests/unit_tests/conftest.py b/tests/unit_tests/conftest.py index d618b85def..1434eaf3b4 100644 --- a/tests/unit_tests/conftest.py +++ b/tests/unit_tests/conftest.py @@ -2,15 +2,6 @@ import openmc import pytest -@pytest.fixture -def run_in_tmpdir(tmpdir): - orig = tmpdir.chdir() - try: - yield - finally: - orig.chdir() - - @pytest.fixture(scope='module') def uo2(): m = openmc.Material(material_id=100, name='UO2') diff --git a/tests/unit_tests/test_depletion_chain.py b/tests/unit_tests/test_depletion_chain.py index 06abbba0f6..de7180e881 100644 --- a/tests/unit_tests/test_depletion_chain.py +++ b/tests/unit_tests/test_depletion_chain.py @@ -3,11 +3,15 @@ from collections import OrderedDict import os import unittest +from pathlib import Path import numpy as np from openmc.deplete import comm, depletion_chain, reaction_rates, nuclide +_test_filename = str(Path(__file__).parents[2] / 'chains' / 'chain_test.xml') + + class TestDepletionChain(unittest.TestCase): """ Tests for DepletionChain class.""" @@ -38,7 +42,7 @@ class TestDepletionChain(unittest.TestCase): # the components external to depletion_chain.py are simple storage # types. - dep = depletion_chain.DepletionChain.xml_read("chains/chain_test.xml") + dep = depletion_chain.DepletionChain.xml_read(_test_filename) # Basic checks self.assertEqual(dep.n_nuclides, 3) @@ -124,7 +128,7 @@ class TestDepletionChain(unittest.TestCase): chain.nuclides = [A, B, C] chain.xml_write(filename) - original = open('chains/chain_test.xml', 'r').read() + original = open(_test_filename, 'r').read() chain_xml = open(filename, 'r').read() self.assertEqual(original, chain_xml) @@ -134,7 +138,7 @@ class TestDepletionChain(unittest.TestCase): """ Using chain_test, and a dummy reaction rate, compute the matrix. """ # Relies on test_xml_read passing. - dep = depletion_chain.DepletionChain.xml_read("chains/chain_test.xml") + dep = depletion_chain.DepletionChain.xml_read(_test_filename) cell_ind = {"10000": 0, "10001": 1} nuc_ind = {"A": 0, "B": 1, "C": 2} From 2e358a2ca474371298dbbbe954527a3bcd764f78 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 9 Feb 2018 16:48:32 -0600 Subject: [PATCH 021/231] Release resources properly from Operator class --- openmc/deplete/integrator/cecm.py | 3 +++ openmc/deplete/integrator/predictor.py | 3 +++ openmc/deplete/openmc_wrapper.py | 7 ++++--- tests/dummy_geometry.py | 3 +++ tests/unit_tests/test_capi.py | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/openmc/deplete/integrator/cecm.py b/openmc/deplete/integrator/cecm.py index 4d9baebb2e..699ccc2033 100644 --- a/openmc/deplete/integrator/cecm.py +++ b/openmc/deplete/integrator/cecm.py @@ -131,3 +131,6 @@ def cecm(operator, print_out=True): # Return to origin os.chdir(dir_home) + + # Release resources + operator.finalize() diff --git a/openmc/deplete/integrator/predictor.py b/openmc/deplete/integrator/predictor.py index 6c9d538fd6..7b41e66493 100644 --- a/openmc/deplete/integrator/predictor.py +++ b/openmc/deplete/integrator/predictor.py @@ -98,3 +98,6 @@ def predictor(operator, print_out=True): # Return to origin os.chdir(dir_home) + + # Release resources + operator.finalize() diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 05b5057d20..5955a5defd 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -219,9 +219,6 @@ class OpenMCOperator(Operator): # Create reaction rate tables self.initialize_reaction_rates() - def __del__(self): - openmc.capi.finalize() - def extract_mat_ids(self): """Extracts materials and assigns them to processes. @@ -475,6 +472,10 @@ class OpenMCOperator(Operator): # Return number density vector return self.total_density_list() + def finalize(self): + """Finalize a depletion simulation and release resources.""" + openmc.capi.finalize() + def _update_materials(self): """Updates material compositions in OpenMC on all processes.""" diff --git a/tests/dummy_geometry.py b/tests/dummy_geometry.py index 614cc726e3..ecdce567d6 100644 --- a/tests/dummy_geometry.py +++ b/tests/dummy_geometry.py @@ -21,6 +21,9 @@ class DummyGeometry(Operator): def __init__(self, settings): super().__init__(settings) + def finalize(self): + pass + @property def chain(self): return self diff --git a/tests/unit_tests/test_capi.py b/tests/unit_tests/test_capi.py index 618f54e4f9..8bc6c3d15c 100644 --- a/tests/unit_tests/test_capi.py +++ b/tests/unit_tests/test_capi.py @@ -1,4 +1,4 @@ -from collections import Mapping +from collections.abc import Mapping import os import numpy as np From 3b31892816831c72354ca8de457c4bbb1afa39e0 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 12 Feb 2018 13:34:35 -0600 Subject: [PATCH 022/231] Make sure entropy/UFS mesh index get cleared during finalize --- src/api.F90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/api.F90 b/src/api.F90 index f07e5e38a5..d79a32d945 100644 --- a/src/api.F90 +++ b/src/api.F90 @@ -121,6 +121,8 @@ contains energy_min_neutron = ZERO entropy_on = .false. gen_per_batch = 1 + index_entropy_mesh = -1 + index_ufs_mesh = -1 keff = ONE legendre_to_tabular = .true. legendre_to_tabular_points = 33 From ef99788ff47cd7ff75c06e61f514fc6fe516f913 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 14 Feb 2018 06:37:17 -0600 Subject: [PATCH 023/231] Get rid of OpenMCSettings.openmc_call, which doesn't make sense anymore --- openmc/deplete/openmc_wrapper.py | 3 --- scripts/example_run.py | 3 --- tests/regression_tests/test_deplete_full.py | 2 -- 3 files changed, 8 deletions(-) diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 5955a5defd..66de945cda 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -58,8 +58,6 @@ class OpenMCSettings(Settings): chain_file : str Path to the depletion chain xml file. Defaults to the environment variable "OPENDEPLETE_CHAIN" if it exists. - openmc_call : str - OpenMC executable path. Defaults to "openmc". particles : int Number of particles to simulate per batch. batches : int @@ -94,7 +92,6 @@ class OpenMCSettings(Settings): self.chain_file = os.environ["OPENDEPLETE_CHAIN"] except KeyError: self.chain_file = None - self.openmc_call = "openmc" self.particles = None self.batches = None self.inactive = None diff --git a/scripts/example_run.py b/scripts/example_run.py index 82d0883c3a..78d7dceddc 100644 --- a/scripts/example_run.py +++ b/scripts/example_run.py @@ -18,9 +18,6 @@ dt = np.repeat([dt1], N) # Create settings variable settings = openmc.deplete.OpenMCSettings() -settings.openmc_call = "openmc" -# An example for mpiexec: -# settings.openmc_call = ["mpiexec", "openmc"] settings.particles = 1000 settings.batches = 100 settings.inactive = 40 diff --git a/tests/regression_tests/test_deplete_full.py b/tests/regression_tests/test_deplete_full.py index 78039abc7e..dda1501fbc 100644 --- a/tests/regression_tests/test_deplete_full.py +++ b/tests/regression_tests/test_deplete_full.py @@ -42,8 +42,6 @@ def test_full(run_in_tmpdir): chain_file = str(Path(__file__).parents[2] / 'chains' / 'chain_simple.xml') settings.chain_file = chain_file - settings.openmc_call = "openmc" - settings.openmc_npernode = 2 settings.particles = 100 settings.batches = 100 settings.inactive = 40 From 26852f79f478a67a45ff790a8af2502f01116233 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 14 Feb 2018 07:22:16 -0600 Subject: [PATCH 024/231] Add tqdm to dependencies. Install mpi4py on Travis --- setup.py | 2 +- tools/ci/travis-install.sh | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 2a42dd65dd..ee11f414b6 100755 --- a/setup.py +++ b/setup.py @@ -57,7 +57,7 @@ kwargs = { # Required dependencies 'install_requires': [ 'numpy>=1.9', 'h5py', 'scipy', 'ipython', 'matplotlib', - 'pandas', 'lxml', 'uncertainties' + 'pandas', 'lxml', 'uncertainties', 'tqdm' ], # Optional dependencies diff --git a/tools/ci/travis-install.sh b/tools/ci/travis-install.sh index 4921534db9..2342cdadbc 100755 --- a/tools/ci/travis-install.sh +++ b/tools/ci/travis-install.sh @@ -14,10 +14,15 @@ pip install cython pip install --upgrade pytest # Pandas stopped supporting Python 3.4 with version 0.21 -if [[ "$TRAVIS_PYTHON_VERSION" == "3.4" ]]; then +if [[ $TRAVIS_PYTHON_VERSION == "3.4" ]]; then pip install pandas==0.20.3 fi +# Install mpi4py for MPI configurations +if [[ $MPI == 'y' ]]; then + pip install --no-binary=mpi4py mpi4py +fi + # Build and install OpenMC executable python tools/ci/travis-install.py From 43147b70eb62ce983443ee3f17ac7bee49b6dd60 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 14 Feb 2018 10:17:30 -0600 Subject: [PATCH 025/231] Change xml_write -> export_to_xml, xml_read -> from_xml for consistency --- openmc/deplete/depletion_chain.py | 8 ++++---- openmc/deplete/nuclide.py | 4 ++-- openmc/deplete/openmc_wrapper.py | 2 +- scripts/make_chain.py | 2 +- tests/unit_tests/test_deplete_nuclide.py | 8 ++++---- tests/unit_tests/test_depletion_chain.py | 15 ++++++++------- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/openmc/deplete/depletion_chain.py b/openmc/deplete/depletion_chain.py index af126035f6..9f6b7cfeda 100644 --- a/openmc/deplete/depletion_chain.py +++ b/openmc/deplete/depletion_chain.py @@ -317,7 +317,7 @@ class DepletionChain(object): return depl_chain @classmethod - def xml_read(cls, filename): + def from_xml(cls, filename): """Reads a depletion chain XML file. Parameters @@ -343,7 +343,7 @@ class DepletionChain(object): reaction_index = 0 for i, nuclide_elem in enumerate(root.findall('nuclide_table')): - nuc = Nuclide.xml_read(nuclide_elem) + nuc = Nuclide.from_xml(nuclide_elem) depl_chain.nuclide_dict[nuc.name] = i # Check for reaction paths @@ -356,7 +356,7 @@ class DepletionChain(object): return depl_chain - def xml_write(self, filename): + def export_to_xml(self, filename): """Writes a depletion chain XML file. Parameters @@ -368,7 +368,7 @@ class DepletionChain(object): root_elem = ET.Element('depletion') for nuclide in self.nuclides: - root_elem.append(nuclide.xml_write()) + root_elem.append(nuclide.to_xml_element()) tree = ET.ElementTree(root_elem) if _have_lxml: diff --git a/openmc/deplete/nuclide.py b/openmc/deplete/nuclide.py index 1208a9b3c3..17cf4d9b8f 100644 --- a/openmc/deplete/nuclide.py +++ b/openmc/deplete/nuclide.py @@ -71,7 +71,7 @@ class Nuclide(object): return len(self.reactions) @classmethod - def xml_read(cls, element): + def from_xml(cls, element): """Read nuclide from an XML element. Parameters @@ -129,7 +129,7 @@ class Nuclide(object): return nuc - def xml_write(self): + def to_xml_element(self): """Write nuclide to XML element. Returns diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 66de945cda..88b4971222 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -186,7 +186,7 @@ class OpenMCOperator(Operator): self.burn_nuc_to_ind = None # Read depletion chain - self.chain = DepletionChain.xml_read(settings.chain_file) + self.chain = DepletionChain.from_xml(settings.chain_file) # Clear out OpenMC, create task lists, distribute if comm.rank == 0: diff --git a/scripts/make_chain.py b/scripts/make_chain.py index ccf4ef9b7b..e2b0a23405 100644 --- a/scripts/make_chain.py +++ b/scripts/make_chain.py @@ -53,7 +53,7 @@ def main(): neutron_files = glob.glob(os.path.join('neutrons', '*.endf')) chain = openmc.deplete.DepletionChain.from_endf(decay_files, nfy_files, neutron_files) - chain.xml_write('chain_endfb71.xml') + chain.export_to_xml('chain_endfb71.xml') if __name__ == '__main__': diff --git a/tests/unit_tests/test_deplete_nuclide.py b/tests/unit_tests/test_deplete_nuclide.py index 2d379030d8..ebcabc5ca9 100644 --- a/tests/unit_tests/test_deplete_nuclide.py +++ b/tests/unit_tests/test_deplete_nuclide.py @@ -35,7 +35,7 @@ class TestNuclide(unittest.TestCase): self.assertEqual(nuc.n_reaction_paths, 3) - def test_xml_read(self): + def test_from_xml(self): """Test reading nuclide data from an XML element.""" data = """ @@ -58,7 +58,7 @@ class TestNuclide(unittest.TestCase): """ element = ET.fromstring(data) - u235 = nuclide.Nuclide.xml_read(element) + u235 = nuclide.Nuclide.from_xml(element) self.assertEqual(u235.decay_modes, [ nuclide.DecayTuple('sf', 'U235', 7.2e-11), @@ -77,7 +77,7 @@ class TestNuclide(unittest.TestCase): ('Xe138', 0.0481413)] }) - def test_xml_write(self): + def test_to_xml_element(self): """Test writing nuclide data to an XML element.""" C = nuclide.Nuclide() @@ -93,7 +93,7 @@ class TestNuclide(unittest.TestCase): ] C.yield_energies = [0.0253] C.yield_data = {0.0253: [("A", 0.0292737), ("B", 0.002566345)]} - element = C.xml_write() + element = C.to_xml_element() self.assertEqual(element.get("half_life"), "0.123") diff --git a/tests/unit_tests/test_depletion_chain.py b/tests/unit_tests/test_depletion_chain.py index de7180e881..ba9e32db47 100644 --- a/tests/unit_tests/test_depletion_chain.py +++ b/tests/unit_tests/test_depletion_chain.py @@ -36,13 +36,13 @@ class TestDepletionChain(unittest.TestCase): out a good way to unit-test this.""" pass - def test_xml_read(self): + def test_from_xml(self): """ Read chain_test.xml and ensure all values are correct. """ # Unfortunately, this routine touches a lot of the code, but most of # the components external to depletion_chain.py are simple storage # types. - dep = depletion_chain.DepletionChain.xml_read(_test_filename) + dep = depletion_chain.DepletionChain.from_xml(_test_filename) # Basic checks self.assertEqual(dep.n_nuclides, 3) @@ -93,11 +93,11 @@ class TestDepletionChain(unittest.TestCase): self.assertEqual(nuc.yield_data[0.0253], [("A", 0.0292737), ("B", 0.002566345)]) - def test_xml_write(self): + def test_export_to_xml(self): """Test writing a depletion chain to XML.""" # Prevent different MPI ranks from conflicting - filename = 'test%u.xml' % comm.rank + filename = 'test{}.xml'.format(comm.rank) A = nuclide.Nuclide() A.name = "A" @@ -126,7 +126,7 @@ class TestDepletionChain(unittest.TestCase): chain = depletion_chain.DepletionChain() chain.nuclides = [A, B, C] - chain.xml_write(filename) + chain.export_to_xml(filename) original = open(_test_filename, 'r').read() chain_xml = open(filename, 'r').read() @@ -136,9 +136,9 @@ class TestDepletionChain(unittest.TestCase): def test_form_matrix(self): """ Using chain_test, and a dummy reaction rate, compute the matrix. """ - # Relies on test_xml_read passing. + # Relies on test_from_xml passing. - dep = depletion_chain.DepletionChain.xml_read(_test_filename) + dep = depletion_chain.DepletionChain.from_xml(_test_filename) cell_ind = {"10000": 0, "10001": 1} nuc_ind = {"A": 0, "B": 1, "C": 2} @@ -196,5 +196,6 @@ class TestDepletionChain(unittest.TestCase): self.assertEqual("NucB", dep.nuc_by_ind("NucB")) self.assertEqual("NucC", dep.nuc_by_ind("NucC")) + if __name__ == '__main__': unittest.main() From 1ee27edc8c935f48894dbefb37bfe48f2db06583 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 14 Feb 2018 10:45:39 -0600 Subject: [PATCH 026/231] Rename DepletionChain -> Chain --- docs/source/pythonapi/deplete/index.rst | 24 +++++++-------- .../pythonapi/deplete/integrator.CRAM16.rst | 2 +- .../pythonapi/deplete/integrator.CRAM48.rst | 2 +- .../pythonapi/deplete/integrator.cecm.rst | 2 +- .../deplete/integrator.predictor.rst | 2 +- .../deplete/integrator.save_results.rst | 2 +- .../deplete/opendeplete.Concentrations.rst | 30 ------------------- .../deplete/opendeplete.ReactionRates.rst | 30 ------------------- .../pythonapi/deplete/opendeplete.Results.rst | 22 -------------- openmc/data/data.py | 3 +- openmc/deplete/__init__.py | 2 +- .../deplete/{depletion_chain.py => chain.py} | 8 ++--- openmc/deplete/openmc_wrapper.py | 20 ++++++------- scripts/make_chain.py | 2 +- ...pletion_chain.py => test_deplete_chain.py} | 20 ++++++------- 15 files changed, 44 insertions(+), 127 deletions(-) delete mode 100644 docs/source/pythonapi/deplete/opendeplete.Concentrations.rst delete mode 100644 docs/source/pythonapi/deplete/opendeplete.ReactionRates.rst delete mode 100644 docs/source/pythonapi/deplete/opendeplete.Results.rst rename openmc/deplete/{depletion_chain.py => chain.py} (99%) rename tests/unit_tests/{test_depletion_chain.py => test_deplete_chain.py} (92%) diff --git a/docs/source/pythonapi/deplete/index.rst b/docs/source/pythonapi/deplete/index.rst index 55380c7a1c..30d2d42611 100644 --- a/docs/source/pythonapi/deplete/index.rst +++ b/docs/source/pythonapi/deplete/index.rst @@ -17,7 +17,7 @@ Integrator Helper Functions --------------------------- .. toctree:: :maxdepth: 2 - + integrator.CRAM16 integrator.CRAM48 integrator.save_results @@ -29,8 +29,8 @@ Metaclasses :toctree: generated :nosignatures: - opendeplete.Settings - opendeplete.Operator + openmc.deplete.Settings + openmc.deplete.Operator OpenMC Classes -------------- @@ -39,18 +39,18 @@ OpenMC Classes :toctree: generated :nosignatures: - opendeplete.OpenMCSettings - opendeplete.Materials - opendeplete.OpenMCOperator + openmc.deplete.OpenMCSettings + openmc.deplete.Materials + openmc.deplete.OpenMCOperator Data Classes ------------ .. autosummary:: :toctree: generated :nosignatures: - - opendeplete.AtomNumber - opendeplete.DepletionChain - opendeplete.Nuclide - opendeplete.ReactionRates - opendeplete.Results + + openmc.deplete.AtomNumber + openmc.deplete.Chain + openmc.deplete.Nuclide + openmc.deplete.ReactionRates + openmc.deplete.Results diff --git a/docs/source/pythonapi/deplete/integrator.CRAM16.rst b/docs/source/pythonapi/deplete/integrator.CRAM16.rst index f9eba273ed..a0dc648056 100644 --- a/docs/source/pythonapi/deplete/integrator.CRAM16.rst +++ b/docs/source/pythonapi/deplete/integrator.CRAM16.rst @@ -1,6 +1,6 @@ integrator\.CRAM16 ================== -.. currentmodule:: opendeplete.integrator +.. currentmodule:: openmc.deplete.integrator .. autofunction:: CRAM16 diff --git a/docs/source/pythonapi/deplete/integrator.CRAM48.rst b/docs/source/pythonapi/deplete/integrator.CRAM48.rst index d7467a418a..f9720f7ad9 100644 --- a/docs/source/pythonapi/deplete/integrator.CRAM48.rst +++ b/docs/source/pythonapi/deplete/integrator.CRAM48.rst @@ -1,6 +1,6 @@ integrator\.CRAM48 ================== -.. currentmodule:: opendeplete.integrator +.. currentmodule:: openmc.deplete.integrator .. autofunction:: CRAM48 diff --git a/docs/source/pythonapi/deplete/integrator.cecm.rst b/docs/source/pythonapi/deplete/integrator.cecm.rst index 507a638f69..4851b20b34 100644 --- a/docs/source/pythonapi/deplete/integrator.cecm.rst +++ b/docs/source/pythonapi/deplete/integrator.cecm.rst @@ -1,6 +1,6 @@ integrator\.cecm ================= -.. currentmodule:: opendeplete.integrator +.. currentmodule:: openmc.deplete.integrator .. autofunction:: cecm diff --git a/docs/source/pythonapi/deplete/integrator.predictor.rst b/docs/source/pythonapi/deplete/integrator.predictor.rst index d6c0fd827c..2243e77f71 100644 --- a/docs/source/pythonapi/deplete/integrator.predictor.rst +++ b/docs/source/pythonapi/deplete/integrator.predictor.rst @@ -1,6 +1,6 @@ integrator\.predictor ===================== -.. currentmodule:: opendeplete.integrator +.. currentmodule:: openmc.deplete.integrator .. autofunction:: predictor diff --git a/docs/source/pythonapi/deplete/integrator.save_results.rst b/docs/source/pythonapi/deplete/integrator.save_results.rst index 5c21dcb664..f9c830cd5b 100644 --- a/docs/source/pythonapi/deplete/integrator.save_results.rst +++ b/docs/source/pythonapi/deplete/integrator.save_results.rst @@ -1,6 +1,6 @@ integrator\.save_results ======================== -.. currentmodule:: opendeplete.integrator +.. currentmodule:: openmc.deplete.integrator .. autofunction:: save_results diff --git a/docs/source/pythonapi/deplete/opendeplete.Concentrations.rst b/docs/source/pythonapi/deplete/opendeplete.Concentrations.rst deleted file mode 100644 index 6fa07a970b..0000000000 --- a/docs/source/pythonapi/deplete/opendeplete.Concentrations.rst +++ /dev/null @@ -1,30 +0,0 @@ -opendeplete.Concentrations -========================== - -.. currentmodule:: opendeplete - -.. autoclass:: Concentrations - - - .. automethod:: __init__ - - - .. rubric:: Methods - - .. autosummary:: - - ~Concentrations.__init__ - ~Concentrations.convert_nested_dict - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~Concentrations.n_cell - ~Concentrations.n_nuc - - \ No newline at end of file diff --git a/docs/source/pythonapi/deplete/opendeplete.ReactionRates.rst b/docs/source/pythonapi/deplete/opendeplete.ReactionRates.rst deleted file mode 100644 index 99e048b565..0000000000 --- a/docs/source/pythonapi/deplete/opendeplete.ReactionRates.rst +++ /dev/null @@ -1,30 +0,0 @@ -opendeplete.ReactionRates -========================= - -.. currentmodule:: opendeplete - -.. autoclass:: ReactionRates - - - .. automethod:: __init__ - - - .. rubric:: Methods - - .. autosummary:: - - ~ReactionRates.__init__ - - - - - - .. rubric:: Attributes - - .. autosummary:: - - ~ReactionRates.n_cell - ~ReactionRates.n_nuc - ~ReactionRates.n_react - - \ No newline at end of file diff --git a/docs/source/pythonapi/deplete/opendeplete.Results.rst b/docs/source/pythonapi/deplete/opendeplete.Results.rst deleted file mode 100644 index 0ab8a1f711..0000000000 --- a/docs/source/pythonapi/deplete/opendeplete.Results.rst +++ /dev/null @@ -1,22 +0,0 @@ -opendeplete.Results -=================== - -.. currentmodule:: opendeplete - -.. autoclass:: Results - - - .. automethod:: __init__ - - - .. rubric:: Methods - - .. autosummary:: - - ~Results.__init__ - - - - - - \ No newline at end of file diff --git a/openmc/data/data.py b/openmc/data/data.py index a7c0e536f6..523ac9769d 100644 --- a/openmc/data/data.py +++ b/openmc/data/data.py @@ -319,8 +319,9 @@ def water_density(temperature, pressure=0.1013): # The value of the Boltzman constant in units of eV / K K_BOLTZMANN = 8.6173303e-5 -# Used for converting units in ACE data +# Unit conversions EV_PER_MEV = 1.0e6 +JOULE_PER_EV = 1.6021766208e-19 # Avogadro's constant AVOGADRO = 6.022140857e23 diff --git a/openmc/deplete/__init__.py b/openmc/deplete/__init__.py index 4bdde3935e..19d1d13201 100644 --- a/openmc/deplete/__init__.py +++ b/openmc/deplete/__init__.py @@ -15,7 +15,7 @@ except ImportError: have_mpi = False from .nuclide import * -from .depletion_chain import * +from .chain import * from .openmc_wrapper import * from .reaction_rates import * from .function import * diff --git a/openmc/deplete/depletion_chain.py b/openmc/deplete/chain.py similarity index 99% rename from openmc/deplete/depletion_chain.py rename to openmc/deplete/chain.py index 9f6b7cfeda..03decb72ab 100644 --- a/openmc/deplete/depletion_chain.py +++ b/openmc/deplete/chain.py @@ -1,4 +1,4 @@ -"""depletion_chain module. +"""chain module. This module contains information about a depletion chain. A depletion chain is loaded from an .xml file and all the nuclides are linked together. @@ -108,10 +108,8 @@ def replace_missing(product, decay_data): return product -class DepletionChain(object): - """The DepletionChain class. - - This class contains a full representation of a depletion chain. +class Chain(object): + """Full representation of a depletion chain. Attributes ---------- diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 88b4971222..5c7a1aebaa 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -21,14 +21,14 @@ import numpy as np import openmc import openmc.capi +from openmc.data import JOULE_PER_EV from . import comm from .atom_number import AtomNumber -from .depletion_chain import DepletionChain +from .chain import Chain from .reaction_rates import ReactionRates from .function import Settings, Operator -_JOULE_PER_EV = 1.6021766208e-19 def chunks(items, n): @@ -149,13 +149,13 @@ class OpenMCOperator(Operator): Materials to be used for this simulation. seed : int The RNG seed used in last OpenMC run. - number : AtomNumber + number : openmc.deplete.AtomNumber Total number of atoms in simulation. participating_nuclides : set of str A set listing all unique nuclides available from cross_sections.xml. - chain : DepletionChain + chain : openmc.deplete.Chain The depletion chain information necessary to form matrices and tallies. - reaction_rates : ReactionRates + reaction_rates : openmc.deplete.ReactionRates Reaction rates from the last operator step. power : OrderedDict of str to float Material-by-Material power. Indexed by material ID. @@ -186,7 +186,7 @@ class OpenMCOperator(Operator): self.burn_nuc_to_ind = None # Read depletion chain - self.chain = DepletionChain.from_xml(settings.chain_file) + self.chain = Chain.from_xml(settings.chain_file) # Clear out OpenMC, create task lists, distribute if comm.rank == 0: @@ -390,7 +390,7 @@ class OpenMCOperator(Operator): Matrices for the next step. k : float Eigenvalue of the problem. - rates : ReactionRates + rates : openmc.deplete.ReactionRates Reaction rates from this simulation. seed : int Seed for this simulation. @@ -602,11 +602,11 @@ class OpenMCOperator(Operator): def generate_tallies(self): """Generates depletion tallies. - Using information from self.depletion_chain as well as the nuclides + Using information from the depletion chain as well as the nuclides currently in the problem, this function automatically generates a tally.xml for the simulation. - """ + """ # Create tallies for depleting regions materials = [openmc.capi.materials[int(i)] for i in self.mat_tally_ind] @@ -742,7 +742,7 @@ class OpenMCOperator(Operator): energy = comm.allreduce(energy) # Determine power in eV/s - power = self.settings.power / _JOULE_PER_EV + power = self.settings.power / JOULE_PER_EV # Scale reaction rates to obtain units of reactions/sec rates[:, :, :] *= power / energy diff --git a/scripts/make_chain.py b/scripts/make_chain.py index e2b0a23405..6d64f34b3c 100644 --- a/scripts/make_chain.py +++ b/scripts/make_chain.py @@ -52,7 +52,7 @@ def main(): nfy_files = glob.glob(os.path.join('nfy', '*.endf')) neutron_files = glob.glob(os.path.join('neutrons', '*.endf')) - chain = openmc.deplete.DepletionChain.from_endf(decay_files, nfy_files, neutron_files) + chain = openmc.deplete.Chain.from_endf(decay_files, nfy_files, neutron_files) chain.export_to_xml('chain_endfb71.xml') diff --git a/tests/unit_tests/test_depletion_chain.py b/tests/unit_tests/test_deplete_chain.py similarity index 92% rename from tests/unit_tests/test_depletion_chain.py rename to tests/unit_tests/test_deplete_chain.py index ba9e32db47..6166f15612 100644 --- a/tests/unit_tests/test_depletion_chain.py +++ b/tests/unit_tests/test_deplete_chain.py @@ -1,4 +1,4 @@ -""" Tests for depletion_chain.py""" +"""Tests for depletion chains""" from collections import OrderedDict import os @@ -6,18 +6,18 @@ import unittest from pathlib import Path import numpy as np -from openmc.deplete import comm, depletion_chain, reaction_rates, nuclide +from openmc.deplete import comm, Chain, reaction_rates, nuclide _test_filename = str(Path(__file__).parents[2] / 'chains' / 'chain_test.xml') -class TestDepletionChain(unittest.TestCase): - """ Tests for DepletionChain class.""" +class TestChain(unittest.TestCase): + """ Tests for Chain class.""" def test__init__(self): """ Test depletion chain initialization.""" - dep = depletion_chain.DepletionChain() + dep = Chain() self.assertIsInstance(dep.nuclides, list) self.assertIsInstance(dep.nuclide_dict, OrderedDict) @@ -25,7 +25,7 @@ class TestDepletionChain(unittest.TestCase): def test_n_nuclides(self): """ Test depletion chain n_nuclides parameter. """ - dep = depletion_chain.DepletionChain() + dep = Chain() dep.nuclides = ["NucA", "NucB", "NucC"] @@ -42,7 +42,7 @@ class TestDepletionChain(unittest.TestCase): # the components external to depletion_chain.py are simple storage # types. - dep = depletion_chain.DepletionChain.from_xml(_test_filename) + dep = Chain.from_xml(_test_filename) # Basic checks self.assertEqual(dep.n_nuclides, 3) @@ -124,7 +124,7 @@ class TestDepletionChain(unittest.TestCase): C.yield_energies = [0.0253] C.yield_data = {0.0253: [("A", 0.0292737), ("B", 0.002566345)]} - chain = depletion_chain.DepletionChain() + chain = Chain() chain.nuclides = [A, B, C] chain.export_to_xml(filename) @@ -138,7 +138,7 @@ class TestDepletionChain(unittest.TestCase): """ Using chain_test, and a dummy reaction rate, compute the matrix. """ # Relies on test_from_xml passing. - dep = depletion_chain.DepletionChain.from_xml(_test_filename) + dep = Chain.from_xml(_test_filename) cell_ind = {"10000": 0, "10001": 1} nuc_ind = {"A": 0, "B": 1, "C": 2} @@ -187,7 +187,7 @@ class TestDepletionChain(unittest.TestCase): def test_nuc_by_ind(self): """ Test nuc_by_ind converter function. """ - dep = depletion_chain.DepletionChain() + dep = Chain() dep.nuclides = ["NucA", "NucB", "NucC"] dep.nuclide_dict = {"NucA" : 0, "NucB" : 1, "NucC" : 2} From dba919c6109009670cc41decae356588c47c305f Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 14 Feb 2018 11:24:24 -0600 Subject: [PATCH 027/231] Convert deplete unit tests to use pytest --- openmc/deplete/integrator/cram.py | 4 +- openmc/deplete/results.py | 2 +- tests/regression_tests/test_deplete_full.py | 1 - tests/unit_tests/test_deplete_atom_number.py | 321 ++++++++-------- tests/unit_tests/test_deplete_cecm.py | 75 ++-- tests/unit_tests/test_deplete_chain.py | 367 +++++++++---------- tests/unit_tests/test_deplete_cram.py | 61 ++- tests/unit_tests/test_deplete_integrator.py | 156 ++++---- tests/unit_tests/test_deplete_nuclide.py | 165 ++++----- tests/unit_tests/test_deplete_predictor.py | 74 ++-- tests/unit_tests/test_deplete_reaction.py | 140 ++++--- 11 files changed, 631 insertions(+), 735 deletions(-) diff --git a/openmc/deplete/integrator/cram.py b/openmc/deplete/integrator/cram.py index a18d8450c3..56476384c6 100644 --- a/openmc/deplete/integrator/cram.py +++ b/openmc/deplete/integrator/cram.py @@ -1,6 +1,6 @@ -""" Chebyshev Rational Approximation Method module +"""Chebyshev Rational Approximation Method module -Implements two different forms of CRAM for use in opendeplete. +Implements two different forms of CRAM for use in openmc.deplete. """ import numpy as np diff --git a/openmc/deplete/results.py b/openmc/deplete/results.py index ae096b8ce5..c08b3ef40d 100644 --- a/openmc/deplete/results.py +++ b/openmc/deplete/results.py @@ -16,7 +16,7 @@ RESULTS_VERSION = 2 class Results(object): - """Contains output of opendeplete. + """Contains output of a depletion run. Attributes ---------- diff --git a/tests/regression_tests/test_deplete_full.py b/tests/regression_tests/test_deplete_full.py index dda1501fbc..5f4af7a737 100644 --- a/tests/regression_tests/test_deplete_full.py +++ b/tests/regression_tests/test_deplete_full.py @@ -2,7 +2,6 @@ from math import floor import shutil -import unittest from pathlib import Path import numpy as np diff --git a/tests/unit_tests/test_deplete_atom_number.py b/tests/unit_tests/test_deplete_atom_number.py index d36b96d38d..e3eb22aa55 100644 --- a/tests/unit_tests/test_deplete_atom_number.py +++ b/tests/unit_tests/test_deplete_atom_number.py @@ -1,180 +1,177 @@ -""" Tests for atom_number.py. """ - -import unittest +""" Tests for the AtomNumber class """ import numpy as np from openmc.deplete import atom_number -class TestAtomNumber(unittest.TestCase): - """Tests for the AtomNumber class.""" +def test_indexing(): + """Tests the __getitem__ and __setitem__ routines simultaneously.""" - def test_indexing(self): - """Tests the __getitem__ and __setitem__ routines simultaneously.""" + mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} + nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} + volume = {"10000" : 0.38, "10001" : 0.21} - mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} - nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} - volume = {"10000" : 0.38, "10001" : 0.21} + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + number["10000", "U238"] = 1.0 + number["10001", "U238"] = 2.0 + number["10000", "U235"] = 3.0 + number["10001", "U235"] = 4.0 - number["10000", "U238"] = 1.0 - number["10001", "U238"] = 2.0 - number["10000", "U235"] = 3.0 - number["10001", "U235"] = 4.0 + # String indexing + assert number["10000", "U238"] == 1.0 + assert number["10001", "U238"] == 2.0 + assert number["10000", "U235"] == 3.0 + assert number["10001", "U235"] == 4.0 - # String indexing - self.assertEqual(number["10000", "U238"], 1.0) - self.assertEqual(number["10001", "U238"], 2.0) - self.assertEqual(number["10000", "U235"], 3.0) - self.assertEqual(number["10001", "U235"], 4.0) + # Int indexing + assert number[0, 0] == 1.0 + assert number[1, 0] == 2.0 + assert number[0, 1] == 3.0 + assert number[1, 1] == 4.0 - # Int indexing - self.assertEqual(number[0, 0], 1.0) - self.assertEqual(number[1, 0], 2.0) - self.assertEqual(number[0, 1], 3.0) - self.assertEqual(number[1, 1], 4.0) + number[0, 0] = 5.0 - number[0, 0] = 5.0 - - self.assertEqual(number[0, 0], 5.0) - self.assertEqual(number["10000", "U238"], 5.0) - - def test_n_mat(self): - """Test number of materials property. """ - mat_to_ind = {"10000" : 0, "10001" : 1} - nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} - volume = {"10000" : 0.38, "10001" : 0.21} - - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) - - self.assertEqual(number.n_mat, 2) - - def test_n_nuc(self): - """Test number of nuclides property.""" - mat_to_ind = {"10000" : 0, "10001" : 1} - nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} - volume = {"10000" : 0.38, "10001" : 0.21} - - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) - - self.assertEqual(number.n_nuc, 3) - - def test_burn_nuc_list(self): - """Test the list of burned nuclides property""" - mat_to_ind = {"10000" : 0, "10001" : 1} - nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} - volume = {"10000" : 0.38, "10001" : 0.21} - - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) - - self.assertEqual(number.burn_nuc_list, ["U238", "U235"]) - - def test_burn_mat_list(self): - """Test the list of burned nuclides property""" - mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} - nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} - volume = {"10000" : 0.38, "10001" : 0.21} - - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) - - self.assertEqual(number.burn_mat_list, ["10000", "10001"]) - - def test_density_indexing(self): - """Tests the get and set_atom_density routines simultaneously.""" - - mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} - nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} - volume = {"10000" : 0.38, "10001" : 0.21} - - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) - - number.set_atom_density("10000", "U238", 1.0) - number.set_atom_density("10001", "U238", 2.0) - number.set_atom_density("10002", "U238", 3.0) - number.set_atom_density("10000", "U235", 4.0) - number.set_atom_density("10001", "U235", 5.0) - number.set_atom_density("10002", "U235", 6.0) - number.set_atom_density("10000", "U234", 7.0) - number.set_atom_density("10001", "U234", 8.0) - number.set_atom_density("10002", "U234", 9.0) - - # String indexing - self.assertEqual(number.get_atom_density("10000", "U238"), 1.0) - self.assertEqual(number.get_atom_density("10001", "U238"), 2.0) - self.assertEqual(number.get_atom_density("10002", "U238"), 3.0) - self.assertEqual(number.get_atom_density("10000", "U235"), 4.0) - self.assertEqual(number.get_atom_density("10001", "U235"), 5.0) - self.assertEqual(number.get_atom_density("10002", "U235"), 6.0) - self.assertEqual(number.get_atom_density("10000", "U234"), 7.0) - self.assertEqual(number.get_atom_density("10001", "U234"), 8.0) - self.assertEqual(number.get_atom_density("10002", "U234"), 9.0) - - # Int indexing - self.assertEqual(number.get_atom_density(0, 0), 1.0) - self.assertEqual(number.get_atom_density(1, 0), 2.0) - self.assertEqual(number.get_atom_density(2, 0), 3.0) - self.assertEqual(number.get_atom_density(0, 1), 4.0) - self.assertEqual(number.get_atom_density(1, 1), 5.0) - self.assertEqual(number.get_atom_density(2, 1), 6.0) - self.assertEqual(number.get_atom_density(0, 2), 7.0) - self.assertEqual(number.get_atom_density(1, 2), 8.0) - self.assertEqual(number.get_atom_density(2, 2), 9.0) + assert number[0, 0] == 5.0 + assert number["10000", "U238"] == 5.0 - number.set_atom_density(0, 0, 5.0) +def test_n_mat(): + """Test number of materials property. """ + mat_to_ind = {"10000" : 0, "10001" : 1} + nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} + volume = {"10000" : 0.38, "10001" : 0.21} - self.assertEqual(number.get_atom_density(0, 0), 5.0) + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) - # Verify volume is used correctly - self.assertEqual(number[0, 0], 5.0 * 0.38) - self.assertEqual(number[1, 0], 2.0 * 0.21) - self.assertEqual(number[2, 0], 3.0 * 1.0) - self.assertEqual(number[0, 1], 4.0 * 0.38) - self.assertEqual(number[1, 1], 5.0 * 0.21) - self.assertEqual(number[2, 1], 6.0 * 1.0) - self.assertEqual(number[0, 2], 7.0 * 0.38) - self.assertEqual(number[1, 2], 8.0 * 0.21) - self.assertEqual(number[2, 2], 9.0 * 1.0) - - def test_get_mat_slice(self): - """Tests getting slices.""" - - mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} - nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} - volume = {"10000" : 0.38, "10001" : 0.21} - - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) - - number.number = np.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0]]) - - sl = number.get_mat_slice(0) - - np.testing.assert_array_equal(sl, np.array([1.0, 2.0])) - - sl = number.get_mat_slice("10000") - - np.testing.assert_array_equal(sl, np.array([1.0, 2.0])) - - def test_set_mat_slice(self): - """Tests getting slices.""" - - mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} - nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} - volume = {"10000" : 0.38, "10001" : 0.21} - - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) - - number.set_mat_slice(0, [1.0, 2.0]) - - self.assertEqual(number[0, 0], 1.0) - self.assertEqual(number[0, 1], 2.0) - - number.set_mat_slice("10000", [3.0, 4.0]) - - self.assertEqual(number[0, 0], 3.0) - self.assertEqual(number[0, 1], 4.0) + assert number.n_mat == 2 -if __name__ == '__main__': - unittest.main() +def test_n_nuc(): + """Test number of nuclides property.""" + mat_to_ind = {"10000" : 0, "10001" : 1} + nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} + volume = {"10000" : 0.38, "10001" : 0.21} + + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + + assert number.n_nuc == 3 + + +def test_burn_nuc_list(): + """Test the list of burned nuclides property""" + mat_to_ind = {"10000" : 0, "10001" : 1} + nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} + volume = {"10000" : 0.38, "10001" : 0.21} + + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + + assert number.burn_nuc_list == ["U238", "U235"] + + +def test_burn_mat_list(): + """Test the list of burned nuclides property""" + mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} + nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} + volume = {"10000" : 0.38, "10001" : 0.21} + + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + + assert number.burn_mat_list == ["10000", "10001"] + + +def test_density_indexing(): + """Tests the get and set_atom_density routines simultaneously.""" + + mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} + nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} + volume = {"10000" : 0.38, "10001" : 0.21} + + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + + number.set_atom_density("10000", "U238", 1.0) + number.set_atom_density("10001", "U238", 2.0) + number.set_atom_density("10002", "U238", 3.0) + number.set_atom_density("10000", "U235", 4.0) + number.set_atom_density("10001", "U235", 5.0) + number.set_atom_density("10002", "U235", 6.0) + number.set_atom_density("10000", "U234", 7.0) + number.set_atom_density("10001", "U234", 8.0) + number.set_atom_density("10002", "U234", 9.0) + + # String indexing + assert number.get_atom_density("10000", "U238") == 1.0 + assert number.get_atom_density("10001", "U238") == 2.0 + assert number.get_atom_density("10002", "U238") == 3.0 + assert number.get_atom_density("10000", "U235") == 4.0 + assert number.get_atom_density("10001", "U235") == 5.0 + assert number.get_atom_density("10002", "U235") == 6.0 + assert number.get_atom_density("10000", "U234") == 7.0 + assert number.get_atom_density("10001", "U234") == 8.0 + assert number.get_atom_density("10002", "U234") == 9.0 + + # Int indexing + assert number.get_atom_density(0, 0) == 1.0 + assert number.get_atom_density(1, 0) == 2.0 + assert number.get_atom_density(2, 0) == 3.0 + assert number.get_atom_density(0, 1) == 4.0 + assert number.get_atom_density(1, 1) == 5.0 + assert number.get_atom_density(2, 1) == 6.0 + assert number.get_atom_density(0, 2) == 7.0 + assert number.get_atom_density(1, 2) == 8.0 + assert number.get_atom_density(2, 2) == 9.0 + + + number.set_atom_density(0, 0, 5.0) + assert number.get_atom_density(0, 0) == 5.0 + + # Verify volume is used correctly + assert number[0, 0] == 5.0 * 0.38 + assert number[1, 0] == 2.0 * 0.21 + assert number[2, 0] == 3.0 * 1.0 + assert number[0, 1] == 4.0 * 0.38 + assert number[1, 1] == 5.0 * 0.21 + assert number[2, 1] == 6.0 * 1.0 + assert number[0, 2] == 7.0 * 0.38 + assert number[1, 2] == 8.0 * 0.21 + assert number[2, 2] == 9.0 * 1.0 + + +def test_get_mat_slice(): + """Tests getting slices.""" + + mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} + nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} + volume = {"10000" : 0.38, "10001" : 0.21} + + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + + number.number = np.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0]]) + + sl = number.get_mat_slice(0) + + np.testing.assert_array_equal(sl, np.array([1.0, 2.0])) + + sl = number.get_mat_slice("10000") + + np.testing.assert_array_equal(sl, np.array([1.0, 2.0])) + + +def test_set_mat_slice(): + """Tests getting slices.""" + + mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} + nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} + volume = {"10000" : 0.38, "10001" : 0.21} + + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + + number.set_mat_slice(0, [1.0, 2.0]) + + assert number[0, 0] == 1.0 + assert number[0, 1] == 2.0 + + number.set_mat_slice("10000", [3.0, 4.0]) + + assert number[0, 0] == 3.0 + assert number[0, 1] == 4.0 diff --git a/tests/unit_tests/test_deplete_cecm.py b/tests/unit_tests/test_deplete_cecm.py index 34c3435a76..264ad21671 100644 --- a/tests/unit_tests/test_deplete_cecm.py +++ b/tests/unit_tests/test_deplete_cecm.py @@ -1,9 +1,9 @@ -""" Regression tests for cecm.py""" +"""Regression tests for openmc.deplete.integrator.cecm algorithm. -import os -import unittest +These tests integrate a simple test problem described in dummy_geometry.py. +""" -import numpy as np +from pytest import approx import openmc.deplete from openmc.deplete import results from openmc.deplete import utilities @@ -11,59 +11,30 @@ from openmc.deplete import utilities from tests import dummy_geometry -class TestCECMRegression(unittest.TestCase): - """ Regression tests for opendeplete.integrator.cecm algorithm. +def test_cecm(run_in_tmpdir): + """Integral regression test of integrator algorithm using CE/CM.""" - These tests integrate a simple test problem described in dummy_geometry.py. - """ + settings = openmc.deplete.Settings() + settings.dt_vec = [0.75, 0.75] + settings.output_dir = "test_integrator_regression" - @classmethod - def setUpClass(cls): - """ Save current directory in case integrator crashes.""" - cls.cwd = os.getcwd() - cls.results = "test_integrator_regression" + op = dummy_geometry.DummyGeometry(settings) - def test_cecm(self): - """ Integral regression test of integrator algorithm using CE/CM. """ + # Perform simulation using the MCNPX/MCNP6 algorithm + openmc.deplete.cecm(op, print_out=False) - settings = openmc.deplete.Settings() - settings.dt_vec = [0.75, 0.75] - settings.output_dir = self.results + # Load the files + res = results.read_results(settings.output_dir + "/results.h5") - op = dummy_geometry.DummyGeometry(settings) + _, y1 = utilities.evaluate_single_nuclide(res, "1", "1") + _, y2 = utilities.evaluate_single_nuclide(res, "1", "2") - # Perform simulation using the MCNPX/MCNP6 algorithm - openmc.deplete.cecm(op, print_out=False) + # Mathematica solution + s1 = [1.86872629872102, 1.395525772416039] + s2 = [2.18097439443550, 2.69429754646747] - # Load the files - res = results.read_results(settings.output_dir + "/results.h5") + assert y1[1] == approx(s1[0]) + assert y2[1] == approx(s1[1]) - _, y1 = utilities.evaluate_single_nuclide(res, "1", "1") - _, y2 = utilities.evaluate_single_nuclide(res, "1", "2") - - # Mathematica solution - s1 = [1.86872629872102, 1.395525772416039] - s2 = [2.18097439443550, 2.69429754646747] - - tol = 1.0e-13 - - self.assertLess(np.absolute(y1[1] - s1[0]), tol) - self.assertLess(np.absolute(y2[1] - s1[1]), tol) - - self.assertLess(np.absolute(y1[2] - s2[0]), tol) - self.assertLess(np.absolute(y2[2] - s2[1]), tol) - - @classmethod - def tearDownClass(cls): - """ Clean up files""" - - os.chdir(cls.cwd) - - openmc.deplete.comm.barrier() - if openmc.deplete.comm.rank == 0: - os.remove(os.path.join(cls.results, "results.h5")) - os.rmdir(cls.results) - - -if __name__ == '__main__': - unittest.main() + assert y1[2] == approx(s2[0]) + assert y2[2] == approx(s2[1]) diff --git a/tests/unit_tests/test_deplete_chain.py b/tests/unit_tests/test_deplete_chain.py index 6166f15612..064b878afe 100644 --- a/tests/unit_tests/test_deplete_chain.py +++ b/tests/unit_tests/test_deplete_chain.py @@ -1,8 +1,7 @@ -"""Tests for depletion chains""" +"""Tests for openmc.deplete.Chain class.""" -from collections import OrderedDict +from collections.abc import Mapping import os -import unittest from pathlib import Path import numpy as np @@ -12,190 +11,184 @@ from openmc.deplete import comm, Chain, reaction_rates, nuclide _test_filename = str(Path(__file__).parents[2] / 'chains' / 'chain_test.xml') -class TestChain(unittest.TestCase): - """ Tests for Chain class.""" +def test_init(): + """Test depletion chain initialization.""" + dep = Chain() - def test__init__(self): - """ Test depletion chain initialization.""" - dep = Chain() - - self.assertIsInstance(dep.nuclides, list) - self.assertIsInstance(dep.nuclide_dict, OrderedDict) - self.assertIsInstance(dep.react_to_ind, OrderedDict) - - def test_n_nuclides(self): - """ Test depletion chain n_nuclides parameter. """ - dep = Chain() - - dep.nuclides = ["NucA", "NucB", "NucC"] - - self.assertEqual(dep.n_nuclides, 3) - - def test_from_endf(self): - """Test depletion chain building from ENDF. Empty at the moment until we figure - out a good way to unit-test this.""" - pass - - def test_from_xml(self): - """ Read chain_test.xml and ensure all values are correct. """ - # Unfortunately, this routine touches a lot of the code, but most of - # the components external to depletion_chain.py are simple storage - # types. - - dep = Chain.from_xml(_test_filename) - - # Basic checks - self.assertEqual(dep.n_nuclides, 3) - - # A tests - nuc = dep.nuclides[dep.nuclide_dict["A"]] - - self.assertEqual(nuc.name, "A") - self.assertEqual(nuc.half_life, 2.36520E+04) - self.assertEqual(nuc.n_decay_modes, 2) - modes = nuc.decay_modes - self.assertEqual([m.target for m in modes], ["B", "C"]) - self.assertEqual([m.type for m in modes], ["beta1", "beta2"]) - self.assertEqual([m.branching_ratio for m in modes], [0.6, 0.4]) - self.assertEqual(nuc.n_reaction_paths, 1) - self.assertEqual([r.target for r in nuc.reactions], ["C"]) - self.assertEqual([r.type for r in nuc.reactions], ["(n,gamma)"]) - self.assertEqual([r.branching_ratio for r in nuc.reactions], [1.0]) - - # B tests - nuc = dep.nuclides[dep.nuclide_dict["B"]] - - self.assertEqual(nuc.name, "B") - self.assertEqual(nuc.half_life, 3.29040E+04) - self.assertEqual(nuc.n_decay_modes, 1) - modes = nuc.decay_modes - self.assertEqual([m.target for m in modes], ["A"]) - self.assertEqual([m.type for m in modes], ["beta"]) - self.assertEqual([m.branching_ratio for m in modes], [1.0]) - self.assertEqual(nuc.n_reaction_paths, 1) - self.assertEqual([r.target for r in nuc.reactions], ["C"]) - self.assertEqual([r.type for r in nuc.reactions], ["(n,gamma)"]) - self.assertEqual([r.branching_ratio for r in nuc.reactions], [1.0]) - - # C tests - nuc = dep.nuclides[dep.nuclide_dict["C"]] - - self.assertEqual(nuc.name, "C") - self.assertEqual(nuc.n_decay_modes, 0) - self.assertEqual(nuc.n_reaction_paths, 3) - self.assertEqual([r.target for r in nuc.reactions], [None, "A", "B"]) - self.assertEqual([r.type for r in nuc.reactions], ["fission", "(n,gamma)", "(n,gamma)"]) - self.assertEqual([r.branching_ratio for r in nuc.reactions], [1.0, 0.7, 0.3]) - - # Yield tests - self.assertEqual(nuc.yield_energies, [0.0253]) - self.assertEqual(list(nuc.yield_data.keys()), [0.0253]) - self.assertEqual(nuc.yield_data[0.0253], - [("A", 0.0292737), ("B", 0.002566345)]) - - def test_export_to_xml(self): - """Test writing a depletion chain to XML.""" - - # Prevent different MPI ranks from conflicting - filename = 'test{}.xml'.format(comm.rank) - - A = nuclide.Nuclide() - A.name = "A" - A.half_life = 2.36520e4 - A.decay_modes = [ - nuclide.DecayTuple("beta1", "B", 0.6), - nuclide.DecayTuple("beta2", "C", 0.4) - ] - A.reactions = [nuclide.ReactionTuple("(n,gamma)", "C", 0.0, 1.0)] - - B = nuclide.Nuclide() - B.name = "B" - B.half_life = 3.29040e4 - B.decay_modes = [nuclide.DecayTuple("beta", "A", 1.0)] - B.reactions = [nuclide.ReactionTuple("(n,gamma)", "C", 0.0, 1.0)] - - C = nuclide.Nuclide() - C.name = "C" - C.reactions = [ - nuclide.ReactionTuple("fission", None, 2.0e8, 1.0), - nuclide.ReactionTuple("(n,gamma)", "A", 0.0, 0.7), - nuclide.ReactionTuple("(n,gamma)", "B", 0.0, 0.3) - ] - C.yield_energies = [0.0253] - C.yield_data = {0.0253: [("A", 0.0292737), ("B", 0.002566345)]} - - chain = Chain() - chain.nuclides = [A, B, C] - chain.export_to_xml(filename) - - original = open(_test_filename, 'r').read() - chain_xml = open(filename, 'r').read() - self.assertEqual(original, chain_xml) - - os.remove(filename) - - def test_form_matrix(self): - """ Using chain_test, and a dummy reaction rate, compute the matrix. """ - # Relies on test_from_xml passing. - - dep = Chain.from_xml(_test_filename) - - cell_ind = {"10000": 0, "10001": 1} - nuc_ind = {"A": 0, "B": 1, "C": 2} - react_ind = dep.react_to_ind - - react = reaction_rates.ReactionRates(cell_ind, nuc_ind, react_ind) - - dep.nuc_to_react_ind = nuc_ind - - react["10000", "C", "fission"] = 1.0 - react["10000", "A", "(n,gamma)"] = 2.0 - react["10000", "B", "(n,gamma)"] = 3.0 - react["10000", "C", "(n,gamma)"] = 4.0 - - mat = dep.form_matrix(react[0, :, :]) - # Loss A, decay, (n, gamma) - mat00 = -np.log(2) / 2.36520E+04 - 2 - # A -> B, decay, 0.6 branching ratio - mat10 = np.log(2) / 2.36520E+04 * 0.6 - # A -> C, decay, 0.4 branching ratio + (n,gamma) - mat20 = np.log(2) / 2.36520E+04 * 0.4 + 2 - - # B -> A, decay, 1.0 branching ratio - mat01 = np.log(2)/3.29040E+04 - # Loss B, decay, (n, gamma) - mat11 = -np.log(2)/3.29040E+04 - 3 - # B -> C, (n, gamma) - mat21 = 3 - - # C -> A fission, (n, gamma) - mat02 = 0.0292737 * 1.0 + 4.0 * 0.7 - # C -> B fission, (n, gamma) - mat12 = 0.002566345 * 1.0 + 4.0 * 0.3 - # Loss C, fission, (n, gamma) - mat22 = -1.0 - 4.0 - - self.assertEqual(mat[0, 0], mat00) - self.assertEqual(mat[1, 0], mat10) - self.assertEqual(mat[2, 0], mat20) - self.assertEqual(mat[0, 1], mat01) - self.assertEqual(mat[1, 1], mat11) - self.assertEqual(mat[2, 1], mat21) - self.assertEqual(mat[0, 2], mat02) - self.assertEqual(mat[1, 2], mat12) - self.assertEqual(mat[2, 2], mat22) - - def test_nuc_by_ind(self): - """ Test nuc_by_ind converter function. """ - dep = Chain() - - dep.nuclides = ["NucA", "NucB", "NucC"] - dep.nuclide_dict = {"NucA" : 0, "NucB" : 1, "NucC" : 2} - - self.assertEqual("NucA", dep.nuc_by_ind("NucA")) - self.assertEqual("NucB", dep.nuc_by_ind("NucB")) - self.assertEqual("NucC", dep.nuc_by_ind("NucC")) + assert isinstance(dep.nuclides, list) + assert isinstance(dep.nuclide_dict, Mapping) + assert isinstance(dep.react_to_ind, Mapping) -if __name__ == '__main__': - unittest.main() +def test_n_nuclides(): + """Test depletion chain n_nuclides parameter.""" + dep = Chain() + dep.nuclides = ["NucA", "NucB", "NucC"] + + assert dep.n_nuclides == 3 + + +def test_from_endf(): + """Test depletion chain building from ENDF. Empty at the moment until we figure + out a good way to unit-test this.""" + pass + + +def test_from_xml(): + """Read chain_test.xml and ensure all values are correct.""" + # Unfortunately, this routine touches a lot of the code, but most of + # the components external to depletion_chain.py are simple storage + # types. + + dep = Chain.from_xml(_test_filename) + + # Basic checks + assert dep.n_nuclides == 3 + + # A tests + nuc = dep.nuclides[dep.nuclide_dict["A"]] + + assert nuc.name == "A" + assert nuc.half_life == 2.36520E+04 + assert nuc.n_decay_modes == 2 + modes = nuc.decay_modes + assert [m.target for m in modes] == ["B", "C"] + assert [m.type for m in modes] == ["beta1", "beta2"] + assert [m.branching_ratio for m in modes] == [0.6, 0.4] + assert nuc.n_reaction_paths == 1 + assert [r.target for r in nuc.reactions] == ["C"] + assert [r.type for r in nuc.reactions] == ["(n,gamma)"] + assert [r.branching_ratio for r in nuc.reactions] == [1.0] + + # B tests + nuc = dep.nuclides[dep.nuclide_dict["B"]] + + assert nuc.name == "B" + assert nuc.half_life == 3.29040E+04 + assert nuc.n_decay_modes == 1 + modes = nuc.decay_modes + assert [m.target for m in modes] == ["A"] + assert [m.type for m in modes] == ["beta"] + assert [m.branching_ratio for m in modes] == [1.0] + assert nuc.n_reaction_paths == 1 + assert [r.target for r in nuc.reactions] == ["C"] + assert [r.type for r in nuc.reactions] == ["(n,gamma)"] + assert [r.branching_ratio for r in nuc.reactions] == [1.0] + + # C tests + nuc = dep.nuclides[dep.nuclide_dict["C"]] + + assert nuc.name == "C" + assert nuc.n_decay_modes == 0 + assert nuc.n_reaction_paths == 3 + assert [r.target for r in nuc.reactions] == [None, "A", "B"] + assert [r.type for r in nuc.reactions] == ["fission", "(n,gamma)", "(n,gamma)"] + assert [r.branching_ratio for r in nuc.reactions] == [1.0, 0.7, 0.3] + + # Yield tests + assert nuc.yield_energies == [0.0253] + assert list(nuc.yield_data) == [0.0253] + assert nuc.yield_data[0.0253] == [("A", 0.0292737), ("B", 0.002566345)] + + +def test_export_to_xml(run_in_tmpdir): + """Test writing a depletion chain to XML.""" + + # Prevent different MPI ranks from conflicting + filename = 'test{}.xml'.format(comm.rank) + + A = nuclide.Nuclide() + A.name = "A" + A.half_life = 2.36520e4 + A.decay_modes = [ + nuclide.DecayTuple("beta1", "B", 0.6), + nuclide.DecayTuple("beta2", "C", 0.4) + ] + A.reactions = [nuclide.ReactionTuple("(n,gamma)", "C", 0.0, 1.0)] + + B = nuclide.Nuclide() + B.name = "B" + B.half_life = 3.29040e4 + B.decay_modes = [nuclide.DecayTuple("beta", "A", 1.0)] + B.reactions = [nuclide.ReactionTuple("(n,gamma)", "C", 0.0, 1.0)] + + C = nuclide.Nuclide() + C.name = "C" + C.reactions = [ + nuclide.ReactionTuple("fission", None, 2.0e8, 1.0), + nuclide.ReactionTuple("(n,gamma)", "A", 0.0, 0.7), + nuclide.ReactionTuple("(n,gamma)", "B", 0.0, 0.3) + ] + C.yield_energies = [0.0253] + C.yield_data = {0.0253: [("A", 0.0292737), ("B", 0.002566345)]} + + chain = Chain() + chain.nuclides = [A, B, C] + chain.export_to_xml(filename) + + original = open(_test_filename, 'r').read() + chain_xml = open(filename, 'r').read() + assert original == chain_xml + + +def test_form_matrix(): + """ Using chain_test, and a dummy reaction rate, compute the matrix. """ + # Relies on test_from_xml passing. + + dep = Chain.from_xml(_test_filename) + + cell_ind = {"10000": 0, "10001": 1} + nuc_ind = {"A": 0, "B": 1, "C": 2} + react_ind = dep.react_to_ind + + react = reaction_rates.ReactionRates(cell_ind, nuc_ind, react_ind) + + dep.nuc_to_react_ind = nuc_ind + + react["10000", "C", "fission"] = 1.0 + react["10000", "A", "(n,gamma)"] = 2.0 + react["10000", "B", "(n,gamma)"] = 3.0 + react["10000", "C", "(n,gamma)"] = 4.0 + + mat = dep.form_matrix(react[0, :, :]) + # Loss A, decay, (n, gamma) + mat00 = -np.log(2) / 2.36520E+04 - 2 + # A -> B, decay, 0.6 branching ratio + mat10 = np.log(2) / 2.36520E+04 * 0.6 + # A -> C, decay, 0.4 branching ratio + (n,gamma) + mat20 = np.log(2) / 2.36520E+04 * 0.4 + 2 + + # B -> A, decay, 1.0 branching ratio + mat01 = np.log(2)/3.29040E+04 + # Loss B, decay, (n, gamma) + mat11 = -np.log(2)/3.29040E+04 - 3 + # B -> C, (n, gamma) + mat21 = 3 + + # C -> A fission, (n, gamma) + mat02 = 0.0292737 * 1.0 + 4.0 * 0.7 + # C -> B fission, (n, gamma) + mat12 = 0.002566345 * 1.0 + 4.0 * 0.3 + # Loss C, fission, (n, gamma) + mat22 = -1.0 - 4.0 + + assert mat[0, 0] == mat00 + assert mat[1, 0] == mat10 + assert mat[2, 0] == mat20 + assert mat[0, 1] == mat01 + assert mat[1, 1] == mat11 + assert mat[2, 1] == mat21 + assert mat[0, 2] == mat02 + assert mat[1, 2] == mat12 + assert mat[2, 2] == mat22 + + +def test_nuc_by_ind(): + """ Test nuc_by_ind converter function. """ + dep = Chain() + dep.nuclides = ["NucA", "NucB", "NucC"] + dep.nuclide_dict = {"NucA" : 0, "NucB" : 1, "NucC" : 2} + + assert "NucA" == dep.nuc_by_ind("NucA") + assert "NucB" == dep.nuc_by_ind("NucB") + assert "NucC" == dep.nuc_by_ind("NucC") diff --git a/tests/unit_tests/test_deplete_cram.py b/tests/unit_tests/test_deplete_cram.py index 10f41fe2b6..21b93d17e3 100644 --- a/tests/unit_tests/test_deplete_cram.py +++ b/tests/unit_tests/test_deplete_cram.py @@ -1,48 +1,37 @@ -""" Tests for cram.py """ +""" Tests for cram.py -import unittest +Compares a few Mathematica matrix exponentials to CRAM16/CRAM48. +""" +from pytest import approx import numpy as np import scipy.sparse as sp from openmc.deplete.integrator import CRAM16, CRAM48 -class TestCram(unittest.TestCase): - """ Tests for cram.py +def test_CRAM16(): + """Test 16-term CRAM.""" + x = np.array([1.0, 1.0]) + mat = sp.csr_matrix([[-1.0, 0.0], [-2.0, -3.0]]) + dt = 0.1 - Compares a few Mathematica matrix exponentials to CRAM16/CRAM48. - """ + z = CRAM16(mat, x, dt) - def test_CRAM16(self): - """ Test 16-term CRAM. """ - x = np.array([1.0, 1.0]) - mat = sp.csr_matrix([[-1.0, 0.0], [-2.0, -3.0]]) - dt = 0.1 + # Solution from mathematica + z0 = np.array((0.904837418035960, 0.576799023327476)) - z = CRAM16(mat, x, dt) - - # Solution from mathematica - z0 = np.array((0.904837418035960, 0.576799023327476)) - - tol = 1.0e-15 - - self.assertLess(np.linalg.norm(z - z0), tol) - - def test_CRAM48(self): - """ Test 48-term CRAM. """ - x = np.array([1.0, 1.0]) - mat = sp.csr_matrix([[-1.0, 0.0], [-2.0, -3.0]]) - dt = 0.1 - - z = CRAM48(mat, x, dt) - - # Solution from mathematica - z0 = np.array((0.904837418035960, 0.576799023327476)) - - tol = 1.0e-15 - - self.assertLess(np.linalg.norm(z - z0), tol) + assert z == approx(z0) -if __name__ == '__main__': - unittest.main() +def test_CRAM48(): + """Test 48-term CRAM.""" + x = np.array([1.0, 1.0]) + mat = sp.csr_matrix([[-1.0, 0.0], [-2.0, -3.0]]) + dt = 0.1 + + z = CRAM48(mat, x, dt) + + # Solution from mathematica + z0 = np.array((0.904837418035960, 0.576799023327476)) + + assert z == approx(z0) diff --git a/tests/unit_tests/test_deplete_integrator.py b/tests/unit_tests/test_deplete_integrator.py index 9b4cbe7802..3b6eed42dc 100644 --- a/tests/unit_tests/test_deplete_integrator.py +++ b/tests/unit_tests/test_deplete_integrator.py @@ -1,115 +1,101 @@ -""" Tests for integrator.py """ +"""Tests for integrator.py + +It is worth noting that openmc.deplete.integrate is extremely complex, to the +point I am unsure if it can be reasonably unit-tested. For the time being, it +will be left unimplemented and testing will be done via regression. + +""" import copy import os -import unittest from unittest.mock import MagicMock import numpy as np from openmc.deplete import integrator, ReactionRates, results, comm -class TestIntegrator(unittest.TestCase): - """ Tests for integrator.py +def test_save_results(run_in_tmpdir): + """Test data save module""" - It is worth noting that opendeplete.integrate is extremely complex, to - the point I am unsure if it can be reasonably unit-tested. For the time - being, it will be left unimplemented and testing will be done via - regression (in test_integrator_regression.py) - """ + stages = 3 - def test_save_results(self): - """ Test data save module """ + np.random.seed(comm.rank) - stages = 3 + # Mock geometry + op = MagicMock() - np.random.seed(comm.rank) + vol_dict = {} + full_burn_dict = {} - # Mock geometry - op = MagicMock() + j = 0 + for i in range(comm.size): + vol_dict[str(2*i)] = 1.2 + vol_dict[str(2*i + 1)] = 1.2 + full_burn_dict[str(2*i)] = j + full_burn_dict[str(2*i + 1)] = j + 1 + j += 2 - vol_dict = {} - full_burn_dict = {} + burn_list = [str(i) for i in range(2*comm.rank, 2*comm.rank + 2)] + nuc_list = ["na", "nb"] - j = 0 - for i in range(comm.size): - vol_dict[str(2*i)] = 1.2 - vol_dict[str(2*i + 1)] = 1.2 - full_burn_dict[str(2*i)] = j - full_burn_dict[str(2*i + 1)] = j + 1 - j += 2 + op.get_results_info.return_value = vol_dict, nuc_list, burn_list, full_burn_dict - burn_list = [str(i) for i in range(2*comm.rank, 2*comm.rank + 2)] - nuc_list = ["na", "nb"] + # Construct x + x1 = [] + x2 = [] - op.get_results_info.return_value = vol_dict, nuc_list, burn_list, full_burn_dict + for i in range(stages): + x1.append([np.random.rand(2), np.random.rand(2)]) + x2.append([np.random.rand(2), np.random.rand(2)]) - # Construct x - x1 = [] - x2 = [] + # Construct r + cell_dict = {s:i for i, s in enumerate(burn_list)} + r1 = ReactionRates(cell_dict, {"na":0, "nb":1}, {"ra":0, "rb":1}) + r1.rates = np.random.rand(2, 2, 2) - for i in range(stages): - x1.append([np.random.rand(2), np.random.rand(2)]) - x2.append([np.random.rand(2), np.random.rand(2)]) + rate1 = [] + rate2 = [] - # Construct r - cell_dict = {s:i for i, s in enumerate(burn_list)} - r1 = ReactionRates(cell_dict, {"na":0, "nb":1}, {"ra":0, "rb":1}) + for i in range(stages): + rate1.append(copy.deepcopy(r1)) + r1.rates = np.random.rand(2, 2, 2) + rate2.append(copy.deepcopy(r1)) r1.rates = np.random.rand(2, 2, 2) - rate1 = [] - rate2 = [] + # Create global terms + eigvl1 = np.random.rand(stages) + eigvl2 = np.random.rand(stages) + seed1 = [np.random.randint(100) for i in range(stages)] + seed2 = [np.random.randint(100) for i in range(stages)] - for i in range(stages): - rate1.append(copy.deepcopy(r1)) - r1.rates = np.random.rand(2, 2, 2) - rate2.append(copy.deepcopy(r1)) - r1.rates = np.random.rand(2, 2, 2) + eigvl1 = comm.bcast(eigvl1, root=0) + eigvl2 = comm.bcast(eigvl2, root=0) + seed1 = comm.bcast(seed1, root=0) + seed2 = comm.bcast(seed2, root=0) - # Create global terms - eigvl1 = np.random.rand(stages) - eigvl2 = np.random.rand(stages) - seed1 = [np.random.randint(100) for i in range(stages)] - seed2 = [np.random.randint(100) for i in range(stages)] + t1 = [0.0, 1.0] + t2 = [1.0, 2.0] - eigvl1 = comm.bcast(eigvl1, root=0) - eigvl2 = comm.bcast(eigvl2, root=0) - seed1 = comm.bcast(seed1, root=0) - seed2 = comm.bcast(seed2, root=0) + integrator.save_results(op, x1, rate1, eigvl1, seed1, t1, 0) + integrator.save_results(op, x2, rate2, eigvl2, seed2, t2, 1) - t1 = [0.0, 1.0] - t2 = [1.0, 2.0] + # Load the files + res = results.read_results("results.h5") - integrator.save_results(op, x1, rate1, eigvl1, seed1, t1, 0) - integrator.save_results(op, x2, rate2, eigvl2, seed2, t2, 1) + for i in range(stages): + for mat_i, mat in enumerate(burn_list): + for nuc_i, nuc in enumerate(nuc_list): + assert res[0][i, mat, nuc] == x1[i][mat_i][nuc_i] + assert res[1][i, mat, nuc] == x2[i][mat_i][nuc_i] + np.testing.assert_array_equal(res[0].rates[i][mat, nuc, :], + rate1[i][mat, nuc, :]) + np.testing.assert_array_equal(res[1].rates[i][mat, nuc, :], + rate2[i][mat, nuc, :]) - # Load the files - res = results.read_results("results.h5") + np.testing.assert_array_equal(res[0].k, eigvl1) + np.testing.assert_array_equal(res[0].seeds, seed1) + np.testing.assert_array_equal(res[0].time, t1) - for i in range(stages): - for mat_i, mat in enumerate(burn_list): - - for nuc_i, nuc in enumerate(nuc_list): - self.assertEqual(res[0][i, mat, nuc], x1[i][mat_i][nuc_i]) - self.assertEqual(res[1][i, mat, nuc], x2[i][mat_i][nuc_i]) - np.testing.assert_array_equal(res[0].rates[i][mat, nuc, :], - rate1[i][mat, nuc, :]) - np.testing.assert_array_equal(res[1].rates[i][mat, nuc, :], - rate2[i][mat, nuc, :]) - - np.testing.assert_array_equal(res[0].k, eigvl1) - np.testing.assert_array_equal(res[0].seeds, seed1) - np.testing.assert_array_equal(res[0].time, t1) - - np.testing.assert_array_equal(res[1].k, eigvl2) - np.testing.assert_array_equal(res[1].seeds, seed2) - np.testing.assert_array_equal(res[1].time, t2) - - # Delete files - comm.barrier() - if comm.rank == 0: - os.remove("results.h5") - - -if __name__ == '__main__': - unittest.main() + np.testing.assert_array_equal(res[1].k, eigvl2) + np.testing.assert_array_equal(res[1].seeds, seed2) + np.testing.assert_array_equal(res[1].time, t2) diff --git a/tests/unit_tests/test_deplete_nuclide.py b/tests/unit_tests/test_deplete_nuclide.py index ebcabc5ca9..2add13f866 100644 --- a/tests/unit_tests/test_deplete_nuclide.py +++ b/tests/unit_tests/test_deplete_nuclide.py @@ -1,44 +1,42 @@ -""" Tests for nuclide.py. """ +"""Tests for the openmc.deplete.Nuclide class.""" -import unittest import xml.etree.ElementTree as ET from openmc.deplete import nuclide -class TestNuclide(unittest.TestCase): - """ Tests for the nuclide class. """ +def test_n_decay_modes(): + """ Test the decay mode count parameter. """ - def test_n_decay_modes(self): - """ Test the decay mode count parameter. """ + nuc = nuclide.Nuclide() - nuc = nuclide.Nuclide() + nuc.decay_modes = [ + nuclide.DecayTuple("beta1", "a", 0.5), + nuclide.DecayTuple("beta2", "b", 0.3), + nuclide.DecayTuple("beta3", "c", 0.2) + ] - nuc.decay_modes = [ - nuclide.DecayTuple("beta1", "a", 0.5), - nuclide.DecayTuple("beta2", "b", 0.3), - nuclide.DecayTuple("beta3", "c", 0.2) - ] + assert nuc.n_decay_modes == 3 - self.assertEqual(nuc.n_decay_modes, 3) - def test_n_reaction_paths(self): - """ Test the reaction path count parameter. """ +def test_n_reaction_paths(): + """ Test the reaction path count parameter. """ - nuc = nuclide.Nuclide() + nuc = nuclide.Nuclide() - nuc.reactions = [ - nuclide.ReactionTuple("(n,2n)", "a", 0.0, 1.0), - nuclide.ReactionTuple("(n,3n)", "b", 0.0, 1.0), - nuclide.ReactionTuple("(n,4n)", "c", 0.0, 1.0) - ] + nuc.reactions = [ + nuclide.ReactionTuple("(n,2n)", "a", 0.0, 1.0), + nuclide.ReactionTuple("(n,3n)", "b", 0.0, 1.0), + nuclide.ReactionTuple("(n,4n)", "c", 0.0, 1.0) + ] - self.assertEqual(nuc.n_reaction_paths, 3) + assert nuc.n_reaction_paths == 3 - def test_from_xml(self): - """Test reading nuclide data from an XML element.""" - data = """ +def test_from_xml(): + """Test reading nuclide data from an XML element.""" + + data = """ @@ -55,67 +53,64 @@ class TestNuclide(unittest.TestCase): - """ + """ - element = ET.fromstring(data) - u235 = nuclide.Nuclide.from_xml(element) + element = ET.fromstring(data) + u235 = nuclide.Nuclide.from_xml(element) - self.assertEqual(u235.decay_modes, [ - nuclide.DecayTuple('sf', 'U235', 7.2e-11), - nuclide.DecayTuple('alpha', 'Th231', 1 - 7.2e-11) - ]) - self.assertEqual(u235.reactions, [ - nuclide.ReactionTuple('(n,2n)', 'U234', -5297781.0, 1.0), - nuclide.ReactionTuple('(n,3n)', 'U233', -12142300.0, 1.0), - nuclide.ReactionTuple('(n,4n)', 'U232', -17885600.0, 1.0), - nuclide.ReactionTuple('(n,gamma)', 'U236', 6545200.0, 1.0), - nuclide.ReactionTuple('fission', None, 193405400.0, 1.0), - ]) - self.assertEqual(u235.yield_energies, [0.0253]) - self.assertEqual(u235.yield_data, { - 0.0253: [('Te134', 0.062155), ('Zr100', 0.0497641), - ('Xe138', 0.0481413)] - }) - - def test_to_xml_element(self): - """Test writing nuclide data to an XML element.""" - - C = nuclide.Nuclide() - C.name = "C" - C.half_life = 0.123 - C.decay_modes = [ - nuclide.DecayTuple('beta-', 'B', 0.99), - nuclide.DecayTuple('alpha', 'D', 0.01) - ] - C.reactions = [ - nuclide.ReactionTuple('fission', None, 2.0e8, 1.0), - nuclide.ReactionTuple('(n,gamma)', 'A', 0.0, 1.0) - ] - C.yield_energies = [0.0253] - C.yield_data = {0.0253: [("A", 0.0292737), ("B", 0.002566345)]} - element = C.to_xml_element() - - self.assertEqual(element.get("half_life"), "0.123") - - decay_elems = element.findall("decay_type") - self.assertEqual(len(decay_elems), 2) - self.assertEqual(decay_elems[0].get("type"), "beta-") - self.assertEqual(decay_elems[0].get("target"), "B") - self.assertEqual(decay_elems[0].get("branching_ratio"), "0.99") - self.assertEqual(decay_elems[1].get("type"), "alpha") - self.assertEqual(decay_elems[1].get("target"), "D") - self.assertEqual(decay_elems[1].get("branching_ratio"), "0.01") - - rx_elems = element.findall("reaction_type") - self.assertEqual(len(rx_elems), 2) - self.assertEqual(rx_elems[0].get("type"), "fission") - self.assertEqual(float(rx_elems[0].get("Q")), 2.0e8) - self.assertEqual(rx_elems[1].get("type"), "(n,gamma)") - self.assertEqual(rx_elems[1].get("target"), "A") - self.assertEqual(float(rx_elems[1].get("Q")), 0.0) - - self.assertIsNotNone(element.find('neutron_fission_yields')) + assert u235.decay_modes == [ + nuclide.DecayTuple('sf', 'U235', 7.2e-11), + nuclide.DecayTuple('alpha', 'Th231', 1 - 7.2e-11) + ] + assert u235.reactions == [ + nuclide.ReactionTuple('(n,2n)', 'U234', -5297781.0, 1.0), + nuclide.ReactionTuple('(n,3n)', 'U233', -12142300.0, 1.0), + nuclide.ReactionTuple('(n,4n)', 'U232', -17885600.0, 1.0), + nuclide.ReactionTuple('(n,gamma)', 'U236', 6545200.0, 1.0), + nuclide.ReactionTuple('fission', None, 193405400.0, 1.0), + ] + assert u235.yield_energies == [0.0253] + assert u235.yield_data == { + 0.0253: [('Te134', 0.062155), ('Zr100', 0.0497641), + ('Xe138', 0.0481413)] + } -if __name__ == '__main__': - unittest.main() +def test_to_xml_element(): + """Test writing nuclide data to an XML element.""" + + C = nuclide.Nuclide() + C.name = "C" + C.half_life = 0.123 + C.decay_modes = [ + nuclide.DecayTuple('beta-', 'B', 0.99), + nuclide.DecayTuple('alpha', 'D', 0.01) + ] + C.reactions = [ + nuclide.ReactionTuple('fission', None, 2.0e8, 1.0), + nuclide.ReactionTuple('(n,gamma)', 'A', 0.0, 1.0) + ] + C.yield_energies = [0.0253] + C.yield_data = {0.0253: [("A", 0.0292737), ("B", 0.002566345)]} + element = C.to_xml_element() + + assert element.get("half_life") == "0.123" + + decay_elems = element.findall("decay_type") + assert len(decay_elems) == 2 + assert decay_elems[0].get("type") == "beta-" + assert decay_elems[0].get("target") == "B" + assert decay_elems[0].get("branching_ratio") == "0.99" + assert decay_elems[1].get("type") == "alpha" + assert decay_elems[1].get("target") == "D" + assert decay_elems[1].get("branching_ratio") == "0.01" + + rx_elems = element.findall("reaction_type") + assert len(rx_elems) == 2 + assert rx_elems[0].get("type") == "fission" + assert float(rx_elems[0].get("Q")) == 2.0e8 + assert rx_elems[1].get("type") == "(n,gamma)" + assert rx_elems[1].get("target") == "A" + assert float(rx_elems[1].get("Q")) == 0.0 + + assert element.find('neutron_fission_yields') is not None diff --git a/tests/unit_tests/test_deplete_predictor.py b/tests/unit_tests/test_deplete_predictor.py index 6ad2007d9c..d4b2efd330 100644 --- a/tests/unit_tests/test_deplete_predictor.py +++ b/tests/unit_tests/test_deplete_predictor.py @@ -1,68 +1,40 @@ -""" Regression tests for predictor.py""" +"""Regression tests for openmc.deplete.integrator.predictor algorithm. -import os -import unittest +These tests integrate a simple test problem described in dummy_geometry.py. +""" -import numpy as np +from pytest import approx import openmc.deplete from openmc.deplete import results from openmc.deplete import utilities from tests import dummy_geometry -class TestPredictorRegression(unittest.TestCase): - """ Regression tests for opendeplete.integrator.predictor algorithm. - These tests integrate a simple test problem described in dummy_geometry.py. - """ +def test_predictor(): + """Integral regression test of integrator algorithm using predictor/corrector""" - @classmethod - def setUpClass(cls): - """ Save current directory in case integrator crashes.""" - cls.cwd = os.getcwd() - cls.results = "test_integrator_regression" + settings = openmc.deplete.Settings() + settings.dt_vec = [0.75, 0.75] + settings.output_dir = "test_integrator_regression" - def test_predictor(self): - """ Integral regression test of integrator algorithm using CE/CM. """ + op = dummy_geometry.DummyGeometry(settings) - settings = openmc.deplete.Settings() - settings.dt_vec = [0.75, 0.75] - settings.output_dir = self.results + # Perform simulation using the predictor algorithm + openmc.deplete.predictor(op, print_out=False) - op = dummy_geometry.DummyGeometry(settings) + # Load the files + res = results.read_results(settings.output_dir + "/results.h5") - # Perform simulation using the predictor algorithm - openmc.deplete.predictor(op, print_out=False) + _, y1 = utilities.evaluate_single_nuclide(res, "1", "1") + _, y2 = utilities.evaluate_single_nuclide(res, "1", "2") - # Load the files - res = results.read_results(settings.output_dir + "/results.h5") + # Mathematica solution + s1 = [2.46847546272295, 0.986431226850467] + s2 = [4.11525874568034, -0.0581692232513460] - _, y1 = utilities.evaluate_single_nuclide(res, "1", "1") - _, y2 = utilities.evaluate_single_nuclide(res, "1", "2") + assert y1[1] == approx(s1[0]) + assert y2[1] == approx(s1[1]) - # Mathematica solution - s1 = [2.46847546272295, 0.986431226850467] - s2 = [4.11525874568034, -0.0581692232513460] - - tol = 1.0e-13 - - self.assertLess(np.absolute(y1[1] - s1[0]), tol) - self.assertLess(np.absolute(y2[1] - s1[1]), tol) - - self.assertLess(np.absolute(y1[2] - s2[0]), tol) - self.assertLess(np.absolute(y2[2] - s2[1]), tol) - - @classmethod - def tearDownClass(cls): - """ Clean up files""" - - os.chdir(cls.cwd) - - openmc.deplete.comm.barrier() - if openmc.deplete.comm.rank == 0: - os.remove(os.path.join(cls.results, "results.h5")) - os.rmdir(cls.results) - - -if __name__ == '__main__': - unittest.main() + assert y1[2] == approx(s2[0]) + assert y2[2] == approx(s2[1]) diff --git a/tests/unit_tests/test_deplete_reaction.py b/tests/unit_tests/test_deplete_reaction.py index 2139be16c2..a98535e1d8 100644 --- a/tests/unit_tests/test_deplete_reaction.py +++ b/tests/unit_tests/test_deplete_reaction.py @@ -1,86 +1,80 @@ -""" Tests for reaction_rates.py. """ - -import unittest +"""Tests for the openmc.deplete.ReactionRates class.""" from openmc.deplete import reaction_rates -class TestReactionRates(unittest.TestCase): - """ Tests for the ReactionRates class. """ +def test_indexing(): + """Tests the __getitem__ and __setitem__ routines simultaneously.""" - def test_indexing(self): - """Tests the __getitem__ and __setitem__ routines simultaneously.""" + mat_to_ind = {"10000" : 0, "10001" : 1} + nuc_to_ind = {"U238" : 0, "U235" : 1} + react_to_ind = {"fission" : 0, "(n,gamma)" : 1} - mat_to_ind = {"10000" : 0, "10001" : 1} - nuc_to_ind = {"U238" : 0, "U235" : 1} - react_to_ind = {"fission" : 0, "(n,gamma)" : 1} + rates = reaction_rates.ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) - rates = reaction_rates.ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) + rates["10000", "U238", "fission"] = 1.0 + rates["10001", "U238", "fission"] = 2.0 + rates["10000", "U235", "fission"] = 3.0 + rates["10001", "U235", "fission"] = 4.0 + rates["10000", "U238", "(n,gamma)"] = 5.0 + rates["10001", "U238", "(n,gamma)"] = 6.0 + rates["10000", "U235", "(n,gamma)"] = 7.0 + rates["10001", "U235", "(n,gamma)"] = 8.0 - rates["10000", "U238", "fission"] = 1.0 - rates["10001", "U238", "fission"] = 2.0 - rates["10000", "U235", "fission"] = 3.0 - rates["10001", "U235", "fission"] = 4.0 - rates["10000", "U238", "(n,gamma)"] = 5.0 - rates["10001", "U238", "(n,gamma)"] = 6.0 - rates["10000", "U235", "(n,gamma)"] = 7.0 - rates["10001", "U235", "(n,gamma)"] = 8.0 + # String indexing + assert rates["10000", "U238", "fission"] == 1.0 + assert rates["10001", "U238", "fission"] == 2.0 + assert rates["10000", "U235", "fission"] == 3.0 + assert rates["10001", "U235", "fission"] == 4.0 + assert rates["10000", "U238", "(n,gamma)"] == 5.0 + assert rates["10001", "U238", "(n,gamma)"] == 6.0 + assert rates["10000", "U235", "(n,gamma)"] == 7.0 + assert rates["10001", "U235", "(n,gamma)"] == 8.0 - # String indexing - self.assertEqual(rates["10000", "U238", "fission"], 1.0) - self.assertEqual(rates["10001", "U238", "fission"], 2.0) - self.assertEqual(rates["10000", "U235", "fission"], 3.0) - self.assertEqual(rates["10001", "U235", "fission"], 4.0) - self.assertEqual(rates["10000", "U238", "(n,gamma)"], 5.0) - self.assertEqual(rates["10001", "U238", "(n,gamma)"], 6.0) - self.assertEqual(rates["10000", "U235", "(n,gamma)"], 7.0) - self.assertEqual(rates["10001", "U235", "(n,gamma)"], 8.0) + # Int indexing + assert rates[0, 0, 0] == 1.0 + assert rates[1, 0, 0] == 2.0 + assert rates[0, 1, 0] == 3.0 + assert rates[1, 1, 0] == 4.0 + assert rates[0, 0, 1] == 5.0 + assert rates[1, 0, 1] == 6.0 + assert rates[0, 1, 1] == 7.0 + assert rates[1, 1, 1] == 8.0 - # Int indexing - self.assertEqual(rates[0, 0, 0], 1.0) - self.assertEqual(rates[1, 0, 0], 2.0) - self.assertEqual(rates[0, 1, 0], 3.0) - self.assertEqual(rates[1, 1, 0], 4.0) - self.assertEqual(rates[0, 0, 1], 5.0) - self.assertEqual(rates[1, 0, 1], 6.0) - self.assertEqual(rates[0, 1, 1], 7.0) - self.assertEqual(rates[1, 1, 1], 8.0) + rates[0, 0, 0] = 5.0 - rates[0, 0, 0] = 5.0 - - self.assertEqual(rates[0, 0, 0], 5.0) - self.assertEqual(rates["10000", "U238", "fission"], 5.0) - - def test_n_mat(self): - """ Test number of materials property. """ - mat_to_ind = {"10000" : 0, "10001" : 1} - nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} - react_to_ind = {"fission" : 0, "(n,gamma)" : 1, "(n,2n)" : 2, "(n,3n)" : 3} - - rates = reaction_rates.ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) - - self.assertEqual(rates.n_mat, 2) - - def test_n_nuc(self): - """ Test number of nuclides property. """ - mat_to_ind = {"10000" : 0, "10001" : 1} - nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} - react_to_ind = {"fission" : 0, "(n,gamma)" : 1, "(n,2n)" : 2, "(n,3n)" : 3} - - rates = reaction_rates.ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) - - self.assertEqual(rates.n_nuc, 3) - - def test_n_react(self): - """ Test number of reactions property. """ - mat_to_ind = {"10000" : 0, "10001" : 1} - nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} - react_to_ind = {"fission" : 0, "(n,gamma)" : 1, "(n,2n)" : 2, "(n,3n)" : 3} - - rates = reaction_rates.ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) - - self.assertEqual(rates.n_react, 4) + assert rates[0, 0, 0] == 5.0 + assert rates["10000", "U238", "fission"] == 5.0 -if __name__ == '__main__': - unittest.main() +def test_n_mat(): + """Test number of materials property.""" + mat_to_ind = {"10000" : 0, "10001" : 1} + nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} + react_to_ind = {"fission" : 0, "(n,gamma)" : 1, "(n,2n)" : 2, "(n,3n)" : 3} + + rates = reaction_rates.ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) + + assert rates.n_mat == 2 + + +def test_n_nuc(): + """Test number of nuclides property.""" + mat_to_ind = {"10000" : 0, "10001" : 1} + nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} + react_to_ind = {"fission" : 0, "(n,gamma)" : 1, "(n,2n)" : 2, "(n,3n)" : 3} + + rates = reaction_rates.ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) + + assert rates.n_nuc == 3 + + +def test_n_react(): + """ Test number of reactions property. """ + mat_to_ind = {"10000" : 0, "10001" : 1} + nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} + react_to_ind = {"fission" : 0, "(n,gamma)" : 1, "(n,2n)" : 2, "(n,3n)" : 3} + + rates = reaction_rates.ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) + + assert rates.n_react == 4 From 939d47cffa59fd8570a60fbb255cb4a4a8164dff Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 14 Feb 2018 12:46:23 -0600 Subject: [PATCH 028/231] Simplify OpenMCSettings class (can properly delegate to openmc.Settings) --- openmc/deplete/openmc_wrapper.py | 116 ++++++-------------- scripts/example_run.py | 18 +-- tests/regression_tests/test_deplete_full.py | 29 +++-- 3 files changed, 56 insertions(+), 107 deletions(-) diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 5c7a1aebaa..bf0a124710 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -31,7 +31,7 @@ from .function import Settings, Operator -def chunks(items, n): +def _chunks(items, n): min_size, extra = divmod(len(items), n) j = 0 chunk_list = [] @@ -43,70 +43,61 @@ def chunks(items, n): class OpenMCSettings(Settings): - """The OpenMCSettings class. - - Extends Settings to provide information OpenMC needs to run. + """Extends Settings to provide information OpenMC needs to run. Attributes ---------- dt_vec : numpy.array - Array of time steps to take. (From Settings) - tol : float - Tolerance for adaptive time stepping. (From Settings) + Array of time steps to in units of [s] output_dir : str - Path to output directory to save results. (From Settings) + Path to output directory to save results. chain_file : str - Path to the depletion chain xml file. Defaults to the environment - variable "OPENDEPLETE_CHAIN" if it exists. - particles : int - Number of particles to simulate per batch. - batches : int - Number of batches. - inactive : int - Number of inactive batches. - lower_left : list of float - Coordinate of lower left of bounding box of geometry. - upper_right : list of float - Coordinate of upper right of bounding box of geometry. - entropy_dimension : list of int - Grid size of entropy. - dilute_initial : float, default 1.0e3 + Path to the depletion chain xml file. Defaults to the + :envvar:`OPENDEPLETE_CHAIN` environment variable if it exists. + dilute_initial : float Initial atom density to add for nuclides that are zero in initial condition to ensure they exist in the decay chain. Only done for - nuclides with reaction rates. + nuclides with reaction rates. Defaults to 1.0e3. round_number : bool Whether or not to round output to OpenMC to 8 digits. Useful in testing, as OpenMC is incredibly sensitive to exact values. - constant_seed : int - If present, all runs will be performed with this seed. power : float - Power of the reactor in W. For a 2D problem, the power can be given in + Power of the reactor in [W]. For a 2D problem, the power can be given in W/cm as long as the "volume" assigned to a depletion material is actually an area in cm^2. + settings : openmc.Settings + Settings for OpenMC simulations + """ + _depletion_attrs = {'dt_vec', 'output_dir', 'chain_file', 'dilute_initial', + 'round_number', 'power'} + def __init__(self): super().__init__() - # OpenMC specific try: self.chain_file = os.environ["OPENDEPLETE_CHAIN"] except KeyError: self.chain_file = None - self.particles = None - self.batches = None - self.inactive = None - self.lower_left = None - self.upper_right = None - self.entropy_dimension = None self.dilute_initial = 1.0e3 - - # OpenMC testing specific self.round_number = False - self.constant_seed = None - - # Depletion problem specific self.power = None + # Avoid setattr to create OpenMC settings + self.__dict__['settings'] = openmc.Settings() + + def __setattr__(self, name, value): + if name in self._depletion_attrs: + self.__dict__[name] = value + else: + setattr(self.__dict__['settings'], name, value) + + def __getattr__(self, name): + if name in self._depletion_attrs: + return self.__dict__[name] + else: + return getattr(self.__dict__['settings'], name) + class Materials(object): """The Materials class. @@ -290,8 +281,8 @@ class OpenMCOperator(Operator): i += 1 # Decompose geometry - mat_burn_lists = chunks(mat_burn, comm.size) - mat_not_burn_lists = chunks(mat_not_burn, comm.size) + mat_burn_lists = _chunks(mat_burn, comm.size) + mat_not_burn_lists = _chunks(mat_not_burn, comm.size) mat_tally_ind = OrderedDict() @@ -456,7 +447,7 @@ class OpenMCOperator(Operator): # Create XML files if comm.rank == 0: self.geometry.export_to_xml() - self.generate_settings_xml() + self.settings.settings.export_to_xml() self.generate_materials_xml() # Initialize OpenMC library @@ -526,46 +517,6 @@ class OpenMCOperator(Operator): materials.export_to_xml() - def generate_settings_xml(self): - """Generates settings.xml. - - This function creates settings.xml using the value of the settings - variable. - - Todo - ---- - Rewrite to generalize source box. - """ - - batches = self.settings.batches - inactive = self.settings.inactive - particles = self.settings.particles - - # Just a generic settings file to get it running. - settings_file = openmc.Settings() - settings_file.batches = batches - settings_file.inactive = inactive - settings_file.particles = particles - settings_file.source = openmc.Source(space=openmc.stats.Box( - self.settings.lower_left, self.settings.upper_right)) - - if self.settings.entropy_dimension is not None: - entropy_mesh = openmc.Mesh() - entropy_mesh.lower_left = self.settings.lower_left - entropy_mesh.upper_right = self.settings.upper_right - entropy_mesh.dimension = self.settings.entropy_dimension - settings_file.entropy_mesh = entropy_mesh - - # Set seed - if self.settings.constant_seed is not None: - seed = self.settings.constant_seed - else: - seed = random.randint(1, sys.maxsize-1) - - settings_file.seed = self.seed = seed - - settings_file.export_to_xml() - def _get_tally_nuclides(self): nuc_set = set() @@ -581,7 +532,6 @@ class OpenMCOperator(Operator): for i in range(1, comm.size): nuc_newset = comm.recv(source=i, tag=i) nuc_set |= nuc_newset - else: comm.send(nuc_set, dest=0, tag=comm.rank) diff --git a/scripts/example_run.py b/scripts/example_run.py index 78d7dceddc..56d42b21a7 100644 --- a/scripts/example_run.py +++ b/scripts/example_run.py @@ -1,6 +1,8 @@ """An example file showing how to run a simulation.""" import numpy as np +import openmc +from openmc.data import JOULE_PER_EV import openmc.deplete import example_geometry @@ -15,20 +17,18 @@ N = np.floor(dt2/dt1) dt = np.repeat([dt1], N) -# Create settings variable +# Depletion settings settings = openmc.deplete.OpenMCSettings() +settings.power = 2.337e15*4*JOULE_PER_EV*1e6 # MeV/second cm from CASMO +settings.dt_vec = dt +settings.output_dir = 'test' +# OpenMC-delegated settings settings.particles = 1000 settings.batches = 100 settings.inactive = 40 -settings.lower_left = lower_left -settings.upper_right = upper_right -settings.entropy_dimension = [10, 10, 1] - -joule_per_mev = 1.6021766208e-13 -settings.power = 2.337e15*4*joule_per_mev # MeV/second cm from CASMO -settings.dt_vec = dt -settings.output_dir = 'test' +settings.source = openmc.Source(space=openmc.stats.Box(lower_left, upper_right)) +settings.verbosity = 3 op = openmc.deplete.OpenMCOperator(geometry, settings) diff --git a/tests/regression_tests/test_deplete_full.py b/tests/regression_tests/test_deplete_full.py index 5f4af7a737..fcaa60eee5 100644 --- a/tests/regression_tests/test_deplete_full.py +++ b/tests/regression_tests/test_deplete_full.py @@ -5,6 +5,8 @@ import shutil from pathlib import Path import numpy as np +import openmc +from openmc.data import JOULE_PER_EV import openmc.deplete from openmc.deplete import results from openmc.deplete import utilities @@ -35,26 +37,23 @@ def test_full(run_in_tmpdir): N = floor(dt2/dt1) dt = np.full(N, dt1) - # Create settings variable + # Depletion settings settings = openmc.deplete.OpenMCSettings() + settings.chain_file = str(Path(__file__).parents[2] / 'chains' / + 'chain_simple.xml') + settings.power = 2.337e15*4*JOULE_PER_EV*1e6 # MeV/second cm from CASMO + settings.dt_vec = dt + settings.output_dir = "test_full" + settings.round_number = True - - chain_file = str(Path(__file__).parents[2] / 'chains' / 'chain_simple.xml') - settings.chain_file = chain_file + # Add OpenMC-specific settings settings.particles = 100 settings.batches = 100 settings.inactive = 40 - settings.lower_left = lower_left - settings.upper_right = upper_right - settings.entropy_dimension = [10, 10, 1] - - settings.round_number = True - settings.constant_seed = 1 - - joule_per_mev = 1.6021766208e-13 - settings.power = 2.337e15*4*joule_per_mev # MeV/second cm from CASMO - settings.dt_vec = dt - settings.output_dir = "test_full" + space = openmc.stats.Box(lower_left, upper_right) + settings.source = openmc.Source(space=space) + settings.seed = 1 + settings.verbosity = 3 op = openmc.deplete.OpenMCOperator(geometry, settings) From f494fecf21b7e8de0066c27acdd1258e06641694 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 14 Feb 2018 12:57:56 -0600 Subject: [PATCH 029/231] Change Operator.eval() -> Operator.__call__() --- openmc/deplete/function.py | 35 +++---- openmc/deplete/integrator/cecm.py | 6 +- openmc/deplete/integrator/predictor.py | 4 +- openmc/deplete/openmc_wrapper.py | 104 ++++++++++----------- tests/dummy_geometry.py | 16 ++-- tests/unit_tests/test_deplete_predictor.py | 2 +- 6 files changed, 84 insertions(+), 83 deletions(-) diff --git a/openmc/deplete/function.py b/openmc/deplete/function.py index bcc055e67b..b9694d88b1 100644 --- a/openmc/deplete/function.py +++ b/openmc/deplete/function.py @@ -27,33 +27,19 @@ class Settings(object): class Operator(metaclass=ABCMeta): - """The Operator metaclass. - - This defines all functions that the integrator needs to operate. + """Abstract class defining all methods needed for the integrator. Attributes ---------- settings : Settings Settings object. - """ + """ def __init__(self, settings): self.settings = settings @abstractmethod - def initial_condition(self): - """Performs final setup and returns initial condition. - - Returns - ------- - list of numpy.array - Total density for initial conditions. - """ - - pass - - @abstractmethod - def eval(self, vec, print_out=True): + def __call__(self, vec, print_out=True): """Runs a simulation. Parameters @@ -72,6 +58,17 @@ class Operator(metaclass=ABCMeta): seed : int Seed for this simulation. """ + pass + + @abstractmethod + def initial_condition(self): + """Performs final setup and returns initial condition. + + Returns + ------- + list of numpy.array + Total density for initial conditions. + """ pass @@ -114,3 +111,7 @@ class Operator(metaclass=ABCMeta): """ pass + + @abstractmethod + def finalize(self): + pass diff --git a/openmc/deplete/integrator/cecm.py b/openmc/deplete/integrator/cecm.py index 699ccc2033..57a87c703e 100644 --- a/openmc/deplete/integrator/cecm.py +++ b/openmc/deplete/integrator/cecm.py @@ -62,7 +62,7 @@ def cecm(operator, print_out=True): eigvls = [] rates_array = [] - eigvl, rates, seed = operator.eval(x[0]) + eigvl, rates, seed = operator(x[0]) eigvls.append(eigvl) seeds.append(seed) @@ -86,7 +86,7 @@ def cecm(operator, print_out=True): x.append(x_result) - eigvl, rates, seed = operator.eval(x[1]) + eigvl, rates, seed = operator(x[1]) eigvls.append(eigvl) seeds.append(seed) @@ -119,7 +119,7 @@ def cecm(operator, print_out=True): seeds = [] eigvls = [] rates_array = [] - eigvl, rates, seed = operator.eval(x[0]) + eigvl, rates, seed = operator(x[0]) eigvls.append(eigvl) seeds.append(seed) diff --git a/openmc/deplete/integrator/predictor.py b/openmc/deplete/integrator/predictor.py index 7b41e66493..1b8d00600c 100644 --- a/openmc/deplete/integrator/predictor.py +++ b/openmc/deplete/integrator/predictor.py @@ -53,7 +53,7 @@ def predictor(operator, print_out=True): eigvls = [] rates_array = [] - eigvl, rates, seed = operator.eval(x[0]) + eigvl, rates, seed = operator(x[0]) eigvls.append(eigvl) seeds.append(seed) @@ -86,7 +86,7 @@ def predictor(operator, print_out=True): seeds = [] eigvls = [] rates_array = [] - eigvl, rates, seed = operator.eval(x[0]) + eigvl, rates, seed = operator(x[0]) eigvls.append(eigvl) seeds.append(seed) diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index bf0a124710..3dce9db7b9 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -207,6 +207,58 @@ class OpenMCOperator(Operator): # Create reaction rate tables self.initialize_reaction_rates() + def __call__(self, vec, print_out=True): + """Runs a simulation. + + Parameters + ---------- + vec : list of numpy.array + Total atoms to be used in function. + print_out : bool, optional + Whether or not to print out time. + + Returns + ------- + mat : list of scipy.sparse.csr_matrix + Matrices for the next step. + k : float + Eigenvalue of the problem. + rates : openmc.deplete.ReactionRates + Reaction rates from this simulation. + seed : int + Seed for this simulation. + """ + + # Prevent OpenMC from complaining about re-creating tallies + openmc.reset_auto_ids() + + # Update status + self.set_density(vec) + + time_start = time.time() + + # Update material compositions and tally nuclides + self._update_materials() + openmc.capi.tallies[1].nuclides = self._get_tally_nuclides() + + # Run OpenMC + openmc.capi.reset() + openmc.capi.run() + + time_openmc = time.time() + + # Extract results + k = self.unpack_tallies_and_normalize() + + if comm.rank == 0: + time_unpack = time.time() + + if print_out: + print("Time to openmc: ", time_openmc - time_start) + print("Time to unpack: ", time_unpack - time_openmc) + + return k, copy.deepcopy(self.reaction_rates), self.seed + def extract_mat_ids(self): """Extracts materials and assigns them to processes. @@ -365,58 +417,6 @@ class OpenMCOperator(Operator): self.chain.nuc_to_react_ind = self.burn_nuc_to_ind - def eval(self, vec, print_out=True): - """Runs a simulation. - - Parameters - ---------- - vec : list of numpy.array - Total atoms to be used in function. - print_out : bool, optional - Whether or not to print out time. - - Returns - ------- - mat : list of scipy.sparse.csr_matrix - Matrices for the next step. - k : float - Eigenvalue of the problem. - rates : openmc.deplete.ReactionRates - Reaction rates from this simulation. - seed : int - Seed for this simulation. - """ - - # Prevent OpenMC from complaining about re-creating tallies - openmc.reset_auto_ids() - - # Update status - self.set_density(vec) - - time_start = time.time() - - # Update material compositions and tally nuclides - self._update_materials() - openmc.capi.tallies[1].nuclides = self._get_tally_nuclides() - - # Run OpenMC - openmc.capi.reset() - openmc.capi.run() - - time_openmc = time.time() - - # Extract results - k = self.unpack_tallies_and_normalize() - - if comm.rank == 0: - time_unpack = time.time() - - if print_out: - print("Time to openmc: ", time_openmc - time_start) - print("Time to unpack: ", time_unpack - time_openmc) - - return k, copy.deepcopy(self.reaction_rates), self.seed - def form_matrix(self, y, mat): """Forms the depletion matrix. diff --git a/tests/dummy_geometry.py b/tests/dummy_geometry.py index ecdce567d6..585c1b11cd 100644 --- a/tests/dummy_geometry.py +++ b/tests/dummy_geometry.py @@ -21,14 +21,7 @@ class DummyGeometry(Operator): def __init__(self, settings): super().__init__(settings) - def finalize(self): - pass - - @property - def chain(self): - return self - - def eval(self, vec, print_out=False): + def __call__(self, vec, print_out=False): """Evaluates F(y) Parameters @@ -60,6 +53,13 @@ class DummyGeometry(Operator): # Create a fake rates object return 0.0, reaction_rates, 0 + def finalize(self): + pass + + @property + def chain(self): + return self + def form_matrix(self, rates): """Forms the f(y) matrix in y' = f(y)y. diff --git a/tests/unit_tests/test_deplete_predictor.py b/tests/unit_tests/test_deplete_predictor.py index d4b2efd330..d808c46b8e 100644 --- a/tests/unit_tests/test_deplete_predictor.py +++ b/tests/unit_tests/test_deplete_predictor.py @@ -11,7 +11,7 @@ from openmc.deplete import utilities from tests import dummy_geometry -def test_predictor(): +def test_predictor(run_in_tmpdir): """Integral regression test of integrator algorithm using predictor/corrector""" settings = openmc.deplete.Settings() From fc6b3bd9d9a36b23efced294eb32b0e9a30b9a76 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 14 Feb 2018 13:39:40 -0600 Subject: [PATCH 030/231] Make Results.from_hdf5 a classmethod --- openmc/deplete/integrator/cecm.py | 2 +- openmc/deplete/results.py | 62 +++++++++++++------------------ 2 files changed, 27 insertions(+), 37 deletions(-) diff --git a/openmc/deplete/integrator/cecm.py b/openmc/deplete/integrator/cecm.py index 57a87c703e..5432f172d0 100644 --- a/openmc/deplete/integrator/cecm.py +++ b/openmc/deplete/integrator/cecm.py @@ -30,7 +30,7 @@ def cecm(operator, print_out=True): .. [ref] Isotalo, Aarno. "Comparison of Neutronics-Depletion Coupling Schemes - for Burnup Calculations—Continued Study." Nuclear Science and + for Burnup Calculations-Continued Study." Nuclear Science and Engineering 180.3 (2015): 286-300. Parameters diff --git a/openmc/deplete/results.py b/openmc/deplete/results.py index c08b3ef40d..1a2ee4e437 100644 --- a/openmc/deplete/results.py +++ b/openmc/deplete/results.py @@ -302,7 +302,8 @@ class Results(object): if comm.rank == 0: time_dset[index, :] = self.time - def from_hdf5(self, handle, index): + @classmethod + def from_hdf5(cls, handle, index): """Loads results object from HDF5. Parameters @@ -312,6 +313,7 @@ class Results(object): index : int What step is this? """ + results = cls() # Grab handles number_dset = handle["/number"] @@ -319,15 +321,15 @@ class Results(object): seeds_dset = handle["/seeds"] time_dset = handle["/time"] - self.data = number_dset[index, :, :, :] - self.k = eigenvalues_dset[index, :] - self.seeds = seeds_dset[index, :] - self.time = time_dset[index, :] + results.data = number_dset[index, :, :, :] + results.k = eigenvalues_dset[index, :] + results.seeds = seeds_dset[index, :] + results.time = time_dset[index, :] # Reconstruct dictionaries - self.volume = OrderedDict() - self.mat_to_ind = OrderedDict() - self.nuc_to_ind = OrderedDict() + results.volume = OrderedDict() + results.mat_to_ind = OrderedDict() + results.nuc_to_ind = OrderedDict() rxn_nuc_to_ind = OrderedDict() rxn_to_ind = OrderedDict() @@ -336,13 +338,13 @@ class Results(object): vol = mat_handle.attrs["volume"] ind = mat_handle.attrs["index"] - self.volume[mat] = vol - self.mat_to_ind[mat] = ind + results.volume[mat] = vol + results.mat_to_ind[mat] = ind for nuc in handle["/nuclides"]: nuc_handle = handle["/nuclides/" + nuc] ind_atom = nuc_handle.attrs["atom number index"] - self.nuc_to_ind[nuc] = ind_atom + results.nuc_to_ind[nuc] = ind_atom if "reaction rate index" in nuc_handle.attrs: rxn_nuc_to_ind[nuc] = nuc_handle.attrs["reaction rate index"] @@ -351,13 +353,15 @@ class Results(object): rxn_handle = handle["/reactions/" + rxn] rxn_to_ind[rxn] = rxn_handle.attrs["index"] - self.rates = [] + results.rates = [] # Reconstruct reactions - for i in range(self.n_stages): - rate = ReactionRates(self.mat_to_ind, rxn_nuc_to_ind, rxn_to_ind) + for i in range(results.n_stages): + rate = ReactionRates(results.mat_to_ind, rxn_nuc_to_ind, rxn_to_ind) rate.rates = handle["/reaction rates"][index, i, :, :, :] - self.rates.append(rate) + results.rates.append(rate) + + return results def get_dict(number): @@ -419,7 +423,7 @@ def write_results(result, filename, index): def read_results(filename): - """Reads out a list of results objects from an hdf5 file. + """Return a list of Results objects from an HDF5 file. Parameters ---------- @@ -430,26 +434,12 @@ def read_results(filename): ------- results : list of Results The result objects. + """ + with h5py.File(filename, "r") as fh: + assert fh["version"].value == RESULTS_VERSION - file = h5py.File(filename, "r") + # Get number of results stored + n = fh["number"].value.shape[0] - assert file["/version"].value == RESULTS_VERSION - - # Grab handles - number_dset = file["/number"] - - # Get number of results stored - number_shape = list(number_dset.shape) - number_results = number_shape[0] - - results = [] - - for i in range(number_results): - result = Results() - result.from_hdf5(file, i) - results.append(result) - - file.close() - - return results + return [Results.from_hdf5(fh, i) for i in range(n)] From 730623246f53e25fd6875b04953ae3633aab4e75 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 14 Feb 2018 15:36:00 -0600 Subject: [PATCH 031/231] Rename results.h5 -> depletion_results.h5. Use /materials in HDF5 file --- openmc/deplete/integrator/save_results.py | 4 ++-- openmc/deplete/results.py | 12 ++++-------- scripts/example_plot.py | 2 +- scripts/example_run.py | 1 - tests/regression_tests/test_deplete_full.py | 2 +- tests/regression_tests/test_reference.h5 | Bin 165384 -> 231608 bytes tests/unit_tests/test_deplete_cecm.py | 2 +- tests/unit_tests/test_deplete_integrator.py | 2 +- tests/unit_tests/test_deplete_predictor.py | 2 +- 9 files changed, 11 insertions(+), 16 deletions(-) diff --git a/openmc/deplete/integrator/save_results.py b/openmc/deplete/integrator/save_results.py index 4f20b52fde..f580af838c 100644 --- a/openmc/deplete/integrator/save_results.py +++ b/openmc/deplete/integrator/save_results.py @@ -9,7 +9,7 @@ def save_results(op, x, rates, eigvls, seeds, t, step_ind): Parameters ---------- - op : Function + op : openmc.deplete.Operator The operator used to generate these results. x : list of list of numpy.array The prior x vectors. Indexed [i][cell] using the above equation. @@ -44,4 +44,4 @@ def save_results(op, x, rates, eigvls, seeds, t, step_ind): results.time = t results.rates = rates - write_results(results, "results.h5", step_ind) + write_results(results, "depletion_results.h5", step_ind) diff --git a/openmc/deplete/results.py b/openmc/deplete/results.py index 1a2ee4e437..fd48bb4df1 100644 --- a/openmc/deplete/results.py +++ b/openmc/deplete/results.py @@ -52,7 +52,6 @@ class Results(object): self.k = None self.seeds = None self.time = None - self.p_terms = None self.rates = None self.volume = None @@ -192,7 +191,7 @@ class Results(object): n_rxn = len(rxn_list) n_stages = self.n_stages - mat_group = handle.create_group("cells") + mat_group = handle.create_group("materials") for mat in mat_list: mat_single_group = mat_group.create_group(mat) @@ -333,24 +332,21 @@ class Results(object): rxn_nuc_to_ind = OrderedDict() rxn_to_ind = OrderedDict() - for mat in handle["/cells"]: - mat_handle = handle["/cells/" + mat] + for mat, mat_handle in handle["/materials"].items(): vol = mat_handle.attrs["volume"] ind = mat_handle.attrs["index"] results.volume[mat] = vol results.mat_to_ind[mat] = ind - for nuc in handle["/nuclides"]: - nuc_handle = handle["/nuclides/" + nuc] + for nuc, nuc_handle in handle["/nuclides"].items(): ind_atom = nuc_handle.attrs["atom number index"] results.nuc_to_ind[nuc] = ind_atom if "reaction rate index" in nuc_handle.attrs: rxn_nuc_to_ind[nuc] = nuc_handle.attrs["reaction rate index"] - for rxn in handle["/reactions"]: - rxn_handle = handle["/reactions/" + rxn] + for rxn, rxn_handle in handle["/reactions"].items(): rxn_to_ind[rxn] = rxn_handle.attrs["index"] results.rates = [] diff --git a/scripts/example_plot.py b/scripts/example_plot.py index c92fef6bf2..ab5ac204d8 100644 --- a/scripts/example_plot.py +++ b/scripts/example_plot.py @@ -8,7 +8,7 @@ from openmc.deplete import (read_results, evaluate_single_nuclide, result_folder = "test" # Load data -results = read_results(result_folder + "/results.h5") +results = read_results(result_folder + "/deplete_results.h5") cell = "5" nuc = "Gd157" diff --git a/scripts/example_run.py b/scripts/example_run.py index 56d42b21a7..30b6bdc2ee 100644 --- a/scripts/example_run.py +++ b/scripts/example_run.py @@ -28,7 +28,6 @@ settings.particles = 1000 settings.batches = 100 settings.inactive = 40 settings.source = openmc.Source(space=openmc.stats.Box(lower_left, upper_right)) -settings.verbosity = 3 op = openmc.deplete.OpenMCOperator(geometry, settings) diff --git a/tests/regression_tests/test_deplete_full.py b/tests/regression_tests/test_deplete_full.py index fcaa60eee5..e775e7af86 100644 --- a/tests/regression_tests/test_deplete_full.py +++ b/tests/regression_tests/test_deplete_full.py @@ -61,7 +61,7 @@ def test_full(run_in_tmpdir): openmc.deplete.integrator.predictor(op) # Load the files - res_test = results.read_results(settings.output_dir + "/results.h5") + res_test = results.read_results(settings.output_dir + "/depletion_results.h5") # Load the reference filename = str(Path(__file__).with_name('test_reference.h5')) diff --git a/tests/regression_tests/test_reference.h5 b/tests/regression_tests/test_reference.h5 index ef3ae0090943bc7ecdc01a1afaa70c0216e029f0..f832e3e2635c8d25a09609c38830227a3a551958 100644 GIT binary patch delta 27268 zcmeI5@sHDI9mk)3%UtEA6vv?7k(`A)vhO?$9fnasXEmTzbW~VIg|L)GObKi@FlQ0i zb%VJ^#Pw*{RWY+-&~9U-3kJHNvltgUhwj{>t0OLD2GfNt>*6vlkg3n-`Fy_nKHuxJ z=P!8fhr4_Fym(q(pXYghpWbuV7JoRsG4|1t6KoWNPmLU~0)-P#Tcd$;W|}jUWB3u; zZ;5XLZu|S#c8b>Cz0*$ZofdfTSN2_-?%BM3%cgBR2y)@r*qIx~OQ!-~IQ4^Lf&2b( z^=)fbu4HWH*u(Z{_D48Ql>SNXF>EKOT{(sA47HojV!J@??n~INQak(_wwu(B_psfe zcILm>X871fS@D{n=!(*VtzVDr1hv}^wlnU3W+}D{)OJ>4yGrfUT5LC|o!^A*4z;V_ z#x@g=;~K_Vd+>&YHFoCRgW<@`WRV^sJ>;9p=Z~cWti1Tib^P-K;`58*^Zes*%l6~z zZX|SR48K`=6MbEbU*pvOX;yya_68=h*Q*&(VfK}c)XX8+S z1sRmDL>gzZu=p-Uiy{TwtUaS^Z(Y42z^1VfajgSbNh&>)ctPMOj3p2Hx%$J{o*2Wg z5gM;>$j^1@--Yn@VHPE@QSpP(N3fl!@JV*GTv!}6<(^XRiLcq#n7-UnS;`|z_LO7S z8I4o&i?5nU&^e^{C{0_wY?hR3@uYFd*wkx5Iq`Mds_0cp3tOm+e8#Bc8Q7;1re)=@ z-evm77?OG5__Qp3&bU;$tZ%lhNA)U8KSh;w&JCNT=opvEZYE`G&mRB43in6K$Q#(#+()12FItGC~E_<-=yJBbpNW(k2aRypbirGlINu27@AB2FID*SqmJYHb6@ zuZYRD=8DK?T%XJE0^6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ahs9{mKCAi=qjvu5RRn~EUkf0(>T?=k&J^qA+|;TMcYl}9*JUaZ$xilN3j=LTLf z8dVy_nexqgkF8Ik$L^9~dDq{)B+pWU#_1Jv+(4C*U*t)SIvNXc9G8>gLU4KN=q>Vd z(sBT9h!qHQ=z+NddIdL0E{v*^9BN)%rmuN2jy1>v$DfO3&za}7TxnmN!=dtL^(qU? zQDqf4uCo2AQK?c1({eJQciFfFUABSaE|aermnxTVsJue2viEsZ83vB4Y+Ueu+ES!M z&D@NP8?e%qK;%n_Iy%ezoRl7ds}L8V^10(lO9QweR;8X4JvbNi>TZ%<7*!{GX`5{& z^<~d}5ldA9j+fne-K-#Pv@h5pjk>G!E^A*#mo3gc@ut~eDm=pZ@@l=s&R5YQst$8Vp!V(hnpbW^wGGbgf5)sHuCp)6;c$7qUgN|%)Y$t* zuzcl`(Wuf0(=oYG?=iFiJvzW$F&c+!#pZisaVtZwv!Ud>IK3!~~Z?_9R6&HA!8??khm zZ;G;yw}Jt)H|I+G5*?x_p4H2o+>A0Kz|C4R9>3bigz2e}XL<%(fLvWMSQOf$q zlU4?BLkwS;p1-j3RzK*K-6Xp(s!n!DBWH)c=-nKu4ebbyAO2Xt?2Ne2z9fPZ=6m%X zqxYc41m^~BG#XVJVLn!N>OH2viyrekgX06U&3uIA-8UcMhaK_5=+WDf+p>gV?S<#D96j zygfW-s*8Td~DAh#l)3SqRp9Yh-&m}};ai3nMG;hnh7Me?q$|Ib9^X000%N%)G Q!*hq`vcUB6KWAq7$Bg66+$yY`3sm<}8}c9W2{B cSQs0YbHWrkOgv~leZqD|r|n&980&5V0K4QAp8x;= diff --git a/tests/unit_tests/test_deplete_cecm.py b/tests/unit_tests/test_deplete_cecm.py index 264ad21671..7fe8c6a043 100644 --- a/tests/unit_tests/test_deplete_cecm.py +++ b/tests/unit_tests/test_deplete_cecm.py @@ -24,7 +24,7 @@ def test_cecm(run_in_tmpdir): openmc.deplete.cecm(op, print_out=False) # Load the files - res = results.read_results(settings.output_dir + "/results.h5") + res = results.read_results(settings.output_dir + "/depletion_results.h5") _, y1 = utilities.evaluate_single_nuclide(res, "1", "1") _, y2 = utilities.evaluate_single_nuclide(res, "1", "2") diff --git a/tests/unit_tests/test_deplete_integrator.py b/tests/unit_tests/test_deplete_integrator.py index 3b6eed42dc..964f99eee3 100644 --- a/tests/unit_tests/test_deplete_integrator.py +++ b/tests/unit_tests/test_deplete_integrator.py @@ -80,7 +80,7 @@ def test_save_results(run_in_tmpdir): integrator.save_results(op, x2, rate2, eigvl2, seed2, t2, 1) # Load the files - res = results.read_results("results.h5") + res = results.read_results("depletion_results.h5") for i in range(stages): for mat_i, mat in enumerate(burn_list): diff --git a/tests/unit_tests/test_deplete_predictor.py b/tests/unit_tests/test_deplete_predictor.py index d808c46b8e..8ec8964bbd 100644 --- a/tests/unit_tests/test_deplete_predictor.py +++ b/tests/unit_tests/test_deplete_predictor.py @@ -24,7 +24,7 @@ def test_predictor(run_in_tmpdir): openmc.deplete.predictor(op, print_out=False) # Load the files - res = results.read_results(settings.output_dir + "/results.h5") + res = results.read_results(settings.output_dir + "/depletion_results.h5") _, y1 = utilities.evaluate_single_nuclide(res, "1", "1") _, y2 = utilities.evaluate_single_nuclide(res, "1", "2") From b3106a65044a4978ad36fe75e9ca8ab0aae0092b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 15 Feb 2018 06:37:46 -0600 Subject: [PATCH 032/231] Make Operator a context manager. Smart handling of output_dir --- openmc/deplete/__init__.py | 2 +- openmc/deplete/{function.py => abc.py} | 32 ++++- openmc/deplete/integrator/cecm.py | 142 +++++++++----------- openmc/deplete/integrator/predictor.py | 94 ++++++------- openmc/deplete/openmc_wrapper.py | 13 +- tests/dummy_geometry.py | 5 +- tests/regression_tests/test_deplete_full.py | 3 +- tests/unit_tests/test_deplete_cecm.py | 2 +- tests/unit_tests/test_deplete_predictor.py | 2 +- 9 files changed, 144 insertions(+), 151 deletions(-) rename openmc/deplete/{function.py => abc.py} (78%) diff --git a/openmc/deplete/__init__.py b/openmc/deplete/__init__.py index 19d1d13201..2467b973a9 100644 --- a/openmc/deplete/__init__.py +++ b/openmc/deplete/__init__.py @@ -18,7 +18,7 @@ from .nuclide import * from .chain import * from .openmc_wrapper import * from .reaction_rates import * -from .function import * +from .abc import * from .results import * from .integrator import * from .utilities import * diff --git a/openmc/deplete/function.py b/openmc/deplete/abc.py similarity index 78% rename from openmc/deplete/function.py rename to openmc/deplete/abc.py index b9694d88b1..63a80b45c7 100644 --- a/openmc/deplete/function.py +++ b/openmc/deplete/abc.py @@ -4,6 +4,9 @@ This module contains the Operator class, which is then passed to an integrator to run a full depletion simulation. """ +import os +from pathlib import Path + from abc import ABCMeta, abstractmethod @@ -16,14 +19,22 @@ class Settings(object): ---------- dt_vec : numpy.array Array of time steps to take. - output_dir : str + output_dir : pathlib.Path Path to output directory to save results. - """ + """ def __init__(self): # Integrator specific self.dt_vec = None - self.output_dir = None + self.output_dir = Path('.') + + @property + def output_dir(self): + return self._output_dir + + @output_dir.setter + def output_dir(self, output_dir): + self._output_dir = Path(output_dir) class Operator(metaclass=ABCMeta): @@ -60,6 +71,20 @@ class Operator(metaclass=ABCMeta): """ pass + def __enter__(self): + # Save current directory and move to specific output directory + self._orig_dir = os.getcwd() + self.settings.output_dir.mkdir(exist_ok=True) + + # In Python 3.6+, chdir accepts a Path directly + os.chdir(str(self.settings.output_dir)) + + return self.initial_condition() + + def __exit__(self, exc_type, exc_value, traceback): + self.finalize() + os.chdir(self._orig_dir) + @abstractmethod def initial_condition(self): """Performs final setup and returns initial condition. @@ -112,6 +137,5 @@ class Operator(metaclass=ABCMeta): pass - @abstractmethod def finalize(self): pass diff --git a/openmc/deplete/integrator/cecm.py b/openmc/deplete/integrator/cecm.py index 5432f172d0..148b02b4ad 100644 --- a/openmc/deplete/integrator/cecm.py +++ b/openmc/deplete/integrator/cecm.py @@ -41,96 +41,82 @@ def cecm(operator, print_out=True): Whether or not to print out time. """ - # Save current directory - dir_home = os.getcwd() - - # Move to folder - os.makedirs(operator.settings.output_dir, exist_ok=True) - os.chdir(operator.settings.output_dir) - # Generate initial conditions - vec = operator.initial_condition() + with operator as vec: + n_mats = len(vec) - n_mats = len(vec) + t = 0.0 - t = 0.0 + for i, dt in enumerate(operator.settings.dt_vec): + # Create vectors + x = [copy.deepcopy(vec)] + seeds = [] + eigvls = [] + rates_array = [] - for i, dt in enumerate(operator.settings.dt_vec): - # Create vectors + eigvl, rates, seed = operator(x[0]) + + eigvls.append(eigvl) + seeds.append(seed) + rates_array.append(rates) + + t_start = time.time() + + chains = repeat(operator.chain, n_mats) + vecs = (x[0][i] for i in range(n_mats)) + rates = (rates_array[0][i, :, :] for i in range(n_mats)) + dts = repeat(dt/2, n_mats) + + with Pool() as pool: + iters = zip(chains, vecs, rates, dts) + x_result = list(pool.starmap(cram_wrapper, iters)) + + t_end = time.time() + if comm.rank == 0: + if print_out: + print("Time to matexp: ", t_end - t_start) + + x.append(x_result) + + eigvl, rates, seed = operator(x[1]) + + eigvls.append(eigvl) + seeds.append(seed) + rates_array.append(rates) + + t_start = time.time() + + chains = repeat(operator.chain, n_mats) + vecs = (x[0][i] for i in range(n_mats)) + rates = (rates_array[1][i, :, :] for i in range(n_mats)) + dts = repeat(dt, n_mats) + + with Pool() as pool: + iters = zip(chains, vecs, rates, dts) + x_result = list(pool.starmap(cram_wrapper, iters)) + + t_end = time.time() + if comm.rank == 0: + if print_out: + print("Time to matexp: ", t_end - t_start) + + # Create results, write to disk + save_results(operator, x, rates_array, eigvls, seeds, [t, t + dt], i) + + t += dt + vec = copy.deepcopy(x_result) + + # Perform one last simulation x = [copy.deepcopy(vec)] seeds = [] eigvls = [] rates_array = [] - eigvl, rates, seed = operator(x[0]) eigvls.append(eigvl) seeds.append(seed) rates_array.append(rates) - t_start = time.time() - - chains = repeat(operator.chain, n_mats) - vecs = (x[0][i] for i in range(n_mats)) - rates = (rates_array[0][i, :, :] for i in range(n_mats)) - dts = repeat(dt/2, n_mats) - - with Pool() as pool: - iters = zip(chains, vecs, rates, dts) - x_result = list(pool.starmap(cram_wrapper, iters)) - - t_end = time.time() - if comm.rank == 0: - if print_out: - print("Time to matexp: ", t_end - t_start) - - x.append(x_result) - - eigvl, rates, seed = operator(x[1]) - - eigvls.append(eigvl) - seeds.append(seed) - rates_array.append(rates) - - t_start = time.time() - - chains = repeat(operator.chain, n_mats) - vecs = (x[0][i] for i in range(n_mats)) - rates = (rates_array[1][i, :, :] for i in range(n_mats)) - dts = repeat(dt, n_mats) - - with Pool() as pool: - iters = zip(chains, vecs, rates, dts) - x_result = list(pool.starmap(cram_wrapper, iters)) - - t_end = time.time() - if comm.rank == 0: - if print_out: - print("Time to matexp: ", t_end - t_start) - # Create results, write to disk - save_results(operator, x, rates_array, eigvls, seeds, [t, t + dt], i) - - t += dt - vec = copy.deepcopy(x_result) - - # Perform one last simulation - x = [copy.deepcopy(vec)] - seeds = [] - eigvls = [] - rates_array = [] - eigvl, rates, seed = operator(x[0]) - - eigvls.append(eigvl) - seeds.append(seed) - rates_array.append(rates) - - # Create results, write to disk - save_results(operator, x, rates_array, eigvls, seeds, [t, t], - len(operator.settings.dt_vec)) - - # Return to origin - os.chdir(dir_home) - - # Release resources - operator.finalize() + save_results(operator, x, rates_array, eigvls, seeds, [t, t], + len(operator.settings.dt_vec)) diff --git a/openmc/deplete/integrator/predictor.py b/openmc/deplete/integrator/predictor.py index 1b8d00600c..8d499d1ff4 100644 --- a/openmc/deplete/integrator/predictor.py +++ b/openmc/deplete/integrator/predictor.py @@ -32,27 +32,52 @@ def predictor(operator, print_out=True): Whether or not to print out time. """ - # Save current directory - dir_home = os.getcwd() - - # Move to folder - os.makedirs(operator.settings.output_dir, exist_ok=True) - os.chdir(operator.settings.output_dir) - # Generate initial conditions - vec = operator.initial_condition() + with operator as vec: + n_mats = len(vec) - n_mats = len(vec) + t = 0.0 - t = 0.0 + for i, dt in enumerate(operator.settings.dt_vec): + # Create vectors + x = [copy.deepcopy(vec)] + seeds = [] + eigvls = [] + rates_array = [] - for i, dt in enumerate(operator.settings.dt_vec): - # Create vectors + eigvl, rates, seed = operator(x[0]) + + eigvls.append(eigvl) + seeds.append(seed) + rates_array.append(rates) + + # Create results, write to disk + save_results(operator, x, rates_array, eigvls, seeds, [t, t + dt], i) + + t_start = time.time() + + chains = repeat(operator.chain, n_mats) + vecs = (x[0][i] for i in range(n_mats)) + rates = (rates_array[0][i, :, :] for i in range(n_mats)) + dts = repeat(dt, n_mats) + + with Pool() as pool: + iters = zip(chains, vecs, rates, dts) + x_result = list(pool.starmap(cram_wrapper, iters)) + + t_end = time.time() + if comm.rank == 0: + if print_out: + print("Time to matexp: ", t_end - t_start) + + t += dt + vec = copy.deepcopy(x_result) + + # Perform one last simulation x = [copy.deepcopy(vec)] seeds = [] eigvls = [] rates_array = [] - eigvl, rates, seed = operator(x[0]) eigvls.append(eigvl) @@ -60,44 +85,5 @@ def predictor(operator, print_out=True): rates_array.append(rates) # Create results, write to disk - save_results(operator, x, rates_array, eigvls, seeds, [t, t + dt], i) - - t_start = time.time() - - chains = repeat(operator.chain, n_mats) - vecs = (x[0][i] for i in range(n_mats)) - rates = (rates_array[0][i, :, :] for i in range(n_mats)) - dts = repeat(dt, n_mats) - - with Pool() as pool: - iters = zip(chains, vecs, rates, dts) - x_result = list(pool.starmap(cram_wrapper, iters)) - - t_end = time.time() - if comm.rank == 0: - if print_out: - print("Time to matexp: ", t_end - t_start) - - t += dt - vec = copy.deepcopy(x_result) - - # Perform one last simulation - x = [copy.deepcopy(vec)] - seeds = [] - eigvls = [] - rates_array = [] - eigvl, rates, seed = operator(x[0]) - - eigvls.append(eigvl) - seeds.append(seed) - rates_array.append(rates) - - # Create results, write to disk - save_results(operator, x, rates_array, eigvls, seeds, [t, t], - len(operator.settings.dt_vec)) - - # Return to origin - os.chdir(dir_home) - - # Release resources - operator.finalize() + save_results(operator, x, rates_array, eigvls, seeds, [t, t], + len(operator.settings.dt_vec)) diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 3dce9db7b9..701a35b7d3 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -23,12 +23,10 @@ import openmc import openmc.capi from openmc.data import JOULE_PER_EV from . import comm +from .abc import Settings, Operator from .atom_number import AtomNumber from .chain import Chain from .reaction_rates import ReactionRates -from .function import Settings, Operator - - def _chunks(items, n): @@ -49,7 +47,7 @@ class OpenMCSettings(Settings): ---------- dt_vec : numpy.array Array of time steps to in units of [s] - output_dir : str + output_dir : pathlib.Path Path to output directory to save results. chain_file : str Path to the depletion chain xml file. Defaults to the @@ -70,7 +68,7 @@ class OpenMCSettings(Settings): """ - _depletion_attrs = {'dt_vec', 'output_dir', 'chain_file', 'dilute_initial', + _depletion_attrs = {'dt_vec', '_output_dir', 'chain_file', 'dilute_initial', 'round_number', 'power'} def __init__(self): @@ -87,7 +85,10 @@ class OpenMCSettings(Settings): self.__dict__['settings'] = openmc.Settings() def __setattr__(self, name, value): - if name in self._depletion_attrs: + if hasattr(self.__class__, name): + prop = getattr(self.__class__, name) + prop.fset(self, value) + elif name in self._depletion_attrs: self.__dict__[name] = value else: setattr(self.__dict__['settings'], name, value) diff --git a/tests/dummy_geometry.py b/tests/dummy_geometry.py index 585c1b11cd..aab396b85a 100644 --- a/tests/dummy_geometry.py +++ b/tests/dummy_geometry.py @@ -1,7 +1,7 @@ import numpy as np import scipy.sparse as sp from openmc.deplete.reaction_rates import ReactionRates -from openmc.deplete.function import Operator +from openmc.deplete.abc import Operator class DummyGeometry(Operator): @@ -53,9 +53,6 @@ class DummyGeometry(Operator): # Create a fake rates object return 0.0, reaction_rates, 0 - def finalize(self): - pass - @property def chain(self): return self diff --git a/tests/regression_tests/test_deplete_full.py b/tests/regression_tests/test_deplete_full.py index e775e7af86..c809ba0536 100644 --- a/tests/regression_tests/test_deplete_full.py +++ b/tests/regression_tests/test_deplete_full.py @@ -43,7 +43,6 @@ def test_full(run_in_tmpdir): 'chain_simple.xml') settings.power = 2.337e15*4*JOULE_PER_EV*1e6 # MeV/second cm from CASMO settings.dt_vec = dt - settings.output_dir = "test_full" settings.round_number = True # Add OpenMC-specific settings @@ -61,7 +60,7 @@ def test_full(run_in_tmpdir): openmc.deplete.integrator.predictor(op) # Load the files - res_test = results.read_results(settings.output_dir + "/depletion_results.h5") + res_test = results.read_results(settings.output_dir / "depletion_results.h5") # Load the reference filename = str(Path(__file__).with_name('test_reference.h5')) diff --git a/tests/unit_tests/test_deplete_cecm.py b/tests/unit_tests/test_deplete_cecm.py index 7fe8c6a043..66c3ee156c 100644 --- a/tests/unit_tests/test_deplete_cecm.py +++ b/tests/unit_tests/test_deplete_cecm.py @@ -24,7 +24,7 @@ def test_cecm(run_in_tmpdir): openmc.deplete.cecm(op, print_out=False) # Load the files - res = results.read_results(settings.output_dir + "/depletion_results.h5") + res = results.read_results(settings.output_dir / "depletion_results.h5") _, y1 = utilities.evaluate_single_nuclide(res, "1", "1") _, y2 = utilities.evaluate_single_nuclide(res, "1", "2") diff --git a/tests/unit_tests/test_deplete_predictor.py b/tests/unit_tests/test_deplete_predictor.py index 8ec8964bbd..f1133f87d2 100644 --- a/tests/unit_tests/test_deplete_predictor.py +++ b/tests/unit_tests/test_deplete_predictor.py @@ -24,7 +24,7 @@ def test_predictor(run_in_tmpdir): openmc.deplete.predictor(op, print_out=False) # Load the files - res = results.read_results(settings.output_dir + "/depletion_results.h5") + res = results.read_results(settings.output_dir / "depletion_results.h5") _, y1 = utilities.evaluate_single_nuclide(res, "1", "1") _, y2 = utilities.evaluate_single_nuclide(res, "1", "2") From 484a0238888315242c5327d9a4ef7163ba806e64 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 15 Feb 2018 07:03:01 -0600 Subject: [PATCH 033/231] Move more attributes to abc.Settings --- openmc/deplete/abc.py | 20 ++++++++++++++++++-- openmc/deplete/openmc_wrapper.py | 15 ++++++--------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index 63a80b45c7..e2b286d6a4 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -21,12 +21,28 @@ class Settings(object): Array of time steps to take. output_dir : pathlib.Path Path to output directory to save results. + chain_file : str + Path to the depletion chain xml file. Defaults to the + :envvar:`OPENDEPLETE_CHAIN` environment variable if it exists. + dilute_initial : float + Initial atom density to add for nuclides that are zero in initial + condition to ensure they exist in the decay chain. Only done for + nuclides with reaction rates. Defaults to 1.0e3. + power : float + Power of the reactor in [W]. For a 2D problem, the power can be given in + W/cm as long as the "volume" assigned to a depletion material is + actually an area in cm^2. """ def __init__(self): - # Integrator specific + try: + self.chain_file = os.environ["OPENDEPLETE_CHAIN"] + except KeyError: + self.chain_file = None self.dt_vec = None - self.output_dir = Path('.') + self.output_dir = '.' + self.power = None + self.dilute_initial = 1.0e3 @property def output_dir(self): diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 701a35b7d3..b5b91f2ac4 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -56,13 +56,13 @@ class OpenMCSettings(Settings): Initial atom density to add for nuclides that are zero in initial condition to ensure they exist in the decay chain. Only done for nuclides with reaction rates. Defaults to 1.0e3. - round_number : bool - Whether or not to round output to OpenMC to 8 digits. - Useful in testing, as OpenMC is incredibly sensitive to exact values. power : float Power of the reactor in [W]. For a 2D problem, the power can be given in W/cm as long as the "volume" assigned to a depletion material is actually an area in cm^2. + round_number : bool + Whether or not to round output to OpenMC to 8 digits. + Useful in testing, as OpenMC is incredibly sensitive to exact values. settings : openmc.Settings Settings for OpenMC simulations @@ -73,24 +73,21 @@ class OpenMCSettings(Settings): def __init__(self): super().__init__() - try: - self.chain_file = os.environ["OPENDEPLETE_CHAIN"] - except KeyError: - self.chain_file = None - self.dilute_initial = 1.0e3 self.round_number = False - self.power = None # Avoid setattr to create OpenMC settings self.__dict__['settings'] = openmc.Settings() def __setattr__(self, name, value): if hasattr(self.__class__, name): + # Use properties when appropriate prop = getattr(self.__class__, name) prop.fset(self, value) elif name in self._depletion_attrs: + # For known attributes, store in dictionary self.__dict__[name] = value else: + # otherwise, delegate to openmc.Settings setattr(self.__dict__['settings'], name, value) def __getattr__(self, name): From 998a562a33b214fa41f62166ebd78c83eb77aed8 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 15 Feb 2018 09:47:37 -0600 Subject: [PATCH 034/231] Have Operator() return a namedtuple (simplifies integrators quite a bit) --- openmc/deplete/abc.py | 4 ++ openmc/deplete/integrator/cecm.py | 58 ++++++--------------- openmc/deplete/integrator/predictor.py | 42 +++++---------- openmc/deplete/integrator/save_results.py | 20 +++---- openmc/deplete/openmc_wrapper.py | 4 +- tests/dummy_geometry.py | 4 +- tests/unit_tests/test_deplete_integrator.py | 15 ++++-- 7 files changed, 55 insertions(+), 92 deletions(-) diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index e2b286d6a4..155261742c 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -4,6 +4,7 @@ This module contains the Operator class, which is then passed to an integrator to run a full depletion simulation. """ +from collections import namedtuple import os from pathlib import Path @@ -53,6 +54,9 @@ class Settings(object): self._output_dir = Path(output_dir) +OperatorResult = namedtuple('OperatorResult', ['k', 'rates', 'seed']) + + class Operator(metaclass=ABCMeta): """Abstract class defining all methods needed for the integrator. diff --git a/openmc/deplete/integrator/cecm.py b/openmc/deplete/integrator/cecm.py index 148b02b4ad..16fa299fd3 100644 --- a/openmc/deplete/integrator/cecm.py +++ b/openmc/deplete/integrator/cecm.py @@ -12,7 +12,7 @@ from .save_results import save_results def cecm(operator, print_out=True): - """The CE/CM integrator. + r"""The CE/CM integrator. Implements the second order CE/CM Predictor-Corrector algorithm [ref]_. This algorithm is mathematically defined as: @@ -22,11 +22,11 @@ def cecm(operator, print_out=True): A_p &= A(y_n, t_n) - y_m &= \\text{expm}(A_p h/2) y_n + y_m &= \text{expm}(A_p h/2) y_n A_c &= A(y_m, t_n + h/2) - y_{n+1} &= \\text{expm}(A_c h) y_n + y_{n+1} &= \text{expm}(A_c h) y_n .. [ref] Isotalo, Aarno. "Comparison of Neutronics-Depletion Coupling Schemes @@ -35,88 +35,64 @@ def cecm(operator, print_out=True): Parameters ---------- - operator : Operator + operator : openmc.deplete.Operator The operator object to simulate on. print_out : bool, optional Whether or not to print out time. - """ + """ # Generate initial conditions with operator as vec: n_mats = len(vec) t = 0.0 - for i, dt in enumerate(operator.settings.dt_vec): - # Create vectors + # Get beginning-of-timestep reaction rates x = [copy.deepcopy(vec)] - seeds = [] - eigvls = [] - rates_array = [] - - eigvl, rates, seed = operator(x[0]) - - eigvls.append(eigvl) - seeds.append(seed) - rates_array.append(rates) + results = [operator(x[0])] + # Deplete for first half of timestep t_start = time.time() - chains = repeat(operator.chain, n_mats) vecs = (x[0][i] for i in range(n_mats)) - rates = (rates_array[0][i, :, :] for i in range(n_mats)) + rates = (results[0].rates[i, :, :] for i in range(n_mats)) dts = repeat(dt/2, n_mats) - with Pool() as pool: iters = zip(chains, vecs, rates, dts) x_result = list(pool.starmap(cram_wrapper, iters)) - t_end = time.time() if comm.rank == 0: if print_out: print("Time to matexp: ", t_end - t_start) + # Get middle-of-timestep reaction rates x.append(x_result) + results.append(operator(x_result)) - eigvl, rates, seed = operator(x[1]) - - eigvls.append(eigvl) - seeds.append(seed) - rates_array.append(rates) - + # Deplete for second half of timestep t_start = time.time() - chains = repeat(operator.chain, n_mats) vecs = (x[0][i] for i in range(n_mats)) - rates = (rates_array[1][i, :, :] for i in range(n_mats)) + rates = (results[1].rates[i, :, :] for i in range(n_mats)) dts = repeat(dt, n_mats) - with Pool() as pool: iters = zip(chains, vecs, rates, dts) x_result = list(pool.starmap(cram_wrapper, iters)) - t_end = time.time() if comm.rank == 0: if print_out: print("Time to matexp: ", t_end - t_start) # Create results, write to disk - save_results(operator, x, rates_array, eigvls, seeds, [t, t + dt], i) + save_results(operator, x, results, [t, t + dt], i) + # Advance time, update vector t += dt vec = copy.deepcopy(x_result) # Perform one last simulation x = [copy.deepcopy(vec)] - seeds = [] - eigvls = [] - rates_array = [] - eigvl, rates, seed = operator(x[0]) - - eigvls.append(eigvl) - seeds.append(seed) - rates_array.append(rates) + results = [operator(x[0])] # Create results, write to disk - save_results(operator, x, rates_array, eigvls, seeds, [t, t], - len(operator.settings.dt_vec)) + save_results(operator, x, results, [t, t], len(operator.settings.dt_vec)) diff --git a/openmc/deplete/integrator/predictor.py b/openmc/deplete/integrator/predictor.py index 8d499d1ff4..872b5ebb19 100644 --- a/openmc/deplete/integrator/predictor.py +++ b/openmc/deplete/integrator/predictor.py @@ -12,7 +12,7 @@ from .save_results import save_results def predictor(operator, print_out=True): - """The basic predictor integrator. + r"""The basic predictor integrator. Implements the first order predictor algorithm. This algorithm is mathematically defined as: @@ -22,68 +22,50 @@ def predictor(operator, print_out=True): A_p &= A(y_n, t_n) - y_{n+1} &= \\text{expm}(A_p h) y_n + y_{n+1} &= \text{expm}(A_p h) y_n Parameters ---------- - operator : Operator + operator : openmc.deplete.Operator The operator object to simulate on. print_out : bool, optional Whether or not to print out time. - """ + """ # Generate initial conditions with operator as vec: n_mats = len(vec) t = 0.0 - for i, dt in enumerate(operator.settings.dt_vec): - # Create vectors + # Get beginning-of-timestep reaction rates x = [copy.deepcopy(vec)] - seeds = [] - eigvls = [] - rates_array = [] - - eigvl, rates, seed = operator(x[0]) - - eigvls.append(eigvl) - seeds.append(seed) - rates_array.append(rates) + results = [operator(x[0])] # Create results, write to disk - save_results(operator, x, rates_array, eigvls, seeds, [t, t + dt], i) + save_results(operator, x, results, [t, t + dt], i) + # Deplete for full timestep t_start = time.time() - chains = repeat(operator.chain, n_mats) vecs = (x[0][i] for i in range(n_mats)) - rates = (rates_array[0][i, :, :] for i in range(n_mats)) + rates = (results[0].rates[i, :, :] for i in range(n_mats)) dts = repeat(dt, n_mats) - with Pool() as pool: iters = zip(chains, vecs, rates, dts) x_result = list(pool.starmap(cram_wrapper, iters)) - t_end = time.time() if comm.rank == 0: if print_out: print("Time to matexp: ", t_end - t_start) + # Advance time, update vector t += dt vec = copy.deepcopy(x_result) # Perform one last simulation x = [copy.deepcopy(vec)] - seeds = [] - eigvls = [] - rates_array = [] - eigvl, rates, seed = operator(x[0]) - - eigvls.append(eigvl) - seeds.append(seed) - rates_array.append(rates) + results = [operator(x[0])] # Create results, write to disk - save_results(operator, x, rates_array, eigvls, seeds, [t, t], - len(operator.settings.dt_vec)) + save_results(operator, x, results, [t, t], len(operator.settings.dt_vec)) diff --git a/openmc/deplete/integrator/save_results.py b/openmc/deplete/integrator/save_results.py index f580af838c..31cd9b2880 100644 --- a/openmc/deplete/integrator/save_results.py +++ b/openmc/deplete/integrator/save_results.py @@ -4,8 +4,8 @@ from ..results import Results, write_results -def save_results(op, x, rates, eigvls, seeds, t, step_ind): - """ Creates and writes results to disk +def save_results(op, x, op_results, t, step_ind): + """Creates and writes depletion results to disk Parameters ---------- @@ -13,18 +13,14 @@ def save_results(op, x, rates, eigvls, seeds, t, step_ind): The operator used to generate these results. x : list of list of numpy.array The prior x vectors. Indexed [i][cell] using the above equation. - rates : list of ReactionRates - The reaction rates for each substep. - eigvls : list of float - Eigenvalue for each substep - seeds : list of int - Seeds for each substep. + op_results : list of openmc.deplete.OperatorResult + Results of applying transport operator t : list of float Time indices. step_ind : int Step index. - """ + """ # Get indexing terms vol_list, nuc_list, burn_list, full_burn_list = op.get_results_info() @@ -39,9 +35,9 @@ def save_results(op, x, rates, eigvls, seeds, t, step_ind): for mat_i in range(n_mat): results[i, mat_i, :] = x[i][mat_i][:] - results.k = eigvls - results.seeds = seeds + results.k = [r.k for r in op_results] + results.seeds = [r.seed for r in op_results] + results.rates = [r.rates for r in op_results] results.time = t - results.rates = rates write_results(results, "depletion_results.h5", step_ind) diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index b5b91f2ac4..da397c0149 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -23,7 +23,7 @@ import openmc import openmc.capi from openmc.data import JOULE_PER_EV from . import comm -from .abc import Settings, Operator +from .abc import Settings, Operator, OperatorResult from .atom_number import AtomNumber from .chain import Chain from .reaction_rates import ReactionRates @@ -255,7 +255,7 @@ class OpenMCOperator(Operator): print("Time to openmc: ", time_openmc - time_start) print("Time to unpack: ", time_unpack - time_openmc) - return k, copy.deepcopy(self.reaction_rates), self.seed + return OperatorResult(k, copy.deepcopy(self.reaction_rates), self.seed) def extract_mat_ids(self): """Extracts materials and assigns them to processes. diff --git a/tests/dummy_geometry.py b/tests/dummy_geometry.py index aab396b85a..ceafc3fdc2 100644 --- a/tests/dummy_geometry.py +++ b/tests/dummy_geometry.py @@ -1,7 +1,7 @@ import numpy as np import scipy.sparse as sp from openmc.deplete.reaction_rates import ReactionRates -from openmc.deplete.abc import Operator +from openmc.deplete.abc import Operator, OperatorResult class DummyGeometry(Operator): @@ -51,7 +51,7 @@ class DummyGeometry(Operator): reaction_rates[0, 1, 0] = vec[0][1] # Create a fake rates object - return 0.0, reaction_rates, 0 + return OperatorResult(0.0, reaction_rates, 0) @property def chain(self): diff --git a/tests/unit_tests/test_deplete_integrator.py b/tests/unit_tests/test_deplete_integrator.py index 964f99eee3..faccd3392f 100644 --- a/tests/unit_tests/test_deplete_integrator.py +++ b/tests/unit_tests/test_deplete_integrator.py @@ -11,7 +11,8 @@ import os from unittest.mock import MagicMock import numpy as np -from openmc.deplete import integrator, ReactionRates, results, comm +from openmc.deplete import (integrator, ReactionRates, results, comm, + OperatorResult) def test_save_results(run_in_tmpdir): @@ -49,8 +50,8 @@ def test_save_results(run_in_tmpdir): x2.append([np.random.rand(2), np.random.rand(2)]) # Construct r - cell_dict = {s:i for i, s in enumerate(burn_list)} - r1 = ReactionRates(cell_dict, {"na":0, "nb":1}, {"ra":0, "rb":1}) + cell_dict = {s: i for i, s in enumerate(burn_list)} + r1 = ReactionRates(cell_dict, {"na": 0, "nb": 1}, {"ra": 0, "rb": 1}) r1.rates = np.random.rand(2, 2, 2) rate1 = [] @@ -76,8 +77,12 @@ def test_save_results(run_in_tmpdir): t1 = [0.0, 1.0] t2 = [1.0, 2.0] - integrator.save_results(op, x1, rate1, eigvl1, seed1, t1, 0) - integrator.save_results(op, x2, rate2, eigvl2, seed2, t2, 1) + op_result1 = [OperatorResult(k, rates, seed) + for k, rates, seed in zip(eigvl1, rate1, seed1)] + op_result2 = [OperatorResult(k, rates, seed) + for k, rates, seed in zip(eigvl2, rate2, seed2)] + integrator.save_results(op, x1, op_result1, t1, 0) + integrator.save_results(op, x2, op_result2, t2, 1) # Load the files res = results.read_results("depletion_results.h5") From b62e25bcf5f84e5178990519a5e6c2ec433cb7bd Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 15 Feb 2018 10:39:16 -0600 Subject: [PATCH 035/231] Simplify integrator implementations by separating out function for depletion --- openmc/deplete/integrator/cecm.py | 46 +++++------------------- openmc/deplete/integrator/cram.py | 50 ++++++++++++++++++++++++++ openmc/deplete/integrator/predictor.py | 29 ++++----------- 3 files changed, 65 insertions(+), 60 deletions(-) diff --git a/openmc/deplete/integrator/cecm.py b/openmc/deplete/integrator/cecm.py index 16fa299fd3..760e3c89d8 100644 --- a/openmc/deplete/integrator/cecm.py +++ b/openmc/deplete/integrator/cecm.py @@ -1,13 +1,8 @@ -""" The CE/CM integrator.""" +"""The CE/CM integrator.""" import copy -from itertools import repeat -import os -from multiprocessing import Pool -import time -from .. import comm -from .cram import CRAM48, cram_wrapper +from .cram import deplete from .save_results import save_results @@ -43,8 +38,7 @@ def cecm(operator, print_out=True): """ # Generate initial conditions with operator as vec: - n_mats = len(vec) - + chain = operator.chain t = 0.0 for i, dt in enumerate(operator.settings.dt_vec): # Get beginning-of-timestep reaction rates @@ -52,43 +46,21 @@ def cecm(operator, print_out=True): results = [operator(x[0])] # Deplete for first half of timestep - t_start = time.time() - chains = repeat(operator.chain, n_mats) - vecs = (x[0][i] for i in range(n_mats)) - rates = (results[0].rates[i, :, :] for i in range(n_mats)) - dts = repeat(dt/2, n_mats) - with Pool() as pool: - iters = zip(chains, vecs, rates, dts) - x_result = list(pool.starmap(cram_wrapper, iters)) - t_end = time.time() - if comm.rank == 0: - if print_out: - print("Time to matexp: ", t_end - t_start) + x_middle = deplete(chain, x[0], results[0], dt/2, print_out) # Get middle-of-timestep reaction rates - x.append(x_result) - results.append(operator(x_result)) + x.append(x_middle) + results.append(operator(x_middle)) - # Deplete for second half of timestep - t_start = time.time() - chains = repeat(operator.chain, n_mats) - vecs = (x[0][i] for i in range(n_mats)) - rates = (results[1].rates[i, :, :] for i in range(n_mats)) - dts = repeat(dt, n_mats) - with Pool() as pool: - iters = zip(chains, vecs, rates, dts) - x_result = list(pool.starmap(cram_wrapper, iters)) - t_end = time.time() - if comm.rank == 0: - if print_out: - print("Time to matexp: ", t_end - t_start) + # Deplete for full timestep using beginning-of-step materials + x_end = deplete(chain, x[0], results[1], dt, print_out) # Create results, write to disk save_results(operator, x, results, [t, t + dt], i) # Advance time, update vector t += dt - vec = copy.deepcopy(x_result) + vec = copy.deepcopy(x_end) # Perform one last simulation x = [copy.deepcopy(vec)] diff --git a/openmc/deplete/integrator/cram.py b/openmc/deplete/integrator/cram.py index 56476384c6..09207fbc6b 100644 --- a/openmc/deplete/integrator/cram.py +++ b/openmc/deplete/integrator/cram.py @@ -3,10 +3,60 @@ Implements two different forms of CRAM for use in openmc.deplete. """ +from itertools import repeat +from multiprocessing import Pool +import time + import numpy as np import scipy.sparse as sp import scipy.sparse.linalg as sla +from .. import comm + + +def deplete(chain, x, op_result, dt, print_out): + """Deplete materials using given reaction rates for a specified time + + Parameters + ---------- + chain : openmc.deplete.Chain + Depletion chain + x : list of numpy.ndarray + Atom number vectors for each material + op_result : openmc.deplete.OperatorResult + Result of applying transport operator (contains reaction rates) + dt : float + Time in [s] to deplete for + print_out : bool + Whether to show elapsed time + + Returns + ------- + x_result : list of numpy.ndarray + Updated atom number vectors for each material + + """ + t_start = time.time() + + # Set up iterators + n_mats = len(x) + chains = repeat(chain, n_mats) + vecs = (x[i] for i in range(n_mats)) + rates = (op_result.rates[i, :, :] for i in range(n_mats)) + dts = repeat(dt, n_mats) + + # Use multiprocessing pool to distribute work + with Pool() as pool: + iters = zip(chains, vecs, rates, dts) + x_result = list(pool.starmap(cram_wrapper, iters)) + + t_end = time.time() + if comm.rank == 0: + if print_out: + print("Time to matexp: ", t_end - t_start) + + return x_result + def cram_wrapper(chain, n0, rates, dt): """Wraps depletion matrix creation / CRAM solve for multiprocess execution diff --git a/openmc/deplete/integrator/predictor.py b/openmc/deplete/integrator/predictor.py index 872b5ebb19..0640783318 100644 --- a/openmc/deplete/integrator/predictor.py +++ b/openmc/deplete/integrator/predictor.py @@ -1,20 +1,15 @@ -""" The Predictor algorithm.""" +"""The Predictor algorithm.""" import copy -from itertools import repeat -import os -from multiprocessing import Pool -import time -from .. import comm -from .cram import CRAM48, cram_wrapper +from .cram import deplete from .save_results import save_results def predictor(operator, print_out=True): r"""The basic predictor integrator. - Implements the first order predictor algorithm. This algorithm is + Implements the first-order predictor algorithm. This algorithm is mathematically defined as: .. math:: @@ -34,8 +29,7 @@ def predictor(operator, print_out=True): """ # Generate initial conditions with operator as vec: - n_mats = len(vec) - + chain = operator.chain t = 0.0 for i, dt in enumerate(operator.settings.dt_vec): # Get beginning-of-timestep reaction rates @@ -46,22 +40,11 @@ def predictor(operator, print_out=True): save_results(operator, x, results, [t, t + dt], i) # Deplete for full timestep - t_start = time.time() - chains = repeat(operator.chain, n_mats) - vecs = (x[0][i] for i in range(n_mats)) - rates = (results[0].rates[i, :, :] for i in range(n_mats)) - dts = repeat(dt, n_mats) - with Pool() as pool: - iters = zip(chains, vecs, rates, dts) - x_result = list(pool.starmap(cram_wrapper, iters)) - t_end = time.time() - if comm.rank == 0: - if print_out: - print("Time to matexp: ", t_end - t_start) + x_end = deplete(chain, x[0], results[0], dt, print_out) # Advance time, update vector t += dt - vec = copy.deepcopy(x_result) + vec = copy.deepcopy(x_end) # Perform one last simulation x = [copy.deepcopy(vec)] From bc4d631883032791249d8e63824a0fbe159d7af9 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 15 Feb 2018 11:02:48 -0600 Subject: [PATCH 036/231] Get rid of deplete.Materials class that wasn't used --- openmc/deplete/openmc_wrapper.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index da397c0149..4668249b1f 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -97,25 +97,6 @@ class OpenMCSettings(Settings): return getattr(self.__dict__['settings'], name) -class Materials(object): - """The Materials class. - - Contains information about cross sections for a cell. - - Attributes - ---------- - temperature : float - Temperature in Kelvin for each region. - sab : str or list of str - ENDF S(a,b) name for a region that needs S(a,b) data. Not set if no - S(a,b) needed for region. - """ - - def __init__(self): - self.temperature = None - self.sab = None - - class OpenMCOperator(Operator): """The OpenMC Operator class. @@ -134,8 +115,6 @@ class OpenMCOperator(Operator): Settings object. (From Operator) geometry : openmc.Geometry The OpenMC geometry object. - materials : list of Materials - Materials to be used for this simulation. seed : int The RNG seed used in last OpenMC run. number : openmc.deplete.AtomNumber From 8a41bac17abdb16868dcbb6a4666e80a3f9b493c Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 15 Feb 2018 14:31:03 -0600 Subject: [PATCH 037/231] Removing a few attributes on OpenMCOperator --- openmc/deplete/abc.py | 2 +- openmc/deplete/integrator/save_results.py | 1 - openmc/deplete/openmc_wrapper.py | 27 +++------------------ openmc/deplete/results.py | 15 +----------- tests/dummy_geometry.py | 2 +- tests/unit_tests/test_deplete_integrator.py | 12 ++------- 6 files changed, 9 insertions(+), 50 deletions(-) diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index 155261742c..23322d91ca 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -54,7 +54,7 @@ class Settings(object): self._output_dir = Path(output_dir) -OperatorResult = namedtuple('OperatorResult', ['k', 'rates', 'seed']) +OperatorResult = namedtuple('OperatorResult', ['k', 'rates']) class Operator(metaclass=ABCMeta): diff --git a/openmc/deplete/integrator/save_results.py b/openmc/deplete/integrator/save_results.py index 31cd9b2880..8a0ae92040 100644 --- a/openmc/deplete/integrator/save_results.py +++ b/openmc/deplete/integrator/save_results.py @@ -36,7 +36,6 @@ def save_results(op, x, op_results, t, step_ind): results[i, mat_i, :] = x[i][mat_i][:] results.k = [r.k for r in op_results] - results.seeds = [r.seed for r in op_results] results.rates = [r.rates for r in op_results] results.time = t diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 4668249b1f..d9a5d405ad 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -115,8 +115,6 @@ class OpenMCOperator(Operator): Settings object. (From Operator) geometry : openmc.Geometry The OpenMC geometry object. - seed : int - The RNG seed used in last OpenMC run. number : openmc.deplete.AtomNumber Total number of atoms in simulation. participating_nuclides : set of str @@ -125,10 +123,6 @@ class OpenMCOperator(Operator): The depletion chain information necessary to form matrices and tallies. reaction_rates : openmc.deplete.ReactionRates Reaction rates from the last operator step. - power : OrderedDict of str to float - Material-by-Material power. Indexed by material ID. - mat_name : OrderedDict of str to int - The name of region each material is set to. Indexed by material ID. burn_mat_to_id : OrderedDict of str to int Dictionary mapping material ID (as a string) to an index in reaction_rates. burn_nuc_to_id : OrderedDict of str to int @@ -144,12 +138,9 @@ class OpenMCOperator(Operator): super().__init__(settings) self.geometry = geometry - self.seed = 0 self.number = None self.participating_nuclides = None self.reaction_rates = None - self.power = None - self.mat_name = OrderedDict() self.burn_mat_to_ind = OrderedDict() self.burn_nuc_to_ind = None @@ -196,16 +187,10 @@ class OpenMCOperator(Operator): Returns ------- - mat : list of scipy.sparse.csr_matrix - Matrices for the next step. - k : float - Eigenvalue of the problem. - rates : openmc.deplete.ReactionRates - Reaction rates from this simulation. - seed : int - Seed for this simulation. - """ + openmc.deplete.OperatorResult + Eigenvalue and reaction rates resulting from transport operator + """ # Prevent OpenMC from complaining about re-creating tallies openmc.reset_auto_ids() @@ -234,7 +219,7 @@ class OpenMCOperator(Operator): print("Time to openmc: ", time_openmc - time_start) print("Time to unpack: ", time_unpack - time_openmc) - return OperatorResult(k, copy.deepcopy(self.reaction_rates), self.seed) + return OperatorResult(k, copy.deepcopy(self.reaction_rates)) def extract_mat_ids(self): """Extracts materials and assigns them to processes. @@ -262,8 +247,6 @@ class OpenMCOperator(Operator): # Iterate once through the geometry to get dictionaries cells = self.geometry.get_all_material_cells() for cell in cells.values(): - name = cell.name - if isinstance(cell.fill, openmc.Material): mat = cell.fill for nuclide in mat.get_nuclide_densities(): @@ -273,7 +256,6 @@ class OpenMCOperator(Operator): volume[str(mat.id)] = mat.volume else: mat_not_burn.add(str(mat.id)) - self.mat_name[mat.id] = name else: for mat in cell.fill: for nuclide in mat.get_nuclide_densities(): @@ -283,7 +265,6 @@ class OpenMCOperator(Operator): volume[str(mat.id)] = mat.volume else: mat_not_burn.add(str(mat.id)) - self.mat_name[mat.id] = name need_vol = [] diff --git a/openmc/deplete/results.py b/openmc/deplete/results.py index fd48bb4df1..37c4b6e921 100644 --- a/openmc/deplete/results.py +++ b/openmc/deplete/results.py @@ -22,8 +22,6 @@ class Results(object): ---------- k : list of float Eigenvalue for each substep. - seeds : list of int - Seeds for each substep. time : list of float Time at beginning, end of step, in seconds. n_mat : int @@ -46,11 +44,10 @@ class Results(object): Number of stages in simulation. data : numpy.array Atom quantity, stored by stage, mat, then by nuclide. - """ + """ def __init__(self): self.k = None - self.seeds = None self.time = None self.rates = None self.volume = None @@ -227,8 +224,6 @@ class Results(object): handle.create_dataset("eigenvalues", (1, n_stages), maxshape=(None, n_stages), dtype='float64') - handle.create_dataset("seeds", (1, n_stages), maxshape=(None, n_stages), dtype='int64') - handle.create_dataset("time", (1, 2), maxshape=(None, 2), dtype='float64') def to_hdf5(self, handle, index): @@ -252,7 +247,6 @@ class Results(object): number_dset = handle["/number"] rxn_dset = handle["/reaction rates"] eigenvalues_dset = handle["/eigenvalues"] - seeds_dset = handle["/seeds"] time_dset = handle["/time"] # Get number of results stored @@ -274,10 +268,6 @@ class Results(object): eigenvalues_shape[0] = new_shape eigenvalues_dset.resize(eigenvalues_shape) - seeds_shape = list(seeds_dset.shape) - seeds_shape[0] = new_shape - seeds_dset.resize(seeds_shape) - time_shape = list(time_dset.shape) time_shape[0] = new_shape time_dset.resize(time_shape) @@ -297,7 +287,6 @@ class Results(object): rxn_dset[index, i, low:high+1, :, :] = self.rates[i][:, :, :] if comm.rank == 0: eigenvalues_dset[index, i] = self.k[i] - seeds_dset[index, i] = self.seeds[i] if comm.rank == 0: time_dset[index, :] = self.time @@ -317,12 +306,10 @@ class Results(object): # Grab handles number_dset = handle["/number"] eigenvalues_dset = handle["/eigenvalues"] - seeds_dset = handle["/seeds"] time_dset = handle["/time"] results.data = number_dset[index, :, :, :] results.k = eigenvalues_dset[index, :] - results.seeds = seeds_dset[index, :] results.time = time_dset[index, :] # Reconstruct dictionaries diff --git a/tests/dummy_geometry.py b/tests/dummy_geometry.py index ceafc3fdc2..c013bb0054 100644 --- a/tests/dummy_geometry.py +++ b/tests/dummy_geometry.py @@ -51,7 +51,7 @@ class DummyGeometry(Operator): reaction_rates[0, 1, 0] = vec[0][1] # Create a fake rates object - return OperatorResult(0.0, reaction_rates, 0) + return OperatorResult(0.0, reaction_rates) @property def chain(self): diff --git a/tests/unit_tests/test_deplete_integrator.py b/tests/unit_tests/test_deplete_integrator.py index faccd3392f..59d08b4842 100644 --- a/tests/unit_tests/test_deplete_integrator.py +++ b/tests/unit_tests/test_deplete_integrator.py @@ -66,21 +66,15 @@ def test_save_results(run_in_tmpdir): # Create global terms eigvl1 = np.random.rand(stages) eigvl2 = np.random.rand(stages) - seed1 = [np.random.randint(100) for i in range(stages)] - seed2 = [np.random.randint(100) for i in range(stages)] eigvl1 = comm.bcast(eigvl1, root=0) eigvl2 = comm.bcast(eigvl2, root=0) - seed1 = comm.bcast(seed1, root=0) - seed2 = comm.bcast(seed2, root=0) t1 = [0.0, 1.0] t2 = [1.0, 2.0] - op_result1 = [OperatorResult(k, rates, seed) - for k, rates, seed in zip(eigvl1, rate1, seed1)] - op_result2 = [OperatorResult(k, rates, seed) - for k, rates, seed in zip(eigvl2, rate2, seed2)] + op_result1 = [OperatorResult(k, rates) for k, rates in zip(eigvl1, rate1)] + op_result2 = [OperatorResult(k, rates) for k, rates in zip(eigvl2, rate2)] integrator.save_results(op, x1, op_result1, t1, 0) integrator.save_results(op, x2, op_result2, t2, 1) @@ -98,9 +92,7 @@ def test_save_results(run_in_tmpdir): rate2[i][mat, nuc, :]) np.testing.assert_array_equal(res[0].k, eigvl1) - np.testing.assert_array_equal(res[0].seeds, seed1) np.testing.assert_array_equal(res[0].time, t1) np.testing.assert_array_equal(res[1].k, eigvl2) - np.testing.assert_array_equal(res[1].seeds, seed2) np.testing.assert_array_equal(res[1].time, t2) From 3bbd1774537bd2cfd5c0d775caefd7cfdd0f290f Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 15 Feb 2018 14:53:11 -0600 Subject: [PATCH 038/231] Have unpack_tallies_and_normalize return an OperatorResult --- openmc/deplete/abc.py | 11 ++++------- openmc/deplete/openmc_wrapper.py | 28 +++++++++++----------------- openmc/deplete/reaction_rates.py | 2 +- 3 files changed, 16 insertions(+), 25 deletions(-) diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index 23322d91ca..b2594d2c84 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -58,7 +58,7 @@ OperatorResult = namedtuple('OperatorResult', ['k', 'rates']) class Operator(metaclass=ABCMeta): - """Abstract class defining all methods needed for the integrator. + """Abstract class defining a transport operator Attributes ---------- @@ -82,12 +82,9 @@ class Operator(metaclass=ABCMeta): Returns ------- - k : float - Eigenvalue of the problem. - rates : ReactionRates - Reaction rates from this simulation. - seed : int - Seed for this simulation. + openmc.deplete.OperatorResult + Eigenvalue and reaction rates resulting from transport operator + """ pass diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index d9a5d405ad..65ed4793dd 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -98,9 +98,7 @@ class OpenMCSettings(Settings): class OpenMCOperator(Operator): - """The OpenMC Operator class. - - Provides Operator functions for OpenMC. + """OpenMC transport operator Parameters ---------- @@ -210,7 +208,7 @@ class OpenMCOperator(Operator): time_openmc = time.time() # Extract results - k = self.unpack_tallies_and_normalize() + op_result = self.unpack_tallies_and_normalize() if comm.rank == 0: time_unpack = time.time() @@ -219,7 +217,7 @@ class OpenMCOperator(Operator): print("Time to openmc: ", time_openmc - time_start) print("Time to unpack: ", time_unpack - time_openmc) - return OperatorResult(k, copy.deepcopy(self.reaction_rates)) + return copy.deepcopy(op_result) def extract_mat_ids(self): """Extracts materials and assigns them to processes. @@ -561,23 +559,19 @@ class OpenMCOperator(Operator): self.number.set_mat_slice(i, total_density[i]) def unpack_tallies_and_normalize(self): - """Unpack tallies from OpenMC + """Unpack tallies from OpenMC and return an operator result - This function reads the tallies generated by OpenMC (from the tally.xml - file generated in generate_tally_xml) normalizes them so that the total - power generated is new_power, and then stores them in the reaction rate - database. + This method uses OpenMC's C API bindings to determine the k-effective + value and reaction rates from the simulation. The reaction rates are + normalized by the user-specified power, summing the product of the + fission reaction rate times the fission Q value for each material. Returns ------- - k : float - Eigenvalue of the last simulation. + openmc.deplete.OperatorResult + Eigenvalue and reaction rates resulting from transport operator - Todo - ---- - Provide units for power """ - rates = self.reaction_rates rates[:, :, :] = 0.0 @@ -655,7 +649,7 @@ class OpenMCOperator(Operator): # Scale reaction rates to obtain units of reactions/sec rates[:, :, :] *= power / energy - return k_combined + return OperatorResult(k_combined, rates) def load_participating(self): """Loads a cross_sections.xml file to find participating nuclides. diff --git a/openmc/deplete/reaction_rates.py b/openmc/deplete/reaction_rates.py index de3a6a7280..e8bab101bf 100644 --- a/openmc/deplete/reaction_rates.py +++ b/openmc/deplete/reaction_rates.py @@ -23,7 +23,7 @@ class ReactionRates(object): Attributes ---------- mat_to_ind : OrderedDict of str to int - A dictionary mapping cell ID as string to index. + A dictionary mapping material ID as string to index. nuc_to_ind : OrderedDict of str to int A dictionary mapping nuclide name as string to index. react_to_ind : OrderedDict of str to int From 05afc55a88c11200d387519de6a71be9063dbbbc Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 15 Feb 2018 15:34:00 -0600 Subject: [PATCH 039/231] Give deplete.Chain some special methods to make it more Pythonic --- openmc/deplete/chain.py | 34 +++++++++----------------- openmc/deplete/openmc_wrapper.py | 9 +++---- tests/unit_tests/test_deplete_chain.py | 25 ++++++++++--------- 3 files changed, 29 insertions(+), 39 deletions(-) diff --git a/openmc/deplete/chain.py b/openmc/deplete/chain.py index 03decb72ab..846b3af564 100644 --- a/openmc/deplete/chain.py +++ b/openmc/deplete/chain.py @@ -113,8 +113,6 @@ class Chain(object): Attributes ---------- - n_nuclides : int - Number of nuclides in chain. nuclides : list of Nuclide List of nuclides in chain. nuclide_dict : OrderedDict of str to int @@ -132,8 +130,14 @@ class Chain(object): self.nuc_to_react_ind = OrderedDict() self.react_to_ind = OrderedDict() - @property - def n_nuclides(self): + def __contains__(self, nuclide): + return nuclide in self.nuclide_dict + + def __getitem__(self, name): + """Get a Nuclide by name.""" + return self.nuclides[self.nuclide_dict[name]] + + def __len__(self): """Number of nuclides in chain.""" return len(self.nuclides) @@ -381,14 +385,14 @@ class Chain(object): Parameters ---------- rates : numpy.ndarray - 2D array indexed by nuclide then by cell. + 2D array indexed by (nuclide, reaction) Returns ------- scipy.sparse.csr_matrix Sparse matrix representing depletion. - """ + """ matrix = defaultdict(float) reactions = set() @@ -450,21 +454,7 @@ class Chain(object): reactions.clear() # Use DOK matrix as intermediate representation, then convert to CSR and return - matrix_dok = sp.dok_matrix((self.n_nuclides, self.n_nuclides)) + n = len(self) + matrix_dok = sp.dok_matrix((n, n)) dict.update(matrix_dok, matrix) return matrix_dok.tocsr() - - def nuc_by_ind(self, ind): - """Extracts nuclides from the list by dictionary key. - - Parameters - ---------- - ind : str - Name of nuclide. - - Returns - ------- - Nuclide - Nuclide object that corresponds to ind. - """ - return self.nuclides[self.nuclide_dict[ind]] diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 65ed4793dd..b8b9065276 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -328,7 +328,7 @@ class OpenMCOperator(Operator): i += 1 n_mat_burn = len(mat_burn) - n_nuc_burn = len(self.chain.nuclide_dict) + n_nuc_burn = len(self.chain) self.number = AtomNumber(mat_dict, nuc_dict, volume, n_mat_burn, n_nuc_burn) @@ -500,8 +500,7 @@ class OpenMCOperator(Operator): # Store list of tally nuclides on each process nuc_list = comm.bcast(nuc_list, root=0) - tally_nuclides = [nuc for nuc in nuc_list - if nuc in self.chain.nuclide_dict] + tally_nuclides = [nuc for nuc in nuc_list if nuc in self.chain] return tally_nuclides @@ -690,14 +689,14 @@ class OpenMCOperator(Operator): # and nuclides in depletion chain. if name not in self.participating_nuclides: self.participating_nuclides.add(name) - if name in self.chain.nuclide_dict: + if name in self.chain: self.burn_nuc_to_ind[name] = nuc_ind nuc_ind += 1 @property def n_nuc(self): """Number of nuclides considered in the decay chain.""" - return len(self.chain.nuclides) + return len(self.chain) def get_results_info(self): """Returns volume list, cell lists, and nuc lists. diff --git a/tests/unit_tests/test_deplete_chain.py b/tests/unit_tests/test_deplete_chain.py index 064b878afe..3a065fb46f 100644 --- a/tests/unit_tests/test_deplete_chain.py +++ b/tests/unit_tests/test_deplete_chain.py @@ -20,12 +20,12 @@ def test_init(): assert isinstance(dep.react_to_ind, Mapping) -def test_n_nuclides(): - """Test depletion chain n_nuclides parameter.""" +def test_len(): + """Test depletion chain length.""" dep = Chain() dep.nuclides = ["NucA", "NucB", "NucC"] - assert dep.n_nuclides == 3 + assert len(dep) == 3 def test_from_endf(): @@ -43,10 +43,10 @@ def test_from_xml(): dep = Chain.from_xml(_test_filename) # Basic checks - assert dep.n_nuclides == 3 + assert len(dep) == 3 # A tests - nuc = dep.nuclides[dep.nuclide_dict["A"]] + nuc = dep["A"] assert nuc.name == "A" assert nuc.half_life == 2.36520E+04 @@ -61,7 +61,7 @@ def test_from_xml(): assert [r.branching_ratio for r in nuc.reactions] == [1.0] # B tests - nuc = dep.nuclides[dep.nuclide_dict["B"]] + nuc = dep["B"] assert nuc.name == "B" assert nuc.half_life == 3.29040E+04 @@ -76,7 +76,7 @@ def test_from_xml(): assert [r.branching_ratio for r in nuc.reactions] == [1.0] # C tests - nuc = dep.nuclides[dep.nuclide_dict["C"]] + nuc = dep["C"] assert nuc.name == "C" assert nuc.n_decay_modes == 0 @@ -183,12 +183,13 @@ def test_form_matrix(): assert mat[2, 2] == mat22 -def test_nuc_by_ind(): +def test_getitem(): """ Test nuc_by_ind converter function. """ dep = Chain() dep.nuclides = ["NucA", "NucB", "NucC"] - dep.nuclide_dict = {"NucA" : 0, "NucB" : 1, "NucC" : 2} + dep.nuclide_dict = {nuc: dep.nuclides.index(nuc) + for nuc in dep.nuclides} - assert "NucA" == dep.nuc_by_ind("NucA") - assert "NucB" == dep.nuc_by_ind("NucB") - assert "NucC" == dep.nuc_by_ind("NucC") + assert "NucA" == dep["NucA"] + assert "NucB" == dep["NucB"] + assert "NucC" == dep["NucC"] From a6c095c4e9dd480b382d48ce0d3301648f8942b5 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 15 Feb 2018 15:37:41 -0600 Subject: [PATCH 040/231] Bugfix for Python 3.4 --- openmc/deplete/abc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index b2594d2c84..5441829b40 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -91,7 +91,8 @@ class Operator(metaclass=ABCMeta): def __enter__(self): # Save current directory and move to specific output directory self._orig_dir = os.getcwd() - self.settings.output_dir.mkdir(exist_ok=True) + if not self.settings.output_dir.exists(): + self.settings.output_dir.mkdir() # exist_ok parameter is 3.5+ # In Python 3.6+, chdir accepts a Path directly os.chdir(str(self.settings.output_dir)) From c9abcfc0a1890da0263642e22b3cd9675f28242c Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sat, 17 Feb 2018 10:28:24 -0600 Subject: [PATCH 041/231] Make ReactionRates a subclass of ndarray, simplifying mapping dictionaries --- openmc/deplete/chain.py | 41 +++++++-------- openmc/deplete/openmc_wrapper.py | 20 ++++---- openmc/deplete/reaction_rates.py | 86 +++++++++++--------------------- openmc/deplete/results.py | 12 ++--- 4 files changed, 63 insertions(+), 96 deletions(-) diff --git a/openmc/deplete/chain.py b/openmc/deplete/chain.py index 846b3af564..2187b04860 100644 --- a/openmc/deplete/chain.py +++ b/openmc/deplete/chain.py @@ -117,9 +117,7 @@ class Chain(object): List of nuclides in chain. nuclide_dict : OrderedDict of str to int Maps a nuclide name to an index in nuclides. - nuc_to_react_ind : OrderedDict of str to int - Dictionary mapping a nuclide name to an index in ReactionRates. - react_to_ind : OrderedDict of str to int + index_reaction : OrderedDict of str to int Dictionary mapping a reaction name to an index in ReactionRates. """ @@ -127,8 +125,7 @@ class Chain(object): def __init__(self): self.nuclides = [] self.nuclide_dict = OrderedDict() - self.nuc_to_react_ind = OrderedDict() - self.react_to_ind = OrderedDict() + self.index_reaction = OrderedDict() def __contains__(self, nuclide): return nuclide in self.nuclide_dict @@ -155,7 +152,7 @@ class Chain(object): List of ENDF neutron reaction sub-library files """ - depl_chain = cls() + chain = cls() # Create dictionary mapping target to filename reactions = {} @@ -200,8 +197,8 @@ class Chain(object): nuclide = Nuclide() nuclide.name = parent - depl_chain.nuclides.append(nuclide) - depl_chain.nuclide_dict[parent] = idx + chain.nuclides.append(nuclide) + chain.nuclide_dict[parent] = idx if not data.nuclide['stable'] and data.half_life.nominal_value != 0.0: nuclide.half_life = data.half_life.nominal_value @@ -235,8 +232,8 @@ class Chain(object): Z = data.nuclide['atomic_number'] + delta_Z daughter = '{}{}'.format(openmc.data.ATOMIC_SYMBOL[Z], A) - if name not in depl_chain.react_to_ind: - depl_chain.react_to_ind[name] = reaction_index + if name not in chain.index_reaction: + chain.index_reaction[name] = reaction_index reaction_index += 1 if daughter not in decay_data: @@ -259,8 +256,8 @@ class Chain(object): nuclide.reactions.append( ReactionTuple('fission', 0, q_value, 1.0)) - if 'fission' not in depl_chain.react_to_ind: - depl_chain.react_to_ind['fission'] = reaction_index + if 'fission' not in chain.index_reaction: + chain.index_reaction['fission'] = reaction_index reaction_index += 1 else: missing_fpy.append(parent) @@ -316,7 +313,7 @@ class Chain(object): for vals in missing_fp: print(' {}, E={} eV (total yield={})'.format(*vals)) - return depl_chain + return chain @classmethod def from_xml(cls, filename): @@ -331,7 +328,7 @@ class Chain(object): ---- Allow for branching on capture, etc. """ - depl_chain = cls() + chain = cls() # Load XML tree try: @@ -346,17 +343,17 @@ class Chain(object): reaction_index = 0 for i, nuclide_elem in enumerate(root.findall('nuclide_table')): nuc = Nuclide.from_xml(nuclide_elem) - depl_chain.nuclide_dict[nuc.name] = i + chain.nuclide_dict[nuc.name] = i # Check for reaction paths for rx in nuc.reactions: - if rx.type not in depl_chain.react_to_ind: - depl_chain.react_to_ind[rx.type] = reaction_index + if rx.type not in chain.index_reaction: + chain.index_reaction[rx.type] = reaction_index reaction_index += 1 - depl_chain.nuclides.append(nuc) + chain.nuclides.append(nuc) - return depl_chain + return chain def export_to_xml(self, filename): """Writes a depletion chain XML file. @@ -416,14 +413,14 @@ class Chain(object): k = self.nuclide_dict[target] matrix[k, i] += branch_val - if nuc.name in self.nuc_to_react_ind: + if nuc.name in rates.index_nuc: # Extract all reactions for this nuclide in this cell - nuc_ind = self.nuc_to_react_ind[nuc.name] + nuc_ind = rates.index_nuc[nuc.name] nuc_rates = rates[nuc_ind, :] for r_type, target, _, br in nuc.reactions: # Extract reaction index, and then final reaction rate - r_id = self.react_to_ind[r_type] + r_id = rates.index_rx[r_type] path_rate = nuc_rates[r_id] # Loss term -- make sure we only count loss once for diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index b8b9065276..46d07a23f7 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -369,9 +369,7 @@ class OpenMCOperator(Operator): self.reaction_rates = ReactionRates( self.burn_mat_to_ind, self.burn_nuc_to_ind, - self.chain.react_to_ind) - - self.chain.nuc_to_react_ind = self.burn_nuc_to_ind + self.chain.index_reaction) def form_matrix(self, y, mat): """Forms the depletion matrix. @@ -522,7 +520,7 @@ class OpenMCOperator(Operator): # transmutation. The nuclides for the tally are set later when eval() is # called. tally_dep = openmc.capi.Tally(1) - tally_dep.scores = self.chain.react_to_ind.keys() + tally_dep.scores = self.chain.index_reaction.keys() tally_dep.filters = [mat_filter] def total_density_list(self): @@ -579,11 +577,11 @@ class OpenMCOperator(Operator): # Extract tally bins materials = list(self.mat_tally_ind.keys()) nuclides = openmc.capi.tallies[1].nuclides - reactions = list(self.chain.react_to_ind.keys()) + reactions = list(self.chain.index_reaction.keys()) # Form fast map - nuc_ind = [rates.nuc_to_ind[nuc] for nuc in nuclides] - react_ind = [rates.react_to_ind[react] for react in reactions] + nuc_ind = [rates.index_nuc[nuc] for nuc in nuclides] + react_ind = [rates.index_rx[react] for react in reactions] # Compute fission power # TODO : improve this calculation @@ -598,13 +596,13 @@ class OpenMCOperator(Operator): rates_expanded = np.zeros((rates.n_nuc, rates.n_react)) number = np.zeros(rates.n_nuc) - fission_ind = rates.react_to_ind["fission"] + fission_ind = rates.index_rx["fission"] for nuclide in self.chain.nuclides: - if nuclide.name in rates.nuc_to_ind: + if nuclide.name in rates.index_nuc: for rx in nuclide.reactions: if rx.type == 'fission': - ind = rates.nuc_to_ind[nuclide.name] + ind = rates.index_nuc[nuclide.name] fission_Q[ind] = rx.Q break @@ -637,7 +635,7 @@ class OpenMCOperator(Operator): for react in react_ind: rates_expanded[i_nuc_results, react] /= number[i_nuc_results] - rates.rates[i, :, :] = rates_expanded + rates[i, :, :] = rates_expanded # Reduce energy produced from all processes energy = comm.allreduce(energy) diff --git a/openmc/deplete/reaction_rates.py b/openmc/deplete/reaction_rates.py index e8bab101bf..b437773826 100644 --- a/openmc/deplete/reaction_rates.py +++ b/openmc/deplete/reaction_rates.py @@ -6,7 +6,7 @@ An ndarray to store reaction rates with string, integer, or slice indexing. import numpy as np -class ReactionRates(object): +class ReactionRates(np.ndarray): """ReactionRates class. An ndarray to store reaction rates with string, integer, or slice indexing. @@ -38,76 +38,48 @@ class ReactionRates(object): Array storing rates indexed by the above dictionaries. """ - def __init__(self, mat_to_ind, nuc_to_ind, react_to_ind): + def __new__(cls, index_mat, index_nuc, index_rx): + # Create appropriately-sized zeroed-out ndarray + shape = (len(index_mat), len(index_nuc), len(index_rx)) + obj = super().__new__(cls, shape) + obj[:] = 0.0 - self.mat_to_ind = mat_to_ind - self.nuc_to_ind = nuc_to_ind - self.react_to_ind = react_to_ind + # Add mapping attributes + obj.index_mat = index_mat + obj.index_nuc = index_nuc + obj.index_rx = index_rx - self.rates = np.zeros((self.n_mat, self.n_nuc, self.n_react)) + return obj - def __getitem__(self, pos): - """Retrieves an item from reaction_rates. + def __array_finalize__(self, obj): + if obj is None: + return + self.index_mat = getattr(obj, 'index_mat', None) + self.index_nuc = getattr(obj, 'index_nuc', None) + self.index_rx = getattr(obj, 'index_rx', None) - Parameters - ---------- - pos : tuple - A three-length tuple containing a material index, a nuc index, and a - reaction index. These indexes can be strings (which get converted - to integers via the dictionaries), integers used directly, or - slices. + def __reduce__(self): + state = super().__reduce__() + new_state = state[2] + (self.index_mat, self.index_nuc, self.index_rx) + return (state[0], state[1], new_state) - Returns - ------- - numpy.array - The value indexed from self.rates. - """ - - mat, nuc, react = pos - if isinstance(mat, str): - mat = self.mat_to_ind[mat] - if isinstance(nuc, str): - nuc = self.nuc_to_ind[nuc] - if isinstance(react, str): - react = self.react_to_ind[react] - - return self.rates[mat, nuc, react] - - def __setitem__(self, pos, val): - """Sets an item from reaction_rates. - - Parameters - ---------- - pos : tuple - A three-length tuple containing a material index, a nuc index, and a - reaction index. These indexes can be strings (which get converted - to integers via the dictionaries), integers used directly, or - slices. - val : float - The value to set the array to. - """ - - mat, nuc, react = pos - if isinstance(mat, str): - mat = self.mat_to_ind[mat] - if isinstance(nuc, str): - nuc = self.nuc_to_ind[nuc] - if isinstance(react, str): - react = self.react_to_ind[react] - - self.rates[mat, nuc, react] = val + def __setstate__(self, state): + self.index_mat = state[-3] + self.index_nuc = state[-2] + self.index_rx = state[-1] + super().__setstate__(state[0:-3]) @property def n_mat(self): """Number of cells.""" - return len(self.mat_to_ind) + return len(self.index_mat) @property def n_nuc(self): """Number of nucs.""" - return len(self.nuc_to_ind) + return len(self.index_nuc) @property def n_react(self): """Number of reactions.""" - return len(self.react_to_ind) + return len(self.index_rx) diff --git a/openmc/deplete/results.py b/openmc/deplete/results.py index 37c4b6e921..4a5ca24352 100644 --- a/openmc/deplete/results.py +++ b/openmc/deplete/results.py @@ -180,11 +180,11 @@ class Results(object): mat_int = sorted([int(mat) for mat in self.mat_to_hdf5_ind]) mat_list = [str(mat) for mat in mat_int] nuc_list = sorted(self.nuc_to_ind.keys()) - rxn_list = sorted(self.rates[0].react_to_ind.keys()) + rxn_list = sorted(self.rates[0].index_rx.keys()) n_mats = self.n_hdf5_mats n_nuc_number = len(nuc_list) - n_nuc_rxn = len(self.rates[0].nuc_to_ind) + n_nuc_rxn = len(self.rates[0].index_nuc) n_rxn = len(rxn_list) n_stages = self.n_stages @@ -200,14 +200,14 @@ class Results(object): for nuc in nuc_list: nuc_single_group = nuc_group.create_group(nuc) nuc_single_group.attrs["atom number index"] = self.nuc_to_ind[nuc] - if nuc in self.rates[0].nuc_to_ind: - nuc_single_group.attrs["reaction rate index"] = self.rates[0].nuc_to_ind[nuc] + if nuc in self.rates[0].index_nuc: + nuc_single_group.attrs["reaction rate index"] = self.rates[0].index_nuc[nuc] rxn_group = handle.create_group("reactions") for rxn in rxn_list: rxn_single_group = rxn_group.create_group(rxn) - rxn_single_group.attrs["index"] = self.rates[0].react_to_ind[rxn] + rxn_single_group.attrs["index"] = self.rates[0].index_rx[rxn] # Construct array storage @@ -341,7 +341,7 @@ class Results(object): for i in range(results.n_stages): rate = ReactionRates(results.mat_to_ind, rxn_nuc_to_ind, rxn_to_ind) - rate.rates = handle["/reaction rates"][index, i, :, :, :] + rate[:] = handle["/reaction rates"][index, i, :, :, :] results.rates.append(rate) return results From 5c4ea0d640a41daa9da0a65d134525a7a6589a09 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sat, 17 Feb 2018 14:31:04 -0600 Subject: [PATCH 042/231] Replace Chain.index_reaction with Chain.reactions. Now the ReactionRates controls all the indexing needed to build a depletion matrix. Got all tests fixed here too. Decided to add get/set methods on ReactionRates which take strings. --- openmc/deplete/chain.py | 27 ++++------ openmc/deplete/openmc_wrapper.py | 12 ++--- openmc/deplete/reaction_rates.py | 59 +++++++++++++++++---- openmc/deplete/utilities.py | 48 ++++++++--------- tests/unit_tests/test_deplete_chain.py | 57 ++++++++++---------- tests/unit_tests/test_deplete_integrator.py | 6 +-- tests/unit_tests/test_deplete_reaction.py | 51 +++++++++--------- 7 files changed, 147 insertions(+), 113 deletions(-) diff --git a/openmc/deplete/chain.py b/openmc/deplete/chain.py index 2187b04860..2af64e172a 100644 --- a/openmc/deplete/chain.py +++ b/openmc/deplete/chain.py @@ -113,19 +113,19 @@ class Chain(object): Attributes ---------- - nuclides : list of Nuclide - List of nuclides in chain. + nuclides : list of openmc.deplete.Nuclide + Nuclides present in the chain. + reactions : list of str + Reactions that are tracked in the depletion chain nuclide_dict : OrderedDict of str to int Maps a nuclide name to an index in nuclides. - index_reaction : OrderedDict of str to int - Dictionary mapping a reaction name to an index in ReactionRates. """ def __init__(self): self.nuclides = [] + self.reactions = [] self.nuclide_dict = OrderedDict() - self.index_reaction = OrderedDict() def __contains__(self, nuclide): return nuclide in self.nuclide_dict @@ -190,7 +190,6 @@ class Chain(object): missing_fpy = [] missing_fp = [] - reaction_index = 0 for idx, parent in enumerate(sorted(decay_data, key=_get_zai)): data = decay_data[parent] @@ -232,9 +231,8 @@ class Chain(object): Z = data.nuclide['atomic_number'] + delta_Z daughter = '{}{}'.format(openmc.data.ATOMIC_SYMBOL[Z], A) - if name not in chain.index_reaction: - chain.index_reaction[name] = reaction_index - reaction_index += 1 + if name not in chain.reactions: + chain.reactions.append(name) if daughter not in decay_data: missing_rx_product.append((parent, name, daughter)) @@ -256,9 +254,8 @@ class Chain(object): nuclide.reactions.append( ReactionTuple('fission', 0, q_value, 1.0)) - if 'fission' not in chain.index_reaction: - chain.index_reaction['fission'] = reaction_index - reaction_index += 1 + if 'fission' not in chain.reactions: + chain.reactions.append('fission') else: missing_fpy.append(parent) @@ -340,16 +337,14 @@ class Chain(object): print('Decay chain "', filename, '" is invalid.') raise - reaction_index = 0 for i, nuclide_elem in enumerate(root.findall('nuclide_table')): nuc = Nuclide.from_xml(nuclide_elem) chain.nuclide_dict[nuc.name] = i # Check for reaction paths for rx in nuc.reactions: - if rx.type not in chain.index_reaction: - chain.index_reaction[rx.type] = reaction_index - reaction_index += 1 + if rx.type not in chain.reactions: + chain.reactions.append(rx.type) chain.nuclides.append(nuc) diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 46d07a23f7..c95170a461 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -366,10 +366,11 @@ class OpenMCOperator(Operator): def initialize_reaction_rates(self): """Create reaction rates object. """ + # Create dictionary to map reactions to indices + index_rx = {rx: i for i, rx in enumerate(self.chain.reactions)} + self.reaction_rates = ReactionRates( - self.burn_mat_to_ind, - self.burn_nuc_to_ind, - self.chain.index_reaction) + self.burn_mat_to_ind, self.burn_nuc_to_ind, index_rx) def form_matrix(self, y, mat): """Forms the depletion matrix. @@ -520,7 +521,7 @@ class OpenMCOperator(Operator): # transmutation. The nuclides for the tally are set later when eval() is # called. tally_dep = openmc.capi.Tally(1) - tally_dep.scores = self.chain.index_reaction.keys() + tally_dep.scores = self.chain.reactions tally_dep.filters = [mat_filter] def total_density_list(self): @@ -577,11 +578,10 @@ class OpenMCOperator(Operator): # Extract tally bins materials = list(self.mat_tally_ind.keys()) nuclides = openmc.capi.tallies[1].nuclides - reactions = list(self.chain.index_reaction.keys()) # Form fast map nuc_ind = [rates.index_nuc[nuc] for nuc in nuclides] - react_ind = [rates.index_rx[react] for react in reactions] + react_ind = [rates.index_rx[react] for react in self.chain.reactions] # Compute fission power # TODO : improve this calculation diff --git a/openmc/deplete/reaction_rates.py b/openmc/deplete/reaction_rates.py index b437773826..a479085174 100644 --- a/openmc/deplete/reaction_rates.py +++ b/openmc/deplete/reaction_rates.py @@ -13,20 +13,20 @@ class ReactionRates(np.ndarray): Parameters ---------- - mat_to_ind : OrderedDict of str to int + index_mat : OrderedDict of str to int A dictionary mapping material ID as string to index. - nuc_to_ind : OrderedDict of str to int + index_nuc : OrderedDict of str to int A dictionary mapping nuclide name as string to index. - react_to_ind : OrderedDict of str to int + index_rx : OrderedDict of str to int A dictionary mapping reaction name as string to index. Attributes ---------- - mat_to_ind : OrderedDict of str to int + index_mat : OrderedDict of str to int A dictionary mapping material ID as string to index. - nuc_to_ind : OrderedDict of str to int + index_nuc : OrderedDict of str to int A dictionary mapping nuclide name as string to index. - react_to_ind : OrderedDict of str to int + index_rx : OrderedDict of str to int A dictionary mapping reaction name as string to index. n_mat : int Number of materials. @@ -34,10 +34,8 @@ class ReactionRates(np.ndarray): Number of nucs. n_react : int Number of reactions. - rates : numpy.array - Array storing rates indexed by the above dictionaries. - """ + """ def __new__(cls, index_mat, index_nuc, index_rx): # Create appropriately-sized zeroed-out ndarray shape = (len(index_mat), len(index_nuc), len(index_rx)) @@ -83,3 +81,46 @@ class ReactionRates(np.ndarray): def n_react(self): """Number of reactions.""" return len(self.index_rx) + + def get(self, mat, nuc, rx): + """Get reaction rate by material/nuclide/reaction + + Parameters + ---------- + mat : str + Material ID as a string + nuc : str + Nuclide name + rx : str + Name of the reaction + + Returns + ------- + float + Reaction rate corresponding to given material, nuclide, and reaction + + """ + mat = self.index_mat[mat] + nuc = self.index_nuc[nuc] + rx = self.index_rx[rx] + return self[mat, nuc, rx] + + def set(self, mat, nuc, rx, value): + """Set reaction rate by material/nuclide/reaction + + Parameters + ---------- + mat : str + Material ID as a string + nuc : str + Nuclide name + rx : str + Name of the reaction + value : float + Corresponding reaction rate to set + + """ + mat = self.index_mat[mat] + nuc = self.index_nuc[nuc] + rx = self.index_rx[rx] + self[mat, nuc, rx] = value diff --git a/openmc/deplete/utilities.py b/openmc/deplete/utilities.py index 5433edce44..d155f321d9 100644 --- a/openmc/deplete/utilities.py +++ b/openmc/deplete/utilities.py @@ -7,26 +7,26 @@ the results module. import numpy as np -def evaluate_single_nuclide(results, cell, nuc): - """Evaluates a single nuclide in a single cell from a results list. +def evaluate_single_nuclide(results, mat, nuc): + """Evaluates a single nuclide in a single material from a results list. Parameters ---------- results : list of results The results to extract data from. Must be sorted and continuous. - cell : str - Cell name to evaluate + mat : str + Material name to evaluate nuc : str Nuclide name to evaluate Returns ------- - time : numpy.array - Time vector. - concentration : numpy.array - Total number of atoms in the cell. - """ + time : numpy.ndarray + Time vector + concentration : numpy.ndarray + Total number of atoms in the material + """ n_points = len(results) time = np.zeros(n_points) concentration = np.zeros(n_points) @@ -34,39 +34,39 @@ def evaluate_single_nuclide(results, cell, nuc): # Evaluate value in each region for i, result in enumerate(results): time[i] = result.time[0] - concentration[i] = result[0, cell, nuc] + concentration[i] = result[0, mat, nuc] return time, concentration -def evaluate_reaction_rate(results, cell, nuc, rxn): - """Evaluates a single nuclide reaction rate in a single cell from a results list. +def evaluate_reaction_rate(results, mat, nuc, rx): + """Return reaction rate in a single material/nuclide from a results list. Parameters ---------- - results : list of Results + results : list of openmc.deplete.Results The results to extract data from. Must be sorted and continuous. - cell : str - Cell name to evaluate + mat : str + Material name to evaluate nuc : str Nuclide name to evaluate - rxn : str + rx : str Reaction rate to evaluate Returns ------- - time : numpy.array + time : numpy.ndarray Time vector. - rate : numpy.array + rate : numpy.ndarray Reaction rate. - """ + """ n_points = len(results) time = np.zeros(n_points) rate = np.zeros(n_points) # Evaluate value in each region for i, result in enumerate(results): time[i] = result.time[0] - rate[i] = result.rates[0][cell, nuc, rxn] * result[0, cell, nuc] + rate[i] = result.rates[0].get(mat, nuc, rx) * result[0, mat, nuc] return time, rate @@ -76,17 +76,17 @@ def evaluate_eigenvalue(results): Parameters ---------- - results : list of Results + results : list of openmc.deplete.Results The results to extract data from. Must be sorted and continuous. Returns ------- - time : numpy.array + time : numpy.ndarray Time vector. - eigenvalue : numpy.array + eigenvalue : numpy.ndarray Eigenvalue. - """ + """ n_points = len(results) time = np.zeros(n_points) eigenvalue = np.zeros(n_points) diff --git a/tests/unit_tests/test_deplete_chain.py b/tests/unit_tests/test_deplete_chain.py index 3a065fb46f..ae900e62d7 100644 --- a/tests/unit_tests/test_deplete_chain.py +++ b/tests/unit_tests/test_deplete_chain.py @@ -13,19 +13,18 @@ _test_filename = str(Path(__file__).parents[2] / 'chains' / 'chain_test.xml') def test_init(): """Test depletion chain initialization.""" - dep = Chain() + chain = Chain() - assert isinstance(dep.nuclides, list) - assert isinstance(dep.nuclide_dict, Mapping) - assert isinstance(dep.react_to_ind, Mapping) + assert isinstance(chain.nuclides, list) + assert isinstance(chain.nuclide_dict, Mapping) def test_len(): """Test depletion chain length.""" - dep = Chain() - dep.nuclides = ["NucA", "NucB", "NucC"] + chain = Chain() + chain.nuclides = ["NucA", "NucB", "NucC"] - assert len(dep) == 3 + assert len(chain) == 3 def test_from_endf(): @@ -40,13 +39,13 @@ def test_from_xml(): # the components external to depletion_chain.py are simple storage # types. - dep = Chain.from_xml(_test_filename) + chain = Chain.from_xml(_test_filename) # Basic checks - assert len(dep) == 3 + assert len(chain) == 3 # A tests - nuc = dep["A"] + nuc = chain["A"] assert nuc.name == "A" assert nuc.half_life == 2.36520E+04 @@ -61,7 +60,7 @@ def test_from_xml(): assert [r.branching_ratio for r in nuc.reactions] == [1.0] # B tests - nuc = dep["B"] + nuc = chain["B"] assert nuc.name == "B" assert nuc.half_life == 3.29040E+04 @@ -76,7 +75,7 @@ def test_from_xml(): assert [r.branching_ratio for r in nuc.reactions] == [1.0] # C tests - nuc = dep["C"] + nuc = chain["C"] assert nuc.name == "C" assert nuc.n_decay_modes == 0 @@ -135,22 +134,20 @@ def test_form_matrix(): """ Using chain_test, and a dummy reaction rate, compute the matrix. """ # Relies on test_from_xml passing. - dep = Chain.from_xml(_test_filename) + chain = Chain.from_xml(_test_filename) - cell_ind = {"10000": 0, "10001": 1} + mat_ind = {"10000": 0, "10001": 1} nuc_ind = {"A": 0, "B": 1, "C": 2} - react_ind = dep.react_to_ind + react_ind = {rx: i for i, rx in enumerate(chain.reactions)} - react = reaction_rates.ReactionRates(cell_ind, nuc_ind, react_ind) + react = reaction_rates.ReactionRates(mat_ind, nuc_ind, react_ind) - dep.nuc_to_react_ind = nuc_ind + react.set("10000", "C", "fission", 1.0) + react.set("10000", "A", "(n,gamma)", 2.0) + react.set("10000", "B", "(n,gamma)", 3.0) + react.set("10000", "C", "(n,gamma)", 4.0) - react["10000", "C", "fission"] = 1.0 - react["10000", "A", "(n,gamma)"] = 2.0 - react["10000", "B", "(n,gamma)"] = 3.0 - react["10000", "C", "(n,gamma)"] = 4.0 - - mat = dep.form_matrix(react[0, :, :]) + mat = chain.form_matrix(react[0, :, :]) # Loss A, decay, (n, gamma) mat00 = -np.log(2) / 2.36520E+04 - 2 # A -> B, decay, 0.6 branching ratio @@ -185,11 +182,11 @@ def test_form_matrix(): def test_getitem(): """ Test nuc_by_ind converter function. """ - dep = Chain() - dep.nuclides = ["NucA", "NucB", "NucC"] - dep.nuclide_dict = {nuc: dep.nuclides.index(nuc) - for nuc in dep.nuclides} + chain = Chain() + chain.nuclides = ["NucA", "NucB", "NucC"] + chain.nuclide_dict = {nuc: chain.nuclides.index(nuc) + for nuc in chain.nuclides} - assert "NucA" == dep["NucA"] - assert "NucB" == dep["NucB"] - assert "NucC" == dep["NucC"] + assert "NucA" == chain["NucA"] + assert "NucB" == chain["NucB"] + assert "NucC" == chain["NucC"] diff --git a/tests/unit_tests/test_deplete_integrator.py b/tests/unit_tests/test_deplete_integrator.py index 59d08b4842..78dd6bcef2 100644 --- a/tests/unit_tests/test_deplete_integrator.py +++ b/tests/unit_tests/test_deplete_integrator.py @@ -86,10 +86,8 @@ def test_save_results(run_in_tmpdir): for nuc_i, nuc in enumerate(nuc_list): assert res[0][i, mat, nuc] == x1[i][mat_i][nuc_i] assert res[1][i, mat, nuc] == x2[i][mat_i][nuc_i] - np.testing.assert_array_equal(res[0].rates[i][mat, nuc, :], - rate1[i][mat, nuc, :]) - np.testing.assert_array_equal(res[1].rates[i][mat, nuc, :], - rate2[i][mat, nuc, :]) + np.testing.assert_array_equal(res[0].rates[i], rate1[i]) + np.testing.assert_array_equal(res[1].rates[i], rate2[i]) np.testing.assert_array_equal(res[0].k, eigvl1) np.testing.assert_array_equal(res[0].time, t1) diff --git a/tests/unit_tests/test_deplete_reaction.py b/tests/unit_tests/test_deplete_reaction.py index a98535e1d8..de628f8c66 100644 --- a/tests/unit_tests/test_deplete_reaction.py +++ b/tests/unit_tests/test_deplete_reaction.py @@ -1,35 +1,38 @@ """Tests for the openmc.deplete.ReactionRates class.""" -from openmc.deplete import reaction_rates +import numpy as np +from openmc.deplete import ReactionRates -def test_indexing(): - """Tests the __getitem__ and __setitem__ routines simultaneously.""" +def test_get_set(): + """Tests the get/set methods.""" mat_to_ind = {"10000" : 0, "10001" : 1} nuc_to_ind = {"U238" : 0, "U235" : 1} react_to_ind = {"fission" : 0, "(n,gamma)" : 1} - rates = reaction_rates.ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) + rates = ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) + assert rates.shape == (2, 2, 2) + assert np.all(rates == 0.0) - rates["10000", "U238", "fission"] = 1.0 - rates["10001", "U238", "fission"] = 2.0 - rates["10000", "U235", "fission"] = 3.0 - rates["10001", "U235", "fission"] = 4.0 - rates["10000", "U238", "(n,gamma)"] = 5.0 - rates["10001", "U238", "(n,gamma)"] = 6.0 - rates["10000", "U235", "(n,gamma)"] = 7.0 - rates["10001", "U235", "(n,gamma)"] = 8.0 + rates.set("10000", "U238", "fission", 1.0) + rates.set("10001", "U238", "fission", 2.0) + rates.set("10000", "U235", "fission", 3.0) + rates.set("10001", "U235", "fission", 4.0) + rates.set("10000", "U238", "(n,gamma)", 5.0) + rates.set("10001", "U238", "(n,gamma)", 6.0) + rates.set("10000", "U235", "(n,gamma)", 7.0) + rates.set("10001", "U235", "(n,gamma)", 8.0) # String indexing - assert rates["10000", "U238", "fission"] == 1.0 - assert rates["10001", "U238", "fission"] == 2.0 - assert rates["10000", "U235", "fission"] == 3.0 - assert rates["10001", "U235", "fission"] == 4.0 - assert rates["10000", "U238", "(n,gamma)"] == 5.0 - assert rates["10001", "U238", "(n,gamma)"] == 6.0 - assert rates["10000", "U235", "(n,gamma)"] == 7.0 - assert rates["10001", "U235", "(n,gamma)"] == 8.0 + assert rates.get("10000", "U238", "fission") == 1.0 + assert rates.get("10001", "U238", "fission") == 2.0 + assert rates.get("10000", "U235", "fission") == 3.0 + assert rates.get("10001", "U235", "fission") == 4.0 + assert rates.get("10000", "U238", "(n,gamma)") == 5.0 + assert rates.get("10001", "U238", "(n,gamma)") == 6.0 + assert rates.get("10000", "U235", "(n,gamma)") == 7.0 + assert rates.get("10001", "U235", "(n,gamma)") == 8.0 # Int indexing assert rates[0, 0, 0] == 1.0 @@ -44,7 +47,7 @@ def test_indexing(): rates[0, 0, 0] = 5.0 assert rates[0, 0, 0] == 5.0 - assert rates["10000", "U238", "fission"] == 5.0 + assert rates.get("10000", "U238", "fission") == 5.0 def test_n_mat(): @@ -53,7 +56,7 @@ def test_n_mat(): nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} react_to_ind = {"fission" : 0, "(n,gamma)" : 1, "(n,2n)" : 2, "(n,3n)" : 3} - rates = reaction_rates.ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) + rates = ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) assert rates.n_mat == 2 @@ -64,7 +67,7 @@ def test_n_nuc(): nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} react_to_ind = {"fission" : 0, "(n,gamma)" : 1, "(n,2n)" : 2, "(n,3n)" : 3} - rates = reaction_rates.ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) + rates = ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) assert rates.n_nuc == 3 @@ -75,6 +78,6 @@ def test_n_react(): nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} react_to_ind = {"fission" : 0, "(n,gamma)" : 1, "(n,2n)" : 2, "(n,3n)" : 3} - rates = reaction_rates.ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) + rates = ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) assert rates.n_react == 4 From 9ec044ec2ed49d44470182a628770bf3e31f42ce Mon Sep 17 00:00:00 2001 From: walshjon Date: Sat, 17 Feb 2018 14:09:37 -0800 Subject: [PATCH 043/231] disallow target energy greater than is used in SIGMA1 --- src/physics.F90 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/physics.F90 b/src/physics.F90 index 53a2cc2320..6c267d8758 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -925,11 +925,14 @@ contains maxval(nuc % elastic_0K(i_E_low + 1 : i_E_up)), xs_up) DBRC_REJECT_LOOP: do - ! sample target velocity with the constant cross section (cxs) approx. - call sample_cxs_target_velocity(nuc, v_target, E, uvw, kT) - + TARGET_ENERGY_LOOP: do + ! sample target velocity with the constant cross section (cxs) approx. + call sample_cxs_target_velocity(nuc, v_target, E, uvw, kT) + E_rel = dot_product((v_neut - v_target), (v_neut - v_target)) + if (E_rel < E_up) exit TARGET_ENERGY_LOOP + end do TARGET_ENERGY_LOOP + ! perform Doppler broadening rejection correction (dbrc) - E_rel = dot_product((v_neut - v_target), (v_neut - v_target)) xs_0K = elastic_xs_0K(E_rel, nuc) R = xs_0K / xs_max if (prn() < R) exit DBRC_REJECT_LOOP From 7704390a3b3e0f5aef46df8b68041a9f022f637d Mon Sep 17 00:00:00 2001 From: walshjon Date: Sat, 17 Feb 2018 15:39:55 -0800 Subject: [PATCH 044/231] remove . --- src/physics.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/physics.F90 b/src/physics.F90 index 6c267d8758..b614b81851 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -931,7 +931,7 @@ contains E_rel = dot_product((v_neut - v_target), (v_neut - v_target)) if (E_rel < E_up) exit TARGET_ENERGY_LOOP end do TARGET_ENERGY_LOOP - + ! perform Doppler broadening rejection correction (dbrc) xs_0K = elastic_xs_0K(E_rel, nuc) R = xs_0K / xs_max From 82fea220c40615bd44b61d120f7059b7efed3aaf Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Feb 2018 07:23:26 -0600 Subject: [PATCH 045/231] Use get_all_materials() to simplify logic --- openmc/deplete/openmc_wrapper.py | 71 ++++++++++---------------------- 1 file changed, 21 insertions(+), 50 deletions(-) diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index c95170a461..9a895a5081 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -104,7 +104,7 @@ class OpenMCOperator(Operator): ---------- geometry : openmc.Geometry The OpenMC geometry object. - settings : OpenMCSettings + settings : openmc.deplete.OpenMCSettings Settings object. Attributes @@ -130,8 +130,8 @@ class OpenMCOperator(Operator): Number of nuclides considered in the decay chain. mat_tally_ind : OrderedDict of str to int Dictionary mapping material ID to index in tally. - """ + """ def __init__(self, geometry, settings): super().__init__(settings) @@ -170,8 +170,10 @@ class OpenMCOperator(Operator): # Extract number densities from the geometry self.extract_number(mat_burn, mat_not_burn, volume, nuc_dict) - # Create reaction rate tables - self.initialize_reaction_rates() + # Create reaction rates array + index_rx = {rx: i for i, rx in enumerate(self.chain.reactions)} + self.reaction_rates = ReactionRates( + self.burn_mat_to_ind, self.burn_nuc_to_ind, index_rx) def __call__(self, vec, print_out=True): """Runs a simulation. @@ -243,35 +245,17 @@ class OpenMCOperator(Operator): volume = OrderedDict() # Iterate once through the geometry to get dictionaries - cells = self.geometry.get_all_material_cells() - for cell in cells.values(): - if isinstance(cell.fill, openmc.Material): - mat = cell.fill - for nuclide in mat.get_nuclide_densities(): - nuc_set.add(nuclide) - if mat.depletable: - mat_burn.add(str(mat.id)) - volume[str(mat.id)] = mat.volume - else: - mat_not_burn.add(str(mat.id)) + for mat in self.geometry.get_all_materials().values(): + for nuclide in mat.get_nuclide_densities(): + nuc_set.add(nuclide) + if mat.depletable: + mat_burn.add(str(mat.id)) + if mat.volume is None: + raise RuntimeError("Volume not specified for depletable " + "material with ID={}.".format(mat.id)) + volume[str(mat.id)] = mat.volume else: - for mat in cell.fill: - for nuclide in mat.get_nuclide_densities(): - nuc_set.add(nuclide) - if mat.depletable: - mat_burn.add(str(mat.id)) - volume[str(mat.id)] = mat.volume - else: - mat_not_burn.add(str(mat.id)) - - need_vol = [] - - for mat_id in volume: - if volume[mat_id] is None: - need_vol.append(mat_id) - - if need_vol: - exit("Need volumes for materials: " + str(need_vol)) + mat_not_burn.add(str(mat.id)) # Sort the sets mat_burn = sorted(mat_burn, key=int) @@ -334,18 +318,13 @@ class OpenMCOperator(Operator): if self.settings.dilute_initial != 0.0: for nuc in self.burn_nuc_to_ind: - self.number.set_atom_density(np.s_[:], nuc, self.settings.dilute_initial) + self.number.set_atom_density(np.s_[:], nuc, + self.settings.dilute_initial) # Now extract the number densities and store - cells = self.geometry.get_all_material_cells() - for cell in cells.values(): - if isinstance(cell.fill, openmc.Material): - if str(cell.fill.id) in mat_dict: - self.set_number_from_mat(cell.fill) - else: - for mat in cell.fill: - if str(mat.id) in mat_dict: - self.set_number_from_mat(mat) + for mat in self.geometry.get_all_materials().values(): + if str(mat.id) in mat_dict: + self.set_number_from_mat(mat) def set_number_from_mat(self, mat): """Extracts material and number densities from openmc.Material @@ -364,14 +343,6 @@ class OpenMCOperator(Operator): number = nuc_dens[nuclide][1] * 1.0e24 self.number.set_atom_density(mat_id, nuclide, number) - def initialize_reaction_rates(self): - """Create reaction rates object. """ - # Create dictionary to map reactions to indices - index_rx = {rx: i for i, rx in enumerate(self.chain.reactions)} - - self.reaction_rates = ReactionRates( - self.burn_mat_to_ind, self.burn_nuc_to_ind, index_rx) - def form_matrix(self, y, mat): """Forms the depletion matrix. From afd4ad61b0717c3566053bc6ca294df4ee8cde59 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Feb 2018 08:53:39 -0600 Subject: [PATCH 046/231] Support --update for depletion regression test --- openmc/deplete/results.py | 2 +- tests/regression_tests/test_deplete_full.py | 27 +++++++++++++-------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/openmc/deplete/results.py b/openmc/deplete/results.py index 4a5ca24352..539ce5dd67 100644 --- a/openmc/deplete/results.py +++ b/openmc/deplete/results.py @@ -419,7 +419,7 @@ def read_results(filename): The result objects. """ - with h5py.File(filename, "r") as fh: + with h5py.File(str(filename), "r") as fh: assert fh["version"].value == RESULTS_VERSION # Get number of results stored diff --git a/tests/regression_tests/test_deplete_full.py b/tests/regression_tests/test_deplete_full.py index c809ba0536..6033e3f75a 100644 --- a/tests/regression_tests/test_deplete_full.py +++ b/tests/regression_tests/test_deplete_full.py @@ -11,6 +11,7 @@ import openmc.deplete from openmc.deplete import results from openmc.deplete import utilities +from tests.regression_tests import config from .example_geometry import generate_problem @@ -59,33 +60,39 @@ def test_full(run_in_tmpdir): # Perform simulation using the predictor algorithm openmc.deplete.integrator.predictor(op) - # Load the files - res_test = results.read_results(settings.output_dir / "depletion_results.h5") + # Get path to test and reference results + path_test = settings.output_dir / 'depletion_results.h5' + path_reference = Path(__file__).with_name('test_reference.h5') - # Load the reference - filename = str(Path(__file__).with_name('test_reference.h5')) - res_old = results.read_results(filename) + # If updating results, do so and return + if config['update']: + shutil.copyfile(str(path_test), str(path_reference)) + return + + # Load the reference/test results + res_test = results.read_results(path_test) + res_ref = results.read_results(path_reference) # Assert same mats - for mat in res_old[0].mat_to_ind: + for mat in res_ref[0].mat_to_ind: assert mat in res_test[0].mat_to_ind, \ "Material {} not in new results.".format(mat) - for nuc in res_old[0].nuc_to_ind: + for nuc in res_ref[0].nuc_to_ind: assert nuc in res_test[0].nuc_to_ind, \ "Nuclide {} not in new results.".format(nuc) for mat in res_test[0].mat_to_ind: - assert mat in res_old[0].mat_to_ind, \ + assert mat in res_ref[0].mat_to_ind, \ "Material {} not in old results.".format(mat) for nuc in res_test[0].nuc_to_ind: - assert nuc in res_old[0].nuc_to_ind, \ + assert nuc in res_ref[0].nuc_to_ind, \ "Nuclide {} not in old results.".format(nuc) tol = 1.0e-6 for mat in res_test[0].mat_to_ind: for nuc in res_test[0].nuc_to_ind: _, y_test = utilities.evaluate_single_nuclide(res_test, mat, nuc) - _, y_old = utilities.evaluate_single_nuclide(res_old, mat, nuc) + _, y_old = utilities.evaluate_single_nuclide(res_ref, mat, nuc) # Test each point correct = True From f113205ab91bb28976314d2cc0f306186410f9cd Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Feb 2018 09:15:09 -0600 Subject: [PATCH 047/231] Don't update non-depletable materials (changes test results) --- openmc/deplete/openmc_wrapper.py | 3 ++ .../test_deplete_utilities.py | 39 +++++++++--------- tests/regression_tests/test_reference.h5 | Bin 231608 -> 162120 bytes 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 9a895a5081..e5eaf52dc0 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -397,6 +397,9 @@ class OpenMCOperator(Operator): number_i = comm.bcast(self.number, root=rank) for mat in number_i.mat_to_ind: + if number_i.mat_to_ind[mat] >= number_i.n_mat_burn: + continue + nuclides = [] densities = [] for nuc in number_i.nuc_to_ind: diff --git a/tests/regression_tests/test_deplete_utilities.py b/tests/regression_tests/test_deplete_utilities.py index f9d34aa75a..f38129cc79 100644 --- a/tests/regression_tests/test_deplete_utilities.py +++ b/tests/regression_tests/test_deplete_utilities.py @@ -20,35 +20,36 @@ def res(): def test_evaluate_single_nuclide(res): """Tests evaluating single nuclide utility code.""" - x, y = utilities.evaluate_single_nuclide(res, "1", "Xe135") + t, n = utilities.evaluate_single_nuclide(res, "1", "Xe135") - x_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] - y_ref = [6.6747328233649218e+08, 3.5519299354458244e+14, - 3.4599104054580338e+14, 3.3821165110278112e+14] + t_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] + n_ref = [6.6747328233649218e+08, 3.5421791038348462e+14, + 3.6208592242443462e+14, 3.3799758969347038e+14] - np.testing.assert_array_equal(x, x_ref) - np.testing.assert_array_equal(y, y_ref) + np.testing.assert_array_equal(t, t_ref) + np.testing.assert_array_equal(n, n_ref) def test_evaluate_reaction_rate(res): """Tests evaluating reaction rate utility code.""" - x, y = utilities.evaluate_reaction_rate(res, "1", "Xe135", "(n,gamma)") + t, r = utilities.evaluate_reaction_rate(res, "1", "Xe135", "(n,gamma)") - x_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] - xe_ref = np.array([6.6747328233649218e+08, 3.5519299354458244e+14, - 3.4599104054580338e+14, 3.3821165110278112e+14]) - r_ref = np.array([4.0643598574337784e-05, 4.1457730544386974e-05, - 3.4121248544056681e-05, 3.9204686657643301e-05]) + t_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] + n_ref = np.array([6.6747328233649218e+08, 3.5421791038348462e+14, + 3.6208592242443462e+14, 3.3799758969347038e+14]) + xs_ref = np.array([4.0594392323131994e-05, 3.9249546927524987e-05, + 3.8394587728581798e-05, 4.1521845978371697e-05]) - np.testing.assert_array_equal(x, x_ref) - np.testing.assert_array_equal(y, xe_ref * r_ref) + np.testing.assert_array_equal(t, t_ref) + np.testing.assert_array_equal(r, n_ref * xs_ref) def test_evaluate_eigenvalue(res): """Tests evaluating eigenvalue.""" - x, y = utilities.evaluate_eigenvalue(res) + t, k = utilities.evaluate_eigenvalue(res) - x_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] - y_ref = [1.1921986054449838, 1.1712785643938586, 1.1927099024502694, 1.2269183590698847] + t_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] + k_ref = [1.181281798790367, 1.1798750921988739, 1.1965943696058159, + 1.2207119847790813] - np.testing.assert_array_equal(x, x_ref) - np.testing.assert_array_equal(y, y_ref) + np.testing.assert_array_equal(t, t_ref) + np.testing.assert_array_equal(k, k_ref) diff --git a/tests/regression_tests/test_reference.h5 b/tests/regression_tests/test_reference.h5 index f832e3e2635c8d25a09609c38830227a3a551958..6e724c597107560c4155a257f4e854210f36f08e 100644 GIT binary patch literal 162120 zcmeEv2|QKZ*Z(!E%u1S#g;M4Wo#Q$OX%K1Bj8cdUr8Fy)22rUr5K2@k4TQ+msF6z1 zY^IDEN>cvkK4+i1bKh>yqhDUn|NWhw&tspp&)RFRz1I4!z4tl$-n-q(+)}*vz}^h@ zKT%PJAVcb}OX^Pt_-D0-|F0^FrtUj{3qDW=gEE0+XYl>?AA=ze>ZO5vZocVu78VSG zmy%DFpcz9;kh~J5D(LdR$^upvX144BCxKCWfzog)6?vfI4;Oq4VInGtf1n#a1{r}= zuL49ov#+IyYVr<~&CL)ZD0V$RKmT8>q67li7Xo|^AcR4|W+wj0{2+I6`HndZMi_bH zU-oy}6dQB44eWtlYPNq3kEfPW;EtaVc|mbU1DYj5)++$M)S)B?#a9Gqh9X(R1bm`X zC=O7;RagO9-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bh*kZ9(5m&%2EMYy>z^3+hX{9An)X0}hA*exS=S=Gme83HXC9 z$H*&xnauy-4%sKt;+d>>|2{aG@lUGJ@bHi4T$=pp~tm0-iiJR{pAp69hMg6ZIV}=_^)8WBQtqHIT?6Zm+ZW1>nZhjpW z|EPf(ZY-A!4{pTFXm+)MeO7U!`?-P?jgBA|@R(ik2*w3bd1AHJ~(&ZTI&J1us zAMgWRjxo;;omU6^L6>9Xm4BSzVHP0kU0OVoed6B-A~XJZZazHx6SItFHv`ybm4D{^ zCjKFDL*nM|5kvcw8E%BEhX*%h7BssZRf&yC2>RI=GS5Ij~bZaCfIg(aHGG9X4e+jXB9VkzX><=KCu8aXsMuYrT1%$ z{cIUHpbYXQU5>Htd=3scgM3bxW6ZNdeFfkTx*Q{~{Nn@>Qd1NK?P zjRA?9?;arg#NP^&|DlW-ZaiIw2RF*=Xm-tjeO7UUk+>mo^FN~e_kX|)H_7h9gBxcz zn%!_<=KCv0pInP1gN-ujD``Hd~z!Kz3x*TKO*$WOtfP6}qW6ZN`^gaUc z2VIVlSAKs){9cV@pGb>mvQPZ`xMIdX@|%W-f0{jMcKLvPR{4kWoA`&s4T+n-M-1&# zX1KBS9v<9CdeQ9a1N*GvhKIz>cMp(#;?JV~*N-v7O^o00;KtI2X4e(&ZTQtR#@@0Q^ChW8@WiASWM4^BY}`(T~bNE_vHu<%G7<_Lafs+CZ*0 z^sjP8A+&vG@Hzc`e`4W(l?x7|?Z@w=ZOM9<<_EG*{Cg^5#y@5t9_inr$Mv6njtwIo zSmmF2zlncH+>p4T$Nt}Knc*fJ@H728{}yf-^8>56;U#hN-2-HwNRQkxJW#LD Wt^QlMVXT)}#SI@A@UPy#^8Wzjt8qmD From fe547feb74329804218084883de8edae76591b84 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Feb 2018 09:17:12 -0600 Subject: [PATCH 048/231] Don't keep track of non-burnable materials --- openmc/deplete/atom_number.py | 38 +++--------- openmc/deplete/openmc_wrapper.py | 64 ++++++-------------- tests/unit_tests/test_deplete_atom_number.py | 27 +++------ 3 files changed, 34 insertions(+), 95 deletions(-) diff --git a/openmc/deplete/atom_number.py b/openmc/deplete/atom_number.py index 63c9af8364..f9d85091ae 100644 --- a/openmc/deplete/atom_number.py +++ b/openmc/deplete/atom_number.py @@ -19,8 +19,6 @@ class AtomNumber(object): A dictionary mapping nuclide name as string to index. volume : OrderedDict of int to float Volume of geometry. - n_mat_burn : int - Number of materials to be burned. n_nuc_burn : int Number of nuclides to be burned. @@ -33,8 +31,6 @@ class AtomNumber(object): volume : numpy.array Volume of geometry indexed by mat_to_ind. If a volume is not found, it defaults to 1 so that reading density still works correctly. - n_mat_burn : int - Number of materials to be burned. n_nuc_burn : int Number of nuclides to be burned. n_mat : int @@ -45,30 +41,26 @@ class AtomNumber(object): Array storing total atoms indexed by the above dictionaries. burn_nuc_list : list of str A list of all nuclide material names. Used for sorting the simulation. - burn_mat_list : list of str - A list of all burning material names. Used for sorting the simulation. - """ - def __init__(self, mat_to_ind, nuc_to_ind, volume, n_mat_burn, n_nuc_burn): + """ + def __init__(self, mat_to_ind, nuc_to_ind, volume, n_nuc_burn): self.mat_to_ind = mat_to_ind self.nuc_to_ind = nuc_to_ind - self.volume = np.ones(self.n_mat) + self.volume = np.ones(len(mat_to_ind)) for mat in volume: - if str(mat) in self.mat_to_ind: - ind = self.mat_to_ind[str(mat)] + if mat in self.mat_to_ind: + ind = self.mat_to_ind[mat] self.volume[ind] = volume[mat] - self.n_mat_burn = n_mat_burn self.n_nuc_burn = n_nuc_burn self.number = np.zeros((self.n_mat, self.n_nuc)) # For performance, create storage for burn_nuc_list, burn_mat_list self._burn_nuc_list = None - self._burn_mat_list = None def __getitem__(self, pos): """Retrieves total atom number from AtomNumber. @@ -175,7 +167,7 @@ class AtomNumber(object): if isinstance(mat, str): mat = self.mat_to_ind[mat] - return self[mat, 0:self.n_nuc_burn] + return self[mat, :self.n_nuc_burn] def set_mat_slice(self, mat, val): """Sets atom quantity indexed by mats for all burned nuclides @@ -191,7 +183,7 @@ class AtomNumber(object): if isinstance(mat, str): mat = self.mat_to_ind[mat] - self[mat, 0:self.n_nuc_burn] = val + self[mat, :self.n_nuc_burn] = val @property def n_mat(self): @@ -218,19 +210,3 @@ class AtomNumber(object): self._burn_nuc_list[ind] = nuc return self._burn_nuc_list - - @property - def burn_mat_list(self): - """burn_mat_list : list of str - A list of all burning material names. Used for sorting the simulation. - """ - - if self._burn_mat_list is None: - self._burn_mat_list = [None] * self.n_mat_burn - - for mat in self.mat_to_ind: - ind = self.mat_to_ind[mat] - if ind < self.n_mat_burn: - self._burn_mat_list[ind] = mat - - return self._burn_mat_list diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index e5eaf52dc0..b25afb79b3 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -121,9 +121,9 @@ class OpenMCOperator(Operator): The depletion chain information necessary to form matrices and tallies. reaction_rates : openmc.deplete.ReactionRates Reaction rates from the last operator step. - burn_mat_to_id : OrderedDict of str to int + burn_mat_to_ind : OrderedDict of str to int Dictionary mapping material ID (as a string) to an index in reaction_rates. - burn_nuc_to_id : OrderedDict of str to int + burn_nuc_to_ind : OrderedDict of str to int Dictionary mapping nuclide name (as a string) to an index in reaction_rates. n_nuc : int @@ -148,18 +148,16 @@ class OpenMCOperator(Operator): # Clear out OpenMC, create task lists, distribute if comm.rank == 0: openmc.reset_auto_ids() - mat_burn_list, mat_not_burn_list, volume, self.mat_tally_ind, \ + mat_burn_list, volume, self.mat_tally_ind, \ nuc_dict = self.extract_mat_ids() else: # Dummy variables mat_burn_list = None - mat_not_burn_list = None volume = None nuc_dict = None self.mat_tally_ind = None mat_burn = comm.scatter(mat_burn_list) - mat_not_burn = comm.scatter(mat_not_burn_list) nuc_dict = comm.bcast(nuc_dict) volume = comm.bcast(volume) self.mat_tally_ind = comm.bcast(self.mat_tally_ind) @@ -168,7 +166,7 @@ class OpenMCOperator(Operator): self.load_participating() # Extract number densities from the geometry - self.extract_number(mat_burn, mat_not_burn, volume, nuc_dict) + self.extract_number(mat_burn, volume, nuc_dict) # Create reaction rates array index_rx = {rx: i for i, rx in enumerate(self.chain.reactions)} @@ -239,9 +237,7 @@ class OpenMCOperator(Operator): """ mat_burn = set() - mat_not_burn = set() nuc_set = set() - volume = OrderedDict() # Iterate once through the geometry to get dictionaries @@ -254,19 +250,14 @@ class OpenMCOperator(Operator): raise RuntimeError("Volume not specified for depletable " "material with ID={}.".format(mat.id)) volume[str(mat.id)] = mat.volume - else: - mat_not_burn.add(str(mat.id)) # Sort the sets mat_burn = sorted(mat_burn, key=int) - mat_not_burn = sorted(mat_not_burn, key=int) nuc_set = sorted(nuc_set) # Construct a global nuclide dictionary, burned first nuc_dict = copy.deepcopy(self.chain.nuclide_dict) - i = len(nuc_dict) - for nuc in nuc_set: if nuc not in nuc_dict: nuc_dict[nuc] = i @@ -274,47 +265,35 @@ class OpenMCOperator(Operator): # Decompose geometry mat_burn_lists = _chunks(mat_burn, comm.size) - mat_not_burn_lists = _chunks(mat_not_burn, comm.size) mat_tally_ind = OrderedDict() - for i, mat in enumerate(mat_burn): mat_tally_ind[mat] = i - return mat_burn_lists, mat_not_burn_lists, volume, mat_tally_ind, nuc_dict + return mat_burn_lists, volume, mat_tally_ind, nuc_dict - def extract_number(self, mat_burn, mat_not_burn, volume, nuc_dict): + def extract_number(self, mat_burn, volume, nuc_dict): """Construct self.number read from geometry Parameters ---------- mat_burn : list of int Materials to be burned managed by this thread. - mat_not_burn - Materials not to be burned managed by this thread. volume : OrderedDict of str to float Volumes for the above materials. nuc_dict : OrderedDict of str to int Nuclides to be used in the simulation. + """ - # Same with materials - mat_dict = OrderedDict() self.burn_mat_to_ind = OrderedDict() - i = 0 - for mat in mat_burn: - mat_dict[mat] = i + for i, mat in enumerate(mat_burn): self.burn_mat_to_ind[mat] = i - i += 1 - for mat in mat_not_burn: - mat_dict[mat] = i - i += 1 - - n_mat_burn = len(mat_burn) n_nuc_burn = len(self.chain) - self.number = AtomNumber(mat_dict, nuc_dict, volume, n_mat_burn, n_nuc_burn) + self.number = AtomNumber(self.burn_mat_to_ind, nuc_dict, volume, + n_nuc_burn) if self.settings.dilute_initial != 0.0: for nuc in self.burn_nuc_to_ind: @@ -323,7 +302,7 @@ class OpenMCOperator(Operator): # Now extract the number densities and store for mat in self.geometry.get_all_materials().values(): - if str(mat.id) in mat_dict: + if str(mat.id) in self.burn_mat_to_ind: self.set_number_from_mat(mat) def set_number_from_mat(self, mat): @@ -397,9 +376,6 @@ class OpenMCOperator(Operator): number_i = comm.bcast(self.number, root=rank) for mat in number_i.mat_to_ind: - if number_i.mat_to_ind[mat] >= number_i.n_mat_burn: - continue - nuclides = [] densities = [] for nuc in number_i.nuc_to_ind: @@ -507,12 +483,10 @@ class OpenMCOperator(Operator): Returns ------- list of numpy.array - A list of np.arrays containing total atoms of each cell. + A list of arrays containing total atoms of each material + """ - - total_density = [self.number.get_mat_slice(i) for i in range(self.number.n_mat_burn)] - - return total_density + return list(self.number.get_mat_slice(np.s_[:])) def set_density(self, total_density): """Sets density. @@ -522,12 +496,12 @@ class OpenMCOperator(Operator): Parameters ---------- - total_density : list of numpy.array + total_density : list of numpy.ndarray Total atoms. - """ + """ # Fill in values - for i in range(self.number.n_mat_burn): + for i in range(self.number.n_mat): self.number.set_mat_slice(i, total_density[i]) def unpack_tallies_and_normalize(self): @@ -581,7 +555,7 @@ class OpenMCOperator(Operator): break # Extract results - for i, mat in enumerate(self.number.burn_mat_list): + for i, mat in enumerate(self.burn_mat_to_ind): # Get tally index slab = materials.index(mat) @@ -686,7 +660,7 @@ class OpenMCOperator(Operator): """ nuc_list = self.number.burn_nuc_list - burn_list = self.number.burn_mat_list + burn_list = list(self.burn_mat_to_ind) volume = {} for i, mat in enumerate(burn_list): diff --git a/tests/unit_tests/test_deplete_atom_number.py b/tests/unit_tests/test_deplete_atom_number.py index e3eb22aa55..887e9af1bc 100644 --- a/tests/unit_tests/test_deplete_atom_number.py +++ b/tests/unit_tests/test_deplete_atom_number.py @@ -7,11 +7,11 @@ from openmc.deplete import atom_number def test_indexing(): """Tests the __getitem__ and __setitem__ routines simultaneously.""" - mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} + mat_to_ind = {"10000" : 0, "10001" : 1} nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} volume = {"10000" : 0.38, "10001" : 0.21} - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2) number["10000", "U238"] = 1.0 number["10001", "U238"] = 2.0 @@ -42,7 +42,7 @@ def test_n_mat(): nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} volume = {"10000" : 0.38, "10001" : 0.21} - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2) assert number.n_mat == 2 @@ -53,7 +53,7 @@ def test_n_nuc(): nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} volume = {"10000" : 0.38, "10001" : 0.21} - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2) assert number.n_nuc == 3 @@ -64,22 +64,11 @@ def test_burn_nuc_list(): nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} volume = {"10000" : 0.38, "10001" : 0.21} - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2) assert number.burn_nuc_list == ["U238", "U235"] -def test_burn_mat_list(): - """Test the list of burned nuclides property""" - mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} - nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} - volume = {"10000" : 0.38, "10001" : 0.21} - - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) - - assert number.burn_mat_list == ["10000", "10001"] - - def test_density_indexing(): """Tests the get and set_atom_density routines simultaneously.""" @@ -87,7 +76,7 @@ def test_density_indexing(): nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} volume = {"10000" : 0.38, "10001" : 0.21} - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2) number.set_atom_density("10000", "U238", 1.0) number.set_atom_density("10001", "U238", 2.0) @@ -144,7 +133,7 @@ def test_get_mat_slice(): nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} volume = {"10000" : 0.38, "10001" : 0.21} - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2) number.number = np.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0]]) @@ -164,7 +153,7 @@ def test_set_mat_slice(): nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} volume = {"10000" : 0.38, "10001" : 0.21} - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2, 2) + number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2) number.set_mat_slice(0, [1.0, 2.0]) From 2cd9aecf21628cdda83d5fd5c9606c21ccaafb73 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Feb 2018 10:15:48 -0600 Subject: [PATCH 049/231] Get rid of Operator.mat_tally_ind --- openmc/deplete/openmc_wrapper.py | 42 +++++++++++--------------------- openmc/deplete/results.py | 17 ++++++------- 2 files changed, 22 insertions(+), 37 deletions(-) diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index b25afb79b3..7cdfbd4d8b 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -5,6 +5,7 @@ This module implements the depletion -> OpenMC linkage. import copy from collections import OrderedDict +from itertools import chain import os import random import sys @@ -126,10 +127,8 @@ class OpenMCOperator(Operator): burn_nuc_to_ind : OrderedDict of str to int Dictionary mapping nuclide name (as a string) to an index in reaction_rates. - n_nuc : int - Number of nuclides considered in the decay chain. - mat_tally_ind : OrderedDict of str to int - Dictionary mapping material ID to index in tally. + burnable_mats : list of str + All burnable material IDs """ def __init__(self, geometry, settings): @@ -138,7 +137,6 @@ class OpenMCOperator(Operator): self.geometry = geometry self.number = None self.participating_nuclides = None - self.reaction_rates = None self.burn_mat_to_ind = OrderedDict() self.burn_nuc_to_ind = None @@ -148,19 +146,18 @@ class OpenMCOperator(Operator): # Clear out OpenMC, create task lists, distribute if comm.rank == 0: openmc.reset_auto_ids() - mat_burn_list, volume, self.mat_tally_ind, \ - nuc_dict = self.extract_mat_ids() + mat_burn_list, volume, nuc_dict = self.extract_mat_ids() else: # Dummy variables mat_burn_list = None volume = None nuc_dict = None - self.mat_tally_ind = None - mat_burn = comm.scatter(mat_burn_list) + mat_burn_list = comm.bcast(mat_burn_list) nuc_dict = comm.bcast(nuc_dict) volume = comm.bcast(volume) - self.mat_tally_ind = comm.bcast(self.mat_tally_ind) + mat_burn = mat_burn_list[comm.rank] + self.burnable_mats = list(chain(*mat_burn_list)) # Load participating nuclides self.load_participating() @@ -230,8 +227,6 @@ class OpenMCOperator(Operator): List of non-burnable materials indexed by rank. volume : OrderedDict of str to float Volume of each cell - mat_tally_ind : OrderedDict of str to int - Dictionary mapping material ID to index in tally. nuc_dict : OrderedDict of str to int Nuclides in order of how they'll appear in the simulation. """ @@ -266,11 +261,7 @@ class OpenMCOperator(Operator): # Decompose geometry mat_burn_lists = _chunks(mat_burn, comm.size) - mat_tally_ind = OrderedDict() - for i, mat in enumerate(mat_burn): - mat_tally_ind[mat] = i - - return mat_burn_lists, volume, mat_tally_ind, nuc_dict + return mat_burn_lists, volume, nuc_dict def extract_number(self, mat_burn, volume, nuc_dict): """Construct self.number read from geometry @@ -463,7 +454,7 @@ class OpenMCOperator(Operator): """ # Create tallies for depleting regions materials = [openmc.capi.materials[int(i)] - for i in self.mat_tally_ind] + for i in self.burnable_mats] mat_filter = openmc.capi.MaterialFilter(materials, 1) # Set up a tally that has a material filter covering each depletable @@ -524,7 +515,7 @@ class OpenMCOperator(Operator): k_combined = openmc.capi.keff()[0] # Extract tally bins - materials = list(self.mat_tally_ind.keys()) + materials = self.burnable_mats nuclides = openmc.capi.tallies[1].nuclides # Form fast map @@ -639,11 +630,6 @@ class OpenMCOperator(Operator): self.burn_nuc_to_ind[name] = nuc_ind nuc_ind += 1 - @property - def n_nuc(self): - """Number of nuclides considered in the decay chain.""" - return len(self.chain) - def get_results_info(self): """Returns volume list, cell lists, and nuc lists. @@ -655,10 +641,10 @@ class OpenMCOperator(Operator): A list of all nuclide names. Used for sorting the simulation. burn_list : list of int A list of all cell IDs to be burned. Used for sorting the simulation. - full_burn_dict : OrderedDict of str to int - Maps cell name to index in global geometry. - """ + full_burn_list : list + List of all burnable material IDs + """ nuc_list = self.number.burn_nuc_list burn_list = list(self.burn_mat_to_ind) @@ -670,7 +656,7 @@ class OpenMCOperator(Operator): volume_list = comm.allgather(volume) volume = {k: v for d in volume_list for k, v in d.items()} - return volume, nuc_list, burn_list, self.mat_tally_ind + return volume, nuc_list, burn_list, self.burnable_mats def density_to_mat(dens_dict): diff --git a/openmc/deplete/results.py b/openmc/deplete/results.py index 539ce5dd67..f7daca5b2e 100644 --- a/openmc/deplete/results.py +++ b/openmc/deplete/results.py @@ -58,7 +58,7 @@ class Results(object): self.data = None - def allocate(self, volume, nuc_list, burn_list, full_burn_dict, stages): + def allocate(self, volume, nuc_list, burn_list, full_burn_list, stages): """Allocates memory of Results. Parameters @@ -69,16 +69,16 @@ class Results(object): A list of all nuclide names. Used for sorting the simulation. burn_list : list of int A list of all mat IDs to be burned. Used for sorting the simulation. - full_burn_dict : dict of str to int - Map of material name to id in global geometry. + full_burn_list : list of str + List of all burnable material IDs stages : int Number of stages in simulation. - """ + """ self.volume = copy.deepcopy(volume) self.nuc_to_ind = OrderedDict() self.mat_to_ind = OrderedDict() - self.mat_to_hdf5_ind = copy.deepcopy(full_burn_dict) + self.mat_to_hdf5_ind = {mat: i for i, mat in enumerate(full_burn_list)} for i, mat in enumerate(burn_list): self.mat_to_ind[mat] = i @@ -177,10 +177,9 @@ class Results(object): handle.create_dataset("version", data=RESULTS_VERSION) - mat_int = sorted([int(mat) for mat in self.mat_to_hdf5_ind]) - mat_list = [str(mat) for mat in mat_int] - nuc_list = sorted(self.nuc_to_ind.keys()) - rxn_list = sorted(self.rates[0].index_rx.keys()) + mat_list = sorted(self.mat_to_hdf5_ind, key=int) + nuc_list = sorted(self.nuc_to_ind) + rxn_list = sorted(self.rates[0].index_rx) n_mats = self.n_hdf5_mats n_nuc_number = len(nuc_list) From 4e21e398c83f0997fc20b7c4a08952cfc73b482b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Feb 2018 10:19:02 -0600 Subject: [PATCH 050/231] Move density_to_mat to example_geometry.py --- openmc/deplete/openmc_wrapper.py | 21 --------------------- scripts/example_geometry.py | 23 ++++++++++++++++++++++- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 7cdfbd4d8b..c8a3bcca99 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -657,24 +657,3 @@ class OpenMCOperator(Operator): volume = {k: v for d in volume_list for k, v in d.items()} return volume, nuc_list, burn_list, self.burnable_mats - - -def density_to_mat(dens_dict): - """Generates an OpenMC material from a cell ID and self.number_density. - - Parameters - ---------- - m_id : int - Cell ID. - Returns - ------- - openmc.Material - The OpenMC material filled with nuclides. - """ - - mat = openmc.Material() - for key in dens_dict: - mat.add_nuclide(key, 1.0e-24*dens_dict[key]) - mat.set_density('sum') - - return mat diff --git a/scripts/example_geometry.py b/scripts/example_geometry.py index 09ce0576f1..ca10c1f725 100644 --- a/scripts/example_geometry.py +++ b/scripts/example_geometry.py @@ -9,7 +9,28 @@ import math import numpy as np import openmc -from openmc.deplete import density_to_mat + + +def density_to_mat(dens_dict): + """Generates an OpenMC material from a cell ID and self.number_density. + + Parameters + ---------- + dens_dict : dict + Dictionary mapping nuclide names to densities + + Returns + ------- + openmc.Material + The OpenMC material filled with nuclides. + + """ + mat = openmc.Material() + for key in dens_dict: + mat.add_nuclide(key, 1.0e-24*dens_dict[key]) + mat.set_density('sum') + + return mat def generate_initial_number_density(): From ea335e06961a94c6b680462e24224b998920f5dc Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Feb 2018 10:24:10 -0600 Subject: [PATCH 051/231] Change OPENDEPLETE_CHAIN -> OPENMC_DEPLETE_CHAIN --- openmc/deplete/abc.py | 6 +++--- openmc/deplete/chain.py | 4 ++-- openmc/deplete/openmc_wrapper.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index 5441829b40..e8f65f8871 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -23,8 +23,8 @@ class Settings(object): output_dir : pathlib.Path Path to output directory to save results. chain_file : str - Path to the depletion chain xml file. Defaults to the - :envvar:`OPENDEPLETE_CHAIN` environment variable if it exists. + Path to the depletion chain XML file. Defaults to the + :envvar:`OPENMC_DEPLETE_CHAIN` environment variable if it exists. dilute_initial : float Initial atom density to add for nuclides that are zero in initial condition to ensure they exist in the decay chain. Only done for @@ -37,7 +37,7 @@ class Settings(object): """ def __init__(self): try: - self.chain_file = os.environ["OPENDEPLETE_CHAIN"] + self.chain_file = os.environ["OPENMC_DEPLETE_CHAIN"] except KeyError: self.chain_file = None self.dt_vec = None diff --git a/openmc/deplete/chain.py b/openmc/deplete/chain.py index 2af64e172a..2d2e71a776 100644 --- a/openmc/deplete/chain.py +++ b/openmc/deplete/chain.py @@ -332,9 +332,9 @@ class Chain(object): root = ET.parse(filename) except Exception: if filename is None: - print("No chain specified, either manually or in environment variable OPENDEPLETE_CHAIN.") + print("No chain specified, either manually or in environment variable OPENMC_DEPLETE_CHAIN.") else: - print('Decay chain "', filename, '" is invalid.') + print('Decay chain "{}" is invalid.'.format(filename)) raise for i, nuclide_elem in enumerate(root.findall('nuclide_table')): diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index c8a3bcca99..a01949a911 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -51,8 +51,8 @@ class OpenMCSettings(Settings): output_dir : pathlib.Path Path to output directory to save results. chain_file : str - Path to the depletion chain xml file. Defaults to the - :envvar:`OPENDEPLETE_CHAIN` environment variable if it exists. + Path to the depletion chain XML file. Defaults to the + :envvar:`OPENMC_DEPLETE_CHAIN` environment variable if it exists. dilute_initial : float Initial atom density to add for nuclides that are zero in initial condition to ensure they exist in the decay chain. Only done for From 78e1afb0ffb6e07c32714967ea0001e120303b28 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Feb 2018 13:10:28 -0600 Subject: [PATCH 052/231] Rename participating_nuclides -> nuclides_with_data --- openmc/deplete/atom_number.py | 14 ++--- openmc/deplete/chain.py | 7 ++- openmc/deplete/openmc_wrapper.py | 103 +++++++++++++++---------------- 3 files changed, 60 insertions(+), 64 deletions(-) diff --git a/openmc/deplete/atom_number.py b/openmc/deplete/atom_number.py index f9d85091ae..fc9cb8433b 100644 --- a/openmc/deplete/atom_number.py +++ b/openmc/deplete/atom_number.py @@ -96,9 +96,9 @@ class AtomNumber(object): These indexes can be strings (which get converted to integers via the dictionaries), integers used directly, or slices. val : float - The value to set the array to. - """ + The value [atom] to set the array to. + """ mat, nuc = pos if isinstance(mat, str): mat = self.mat_to_ind[mat] @@ -119,10 +119,10 @@ class AtomNumber(object): Returns ------- - numpy.array - The density indexed. - """ + numpy.ndarray + Density in [atom/cm^3] + """ if isinstance(mat, str): mat = self.mat_to_ind[mat] if isinstance(nuc, str): @@ -140,9 +140,9 @@ class AtomNumber(object): nuc : str, int or slice Nuclide index. val : numpy.array - Array of values to set. - """ + Array of densities to set in [atom/cm^3] + """ if isinstance(mat, str): mat = self.mat_to_ind[mat] if isinstance(nuc, str): diff --git a/openmc/deplete/chain.py b/openmc/deplete/chain.py index 2d2e71a776..ec8d79f819 100644 --- a/openmc/deplete/chain.py +++ b/openmc/deplete/chain.py @@ -332,10 +332,11 @@ class Chain(object): root = ET.parse(filename) except Exception: if filename is None: - print("No chain specified, either manually or in environment variable OPENMC_DEPLETE_CHAIN.") + msg = ("No chain specified, either manually or in environment " + "variable OPENMC_DEPLETE_CHAIN.") else: - print('Decay chain "{}" is invalid.'.format(filename)) - raise + msg = 'Decay chain "{}" is invalid.'.format(filename) + raise IOError(msg) for i, nuclide_elem in enumerate(root.findall('nuclide_table')): nuc = Nuclide.from_xml(nuclide_elem) diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index a01949a911..7120926bcf 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -116,7 +116,7 @@ class OpenMCOperator(Operator): The OpenMC geometry object. number : openmc.deplete.AtomNumber Total number of atoms in simulation. - participating_nuclides : set of str + nuclides_with_data : set of str A set listing all unique nuclides available from cross_sections.xml. chain : openmc.deplete.Chain The depletion chain information necessary to form matrices and tallies. @@ -126,7 +126,8 @@ class OpenMCOperator(Operator): Dictionary mapping material ID (as a string) to an index in reaction_rates. burn_nuc_to_ind : OrderedDict of str to int Dictionary mapping nuclide name (as a string) to an index in - reaction_rates. + reaction_rates. Consists of all nuclides with neutron data and appearing + in the depletion chain. burnable_mats : list of str All burnable material IDs @@ -136,7 +137,6 @@ class OpenMCOperator(Operator): self.geometry = geometry self.number = None - self.participating_nuclides = None self.burn_mat_to_ind = OrderedDict() self.burn_nuc_to_ind = None @@ -146,7 +146,7 @@ class OpenMCOperator(Operator): # Clear out OpenMC, create task lists, distribute if comm.rank == 0: openmc.reset_auto_ids() - mat_burn_list, volume, nuc_dict = self.extract_mat_ids() + mat_burn_list, volume, nuc_dict = self._extract_mat_ids() else: # Dummy variables mat_burn_list = None @@ -160,10 +160,10 @@ class OpenMCOperator(Operator): self.burnable_mats = list(chain(*mat_burn_list)) # Load participating nuclides - self.load_participating() + self._load_participating() # Extract number densities from the geometry - self.extract_number(mat_burn, volume, nuc_dict) + self._extract_number(mat_burn, volume, nuc_dict) # Create reaction rates array index_rx = {rx: i for i, rx in enumerate(self.chain.reactions)} @@ -190,7 +190,7 @@ class OpenMCOperator(Operator): openmc.reset_auto_ids() # Update status - self.set_density(vec) + self._set_density(vec) time_start = time.time() @@ -205,7 +205,7 @@ class OpenMCOperator(Operator): time_openmc = time.time() # Extract results - op_result = self.unpack_tallies_and_normalize() + op_result = self._unpack_tallies_and_normalize() if comm.rank == 0: time_unpack = time.time() @@ -216,7 +216,7 @@ class OpenMCOperator(Operator): return copy.deepcopy(op_result) - def extract_mat_ids(self): + def _extract_mat_ids(self): """Extracts materials and assigns them to processes. Returns @@ -229,15 +229,15 @@ class OpenMCOperator(Operator): Volume of each cell nuc_dict : OrderedDict of str to int Nuclides in order of how they'll appear in the simulation. - """ + """ mat_burn = set() nuc_set = set() volume = OrderedDict() # Iterate once through the geometry to get dictionaries for mat in self.geometry.get_all_materials().values(): - for nuclide in mat.get_nuclide_densities(): + for nuclide in mat.get_nuclides(): nuc_set.add(nuclide) if mat.depletable: mat_burn.add(str(mat.id)) @@ -263,7 +263,7 @@ class OpenMCOperator(Operator): return mat_burn_lists, volume, nuc_dict - def extract_number(self, mat_burn, volume, nuc_dict): + def _extract_number(self, mat_burn, volume, nuc_dict): """Construct self.number read from geometry Parameters @@ -281,10 +281,8 @@ class OpenMCOperator(Operator): for i, mat in enumerate(mat_burn): self.burn_mat_to_ind[mat] = i - n_nuc_burn = len(self.chain) - self.number = AtomNumber(self.burn_mat_to_ind, nuc_dict, volume, - n_nuc_burn) + len(self.chain)) if self.settings.dilute_initial != 0.0: for nuc in self.burn_nuc_to_ind: @@ -294,23 +292,22 @@ class OpenMCOperator(Operator): # Now extract the number densities and store for mat in self.geometry.get_all_materials().values(): if str(mat.id) in self.burn_mat_to_ind: - self.set_number_from_mat(mat) + self._set_number_from_mat(mat) - def set_number_from_mat(self, mat): + def _set_number_from_mat(self, mat): """Extracts material and number densities from openmc.Material Parameters ---------- - mat : openmc.Materials + mat : openmc.Material The material to read from - """ + """ mat_id = str(mat.id) mat_ind = self.number.mat_to_ind[mat_id] - nuc_dens = mat.get_nuclide_atom_densities() - for nuclide in nuc_dens: - number = nuc_dens[nuclide][1] * 1.0e24 + for nuclide, density in mat.get_nuclide_atom_densities().values(): + number = density * 1.0e24 self.number.set_atom_density(mat_id, nuclide, number) def form_matrix(self, y, mat): @@ -344,17 +341,17 @@ class OpenMCOperator(Operator): if comm.rank == 0: self.geometry.export_to_xml() self.settings.settings.export_to_xml() - self.generate_materials_xml() + self._generate_materials_xml() # Initialize OpenMC library comm.barrier() openmc.capi.init(comm) # Generate tallies in memory - self.generate_tallies() + self._generate_tallies() # Return number density vector - return self.total_density_list() + return list(self.number.get_mat_slice(np.s_[:])) def finalize(self): """Finalize a depletion simulation and release resources.""" @@ -370,7 +367,7 @@ class OpenMCOperator(Operator): nuclides = [] densities = [] for nuc in number_i.nuc_to_ind: - if nuc in self.participating_nuclides: + if nuc in self.nuclides_with_data: val = 1.0e-24 * number_i.get_atom_density(mat, nuc) # If nuclide is zero, do not add to the problem. @@ -395,14 +392,14 @@ class OpenMCOperator(Operator): mat_internal = openmc.capi.materials[int(mat)] mat_internal.set_densities(nuclides, densities) - def generate_materials_xml(self): + def _generate_materials_xml(self): """Creates materials.xml from self.number. Due to uncertainty with how MPI interacts with OpenMC API, this constructs the XML manually. The long term goal is to do this through direct memory writing. - """ + """ materials = openmc.Materials(self.geometry.get_all_materials() .values()) @@ -414,12 +411,26 @@ class OpenMCOperator(Operator): materials.export_to_xml() def _get_tally_nuclides(self): + """Determine nuclides that should be tallied for reaction rates. + + This method returns a list of all nuclides that have neutron data and + are listed in the depletion chain. Technically, we should tally nuclides + that may not appear in the depletion chain because we still need to get + the fission reaction rate for these nuclides in order to normalize + power, but that is left as a future exercise. + + Returns + ------- + list of str + Tally nuclides + + """ nuc_set = set() # Create the set of all nuclides in the decay chain in cells marked for # burning in which the number density is greater than zero. for nuc in self.number.nuc_to_ind: - if nuc in self.participating_nuclides: + if nuc in self.nuclides_with_data: if np.sum(self.number[:, nuc]) > 0.0: nuc_set.add(nuc) @@ -439,12 +450,10 @@ class OpenMCOperator(Operator): nuc_list = None # Store list of tally nuclides on each process - nuc_list = comm.bcast(nuc_list, root=0) - tally_nuclides = [nuc for nuc in nuc_list if nuc in self.chain] + nuc_list = comm.bcast(nuc_list) + return [nuc for nuc in nuc_list if nuc in self.chain] - return tally_nuclides - - def generate_tallies(self): + def _generate_tallies(self): """Generates depletion tallies. Using information from the depletion chain as well as the nuclides @@ -465,21 +474,7 @@ class OpenMCOperator(Operator): tally_dep.scores = self.chain.reactions tally_dep.filters = [mat_filter] - def total_density_list(self): - """Returns a list of total density lists. - - This list is in the exact same order as depletion_matrix_list, so that - matrix exponentiation can be done easily. - - Returns - ------- - list of numpy.array - A list of arrays containing total atoms of each material - - """ - return list(self.number.get_mat_slice(np.s_[:])) - - def set_density(self, total_density): + def _set_density(self, total_density): """Sets density. Sets the density in the exact same order as total_density_list outputs, @@ -495,7 +490,7 @@ class OpenMCOperator(Operator): for i in range(self.number.n_mat): self.number.set_mat_slice(i, total_density[i]) - def unpack_tallies_and_normalize(self): + def _unpack_tallies_and_normalize(self): """Unpack tallies from OpenMC and return an operator result This method uses OpenMC's C API bindings to determine the k-effective @@ -587,7 +582,7 @@ class OpenMCOperator(Operator): return OperatorResult(k_combined, rates) - def load_participating(self): + def _load_participating(self): """Loads a cross_sections.xml file to find participating nuclides. This allows for nuclides that are important in the decay chain but not @@ -602,7 +597,7 @@ class OpenMCOperator(Operator): except KeyError: filename = None - self.participating_nuclides = set() + self.nuclides_with_data = set() try: tree = ET.parse(filename) @@ -624,8 +619,8 @@ class OpenMCOperator(Operator): for name in mats.split(): # Make a burn list of the union of nuclides in cross_sections.xml # and nuclides in depletion chain. - if name not in self.participating_nuclides: - self.participating_nuclides.add(name) + if name not in self.nuclides_with_data: + self.nuclides_with_data.add(name) if name in self.chain: self.burn_nuc_to_ind[name] = nuc_ind nuc_ind += 1 From 6832071b4cf8a5f1b01d20079a902b83abac7e4c Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Feb 2018 13:35:51 -0600 Subject: [PATCH 053/231] Move set_density method to AtomNumber --- openmc/deplete/atom_number.py | 69 +++++++++++++++++++------------- openmc/deplete/openmc_wrapper.py | 18 +-------- 2 files changed, 43 insertions(+), 44 deletions(-) diff --git a/openmc/deplete/atom_number.py b/openmc/deplete/atom_number.py index fc9cb8433b..f1b0155d73 100644 --- a/openmc/deplete/atom_number.py +++ b/openmc/deplete/atom_number.py @@ -107,6 +107,32 @@ class AtomNumber(object): self.number[mat, nuc] = val + @property + def n_mat(self): + """Number of materials.""" + return len(self.mat_to_ind) + + @property + def n_nuc(self): + """Number of nuclides.""" + return len(self.nuc_to_ind) + + @property + def burn_nuc_list(self): + """burn_nuc_list : list of str + A list of all nuclide material names. Used for sorting the simulation. + """ + + if self._burn_nuc_list is None: + self._burn_nuc_list = [None] * self.n_nuc_burn + + for nuc in self.nuc_to_ind: + ind = self.nuc_to_ind[nuc] + if ind < self.n_nuc_burn: + self._burn_nuc_list[ind] = nuc + + return self._burn_nuc_list + def get_atom_density(self, mat, nuc): """Accesses atom density instead of total number. @@ -160,10 +186,10 @@ class AtomNumber(object): Returns ------- - numpy.array - The slice requested. - """ + numpy.ndarray + The slice requested in [atom]. + """ if isinstance(mat, str): mat = self.mat_to_ind[mat] @@ -177,36 +203,25 @@ class AtomNumber(object): mat : str, int or slice Material index. val : numpy.array - The slice to set. - """ + The slice to set in [atom] + """ if isinstance(mat, str): mat = self.mat_to_ind[mat] self[mat, :self.n_nuc_burn] = val - @property - def n_mat(self): - """Number of materials.""" - return len(self.mat_to_ind) + def set_density(self, total_density): + """Sets density. - @property - def n_nuc(self): - """Number of nuclides.""" - return len(self.nuc_to_ind) + Sets the density in the exact same order as total_density_list outputs, + allowing for internal consistency + + Parameters + ---------- + total_density : list of numpy.ndarray + Total atoms. - @property - def burn_nuc_list(self): - """burn_nuc_list : list of str - A list of all nuclide material names. Used for sorting the simulation. """ - - if self._burn_nuc_list is None: - self._burn_nuc_list = [None] * self.n_nuc_burn - - for nuc in self.nuc_to_ind: - ind = self.nuc_to_ind[nuc] - if ind < self.n_nuc_burn: - self._burn_nuc_list[ind] = nuc - - return self._burn_nuc_list + for i in range(self.n_mat): + self.set_mat_slice(i, total_density[i]) diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 7120926bcf..43a171afc5 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -190,7 +190,7 @@ class OpenMCOperator(Operator): openmc.reset_auto_ids() # Update status - self._set_density(vec) + self.number.set_density(vec) time_start = time.time() @@ -474,22 +474,6 @@ class OpenMCOperator(Operator): tally_dep.scores = self.chain.reactions tally_dep.filters = [mat_filter] - def _set_density(self, total_density): - """Sets density. - - Sets the density in the exact same order as total_density_list outputs, - allowing for internal consistency - - Parameters - ---------- - total_density : list of numpy.ndarray - Total atoms. - - """ - # Fill in values - for i in range(self.number.n_mat): - self.number.set_mat_slice(i, total_density[i]) - def _unpack_tallies_and_normalize(self): """Unpack tallies from OpenMC and return an operator result From 2a1c66913ad0a22c91757bf231e0023825f01110 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Feb 2018 13:47:49 -0600 Subject: [PATCH 054/231] Don't use hard-wired IDs for MaterialFilter and Tally --- openmc/deplete/openmc_wrapper.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 43a171afc5..42bd0e600e 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -196,7 +196,7 @@ class OpenMCOperator(Operator): # Update material compositions and tally nuclides self._update_materials() - openmc.capi.tallies[1].nuclides = self._get_tally_nuclides() + self._tally.nuclides = self._get_tally_nuclides() # Run OpenMC openmc.capi.reset() @@ -464,15 +464,15 @@ class OpenMCOperator(Operator): # Create tallies for depleting regions materials = [openmc.capi.materials[int(i)] for i in self.burnable_mats] - mat_filter = openmc.capi.MaterialFilter(materials, 1) + mat_filter = openmc.capi.MaterialFilter(materials) # Set up a tally that has a material filter covering each depletable # material and scores corresponding to all reactions that cause # transmutation. The nuclides for the tally are set later when eval() is # called. - tally_dep = openmc.capi.Tally(1) - tally_dep.scores = self.chain.reactions - tally_dep.filters = [mat_filter] + self._tally = openmc.capi.Tally() + self._tally.scores = self.chain.reactions + self._tally.filters = [mat_filter] def _unpack_tallies_and_normalize(self): """Unpack tallies from OpenMC and return an operator result @@ -495,7 +495,7 @@ class OpenMCOperator(Operator): # Extract tally bins materials = self.burnable_mats - nuclides = openmc.capi.tallies[1].nuclides + nuclides = self._tally.nuclides # Form fast map nuc_ind = [rates.index_nuc[nuc] for nuc in nuclides] @@ -530,7 +530,7 @@ class OpenMCOperator(Operator): slab = materials.index(mat) # Get material results hyperslab - results = openmc.capi.tallies[1].results[slab, :, 1] + results = self._tally.results[slab, :, 1] # Zero out reaction rates and nuclide numbers rates_expanded[:] = 0.0 From 945675aaaa5d27b7347c81fc17c97a945487f1f9 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Feb 2018 14:14:56 -0600 Subject: [PATCH 055/231] Simplification of OpenMCOperator.__init__ --- openmc/deplete/atom_number.py | 2 +- openmc/deplete/openmc_wrapper.py | 79 ++++++++++++-------------------- 2 files changed, 30 insertions(+), 51 deletions(-) diff --git a/openmc/deplete/atom_number.py b/openmc/deplete/atom_number.py index f1b0155d73..3ad4968a82 100644 --- a/openmc/deplete/atom_number.py +++ b/openmc/deplete/atom_number.py @@ -18,7 +18,7 @@ class AtomNumber(object): nuc_to_ind : OrderedDict of str to int A dictionary mapping nuclide name as string to index. volume : OrderedDict of int to float - Volume of geometry. + Volume of each material in [cm^3] n_nuc_burn : int Number of nuclides to be burned. diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 42bd0e600e..f3afedb298 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -30,15 +30,14 @@ from .chain import Chain from .reaction_rates import ReactionRates -def _chunks(items, n): - min_size, extra = divmod(len(items), n) +def _distribute(items): + min_size, extra = divmod(len(items), comm.size) j = 0 - chunk_list = [] - for i in range(n): + for i in range(comm.size): chunk_size = min_size + int(i < extra) - chunk_list.append(items[j:j + chunk_size]) + if comm.rank == i: + return items[j:j + chunk_size] j += chunk_size - return chunk_list class OpenMCSettings(Settings): @@ -134,36 +133,21 @@ class OpenMCOperator(Operator): """ def __init__(self, geometry, settings): super().__init__(settings) - self.geometry = geometry - self.number = None - self.burn_mat_to_ind = OrderedDict() - self.burn_nuc_to_ind = None # Read depletion chain self.chain = Chain.from_xml(settings.chain_file) # Clear out OpenMC, create task lists, distribute - if comm.rank == 0: - openmc.reset_auto_ids() - mat_burn_list, volume, nuc_dict = self._extract_mat_ids() - else: - # Dummy variables - mat_burn_list = None - volume = None - nuc_dict = None + openmc.reset_auto_ids() + self.burnable_mats, volume, nuc_dict = self._get_burnable_mats() + local_mats = _distribute(self.burnable_mats) - mat_burn_list = comm.bcast(mat_burn_list) - nuc_dict = comm.bcast(nuc_dict) - volume = comm.bcast(volume) - mat_burn = mat_burn_list[comm.rank] - self.burnable_mats = list(chain(*mat_burn_list)) - - # Load participating nuclides + # Determine which nuclides have incident neutron data self._load_participating() # Extract number densities from the geometry - self._extract_number(mat_burn, volume, nuc_dict) + self._extract_number(local_mats, volume, nuc_dict) # Create reaction rates array index_rx = {rx: i for i, rx in enumerate(self.chain.reactions)} @@ -216,69 +200,64 @@ class OpenMCOperator(Operator): return copy.deepcopy(op_result) - def _extract_mat_ids(self): - """Extracts materials and assigns them to processes. + def _get_burnable_mats(self): + """Determine depletable materials, volumes, and nuclids Returns ------- - mat_burn_lists : list of list of int - List of burnable materials indexed by rank. - mat_not_burn_lists : list of list of int - List of non-burnable materials indexed by rank. + burnable_mats : list of str + List of burnable material IDs volume : OrderedDict of str to float - Volume of each cell + Volume of each material in [cm^3] nuc_dict : OrderedDict of str to int Nuclides in order of how they'll appear in the simulation. """ - mat_burn = set() - nuc_set = set() + burnable_mats = set() + model_nuclides = set() volume = OrderedDict() # Iterate once through the geometry to get dictionaries for mat in self.geometry.get_all_materials().values(): for nuclide in mat.get_nuclides(): - nuc_set.add(nuclide) + model_nuclides.add(nuclide) if mat.depletable: - mat_burn.add(str(mat.id)) + burnable_mats.add(str(mat.id)) if mat.volume is None: raise RuntimeError("Volume not specified for depletable " "material with ID={}.".format(mat.id)) volume[str(mat.id)] = mat.volume # Sort the sets - mat_burn = sorted(mat_burn, key=int) - nuc_set = sorted(nuc_set) + burnable_mats = sorted(burnable_mats, key=int) + model_nuclides = sorted(model_nuclides) # Construct a global nuclide dictionary, burned first nuc_dict = copy.deepcopy(self.chain.nuclide_dict) i = len(nuc_dict) - for nuc in nuc_set: + for nuc in model_nuclides: if nuc not in nuc_dict: nuc_dict[nuc] = i i += 1 - # Decompose geometry - mat_burn_lists = _chunks(mat_burn, comm.size) + return burnable_mats, volume, nuc_dict - return mat_burn_lists, volume, nuc_dict - - def _extract_number(self, mat_burn, volume, nuc_dict): - """Construct self.number read from geometry + def _extract_number(self, local_mats, volume, nuc_dict): + """Construct AtomNumber using geometry Parameters ---------- - mat_burn : list of int - Materials to be burned managed by this thread. + local_mats : list of str + Material IDs to be managed by this process volume : OrderedDict of str to float - Volumes for the above materials. + Volumes for the above materials in [cm^3] nuc_dict : OrderedDict of str to int Nuclides to be used in the simulation. """ # Same with materials self.burn_mat_to_ind = OrderedDict() - for i, mat in enumerate(mat_burn): + for i, mat in enumerate(local_mats): self.burn_mat_to_ind[mat] = i self.number = AtomNumber(self.burn_mat_to_ind, nuc_dict, volume, From 65061bdadcb04904edb3775fb837bc1037cfc8bf Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Feb 2018 14:24:48 -0600 Subject: [PATCH 056/231] Change burn_nuc_to_ind to _burnable_nucs --- openmc/deplete/openmc_wrapper.py | 28 +++++++++++----------------- openmc/deplete/reaction_rates.py | 10 +++++----- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index f3afedb298..3c3b974c90 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -123,10 +123,6 @@ class OpenMCOperator(Operator): Reaction rates from the last operator step. burn_mat_to_ind : OrderedDict of str to int Dictionary mapping material ID (as a string) to an index in reaction_rates. - burn_nuc_to_ind : OrderedDict of str to int - Dictionary mapping nuclide name (as a string) to an index in - reaction_rates. Consists of all nuclides with neutron data and appearing - in the depletion chain. burnable_mats : list of str All burnable material IDs @@ -144,7 +140,9 @@ class OpenMCOperator(Operator): local_mats = _distribute(self.burnable_mats) # Determine which nuclides have incident neutron data - self._load_participating() + self.nuclides_with_data = self._get_nuclides_with_data() + self._burnable_nucs = [nuc for nuc in self.nuclides_with_data + if nuc in self.chain] # Extract number densities from the geometry self._extract_number(local_mats, volume, nuc_dict) @@ -152,7 +150,7 @@ class OpenMCOperator(Operator): # Create reaction rates array index_rx = {rx: i for i, rx in enumerate(self.chain.reactions)} self.reaction_rates = ReactionRates( - self.burn_mat_to_ind, self.burn_nuc_to_ind, index_rx) + self.burn_mat_to_ind, self._burnable_nucs, index_rx) def __call__(self, vec, print_out=True): """Runs a simulation. @@ -264,7 +262,7 @@ class OpenMCOperator(Operator): len(self.chain)) if self.settings.dilute_initial != 0.0: - for nuc in self.burn_nuc_to_ind: + for nuc in self._burnable_nucs: self.number.set_atom_density(np.s_[:], nuc, self.settings.dilute_initial) @@ -545,7 +543,7 @@ class OpenMCOperator(Operator): return OperatorResult(k_combined, rates) - def _load_participating(self): + def _get_nuclides_with_data(self): """Loads a cross_sections.xml file to find participating nuclides. This allows for nuclides that are important in the decay chain but not @@ -560,7 +558,7 @@ class OpenMCOperator(Operator): except KeyError: filename = None - self.nuclides_with_data = set() + nuclides = set() try: tree = ET.parse(filename) @@ -572,9 +570,6 @@ class OpenMCOperator(Operator): raise IOError(msg) root = tree.getroot() - self.burn_nuc_to_ind = OrderedDict() - nuc_ind = 0 - for nuclide_node in root.findall('library'): mats = nuclide_node.get('materials') if not mats: @@ -582,11 +577,10 @@ class OpenMCOperator(Operator): for name in mats.split(): # Make a burn list of the union of nuclides in cross_sections.xml # and nuclides in depletion chain. - if name not in self.nuclides_with_data: - self.nuclides_with_data.add(name) - if name in self.chain: - self.burn_nuc_to_ind[name] = nuc_ind - nuc_ind += 1 + if name not in nuclides: + nuclides.add(name) + + return nuclides def get_results_info(self): """Returns volume list, cell lists, and nuc lists. diff --git a/openmc/deplete/reaction_rates.py b/openmc/deplete/reaction_rates.py index a479085174..d1e1b0f1e2 100644 --- a/openmc/deplete/reaction_rates.py +++ b/openmc/deplete/reaction_rates.py @@ -15,8 +15,8 @@ class ReactionRates(np.ndarray): ---------- index_mat : OrderedDict of str to int A dictionary mapping material ID as string to index. - index_nuc : OrderedDict of str to int - A dictionary mapping nuclide name as string to index. + nuclides : list of str + Depletable nuclides index_rx : OrderedDict of str to int A dictionary mapping reaction name as string to index. @@ -36,15 +36,15 @@ class ReactionRates(np.ndarray): Number of reactions. """ - def __new__(cls, index_mat, index_nuc, index_rx): + def __new__(cls, index_mat, nuclides, index_rx): # Create appropriately-sized zeroed-out ndarray - shape = (len(index_mat), len(index_nuc), len(index_rx)) + shape = (len(index_mat), len(nuclides), len(index_rx)) obj = super().__new__(cls, shape) obj[:] = 0.0 # Add mapping attributes obj.index_mat = index_mat - obj.index_nuc = index_nuc + obj.index_nuc = {nuc: i for i, nuc in enumerate(nuclides)} obj.index_rx = index_rx return obj From 704a131f2d2039138e566216639011df5ddc102c Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Feb 2018 16:38:45 -0600 Subject: [PATCH 057/231] Some refactoring of AtomNumber. Get rid of burn_mat_to_ind --- openmc/deplete/atom_number.py | 122 +++++++++---------- openmc/deplete/openmc_wrapper.py | 65 +++++----- openmc/deplete/results.py | 34 ------ tests/unit_tests/test_deplete_atom_number.py | 59 +++------ 4 files changed, 103 insertions(+), 177 deletions(-) diff --git a/openmc/deplete/atom_number.py b/openmc/deplete/atom_number.py index 3ad4968a82..1a142676cb 100644 --- a/openmc/deplete/atom_number.py +++ b/openmc/deplete/atom_number.py @@ -7,60 +7,55 @@ import numpy as np class AtomNumber(object): - """AtomNumber module. - - An ndarray to store atom densities with string, integer, or slice indexing. + """Stores local material compositions (atoms of each nuclide). Parameters ---------- - mat_to_ind : OrderedDict of str to int - A dictionary mapping material ID as string to index. - nuc_to_ind : OrderedDict of str to int - A dictionary mapping nuclide name as string to index. - volume : OrderedDict of int to float + local_mats : list of str + Material IDs + nuclides : list of str + Nuclides to be tracked + volume : dict Volume of each material in [cm^3] n_nuc_burn : int Number of nuclides to be burned. Attributes ---------- - mat_to_ind : OrderedDict of str to int - A dictionary mapping cell ID as string to index. - nuc_to_ind : OrderedDict of str to int - A dictionary mapping nuclide name as string to index. - volume : numpy.array - Volume of geometry indexed by mat_to_ind. If a volume is not found, - it defaults to 1 so that reading density still works correctly. + index_mat : dict + A dictionary mapping material ID as string to index. + index_nuc : dict + A dictionary mapping nuclide name to index. + volume : numpy.ndarray + Volume of each material in [cm^3]. If a volume is not found, it defaults + to 1 so that reading density still works correctly. + number : numpy.ndarray + Array storing total atoms for each material/nuclide + materials : list of str + Material IDs as strings + nuclides : list of str + All nuclide names + burnable_nuclides : list of str + Burnable nuclides names. Used for sorting the simulation. n_nuc_burn : int - Number of nuclides to be burned. - n_mat : int - Number of materials. + Number of burnable nuclides. n_nuc : int - Number of nucs. - number : numpy.array - Array storing total atoms indexed by the above dictionaries. - burn_nuc_list : list of str - A list of all nuclide material names. Used for sorting the simulation. + Number of nuclidess. """ - def __init__(self, mat_to_ind, nuc_to_ind, volume, n_nuc_burn): + def __init__(self, local_mats, nuclides, volume, n_nuc_burn): + self.index_mat = {mat: i for i, mat in enumerate(local_mats)} + self.index_nuc = {nuc: i for i, nuc in enumerate(nuclides)} - self.mat_to_ind = mat_to_ind - self.nuc_to_ind = nuc_to_ind - - self.volume = np.ones(len(mat_to_ind)) - - for mat in volume: - if mat in self.mat_to_ind: - ind = self.mat_to_ind[mat] - self.volume[ind] = volume[mat] + self.volume = np.ones(len(local_mats)) + for mat, val in volume.items(): + if mat in self.index_mat: + ind = self.index_mat[mat] + self.volume[ind] = val self.n_nuc_burn = n_nuc_burn - self.number = np.zeros((self.n_mat, self.n_nuc)) - - # For performance, create storage for burn_nuc_list, burn_mat_list - self._burn_nuc_list = None + self.number = np.zeros((len(local_mats), self.n_nuc)) def __getitem__(self, pos): """Retrieves total atom number from AtomNumber. @@ -80,9 +75,9 @@ class AtomNumber(object): mat, nuc = pos if isinstance(mat, str): - mat = self.mat_to_ind[mat] + mat = self.index_mat[mat] if isinstance(nuc, str): - nuc = self.nuc_to_ind[nuc] + nuc = self.index_nuc[nuc] return self.number[mat, nuc] @@ -101,37 +96,30 @@ class AtomNumber(object): """ mat, nuc = pos if isinstance(mat, str): - mat = self.mat_to_ind[mat] + mat = self.index_mat[mat] if isinstance(nuc, str): - nuc = self.nuc_to_ind[nuc] + nuc = self.index_nuc[nuc] self.number[mat, nuc] = val @property - def n_mat(self): - """Number of materials.""" - return len(self.mat_to_ind) + def materials(self): + return self.index_mat.keys() + + @property + def nuclides(self): + return self.index_nuc.keys() @property def n_nuc(self): """Number of nuclides.""" - return len(self.nuc_to_ind) + return len(self.index_nuc) @property - def burn_nuc_list(self): - """burn_nuc_list : list of str - A list of all nuclide material names. Used for sorting the simulation. - """ - - if self._burn_nuc_list is None: - self._burn_nuc_list = [None] * self.n_nuc_burn - - for nuc in self.nuc_to_ind: - ind = self.nuc_to_ind[nuc] - if ind < self.n_nuc_burn: - self._burn_nuc_list[ind] = nuc - - return self._burn_nuc_list + def burnable_nuclides(self): + """All burnable nuclide names. Used for sorting the simulation.""" + return [nuc for nuc, ind in self.index_nuc.items() + if ind < self.n_nuc_burn] def get_atom_density(self, mat, nuc): """Accesses atom density instead of total number. @@ -150,9 +138,9 @@ class AtomNumber(object): """ if isinstance(mat, str): - mat = self.mat_to_ind[mat] + mat = self.index_mat[mat] if isinstance(nuc, str): - nuc = self.nuc_to_ind[nuc] + nuc = self.index_nuc[nuc] return self[mat, nuc] / self.volume[mat] @@ -170,9 +158,9 @@ class AtomNumber(object): """ if isinstance(mat, str): - mat = self.mat_to_ind[mat] + mat = self.index_mat[mat] if isinstance(nuc, str): - nuc = self.nuc_to_ind[nuc] + nuc = self.index_nuc[nuc] self[mat, nuc] = val * self.volume[mat] @@ -191,7 +179,7 @@ class AtomNumber(object): """ if isinstance(mat, str): - mat = self.mat_to_ind[mat] + mat = self.index_mat[mat] return self[mat, :self.n_nuc_burn] @@ -207,7 +195,7 @@ class AtomNumber(object): """ if isinstance(mat, str): - mat = self.mat_to_ind[mat] + mat = self.index_mat[mat] self[mat, :self.n_nuc_burn] = val @@ -223,5 +211,5 @@ class AtomNumber(object): Total atoms. """ - for i in range(self.n_mat): - self.set_mat_slice(i, total_density[i]) + for i, density_slice in enumerate(total_density): + self.set_mat_slice(i, density_slice) diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 3c3b974c90..7d776825b0 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -121,10 +121,10 @@ class OpenMCOperator(Operator): The depletion chain information necessary to form matrices and tallies. reaction_rates : openmc.deplete.ReactionRates Reaction rates from the last operator step. - burn_mat_to_ind : OrderedDict of str to int - Dictionary mapping material ID (as a string) to an index in reaction_rates. burnable_mats : list of str All burnable material IDs + local_mats : list of str + All burnable material IDs being managed by a single process """ def __init__(self, geometry, settings): @@ -136,8 +136,8 @@ class OpenMCOperator(Operator): # Clear out OpenMC, create task lists, distribute openmc.reset_auto_ids() - self.burnable_mats, volume, nuc_dict = self._get_burnable_mats() - local_mats = _distribute(self.burnable_mats) + self.burnable_mats, volume, nuclides = self._get_burnable_mats() + self.local_mats = _distribute(self.burnable_mats) # Determine which nuclides have incident neutron data self.nuclides_with_data = self._get_nuclides_with_data() @@ -145,12 +145,12 @@ class OpenMCOperator(Operator): if nuc in self.chain] # Extract number densities from the geometry - self._extract_number(local_mats, volume, nuc_dict) + self._extract_number(self.local_mats, volume, nuclides) # Create reaction rates array index_rx = {rx: i for i, rx in enumerate(self.chain.reactions)} self.reaction_rates = ReactionRates( - self.burn_mat_to_ind, self._burnable_nucs, index_rx) + self.local_mats, self._burnable_nucs, index_rx) def __call__(self, vec, print_out=True): """Runs a simulation. @@ -207,7 +207,7 @@ class OpenMCOperator(Operator): List of burnable material IDs volume : OrderedDict of str to float Volume of each material in [cm^3] - nuc_dict : OrderedDict of str to int + nuclides : list of str Nuclides in order of how they'll appear in the simulation. """ @@ -231,16 +231,14 @@ class OpenMCOperator(Operator): model_nuclides = sorted(model_nuclides) # Construct a global nuclide dictionary, burned first - nuc_dict = copy.deepcopy(self.chain.nuclide_dict) - i = len(nuc_dict) + nuclides = list(self.chain.nuclide_dict) for nuc in model_nuclides: - if nuc not in nuc_dict: - nuc_dict[nuc] = i - i += 1 + if nuc not in nuclides: + nuclides.append(nuc) - return burnable_mats, volume, nuc_dict + return burnable_mats, volume, nuclides - def _extract_number(self, local_mats, volume, nuc_dict): + def _extract_number(self, local_mats, volume, nuclides): """Construct AtomNumber using geometry Parameters @@ -249,17 +247,11 @@ class OpenMCOperator(Operator): Material IDs to be managed by this process volume : OrderedDict of str to float Volumes for the above materials in [cm^3] - nuc_dict : OrderedDict of str to int + nuclides : list of str Nuclides to be used in the simulation. """ - # Same with materials - self.burn_mat_to_ind = OrderedDict() - for i, mat in enumerate(local_mats): - self.burn_mat_to_ind[mat] = i - - self.number = AtomNumber(self.burn_mat_to_ind, nuc_dict, volume, - len(self.chain)) + self.number = AtomNumber(local_mats, nuclides, volume, len(self.chain)) if self.settings.dilute_initial != 0.0: for nuc in self._burnable_nucs: @@ -268,7 +260,7 @@ class OpenMCOperator(Operator): # Now extract the number densities and store for mat in self.geometry.get_all_materials().values(): - if str(mat.id) in self.burn_mat_to_ind: + if str(mat.id) in local_mats: self._set_number_from_mat(mat) def _set_number_from_mat(self, mat): @@ -281,7 +273,6 @@ class OpenMCOperator(Operator): """ mat_id = str(mat.id) - mat_ind = self.number.mat_to_ind[mat_id] for nuclide, density in mat.get_nuclide_atom_densities().values(): number = density * 1.0e24 @@ -293,7 +284,7 @@ class OpenMCOperator(Operator): Parameters ---------- y : numpy.ndarray - An array representing reaction rates for this cell. + An array representing reaction rates for this material. mat : int Material id. @@ -340,10 +331,10 @@ class OpenMCOperator(Operator): for rank in range(comm.size): number_i = comm.bcast(self.number, root=rank) - for mat in number_i.mat_to_ind: + for mat in number_i.materials: nuclides = [] densities = [] - for nuc in number_i.nuc_to_ind: + for nuc in number_i.nuclides: if nuc in self.nuclides_with_data: val = 1.0e-24 * number_i.get_atom_density(mat, nuc) @@ -381,7 +372,7 @@ class OpenMCOperator(Operator): .values()) # Sort nuclides according to order in AtomNumber object - nuclides = list(self.number.nuc_to_ind.keys()) + nuclides = list(self.number.nuclides) for mat in materials: mat._nuclides.sort(key=lambda x: nuclides.index(x[0])) @@ -404,9 +395,9 @@ class OpenMCOperator(Operator): """ nuc_set = set() - # Create the set of all nuclides in the decay chain in cells marked for - # burning in which the number density is greater than zero. - for nuc in self.number.nuc_to_ind: + # Create the set of all nuclides in the decay chain in materials marked + # for burning in which the number density is greater than zero. + for nuc in self.number.nuclides: if nuc in self.nuclides_with_data: if np.sum(self.number[:, nuc]) > 0.0: nuc_set.add(nuc) @@ -421,7 +412,7 @@ class OpenMCOperator(Operator): if comm.rank == 0: # Sort nuclides in the same order as self.number - nuc_list = [nuc for nuc in self.number.nuc_to_ind + nuc_list = [nuc for nuc in self.number.nuclides if nuc in nuc_set] else: nuc_list = None @@ -502,7 +493,7 @@ class OpenMCOperator(Operator): break # Extract results - for i, mat in enumerate(self.burn_mat_to_ind): + for i, mat in enumerate(self.local_mats): # Get tally index slab = materials.index(mat) @@ -583,7 +574,7 @@ class OpenMCOperator(Operator): return nuclides def get_results_info(self): - """Returns volume list, cell lists, and nuc lists. + """Returns volume list, material lists, and nuc lists. Returns ------- @@ -592,13 +583,13 @@ class OpenMCOperator(Operator): nuc_list : list of str A list of all nuclide names. Used for sorting the simulation. burn_list : list of int - A list of all cell IDs to be burned. Used for sorting the simulation. + A list of all material IDs to be burned. Used for sorting the simulation. full_burn_list : list List of all burnable material IDs """ - nuc_list = self.number.burn_nuc_list - burn_list = list(self.burn_mat_to_ind) + nuc_list = self.number.burnable_nuclides + burn_list = self.local_mats volume = {} for i, mat in enumerate(burn_list): diff --git a/openmc/deplete/results.py b/openmc/deplete/results.py index f7daca5b2e..e18051d9d8 100644 --- a/openmc/deplete/results.py +++ b/openmc/deplete/results.py @@ -346,40 +346,6 @@ class Results(object): return results -def get_dict(number): - """Given an operator nested dictionary, output indexing dictionaries. - - These indexing dictionaries map mat IDs and nuclide names to indices - inside of Results.data. - - Parameters - ---------- - number : AtomNumber - The object to extract dictionaries from - - Returns - ------- - mat_to_ind : OrderedDict of str to int - Maps mat strings to index in array. - nuc_to_ind : OrderedDict of str to int - Maps nuclide strings to index in array. - """ - mat_to_ind = OrderedDict() - nuc_to_ind = OrderedDict() - - for nuc in number.nuc_to_ind: - nuc_ind = number.nuc_to_ind[nuc] - if nuc_ind < number.n_nuc_burn: - nuc_to_ind[nuc] = nuc_ind - - for mat in number.mat_to_ind: - mat_ind = number.mat_to_ind[mat] - if mat_ind < number.n_mat_burn: - mat_to_ind[mat] = mat_ind - - return mat_to_ind, nuc_to_ind - - def write_results(result, filename, index): """Outputs result to an .hdf5 file. diff --git a/tests/unit_tests/test_deplete_atom_number.py b/tests/unit_tests/test_deplete_atom_number.py index 887e9af1bc..4cc9207ca9 100644 --- a/tests/unit_tests/test_deplete_atom_number.py +++ b/tests/unit_tests/test_deplete_atom_number.py @@ -7,11 +7,11 @@ from openmc.deplete import atom_number def test_indexing(): """Tests the __getitem__ and __setitem__ routines simultaneously.""" - mat_to_ind = {"10000" : 0, "10001" : 1} - nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} + local_mats = ["10000", "10001"] + nuclides = ["U238", "U235", "U234"] volume = {"10000" : 0.38, "10001" : 0.21} - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2) + number = atom_number.AtomNumber(local_mats, nuclides, volume, 2) number["10000", "U238"] = 1.0 number["10001", "U238"] = 2.0 @@ -36,47 +36,28 @@ def test_indexing(): assert number["10000", "U238"] == 5.0 -def test_n_mat(): - """Test number of materials property. """ - mat_to_ind = {"10000" : 0, "10001" : 1} - nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} +def test_properties(): + """Test properties. """ + local_mats = ["10000", "10001"] + nuclides = ["U238", "U235", "Gd157"] volume = {"10000" : 0.38, "10001" : 0.21} - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2) - - assert number.n_mat == 2 - - -def test_n_nuc(): - """Test number of nuclides property.""" - mat_to_ind = {"10000" : 0, "10001" : 1} - nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} - volume = {"10000" : 0.38, "10001" : 0.21} - - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2) + number = atom_number.AtomNumber(local_mats, nuclides, volume, 2) + assert list(number.materials) == ["10000", "10001"] assert number.n_nuc == 3 - - -def test_burn_nuc_list(): - """Test the list of burned nuclides property""" - mat_to_ind = {"10000" : 0, "10001" : 1} - nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} - volume = {"10000" : 0.38, "10001" : 0.21} - - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2) - - assert number.burn_nuc_list == ["U238", "U235"] + assert list(number.nuclides) == ["U238", "U235", "Gd157"] + assert number.burnable_nuclides == ["U238", "U235"] def test_density_indexing(): """Tests the get and set_atom_density routines simultaneously.""" - mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} - nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} + local_mats = ["10000", "10001", "10002"] + nuclides = ["U238", "U235", "U234"] volume = {"10000" : 0.38, "10001" : 0.21} - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2) + number = atom_number.AtomNumber(local_mats, nuclides, volume, 2) number.set_atom_density("10000", "U238", 1.0) number.set_atom_density("10001", "U238", 2.0) @@ -129,11 +110,11 @@ def test_density_indexing(): def test_get_mat_slice(): """Tests getting slices.""" - mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} - nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} + local_mats = ["10000", "10001", "10002"] + nuclides = ["U238", "U235", "U234"] volume = {"10000" : 0.38, "10001" : 0.21} - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2) + number = atom_number.AtomNumber(local_mats, nuclides, volume, 2) number.number = np.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0]]) @@ -149,11 +130,11 @@ def test_get_mat_slice(): def test_set_mat_slice(): """Tests getting slices.""" - mat_to_ind = {"10000" : 0, "10001" : 1, "10002" : 2} - nuc_to_ind = {"U238" : 0, "U235" : 1, "U234" : 2} + local_mats = ["10000", "10001", "10002"] + nuclides = ["U238", "U235", "U234"] volume = {"10000" : 0.38, "10001" : 0.21} - number = atom_number.AtomNumber(mat_to_ind, nuc_to_ind, volume, 2) + number = atom_number.AtomNumber(local_mats, nuclides, volume, 2) number.set_mat_slice(0, [1.0, 2.0]) From c19f396aa77b78efe0658ba4d4cc7356b1d8d780 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Feb 2018 16:49:51 -0600 Subject: [PATCH 058/231] Remove Operator.form_matrix methods (Chain owns these) --- openmc/deplete/abc.py | 22 ---------------------- openmc/deplete/openmc_wrapper.py | 18 ------------------ 2 files changed, 40 deletions(-) diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index e8f65f8871..6916066816 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -133,27 +133,5 @@ class Operator(metaclass=ABCMeta): pass - @abstractmethod - def form_matrix(self, y, mat): - """Forms the f(y) matrix in y' = f(y)y. - - Nominally a depletion matrix, this is abstracted on the off chance - that the function f has nothing to do with depletion at all. - - Parameters - ---------- - y : numpy.ndarray - An array representing y. - mat : int - Material id. - - Returns - ------- - scipy.sparse.csr_matrix - Sparse matrix representing f(y). - """ - - pass - def finalize(self): pass diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 7d776825b0..56a248c30c 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -278,24 +278,6 @@ class OpenMCOperator(Operator): number = density * 1.0e24 self.number.set_atom_density(mat_id, nuclide, number) - def form_matrix(self, y, mat): - """Forms the depletion matrix. - - Parameters - ---------- - y : numpy.ndarray - An array representing reaction rates for this material. - mat : int - Material id. - - Returns - ------- - scipy.sparse.csr_matrix - Sparse matrix representing the depletion matrix. - """ - - return copy.deepcopy(self.chain.form_matrix(y[mat, :, :])) - def initial_condition(self): """Performs final setup and returns initial condition. From ccfee55115a10144a04e63eac2e744b7411d1c82 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Feb 2018 17:26:44 -0600 Subject: [PATCH 059/231] Make timesteps and power specified in integrator functions --- openmc/deplete/abc.py | 8 ------- openmc/deplete/integrator/cecm.py | 24 ++++++++++++++----- openmc/deplete/integrator/predictor.py | 26 +++++++++++++++------ openmc/deplete/openmc_wrapper.py | 23 +++++++++++------- tests/dummy_geometry.py | 4 +++- tests/regression_tests/test_deplete_full.py | 17 +++++++------- tests/unit_tests/test_deplete_cecm.py | 5 ++-- tests/unit_tests/test_deplete_predictor.py | 5 ++-- 8 files changed, 68 insertions(+), 44 deletions(-) diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index 6916066816..7fda93aa28 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -18,8 +18,6 @@ class Settings(object): Attributes ---------- - dt_vec : numpy.array - Array of time steps to take. output_dir : pathlib.Path Path to output directory to save results. chain_file : str @@ -29,10 +27,6 @@ class Settings(object): Initial atom density to add for nuclides that are zero in initial condition to ensure they exist in the decay chain. Only done for nuclides with reaction rates. Defaults to 1.0e3. - power : float - Power of the reactor in [W]. For a 2D problem, the power can be given in - W/cm as long as the "volume" assigned to a depletion material is - actually an area in cm^2. """ def __init__(self): @@ -40,9 +34,7 @@ class Settings(object): self.chain_file = os.environ["OPENMC_DEPLETE_CHAIN"] except KeyError: self.chain_file = None - self.dt_vec = None self.output_dir = '.' - self.power = None self.dilute_initial = 1.0e3 @property diff --git a/openmc/deplete/integrator/cecm.py b/openmc/deplete/integrator/cecm.py index 760e3c89d8..7d6c11190f 100644 --- a/openmc/deplete/integrator/cecm.py +++ b/openmc/deplete/integrator/cecm.py @@ -1,12 +1,13 @@ """The CE/CM integrator.""" import copy +from collections.abc import Iterable from .cram import deplete from .save_results import save_results -def cecm(operator, print_out=True): +def cecm(operator, timesteps, power, print_out=True): r"""The CE/CM integrator. Implements the second order CE/CM Predictor-Corrector algorithm [ref]_. @@ -32,25 +33,36 @@ def cecm(operator, print_out=True): ---------- operator : openmc.deplete.Operator The operator object to simulate on. + timesteps : iterable of float + Array of timesteps in units of [s] + power : float or iterable of float + Power of the reactor in [W]. A single value indicates that the power is + constant over all timesteps. An iterable indicates potentially different + power levels for each timestep. For a 2D problem, the power can be given + in [W/cm] as long as the "volume" assigned to a depletion material is + actually an area in [cm^2]. print_out : bool, optional Whether or not to print out time. """ + if not isinstance(power, Iterable): + power = [power]*len(timesteps) + # Generate initial conditions with operator as vec: chain = operator.chain t = 0.0 - for i, dt in enumerate(operator.settings.dt_vec): + for i, (dt, p) in enumerate(zip(timesteps, power)): # Get beginning-of-timestep reaction rates x = [copy.deepcopy(vec)] - results = [operator(x[0])] + results = [operator(x[0], p)] # Deplete for first half of timestep x_middle = deplete(chain, x[0], results[0], dt/2, print_out) # Get middle-of-timestep reaction rates x.append(x_middle) - results.append(operator(x_middle)) + results.append(operator(x_middle, p)) # Deplete for full timestep using beginning-of-step materials x_end = deplete(chain, x[0], results[1], dt, print_out) @@ -64,7 +76,7 @@ def cecm(operator, print_out=True): # Perform one last simulation x = [copy.deepcopy(vec)] - results = [operator(x[0])] + results = [operator(x[0], power[-1])] # Create results, write to disk - save_results(operator, x, results, [t, t], len(operator.settings.dt_vec)) + save_results(operator, x, results, [t, t], len(timesteps)) diff --git a/openmc/deplete/integrator/predictor.py b/openmc/deplete/integrator/predictor.py index 0640783318..038c0778da 100644 --- a/openmc/deplete/integrator/predictor.py +++ b/openmc/deplete/integrator/predictor.py @@ -1,13 +1,14 @@ -"""The Predictor algorithm.""" +"""First-order predictor algorithm.""" import copy +from collections.abc import Iterable from .cram import deplete from .save_results import save_results -def predictor(operator, print_out=True): - r"""The basic predictor integrator. +def predictor(operator, timesteps, power, print_out=True): + r"""Deplete using a first-order predictor algorithm. Implements the first-order predictor algorithm. This algorithm is mathematically defined as: @@ -23,18 +24,29 @@ def predictor(operator, print_out=True): ---------- operator : openmc.deplete.Operator The operator object to simulate on. + timesteps : iterable of float + Array of timesteps in units of [s] + power : float or iterable of float + Power of the reactor in [W]. A single value indicates that the power is + constant over all timesteps. An iterable indicates potentially different + power levels for each timestep. For a 2D problem, the power can be given + in [W/cm] as long as the "volume" assigned to a depletion material is + actually an area in [cm^2]. print_out : bool, optional Whether or not to print out time. """ + if not isinstance(power, Iterable): + power = [power]*len(timesteps) + # Generate initial conditions with operator as vec: chain = operator.chain t = 0.0 - for i, dt in enumerate(operator.settings.dt_vec): + for i, (dt, p) in enumerate(zip(timesteps, power)): # Get beginning-of-timestep reaction rates x = [copy.deepcopy(vec)] - results = [operator(x[0])] + results = [operator(x[0], p)] # Create results, write to disk save_results(operator, x, results, [t, t + dt], i) @@ -48,7 +60,7 @@ def predictor(operator, print_out=True): # Perform one last simulation x = [copy.deepcopy(vec)] - results = [operator(x[0])] + results = [operator(x[0], power[-1])] # Create results, write to disk - save_results(operator, x, results, [t, t], len(operator.settings.dt_vec)) + save_results(operator, x, results, [t, t], len(timesteps)) diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 56a248c30c..e5898997bc 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -45,8 +45,6 @@ class OpenMCSettings(Settings): Attributes ---------- - dt_vec : numpy.array - Array of time steps to in units of [s] output_dir : pathlib.Path Path to output directory to save results. chain_file : str @@ -68,8 +66,8 @@ class OpenMCSettings(Settings): """ - _depletion_attrs = {'dt_vec', '_output_dir', 'chain_file', 'dilute_initial', - 'round_number', 'power'} + _depletion_attrs = {'_output_dir', 'chain_file', 'dilute_initial', + 'round_number'} def __init__(self): super().__init__() @@ -152,13 +150,15 @@ class OpenMCOperator(Operator): self.reaction_rates = ReactionRates( self.local_mats, self._burnable_nucs, index_rx) - def __call__(self, vec, print_out=True): + def __call__(self, vec, power, print_out=True): """Runs a simulation. Parameters ---------- vec : list of numpy.array Total atoms to be used in function. + power : float + Power of the reactor in [W] print_out : bool, optional Whether or not to print out time. @@ -187,7 +187,7 @@ class OpenMCOperator(Operator): time_openmc = time.time() # Extract results - op_result = self._unpack_tallies_and_normalize() + op_result = self._unpack_tallies_and_normalize(power) if comm.rank == 0: time_unpack = time.time() @@ -424,7 +424,7 @@ class OpenMCOperator(Operator): self._tally.scores = self.chain.reactions self._tally.filters = [mat_filter] - def _unpack_tallies_and_normalize(self): + def _unpack_tallies_and_normalize(self, power): """Unpack tallies from OpenMC and return an operator result This method uses OpenMC's C API bindings to determine the k-effective @@ -432,6 +432,11 @@ class OpenMCOperator(Operator): normalized by the user-specified power, summing the product of the fission reaction rate times the fission Q value for each material. + Parameters + ---------- + power : float + Power of the reactor in [W] + Returns ------- openmc.deplete.OperatorResult @@ -509,10 +514,10 @@ class OpenMCOperator(Operator): energy = comm.allreduce(energy) # Determine power in eV/s - power = self.settings.power / JOULE_PER_EV + power /= JOULE_PER_EV # Scale reaction rates to obtain units of reactions/sec - rates[:, :, :] *= power / energy + rates *= power / energy return OperatorResult(k_combined, rates) diff --git a/tests/dummy_geometry.py b/tests/dummy_geometry.py index c013bb0054..d662616698 100644 --- a/tests/dummy_geometry.py +++ b/tests/dummy_geometry.py @@ -21,13 +21,15 @@ class DummyGeometry(Operator): def __init__(self, settings): super().__init__(settings) - def __call__(self, vec, print_out=False): + def __call__(self, vec, power, print_out=False): """Evaluates F(y) Parameters ---------- vec : list of numpy.array Total atoms to be used in function. + power : float + Power in [W] print_out : bool, optional, ignored Whether or not to print out time. diff --git a/tests/regression_tests/test_deplete_full.py b/tests/regression_tests/test_deplete_full.py index 6033e3f75a..1ae2cee1fa 100644 --- a/tests/regression_tests/test_deplete_full.py +++ b/tests/regression_tests/test_deplete_full.py @@ -32,18 +32,10 @@ def test_full(run_in_tmpdir): # Load geometry from example geometry, lower_left, upper_right = generate_problem(n_rings, n_wedges) - # Create dt vector for 3 steps with 15 day timesteps - dt1 = 15.*24*60*60 # 15 days - dt2 = 1.5*30*24*60*60 # 1.5 months - N = floor(dt2/dt1) - dt = np.full(N, dt1) - # Depletion settings settings = openmc.deplete.OpenMCSettings() settings.chain_file = str(Path(__file__).parents[2] / 'chains' / 'chain_simple.xml') - settings.power = 2.337e15*4*JOULE_PER_EV*1e6 # MeV/second cm from CASMO - settings.dt_vec = dt settings.round_number = True # Add OpenMC-specific settings @@ -57,8 +49,15 @@ def test_full(run_in_tmpdir): op = openmc.deplete.OpenMCOperator(geometry, settings) + # Power and timesteps + dt1 = 15.*24*60*60 # 15 days + dt2 = 1.5*30*24*60*60 # 1.5 months + N = floor(dt2/dt1) + dt = np.full(N, dt1) + power = 2.337e15*4*JOULE_PER_EV*1e6 # MeV/second cm from CASMO + # Perform simulation using the predictor algorithm - openmc.deplete.integrator.predictor(op) + openmc.deplete.integrator.predictor(op, dt, power) # Get path to test and reference results path_test = settings.output_dir / 'depletion_results.h5' diff --git a/tests/unit_tests/test_deplete_cecm.py b/tests/unit_tests/test_deplete_cecm.py index 66c3ee156c..3daa7a0489 100644 --- a/tests/unit_tests/test_deplete_cecm.py +++ b/tests/unit_tests/test_deplete_cecm.py @@ -15,13 +15,14 @@ def test_cecm(run_in_tmpdir): """Integral regression test of integrator algorithm using CE/CM.""" settings = openmc.deplete.Settings() - settings.dt_vec = [0.75, 0.75] settings.output_dir = "test_integrator_regression" op = dummy_geometry.DummyGeometry(settings) # Perform simulation using the MCNPX/MCNP6 algorithm - openmc.deplete.cecm(op, print_out=False) + dt = [0.75, 0.75] + power = 1.0 + openmc.deplete.cecm(op, dt, power, print_out=False) # Load the files res = results.read_results(settings.output_dir / "depletion_results.h5") diff --git a/tests/unit_tests/test_deplete_predictor.py b/tests/unit_tests/test_deplete_predictor.py index f1133f87d2..be8497f5f7 100644 --- a/tests/unit_tests/test_deplete_predictor.py +++ b/tests/unit_tests/test_deplete_predictor.py @@ -15,13 +15,14 @@ def test_predictor(run_in_tmpdir): """Integral regression test of integrator algorithm using predictor/corrector""" settings = openmc.deplete.Settings() - settings.dt_vec = [0.75, 0.75] settings.output_dir = "test_integrator_regression" op = dummy_geometry.DummyGeometry(settings) # Perform simulation using the predictor algorithm - openmc.deplete.predictor(op, print_out=False) + dt = [0.75, 0.75] + power = 1.0 + openmc.deplete.predictor(op, dt, power, print_out=False) # Load the files res = results.read_results(settings.output_dir / "depletion_results.h5") From a460782691b86bf932c2acbcdba76ceb6c914659 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Feb 2018 17:52:17 -0600 Subject: [PATCH 060/231] Get rid of extra Settings class --- docs/source/pythonapi/deplete/index.rst | 2 - openmc/deplete/abc.py | 75 +++++++-------- openmc/deplete/chain.py | 14 +-- openmc/deplete/openmc_wrapper.py | 100 ++++++-------------- tests/dummy_geometry.py | 5 +- tests/regression_tests/test_deplete_full.py | 16 ++-- tests/unit_tests/test_deplete_cecm.py | 8 +- tests/unit_tests/test_deplete_predictor.py | 8 +- 8 files changed, 77 insertions(+), 151 deletions(-) diff --git a/docs/source/pythonapi/deplete/index.rst b/docs/source/pythonapi/deplete/index.rst index 30d2d42611..f3212bd61d 100644 --- a/docs/source/pythonapi/deplete/index.rst +++ b/docs/source/pythonapi/deplete/index.rst @@ -29,7 +29,6 @@ Metaclasses :toctree: generated :nosignatures: - openmc.deplete.Settings openmc.deplete.Operator OpenMC Classes @@ -39,7 +38,6 @@ OpenMC Classes :toctree: generated :nosignatures: - openmc.deplete.OpenMCSettings openmc.deplete.Materials openmc.deplete.OpenMCOperator diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index 7fda93aa28..9d53f40bfd 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -7,44 +7,9 @@ to run a full depletion simulation. from collections import namedtuple import os from pathlib import Path - from abc import ABCMeta, abstractmethod - -class Settings(object): - """The Settings class. - - Contains all parameters necessary for the integrator. - - Attributes - ---------- - output_dir : pathlib.Path - Path to output directory to save results. - chain_file : str - Path to the depletion chain XML file. Defaults to the - :envvar:`OPENMC_DEPLETE_CHAIN` environment variable if it exists. - dilute_initial : float - Initial atom density to add for nuclides that are zero in initial - condition to ensure they exist in the decay chain. Only done for - nuclides with reaction rates. Defaults to 1.0e3. - - """ - def __init__(self): - try: - self.chain_file = os.environ["OPENMC_DEPLETE_CHAIN"] - except KeyError: - self.chain_file = None - self.output_dir = '.' - self.dilute_initial = 1.0e3 - - @property - def output_dir(self): - return self._output_dir - - @output_dir.setter - def output_dir(self, output_dir): - self._output_dir = Path(output_dir) - +from .chain import Chain OperatorResult = namedtuple('OperatorResult', ['k', 'rates']) @@ -52,14 +17,30 @@ OperatorResult = namedtuple('OperatorResult', ['k', 'rates']) class Operator(metaclass=ABCMeta): """Abstract class defining a transport operator + Parameters + ---------- + chain_file : str, optional + + Attributes ---------- - settings : Settings - Settings object. + dilute_initial : float + Initial atom density to add for nuclides that are zero in initial + condition to ensure they exist in the decay chain. Only done for + nuclides with reaction rates. Defaults to 1.0e3. """ - def __init__(self, settings): - self.settings = settings + def __init__(self, chain_file=None): + self.dilute_initial = 1.0e3 + self.output_dir = '.' + + # Read depletion chain + if chain_file is None: + chain_file = os.environ.get("OPENMC_DEPLETE_CHAIN", None) + if chain_file is None: + raise IOError("No chain specified, either manually or in " + "environment variable OPENMC_DEPLETE_CHAIN.") + self.chain = Chain.from_xml(chain_file) @abstractmethod def __call__(self, vec, print_out=True): @@ -83,11 +64,11 @@ class Operator(metaclass=ABCMeta): def __enter__(self): # Save current directory and move to specific output directory self._orig_dir = os.getcwd() - if not self.settings.output_dir.exists(): - self.settings.output_dir.mkdir() # exist_ok parameter is 3.5+ + if not self.output_dir.exists(): + self.output_dir.mkdir() # exist_ok parameter is 3.5+ # In Python 3.6+, chdir accepts a Path directly - os.chdir(str(self.settings.output_dir)) + os.chdir(str(self.output_dir)) return self.initial_condition() @@ -95,6 +76,14 @@ class Operator(metaclass=ABCMeta): self.finalize() os.chdir(self._orig_dir) + @property + def output_dir(self): + return self._output_dir + + @output_dir.setter + def output_dir(self, output_dir): + self._output_dir = Path(output_dir) + @abstractmethod def initial_condition(self): """Performs final setup and returns initial condition. diff --git a/openmc/deplete/chain.py b/openmc/deplete/chain.py index ec8d79f819..9ffc3d93ec 100644 --- a/openmc/deplete/chain.py +++ b/openmc/deplete/chain.py @@ -328,15 +328,7 @@ class Chain(object): chain = cls() # Load XML tree - try: - root = ET.parse(filename) - except Exception: - if filename is None: - msg = ("No chain specified, either manually or in environment " - "variable OPENMC_DEPLETE_CHAIN.") - else: - msg = 'Decay chain "{}" is invalid.'.format(filename) - raise IOError(msg) + root = ET.parse(str(filename)) for i, nuclide_elem in enumerate(root.findall('nuclide_table')): nuc = Nuclide.from_xml(nuclide_elem) @@ -367,10 +359,10 @@ class Chain(object): tree = ET.ElementTree(root_elem) if _have_lxml: - tree.write(filename, encoding='utf-8', pretty_print=True) + tree.write(str(filename), encoding='utf-8', pretty_print=True) else: clean_xml_indentation(root_elem) - tree.write(filename, encoding='utf-8') + tree.write(str(filename), encoding='utf-8') def form_matrix(self, rates): """Forms depletion matrix. diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index e5898997bc..12ed27f229 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -24,9 +24,8 @@ import openmc import openmc.capi from openmc.data import JOULE_PER_EV from . import comm -from .abc import Settings, Operator, OperatorResult +from .abc import Operator, OperatorResult from .atom_number import AtomNumber -from .chain import Chain from .reaction_rates import ReactionRates @@ -40,77 +39,34 @@ def _distribute(items): j += chunk_size -class OpenMCSettings(Settings): - """Extends Settings to provide information OpenMC needs to run. - - Attributes - ---------- - output_dir : pathlib.Path - Path to output directory to save results. - chain_file : str - Path to the depletion chain XML file. Defaults to the - :envvar:`OPENMC_DEPLETE_CHAIN` environment variable if it exists. - dilute_initial : float - Initial atom density to add for nuclides that are zero in initial - condition to ensure they exist in the decay chain. Only done for - nuclides with reaction rates. Defaults to 1.0e3. - power : float - Power of the reactor in [W]. For a 2D problem, the power can be given in - W/cm as long as the "volume" assigned to a depletion material is - actually an area in cm^2. - round_number : bool - Whether or not to round output to OpenMC to 8 digits. - Useful in testing, as OpenMC is incredibly sensitive to exact values. - settings : openmc.Settings - Settings for OpenMC simulations - - """ - - _depletion_attrs = {'_output_dir', 'chain_file', 'dilute_initial', - 'round_number'} - - def __init__(self): - super().__init__() - self.round_number = False - - # Avoid setattr to create OpenMC settings - self.__dict__['settings'] = openmc.Settings() - - def __setattr__(self, name, value): - if hasattr(self.__class__, name): - # Use properties when appropriate - prop = getattr(self.__class__, name) - prop.fset(self, value) - elif name in self._depletion_attrs: - # For known attributes, store in dictionary - self.__dict__[name] = value - else: - # otherwise, delegate to openmc.Settings - setattr(self.__dict__['settings'], name, value) - - def __getattr__(self, name): - if name in self._depletion_attrs: - return self.__dict__[name] - else: - return getattr(self.__dict__['settings'], name) - - class OpenMCOperator(Operator): """OpenMC transport operator Parameters ---------- geometry : openmc.Geometry - The OpenMC geometry object. - settings : openmc.deplete.OpenMCSettings - Settings object. + OpenMC geometry object + settings : openmc.Settings + OpenMC Settings object + chain_file : str, optional + Path to the depletion chain XML file. Defaults to the + :envvar:`OPENMC_DEPLETE_CHAIN` environment variable if it exists. Attributes ---------- - settings : OpenMCSettings - Settings object. (From Operator) geometry : openmc.Geometry - The OpenMC geometry object. + OpenMC geometry object + settings : openmc.Settings + OpenMC settings object + dilute_initial : float + Initial atom density to add for nuclides that are zero in initial + condition to ensure they exist in the decay chain. Only done for + nuclides with reaction rates. Defaults to 1.0e3. + output_dir : pathlib.Path + Path to output directory to save results. + round_number : bool + Whether or not to round output to OpenMC to 8 digits. + Useful in testing, as OpenMC is incredibly sensitive to exact values. number : openmc.deplete.AtomNumber Total number of atoms in simulation. nuclides_with_data : set of str @@ -125,13 +81,12 @@ class OpenMCOperator(Operator): All burnable material IDs being managed by a single process """ - def __init__(self, geometry, settings): - super().__init__(settings) + def __init__(self, geometry, settings, chain_file=None): + super().__init__(chain_file) + self.round_number = False + self.settings = settings self.geometry = geometry - # Read depletion chain - self.chain = Chain.from_xml(settings.chain_file) - # Clear out OpenMC, create task lists, distribute openmc.reset_auto_ids() self.burnable_mats, volume, nuclides = self._get_burnable_mats() @@ -253,10 +208,9 @@ class OpenMCOperator(Operator): """ self.number = AtomNumber(local_mats, nuclides, volume, len(self.chain)) - if self.settings.dilute_initial != 0.0: + if self.dilute_initial != 0.0: for nuc in self._burnable_nucs: - self.number.set_atom_density(np.s_[:], nuc, - self.settings.dilute_initial) + self.number.set_atom_density(np.s_[:], nuc, self.dilute_initial) # Now extract the number densities and store for mat in self.geometry.get_all_materials().values(): @@ -290,7 +244,7 @@ class OpenMCOperator(Operator): # Create XML files if comm.rank == 0: self.geometry.export_to_xml() - self.settings.settings.export_to_xml() + self.settings.export_to_xml() self._generate_materials_xml() # Initialize OpenMC library @@ -322,7 +276,7 @@ class OpenMCOperator(Operator): # If nuclide is zero, do not add to the problem. if val > 0.0: - if self.settings.round_number: + if self.round_number: val_magnitude = np.floor(np.log10(val)) val_scaled = val / 10**val_magnitude val_round = round(val_scaled, 8) diff --git a/tests/dummy_geometry.py b/tests/dummy_geometry.py index d662616698..ca2efd6630 100644 --- a/tests/dummy_geometry.py +++ b/tests/dummy_geometry.py @@ -17,9 +17,8 @@ class DummyGeometry(Operator): y_2(1.5) ~ 3.1726475740397628 """ - - def __init__(self, settings): - super().__init__(settings) + def __init__(self): + pass def __call__(self, vec, power, print_out=False): """Evaluates F(y) diff --git a/tests/regression_tests/test_deplete_full.py b/tests/regression_tests/test_deplete_full.py index 1ae2cee1fa..22125d039d 100644 --- a/tests/regression_tests/test_deplete_full.py +++ b/tests/regression_tests/test_deplete_full.py @@ -32,13 +32,8 @@ def test_full(run_in_tmpdir): # Load geometry from example geometry, lower_left, upper_right = generate_problem(n_rings, n_wedges) - # Depletion settings - settings = openmc.deplete.OpenMCSettings() - settings.chain_file = str(Path(__file__).parents[2] / 'chains' / - 'chain_simple.xml') - settings.round_number = True - - # Add OpenMC-specific settings + # OpenMC-specific settings + settings = openmc.Settings() settings.particles = 100 settings.batches = 100 settings.inactive = 40 @@ -47,7 +42,10 @@ def test_full(run_in_tmpdir): settings.seed = 1 settings.verbosity = 3 - op = openmc.deplete.OpenMCOperator(geometry, settings) + # Create operator + chain_file = Path(__file__).parents[2] / 'chains' / 'chain_simple.xml' + op = openmc.deplete.OpenMCOperator(geometry, settings, chain_file) + op.round_number = True # Power and timesteps dt1 = 15.*24*60*60 # 15 days @@ -60,7 +58,7 @@ def test_full(run_in_tmpdir): openmc.deplete.integrator.predictor(op, dt, power) # Get path to test and reference results - path_test = settings.output_dir / 'depletion_results.h5' + path_test = op.output_dir / 'depletion_results.h5' path_reference = Path(__file__).with_name('test_reference.h5') # If updating results, do so and return diff --git a/tests/unit_tests/test_deplete_cecm.py b/tests/unit_tests/test_deplete_cecm.py index 3daa7a0489..97659b8923 100644 --- a/tests/unit_tests/test_deplete_cecm.py +++ b/tests/unit_tests/test_deplete_cecm.py @@ -14,10 +14,8 @@ from tests import dummy_geometry def test_cecm(run_in_tmpdir): """Integral regression test of integrator algorithm using CE/CM.""" - settings = openmc.deplete.Settings() - settings.output_dir = "test_integrator_regression" - - op = dummy_geometry.DummyGeometry(settings) + op = dummy_geometry.DummyGeometry() + op.output_dir = "test_integrator_regression" # Perform simulation using the MCNPX/MCNP6 algorithm dt = [0.75, 0.75] @@ -25,7 +23,7 @@ def test_cecm(run_in_tmpdir): openmc.deplete.cecm(op, dt, power, print_out=False) # Load the files - res = results.read_results(settings.output_dir / "depletion_results.h5") + res = results.read_results(op.output_dir / "depletion_results.h5") _, y1 = utilities.evaluate_single_nuclide(res, "1", "1") _, y2 = utilities.evaluate_single_nuclide(res, "1", "2") diff --git a/tests/unit_tests/test_deplete_predictor.py b/tests/unit_tests/test_deplete_predictor.py index be8497f5f7..42a3c13a3a 100644 --- a/tests/unit_tests/test_deplete_predictor.py +++ b/tests/unit_tests/test_deplete_predictor.py @@ -14,10 +14,8 @@ from tests import dummy_geometry def test_predictor(run_in_tmpdir): """Integral regression test of integrator algorithm using predictor/corrector""" - settings = openmc.deplete.Settings() - settings.output_dir = "test_integrator_regression" - - op = dummy_geometry.DummyGeometry(settings) + op = dummy_geometry.DummyGeometry() + op.output_dir = "test_integrator_regression" # Perform simulation using the predictor algorithm dt = [0.75, 0.75] @@ -25,7 +23,7 @@ def test_predictor(run_in_tmpdir): openmc.deplete.predictor(op, dt, power, print_out=False) # Load the files - res = results.read_results(settings.output_dir / "depletion_results.h5") + res = results.read_results(op.output_dir / "depletion_results.h5") _, y1 = utilities.evaluate_single_nuclide(res, "1", "1") _, y2 = utilities.evaluate_single_nuclide(res, "1", "2") From a9df0465f0d7344d7156473657a575badf354c77 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Feb 2018 22:51:53 -0600 Subject: [PATCH 061/231] Start cleaning up documentation --- docs/source/conf.py | 14 +++-- docs/source/pythonapi/deplete.rst | 62 +++++++++++++++++++ docs/source/pythonapi/deplete/index.rst | 54 ---------------- .../pythonapi/deplete/integrator.CRAM16.rst | 6 -- .../pythonapi/deplete/integrator.CRAM48.rst | 6 -- .../pythonapi/deplete/integrator.cecm.rst | 6 -- .../deplete/integrator.predictor.rst | 6 -- .../deplete/integrator.save_results.rst | 6 -- docs/source/pythonapi/index.rst | 6 +- openmc/deplete/abc.py | 22 ++++++- openmc/deplete/chain.py | 3 - openmc/deplete/integrator/cecm.py | 16 ++--- openmc/deplete/integrator/cram.py | 28 +++------ openmc/deplete/integrator/predictor.py | 4 +- openmc/deplete/integrator/save_results.py | 2 +- openmc/deplete/openmc_wrapper.py | 14 +++-- .../{dummy_geometry.py => dummy_operator.py} | 6 +- tests/regression_tests/test_deplete_full.py | 2 +- .../test_deplete_utilities.py | 2 +- tests/unit_tests/test_deplete_cecm.py | 4 +- tests/unit_tests/test_deplete_predictor.py | 4 +- 21 files changed, 131 insertions(+), 142 deletions(-) create mode 100644 docs/source/pythonapi/deplete.rst delete mode 100644 docs/source/pythonapi/deplete/index.rst delete mode 100644 docs/source/pythonapi/deplete/integrator.CRAM16.rst delete mode 100644 docs/source/pythonapi/deplete/integrator.CRAM48.rst delete mode 100644 docs/source/pythonapi/deplete/integrator.cecm.rst delete mode 100644 docs/source/pythonapi/deplete/integrator.predictor.rst delete mode 100644 docs/source/pythonapi/deplete/integrator.save_results.rst rename tests/{dummy_geometry.py => dummy_operator.py} (95%) diff --git a/docs/source/conf.py b/docs/source/conf.py index db44e34f4d..b25d5abbed 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -21,12 +21,14 @@ on_rtd = os.environ.get('READTHEDOCS', None) == 'True' 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', - 'scipy.stats', 'scipy.spatial', 'h5py', 'pandas', 'uncertainties', - 'matplotlib', 'matplotlib.pyplot','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', 'tqdm', 'openmoc', + 'openmc.data.reconstruct' +] sys.modules.update((mod_name, MagicMock()) for mod_name in MOCK_MODULES) import numpy as np diff --git a/docs/source/pythonapi/deplete.rst b/docs/source/pythonapi/deplete.rst new file mode 100644 index 0000000000..13f2fd1550 --- /dev/null +++ b/docs/source/pythonapi/deplete.rst @@ -0,0 +1,62 @@ +.. _pythonapi_deplete: + +---------------------------------- +:mod:`openmc.deplete` -- Depletion +---------------------------------- + +Integrators +----------- + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myfunction.rst + + openmc.deplete.integrator.predictor + openmc.deplete.integrator.cecm + +Integrator Helper Functions +--------------------------- + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myfunction.rst + + openmc.deplete.integrator.CRAM16 + openmc.deplete.integrator.CRAM48 + openmc.deplete.integrator.save_results + +Metaclasses +----------- + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst + + openmc.deplete.TransportOperator + +OpenMC Classes +-------------- + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst + + openmc.deplete.Operator + openmc.deplete.OperatorResult + +Data Classes +------------ +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst + + openmc.deplete.AtomNumber + openmc.deplete.Chain + openmc.deplete.Nuclide + openmc.deplete.ReactionRates + openmc.deplete.Results diff --git a/docs/source/pythonapi/deplete/index.rst b/docs/source/pythonapi/deplete/index.rst deleted file mode 100644 index f3212bd61d..0000000000 --- a/docs/source/pythonapi/deplete/index.rst +++ /dev/null @@ -1,54 +0,0 @@ -.. _api: - -================= -API Documentation -================= - -Integrators ------------ - -.. toctree:: - :maxdepth: 2 - - integrator.predictor - integrator.cecm - -Integrator Helper Functions ---------------------------- -.. toctree:: - :maxdepth: 2 - - integrator.CRAM16 - integrator.CRAM48 - integrator.save_results - -Metaclasses ------------ - -.. autosummary:: - :toctree: generated - :nosignatures: - - openmc.deplete.Operator - -OpenMC Classes --------------- - -.. autosummary:: - :toctree: generated - :nosignatures: - - openmc.deplete.Materials - openmc.deplete.OpenMCOperator - -Data Classes ------------- -.. autosummary:: - :toctree: generated - :nosignatures: - - openmc.deplete.AtomNumber - openmc.deplete.Chain - openmc.deplete.Nuclide - openmc.deplete.ReactionRates - openmc.deplete.Results diff --git a/docs/source/pythonapi/deplete/integrator.CRAM16.rst b/docs/source/pythonapi/deplete/integrator.CRAM16.rst deleted file mode 100644 index a0dc648056..0000000000 --- a/docs/source/pythonapi/deplete/integrator.CRAM16.rst +++ /dev/null @@ -1,6 +0,0 @@ -integrator\.CRAM16 -================== - -.. currentmodule:: openmc.deplete.integrator - -.. autofunction:: CRAM16 diff --git a/docs/source/pythonapi/deplete/integrator.CRAM48.rst b/docs/source/pythonapi/deplete/integrator.CRAM48.rst deleted file mode 100644 index f9720f7ad9..0000000000 --- a/docs/source/pythonapi/deplete/integrator.CRAM48.rst +++ /dev/null @@ -1,6 +0,0 @@ -integrator\.CRAM48 -================== - -.. currentmodule:: openmc.deplete.integrator - -.. autofunction:: CRAM48 diff --git a/docs/source/pythonapi/deplete/integrator.cecm.rst b/docs/source/pythonapi/deplete/integrator.cecm.rst deleted file mode 100644 index 4851b20b34..0000000000 --- a/docs/source/pythonapi/deplete/integrator.cecm.rst +++ /dev/null @@ -1,6 +0,0 @@ -integrator\.cecm -================= - -.. currentmodule:: openmc.deplete.integrator - -.. autofunction:: cecm diff --git a/docs/source/pythonapi/deplete/integrator.predictor.rst b/docs/source/pythonapi/deplete/integrator.predictor.rst deleted file mode 100644 index 2243e77f71..0000000000 --- a/docs/source/pythonapi/deplete/integrator.predictor.rst +++ /dev/null @@ -1,6 +0,0 @@ -integrator\.predictor -===================== - -.. currentmodule:: openmc.deplete.integrator - -.. autofunction:: predictor diff --git a/docs/source/pythonapi/deplete/integrator.save_results.rst b/docs/source/pythonapi/deplete/integrator.save_results.rst deleted file mode 100644 index f9c830cd5b..0000000000 --- a/docs/source/pythonapi/deplete/integrator.save_results.rst +++ /dev/null @@ -1,6 +0,0 @@ -integrator\.save_results -======================== - -.. currentmodule:: openmc.deplete.integrator - -.. autofunction:: save_results diff --git a/docs/source/pythonapi/index.rst b/docs/source/pythonapi/index.rst index 862acb2384..3c28a21852 100644 --- a/docs/source/pythonapi/index.rst +++ b/docs/source/pythonapi/index.rst @@ -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 @@ -45,6 +46,7 @@ Modules base model examples + deplete mgxs stats data diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index 9d53f40bfd..53e71c1959 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -12,15 +12,33 @@ from abc import ABCMeta, abstractmethod from .chain import Chain OperatorResult = namedtuple('OperatorResult', ['k', 'rates']) +OperatorResult.__doc__ = """\ +Result of applying transport operator + +Parameters +---------- +k : float + Resulting eigenvalue +rates : openmc.deplete.ReactionRates + Resulting reaction rates + +""" -class Operator(metaclass=ABCMeta): +class TransportOperator(metaclass=ABCMeta): """Abstract class defining a transport operator + Each depletion integrator is written to work with a generic transport + operator that takes a vector of material compositions and returns an + eigenvalue and reaction rates. This abstract class sets the requirements for + such a transport operator. Users should instantiate + :class:`openmc.deplete.Operator` rather than this class. + Parameters ---------- chain_file : str, optional - + Path to the depletion chain XML file. Defaults to the + :envvar:`OPENMC_DEPLETE_CHAIN` environment variable if it exists. Attributes ---------- diff --git a/openmc/deplete/chain.py b/openmc/deplete/chain.py index 9ffc3d93ec..348103ea94 100644 --- a/openmc/deplete/chain.py +++ b/openmc/deplete/chain.py @@ -321,9 +321,6 @@ class Chain(object): filename : str The path to the depletion chain XML file. - Todo - ---- - Allow for branching on capture, etc. """ chain = cls() diff --git a/openmc/deplete/integrator/cecm.py b/openmc/deplete/integrator/cecm.py index 7d6c11190f..db58d5d527 100644 --- a/openmc/deplete/integrator/cecm.py +++ b/openmc/deplete/integrator/cecm.py @@ -8,10 +8,11 @@ from .save_results import save_results def cecm(operator, timesteps, power, print_out=True): - r"""The CE/CM integrator. + r"""Deplete using the CE/CM algorithm. - Implements the second order CE/CM Predictor-Corrector algorithm [ref]_. - This algorithm is mathematically defined as: + Implements the second order `CE/CM Predictor-Corrector algorithm + `_. This algorithm is mathematically + defined as: .. math:: y' &= A(y, t) y(t) @@ -24,17 +25,12 @@ def cecm(operator, timesteps, power, print_out=True): y_{n+1} &= \text{expm}(A_c h) y_n - .. [ref] - Isotalo, Aarno. "Comparison of Neutronics-Depletion Coupling Schemes - for Burnup Calculations-Continued Study." Nuclear Science and - Engineering 180.3 (2015): 286-300. - Parameters ---------- - operator : openmc.deplete.Operator + operator : openmc.deplete.TransportOperator The operator object to simulate on. timesteps : iterable of float - Array of timesteps in units of [s] + Array of timesteps in units of [s]. Note that values are not cumulative. power : float or iterable of float Power of the reactor in [W]. A single value indicates that the power is constant over all timesteps. An iterable indicates potentially different diff --git a/openmc/deplete/integrator/cram.py b/openmc/deplete/integrator/cram.py index 09207fbc6b..85954603a1 100644 --- a/openmc/deplete/integrator/cram.py +++ b/openmc/deplete/integrator/cram.py @@ -48,7 +48,7 @@ def deplete(chain, x, op_result, dt, print_out): # Use multiprocessing pool to distribute work with Pool() as pool: iters = zip(chains, vecs, rates, dts) - x_result = list(pool.starmap(cram_wrapper, iters)) + x_result = list(pool.starmap(_cram_wrapper, iters)) t_end = time.time() if comm.rank == 0: @@ -58,7 +58,7 @@ def deplete(chain, x, op_result, dt, print_out): return x_result -def cram_wrapper(chain, n0, rates, dt): +def _cram_wrapper(chain, n0, rates, dt): """Wraps depletion matrix creation / CRAM solve for multiprocess execution Parameters @@ -82,16 +82,11 @@ def cram_wrapper(chain, n0, rates, dt): def CRAM16(A, n0, dt): - """ Chebyshev Rational Approximation Method, order 16 + """Chebyshev Rational Approximation Method, order 16 Algorithm is the 16th order Chebyshev Rational Approximation Method, - implemented in the more stable incomplete partial fraction (IPF) form - [cram16]_. - - .. [cram16] - Pusa, Maria. "Higher-Order Chebyshev Rational Approximation Method and - Application to Burnup Equations." Nuclear Science and Engineering 182.3 - (2016). + implemented in the more stable `incomplete partial fraction (IPF) + `_ form. Parameters ---------- @@ -106,6 +101,7 @@ def CRAM16(A, n0, dt): ------- numpy.array Results of the matrix exponent. + """ alpha = np.array([+2.124853710495224e-16, @@ -144,16 +140,11 @@ def CRAM16(A, n0, dt): def CRAM48(A, n0, dt): - """ Chebyshev Rational Approximation Method, order 48 + """Chebyshev Rational Approximation Method, order 48 Algorithm is the 48th order Chebyshev Rational Approximation Method, - implemented in the more stable incomplete partial fraction (IPF) form - [cram48]_. - - .. [cram48] - Pusa, Maria. "Higher-Order Chebyshev Rational Approximation Method and - Application to Burnup Equations." Nuclear Science and Engineering 182.3 - (2016). + implemented in the more stable `incomplete partial fraction (IPF) + `_ form. Parameters ---------- @@ -168,6 +159,7 @@ def CRAM48(A, n0, dt): ------- numpy.array Results of the matrix exponent. + """ theta_r = np.array([-4.465731934165702e+1, -5.284616241568964e+0, diff --git a/openmc/deplete/integrator/predictor.py b/openmc/deplete/integrator/predictor.py index 038c0778da..444ca7baa7 100644 --- a/openmc/deplete/integrator/predictor.py +++ b/openmc/deplete/integrator/predictor.py @@ -22,10 +22,10 @@ def predictor(operator, timesteps, power, print_out=True): Parameters ---------- - operator : openmc.deplete.Operator + operator : openmc.deplete.TransportOperator The operator object to simulate on. timesteps : iterable of float - Array of timesteps in units of [s] + Array of timesteps in units of [s]. Note that values are not cumulative. power : float or iterable of float Power of the reactor in [W]. A single value indicates that the power is constant over all timesteps. An iterable indicates potentially different diff --git a/openmc/deplete/integrator/save_results.py b/openmc/deplete/integrator/save_results.py index 8a0ae92040..40d2f70b63 100644 --- a/openmc/deplete/integrator/save_results.py +++ b/openmc/deplete/integrator/save_results.py @@ -9,7 +9,7 @@ def save_results(op, x, op_results, t, step_ind): Parameters ---------- - op : openmc.deplete.Operator + op : openmc.deplete.TransportOperator The operator used to generate these results. x : list of list of numpy.array The prior x vectors. Indexed [i][cell] using the above equation. diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/openmc_wrapper.py index 12ed27f229..5104ab2f17 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/openmc_wrapper.py @@ -1,6 +1,10 @@ -"""The OpenMC wrapper module. +"""OpenMC transport operator + +This module implements a transport operator for OpenMC so that it can be used by +depletion integrators. The implementation makes use of the Python bindings to +OpenMC's C API so that reading tally results and updating material number +densities is all done in-memory instead of through the filesystem. -This module implements the depletion -> OpenMC linkage. """ import copy @@ -24,7 +28,7 @@ import openmc import openmc.capi from openmc.data import JOULE_PER_EV from . import comm -from .abc import Operator, OperatorResult +from .abc import TransportOperator, OperatorResult from .atom_number import AtomNumber from .reaction_rates import ReactionRates @@ -39,8 +43,8 @@ def _distribute(items): j += chunk_size -class OpenMCOperator(Operator): - """OpenMC transport operator +class Operator(TransportOperator): + """OpenMC transport operator for depletion Parameters ---------- diff --git a/tests/dummy_geometry.py b/tests/dummy_operator.py similarity index 95% rename from tests/dummy_geometry.py rename to tests/dummy_operator.py index ca2efd6630..706793d93f 100644 --- a/tests/dummy_geometry.py +++ b/tests/dummy_operator.py @@ -1,11 +1,11 @@ import numpy as np import scipy.sparse as sp from openmc.deplete.reaction_rates import ReactionRates -from openmc.deplete.abc import Operator, OperatorResult +from openmc.deplete.abc import TransportOperator, OperatorResult -class DummyGeometry(Operator): - """This is a dummy geometry class with no statistical uncertainty. +class DummyOperator(TransportOperator): + """This is a dummy operator class with no statistical uncertainty. y_1' = sin(y_2) y_1 + cos(y_1) y_2 y_2' = -cos(y_2) y_1 + sin(y_1) y_2 diff --git a/tests/regression_tests/test_deplete_full.py b/tests/regression_tests/test_deplete_full.py index 22125d039d..2286af908a 100644 --- a/tests/regression_tests/test_deplete_full.py +++ b/tests/regression_tests/test_deplete_full.py @@ -44,7 +44,7 @@ def test_full(run_in_tmpdir): # Create operator chain_file = Path(__file__).parents[2] / 'chains' / 'chain_simple.xml' - op = openmc.deplete.OpenMCOperator(geometry, settings, chain_file) + op = openmc.deplete.Operator(geometry, settings, chain_file) op.round_number = True # Power and timesteps diff --git a/tests/regression_tests/test_deplete_utilities.py b/tests/regression_tests/test_deplete_utilities.py index f38129cc79..82d4d56a4c 100644 --- a/tests/regression_tests/test_deplete_utilities.py +++ b/tests/regression_tests/test_deplete_utilities.py @@ -14,7 +14,7 @@ from openmc.deplete import utilities @pytest.fixture def res(): """Load the reference results""" - filename = str(Path(__file__).with_name('test_reference.h5')) + filename = Path(__file__).with_name('test_reference.h5') return results.read_results(filename) diff --git a/tests/unit_tests/test_deplete_cecm.py b/tests/unit_tests/test_deplete_cecm.py index 97659b8923..6deb6cd3dd 100644 --- a/tests/unit_tests/test_deplete_cecm.py +++ b/tests/unit_tests/test_deplete_cecm.py @@ -8,13 +8,13 @@ import openmc.deplete from openmc.deplete import results from openmc.deplete import utilities -from tests import dummy_geometry +from tests import dummy_operator def test_cecm(run_in_tmpdir): """Integral regression test of integrator algorithm using CE/CM.""" - op = dummy_geometry.DummyGeometry() + op = dummy_operator.DummyOperator() op.output_dir = "test_integrator_regression" # Perform simulation using the MCNPX/MCNP6 algorithm diff --git a/tests/unit_tests/test_deplete_predictor.py b/tests/unit_tests/test_deplete_predictor.py index 42a3c13a3a..0d283855cb 100644 --- a/tests/unit_tests/test_deplete_predictor.py +++ b/tests/unit_tests/test_deplete_predictor.py @@ -8,13 +8,13 @@ import openmc.deplete from openmc.deplete import results from openmc.deplete import utilities -from tests import dummy_geometry +from tests import dummy_operator def test_predictor(run_in_tmpdir): """Integral regression test of integrator algorithm using predictor/corrector""" - op = dummy_geometry.DummyGeometry() + op = dummy_operator.DummyOperator() op.output_dir = "test_integrator_regression" # Perform simulation using the predictor algorithm From c9f8daa0aba77274bdd7cf29c8c3a6ecb66970f6 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Feb 2018 23:17:50 -0600 Subject: [PATCH 062/231] Fix in ReactionRates class. More documentation updates --- openmc/deplete/__init__.py | 2 +- openmc/deplete/abc.py | 4 +- openmc/deplete/atom_number.py | 8 ++-- .../{openmc_wrapper.py => operator.py} | 26 ++++++++----- openmc/deplete/reaction_rates.py | 31 +++++++++++---- openmc/deplete/results.py | 2 +- openmc/deplete/utilities.py | 1 + tests/unit_tests/test_deplete_reaction.py | 38 +++++-------------- 8 files changed, 57 insertions(+), 55 deletions(-) rename openmc/deplete/{openmc_wrapper.py => operator.py} (98%) diff --git a/openmc/deplete/__init__.py b/openmc/deplete/__init__.py index 2467b973a9..33b6d9af14 100644 --- a/openmc/deplete/__init__.py +++ b/openmc/deplete/__init__.py @@ -16,7 +16,7 @@ except ImportError: from .nuclide import * from .chain import * -from .openmc_wrapper import * +from .operator import * from .reaction_rates import * from .abc import * from .results import * diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index 53e71c1959..f2fa736508 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -66,7 +66,7 @@ class TransportOperator(metaclass=ABCMeta): Parameters ---------- - vec : list of numpy.array + vec : list of numpy.ndarray Total atoms to be used in function. print_out : bool, optional Whether or not to print out time. @@ -108,7 +108,7 @@ class TransportOperator(metaclass=ABCMeta): Returns ------- - list of numpy.array + list of numpy.ndarray Total density for initial conditions. """ diff --git a/openmc/deplete/atom_number.py b/openmc/deplete/atom_number.py index 1a142676cb..5179224c24 100644 --- a/openmc/deplete/atom_number.py +++ b/openmc/deplete/atom_number.py @@ -55,7 +55,7 @@ class AtomNumber(object): self.n_nuc_burn = n_nuc_burn - self.number = np.zeros((len(local_mats), self.n_nuc)) + self.number = np.zeros((len(local_mats), len(nuclides))) def __getitem__(self, pos): """Retrieves total atom number from AtomNumber. @@ -69,7 +69,7 @@ class AtomNumber(object): Returns ------- - numpy.array + numpy.ndarray The value indexed from self.number. """ @@ -153,7 +153,7 @@ class AtomNumber(object): Material index. nuc : str, int or slice Nuclide index. - val : numpy.array + val : numpy.ndarray Array of densities to set in [atom/cm^3] """ @@ -190,7 +190,7 @@ class AtomNumber(object): ---------- mat : str, int or slice Material index. - val : numpy.array + val : numpy.ndarray The slice to set in [atom] """ diff --git a/openmc/deplete/openmc_wrapper.py b/openmc/deplete/operator.py similarity index 98% rename from openmc/deplete/openmc_wrapper.py rename to openmc/deplete/operator.py index 5104ab2f17..af08727eaa 100644 --- a/openmc/deplete/openmc_wrapper.py +++ b/openmc/deplete/operator.py @@ -11,15 +11,8 @@ import copy from collections import OrderedDict from itertools import chain import os -import random -import sys import time -try: - import lxml.etree as ET - _have_lxml = True -except ImportError: - import xml.etree.ElementTree as ET - _have_lxml = False +import xml.etree.ElementTree as ET import h5py import numpy as np @@ -34,6 +27,19 @@ from .reaction_rates import ReactionRates def _distribute(items): + """Distribute items across MPI communicator + + Parameters + ---------- + items : list + List of items of distribute + + Returns + ------- + list + Items assigned to process that called + + """ min_size, extra = divmod(len(items), comm.size) j = 0 for i in range(comm.size): @@ -114,7 +120,7 @@ class Operator(TransportOperator): Parameters ---------- - vec : list of numpy.array + vec : list of numpy.ndarray Total atoms to be used in function. power : float Power of the reactor in [W] @@ -241,7 +247,7 @@ class Operator(TransportOperator): Returns ------- - list of numpy.array + list of numpy.ndarray Total density for initial conditions. """ diff --git a/openmc/deplete/reaction_rates.py b/openmc/deplete/reaction_rates.py index d1e1b0f1e2..c66003530c 100644 --- a/openmc/deplete/reaction_rates.py +++ b/openmc/deplete/reaction_rates.py @@ -7,14 +7,16 @@ import numpy as np class ReactionRates(np.ndarray): - """ReactionRates class. + """Reaction rates resulting from a transport operator call - An ndarray to store reaction rates with string, integer, or slice indexing. + This class is a subclass of :class:`numpy.ndarray` with a few custom + attributes that make it easy to determine what index corresponds to a given + material, nuclide, and reaction rate. Parameters ---------- - index_mat : OrderedDict of str to int - A dictionary mapping material ID as string to index. + local_mats : list of str + Material IDs nuclides : list of str Depletable nuclides index_rx : OrderedDict of str to int @@ -36,14 +38,22 @@ class ReactionRates(np.ndarray): Number of reactions. """ - def __new__(cls, index_mat, nuclides, index_rx): + + # NumPy arrays can be created 1) explicitly 2) using view casting, and 3) by + # slicing an existing array. Because of these possibilities, it's necessary + # to put initialization logic in __new__ rather than __init__. Additionally, + # subclasses need to handle the multiple ways of creating arrays by using + # the __array_finalize__ method (discussed here: + # https://docs.scipy.org/doc/numpy/user/basics.subclassing.html) + + def __new__(cls, local_mats, nuclides, index_rx): # Create appropriately-sized zeroed-out ndarray - shape = (len(index_mat), len(nuclides), len(index_rx)) + shape = (len(local_mats), len(nuclides), len(index_rx)) obj = super().__new__(cls, shape) obj[:] = 0.0 # Add mapping attributes - obj.index_mat = index_mat + obj.index_mat = {mat: i for i, mat in enumerate(local_mats)} obj.index_nuc = {nuc: i for i, nuc in enumerate(nuclides)} obj.index_rx = index_rx @@ -56,6 +66,11 @@ class ReactionRates(np.ndarray): self.index_nuc = getattr(obj, 'index_nuc', None) self.index_rx = getattr(obj, 'index_rx', None) + # Reaction rates are distributed to other processes via multiprocessing, + # which entails pickling the objects. In order to preserve the custom + # attributes, we have to modify how the ndarray is pickled as described + # here: https://stackoverflow.com/a/26599346/1572453 + def __reduce__(self): state = super().__reduce__() new_state = state[2] + (self.index_mat, self.index_nuc, self.index_rx) @@ -69,7 +84,7 @@ class ReactionRates(np.ndarray): @property def n_mat(self): - """Number of cells.""" + """Number of materials.""" return len(self.index_mat) @property diff --git a/openmc/deplete/results.py b/openmc/deplete/results.py index e18051d9d8..177158dbe2 100644 --- a/openmc/deplete/results.py +++ b/openmc/deplete/results.py @@ -42,7 +42,7 @@ class Results(object): Number of materials in entire geometry. n_stages : int Number of stages in simulation. - data : numpy.array + data : numpy.ndarray Atom quantity, stored by stage, mat, then by nuclide. """ diff --git a/openmc/deplete/utilities.py b/openmc/deplete/utilities.py index d155f321d9..59d5305465 100644 --- a/openmc/deplete/utilities.py +++ b/openmc/deplete/utilities.py @@ -38,6 +38,7 @@ def evaluate_single_nuclide(results, mat, nuc): return time, concentration + def evaluate_reaction_rate(results, mat, nuc, rx): """Return reaction rate in a single material/nuclide from a results list. diff --git a/tests/unit_tests/test_deplete_reaction.py b/tests/unit_tests/test_deplete_reaction.py index de628f8c66..e46a7b13d7 100644 --- a/tests/unit_tests/test_deplete_reaction.py +++ b/tests/unit_tests/test_deplete_reaction.py @@ -7,11 +7,11 @@ from openmc.deplete import ReactionRates def test_get_set(): """Tests the get/set methods.""" - mat_to_ind = {"10000" : 0, "10001" : 1} - nuc_to_ind = {"U238" : 0, "U235" : 1} - react_to_ind = {"fission" : 0, "(n,gamma)" : 1} + local_mats = ["10000", "10001"] + nuclides = ["U238", "U235"] + react_to_ind = {"fission": 0, "(n,gamma)": 1} - rates = ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) + rates = ReactionRates(local_mats, nuclides, react_to_ind) assert rates.shape == (2, 2, 2) assert np.all(rates == 0.0) @@ -50,34 +50,14 @@ def test_get_set(): assert rates.get("10000", "U238", "fission") == 5.0 -def test_n_mat(): +def test_properties(): """Test number of materials property.""" - mat_to_ind = {"10000" : 0, "10001" : 1} - nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} - react_to_ind = {"fission" : 0, "(n,gamma)" : 1, "(n,2n)" : 2, "(n,3n)" : 3} + local_mats = ["10000", "10001"] + nuclides = ["U238", "U235", "Gd157"] + react_to_ind = {"fission": 0, "(n,gamma)": 1, "(n,2n)": 2, "(n,3n)": 3} - rates = ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) + rates = ReactionRates(local_mats, nuclides, react_to_ind) assert rates.n_mat == 2 - - -def test_n_nuc(): - """Test number of nuclides property.""" - mat_to_ind = {"10000" : 0, "10001" : 1} - nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} - react_to_ind = {"fission" : 0, "(n,gamma)" : 1, "(n,2n)" : 2, "(n,3n)" : 3} - - rates = ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) - assert rates.n_nuc == 3 - - -def test_n_react(): - """ Test number of reactions property. """ - mat_to_ind = {"10000" : 0, "10001" : 1} - nuc_to_ind = {"U238" : 0, "U235" : 1, "Gd157" : 2} - react_to_ind = {"fission" : 0, "(n,gamma)" : 1, "(n,2n)" : 2, "(n,3n)" : 3} - - rates = ReactionRates(mat_to_ind, nuc_to_ind, react_to_ind) - assert rates.n_react == 4 From 236e7f8b9e626347eff4395508c0b95efe97493a Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 20 Feb 2018 00:05:53 -0600 Subject: [PATCH 063/231] Add format spec for depletion chain XML file --- chains/chain_simple.xml | 54 +++++------ chains/chain_test.xml | 32 +++---- docs/source/io_formats/depletion_chain.rst | 102 +++++++++++++++++++++ docs/source/io_formats/index.rst | 1 + openmc/deplete/chain.py | 4 +- openmc/deplete/nuclide.py | 14 +-- tests/unit_tests/test_deplete_nuclide.py | 22 ++--- 7 files changed, 166 insertions(+), 63 deletions(-) create mode 100644 docs/source/io_formats/depletion_chain.rst diff --git a/chains/chain_simple.xml b/chains/chain_simple.xml index 345da2237d..c2e50a370f 100644 --- a/chains/chain_simple.xml +++ b/chains/chain_simple.xml @@ -1,23 +1,23 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + 2.53000e-02 @@ -25,9 +25,9 @@ 1.093250e-04 2.087260e-04 2.780820e-02 6.759540e-03 2.392300e-02 4.356330e-05 - - - + + + 2.53000e-02 @@ -35,9 +35,9 @@ 6.142710e-5 1.483250e-04 0.0292737 0.002566345 0.0219242 4.9097e-6 - - - + + + 2.53000e-02 @@ -45,5 +45,5 @@ 4.141120e-04 7.605360e-04 0.0135457 0.00026864 0.0024432 3.7100E-07 - - + + diff --git a/chains/chain_test.xml b/chains/chain_test.xml index 5985704063..c8c75ad7b3 100644 --- a/chains/chain_test.xml +++ b/chains/chain_test.xml @@ -1,17 +1,17 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + 0.0253 @@ -19,5 +19,5 @@ 0.0292737 0.002566345 - - + + diff --git a/docs/source/io_formats/depletion_chain.rst b/docs/source/io_formats/depletion_chain.rst new file mode 100644 index 0000000000..00d95bdf58 --- /dev/null +++ b/docs/source/io_formats/depletion_chain.rst @@ -0,0 +1,102 @@ +.. _io_chain: + +============================ +Depletion Chain -- chain.xml +============================ + +A depletion chain file has a ```` root element with one or more +```` child elements. The decay, reaction, and fission product data for +each nuclide appears as child elements of ````. + +--------------------- +```` Element +--------------------- + +The ```` 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 +````. For each reaction present, a :ref:`io_chain_reaction` appears as +a child of ````. If the nuclide is fissionable, a :ref:`io_chain_nfy` +appears as well. + +.. _io_chain_decay: + +------------------- +```` Element +------------------- + +The ```` 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: + +---------------------- +```` Element +---------------------- + +The ```` 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: + +------------------------------------ +```` Element +------------------------------------ + +The ```` 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 diff --git a/docs/source/io_formats/index.rst b/docs/source/io_formats/index.rst index f3eea21def..1068973332 100644 --- a/docs/source/io_formats/index.rst +++ b/docs/source/io_formats/index.rst @@ -30,6 +30,7 @@ Data Files :maxdepth: 2 cross_sections + depletion_chain nuclear_data mgxs_library data_wmp diff --git a/openmc/deplete/chain.py b/openmc/deplete/chain.py index 348103ea94..0cd3fb0d7e 100644 --- a/openmc/deplete/chain.py +++ b/openmc/deplete/chain.py @@ -327,7 +327,7 @@ class Chain(object): # Load XML tree root = ET.parse(str(filename)) - for i, nuclide_elem in enumerate(root.findall('nuclide_table')): + for i, nuclide_elem in enumerate(root.findall('nuclide')): nuc = Nuclide.from_xml(nuclide_elem) chain.nuclide_dict[nuc.name] = i @@ -350,7 +350,7 @@ class Chain(object): """ - root_elem = ET.Element('depletion') + root_elem = ET.Element('depletion_chain') for nuclide in self.nuclides: root_elem.append(nuclide.to_xml_element()) diff --git a/openmc/deplete/nuclide.py b/openmc/deplete/nuclide.py index 17cf4d9b8f..4a7b86f029 100644 --- a/openmc/deplete/nuclide.py +++ b/openmc/deplete/nuclide.py @@ -23,9 +23,9 @@ class Nuclide(object): name : str Name of nuclide. half_life : float - Half life of nuclide in s^-1. + Half life of nuclide in [s]. decay_energy : float - Energy deposited from decay in eV. + Energy deposited from decay in [eV]. n_decay_modes : int Number of decay pathways. decay_modes : list of DecayTuple @@ -94,14 +94,14 @@ class Nuclide(object): nuc.decay_energy = float(element.get('decay_energy', '0')) # Check for decay paths - for decay_elem in element.iter('decay_type'): + for decay_elem in element.iter('decay'): d_type = decay_elem.get('type') target = decay_elem.get('target') branching_ratio = float(decay_elem.get('branching_ratio')) nuc.decay_modes.append(DecayTuple(d_type, target, branching_ratio)) # Check for reaction paths - for reaction_elem in element.iter('reaction_type'): + for reaction_elem in element.iter('reaction'): r_type = reaction_elem.get('type') Q = float(reaction_elem.get('Q', '0')) branching_ratio = float(reaction_elem.get('branching_ratio', '1')) @@ -138,7 +138,7 @@ class Nuclide(object): XML element to write nuclide data to """ - elem = ET.Element('nuclide_table') + elem = ET.Element('nuclide') elem.set('name', self.name) if self.half_life is not None: @@ -146,14 +146,14 @@ class Nuclide(object): elem.set('decay_modes', str(len(self.decay_modes))) elem.set('decay_energy', str(self.decay_energy)) for mode, daughter, br in self.decay_modes: - mode_elem = ET.SubElement(elem, 'decay_type') + mode_elem = ET.SubElement(elem, 'decay') mode_elem.set('type', mode) mode_elem.set('target', daughter) mode_elem.set('branching_ratio', str(br)) elem.set('reactions', str(len(self.reactions))) for rx, daughter, Q, br in self.reactions: - rx_elem = ET.SubElement(elem, 'reaction_type') + rx_elem = ET.SubElement(elem, 'reaction') rx_elem.set('type', rx) rx_elem.set('Q', str(Q)) if rx != 'fission': diff --git a/tests/unit_tests/test_deplete_nuclide.py b/tests/unit_tests/test_deplete_nuclide.py index 2add13f866..f2a101d2a9 100644 --- a/tests/unit_tests/test_deplete_nuclide.py +++ b/tests/unit_tests/test_deplete_nuclide.py @@ -37,14 +37,14 @@ def test_from_xml(): """Test reading nuclide data from an XML element.""" data = """ - - - - - - - - + + + + + + + + 0.0253 @@ -52,7 +52,7 @@ def test_from_xml(): 0.062155 0.0497641 0.0481413 - + """ element = ET.fromstring(data) @@ -96,7 +96,7 @@ def test_to_xml_element(): assert element.get("half_life") == "0.123" - decay_elems = element.findall("decay_type") + decay_elems = element.findall("decay") assert len(decay_elems) == 2 assert decay_elems[0].get("type") == "beta-" assert decay_elems[0].get("target") == "B" @@ -105,7 +105,7 @@ def test_to_xml_element(): assert decay_elems[1].get("target") == "D" assert decay_elems[1].get("branching_ratio") == "0.01" - rx_elems = element.findall("reaction_type") + rx_elems = element.findall("reaction") assert len(rx_elems) == 2 assert rx_elems[0].get("type") == "fission" assert float(rx_elems[0].get("Q")) == 2.0e8 From f3758e5330490e4f90df99938bb76efd2e9cebb6 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 20 Feb 2018 07:41:50 -0600 Subject: [PATCH 064/231] Fix broken tests on Py3.4, 3.5 --- openmc/deplete/atom_number.py | 5 +++-- openmc/deplete/integrator/save_results.py | 4 ++-- openmc/deplete/operator.py | 3 +-- openmc/deplete/reaction_rates.py | 11 ++++++----- openmc/deplete/results.py | 21 ++++++++------------- tests/unit_tests/test_deplete_chain.py | 7 +++---- tests/unit_tests/test_deplete_integrator.py | 21 +++++++++------------ tests/unit_tests/test_deplete_reaction.py | 8 ++++---- 8 files changed, 36 insertions(+), 44 deletions(-) diff --git a/openmc/deplete/atom_number.py b/openmc/deplete/atom_number.py index 5179224c24..8f6a419113 100644 --- a/openmc/deplete/atom_number.py +++ b/openmc/deplete/atom_number.py @@ -2,6 +2,7 @@ An ndarray to store atom densities with string, integer, or slice indexing. """ +from collections import OrderedDict import numpy as np @@ -44,8 +45,8 @@ class AtomNumber(object): """ def __init__(self, local_mats, nuclides, volume, n_nuc_burn): - self.index_mat = {mat: i for i, mat in enumerate(local_mats)} - self.index_nuc = {nuc: i for i, nuc in enumerate(nuclides)} + self.index_mat = OrderedDict((mat, i) for i, mat in enumerate(local_mats)) + self.index_nuc = OrderedDict((nuc, i) for i, nuc in enumerate(nuclides)) self.volume = np.ones(len(local_mats)) for mat, val in volume.items(): diff --git a/openmc/deplete/integrator/save_results.py b/openmc/deplete/integrator/save_results.py index 40d2f70b63..98245fdeae 100644 --- a/openmc/deplete/integrator/save_results.py +++ b/openmc/deplete/integrator/save_results.py @@ -22,12 +22,12 @@ def save_results(op, x, op_results, t, step_ind): """ # Get indexing terms - vol_list, nuc_list, burn_list, full_burn_list = op.get_results_info() + vol_dict, nuc_list, burn_list, full_burn_list = op.get_results_info() # Create results stages = len(x) results = Results() - results.allocate(vol_list, nuc_list, burn_list, full_burn_list, stages) + results.allocate(vol_dict, nuc_list, burn_list, full_burn_list, stages) n_mat = len(burn_list) diff --git a/openmc/deplete/operator.py b/openmc/deplete/operator.py index af08727eaa..d0a64a06d3 100644 --- a/openmc/deplete/operator.py +++ b/openmc/deplete/operator.py @@ -111,9 +111,8 @@ class Operator(TransportOperator): self._extract_number(self.local_mats, volume, nuclides) # Create reaction rates array - index_rx = {rx: i for i, rx in enumerate(self.chain.reactions)} self.reaction_rates = ReactionRates( - self.local_mats, self._burnable_nucs, index_rx) + self.local_mats, self._burnable_nucs, self.chain.reactions) def __call__(self, vec, power, print_out=True): """Runs a simulation. diff --git a/openmc/deplete/reaction_rates.py b/openmc/deplete/reaction_rates.py index c66003530c..482c357a29 100644 --- a/openmc/deplete/reaction_rates.py +++ b/openmc/deplete/reaction_rates.py @@ -2,6 +2,7 @@ An ndarray to store reaction rates with string, integer, or slice indexing. """ +from collections import OrderedDict import numpy as np @@ -19,8 +20,8 @@ class ReactionRates(np.ndarray): Material IDs nuclides : list of str Depletable nuclides - index_rx : OrderedDict of str to int - A dictionary mapping reaction name as string to index. + reactions : list of str + Transmutation reactions being tracked Attributes ---------- @@ -46,16 +47,16 @@ class ReactionRates(np.ndarray): # the __array_finalize__ method (discussed here: # https://docs.scipy.org/doc/numpy/user/basics.subclassing.html) - def __new__(cls, local_mats, nuclides, index_rx): + def __new__(cls, local_mats, nuclides, reactions): # Create appropriately-sized zeroed-out ndarray - shape = (len(local_mats), len(nuclides), len(index_rx)) + shape = (len(local_mats), len(nuclides), len(reactions)) obj = super().__new__(cls, shape) obj[:] = 0.0 # Add mapping attributes obj.index_mat = {mat: i for i, mat in enumerate(local_mats)} obj.index_nuc = {nuc: i for i, nuc in enumerate(nuclides)} - obj.index_rx = index_rx + obj.index_rx = {rx: i for i, rx in enumerate(reactions)} return obj diff --git a/openmc/deplete/results.py b/openmc/deplete/results.py index 177158dbe2..307d18a405 100644 --- a/openmc/deplete/results.py +++ b/openmc/deplete/results.py @@ -76,16 +76,10 @@ class Results(object): """ self.volume = copy.deepcopy(volume) - self.nuc_to_ind = OrderedDict() - self.mat_to_ind = OrderedDict() + self.nuc_to_ind = {nuc: i for i, nuc in enumerate(nuc_list)} + self.mat_to_ind = {mat: i for i, mat in enumerate(burn_list)} self.mat_to_hdf5_ind = {mat: i for i, mat in enumerate(full_burn_list)} - for i, mat in enumerate(burn_list): - self.mat_to_ind[mat] = i - - for i, nuc in enumerate(nuc_list): - self.nuc_to_ind[nuc] = i - # Create storage array self.data = np.zeros((stages, self.n_mat, self.n_nuc)) @@ -123,8 +117,8 @@ class Results(object): ------- float The atoms for stage, mat, nuc - """ + """ stage, mat, nuc = pos if isinstance(mat, str): mat = self.mat_to_ind[mat] @@ -145,8 +139,8 @@ class Results(object): val : float The value to set data to. - """ + """ stage, mat, nuc = pos if isinstance(mat, str): mat = self.mat_to_ind[mat] @@ -162,8 +156,8 @@ class Results(object): ---------- handle : h5py.File or h5py.Group An hdf5 file or group type to store this in. - """ + """ # Create and save the 5 dictionaries: # quantities # self.mat_to_ind -> self.volume (TODO: support for changing volumes) @@ -234,8 +228,8 @@ class Results(object): An hdf5 file or group type to store this in. index : int What step is this? - """ + """ if "/number" not in handle: comm.barrier() self.create_hdf5(handle) @@ -299,6 +293,7 @@ class Results(object): An hdf5 file or group type to load from. index : int What step is this? + """ results = cls() @@ -357,8 +352,8 @@ def write_results(result, filename, index): Target filename. index : int What step is this? - """ + """ if have_mpi and h5py.get_config().mpi: kwargs = {'driver': 'mpio', 'comm': comm} else: diff --git a/tests/unit_tests/test_deplete_chain.py b/tests/unit_tests/test_deplete_chain.py index ae900e62d7..7ac3e2f8dd 100644 --- a/tests/unit_tests/test_deplete_chain.py +++ b/tests/unit_tests/test_deplete_chain.py @@ -136,11 +136,10 @@ def test_form_matrix(): chain = Chain.from_xml(_test_filename) - mat_ind = {"10000": 0, "10001": 1} - nuc_ind = {"A": 0, "B": 1, "C": 2} - react_ind = {rx: i for i, rx in enumerate(chain.reactions)} + mats = ["10000", "10001"] + nuclides = ["A", "B", "C"] - react = reaction_rates.ReactionRates(mat_ind, nuc_ind, react_ind) + react = reaction_rates.ReactionRates(mats, nuclides, chain.reactions) react.set("10000", "C", "fission", 1.0) react.set("10000", "A", "(n,gamma)", 2.0) diff --git a/tests/unit_tests/test_deplete_integrator.py b/tests/unit_tests/test_deplete_integrator.py index 78dd6bcef2..b209900889 100644 --- a/tests/unit_tests/test_deplete_integrator.py +++ b/tests/unit_tests/test_deplete_integrator.py @@ -26,20 +26,18 @@ def test_save_results(run_in_tmpdir): op = MagicMock() vol_dict = {} - full_burn_dict = {} + full_burn_list = [] - j = 0 for i in range(comm.size): vol_dict[str(2*i)] = 1.2 vol_dict[str(2*i + 1)] = 1.2 - full_burn_dict[str(2*i)] = j - full_burn_dict[str(2*i + 1)] = j + 1 - j += 2 + full_burn_list.append(str(2*i)) + full_burn_list.append(str(2*i + 1)) - burn_list = [str(i) for i in range(2*comm.rank, 2*comm.rank + 2)] + burn_list = full_burn_list[2*comm.rank : 2*comm.rank + 2] nuc_list = ["na", "nb"] - op.get_results_info.return_value = vol_dict, nuc_list, burn_list, full_burn_dict + op.get_results_info.return_value = vol_dict, nuc_list, burn_list, full_burn_list # Construct x x1 = [] @@ -50,18 +48,17 @@ def test_save_results(run_in_tmpdir): x2.append([np.random.rand(2), np.random.rand(2)]) # Construct r - cell_dict = {s: i for i, s in enumerate(burn_list)} - r1 = ReactionRates(cell_dict, {"na": 0, "nb": 1}, {"ra": 0, "rb": 1}) - r1.rates = np.random.rand(2, 2, 2) + r1 = ReactionRates(burn_list, ["na", "nb"], ["ra", "rb"]) + r1[:] = np.random.rand(2, 2, 2) rate1 = [] rate2 = [] for i in range(stages): rate1.append(copy.deepcopy(r1)) - r1.rates = np.random.rand(2, 2, 2) + r1[:] = np.random.rand(2, 2, 2) rate2.append(copy.deepcopy(r1)) - r1.rates = np.random.rand(2, 2, 2) + r1[:] = np.random.rand(2, 2, 2) # Create global terms eigvl1 = np.random.rand(stages) diff --git a/tests/unit_tests/test_deplete_reaction.py b/tests/unit_tests/test_deplete_reaction.py index e46a7b13d7..18639a27a1 100644 --- a/tests/unit_tests/test_deplete_reaction.py +++ b/tests/unit_tests/test_deplete_reaction.py @@ -9,9 +9,9 @@ def test_get_set(): local_mats = ["10000", "10001"] nuclides = ["U238", "U235"] - react_to_ind = {"fission": 0, "(n,gamma)": 1} + reactions = ["fission", "(n,gamma)"] - rates = ReactionRates(local_mats, nuclides, react_to_ind) + rates = ReactionRates(local_mats, nuclides, reactions) assert rates.shape == (2, 2, 2) assert np.all(rates == 0.0) @@ -54,9 +54,9 @@ def test_properties(): """Test number of materials property.""" local_mats = ["10000", "10001"] nuclides = ["U238", "U235", "Gd157"] - react_to_ind = {"fission": 0, "(n,gamma)": 1, "(n,2n)": 2, "(n,3n)": 3} + reactions = ["fission", "(n,gamma)", "(n,2n)", "(n,3n)"] - rates = ReactionRates(local_mats, nuclides, react_to_ind) + rates = ReactionRates(local_mats, nuclides, reactions) assert rates.n_mat == 2 assert rates.n_nuc == 3 From 4aae63ff770d9db1d70b175ada41e24a867b3737 Mon Sep 17 00:00:00 2001 From: Shikhar Kumar Date: Tue, 20 Feb 2018 14:38:45 -0500 Subject: [PATCH 065/231] Reorder printing calls to output CMFD data correctly --- src/output.F90 | 16 ++++++++++++---- src/simulation.F90 | 4 +++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/output.F90 b/src/output.F90 index 9a144721dc..11366b5c03 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -368,7 +368,7 @@ contains ! write out entropy info if (entropy_on) write(UNIT=OUTPUT_UNIT, FMT='(3X, F8.5)', ADVANCE='NO') & entropy % data(i) - + ! write out accumulated k-effective if after first active batch if (n > 1) then write(UNIT=OUTPUT_UNIT, FMT='(3X, F8.5," +/-",F8.5)', ADVANCE='NO') & @@ -376,6 +376,15 @@ contains else write(UNIT=OUTPUT_UNIT, FMT='(23X)', ADVANCE='NO') end if + + end subroutine print_batch_keff + +!=============================================================================== +! PRINT_BATCH_KEFF displays the last batch's tallied value of the neutron +! multiplication factor as well as the average value if we're in active batches +!=============================================================================== + + subroutine print_cmfd() ! write out cmfd keff if it is active and other display info if (cmfd_on) then @@ -396,11 +405,10 @@ contains cmfd % dom(current_batch) end select end if - ! next line write(UNIT=OUTPUT_UNIT, FMT=*) - - end subroutine print_batch_keff + + end subroutine print_cmfd !=============================================================================== ! PRINT_PLOT displays selected options for plotting diff --git a/src/simulation.F90 b/src/simulation.F90 index ef29e7832b..91c176b995 100644 --- a/src/simulation.F90 +++ b/src/simulation.F90 @@ -24,7 +24,8 @@ module simulation use nuclide_header, only: micro_xs, n_nuclides use output, only: header, print_columns, & print_batch_keff, print_generation, print_runtime, & - print_results, print_overlap_check, write_tallies + print_results, print_overlap_check, write_tallies, & + print_cmfd use particle_header, only: Particle use random_lcg, only: set_particle_seed use settings @@ -338,6 +339,7 @@ contains if (run_mode == MODE_EIGENVALUE) then ! Perform CMFD calculation if on if (cmfd_on) call execute_cmfd() + call print_cmfd() end if ! Check_triggers From 552a8b9c0c48adb124a79405c62bbaa66c849fc9 Mon Sep 17 00:00:00 2001 From: Shikhar Kumar Date: Tue, 20 Feb 2018 14:46:03 -0500 Subject: [PATCH 066/231] Add description of print_cmfd --- src/output.F90 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/output.F90 b/src/output.F90 index 11366b5c03..30219e98a2 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -368,7 +368,7 @@ contains ! write out entropy info if (entropy_on) write(UNIT=OUTPUT_UNIT, FMT='(3X, F8.5)', ADVANCE='NO') & entropy % data(i) - + ! write out accumulated k-effective if after first active batch if (n > 1) then write(UNIT=OUTPUT_UNIT, FMT='(3X, F8.5," +/-",F8.5)', ADVANCE='NO') & @@ -380,8 +380,9 @@ contains end subroutine print_batch_keff !=============================================================================== -! PRINT_BATCH_KEFF displays the last batch's tallied value of the neutron -! multiplication factor as well as the average value if we're in active batches +! PRINT_CMFD displays the CMFD related information to output after CMFD is +! executed. Will print blank line if CMFD is not on, to ensure consistent +! formatting of output columns !=============================================================================== subroutine print_cmfd() @@ -405,9 +406,10 @@ contains cmfd % dom(current_batch) end select end if + ! next line write(UNIT=OUTPUT_UNIT, FMT=*) - + end subroutine print_cmfd !=============================================================================== From f15f824c997aa214d11fb1efc85dc0604a17bcd6 Mon Sep 17 00:00:00 2001 From: Shikhar Kumar Date: Tue, 20 Feb 2018 14:48:36 -0500 Subject: [PATCH 067/231] Minor spacing fix --- src/output.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/output.F90 b/src/output.F90 index 30219e98a2..643a28b671 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -409,7 +409,7 @@ contains ! next line write(UNIT=OUTPUT_UNIT, FMT=*) - + end subroutine print_cmfd !=============================================================================== From 6fac1367ec15fc6ee45fcfd220be2205de2b5f88 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 20 Feb 2018 14:43:26 -0600 Subject: [PATCH 068/231] Improve depletion reference documentation --- docs/source/conf.py | 1 + docs/source/pythonapi/deplete.rst | 98 +++++++++++++++++-------------- openmc/deplete/abc.py | 2 + openmc/deplete/atom_number.py | 2 - openmc/deplete/chain.py | 7 +++ openmc/deplete/integrator/cecm.py | 2 +- openmc/deplete/nuclide.py | 50 +++++++++++++--- openmc/deplete/operator.py | 7 ++- openmc/deplete/reaction_rates.py | 3 - openmc/deplete/results.py | 86 +++++++++++++-------------- 10 files changed, 155 insertions(+), 103 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index b25d5abbed..a2fec39b75 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -32,6 +32,7 @@ MOCK_MODULES = [ sys.modules.update((mod_name, MagicMock()) for mod_name in MOCK_MODULES) import numpy as np +np.ndarray = MagicMock np.polynomial.Polynomial = MagicMock diff --git a/docs/source/pythonapi/deplete.rst b/docs/source/pythonapi/deplete.rst index 13f2fd1550..1d1a1c0ee5 100644 --- a/docs/source/pythonapi/deplete.rst +++ b/docs/source/pythonapi/deplete.rst @@ -4,59 +4,71 @@ :mod:`openmc.deplete` -- Depletion ---------------------------------- -Integrators ------------ +.. module:: openmc.deplete + +Two functions are provided that implement different time-integration algorithms +for depletion calculations. .. autosummary:: :toctree: generated :nosignatures: :template: myfunction.rst - openmc.deplete.integrator.predictor - openmc.deplete.integrator.cecm + integrator.predictor + integrator.cecm -Integrator Helper Functions ---------------------------- +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 + +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 + TransportOperator + +Each of the integrator functions also relies on a number of "helper" functions +as follows: .. autosummary:: :toctree: generated :nosignatures: :template: myfunction.rst - openmc.deplete.integrator.CRAM16 - openmc.deplete.integrator.CRAM48 - openmc.deplete.integrator.save_results - -Metaclasses ------------ - -.. autosummary:: - :toctree: generated - :nosignatures: - :template: myclass.rst - - openmc.deplete.TransportOperator - -OpenMC Classes --------------- - -.. autosummary:: - :toctree: generated - :nosignatures: - :template: myclass.rst - - openmc.deplete.Operator - openmc.deplete.OperatorResult - -Data Classes ------------- -.. autosummary:: - :toctree: generated - :nosignatures: - :template: myclass.rst - - openmc.deplete.AtomNumber - openmc.deplete.Chain - openmc.deplete.Nuclide - openmc.deplete.ReactionRates - openmc.deplete.Results + integrator.CRAM16 + integrator.CRAM48 + integrator.save_results diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index f2fa736508..8b42ee800e 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -23,6 +23,8 @@ rates : openmc.deplete.ReactionRates Resulting reaction rates """ +OperatorResult.k.__doc__ = None +OperatorResult.rates.__doc__ = None class TransportOperator(metaclass=ABCMeta): diff --git a/openmc/deplete/atom_number.py b/openmc/deplete/atom_number.py index 8f6a419113..9a32dfa3a0 100644 --- a/openmc/deplete/atom_number.py +++ b/openmc/deplete/atom_number.py @@ -113,12 +113,10 @@ class AtomNumber(object): @property def n_nuc(self): - """Number of nuclides.""" return len(self.index_nuc) @property def burnable_nuclides(self): - """All burnable nuclide names. Used for sorting the simulation.""" return [nuc for nuc, ind in self.index_nuc.items() if ind < self.n_nuc_burn] diff --git a/openmc/deplete/chain.py b/openmc/deplete/chain.py index 0cd3fb0d7e..23395329eb 100644 --- a/openmc/deplete/chain.py +++ b/openmc/deplete/chain.py @@ -111,6 +111,13 @@ def replace_missing(product, decay_data): class Chain(object): """Full representation of a depletion chain. + A depletion chain can be created by using the :meth:`from_endf` method which + requires a list of ENDF incident neutron, decay, and neutron fission product + yield sublibrary files. The depletion chain used during a depletion + simulation is indicated by either an argument to + :class:`openmc.deplete.Operator` or through the + :envvar:`OPENMC_DEPLETE_CHAIN` environment variable. + Attributes ---------- nuclides : list of openmc.deplete.Nuclide diff --git a/openmc/deplete/integrator/cecm.py b/openmc/deplete/integrator/cecm.py index db58d5d527..9a07cd198f 100644 --- a/openmc/deplete/integrator/cecm.py +++ b/openmc/deplete/integrator/cecm.py @@ -10,7 +10,7 @@ from .save_results import save_results def cecm(operator, timesteps, power, print_out=True): r"""Deplete using the CE/CM algorithm. - Implements the second order `CE/CM Predictor-Corrector algorithm + Implements the second order `CE/CM predictor-corrector algorithm `_. This algorithm is mathematically defined as: diff --git a/openmc/deplete/nuclide.py b/openmc/deplete/nuclide.py index 4a7b86f029..af10e5c2f9 100644 --- a/openmc/deplete/nuclide.py +++ b/openmc/deplete/nuclide.py @@ -9,14 +9,50 @@ try: except ImportError: import xml.etree.ElementTree as ET + DecayTuple = namedtuple('DecayTuple', 'type target branching_ratio') +DecayTuple.__doc__ = """\ +Decay mode information + +Parameters +---------- +type : str + Type of the decay mode, e.g., 'beta-' +target : str + Nuclide resulting from decay +branching_ratio : float + Branching ratio of the decay mode + +""" +DecayTuple.type.__doc__ = None +DecayTuple.target.__doc__ = None +DecayTuple.branching_ratio.__doc__ = None + + ReactionTuple = namedtuple('ReactionTuple', 'type target Q branching_ratio') +ReactionTuple.__doc__ = """\ +Transmutation reaction information + +Parameters +---------- +type : str + Type of the reaction, e.g., 'fission' +target : str + nuclide resulting from reaction +Q : float + Q value of the reaction in [eV] +branching_ratio : float + Branching ratio of the reaction + +""" +ReactionTuple.type.__doc__ = None +ReactionTuple.target.__doc__ = None +ReactionTuple.Q.__doc__ = None +ReactionTuple.branching_ratio.__doc__ = None class Nuclide(object): - """The Nuclide class. - - Contains everything in a depletion chain relating to a single nuclide. + """Decay modes, reactions, and fission yields for a single nuclide. Attributes ---------- @@ -28,12 +64,12 @@ class Nuclide(object): Energy deposited from decay in [eV]. n_decay_modes : int Number of decay pathways. - decay_modes : list of DecayTuple + decay_modes : list of openmc.deplete.DecayTuple Decay mode information. Each element of the list is a named tuple with attributes 'type', 'target', and 'branching_ratio'. n_reaction_paths : int Number of possible reaction pathways. - reactions : list of ReactionTuple + reactions : list of openmc.deplete.ReactionTuple Reaction information. Each element of the list is a named tuple with attribute 'type', 'target', 'Q', and 'branching_ratio'. yield_data : dict of float to list @@ -62,12 +98,10 @@ class Nuclide(object): @property def n_decay_modes(self): - """Number of decay modes.""" return len(self.decay_modes) @property def n_reaction_paths(self): - """Number of possible reaction pathways.""" return len(self.reactions) @classmethod @@ -81,7 +115,7 @@ class Nuclide(object): Returns ------- - nuc : Nuclide + nuc : openmc.deplete.Nuclide Instance of a nuclide """ diff --git a/openmc/deplete/operator.py b/openmc/deplete/operator.py index d0a64a06d3..1c62bdd401 100644 --- a/openmc/deplete/operator.py +++ b/openmc/deplete/operator.py @@ -50,7 +50,12 @@ def _distribute(items): class Operator(TransportOperator): - """OpenMC transport operator for depletion + """OpenMC transport operator for depletion. + + Instances of this class can be used to perform depletion using OpenMC as the + transport operator. Normally, a user needn't call methods of this class + directly. Instead, an instance of this class is passed to an integrator + function, such as :func:`openmc.deplete.integrator.cecm`. Parameters ---------- diff --git a/openmc/deplete/reaction_rates.py b/openmc/deplete/reaction_rates.py index 482c357a29..fddb88b19d 100644 --- a/openmc/deplete/reaction_rates.py +++ b/openmc/deplete/reaction_rates.py @@ -85,17 +85,14 @@ class ReactionRates(np.ndarray): @property def n_mat(self): - """Number of materials.""" return len(self.index_mat) @property def n_nuc(self): - """Number of nucs.""" return len(self.index_nuc) @property def n_react(self): - """Number of reactions.""" return len(self.index_rx) def get(self, mat, nuc, rx): diff --git a/openmc/deplete/results.py b/openmc/deplete/results.py index 307d18a405..f27353a4e3 100644 --- a/openmc/deplete/results.py +++ b/openmc/deplete/results.py @@ -58,51 +58,6 @@ class Results(object): self.data = None - def allocate(self, volume, nuc_list, burn_list, full_burn_list, stages): - """Allocates memory of Results. - - Parameters - ---------- - volume : dict of str float - Volumes corresponding to materials in full_burn_dict - nuc_list : list of str - A list of all nuclide names. Used for sorting the simulation. - burn_list : list of int - A list of all mat IDs to be burned. Used for sorting the simulation. - full_burn_list : list of str - List of all burnable material IDs - stages : int - Number of stages in simulation. - - """ - self.volume = copy.deepcopy(volume) - self.nuc_to_ind = {nuc: i for i, nuc in enumerate(nuc_list)} - self.mat_to_ind = {mat: i for i, mat in enumerate(burn_list)} - self.mat_to_hdf5_ind = {mat: i for i, mat in enumerate(full_burn_list)} - - # Create storage array - self.data = np.zeros((stages, self.n_mat, self.n_nuc)) - - @property - def n_mat(self): - """Number of mats.""" - return len(self.mat_to_ind) - - @property - def n_nuc(self): - """Number of nuclides.""" - return len(self.nuc_to_ind) - - @property - def n_hdf5_mats(self): - """Number of materials in entire geometry.""" - return len(self.mat_to_hdf5_ind) - - @property - def n_stages(self): - """Number of stages in simulation.""" - return self.data.shape[0] - def __getitem__(self, pos): """Retrieves an item from results. @@ -149,6 +104,47 @@ class Results(object): self.data[stage, mat, nuc] = val + @property + def n_mat(self): + return len(self.mat_to_ind) + + @property + def n_nuc(self): + return len(self.nuc_to_ind) + + @property + def n_hdf5_mats(self): + return len(self.mat_to_hdf5_ind) + + @property + def n_stages(self): + return self.data.shape[0] + + def allocate(self, volume, nuc_list, burn_list, full_burn_list, stages): + """Allocates memory of Results. + + Parameters + ---------- + volume : dict of str float + Volumes corresponding to materials in full_burn_dict + nuc_list : list of str + A list of all nuclide names. Used for sorting the simulation. + burn_list : list of int + A list of all mat IDs to be burned. Used for sorting the simulation. + full_burn_list : list of str + List of all burnable material IDs + stages : int + Number of stages in simulation. + + """ + self.volume = copy.deepcopy(volume) + self.nuc_to_ind = {nuc: i for i, nuc in enumerate(nuc_list)} + self.mat_to_ind = {mat: i for i, mat in enumerate(burn_list)} + self.mat_to_hdf5_ind = {mat: i for i, mat in enumerate(full_burn_list)} + + # Create storage array + self.data = np.zeros((stages, self.n_mat, self.n_nuc)) + def create_hdf5(self, handle): """Creates file structure for a blank HDF5 file. From 33dec88bd089876b36a73d0850ee594e1a7a49d6 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 20 Feb 2018 15:35:39 -0600 Subject: [PATCH 069/231] Add format spec for depletion results HDF5 file (add necessary attributes too) --- docs/source/io_formats/depletion_chain.rst | 2 +- docs/source/io_formats/depletion_results.rst | 42 ++++++++++++++++++ docs/source/io_formats/index.rst | 7 +-- openmc/checkvalue.py | 4 +- openmc/deplete/results.py | 44 ++++++++++--------- tests/regression_tests/test_reference.h5 | Bin 162120 -> 162320 bytes 6 files changed, 72 insertions(+), 27 deletions(-) create mode 100644 docs/source/io_formats/depletion_results.rst diff --git a/docs/source/io_formats/depletion_chain.rst b/docs/source/io_formats/depletion_chain.rst index 00d95bdf58..b0dd72eb9a 100644 --- a/docs/source/io_formats/depletion_chain.rst +++ b/docs/source/io_formats/depletion_chain.rst @@ -1,4 +1,4 @@ -.. _io_chain: +.. _io_depletion_chain: ============================ Depletion Chain -- chain.xml diff --git a/docs/source/io_formats/depletion_results.rst b/docs/source/io_formats/depletion_results.rst new file mode 100644 index 0000000000..fcbc4fb99b --- /dev/null +++ b/docs/source/io_formats/depletion_results.rst @@ -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** (*float[][]*) -- k-eigenvalues at each + time/stage. This array has shape (number of timesteps, number of + stages). + - **number** (*float[][][][]*) -- Total number of atoms. This array + has shape (number of timesteps, number of stages, number of + materials, number of nuclides). + - **reaction rates** (*float[][][][][]*) -- 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** (*float[][2]*) -- Time in [s] at beginning/end of each + step. + +**/materials//** + +:Attributes: - **index** (*int*) -- Index used in results for this material + - **volume** (*float*) -- Volume of this material in [cm^3] + +**/nuclides//** + +: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//** + +:Attributes: - **index** (*int*) -- Index user in results for this reaction diff --git a/docs/source/io_formats/index.rst b/docs/source/io_formats/index.rst index 1068973332..c1bb76a29a 100644 --- a/docs/source/io_formats/index.rst +++ b/docs/source/io_formats/index.rst @@ -12,7 +12,7 @@ Input Files .. toctree:: :numbered: - :maxdepth: 2 + :maxdepth: 1 geometry materials @@ -27,7 +27,7 @@ Data Files .. toctree:: :numbered: - :maxdepth: 2 + :maxdepth: 1 cross_sections depletion_chain @@ -42,11 +42,12 @@ Output Files .. toctree:: :numbered: - :maxdepth: 2 + :maxdepth: 1 statepoint source summary + depletion_results particle_restart track voxel diff --git a/openmc/checkvalue.py b/openmc/checkvalue.py index dd32aa566c..2f80ee4c0c 100644 --- a/openmc/checkvalue.py +++ b/openmc/checkvalue.py @@ -246,9 +246,9 @@ def check_filetype_version(obj, expected_type, expected_version): ---------- obj : h5py.File HDF5 file to check - expected_type + expected_type : str Expected file type, e.g. 'statepoint' - expected_version + expected_version : int Expected major version number. """ diff --git a/openmc/deplete/results.py b/openmc/deplete/results.py index f27353a4e3..b7e5623c7d 100644 --- a/openmc/deplete/results.py +++ b/openmc/deplete/results.py @@ -11,12 +11,13 @@ import h5py from . import comm, have_mpi from .reaction_rates import ReactionRates +from openmc.checkvalue import check_filetype_version -RESULTS_VERSION = 2 +_VERSION_RESULTS = (1, 0) class Results(object): - """Contains output of a depletion run. + """Output of a depletion run Attributes ---------- @@ -145,8 +146,8 @@ class Results(object): # Create storage array self.data = np.zeros((stages, self.n_mat, self.n_nuc)) - def create_hdf5(self, handle): - """Creates file structure for a blank HDF5 file. + def _write_hdf5_metadata(self, handle): + """Writes result metadata in HDF5 file Parameters ---------- @@ -165,7 +166,8 @@ class Results(object): # Store concentration mat and nuclide dictionaries (along with volumes) - handle.create_dataset("version", data=RESULTS_VERSION) + handle.attrs['version'] = np.array(_VERSION_RESULTS) + handle.attrs['filetype'] = np.string_('depletion results') mat_list = sorted(self.mat_to_hdf5_ind, key=int) nuc_list = sorted(self.nuc_to_ind) @@ -221,14 +223,14 @@ class Results(object): Parameters ---------- handle : h5py.File or h5py.Group - An hdf5 file or group type to store this in. + An HDF5 file or group type to store this in. index : int What step is this? """ if "/number" not in handle: comm.barrier() - self.create_hdf5(handle) + self._write_hdf5_metadata(handle) comm.barrier() @@ -280,14 +282,14 @@ class Results(object): time_dset[index, :] = self.time @classmethod - def from_hdf5(cls, handle, index): + def from_hdf5(cls, handle, step): """Loads results object from HDF5. Parameters ---------- handle : h5py.File or h5py.Group - An hdf5 file or group type to load from. - index : int + An HDF5 file or group type to load from. + step : int What step is this? """ @@ -298,9 +300,9 @@ class Results(object): eigenvalues_dset = handle["/eigenvalues"] time_dset = handle["/time"] - results.data = number_dset[index, :, :, :] - results.k = eigenvalues_dset[index, :] - results.time = time_dset[index, :] + results.data = number_dset[step, :, :, :] + results.k = eigenvalues_dset[step, :] + results.time = time_dset[step, :] # Reconstruct dictionaries results.volume = OrderedDict() @@ -331,14 +333,14 @@ class Results(object): for i in range(results.n_stages): rate = ReactionRates(results.mat_to_ind, rxn_nuc_to_ind, rxn_to_ind) - rate[:] = handle["/reaction rates"][index, i, :, :, :] + rate[:] = handle["/reaction rates"][step, i, :, :, :] results.rates.append(rate) return results -def write_results(result, filename, index): - """Outputs result to an .hdf5 file. +def write_results(result, filename, step): + """Outputs result to an HDF5 file. Parameters ---------- @@ -346,7 +348,7 @@ def write_results(result, filename, index): Object to be stored in a file. filename : String Target filename. - index : int + step : int What step is this? """ @@ -355,10 +357,10 @@ def write_results(result, filename, index): else: kwargs = {} - kwargs['mode'] = "w" if index == 0 else "a" + kwargs['mode'] = "w" if step == 0 else "a" with h5py.File(filename, **kwargs) as handle: - result.to_hdf5(handle, index) + result.to_hdf5(handle, step) def read_results(filename): @@ -371,12 +373,12 @@ def read_results(filename): Returns ------- - results : list of Results + results : list of openmc.deplete.Results The result objects. """ with h5py.File(str(filename), "r") as fh: - assert fh["version"].value == RESULTS_VERSION + check_filetype_version(fh, 'depletion results', _VERSION_RESULTS[0]) # Get number of results stored n = fh["number"].value.shape[0] diff --git a/tests/regression_tests/test_reference.h5 b/tests/regression_tests/test_reference.h5 index 6e724c597107560c4155a257f4e854210f36f08e..5323a9a904e0fce1f806fbc49ad90324b4fe1aa9 100644 GIT binary patch delta 188 zcmX@{iF3ji&IuY!0#y^WEG9o<7vuD(WMTk;6VqQhGpaYPXkEd$bp_LciirghmOKm| z3@ku7Mg|TB9tH`9vecsD%=|nC0S*SB2naZUNk&FSFby$@fq`lI#X?4LZyumDL^~%? zIR`^pW=?8JWkD)fEszif>JkLf5X}q>DX9fO1wacFic*V9b4rR~3K;|@ZWILo?m{Cr delta 45 xcmbR6h4aKG&IuY!9+eZdET$_dGKz6^FhIZxrs=Po8PytBw60*>x`Jsz1prXj4y6D9 From 4a500df455aba407bb69d8c9980a834cccd09f3b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 20 Feb 2018 16:40:18 -0600 Subject: [PATCH 070/231] Add Model.deplete method to make user's life easier --- openmc/deplete/operator.py | 5 +++++ openmc/model/model.py | 39 +++++++++++++++++++++++++++++++++++--- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/openmc/deplete/operator.py b/openmc/deplete/operator.py index 1c62bdd401..a1d8ffb0b0 100644 --- a/openmc/deplete/operator.py +++ b/openmc/deplete/operator.py @@ -195,6 +195,11 @@ class Operator(TransportOperator): "material with ID={}.".format(mat.id)) volume[str(mat.id)] = mat.volume + # Make sure there are burnable materials + if not burnable_mats: + raise RuntimeError( + "No depletable materials were found in the model.") + # Sort the sets burnable_mats = sorted(burnable_mats, key=int) model_nuclides = sorted(model_nuclides) diff --git a/openmc/model/model.py b/openmc/model/model.py index 89fa84e604..d6e6ddce38 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -2,6 +2,10 @@ from collections.abc import Iterable import openmc from openmc.checkvalue import check_type +import openmc.deplete as dep + +_DEPLETE_METHODS = {'predictor': dep.integrator.predictor, + 'cecm': dep.integrator.cecm} class Model(object): @@ -136,9 +140,38 @@ class Model(object): for plot in plots: self._plots.append(plot) - def export_to_xml(self): - """Export model to XML files. + def deplete(self, timesteps, power, chain_file=None, method='cecm', **kwargs): + """Deplete model using specified timesteps/power + + Parameters + ---------- + timesteps : iterable of float + Array of timesteps in units of [s]. Note that values are not + cumulative. + power : float or iterable of float + Power of the reactor in [W]. A single value indicates that the power + is constant over all timesteps. An iterable indicates potentially + different power levels for each timestep. For a 2D problem, the + power can be given in [W/cm] as long as the "volume" assigned to a + depletion material is actually an area in [cm^2]. + chain_file : str, optional + Path to the depletion chain XML file. Defaults to the + :envvar:`OPENMC_DEPLETE_CHAIN` environment variable if it exists. + method : {'cecm', 'predictor'} + Integration method used for depletion + **kwargs + Keyword arguments passed to integration function (e.g., + :func:`openmc.deplete.integrator.cecm`) + """ + # Create OpenMC transport operator + op = dep.Operator(self.geometry, self.settings, chain_file) + + # Perform depletion + _DEPLETE_METHODS[method](op, timesteps, power, **kwargs) + + def export_to_xml(self): + """Export model to XML files.""" self.settings.export_to_xml() self.geometry.export_to_xml() @@ -166,7 +199,7 @@ class Model(object): Parameters ---------- **kwargs - All keyword arguments are passed to openmc.run + All keyword arguments are passed to :func:`openmc.run` Returns ------- From b4719cf53fbabc9f1aa60dba9608f4f101f71674 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 20 Feb 2018 22:46:26 -0600 Subject: [PATCH 071/231] Fix for Python 3.4 (setting __doc__ on properties) --- openmc/deplete/abc.py | 8 ++++++-- openmc/deplete/nuclide.py | 21 ++++++++++++++------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index 8b42ee800e..8502909a21 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -23,8 +23,12 @@ rates : openmc.deplete.ReactionRates Resulting reaction rates """ -OperatorResult.k.__doc__ = None -OperatorResult.rates.__doc__ = None +try: + OperatorResult.k.__doc__ = None + OperatorResult.rates.__doc__ = None +except AttributeError: + # Can't set __doc__ on properties on Python 3.4 + pass class TransportOperator(metaclass=ABCMeta): diff --git a/openmc/deplete/nuclide.py b/openmc/deplete/nuclide.py index af10e5c2f9..8a30214c2c 100644 --- a/openmc/deplete/nuclide.py +++ b/openmc/deplete/nuclide.py @@ -24,9 +24,13 @@ branching_ratio : float Branching ratio of the decay mode """ -DecayTuple.type.__doc__ = None -DecayTuple.target.__doc__ = None -DecayTuple.branching_ratio.__doc__ = None +try: + DecayTuple.type.__doc__ = None + DecayTuple.target.__doc__ = None + DecayTuple.branching_ratio.__doc__ = None +except AttributeError: + # Can't set __doc__ on properties on Python 3.4 + pass ReactionTuple = namedtuple('ReactionTuple', 'type target Q branching_ratio') @@ -45,10 +49,13 @@ branching_ratio : float Branching ratio of the reaction """ -ReactionTuple.type.__doc__ = None -ReactionTuple.target.__doc__ = None -ReactionTuple.Q.__doc__ = None -ReactionTuple.branching_ratio.__doc__ = None +try: + ReactionTuple.type.__doc__ = None + ReactionTuple.target.__doc__ = None + ReactionTuple.Q.__doc__ = None + ReactionTuple.branching_ratio.__doc__ = None +except AttributeError: + pass class Nuclide(object): From 82d6c34d27e0021280581398be350e3f0df1a234 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 21 Feb 2018 06:51:51 -0600 Subject: [PATCH 072/231] Move make_chain.py to openmc-make-depletion-chain --- .gitignore | 7 +--- openmc/_utils.py | 49 +++++++++++++++++++++++ scripts/example_run.py | 16 ++++---- scripts/make_chain.py | 60 ----------------------------- scripts/openmc-make-depletion-chain | 33 ++++++++++++++++ 5 files changed, 91 insertions(+), 74 deletions(-) create mode 100644 openmc/_utils.py delete mode 100644 scripts/make_chain.py create mode 100755 scripts/openmc-make-depletion-chain diff --git a/.gitignore b/.gitignore index 8c7cc3e366..65c7285af1 100644 --- a/.gitignore +++ b/.gitignore @@ -42,11 +42,8 @@ results_error.dat inputs_error.dat results_test.dat -# Test build files -tests/build/ -tests/coverage/ -tests/memcheck/ -tests/ctestscript.run +# Test +.pytest_cache/ # HDF5 files *.h5 diff --git a/openmc/_utils.py b/openmc/_utils.py new file mode 100644 index 0000000000..83455c17aa --- /dev/null +++ b/openmc/_utils.py @@ -0,0 +1,49 @@ +import os.path +from pathlib import Path +from urllib.parse import urlparse +from urllib.request import urlopen + +_BLOCK_SIZE = 16384 + + +def download(url): + """Download file from a URL + + Parameters + ---------- + url : str + URL from which to download + + Returns + ------- + basename : str + Name of file written locally + + """ + req = urlopen(url) + + # Get file size from header + file_size = req.length + + # Check if file already downloaded + basename = Path(urlparse(url).path).name + if os.path.exists(basename): + if os.path.getsize(basename) == file_size: + print('Skipping {}, already downloaded'.format(basename)) + return basename + + # Copy file to disk in chunks + print('Downloading {}... '.format(basename), end='') + downloaded = 0 + with open(basename, 'wb') as fh: + while True: + chunk = req.read(_BLOCK_SIZE) + if not chunk: + break + fh.write(chunk) + downloaded += len(chunk) + status = '{:10} [{:3.2f}%]'.format( + downloaded, downloaded * 100. / file_size) + print(status + '\b'*len(status), end='') + print('') + return basename diff --git a/scripts/example_run.py b/scripts/example_run.py index 30b6bdc2ee..36b6cce1a4 100644 --- a/scripts/example_run.py +++ b/scripts/example_run.py @@ -14,22 +14,20 @@ geometry, lower_left, upper_right = example_geometry.generate_problem() dt1 = 15*24*60*60 # 15 days dt2 = 5.5*30*24*60*60 # 5.5 months N = np.floor(dt2/dt1) - dt = np.repeat([dt1], N) -# Depletion settings -settings = openmc.deplete.OpenMCSettings() -settings.power = 2.337e15*4*JOULE_PER_EV*1e6 # MeV/second cm from CASMO -settings.dt_vec = dt -settings.output_dir = 'test' +# Power for simulation +power = 2.337e15*4*JOULE_PER_EV*1e6 # MeV/second cm from CASMO -# OpenMC-delegated settings +# OpenMC settings +settings = openmc.Settings() settings.particles = 1000 settings.batches = 100 settings.inactive = 40 settings.source = openmc.Source(space=openmc.stats.Box(lower_left, upper_right)) -op = openmc.deplete.OpenMCOperator(geometry, settings) +op = openmc.deplete.Operator(geometry, settings) +op.output_dir = 'test' # Perform simulation using the MCNPX/MCNP6 algorithm -openmc.deplete.integrator.cecm(op) +openmc.deplete.integrator.cecm(op, dt, power) diff --git a/scripts/make_chain.py b/scripts/make_chain.py deleted file mode 100644 index 6d64f34b3c..0000000000 --- a/scripts/make_chain.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python - -import glob -import os -from zipfile import ZipFile - -import requests -from tqdm import tqdm -import openmc.deplete - - -urls = [ - 'http://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-neutrons.zip', - 'http://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-decay.zip', - 'http://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-nfy.zip' -] - - -def download_file(url): - response = requests.get(url, stream=True) - filesize = int(response.headers.get('content-length')) - - # Check if file already downloaded - basename = url.split('/')[-1] - if os.path.exists(basename): - if os.path.getsize(basename) == filesize: - return basename - else: - overwrite = input('Overwrite {}? ([y]/n) '.format(basename)) - if overwrite.lower().startswith('n'): - return basename - - with open(basename, 'wb') as f: - with tqdm(desc='Downloading {}'.format(basename), - total=filesize, unit='B', unit_scale=True) as pbar: - for i, chunk in enumerate(response.iter_content(chunk_size=4096)): - pbar.update(4096) - if chunk: - f.write(chunk) - - return basename - - -def main(): - for url in urls: - basename = download_file(url) - with ZipFile(basename, 'r') as zf: - print('Extracting {}...'.format(basename)) - zf.extractall() - - decay_files = glob.glob(os.path.join('decay', '*.endf')) - nfy_files = glob.glob(os.path.join('nfy', '*.endf')) - neutron_files = glob.glob(os.path.join('neutrons', '*.endf')) - - chain = openmc.deplete.Chain.from_endf(decay_files, nfy_files, neutron_files) - chain.export_to_xml('chain_endfb71.xml') - - -if __name__ == '__main__': - main() diff --git a/scripts/openmc-make-depletion-chain b/scripts/openmc-make-depletion-chain new file mode 100755 index 0000000000..7c08f984e9 --- /dev/null +++ b/scripts/openmc-make-depletion-chain @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 + +import glob +import os +from zipfile import ZipFile + +from openmc._utils import download +import openmc.deplete + + +URLS = [ + 'http://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-neutrons.zip', + 'http://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-decay.zip', + 'http://www.nndc.bnl.gov/endf/b7.1/zips/ENDF-B-VII.1-nfy.zip' +] + +def main(): + for url in URLS: + basename = download(url) + with ZipFile(basename, 'r') as zf: + print('Extracting {}...'.format(basename)) + zf.extractall() + + decay_files = glob.glob(os.path.join('decay', '*.endf')) + nfy_files = glob.glob(os.path.join('nfy', '*.endf')) + neutron_files = glob.glob(os.path.join('neutrons', '*.endf')) + + chain = openmc.deplete.Chain.from_endf(decay_files, nfy_files, neutron_files) + chain.export_to_xml('chain_endfb71.xml') + + +if __name__ == '__main__': + main() From d981b34dc18236cf857d1249629b6437005e073f Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 21 Feb 2018 07:00:20 -0600 Subject: [PATCH 073/231] Remove FutureWarning for capi import --- openmc/capi/__init__.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/openmc/capi/__init__.py b/openmc/capi/__init__.py index d302001c99..bc173f9946 100644 --- a/openmc/capi/__init__.py +++ b/openmc/capi/__init__.py @@ -15,7 +15,6 @@ objects in the :mod:`openmc.capi` subpackage, for example: from ctypes import CDLL import os import sys -from warnings import warn import pkg_resources @@ -36,10 +35,7 @@ else: # available. Instead, we create a mock object so that when the modules # within the openmc.capi package try to configure arguments and return # values for symbols, no errors occur - try: - from unittest.mock import Mock - except ImportError: - from mock import Mock + from unittest.mock import Mock _dll = Mock() from .error import * @@ -50,6 +46,3 @@ from .cell import * from .filter import * from .tally import * from .settings import settings - -warn("The Python bindings to OpenMC's C API are still unstable " - "and may change substantially in future releases.", FutureWarning) From 81b859ad4ff3995ac84e27b8bf15ba2f87cc4cc4 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 21 Feb 2018 07:33:18 -0600 Subject: [PATCH 074/231] Get rid of example_run.py and example_plot.py --- scripts/example_geometry.py | 378 -------------------- scripts/example_plot.py | 43 --- scripts/example_run.py | 33 -- tests/regression_tests/example_geometry.py | 379 ++++++++++++++++++++- 4 files changed, 378 insertions(+), 455 deletions(-) delete mode 100644 scripts/example_geometry.py delete mode 100644 scripts/example_plot.py delete mode 100644 scripts/example_run.py mode change 120000 => 100644 tests/regression_tests/example_geometry.py diff --git a/scripts/example_geometry.py b/scripts/example_geometry.py deleted file mode 100644 index ca10c1f725..0000000000 --- a/scripts/example_geometry.py +++ /dev/null @@ -1,378 +0,0 @@ -"""An example file showing how to make a geometry. - -This particular example creates a 3x3 geometry, with 8 regular pins and one -Gd-157 2 wt-percent enriched. All pins are segmented. -""" - -from collections import OrderedDict -import math - -import numpy as np -import openmc - - -def density_to_mat(dens_dict): - """Generates an OpenMC material from a cell ID and self.number_density. - - Parameters - ---------- - dens_dict : dict - Dictionary mapping nuclide names to densities - - Returns - ------- - openmc.Material - The OpenMC material filled with nuclides. - - """ - mat = openmc.Material() - for key in dens_dict: - mat.add_nuclide(key, 1.0e-24*dens_dict[key]) - mat.set_density('sum') - - return mat - - -def generate_initial_number_density(): - """ Generates initial number density. - - These results were from a CASMO5 run in which the gadolinium pin was - loaded with 2 wt percent of Gd-157. - """ - - # Concentration to be used for all fuel pins - fuel_dict = OrderedDict() - fuel_dict['U235'] = 1.05692e21 - fuel_dict['U234'] = 1.00506e19 - fuel_dict['U238'] = 2.21371e22 - fuel_dict['O16'] = 4.62954e22 - fuel_dict['O17'] = 1.127684e20 - fuel_dict['I135'] = 1.0e10 - fuel_dict['Xe135'] = 1.0e10 - fuel_dict['Xe136'] = 1.0e10 - fuel_dict['Cs135'] = 1.0e10 - fuel_dict['Gd156'] = 1.0e10 - fuel_dict['Gd157'] = 1.0e10 - # fuel_dict['O18'] = 9.51352e19 # Does not exist in ENDF71, merged into 17 - - # Concentration to be used for the gadolinium fuel pin - fuel_gd_dict = OrderedDict() - fuel_gd_dict['U235'] = 1.03579e21 - fuel_gd_dict['U238'] = 2.16943e22 - fuel_gd_dict['Gd156'] = 3.95517E+10 - fuel_gd_dict['Gd157'] = 1.08156e20 - fuel_gd_dict['O16'] = 4.64035e22 - fuel_dict['I135'] = 1.0e10 - fuel_dict['Xe136'] = 1.0e10 - fuel_dict['Xe135'] = 1.0e10 - fuel_dict['Cs135'] = 1.0e10 - # There are a whole bunch of 1e-10 stuff here. - - # Concentration to be used for cladding - clad_dict = OrderedDict() - clad_dict['O16'] = 3.07427e20 - clad_dict['O17'] = 7.48868e17 - clad_dict['Cr50'] = 3.29620e18 - clad_dict['Cr52'] = 6.35639e19 - clad_dict['Cr53'] = 7.20763e18 - clad_dict['Cr54'] = 1.79413e18 - clad_dict['Fe54'] = 5.57350e18 - clad_dict['Fe56'] = 8.74921e19 - clad_dict['Fe57'] = 2.02057e18 - clad_dict['Fe58'] = 2.68901e17 - clad_dict['Cr50'] = 3.29620e18 - clad_dict['Cr52'] = 6.35639e19 - clad_dict['Cr53'] = 7.20763e18 - clad_dict['Cr54'] = 1.79413e18 - clad_dict['Ni58'] = 2.51631e19 - clad_dict['Ni60'] = 9.69278e18 - clad_dict['Ni61'] = 4.21338e17 - clad_dict['Ni62'] = 1.34341e18 - clad_dict['Ni64'] = 3.43127e17 - clad_dict['Zr90'] = 2.18320e22 - clad_dict['Zr91'] = 4.76104e21 - clad_dict['Zr92'] = 7.27734e21 - clad_dict['Zr94'] = 7.37494e21 - clad_dict['Zr96'] = 1.18814e21 - clad_dict['Sn112'] = 4.67352e18 - clad_dict['Sn114'] = 3.17992e18 - clad_dict['Sn115'] = 1.63814e18 - clad_dict['Sn116'] = 7.00546e19 - clad_dict['Sn117'] = 3.70027e19 - clad_dict['Sn118'] = 1.16694e20 - clad_dict['Sn119'] = 4.13872e19 - clad_dict['Sn120'] = 1.56973e20 - clad_dict['Sn122'] = 2.23076e19 - clad_dict['Sn124'] = 2.78966e19 - - # Gap concentration - # Funny enough, the example problem uses air. - gap_dict = OrderedDict() - gap_dict['O16'] = 7.86548e18 - gap_dict['O17'] = 2.99548e15 - gap_dict['N14'] = 3.38646e19 - gap_dict['N15'] = 1.23717e17 - - # Concentration to be used for coolant - # No boron - cool_dict = OrderedDict() - cool_dict['H1'] = 4.68063e22 - cool_dict['O16'] = 2.33427e22 - cool_dict['O17'] = 8.89086e18 - - # Store these dictionaries in the initial conditions dictionary - initial_density = OrderedDict() - initial_density['fuel_gd'] = fuel_gd_dict - initial_density['fuel'] = fuel_dict - initial_density['gap'] = gap_dict - initial_density['clad'] = clad_dict - initial_density['cool'] = cool_dict - - # Set up libraries to use - temperature = OrderedDict() - sab = OrderedDict() - - # Toggle betweeen MCNP and NNDC data - MCNP = False - - if MCNP: - temperature['fuel_gd'] = 900.0 - temperature['fuel'] = 900.0 - # We approximate temperature of everything as 600K, even though it was - # actually 580K. - temperature['gap'] = 600.0 - temperature['clad'] = 600.0 - temperature['cool'] = 600.0 - else: - temperature['fuel_gd'] = 293.6 - temperature['fuel'] = 293.6 - temperature['gap'] = 293.6 - temperature['clad'] = 293.6 - temperature['cool'] = 293.6 - - sab['cool'] = 'c_H_in_H2O' - - # Set up burnable materials - burn = OrderedDict() - burn['fuel_gd'] = True - burn['fuel'] = True - burn['gap'] = False - burn['clad'] = False - burn['cool'] = False - - return temperature, sab, initial_density, burn - -def segment_pin(n_rings, n_wedges, r_fuel, r_gap, r_clad): - """ Calculates a segmented pin. - - Separates a pin with n_rings and n_wedges. All cells have equal volume. - Pin is centered at origin. - """ - - # Calculate all the volumes of interest - v_fuel = math.pi * r_fuel**2 - v_gap = math.pi * r_gap**2 - v_fuel - v_clad = math.pi * r_clad**2 - v_fuel - v_gap - v_ring = v_fuel / n_rings - v_segment = v_ring / n_wedges - - # Compute ring radiuses - r_rings = np.zeros(n_rings) - - for i in range(n_rings): - r_rings[i] = math.sqrt(1.0/(math.pi) * v_ring * (i+1)) - - # Compute thetas - theta = np.linspace(0, 2*math.pi, n_wedges + 1) - - # Compute surfaces - fuel_rings = [openmc.ZCylinder(x0=0, y0=0, R=r_rings[i]) - for i in range(n_rings)] - - fuel_wedges = [openmc.Plane(A=math.cos(theta[i]), B=math.sin(theta[i])) - for i in range(n_wedges)] - - gap_ring = openmc.ZCylinder(x0=0, y0=0, R=r_gap) - clad_ring = openmc.ZCylinder(x0=0, y0=0, R=r_clad) - - # Create cells - fuel_cells = [] - if n_wedges == 1: - for i in range(n_rings): - cell = openmc.Cell(name='fuel') - if i == 0: - cell.region = -fuel_rings[0] - else: - cell.region = +fuel_rings[i-1] & -fuel_rings[i] - fuel_cells.append(cell) - else: - for i in range(n_rings): - for j in range(n_wedges): - cell = openmc.Cell(name='fuel') - if i == 0: - if j != n_wedges-1: - cell.region = (-fuel_rings[0] - & +fuel_wedges[j] - & -fuel_wedges[j+1]) - else: - cell.region = (-fuel_rings[0] - & +fuel_wedges[j] - & -fuel_wedges[0]) - else: - if j != n_wedges-1: - cell.region = (+fuel_rings[i-1] - & -fuel_rings[i] - & +fuel_wedges[j] - & -fuel_wedges[j+1]) - else: - cell.region = (+fuel_rings[i-1] - & -fuel_rings[i] - & +fuel_wedges[j] - & -fuel_wedges[0]) - fuel_cells.append(cell) - - # Gap ring - gap_cell = openmc.Cell(name='gap') - gap_cell.region = +fuel_rings[-1] & -gap_ring - fuel_cells.append(gap_cell) - - # Clad ring - clad_cell = openmc.Cell(name='clad') - clad_cell.region = +gap_ring & -clad_ring - fuel_cells.append(clad_cell) - - # Moderator - mod_cell = openmc.Cell(name='cool') - mod_cell.region = +clad_ring - fuel_cells.append(mod_cell) - - # Form universe - fuel_u = openmc.Universe() - fuel_u.add_cells(fuel_cells) - - return fuel_u, v_segment, v_gap, v_clad - -def generate_geometry(n_rings, n_wedges): - """ Generates example geometry. - - This function creates the initial geometry, a 9 pin reflective problem. - One pin, containing gadolinium, is discretized into sectors. - - In addition to what one would do with the general OpenMC geometry code, it - is necessary to create a dictionary, volume, that maps a cell ID to a - volume. Further, by naming cells the same as the above materials, the code - can automatically handle the mapping. - - Parameters - ---------- - n_rings : int - Number of rings to generate for the geometry - n_wedges : int - Number of wedges to generate for the geometry - """ - - pitch = 1.26197 - r_fuel = 0.412275 - r_gap = 0.418987 - r_clad = 0.476121 - - n_pin = 3 - - # This table describes the 'fuel' to actual type mapping - # It's not necessary to do it this way. Just adjust the initial conditions - # below. - mapping = ['fuel', 'fuel', 'fuel', - 'fuel', 'fuel_gd', 'fuel', - 'fuel', 'fuel', 'fuel'] - - # Form pin cell - fuel_u, v_segment, v_gap, v_clad = segment_pin(n_rings, n_wedges, r_fuel, r_gap, r_clad) - - # Form lattice - all_water_c = openmc.Cell(name='cool') - all_water_u = openmc.Universe(cells=(all_water_c, )) - - lattice = openmc.RectLattice() - lattice.pitch = [pitch]*2 - lattice.lower_left = [-pitch*n_pin/2, -pitch*n_pin/2] - lattice_array = [[fuel_u for i in range(n_pin)] for j in range(n_pin)] - lattice.universes = lattice_array - lattice.outer = all_water_u - - # Bound universe - x_low = openmc.XPlane(x0=-pitch*n_pin/2, boundary_type='reflective') - x_high = openmc.XPlane(x0=pitch*n_pin/2, boundary_type='reflective') - y_low = openmc.YPlane(y0=-pitch*n_pin/2, boundary_type='reflective') - y_high = openmc.YPlane(y0=pitch*n_pin/2, boundary_type='reflective') - z_low = openmc.ZPlane(z0=-10, boundary_type='reflective') - z_high = openmc.ZPlane(z0=10, boundary_type='reflective') - - # Compute bounding box - lower_left = [-pitch*n_pin/2, -pitch*n_pin/2, -10] - upper_right = [pitch*n_pin/2, pitch*n_pin/2, 10] - - root_c = openmc.Cell(fill=lattice) - root_c.region = (+x_low & -x_high - & +y_low & -y_high - & +z_low & -z_high) - root_u = openmc.Universe(universe_id=0, cells=(root_c, )) - geometry = openmc.Geometry(root_u) - - v_cool = pitch**2 - (v_gap + v_clad + n_rings * n_wedges * v_segment) - - # Store volumes for later usage - volume = {'fuel': v_segment, 'gap':v_gap, 'clad':v_clad, 'cool':v_cool} - - return geometry, volume, mapping, lower_left, upper_right - -def generate_problem(n_rings=5, n_wedges=8): - """ Merges geometry and materials. - - This function initializes the materials for each cell using the dictionaries - provided by generate_initial_number_density. It is assumed a cell named - 'fuel' will have further region differentiation (see mapping). - - Parameters - ---------- - n_rings : int, optional - Number of rings to generate for the geometry - n_wedges : int, optional - Number of wedges to generate for the geometry - """ - - # Get materials dictionary, geometry, and volumes - temperature, sab, initial_density, burn = generate_initial_number_density() - geometry, volume, mapping, lower_left, upper_right = generate_geometry(n_rings, n_wedges) - - # Apply distribmats, fill geometry - cells = geometry.root_universe.get_all_cells() - for cell_id in cells: - cell = cells[cell_id] - if cell.name == 'fuel': - - omc_mats = [] - - for cell_type in mapping: - omc_mat = density_to_mat(initial_density[cell_type]) - - if cell_type in sab: - omc_mat.add_s_alpha_beta(sab[cell_type]) - omc_mat.temperature = temperature[cell_type] - omc_mat.depletable = burn[cell_type] - omc_mat.volume = volume['fuel'] - - omc_mats.append(omc_mat) - - cell.fill = omc_mats - elif cell.name != '': - omc_mat = density_to_mat(initial_density[cell.name]) - - if cell.name in sab: - omc_mat.add_s_alpha_beta(sab[cell.name]) - omc_mat.temperature = temperature[cell.name] - omc_mat.depletable = burn[cell.name] - omc_mat.volume = volume[cell.name] - - cell.fill = omc_mat - - return geometry, lower_left, upper_right diff --git a/scripts/example_plot.py b/scripts/example_plot.py deleted file mode 100644 index ab5ac204d8..0000000000 --- a/scripts/example_plot.py +++ /dev/null @@ -1,43 +0,0 @@ -"""An example file showing how to plot data from a simulation.""" - -import matplotlib.pyplot as plt -from openmc.deplete import (read_results, evaluate_single_nuclide, - evaluate_reaction_rate, evaluate_eigenvalue) - -# Set variables for where the data is, and what we want to read out. -result_folder = "test" - -# Load data -results = read_results(result_folder + "/deplete_results.h5") - -cell = "5" -nuc = "Gd157" -rxn = "(n,gamma)" - -# Total number of nuclides -plt.figure() -# Pointwise data -x, y = evaluate_single_nuclide(results, cell, nuc) -plt.semilogy(x, y) - -plt.xlabel("Time, s") -plt.ylabel("Total Number") -plt.savefig("number.pdf") - -# Reaction rate -plt.figure() -x, y = evaluate_reaction_rate(results, cell, nuc, rxn) -plt.plot(x, y) -plt.xlabel("Time, s") -plt.ylabel("Reaction Rate, 1/s") - -plt.savefig("rate.pdf") - -# Eigenvalue -plt.figure() -x, y = evaluate_eigenvalue(results) -plt.plot(x, y) -plt.xlabel("Time, s") -plt.ylabel("Eigenvalue") - -plt.savefig("eigvl.pdf") diff --git a/scripts/example_run.py b/scripts/example_run.py deleted file mode 100644 index 36b6cce1a4..0000000000 --- a/scripts/example_run.py +++ /dev/null @@ -1,33 +0,0 @@ -"""An example file showing how to run a simulation.""" - -import numpy as np -import openmc -from openmc.data import JOULE_PER_EV -import openmc.deplete - -import example_geometry - -# Load geometry from example -geometry, lower_left, upper_right = example_geometry.generate_problem() - -# Create dt vector for 5.5 months with 15 day timesteps -dt1 = 15*24*60*60 # 15 days -dt2 = 5.5*30*24*60*60 # 5.5 months -N = np.floor(dt2/dt1) -dt = np.repeat([dt1], N) - -# Power for simulation -power = 2.337e15*4*JOULE_PER_EV*1e6 # MeV/second cm from CASMO - -# OpenMC settings -settings = openmc.Settings() -settings.particles = 1000 -settings.batches = 100 -settings.inactive = 40 -settings.source = openmc.Source(space=openmc.stats.Box(lower_left, upper_right)) - -op = openmc.deplete.Operator(geometry, settings) -op.output_dir = 'test' - -# Perform simulation using the MCNPX/MCNP6 algorithm -openmc.deplete.integrator.cecm(op, dt, power) diff --git a/tests/regression_tests/example_geometry.py b/tests/regression_tests/example_geometry.py deleted file mode 120000 index 1071aabc05..0000000000 --- a/tests/regression_tests/example_geometry.py +++ /dev/null @@ -1 +0,0 @@ -../../scripts/example_geometry.py \ No newline at end of file diff --git a/tests/regression_tests/example_geometry.py b/tests/regression_tests/example_geometry.py new file mode 100644 index 0000000000..ca10c1f725 --- /dev/null +++ b/tests/regression_tests/example_geometry.py @@ -0,0 +1,378 @@ +"""An example file showing how to make a geometry. + +This particular example creates a 3x3 geometry, with 8 regular pins and one +Gd-157 2 wt-percent enriched. All pins are segmented. +""" + +from collections import OrderedDict +import math + +import numpy as np +import openmc + + +def density_to_mat(dens_dict): + """Generates an OpenMC material from a cell ID and self.number_density. + + Parameters + ---------- + dens_dict : dict + Dictionary mapping nuclide names to densities + + Returns + ------- + openmc.Material + The OpenMC material filled with nuclides. + + """ + mat = openmc.Material() + for key in dens_dict: + mat.add_nuclide(key, 1.0e-24*dens_dict[key]) + mat.set_density('sum') + + return mat + + +def generate_initial_number_density(): + """ Generates initial number density. + + These results were from a CASMO5 run in which the gadolinium pin was + loaded with 2 wt percent of Gd-157. + """ + + # Concentration to be used for all fuel pins + fuel_dict = OrderedDict() + fuel_dict['U235'] = 1.05692e21 + fuel_dict['U234'] = 1.00506e19 + fuel_dict['U238'] = 2.21371e22 + fuel_dict['O16'] = 4.62954e22 + fuel_dict['O17'] = 1.127684e20 + fuel_dict['I135'] = 1.0e10 + fuel_dict['Xe135'] = 1.0e10 + fuel_dict['Xe136'] = 1.0e10 + fuel_dict['Cs135'] = 1.0e10 + fuel_dict['Gd156'] = 1.0e10 + fuel_dict['Gd157'] = 1.0e10 + # fuel_dict['O18'] = 9.51352e19 # Does not exist in ENDF71, merged into 17 + + # Concentration to be used for the gadolinium fuel pin + fuel_gd_dict = OrderedDict() + fuel_gd_dict['U235'] = 1.03579e21 + fuel_gd_dict['U238'] = 2.16943e22 + fuel_gd_dict['Gd156'] = 3.95517E+10 + fuel_gd_dict['Gd157'] = 1.08156e20 + fuel_gd_dict['O16'] = 4.64035e22 + fuel_dict['I135'] = 1.0e10 + fuel_dict['Xe136'] = 1.0e10 + fuel_dict['Xe135'] = 1.0e10 + fuel_dict['Cs135'] = 1.0e10 + # There are a whole bunch of 1e-10 stuff here. + + # Concentration to be used for cladding + clad_dict = OrderedDict() + clad_dict['O16'] = 3.07427e20 + clad_dict['O17'] = 7.48868e17 + clad_dict['Cr50'] = 3.29620e18 + clad_dict['Cr52'] = 6.35639e19 + clad_dict['Cr53'] = 7.20763e18 + clad_dict['Cr54'] = 1.79413e18 + clad_dict['Fe54'] = 5.57350e18 + clad_dict['Fe56'] = 8.74921e19 + clad_dict['Fe57'] = 2.02057e18 + clad_dict['Fe58'] = 2.68901e17 + clad_dict['Cr50'] = 3.29620e18 + clad_dict['Cr52'] = 6.35639e19 + clad_dict['Cr53'] = 7.20763e18 + clad_dict['Cr54'] = 1.79413e18 + clad_dict['Ni58'] = 2.51631e19 + clad_dict['Ni60'] = 9.69278e18 + clad_dict['Ni61'] = 4.21338e17 + clad_dict['Ni62'] = 1.34341e18 + clad_dict['Ni64'] = 3.43127e17 + clad_dict['Zr90'] = 2.18320e22 + clad_dict['Zr91'] = 4.76104e21 + clad_dict['Zr92'] = 7.27734e21 + clad_dict['Zr94'] = 7.37494e21 + clad_dict['Zr96'] = 1.18814e21 + clad_dict['Sn112'] = 4.67352e18 + clad_dict['Sn114'] = 3.17992e18 + clad_dict['Sn115'] = 1.63814e18 + clad_dict['Sn116'] = 7.00546e19 + clad_dict['Sn117'] = 3.70027e19 + clad_dict['Sn118'] = 1.16694e20 + clad_dict['Sn119'] = 4.13872e19 + clad_dict['Sn120'] = 1.56973e20 + clad_dict['Sn122'] = 2.23076e19 + clad_dict['Sn124'] = 2.78966e19 + + # Gap concentration + # Funny enough, the example problem uses air. + gap_dict = OrderedDict() + gap_dict['O16'] = 7.86548e18 + gap_dict['O17'] = 2.99548e15 + gap_dict['N14'] = 3.38646e19 + gap_dict['N15'] = 1.23717e17 + + # Concentration to be used for coolant + # No boron + cool_dict = OrderedDict() + cool_dict['H1'] = 4.68063e22 + cool_dict['O16'] = 2.33427e22 + cool_dict['O17'] = 8.89086e18 + + # Store these dictionaries in the initial conditions dictionary + initial_density = OrderedDict() + initial_density['fuel_gd'] = fuel_gd_dict + initial_density['fuel'] = fuel_dict + initial_density['gap'] = gap_dict + initial_density['clad'] = clad_dict + initial_density['cool'] = cool_dict + + # Set up libraries to use + temperature = OrderedDict() + sab = OrderedDict() + + # Toggle betweeen MCNP and NNDC data + MCNP = False + + if MCNP: + temperature['fuel_gd'] = 900.0 + temperature['fuel'] = 900.0 + # We approximate temperature of everything as 600K, even though it was + # actually 580K. + temperature['gap'] = 600.0 + temperature['clad'] = 600.0 + temperature['cool'] = 600.0 + else: + temperature['fuel_gd'] = 293.6 + temperature['fuel'] = 293.6 + temperature['gap'] = 293.6 + temperature['clad'] = 293.6 + temperature['cool'] = 293.6 + + sab['cool'] = 'c_H_in_H2O' + + # Set up burnable materials + burn = OrderedDict() + burn['fuel_gd'] = True + burn['fuel'] = True + burn['gap'] = False + burn['clad'] = False + burn['cool'] = False + + return temperature, sab, initial_density, burn + +def segment_pin(n_rings, n_wedges, r_fuel, r_gap, r_clad): + """ Calculates a segmented pin. + + Separates a pin with n_rings and n_wedges. All cells have equal volume. + Pin is centered at origin. + """ + + # Calculate all the volumes of interest + v_fuel = math.pi * r_fuel**2 + v_gap = math.pi * r_gap**2 - v_fuel + v_clad = math.pi * r_clad**2 - v_fuel - v_gap + v_ring = v_fuel / n_rings + v_segment = v_ring / n_wedges + + # Compute ring radiuses + r_rings = np.zeros(n_rings) + + for i in range(n_rings): + r_rings[i] = math.sqrt(1.0/(math.pi) * v_ring * (i+1)) + + # Compute thetas + theta = np.linspace(0, 2*math.pi, n_wedges + 1) + + # Compute surfaces + fuel_rings = [openmc.ZCylinder(x0=0, y0=0, R=r_rings[i]) + for i in range(n_rings)] + + fuel_wedges = [openmc.Plane(A=math.cos(theta[i]), B=math.sin(theta[i])) + for i in range(n_wedges)] + + gap_ring = openmc.ZCylinder(x0=0, y0=0, R=r_gap) + clad_ring = openmc.ZCylinder(x0=0, y0=0, R=r_clad) + + # Create cells + fuel_cells = [] + if n_wedges == 1: + for i in range(n_rings): + cell = openmc.Cell(name='fuel') + if i == 0: + cell.region = -fuel_rings[0] + else: + cell.region = +fuel_rings[i-1] & -fuel_rings[i] + fuel_cells.append(cell) + else: + for i in range(n_rings): + for j in range(n_wedges): + cell = openmc.Cell(name='fuel') + if i == 0: + if j != n_wedges-1: + cell.region = (-fuel_rings[0] + & +fuel_wedges[j] + & -fuel_wedges[j+1]) + else: + cell.region = (-fuel_rings[0] + & +fuel_wedges[j] + & -fuel_wedges[0]) + else: + if j != n_wedges-1: + cell.region = (+fuel_rings[i-1] + & -fuel_rings[i] + & +fuel_wedges[j] + & -fuel_wedges[j+1]) + else: + cell.region = (+fuel_rings[i-1] + & -fuel_rings[i] + & +fuel_wedges[j] + & -fuel_wedges[0]) + fuel_cells.append(cell) + + # Gap ring + gap_cell = openmc.Cell(name='gap') + gap_cell.region = +fuel_rings[-1] & -gap_ring + fuel_cells.append(gap_cell) + + # Clad ring + clad_cell = openmc.Cell(name='clad') + clad_cell.region = +gap_ring & -clad_ring + fuel_cells.append(clad_cell) + + # Moderator + mod_cell = openmc.Cell(name='cool') + mod_cell.region = +clad_ring + fuel_cells.append(mod_cell) + + # Form universe + fuel_u = openmc.Universe() + fuel_u.add_cells(fuel_cells) + + return fuel_u, v_segment, v_gap, v_clad + +def generate_geometry(n_rings, n_wedges): + """ Generates example geometry. + + This function creates the initial geometry, a 9 pin reflective problem. + One pin, containing gadolinium, is discretized into sectors. + + In addition to what one would do with the general OpenMC geometry code, it + is necessary to create a dictionary, volume, that maps a cell ID to a + volume. Further, by naming cells the same as the above materials, the code + can automatically handle the mapping. + + Parameters + ---------- + n_rings : int + Number of rings to generate for the geometry + n_wedges : int + Number of wedges to generate for the geometry + """ + + pitch = 1.26197 + r_fuel = 0.412275 + r_gap = 0.418987 + r_clad = 0.476121 + + n_pin = 3 + + # This table describes the 'fuel' to actual type mapping + # It's not necessary to do it this way. Just adjust the initial conditions + # below. + mapping = ['fuel', 'fuel', 'fuel', + 'fuel', 'fuel_gd', 'fuel', + 'fuel', 'fuel', 'fuel'] + + # Form pin cell + fuel_u, v_segment, v_gap, v_clad = segment_pin(n_rings, n_wedges, r_fuel, r_gap, r_clad) + + # Form lattice + all_water_c = openmc.Cell(name='cool') + all_water_u = openmc.Universe(cells=(all_water_c, )) + + lattice = openmc.RectLattice() + lattice.pitch = [pitch]*2 + lattice.lower_left = [-pitch*n_pin/2, -pitch*n_pin/2] + lattice_array = [[fuel_u for i in range(n_pin)] for j in range(n_pin)] + lattice.universes = lattice_array + lattice.outer = all_water_u + + # Bound universe + x_low = openmc.XPlane(x0=-pitch*n_pin/2, boundary_type='reflective') + x_high = openmc.XPlane(x0=pitch*n_pin/2, boundary_type='reflective') + y_low = openmc.YPlane(y0=-pitch*n_pin/2, boundary_type='reflective') + y_high = openmc.YPlane(y0=pitch*n_pin/2, boundary_type='reflective') + z_low = openmc.ZPlane(z0=-10, boundary_type='reflective') + z_high = openmc.ZPlane(z0=10, boundary_type='reflective') + + # Compute bounding box + lower_left = [-pitch*n_pin/2, -pitch*n_pin/2, -10] + upper_right = [pitch*n_pin/2, pitch*n_pin/2, 10] + + root_c = openmc.Cell(fill=lattice) + root_c.region = (+x_low & -x_high + & +y_low & -y_high + & +z_low & -z_high) + root_u = openmc.Universe(universe_id=0, cells=(root_c, )) + geometry = openmc.Geometry(root_u) + + v_cool = pitch**2 - (v_gap + v_clad + n_rings * n_wedges * v_segment) + + # Store volumes for later usage + volume = {'fuel': v_segment, 'gap':v_gap, 'clad':v_clad, 'cool':v_cool} + + return geometry, volume, mapping, lower_left, upper_right + +def generate_problem(n_rings=5, n_wedges=8): + """ Merges geometry and materials. + + This function initializes the materials for each cell using the dictionaries + provided by generate_initial_number_density. It is assumed a cell named + 'fuel' will have further region differentiation (see mapping). + + Parameters + ---------- + n_rings : int, optional + Number of rings to generate for the geometry + n_wedges : int, optional + Number of wedges to generate for the geometry + """ + + # Get materials dictionary, geometry, and volumes + temperature, sab, initial_density, burn = generate_initial_number_density() + geometry, volume, mapping, lower_left, upper_right = generate_geometry(n_rings, n_wedges) + + # Apply distribmats, fill geometry + cells = geometry.root_universe.get_all_cells() + for cell_id in cells: + cell = cells[cell_id] + if cell.name == 'fuel': + + omc_mats = [] + + for cell_type in mapping: + omc_mat = density_to_mat(initial_density[cell_type]) + + if cell_type in sab: + omc_mat.add_s_alpha_beta(sab[cell_type]) + omc_mat.temperature = temperature[cell_type] + omc_mat.depletable = burn[cell_type] + omc_mat.volume = volume['fuel'] + + omc_mats.append(omc_mat) + + cell.fill = omc_mats + elif cell.name != '': + omc_mat = density_to_mat(initial_density[cell.name]) + + if cell.name in sab: + omc_mat.add_s_alpha_beta(sab[cell.name]) + omc_mat.temperature = temperature[cell.name] + omc_mat.depletable = burn[cell.name] + omc_mat.volume = volume[cell.name] + + cell.fill = omc_mat + + return geometry, lower_left, upper_right From d7f1904e41cb8e00578c476c7ec75a62d9174101 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 21 Feb 2018 10:15:42 -0600 Subject: [PATCH 075/231] Move simple chains into tests directory --- {chains => tests}/chain_simple.xml | 0 {chains => tests}/chain_test.xml | 0 tests/regression_tests/test_deplete_full.py | 2 +- tests/unit_tests/test_deplete_chain.py | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) rename {chains => tests}/chain_simple.xml (100%) rename {chains => tests}/chain_test.xml (100%) diff --git a/chains/chain_simple.xml b/tests/chain_simple.xml similarity index 100% rename from chains/chain_simple.xml rename to tests/chain_simple.xml diff --git a/chains/chain_test.xml b/tests/chain_test.xml similarity index 100% rename from chains/chain_test.xml rename to tests/chain_test.xml diff --git a/tests/regression_tests/test_deplete_full.py b/tests/regression_tests/test_deplete_full.py index 2286af908a..fb31ac0c03 100644 --- a/tests/regression_tests/test_deplete_full.py +++ b/tests/regression_tests/test_deplete_full.py @@ -43,7 +43,7 @@ def test_full(run_in_tmpdir): settings.verbosity = 3 # Create operator - chain_file = Path(__file__).parents[2] / 'chains' / 'chain_simple.xml' + chain_file = Path(__file__).parents[1] / 'chain_simple.xml' op = openmc.deplete.Operator(geometry, settings, chain_file) op.round_number = True diff --git a/tests/unit_tests/test_deplete_chain.py b/tests/unit_tests/test_deplete_chain.py index 7ac3e2f8dd..8fc01b4270 100644 --- a/tests/unit_tests/test_deplete_chain.py +++ b/tests/unit_tests/test_deplete_chain.py @@ -8,7 +8,7 @@ import numpy as np from openmc.deplete import comm, Chain, reaction_rates, nuclide -_test_filename = str(Path(__file__).parents[2] / 'chains' / 'chain_test.xml') +_test_filename = str(Path(__file__).parents[1] / 'chain_test.xml') def test_init(): From 7ef5174274fb4fb034d0fb710db6e5b5a1756858 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 21 Feb 2018 10:31:57 -0600 Subject: [PATCH 076/231] Move test chain directly into test_deplete_chain --- tests/chain_test.xml | 23 ------------ tests/unit_tests/test_deplete_chain.py | 48 ++++++++++++++++++++++---- 2 files changed, 41 insertions(+), 30 deletions(-) delete mode 100644 tests/chain_test.xml diff --git a/tests/chain_test.xml b/tests/chain_test.xml deleted file mode 100644 index c8c75ad7b3..0000000000 --- a/tests/chain_test.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - 0.0253 - - A B - 0.0292737 0.002566345 - - - - diff --git a/tests/unit_tests/test_deplete_chain.py b/tests/unit_tests/test_deplete_chain.py index 8fc01b4270..f7e7899a30 100644 --- a/tests/unit_tests/test_deplete_chain.py +++ b/tests/unit_tests/test_deplete_chain.py @@ -6,9 +6,44 @@ from pathlib import Path import numpy as np from openmc.deplete import comm, Chain, reaction_rates, nuclide +import pytest + +from tests import cdtemp -_test_filename = str(Path(__file__).parents[1] / 'chain_test.xml') +_TEST_CHAIN = """\ + + + + + + + + + + + + + + + + 0.0253 + + A B + 0.0292737 0.002566345 + + + + +""" + + +@pytest.fixture(scope='module') +def simple_chain(): + with cdtemp(): + with open('chain_test.xml', 'w') as fh: + fh.write(_TEST_CHAIN) + yield Chain.from_xml('chain_test.xml') def test_init(): @@ -33,13 +68,13 @@ def test_from_endf(): pass -def test_from_xml(): +def test_from_xml(simple_chain): """Read chain_test.xml and ensure all values are correct.""" # Unfortunately, this routine touches a lot of the code, but most of # the components external to depletion_chain.py are simple storage # types. - chain = Chain.from_xml(_test_filename) + chain = simple_chain # Basic checks assert len(chain) == 3 @@ -125,16 +160,15 @@ def test_export_to_xml(run_in_tmpdir): chain.nuclides = [A, B, C] chain.export_to_xml(filename) - original = open(_test_filename, 'r').read() chain_xml = open(filename, 'r').read() - assert original == chain_xml + assert _TEST_CHAIN == chain_xml -def test_form_matrix(): +def test_form_matrix(simple_chain): """ Using chain_test, and a dummy reaction rate, compute the matrix. """ # Relies on test_from_xml passing. - chain = Chain.from_xml(_test_filename) + chain = simple_chain mats = ["10000", "10001"] nuclides = ["A", "B", "C"] From 8a4cdf39921ed6f5d509a42f87f5165d6a70e5c6 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 21 Feb 2018 11:30:27 -0600 Subject: [PATCH 077/231] Fix two broken links in user's guide --- docs/source/usersguide/beginners.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/usersguide/beginners.rst b/docs/source/usersguide/beginners.rst index 22b09a24d3..ec37d0825a 100644 --- a/docs/source/usersguide/beginners.rst +++ b/docs/source/usersguide/beginners.rst @@ -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 From 92697ec06eae659cfd3a801d7bca52efee81cb2d Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 21 Feb 2018 15:36:27 -0600 Subject: [PATCH 078/231] Introduce ResultsList class to replace scattered functions --- docs/source/pythonapi/deplete.rst | 2 +- openmc/deplete/__init__.py | 2 +- openmc/deplete/integrator/__init__.py | 1 - openmc/deplete/integrator/cecm.py | 16 +-- openmc/deplete/integrator/predictor.py | 12 +- openmc/deplete/integrator/save_results.py | 42 ------- openmc/deplete/results.py | 93 +++++++++------- openmc/deplete/results_list.py | 105 ++++++++++++++++++ openmc/deplete/utilities.py | 101 ----------------- tests/dummy_operator.py | 42 ++++--- tests/regression_tests/test_deplete_full.py | 10 +- tests/unit_tests/test_deplete_cecm.py | 8 +- tests/unit_tests/test_deplete_integrator.py | 12 +- tests/unit_tests/test_deplete_predictor.py | 8 +- .../test_deplete_resultslist.py} | 28 ++--- 15 files changed, 220 insertions(+), 262 deletions(-) delete mode 100644 openmc/deplete/integrator/save_results.py create mode 100644 openmc/deplete/results_list.py delete mode 100644 openmc/deplete/utilities.py rename tests/{regression_tests/test_deplete_utilities.py => unit_tests/test_deplete_resultslist.py} (62%) diff --git a/docs/source/pythonapi/deplete.rst b/docs/source/pythonapi/deplete.rst index 1d1a1c0ee5..61c5dd18c4 100644 --- a/docs/source/pythonapi/deplete.rst +++ b/docs/source/pythonapi/deplete.rst @@ -59,6 +59,7 @@ data, such as number densities and reaction rates for each material. OperatorResult ReactionRates Results + ResultsList TransportOperator Each of the integrator functions also relies on a number of "helper" functions @@ -71,4 +72,3 @@ as follows: integrator.CRAM16 integrator.CRAM48 - integrator.save_results diff --git a/openmc/deplete/__init__.py b/openmc/deplete/__init__.py index 33b6d9af14..e49c4e69cf 100644 --- a/openmc/deplete/__init__.py +++ b/openmc/deplete/__init__.py @@ -20,5 +20,5 @@ from .operator import * from .reaction_rates import * from .abc import * from .results import * +from .results_list import * from .integrator import * -from .utilities import * diff --git a/openmc/deplete/integrator/__init__.py b/openmc/deplete/integrator/__init__.py index 607650dc69..cf8caffdfe 100644 --- a/openmc/deplete/integrator/__init__.py +++ b/openmc/deplete/integrator/__init__.py @@ -8,4 +8,3 @@ The integrator subcomponents. from .cecm import * from .cram import * from .predictor import * -from .save_results import * diff --git a/openmc/deplete/integrator/cecm.py b/openmc/deplete/integrator/cecm.py index 9a07cd198f..61b58d0b95 100644 --- a/openmc/deplete/integrator/cecm.py +++ b/openmc/deplete/integrator/cecm.py @@ -4,7 +4,7 @@ import copy from collections.abc import Iterable from .cram import deplete -from .save_results import save_results +from ..results import Results def cecm(operator, timesteps, power, print_out=True): @@ -51,20 +51,20 @@ def cecm(operator, timesteps, power, print_out=True): for i, (dt, p) in enumerate(zip(timesteps, power)): # Get beginning-of-timestep reaction rates x = [copy.deepcopy(vec)] - results = [operator(x[0], p)] + op_results = [operator(x[0], p)] # Deplete for first half of timestep - x_middle = deplete(chain, x[0], results[0], dt/2, print_out) + x_middle = deplete(chain, x[0], op_results[0], dt/2, print_out) # Get middle-of-timestep reaction rates x.append(x_middle) - results.append(operator(x_middle, p)) + op_results.append(operator(x_middle, p)) # Deplete for full timestep using beginning-of-step materials - x_end = deplete(chain, x[0], results[1], dt, print_out) + x_end = deplete(chain, x[0], op_results[1], dt, print_out) # Create results, write to disk - save_results(operator, x, results, [t, t + dt], i) + Results.save(operator, x, op_results, [t, t + dt], i) # Advance time, update vector t += dt @@ -72,7 +72,7 @@ def cecm(operator, timesteps, power, print_out=True): # Perform one last simulation x = [copy.deepcopy(vec)] - results = [operator(x[0], power[-1])] + op_results = [operator(x[0], power[-1])] # Create results, write to disk - save_results(operator, x, results, [t, t], len(timesteps)) + Results.save(operator, x, op_results, [t, t], len(timesteps)) diff --git a/openmc/deplete/integrator/predictor.py b/openmc/deplete/integrator/predictor.py index 444ca7baa7..9be992c16a 100644 --- a/openmc/deplete/integrator/predictor.py +++ b/openmc/deplete/integrator/predictor.py @@ -4,7 +4,7 @@ import copy from collections.abc import Iterable from .cram import deplete -from .save_results import save_results +from ..results import Results def predictor(operator, timesteps, power, print_out=True): @@ -46,13 +46,13 @@ def predictor(operator, timesteps, power, print_out=True): for i, (dt, p) in enumerate(zip(timesteps, power)): # Get beginning-of-timestep reaction rates x = [copy.deepcopy(vec)] - results = [operator(x[0], p)] + op_results = [operator(x[0], p)] # Create results, write to disk - save_results(operator, x, results, [t, t + dt], i) + Results.save(operator, x, op_results, [t, t + dt], i) # Deplete for full timestep - x_end = deplete(chain, x[0], results[0], dt, print_out) + x_end = deplete(chain, x[0], op_results[0], dt, print_out) # Advance time, update vector t += dt @@ -60,7 +60,7 @@ def predictor(operator, timesteps, power, print_out=True): # Perform one last simulation x = [copy.deepcopy(vec)] - results = [operator(x[0], power[-1])] + op_results = [operator(x[0], power[-1])] # Create results, write to disk - save_results(operator, x, results, [t, t], len(timesteps)) + Results.save(operator, x, op_results, [t, t], len(timesteps)) diff --git a/openmc/deplete/integrator/save_results.py b/openmc/deplete/integrator/save_results.py deleted file mode 100644 index 98245fdeae..0000000000 --- a/openmc/deplete/integrator/save_results.py +++ /dev/null @@ -1,42 +0,0 @@ -""" Generic result saving code for integrators. - -""" -from ..results import Results, write_results - - -def save_results(op, x, op_results, t, step_ind): - """Creates and writes depletion results to disk - - Parameters - ---------- - op : openmc.deplete.TransportOperator - The operator used to generate these results. - x : list of list of numpy.array - The prior x vectors. Indexed [i][cell] using the above equation. - op_results : list of openmc.deplete.OperatorResult - Results of applying transport operator - t : list of float - Time indices. - step_ind : int - Step index. - - """ - # Get indexing terms - vol_dict, nuc_list, burn_list, full_burn_list = op.get_results_info() - - # Create results - stages = len(x) - results = Results() - results.allocate(vol_dict, nuc_list, burn_list, full_burn_list, stages) - - n_mat = len(burn_list) - - for i in range(stages): - for mat_i in range(n_mat): - results[i, mat_i, :] = x[i][mat_i][:] - - results.k = [r.k for r in op_results] - results.rates = [r.rates for r in op_results] - results.time = t - - write_results(results, "depletion_results.h5", step_ind) diff --git a/openmc/deplete/results.py b/openmc/deplete/results.py index b7e5623c7d..ab740e61ec 100644 --- a/openmc/deplete/results.py +++ b/openmc/deplete/results.py @@ -11,7 +11,6 @@ import h5py from . import comm, have_mpi from .reaction_rates import ReactionRates -from openmc.checkvalue import check_filetype_version _VERSION_RESULTS = (1, 0) @@ -146,6 +145,27 @@ class Results(object): # Create storage array self.data = np.zeros((stages, self.n_mat, self.n_nuc)) + def export_to_hdf5(self, filename, step): + """Export results to an HDF5 file + + Parameters + ---------- + filename : str + The filename to write to + step : int + What step is this? + + """ + if have_mpi and h5py.get_config().mpi: + kwargs = {'driver': 'mpio', 'comm': comm} + else: + kwargs = {} + + kwargs['mode'] = "w" if step == 0 else "a" + + with h5py.File(filename, **kwargs) as handle: + self._to_hdf5(handle, step) + def _write_hdf5_metadata(self, handle): """Writes result metadata in HDF5 file @@ -217,7 +237,7 @@ class Results(object): handle.create_dataset("time", (1, 2), maxshape=(None, 2), dtype='float64') - def to_hdf5(self, handle, index): + def _to_hdf5(self, handle, index): """Converts results object into an hdf5 object. Parameters @@ -338,49 +358,40 @@ class Results(object): return results + @staticmethod + def save(op, x, op_results, t, step_ind): + """Creates and writes depletion results to disk -def write_results(result, filename, step): - """Outputs result to an HDF5 file. + Parameters + ---------- + op : openmc.deplete.TransportOperator + The operator used to generate these results. + x : list of list of numpy.array + The prior x vectors. Indexed [i][cell] using the above equation. + op_results : list of openmc.deplete.OperatorResult + Results of applying transport operator + t : list of float + Time indices. + step_ind : int + Step index. - Parameters - ---------- - result : Results - Object to be stored in a file. - filename : String - Target filename. - step : int - What step is this? + """ + # Get indexing terms + vol_dict, nuc_list, burn_list, full_burn_list = op.get_results_info() - """ - if have_mpi and h5py.get_config().mpi: - kwargs = {'driver': 'mpio', 'comm': comm} - else: - kwargs = {} + # Create results + stages = len(x) + results = Results() + results.allocate(vol_dict, nuc_list, burn_list, full_burn_list, stages) - kwargs['mode'] = "w" if step == 0 else "a" + n_mat = len(burn_list) - with h5py.File(filename, **kwargs) as handle: - result.to_hdf5(handle, step) + for i in range(stages): + for mat_i in range(n_mat): + results[i, mat_i, :] = x[i][mat_i][:] + results.k = [r.k for r in op_results] + results.rates = [r.rates for r in op_results] + results.time = t -def read_results(filename): - """Return a list of Results objects from an HDF5 file. - - Parameters - ---------- - filename : str - The filename to read from. - - Returns - ------- - results : list of openmc.deplete.Results - The result objects. - - """ - with h5py.File(str(filename), "r") as fh: - check_filetype_version(fh, 'depletion results', _VERSION_RESULTS[0]) - - # Get number of results stored - n = fh["number"].value.shape[0] - - return [Results.from_hdf5(fh, i) for i in range(n)] + results.export_to_hdf5("depletion_results.h5", step_ind) diff --git a/openmc/deplete/results_list.py b/openmc/deplete/results_list.py new file mode 100644 index 0000000000..d3d45e955b --- /dev/null +++ b/openmc/deplete/results_list.py @@ -0,0 +1,105 @@ +import h5py +import numpy as np + +from .results import Results, _VERSION_RESULTS +from openmc.checkvalue import check_filetype_version + + +class ResultsList(list): + """A list of openmc.deplete.Results objects + + Parameters + ---------- + filename : str + The filename to read from. + + """ + def __init__(self, filename): + super().__init__() + with h5py.File(str(filename), "r") as fh: + check_filetype_version(fh, 'depletion results', _VERSION_RESULTS[0]) + + # Get number of results stored + n = fh["number"].value.shape[0] + + for i in range(n): + self.append(Results.from_hdf5(fh, i)) + + def get_atoms(self, mat, nuc): + """Get nuclide concentration over time from a single material + + Parameters + ---------- + mat : str + Material name to evaluate + nuc : str + Nuclide name to evaluate + + Returns + ------- + time : numpy.ndarray + Array of times in [s] + concentration : numpy.ndarray + Total number of atoms for specified nuclide + + """ + time = np.empty_like(self) + concentration = np.empty_like(self) + + # Evaluate value in each region + for i, result in enumerate(self): + time[i] = result.time[0] + concentration[i] = result[0, mat, nuc] + + return time, concentration + + def get_reaction_rate(self, mat, nuc, rx): + """Get reaction rate in a single material/nuclide over time + + Parameters + ---------- + mat : str + Material name to evaluate + nuc : str + Nuclide name to evaluate + rx : str + Reaction rate to evaluate + + Returns + ------- + time : numpy.ndarray + Array of times in [s] + rate : numpy.ndarray + Array of reaction rates + + """ + time = np.empty_like(self) + rate = np.empty_like(self) + + # Evaluate value in each region + for i, result in enumerate(self): + time[i] = result.time[0] + rate[i] = result.rates[0].get(mat, nuc, rx) * result[0, mat, nuc] + + return time, rate + + def get_eigenvalue(self): + """Evaluates the eigenvalue from a results list. + + Returns + ------- + time : numpy.ndarray + Array of times in [s] + eigenvalue : numpy.ndarray + k-eigenvalue at each time + + """ + time = np.empty_like(self) + eigenvalue = np.empty_like(self) + + # Get time/eigenvalue at each point + for i, result in enumerate(self): + time[i] = result.time[0] + eigenvalue[i] = result.k[0] + + return time, eigenvalue diff --git a/openmc/deplete/utilities.py b/openmc/deplete/utilities.py deleted file mode 100644 index 59d5305465..0000000000 --- a/openmc/deplete/utilities.py +++ /dev/null @@ -1,101 +0,0 @@ -"""The utilities module. - -Contains functions that can be used to post-process objects that come out of -the results module. -""" - -import numpy as np - - -def evaluate_single_nuclide(results, mat, nuc): - """Evaluates a single nuclide in a single material from a results list. - - Parameters - ---------- - results : list of results - The results to extract data from. Must be sorted and continuous. - mat : str - Material name to evaluate - nuc : str - Nuclide name to evaluate - - Returns - ------- - time : numpy.ndarray - Time vector - concentration : numpy.ndarray - Total number of atoms in the material - - """ - n_points = len(results) - time = np.zeros(n_points) - concentration = np.zeros(n_points) - - # Evaluate value in each region - for i, result in enumerate(results): - time[i] = result.time[0] - concentration[i] = result[0, mat, nuc] - - return time, concentration - - -def evaluate_reaction_rate(results, mat, nuc, rx): - """Return reaction rate in a single material/nuclide from a results list. - - Parameters - ---------- - results : list of openmc.deplete.Results - The results to extract data from. Must be sorted and continuous. - mat : str - Material name to evaluate - nuc : str - Nuclide name to evaluate - rx : str - Reaction rate to evaluate - - Returns - ------- - time : numpy.ndarray - Time vector. - rate : numpy.ndarray - Reaction rate. - - """ - n_points = len(results) - time = np.zeros(n_points) - rate = np.zeros(n_points) - # Evaluate value in each region - for i, result in enumerate(results): - time[i] = result.time[0] - rate[i] = result.rates[0].get(mat, nuc, rx) * result[0, mat, nuc] - - return time, rate - - -def evaluate_eigenvalue(results): - """Evaluates the eigenvalue from a results list. - - Parameters - ---------- - results : list of openmc.deplete.Results - The results to extract data from. Must be sorted and continuous. - - Returns - ------- - time : numpy.ndarray - Time vector. - eigenvalue : numpy.ndarray - Eigenvalue. - - """ - n_points = len(results) - time = np.zeros(n_points) - eigenvalue = np.zeros(n_points) - - # Evaluate value in each region - for i, result in enumerate(results): - - time[i] = result.time[0] - eigenvalue[i] = result.k[0] - - return time, eigenvalue diff --git a/tests/dummy_operator.py b/tests/dummy_operator.py index 706793d93f..05fe97a950 100644 --- a/tests/dummy_operator.py +++ b/tests/dummy_operator.py @@ -34,19 +34,15 @@ class DummyOperator(TransportOperator): Returns ------- - k : float - Zero. - rates : ReactionRates - Reaction rates from this simulation. - seed : int - Zero. + openmc.deplete.OperatorResult + Result of transport operator + """ + mats = ["1"] + nuclides = ["1", "2"] + reactions = ["1"] - cell_to_ind = {"1" : 0} - nuc_to_ind = {"1" : 0, "2" : 1} - react_to_ind = {"1" : 0} - - reaction_rates = ReactionRates(cell_to_ind, nuc_to_ind, react_to_ind) + reaction_rates = ReactionRates(mats, nuclides, reactions) reaction_rates[0, 0, 0] = vec[0][0] reaction_rates[0, 1, 0] = vec[0][1] @@ -105,18 +101,18 @@ class DummyOperator(TransportOperator): return ["1", "2"] @property - def burn_list(self): + def local_mats(self): """ - burn_list : list of str - A list of all cell IDs to be burned. Used for sorting the simulation. + local_mats : list of str + A list of all material IDs to be burned. Used for sorting the simulation. """ return ["1"] @property - def mat_tally_ind(self): + def burnable_mats(self): """Maps cell name to index in global geometry.""" - return {"1": 0} + return self.local_mats @property @@ -125,11 +121,11 @@ class DummyOperator(TransportOperator): reaction_rates : ReactionRates Reaction rates from the last operator step. """ - cell_to_ind = {"1" : 0} - nuc_to_ind = {"1" : 0, "2" : 1} - react_to_ind = {"1" : 0} + mats = ["1"] + nuclides = ["1", "2"] + reactions = ["1"] - return ReactionRates(cell_to_ind, nuc_to_ind, react_to_ind) + return ReactionRates(mats, nuclides, reactions) def initial_condition(self): """Returns initial vector. @@ -153,8 +149,8 @@ class DummyOperator(TransportOperator): A list of all nuclide names. Used for sorting the simulation. burn_list : list of int A list of all cell IDs to be burned. Used for sorting the simulation. - full_burn_dict : OrderedDict of str to int + full_burn_list : OrderedDict of str to int Maps cell name to index in global geometry. - """ - return self.volume, self.nuc_list, self.burn_list, self.mat_tally_ind + """ + return self.volume, self.nuc_list, self.local_mats, self.burnable_mats diff --git a/tests/regression_tests/test_deplete_full.py b/tests/regression_tests/test_deplete_full.py index fb31ac0c03..19e2c7664b 100644 --- a/tests/regression_tests/test_deplete_full.py +++ b/tests/regression_tests/test_deplete_full.py @@ -8,8 +8,6 @@ import numpy as np import openmc from openmc.data import JOULE_PER_EV import openmc.deplete -from openmc.deplete import results -from openmc.deplete import utilities from tests.regression_tests import config from .example_geometry import generate_problem @@ -67,8 +65,8 @@ def test_full(run_in_tmpdir): return # Load the reference/test results - res_test = results.read_results(path_test) - res_ref = results.read_results(path_reference) + res_test = openmc.deplete.ResultsList(path_test) + res_ref = openmc.deplete.ResultsList(path_reference) # Assert same mats for mat in res_ref[0].mat_to_ind: @@ -88,8 +86,8 @@ def test_full(run_in_tmpdir): tol = 1.0e-6 for mat in res_test[0].mat_to_ind: for nuc in res_test[0].nuc_to_ind: - _, y_test = utilities.evaluate_single_nuclide(res_test, mat, nuc) - _, y_old = utilities.evaluate_single_nuclide(res_ref, mat, nuc) + _, y_test = res_test.get_atoms(mat, nuc) + _, y_old = res_ref.get_atoms(mat, nuc) # Test each point correct = True diff --git a/tests/unit_tests/test_deplete_cecm.py b/tests/unit_tests/test_deplete_cecm.py index 6deb6cd3dd..466a2eec74 100644 --- a/tests/unit_tests/test_deplete_cecm.py +++ b/tests/unit_tests/test_deplete_cecm.py @@ -5,8 +5,6 @@ These tests integrate a simple test problem described in dummy_geometry.py. from pytest import approx import openmc.deplete -from openmc.deplete import results -from openmc.deplete import utilities from tests import dummy_operator @@ -23,10 +21,10 @@ def test_cecm(run_in_tmpdir): openmc.deplete.cecm(op, dt, power, print_out=False) # Load the files - res = results.read_results(op.output_dir / "depletion_results.h5") + res = openmc.deplete.ResultsList(op.output_dir / "depletion_results.h5") - _, y1 = utilities.evaluate_single_nuclide(res, "1", "1") - _, y2 = utilities.evaluate_single_nuclide(res, "1", "2") + _, y1 = res.get_atoms("1", "1") + _, y2 = res.get_atoms("1", "2") # Mathematica solution s1 = [1.86872629872102, 1.395525772416039] diff --git a/tests/unit_tests/test_deplete_integrator.py b/tests/unit_tests/test_deplete_integrator.py index b209900889..a1768625b2 100644 --- a/tests/unit_tests/test_deplete_integrator.py +++ b/tests/unit_tests/test_deplete_integrator.py @@ -1,4 +1,4 @@ -"""Tests for integrator.py +"""Tests for saving results It is worth noting that openmc.deplete.integrate is extremely complex, to the point I am unsure if it can be reasonably unit-tested. For the time being, it @@ -11,11 +11,11 @@ import os from unittest.mock import MagicMock import numpy as np -from openmc.deplete import (integrator, ReactionRates, results, comm, +from openmc.deplete import (ReactionRates, Results, ResultsList, comm, OperatorResult) -def test_save_results(run_in_tmpdir): +def test_results_save(run_in_tmpdir): """Test data save module""" stages = 3 @@ -72,11 +72,11 @@ def test_save_results(run_in_tmpdir): op_result1 = [OperatorResult(k, rates) for k, rates in zip(eigvl1, rate1)] op_result2 = [OperatorResult(k, rates) for k, rates in zip(eigvl2, rate2)] - integrator.save_results(op, x1, op_result1, t1, 0) - integrator.save_results(op, x2, op_result2, t2, 1) + Results.save(op, x1, op_result1, t1, 0) + Results.save(op, x2, op_result2, t2, 1) # Load the files - res = results.read_results("depletion_results.h5") + res = ResultsList("depletion_results.h5") for i in range(stages): for mat_i, mat in enumerate(burn_list): diff --git a/tests/unit_tests/test_deplete_predictor.py b/tests/unit_tests/test_deplete_predictor.py index 0d283855cb..50803e5085 100644 --- a/tests/unit_tests/test_deplete_predictor.py +++ b/tests/unit_tests/test_deplete_predictor.py @@ -5,8 +5,6 @@ These tests integrate a simple test problem described in dummy_geometry.py. from pytest import approx import openmc.deplete -from openmc.deplete import results -from openmc.deplete import utilities from tests import dummy_operator @@ -23,10 +21,10 @@ def test_predictor(run_in_tmpdir): openmc.deplete.predictor(op, dt, power, print_out=False) # Load the files - res = results.read_results(op.output_dir / "depletion_results.h5") + res = openmc.deplete.ResultsList(op.output_dir / "depletion_results.h5") - _, y1 = utilities.evaluate_single_nuclide(res, "1", "1") - _, y2 = utilities.evaluate_single_nuclide(res, "1", "2") + _, y1 = res.get_atoms("1", "1") + _, y2 = res.get_atoms("1", "2") # Mathematica solution s1 = [2.46847546272295, 0.986431226850467] diff --git a/tests/regression_tests/test_deplete_utilities.py b/tests/unit_tests/test_deplete_resultslist.py similarity index 62% rename from tests/regression_tests/test_deplete_utilities.py rename to tests/unit_tests/test_deplete_resultslist.py index 82d4d56a4c..aad8cd9f68 100644 --- a/tests/regression_tests/test_deplete_utilities.py +++ b/tests/unit_tests/test_deplete_resultslist.py @@ -1,26 +1,22 @@ -""" Tests the utilities classes. - -This also tests the results read/write code. -""" +"""Tests the ResultsList class""" from pathlib import Path import numpy as np import pytest -from openmc.deplete import results -from openmc.deplete import utilities +import openmc.deplete @pytest.fixture def res(): """Load the reference results""" - filename = Path(__file__).with_name('test_reference.h5') - return results.read_results(filename) + filename = Path(__file__).parents[1] / 'regression_tests' / 'test_reference.h5' + return openmc.deplete.ResultsList(filename) -def test_evaluate_single_nuclide(res): - """Tests evaluating single nuclide utility code.""" - t, n = utilities.evaluate_single_nuclide(res, "1", "Xe135") +def test_get_atoms(res): + """Tests evaluating single nuclide concentration.""" + t, n = res.get_atoms("1", "Xe135") t_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] n_ref = [6.6747328233649218e+08, 3.5421791038348462e+14, @@ -29,9 +25,9 @@ def test_evaluate_single_nuclide(res): np.testing.assert_array_equal(t, t_ref) np.testing.assert_array_equal(n, n_ref) -def test_evaluate_reaction_rate(res): - """Tests evaluating reaction rate utility code.""" - t, r = utilities.evaluate_reaction_rate(res, "1", "Xe135", "(n,gamma)") +def test_get_reaction_rate(res): + """Tests evaluating reaction rate.""" + t, r = res.get_reaction_rate("1", "Xe135", "(n,gamma)") t_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] n_ref = np.array([6.6747328233649218e+08, 3.5421791038348462e+14, @@ -43,9 +39,9 @@ def test_evaluate_reaction_rate(res): np.testing.assert_array_equal(r, n_ref * xs_ref) -def test_evaluate_eigenvalue(res): +def test_get_eigenvalue(res): """Tests evaluating eigenvalue.""" - t, k = utilities.evaluate_eigenvalue(res) + t, k = res.get_eigenvalue() t_ref = [0.0, 1296000.0, 2592000.0, 3888000.0] k_ref = [1.181281798790367, 1.1798750921988739, 1.1965943696058159, From 7622a1a39472a64fac950930423b6bedd2b8ff9a Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 22 Feb 2018 16:00:32 -0600 Subject: [PATCH 079/231] Add methods on Material to get mass (if volume specified) --- docs/source/pythonapi/data.rst | 1 + openmc/data/data.py | 20 ++++++++++ openmc/deplete/chain.py | 13 +----- openmc/material.py | 64 +++++++++++++++++++++++++++++- tests/unit_tests/test_data_misc.py | 8 ++++ tests/unit_tests/test_material.py | 17 ++++++++ 6 files changed, 110 insertions(+), 13 deletions(-) diff --git a/docs/source/pythonapi/data.rst b/docs/source/pythonapi/data.rst index 3c221906db..52dc5173b0 100644 --- a/docs/source/pythonapi/data.rst +++ b/docs/source/pythonapi/data.rst @@ -36,6 +36,7 @@ Core Functions openmc.data.thin openmc.data.water_density openmc.data.write_compact_458_library + openmc.data.zam Angle-Energy Distributions -------------------------- diff --git a/openmc/data/data.py b/openmc/data/data.py index 523ac9769d..70bc00bd92 100644 --- a/openmc/data/data.py +++ b/openmc/data/data.py @@ -313,6 +313,26 @@ def water_density(temperature, pressure=0.1013): return coeff / pi / gamma1_pi +def zam(name): + """Return tuple of (atomic number, mass number, metastable state) + + Parameters + ---------- + name : str + Name of nuclide using GND convention, e.g., 'Am242m1' + + Returns + ------- + 3-tuple of int + Atomic number, mass number, and metastable state + + """ + symbol, A, state = re.match(r'([A-Zn][a-z]*)(\d+)((?:_[em]\d+)?)', + name).groups() + metastable = int(state[2:]) if state else 0 + return (ATOMIC_NUMBER[symbol], int(A), metastable) + + # Values here are from the Committee on Data for Science and Technology # (CODATA) 2014 recommendation (doi:10.1103/RevModPhys.88.035009). diff --git a/openmc/deplete/chain.py b/openmc/deplete/chain.py index 23395329eb..bcef5fff11 100644 --- a/openmc/deplete/chain.py +++ b/openmc/deplete/chain.py @@ -40,15 +40,6 @@ _REACTIONS = [ ] -def _get_zai(s): - """Get ZAI value (10000*z + 10*A + metastable state) for sorting purposes""" - symbol, A, state = re.match(r'([A-Zn][a-z]*)(\d+)((?:_[em]\d+)?)', s).groups() - Z = openmc.data.ATOMIC_NUMBER[symbol] - A = int(A) - state = int(state[2:]) if state else 0 - return 10000*Z + 10*A + state - - def replace_missing(product, decay_data): """Replace missing product with suitable decay daughter. @@ -197,7 +188,7 @@ class Chain(object): missing_fpy = [] missing_fp = [] - for idx, parent in enumerate(sorted(decay_data, key=_get_zai)): + for idx, parent in enumerate(sorted(decay_data, key=openmc.data.zam)): data = decay_data[parent] nuclide = Nuclide() @@ -290,7 +281,7 @@ class Chain(object): missing_fp.append((parent, E, yield_replace)) nuclide.yield_data[E] = [] - for k in sorted(yields, key=_get_zai): + for k in sorted(yields, key=openmc.data.zam): nuclide.yield_data[E].append((k, yields[k])) # Display warnings diff --git a/openmc/material.py b/openmc/material.py index e409d6536c..351e2db272 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -52,8 +52,7 @@ class Material(IDManagerMixin): 'atom/b-cm', 'atom/cm3', 'sum', or 'macro'. The 'macro' unit only applies in the case of a multi-group calculation. depletable : bool - Indicate whether the material is depletable. This attribute can be used - by downstream depletion applications. + Indicate whether the material is depletable. nuclides : list of tuple List in which each item is a 3-tuple consisting of a nuclide string, the percent density, and the percent type ('ao' or 'wo'). @@ -74,6 +73,9 @@ class Material(IDManagerMixin): :meth:`Geometry.determine_paths` method. num_instances : int The number of instances of this material throughout the geometry. + fissionable_mass : float + Mass of fissionable nuclides in the material in [g]. Requires that the + :attr:`volume` attribute is set. """ @@ -245,6 +247,18 @@ class Material(IDManagerMixin): str) self._isotropic = list(isotropic) + @property + def fissionable_mass(self): + if self.volume is None: + raise ValueError("Volume must be set in order to determine mass.") + density = 0.0 + for nuc, atoms_per_cc in self.get_nuclide_atom_densities().values(): + Z = openmc.data.zam(nuc)[0] + if Z >= 90: + density += 1e24 * atoms_per_cc * openmc.data.atomic_mass(nuc) \ + / openmc.data.AVOGADRO + return density*self.volume + @classmethod def from_hdf5(cls, group): """Create material from HDF5 group @@ -687,7 +701,53 @@ class Material(IDManagerMixin): return nuclides + def get_mass_density(self, nuclide=None): + """Return mass density of one or all nuclides + + Parameters + ---------- + nuclides : str, optional + Nuclide for which density is desired. If not specified, the density + for the entire material is given. + + Returns + ------- + float + Density of the nuclide/material in [g/cm^3] + + """ + mass_density = 0.0 + for nuc, atoms_per_cc in self.get_nuclide_atom_densities().values(): + density_i = 1e24 * atoms_per_cc * openmc.data.atomic_mass(nuc) \ + / openmc.data.AVOGADRO + if nuclide is None or nuclide == nuc: + mass_density += density_i + return mass_density + + def get_mass(self, nuclide=None): + """Return mass of one or all nuclides. + + Note that this method requires that the :attr:`Material.volume` has + already been set. + + Parameters + ---------- + nuclides : str, optional + Nuclide for which mass is desired. If not specified, the density + for the entire material is given. + + Returns + ------- + float + Mass of the nuclide/material in [g] + + """ + if self.volume is None: + raise ValueError("Volume must be set in order to determine mass.") + return self.volume*self.get_mass_density(nuclide) + def clone(self, memo=None): + """Create a copy of this material with a new unique ID. Parameters diff --git a/tests/unit_tests/test_data_misc.py b/tests/unit_tests/test_data_misc.py index 433d34adb9..7d00b7bc77 100644 --- a/tests/unit_tests/test_data_misc.py +++ b/tests/unit_tests/test_data_misc.py @@ -58,3 +58,11 @@ def test_water_density(): assert dens(300.0, 3.0) == pytest.approx(1e-3/0.100215168e-2, 1e-6) assert dens(300.0, 80.0) == pytest.approx(1e-3/0.971180894e-3, 1e-6) assert dens(500.0, 3.0) == pytest.approx(1e-3/0.120241800e-2, 1e-6) + + +def test_zam(): + assert openmc.data.zam('H1') == (1, 1, 0) + assert openmc.data.zam('Zr90') == (40, 90, 0) + assert openmc.data.zam('Am242') == (95, 242, 0) + assert openmc.data.zam('Am242_m1') == (95, 242, 1) + assert openmc.data.zam('Am242_m10') == (95, 242, 10) diff --git a/tests/unit_tests/test_material.py b/tests/unit_tests/test_material.py index 2265215417..c251df3a6d 100644 --- a/tests/unit_tests/test_material.py +++ b/tests/unit_tests/test_material.py @@ -121,6 +121,23 @@ def test_get_nuclide_atom_densities(uo2): assert density > 0 +def test_mass(): + m = openmc.Material() + m.add_nuclide('Zr90', 1.0, 'wo') + m.add_nuclide('U235', 1.0, 'wo') + m.set_density('g/cm3', 2.0) + m.volume = 10.0 + + assert m.get_mass_density('Zr90') == pytest.approx(1.0) + assert m.get_mass_density('U235') == pytest.approx(1.0) + assert m.get_mass_density() == pytest.approx(2.0) + + assert m.get_mass('Zr90') == pytest.approx(10.0) + assert m.get_mass('U235') == pytest.approx(10.0) + assert m.get_mass() == pytest.approx(20.0) + assert m.fissionable_mass == pytest.approx(10.0) + + def test_materials(run_in_tmpdir): m1 = openmc.Material() m1.add_nuclide('U235', 1.0, 'wo') From ab00421c0eda42adb29a90e49e08230cbebaa9a5 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 23 Feb 2018 11:37:55 -0600 Subject: [PATCH 080/231] Add test for Chain.from_endf. Remove tqdm dependence. --- docs/source/conf.py | 2 +- openmc/data/endf.py | 5 +-- openmc/deplete/chain.py | 42 ++++++++++++-------------- setup.py | 2 +- tests/unit_tests/test_deplete_chain.py | 14 +++++++-- 5 files changed, 35 insertions(+), 30 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index a2fec39b75..eeecba23e4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -26,7 +26,7 @@ MOCK_MODULES = [ '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', 'tqdm', 'openmoc', + 'matplotlib', 'matplotlib.pyplot', 'openmoc', 'openmc.data.reconstruct' ] sys.modules.update((mod_name, MagicMock()) for mod_name in MOCK_MODULES) diff --git a/openmc/data/endf.py b/openmc/data/endf.py index 160ab61513..db94e15bea 100644 --- a/openmc/data/endf.py +++ b/openmc/data/endf.py @@ -10,6 +10,7 @@ import io import re import os from math import pi +from pathlib import PurePath from collections import OrderedDict from collections.abc import Iterable @@ -299,8 +300,8 @@ class Evaluation(object): """ def __init__(self, filename_or_obj): - if isinstance(filename_or_obj, str): - fh = open(filename_or_obj, 'r') + if isinstance(filename_or_obj, (str, PurePath)): + fh = open(str(filename_or_obj), 'r') else: fh = filename_or_obj self.section = {} diff --git a/openmc/deplete/chain.py b/openmc/deplete/chain.py index bcef5fff11..612ec29cb9 100644 --- a/openmc/deplete/chain.py +++ b/openmc/deplete/chain.py @@ -20,7 +20,6 @@ try: except ImportError: import xml.etree.ElementTree as ET _have_lxml = False -from tqdm import tqdm import scipy.sparse as sp import openmc.data @@ -153,34 +152,31 @@ class Chain(object): chain = cls() # Create dictionary mapping target to filename + print('Processing neutron sub-library files...') reactions = {} - with tqdm(neutron_files) as pbar: - for f in pbar: - pbar.set_description('Processing {}'.format(os.path.basename(f))) - evaluation = openmc.data.endf.Evaluation(f) - name = evaluation.gnd_name - reactions[name] = {} - for mf, mt, nc, mod in evaluation.reaction_list: - if mf == 3: - file_obj = StringIO(evaluation.section[3, mt]) - openmc.data.endf.get_head_record(file_obj) - q_value = openmc.data.endf.get_cont_record(file_obj)[1] - reactions[name][mt] = q_value + for f in neutron_files: + evaluation = openmc.data.endf.Evaluation(f) + name = evaluation.gnd_name + reactions[name] = {} + for mf, mt, nc, mod in evaluation.reaction_list: + if mf == 3: + file_obj = StringIO(evaluation.section[3, mt]) + openmc.data.endf.get_head_record(file_obj) + q_value = openmc.data.endf.get_cont_record(file_obj)[1] + reactions[name][mt] = q_value # Determine what decay and FPY nuclides are available + print('Processing decay sub-library files...') decay_data = {} - with tqdm(decay_files) as pbar: - for f in pbar: - pbar.set_description('Processing {}'.format(os.path.basename(f))) - data = openmc.data.Decay(f) - decay_data[data.nuclide['name']] = data + for f in decay_files: + data = openmc.data.Decay(f) + decay_data[data.nuclide['name']] = data + print('Processing fission product yield sub-library files...') fpy_data = {} - with tqdm(fpy_files) as pbar: - for f in pbar: - pbar.set_description('Processing {}'.format(os.path.basename(f))) - data = openmc.data.FissionProductYields(f) - fpy_data[data.nuclide['name']] = data + for f in fpy_files: + data = openmc.data.FissionProductYields(f) + fpy_data[data.nuclide['name']] = data print('Creating depletion_chain...') missing_daughter = [] diff --git a/setup.py b/setup.py index ee11f414b6..2a42dd65dd 100755 --- a/setup.py +++ b/setup.py @@ -57,7 +57,7 @@ kwargs = { # Required dependencies 'install_requires': [ 'numpy>=1.9', 'h5py', 'scipy', 'ipython', 'matplotlib', - 'pandas', 'lxml', 'uncertainties', 'tqdm' + 'pandas', 'lxml', 'uncertainties' ], # Optional dependencies diff --git a/tests/unit_tests/test_deplete_chain.py b/tests/unit_tests/test_deplete_chain.py index f7e7899a30..4ec5415ee9 100644 --- a/tests/unit_tests/test_deplete_chain.py +++ b/tests/unit_tests/test_deplete_chain.py @@ -5,11 +5,13 @@ import os from pathlib import Path import numpy as np +from openmc.data import zam, ATOMIC_SYMBOL from openmc.deplete import comm, Chain, reaction_rates, nuclide import pytest from tests import cdtemp +_ENDF_DATA = Path(os.environ['OPENMC_ENDF_DATA']) _TEST_CHAIN = """\ @@ -63,9 +65,15 @@ def test_len(): def test_from_endf(): - """Test depletion chain building from ENDF. Empty at the moment until we figure - out a good way to unit-test this.""" - pass + """Test depletion chain building from ENDF files""" + decay_data = (_ENDF_DATA / 'decay').glob('*.endf') + fpy_data = (_ENDF_DATA / 'nfy').glob('*.endf') + neutron_data = (_ENDF_DATA / 'neutrons').glob('*.endf') + chain = Chain.from_endf(decay_data, fpy_data, neutron_data) + + assert len(chain) == len(chain.nuclides) == len(chain.nuclide_dict) == 3821 + for nuc in chain.nuclides: + assert nuc == chain[nuc.name] def test_from_xml(simple_chain): From fc73f195a520bf39772d86fd8d6260f40c5842fc Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 23 Feb 2018 11:54:16 -0600 Subject: [PATCH 081/231] Mention mpi4py as optional dependency in docs --- docs/source/usersguide/install.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/source/usersguide/install.rst b/docs/source/usersguide/install.rst index 9b11d1dce4..24bcc7164d 100644 --- a/docs/source/usersguide/install.rst +++ b/docs/source/usersguide/install.rst @@ -452,6 +452,11 @@ distributions. .. admonition:: Optional :class: note + `mpi4py `_ + 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 `_ Cython is used for resonance reconstruction for ENDF data converted to :class:`openmc.data.IncidentNeutron`. From 13a167393d9bccb173e0c1e6584cbecf5b6e8ef0 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 23 Feb 2018 14:59:13 -0600 Subject: [PATCH 082/231] Add archive destination in CMakeLists.txt for building static --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 71934a47cc..d3673df26c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -496,7 +496,8 @@ add_custom_command(TARGET libopenmc POST_BUILD install(TARGETS ${program} libopenmc RUNTIME DESTINATION bin - LIBRARY DESTINATION lib) + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) install(DIRECTORY src/relaxng DESTINATION share/openmc) install(FILES man/man1/openmc.1 DESTINATION share/man/man1) install(FILES LICENSE DESTINATION "share/doc/${program}" RENAME copyright) From 09a63ec3e71734daf1ae88f5be1b286b45396f04 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sat, 24 Feb 2018 15:07:58 -0600 Subject: [PATCH 083/231] Remove blank line that was added --- openmc/material.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openmc/material.py b/openmc/material.py index 351e2db272..5fdcb76894 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -747,7 +747,6 @@ class Material(IDManagerMixin): return self.volume*self.get_mass_density(nuclide) def clone(self, memo=None): - """Create a copy of this material with a new unique ID. Parameters From cc57551bd3746f6e1a26a85f309193031474f27f Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 25 Feb 2018 15:22:30 -0600 Subject: [PATCH 084/231] Fix bug in Model.run() --- openmc/model/model.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openmc/model/model.py b/openmc/model/model.py index d6e6ddce38..72a2c50dd7 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -209,9 +209,7 @@ class Model(object): """ self.export_to_xml() - return_code = openmc.run(**kwargs) - - assert (return_code == 0), "OpenMC did not execute successfully" + openmc.run(**kwargs) n = self.settings.batches if self.settings.statepoint is not None: From e3d6189cfa163579396377df7a91d0f76a2fc043 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 26 Feb 2018 22:12:14 -0600 Subject: [PATCH 085/231] Make sure Decay.half_life is set, even for stable nuclides --- openmc/data/decay.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openmc/data/decay.py b/openmc/data/decay.py index d83338d028..fa18759396 100644 --- a/openmc/data/decay.py +++ b/openmc/data/decay.py @@ -457,6 +457,7 @@ class Decay(EqualityMixin): items, values = get_list_record(file_obj) self.nuclide['spin'] = items[0] self.nuclide['parity'] = items[1] + self.half_life = ufloat(float('inf'), float('inf')) @property def decay_constant(self): From 5993a59196119db37ec9b7183887055480a26808 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 27 Feb 2018 07:22:27 -0600 Subject: [PATCH 086/231] Address first round of comments on #976 --- docs/source/io_formats/depletion_results.rst | 10 +++++----- docs/source/pythonapi/deplete.rst | 11 +++++++++++ openmc/data/data.py | 8 ++++++-- openmc/deplete/atom_number.py | 2 +- openmc/deplete/chain.py | 9 +++------ tests/unit_tests/test_data_misc.py | 2 ++ 6 files changed, 28 insertions(+), 14 deletions(-) diff --git a/docs/source/io_formats/depletion_results.rst b/docs/source/io_formats/depletion_results.rst index fcbc4fb99b..d35e251469 100644 --- a/docs/source/io_formats/depletion_results.rst +++ b/docs/source/io_formats/depletion_results.rst @@ -12,23 +12,23 @@ The current version of the depletion results file format is 1.0. - **version** (*int[2]*) -- Major and minor version of the statepoint file format. -:Datasets: - **eigenvalues** (*float[][]*) -- k-eigenvalues at each +:Datasets: - **eigenvalues** (*double[][]*) -- k-eigenvalues at each time/stage. This array has shape (number of timesteps, number of stages). - - **number** (*float[][][][]*) -- Total number of atoms. This array + - **number** (*double[][][][]*) -- Total number of atoms. This array has shape (number of timesteps, number of stages, number of materials, number of nuclides). - - **reaction rates** (*float[][][][][]*) -- Reaction rates used to + - **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** (*float[][2]*) -- Time in [s] at beginning/end of each + - **time** (*double[][2]*) -- Time in [s] at beginning/end of each step. **/materials//** :Attributes: - **index** (*int*) -- Index used in results for this material - - **volume** (*float*) -- Volume of this material in [cm^3] + - **volume** (*double*) -- Volume of this material in [cm^3] **/nuclides//** diff --git a/docs/source/pythonapi/deplete.rst b/docs/source/pythonapi/deplete.rst index 61c5dd18c4..d4055f0fdf 100644 --- a/docs/source/pythonapi/deplete.rst +++ b/docs/source/pythonapi/deplete.rst @@ -27,6 +27,17 @@ specific to OpenMC is available using the following class: Operator +When running in parallel using `mpi4py `_, 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 ------------------------------ diff --git a/openmc/data/data.py b/openmc/data/data.py index 70bc00bd92..d0bb65648c 100644 --- a/openmc/data/data.py +++ b/openmc/data/data.py @@ -327,8 +327,12 @@ def zam(name): Atomic number, mass number, and metastable state """ - symbol, A, state = re.match(r'([A-Zn][a-z]*)(\d+)((?:_[em]\d+)?)', - name).groups() + try: + symbol, A, state = re.match(r'([A-Zn][a-z]*)(\d+)((?:_[em]\d+)?)', + name).groups() + except AttributeError: + raise ValueError("'{}' does not appear to be a nuclide name in GND " + "format.".format(name)) metastable = int(state[2:]) if state else 0 return (ATOMIC_NUMBER[symbol], int(A), metastable) diff --git a/openmc/deplete/atom_number.py b/openmc/deplete/atom_number.py index 9a32dfa3a0..b5357280c0 100644 --- a/openmc/deplete/atom_number.py +++ b/openmc/deplete/atom_number.py @@ -41,7 +41,7 @@ class AtomNumber(object): n_nuc_burn : int Number of burnable nuclides. n_nuc : int - Number of nuclidess. + Number of nuclides. """ def __init__(self, local_mats, nuclides, volume, n_nuc_burn): diff --git a/openmc/deplete/chain.py b/openmc/deplete/chain.py index 612ec29cb9..fbe6792227 100644 --- a/openmc/deplete/chain.py +++ b/openmc/deplete/chain.py @@ -55,15 +55,12 @@ def replace_missing(product, decay_data): Replacement for missing product in GND format. """ - - symbol, A, state = re.match(r'([A-Zn][a-z]*)(\d+)((?:_m\d+)?)', - product).groups() - Z = openmc.data.ATOMIC_NUMBER[symbol] - A = int(A) + # Determine atomic number, mass number, and metastable state + Z, A, state = openmc.data.zam(product) + symbol = openmc.data.ATOMIC_SYMBOL[Z] # First check if ground state is available if state: - metastable_state = int(state[2:]) product = '{}{}'.format(symbol, A) # Find isotope with longest half-life diff --git a/tests/unit_tests/test_data_misc.py b/tests/unit_tests/test_data_misc.py index 7d00b7bc77..6167449268 100644 --- a/tests/unit_tests/test_data_misc.py +++ b/tests/unit_tests/test_data_misc.py @@ -66,3 +66,5 @@ def test_zam(): assert openmc.data.zam('Am242') == (95, 242, 0) assert openmc.data.zam('Am242_m1') == (95, 242, 1) assert openmc.data.zam('Am242_m10') == (95, 242, 10) + with pytest.raises(ValueError): + openmc.data.zam('garbage') From bedf99d2fea7f92b5558119b1ebc4a6602e2c920 Mon Sep 17 00:00:00 2001 From: Shikhar Kumar Date: Thu, 1 Mar 2018 15:56:24 -0500 Subject: [PATCH 087/231] remove print_cmfd and change order in which print_batch_keff is called --- src/output.F90 | 16 +++------------- src/simulation.F90 | 8 +++----- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/output.F90 b/src/output.F90 index 643a28b671..6e21d9143a 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -356,9 +356,9 @@ contains integer :: n ! number of active generations ! Determine overall generation and number of active generations - i = overall_generation() + i = overall_generation() - 1 n = i - n_inactive*gen_per_batch - + ! write out information batch and option independent output write(UNIT=OUTPUT_UNIT, FMT='(2X,A9)', ADVANCE='NO') & trim(to_str(current_batch)) // "/" // trim(to_str(gen_per_batch)) @@ -377,16 +377,6 @@ contains write(UNIT=OUTPUT_UNIT, FMT='(23X)', ADVANCE='NO') end if - end subroutine print_batch_keff - -!=============================================================================== -! PRINT_CMFD displays the CMFD related information to output after CMFD is -! executed. Will print blank line if CMFD is not on, to ensure consistent -! formatting of output columns -!=============================================================================== - - subroutine print_cmfd() - ! write out cmfd keff if it is active and other display info if (cmfd_on) then write(UNIT=OUTPUT_UNIT, FMT='(3X, F8.5)', ADVANCE='NO') & @@ -410,7 +400,7 @@ contains ! next line write(UNIT=OUTPUT_UNIT, FMT=*) - end subroutine print_cmfd + end subroutine print_batch_keff !=============================================================================== ! PRINT_PLOT displays selected options for plotting diff --git a/src/simulation.F90 b/src/simulation.F90 index 91c176b995..701cd191b7 100644 --- a/src/simulation.F90 +++ b/src/simulation.F90 @@ -24,8 +24,7 @@ module simulation use nuclide_header, only: micro_xs, n_nuclides use output, only: header, print_columns, & print_batch_keff, print_generation, print_runtime, & - print_results, print_overlap_check, write_tallies, & - print_cmfd + print_results, print_overlap_check, write_tallies use particle_header, only: Particle use random_lcg, only: set_particle_seed use settings @@ -295,8 +294,6 @@ contains if (master .and. verbosity >= 7) then if (current_gen /= gen_per_batch) then call print_generation() - else - call print_batch_keff() end if end if @@ -339,7 +336,8 @@ contains if (run_mode == MODE_EIGENVALUE) then ! Perform CMFD calculation if on if (cmfd_on) call execute_cmfd() - call print_cmfd() + ! Write batch output + if (master .and. verbosity >= 7) call print_batch_keff() end if ! Check_triggers From a21947ff9804f2b6a7e0be376986ff22c99c6722 Mon Sep 17 00:00:00 2001 From: Shikhar Kumar Date: Thu, 1 Mar 2018 16:15:53 -0500 Subject: [PATCH 088/231] Remove trailing whitespace 1 --- src/output.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/output.F90 b/src/output.F90 index 6e21d9143a..349d0007ef 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -358,7 +358,7 @@ contains ! Determine overall generation and number of active generations i = overall_generation() - 1 n = i - n_inactive*gen_per_batch - + ! write out information batch and option independent output write(UNIT=OUTPUT_UNIT, FMT='(2X,A9)', ADVANCE='NO') & trim(to_str(current_batch)) // "/" // trim(to_str(gen_per_batch)) From a96a192cd535429d0d38efb148fca60992935ffe Mon Sep 17 00:00:00 2001 From: Shikhar Kumar Date: Thu, 1 Mar 2018 16:34:16 -0500 Subject: [PATCH 089/231] Remove trailing whitespace 2 --- src/output.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/output.F90 b/src/output.F90 index 349d0007ef..908f698141 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -376,7 +376,7 @@ contains else write(UNIT=OUTPUT_UNIT, FMT='(23X)', ADVANCE='NO') end if - + ! write out cmfd keff if it is active and other display info if (cmfd_on) then write(UNIT=OUTPUT_UNIT, FMT='(3X, F8.5)', ADVANCE='NO') & From 7ee08d5280c3195ba74102027f127f6ac18f26cb Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 1 Mar 2018 23:08:43 -0600 Subject: [PATCH 090/231] Add gnd_name function --- docs/source/pythonapi/data.rst | 1 + openmc/data/data.py | 26 +++++++++++++++++++++++++- openmc/data/endf.py | 13 +++++-------- openmc/material.py | 2 +- tests/unit_tests/test_data_misc.py | 8 ++++++++ 5 files changed, 40 insertions(+), 10 deletions(-) diff --git a/docs/source/pythonapi/data.rst b/docs/source/pythonapi/data.rst index 52dc5173b0..7feaa8d608 100644 --- a/docs/source/pythonapi/data.rst +++ b/docs/source/pythonapi/data.rst @@ -32,6 +32,7 @@ Core Functions :template: myfunction.rst openmc.data.atomic_mass + openmc.data.gnd_name openmc.data.linearize openmc.data.thin openmc.data.water_density diff --git a/openmc/data/data.py b/openmc/data/data.py index d0bb65648c..fd13299617 100644 --- a/openmc/data/data.py +++ b/openmc/data/data.py @@ -313,13 +313,37 @@ def water_density(temperature, pressure=0.1013): return coeff / pi / gamma1_pi +def gnd_name(Z, A, m=0): + """Return nuclide name using GND convention + + Parameters + ---------- + Z : int + Atomic number + A : int + Mass number + m : int, optional + Metastable state + + Returns + ------- + str + Nuclide name in GND convention, e.g., 'Am242_m1' + + """ + if m > 0: + return '{}{}_m{}'.format(ATOMIC_SYMBOL[Z], A, m) + else: + return '{}{}'.format(ATOMIC_SYMBOL[Z], A) + + def zam(name): """Return tuple of (atomic number, mass number, metastable state) Parameters ---------- name : str - Name of nuclide using GND convention, e.g., 'Am242m1' + Name of nuclide using GND convention, e.g., 'Am242_m1' Returns ------- diff --git a/openmc/data/endf.py b/openmc/data/endf.py index db94e15bea..c44c66be0c 100644 --- a/openmc/data/endf.py +++ b/openmc/data/endf.py @@ -17,7 +17,7 @@ from collections.abc import Iterable import numpy as np from numpy.polynomial.polynomial import Polynomial -from .data import ATOMIC_SYMBOL +from .data import ATOMIC_SYMBOL, gnd_name from .function import Tabulated1D, INTERPOLATION_SCHEME from openmc.stats.univariate import Uniform, Tabular, Legendre @@ -249,6 +249,7 @@ def get_tab2_record(file_obj): return params, Tabulated2D(breakpoints, interpolation) + def get_evaluations(filename): """Return a list of all evaluations within an ENDF file. @@ -424,13 +425,9 @@ class Evaluation(object): @property def gnd_name(self): - symbol = ATOMIC_SYMBOL[self.target['atomic_number']] - A = self.target['mass_number'] - m = self.target['isomeric_state'] - if m > 0: - return '{}{}_m{}'.format(symbol, A, m) - else: - return '{}{}'.format(symbol, A) + return gnd_name(self.target['atomic_number'], + self.target['mass_number'], + self.target['isomeric_state']) class Tabulated2D(object): diff --git a/openmc/material.py b/openmc/material.py index 5fdcb76894..d52d8a27b4 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -24,7 +24,7 @@ class Material(IDManagerMixin): To create a material, one should create an instance of this class, add nuclides or elements with :meth:`Material.add_nuclide` or `Material.add_element`, respectively, and set the total material density - with `Material.export_to_xml()`. The material can then be assigned to a cell + with `Material.set_density()`. The material can then be assigned to a cell using the :attr:`Cell.fill` attribute. Parameters diff --git a/tests/unit_tests/test_data_misc.py b/tests/unit_tests/test_data_misc.py index 6167449268..04ca0f1031 100644 --- a/tests/unit_tests/test_data_misc.py +++ b/tests/unit_tests/test_data_misc.py @@ -60,6 +60,14 @@ def test_water_density(): assert dens(500.0, 3.0) == pytest.approx(1e-3/0.120241800e-2, 1e-6) +def test_gnd_name(): + assert openmc.data.gnd_name(1, 1) == 'H1' + assert openmc.data.gnd_name(40, 90) == ('Zr90') + assert openmc.data.gnd_name(95, 242, 0) == ('Am242') + assert openmc.data.gnd_name(95, 242, 1) == ('Am242_m1') + assert openmc.data.gnd_name(95, 242, 10) == ('Am242_m10') + + def test_zam(): assert openmc.data.zam('H1') == (1, 1, 0) assert openmc.data.zam('Zr90') == (40, 90, 0) From b9ff205090520b718bbec7a26a07fa7d9361374a Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 1 Mar 2018 23:09:10 -0600 Subject: [PATCH 091/231] Don't put free neutron in depletion chain --- openmc/deplete/chain.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openmc/deplete/chain.py b/openmc/deplete/chain.py index fbe6792227..1826ca9ca0 100644 --- a/openmc/deplete/chain.py +++ b/openmc/deplete/chain.py @@ -59,6 +59,10 @@ def replace_missing(product, decay_data): Z, A, state = openmc.data.zam(product) symbol = openmc.data.ATOMIC_SYMBOL[Z] + # Replace neutron with proton + if Z == 0 and A == 1: + return 'H1' + # First check if ground state is available if state: product = '{}{}'.format(symbol, A) @@ -167,6 +171,9 @@ class Chain(object): decay_data = {} for f in decay_files: data = openmc.data.Decay(f) + # Skip decay data for neutron itself + if data.nuclide['atomic_number'] == 0: + continue decay_data[data.nuclide['name']] = data print('Processing fission product yield sub-library files...') From efb264da605b1b818e1e62b62decdbe10e8fa03d Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 2 Mar 2018 06:20:16 -0600 Subject: [PATCH 092/231] Fix depletion chain unit test --- tests/unit_tests/test_deplete_chain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit_tests/test_deplete_chain.py b/tests/unit_tests/test_deplete_chain.py index 4ec5415ee9..1fe83ad98a 100644 --- a/tests/unit_tests/test_deplete_chain.py +++ b/tests/unit_tests/test_deplete_chain.py @@ -71,7 +71,7 @@ def test_from_endf(): neutron_data = (_ENDF_DATA / 'neutrons').glob('*.endf') chain = Chain.from_endf(decay_data, fpy_data, neutron_data) - assert len(chain) == len(chain.nuclides) == len(chain.nuclide_dict) == 3821 + assert len(chain) == len(chain.nuclides) == len(chain.nuclide_dict) == 3820 for nuc in chain.nuclides: assert nuc == chain[nuc.name] From 3120e15ad45aa203607705132f914169f1282b1b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 5 Mar 2018 19:57:34 -0600 Subject: [PATCH 093/231] Avoid segfault when nuclide is present in material that's not used --- src/input_xml.F90 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 34a2fdd718..8c3669b2e0 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -4265,12 +4265,16 @@ contains ! Show which nuclide results in lowest energy for neutron transport do i = 1, size(nuclides) - if (nuclides(i) % grid(1) % energy(size(nuclides(i) % grid(1) % energy)) & - == energy_max_neutron) then - call write_message("Maximum neutron transport energy: " // & - trim(to_str(energy_max_neutron)) // " eV for " // & - trim(adjustl(nuclides(i) % name)), 7) - exit + ! If a nuclide is present in a material that's not used in the model, its + ! grid has not been allocated + if (size(nuclides(i) % grid) > 0) then + if (nuclides(i) % grid(1) % energy(size(nuclides(i) % grid(1) % energy)) & + == energy_max_neutron) then + call write_message("Maximum neutron transport energy: " // & + trim(to_str(energy_max_neutron)) // " eV for " // & + trim(adjustl(nuclides(i) % name)), 7) + exit + end if end if end do From 3a90b147be78d57e0e795336740eb183295589e3 Mon Sep 17 00:00:00 2001 From: Shikhar Kumar Date: Mon, 5 Mar 2018 22:40:16 -0500 Subject: [PATCH 094/231] redefine i as current_batch*gen_per_batch --- src/output.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/output.F90 b/src/output.F90 index 908f698141..25cb84d58c 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -356,7 +356,7 @@ contains integer :: n ! number of active generations ! Determine overall generation and number of active generations - i = overall_generation() - 1 + i = current_batch*gen_per_batch n = i - n_inactive*gen_per_batch ! write out information batch and option independent output From 80959dc82bb0f3ba5a8b0f592eb8191721e7c410 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Tue, 13 Mar 2018 13:53:07 -0400 Subject: [PATCH 095/231] Dont import capi (through model) on import openmc --- openmc/model/model.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/openmc/model/model.py b/openmc/model/model.py index 72a2c50dd7..cd51533217 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -1,11 +1,7 @@ from collections.abc import Iterable import openmc -from openmc.checkvalue import check_type -import openmc.deplete as dep - -_DEPLETE_METHODS = {'predictor': dep.integrator.predictor, - 'cecm': dep.integrator.cecm} +from openmc.checkvalue import check_type, check_value class Model(object): @@ -140,7 +136,8 @@ class Model(object): for plot in plots: self._plots.append(plot) - def deplete(self, timesteps, power, chain_file=None, method='cecm', **kwargs): + def deplete(self, timesteps, power, chain_file=None, method='cecm', + **kwargs): """Deplete model using specified timesteps/power Parameters @@ -164,11 +161,21 @@ class Model(object): :func:`openmc.deplete.integrator.cecm`) """ + # Import the depletion module. This is done here rather than the module + # header to delay importing openmc.capi (through openmc.deplete) which + # can be tough to install properly. + import openmc.deplete as dep + # Create OpenMC transport operator op = dep.Operator(self.geometry, self.settings, chain_file) # Perform depletion - _DEPLETE_METHODS[method](op, timesteps, power, **kwargs) + if method == 'predictor': + dep.integrator.predictor(op, timesteps, power, **kwargs) + elif method == 'cecm': + dep.integrator.cecm(op, timesteps, power, **kwargs) + else: + check_value('method', method, ('cecm', 'predictor')) def export_to_xml(self): """Export model to XML files.""" From 7bb066bc9aab65992055667ac2e641cd708c3203 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Tue, 13 Mar 2018 17:15:58 -0400 Subject: [PATCH 096/231] Infer WMP vales like num_l and fissionable --- openmc/data/multipole.py | 123 ++++++++++++++++++--------------------- 1 file changed, 57 insertions(+), 66 deletions(-) diff --git a/openmc/data/multipole.py b/openmc/data/multipole.py index 33078f5046..fd5bf28b3b 100644 --- a/openmc/data/multipole.py +++ b/openmc/data/multipole.py @@ -24,7 +24,7 @@ _RM_RF = 3 # Residue fission # Multi-level Breit Wigner indices _MLBW_RT = 1 # Residue total -_MLBW_RX = 2 # Residue compettitive +_MLBW_RX = 2 # Residue competitive _MLBW_RA = 3 # Residue absorption _MLBW_RF = 4 # Residue fission @@ -141,6 +141,12 @@ def _broaden_wmp_polynomials(E, dopp, n): class WindowedMultipole(EqualityMixin): """Resonant cross sections represented in the windowed multipole format. + Parameters + ---------- + formalism : {'MLBW', 'RM'} + The R-matrix formalism used to reconstruct resonances. Either 'MLBW' + for multi-level Breit Wigner or 'RM' for Reich-Moore. + Attributes ---------- num_l : Integral @@ -195,11 +201,9 @@ class WindowedMultipole(EqualityMixin): a/E + b/sqrt(E) + c + d sqrt(E) + ... """ - def __init__(self): - self.num_l = None - self.fit_order = None - self.fissionable = None - self.formalism = None + def __init__(self, formalism): + self._num_l = None + self.formalism = formalism self.spacing = None self.sqrtAWR = None self.start_E = None @@ -218,11 +222,15 @@ class WindowedMultipole(EqualityMixin): @property def fit_order(self): - return self._fit_order + return self.curvefit.shape[1] - 1 @property def fissionable(self): - return self._fissionable + if self.formalism == 'RM': + return self.data.shape[1] == 4 + else: + # Assume self.formalism == 'MLBW' + return self.data.shape[1] == 5 @property def formalism(self): @@ -272,35 +280,10 @@ class WindowedMultipole(EqualityMixin): def curvefit(self): return self._curvefit - @num_l.setter - def num_l(self, num_l): - if num_l is not None: - cv.check_type('num_l', num_l, Integral) - cv.check_greater_than('num_l', num_l, 1, equality=True) - cv.check_less_than('num_l', num_l, 4, equality=True) - # There is an if block in _evaluate that assumes num_l <= 4. - self._num_l = num_l - - @fit_order.setter - def fit_order(self, fit_order): - if fit_order is not None: - cv.check_type('fit_order', fit_order, Integral) - cv.check_greater_than('fit_order', fit_order, 2, equality=True) - # _broaden_wmp_polynomials assumes the curve fit has at least 3 - # terms. - self._fit_order = fit_order - - @fissionable.setter - def fissionable(self, fissionable): - if fissionable is not None: - cv.check_type('fissionable', fissionable, bool) - self._fissionable = fissionable - @formalism.setter def formalism(self, formalism): - if formalism is not None: - cv.check_type('formalism', formalism, str) - cv.check_value('formalism', formalism, ('MLBW', 'RM')) + cv.check_type('formalism', formalism, str) + cv.check_value('formalism', formalism, ('MLBW', 'RM')) self._formalism = formalism @spacing.setter @@ -337,9 +320,20 @@ class WindowedMultipole(EqualityMixin): cv.check_type('data', data, np.ndarray) if len(data.shape) != 2: raise ValueError('Multipole data arrays must be 2D') - if data.shape[1] not in (3, 4, 5): # 3 or 4 for RM, 4 or 5 for MLBW - raise ValueError('The second dimension of multipole data arrays' - ' must have a length of 3, 4 or 5') + if self.formalism == 'RM': + if data.shape[1] not in (3, 4): + raise ValueError('For the Reich-Moore formalism, ' + 'data.shape[1] must be 3 or 4. One value for the pole.' + ' One each for the total and absorption residues. ' + 'Possibly one more for a fission residue.') + else: + # Assume self.formalism == 'MLBW' + if data.shape[1] not in (4, 5): + raise ValueError('For the Multi-level Breit-Wigner ' + 'formalism, data.shape[1] must be 4 or 5. One value ' + 'for the pole. One each for the total, competitive, ' + 'and absorption residues. Possibly one mor efor a ' + 'fission residue.') if not np.issubdtype(data.dtype, complex): raise TypeError('Multipole data arrays must be complex dtype') self._data = data @@ -363,6 +357,12 @@ class WindowedMultipole(EqualityMixin): if not np.issubdtype(l_value.dtype, int): raise TypeError('Multipole l_value arrays must be integer' ' dtype') + + self._num_l = len(np.unique(l_value)) + + else: + self._num_l = None + self._l_value = l_value @w_start.setter @@ -442,20 +442,12 @@ class WindowedMultipole(EqualityMixin): 'Python API expects version ' + WMP_VERSION) group = h5file['nuclide'] - out = cls() - # Read scalar values. Note that group['max_w'] is ignored. - length = group['length'].value - windows = group['windows'].value - out.num_l = group['num_l'].value - out.fit_order = group['fit_order'].value - out.fissionable = bool(group['fissionable'].value) - if group['formalism'].value == _FORM_MLBW: - out.formalism = 'MLBW' + out = cls('MLBW') elif group['formalism'].value == _FORM_RM: - out.formalism = 'RM' + out = cls('RM') else: raise ValueError('Unrecognized/Unsupported R-matrix formalism') @@ -466,37 +458,36 @@ class WindowedMultipole(EqualityMixin): # Read arrays. - err = "WMP '{}' array shape is not consistent with the '{}' value" + err = "WMP '{}' array shape is not consistent with the '{}' array shape" out.data = group['data'].value - if out.data.shape[0] != length: - raise ValueError(err.format('data', 'length')) + + out.l_value = group['l_value'].value + if out.l_value.shape[0] != out.data.shape[0]: + raise ValueError(err.format('l_value', 'data')) out.pseudo_k0RS = group['pseudo_K0RS'].value if out.pseudo_k0RS.shape[0] != out.num_l: - raise ValueError(err.format('pseudo_k0RS', 'num_l')) - - out.l_value = group['l_value'].value - if out.l_value.shape[0] != length: - raise ValueError(err.format('l_value', 'length')) + raise ValueError(err.format('pseudo_k0RS', 'l_value')) out.w_start = group['w_start'].value - if out.w_start.shape[0] != windows: - raise ValueError(err.format('w_start', 'windows')) out.w_end = group['w_end'].value - if out.w_end.shape[0] != windows: - raise ValueError(err.format('w_end', 'windows')) + if out.w_end.shape[0] != out.w_start.shape[0]: + raise ValueError(err.format('w_end', 'w_start')) out.broaden_poly = group['broaden_poly'].value.astype(np.bool) - if out.broaden_poly.shape[0] != windows: - raise ValueError(err.format('broaden_poly', 'windows')) + if out.broaden_poly.shape[0] != out.w_start.shape[0]: + raise ValueError(err.format('broaden_poly', 'w_start')) out.curvefit = group['curvefit'].value - if out.curvefit.shape[0] != windows: - raise ValueError(err.format('curvefit', 'windows')) - if out.curvefit.shape[1] != out.fit_order + 1: - raise ValueError(err.format('curvefit', 'fit_order')) + if out.curvefit.shape[0] != out.w_start.shape[0]: + raise ValueError(err.format('curvefit', 'w_start')) + + # _broaden_wmp_polynomials assumes the curve fit has at least 3 terms. + if out.fit_order < 2: + raise ValueError("Windowed multipole is only supported for " + "curvefits with 3 or more terms.") # Note that all the file 3 data (group['reactions/MT...']) are ignored. From f2c2b4aac8c4591fa48c2f92828436b3ec836ec2 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Tue, 13 Mar 2018 17:19:55 -0400 Subject: [PATCH 097/231] Update WMP format docs --- docs/source/io_formats/data_wmp.rst | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/docs/source/io_formats/data_wmp.rst b/docs/source/io_formats/data_wmp.rst index d645c6e8f1..4fa25ee3b6 100644 --- a/docs/source/io_formats/data_wmp.rst +++ b/docs/source/io_formats/data_wmp.rst @@ -30,10 +30,6 @@ Windowed Multipole Library Format Highest energy the windowed multipole part of the library is valid for. - **energy_points** (*double[]*) Energy grid for the pointwise library in the reaction group. - - **fissionable** (*int*) - 1 if this nuclide has fission data. 0 if it does not. - - **fit_order** (*int*) - The order of the curve fit. - **formalism** (*int*) The formalism of the underlying data. Uses the `ENDF-6`_ format formalism numbers. @@ -51,18 +47,12 @@ Windowed Multipole Library Format - **l_value** (*int[]*) The index for a corresponding pole. Equivalent to the :math:`l` quantum number of the resonance the pole comes from :math:`+1`. - - **length** (*int*) - Total count of poles in `data`. - **max_w** (*int*) Maximum number of poles in a window. - **MT_count** (*int*) Number of pointwise tables in the library. - **MT_list** (*int[]*) A list of available MT identifiers. See `ENDF-6`_ for meaning. - - **n_grid** (*int*) - Total length of the pointwise data. - - **num_l** (*int*) - Number of possible :math:`l` quantum states for this nuclide. - **pseudo_K0RS** (*double[]*) :math:`l` dependent value of @@ -90,13 +80,6 @@ Windowed Multipole Library Format The pole to start from for each window. - **w_end** (*int[]*) The pole to end at for each window. - - **windows** (*int*) - Number of windows. - -**/nuclide/reactions/MT** - - **MT_sigma** (*double[]*) -- Cross section value for this reaction. - - **Q_value** (*double*) -- Energy released in this reaction, in eV. - - **threshold** (*int*) -- The first non-zero entry in ``MT_sigma``. .. _h5py: http://docs.h5py.org/en/latest/ .. _ENDF-6: https://www.oecd-nea.org/dbdata/data/manual-endf/endf102.pdf From f047e79540b08aeaa0bca0b72db8ac7529a63685 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Tue, 13 Mar 2018 20:48:47 -0400 Subject: [PATCH 098/231] Infer WMP array sizes in F90 --- CMakeLists.txt | 1 - src/input_xml.F90 | 3 +- src/multipole.F90 | 89 ------------------- src/multipole_header.F90 | 179 ++++++++++++++++++++++++++------------- 4 files changed, 120 insertions(+), 152 deletions(-) delete mode 100644 src/multipole.F90 diff --git a/CMakeLists.txt b/CMakeLists.txt index d3673df26c..be62dcd57b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -368,7 +368,6 @@ set(LIBOPENMC_FORTRAN_SRC src/message_passing.F90 src/mgxs_data.F90 src/mgxs_header.F90 - src/multipole.F90 src/multipole_header.F90 src/nuclide_header.F90 src/output.F90 diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 8c3669b2e0..918d471d3c 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -21,7 +21,6 @@ module input_xml use message_passing use mgxs_data, only: create_macro_xs, read_mgxs use mgxs_header - use multipole, only: multipole_read use nuclide_header use output, only: title, header, print_plot use plot_header @@ -4377,7 +4376,7 @@ contains allocate(nuc % multipole) ! Call the read routine - call multipole_read(filename, nuc % multipole, i_table) + call nuc % multipole % from_hdf5(filename) nuc % mp_present = .true. end associate diff --git a/src/multipole.F90 b/src/multipole.F90 deleted file mode 100644 index 0282adb7d9..0000000000 --- a/src/multipole.F90 +++ /dev/null @@ -1,89 +0,0 @@ -module multipole - - use hdf5 - - use constants - use error, only: fatal_error - use hdf5_interface - use multipole_header, only: MultipoleArray, FIT_T, FIT_A, FIT_F, & - MP_FISS, FORM_MLBW, FORM_RM - use nuclide_header, only: nuclides - - implicit none - -contains - -!=============================================================================== -! MULTIPOLE_READ Reads in a multipole HDF5 file with the original API -! specification. Subject to change as the library format matures. -!=============================================================================== - - subroutine multipole_read(filename, multipole, i_table) - character(len=*), intent(in) :: filename ! Filename of the - ! multipole library - ! to load - type(MultipoleArray), intent(out), target :: multipole ! The object to fill - integer, intent(in) :: i_table ! index in nuclides/ - ! sab_tables - - integer(HID_T) :: file_id - integer(HID_T) :: group_id - - ! Intermediate loading components - integer :: is_fissionable - character(len=10) :: version - - associate (nuc => nuclides(i_table)) - - ! Open file for reading and move into the /isotope group - file_id = file_open(filename, 'r', parallel=.true.) - group_id = open_group(file_id, "/nuclide") - - ! Check the file version number. - call read_dataset(version, file_id, "version") - if (version /= VERSION_MULTIPOLE) call fatal_error("The current multipole& - & format version is " // trim(VERSION_MULTIPOLE) // " but the file "& - // trim(filename) // " uses version " // trim(version) // ".") - - ! Load in all the array size scalars - call read_dataset(multipole % length, group_id, "length") - call read_dataset(multipole % windows, group_id, "windows") - call read_dataset(multipole % num_l, group_id, "num_l") - call read_dataset(multipole % fit_order, group_id, "fit_order") - call read_dataset(multipole % max_w, group_id, "max_w") - call read_dataset(is_fissionable, group_id, "fissionable") - if (is_fissionable == MP_FISS) then - multipole % fissionable = .true. - else - multipole % fissionable = .false. - end if - call read_dataset(multipole % formalism, group_id, "formalism") - - call read_dataset(multipole % spacing, group_id, "spacing") - call read_dataset(multipole % sqrtAWR, group_id, "sqrtAWR") - call read_dataset(multipole % start_E, group_id, "start_E") - call read_dataset(multipole % end_E, group_id, "end_E") - - ! Allocate the multipole array components - call multipole % allocate() - - ! Read in arrays - call read_dataset(multipole % data, group_id, "data") - call read_dataset(multipole % pseudo_k0RS, group_id, "pseudo_K0RS") - call read_dataset(multipole % l_value, group_id, "l_value") - call read_dataset(multipole % w_start, group_id, "w_start") - call read_dataset(multipole % w_end, group_id, "w_end") - call read_dataset(multipole % broaden_poly, group_id, "broaden_poly") - - call read_dataset(multipole % curvefit, group_id, "curvefit") - - call close_group(group_id) - - ! Close file - call file_close(file_id) - - end associate - - end subroutine multipole_read - -end module multipole diff --git a/src/multipole_header.F90 b/src/multipole_header.F90 index 143047b0b5..ec82b16a4e 100644 --- a/src/multipole_header.F90 +++ b/src/multipole_header.F90 @@ -1,5 +1,12 @@ module multipole_header + use hdf5 + + use constants + use dict_header, only: DictIntInt + use error, only: fatal_error + use hdf5_interface + implicit none !======================================================================== @@ -29,9 +36,6 @@ module multipole_header FIT_A = 2, & ! Absorption FIT_F = 3 ! Fission - ! Value of 'true' when checking if nuclide is fissionable - integer, parameter :: MP_FISS = 1 - !=============================================================================== ! MULTIPOLE contains all the components needed for the windowed multipole ! temperature dependent cross section libraries for the resolved resonance @@ -42,87 +46,142 @@ module multipole_header !========================================================================= ! Isotope Properties - logical :: fissionable = .false. ! Is this isotope fissionable? - integer :: length ! Number of poles - integer, allocatable :: l_value(:) ! The l index of the pole - real(8), allocatable :: pseudo_k0RS(:) ! The value (sqrt(2*mass neutron)/reduced planck constant) - ! * AWR/(AWR + 1) * scattering radius for each l - complex(8), allocatable :: data(:,:) ! Contains all of the pole-residue data - real(8) :: sqrtAWR ! Square root of the atomic weight ratio + + logical :: fissionable ! Is this isotope fissionable? + integer, allocatable :: l_value(:) ! The l index of the pole + integer :: num_l ! Number of unique l values + real(8), allocatable :: pseudo_k0RS(:) ! The value (sqrt(2*mass neutron + ! /reduced planck constant) + ! * AWR/(AWR + 1) + ! * scattering radius for + ! each l + complex(8), allocatable :: data(:,:) ! Poles and residues + real(8) :: sqrtAWR ! Square root of the atomic + ! weight ratio + integer :: formalism ! R-matrix formalism !========================================================================= ! Windows - integer :: windows ! Number of windows - integer :: fit_order ! Order of the fit. 1 linear, 2 quadratic, etc. + integer :: fit_order ! Order of the fit. 1 linear, + ! 2 quadratic, etc. real(8) :: start_E ! Start energy for the windows real(8) :: end_E ! End energy for the windows - real(8) :: spacing ! The actual spacing in sqrt(E) space. - ! spacing = sqrt(multipole_w%endE - multipole_w%startE)/multipole_w%windows - integer, allocatable :: w_start(:) ! Contains the index of the pole at the start of the window - integer, allocatable :: w_end(:) ! Contains the index of the pole at the end of the window - real(8), allocatable :: curvefit(:,:,:) ! Contains the fitting function. (reaction type, coeff index, window index) + real(8) :: spacing ! The actual spacing in sqrt(E) + ! space. + ! spacing = sqrt(multipole_w % endE - multipole_w % startE) + ! / multipole_w % windows + integer, allocatable :: w_start(:) ! Contains the index of the pole at + ! the start of the window + integer, allocatable :: w_end(:) ! Contains the index of the pole at + ! the end of the window + real(8), allocatable :: curvefit(:,:,:) ! Contains the fitting function. + ! (reaction type, coeff index, + ! window index) integer, allocatable :: broaden_poly(:) ! if 1, broaden, if 0, don't. - !========================================================================= - ! Storage Helpers - integer :: num_l - integer :: max_w + contains - integer :: formalism + procedure :: from_hdf5 => multipole_from_hdf5 - contains - procedure :: allocate => multipole_allocate ! Allocates Multipole end type MultipoleArray contains !=============================================================================== -! MULTIPOLE_ALLOCATE allocates necessary data for Multipole. +! FROM_HDF5 loads multipole data from an HDF5 file. !=============================================================================== - subroutine multipole_allocate(multipole) - class(MultipoleArray), intent(inout) :: multipole ! Multipole object to allocate. + subroutine multipole_from_hdf5(this, filename) + class(MultipoleArray), intent(inout) :: this + character(len=*), intent(in) :: filename - ! This function assumes length, numL, fissionable, windows, fitorder, - ! and formalism are known + character(len=10) :: version + integer :: i, n_poles, n_residue_types, n_windows + integer(HSIZE_T) :: dims_1d(1), dims_2d(2), dims_3d(3) + integer(HID_T) :: file_id + integer(HID_T) :: group_id + integer(HID_T) :: dset + type(DictIntInt) :: l_val_dict - ! Allocate the pole-residue storage. - ! MLBW has one more pole than Reich-Moore, and fissionable nuclides - ! have further one more. - if (multipole % formalism == FORM_MLBW) then - if (multipole % fissionable) then - allocate(multipole % data(5, multipole % length)) - else - allocate(multipole % data(4, multipole % length)) - end if - else if (multipole % formalism == FORM_RM) then - if (multipole % fissionable) then - allocate(multipole % data(4, multipole % length)) - else - allocate(multipole % data(3, multipole % length)) - end if + ! Open file for reading and move into the /isotope group + file_id = file_open(filename, 'r', parallel=.true.) + group_id = open_group(file_id, "/nuclide") + + ! Check the file version number. + call read_dataset(version, file_id, "version") + if (version /= VERSION_MULTIPOLE) call fatal_error("The current multipole& + & format version is " // trim(VERSION_MULTIPOLE) // " but the file "& + // trim(filename) // " uses version " // trim(version) // ".") + + ! Read scalar values. + call read_dataset(this % formalism, group_id, "formalism") + call read_dataset(this % spacing, group_id, "spacing") + call read_dataset(this % sqrtAWR, group_id, "sqrtAWR") + call read_dataset(this % start_E, group_id, "start_E") + call read_dataset(this % end_E, group_id, "end_E") + + ! Read the "data" array. Use its shape to figure out the number of poles + ! and residue types in this data. + dset = open_dataset(group_id, "data") + call get_shape(dset, dims_2d) + n_residue_types = int(dims_2d(1), 4) - 1 + n_poles = int(dims_2d(2), 4) + allocate(this % data(n_residue_types+1, n_poles)) + call read_dataset(this % data, dset) + call close_dataset(dset) + + ! Check to see if this data includes fission residues. + if (this % formalism == FORM_RM) then + this % fissionable = (n_residue_types == 3) + else + ! Assume FORM_MLBW. + this % fissionable = (n_residue_types == 4) + end if + + ! Read the "l_value" array. + allocate(this % l_value(n_poles)) + call read_dataset(this % l_value, group_id, "l_value") + + ! Figure out the number of unique l values in the l_value array. + do i = 1, n_poles + if (.not. l_val_dict % has(this % l_value(i))) then + call l_val_dict % set(i, 0) end if + end do + this % num_l = l_val_dict % size() + call l_val_dict % clear() - ! Allocate the l value table for each pole-residue set. - allocate(multipole % l_value(multipole % length)) + ! Read the "pseudo_K0RS" array. + allocate(this % pseudo_k0RS(this % num_l)) + call read_dataset(this % pseudo_k0RS, group_id, "pseudo_K0RS") - ! Allocate the table of pseudo_k0RS values at each l. - allocate(multipole % pseudo_k0RS(multipole % num_l)) + ! Read the "w_start" array and use its shape to figure out the number of + ! windows. + dset = open_dataset(group_id, "w_start") + call get_shape(dset, dims_1d) + n_windows = int(dims_1d(1), 4) + allocate(this % w_start(n_windows)) + call read_dataset(this % w_start, dset) + call close_dataset(dset) - ! Allocate window start, window end - allocate(multipole % w_start(multipole % windows)) - allocate(multipole % w_end(multipole % windows)) + ! Read the "w_end" and "broaden_poly" arrays. + allocate(this % w_end(n_windows)) + call read_dataset(this % w_end, group_id, "w_end") + allocate(this % broaden_poly(n_windows)) + call read_dataset(this % broaden_poly, group_id, "broaden_poly") - ! Allocate broaden_poly - allocate(multipole % broaden_poly(multipole % windows)) + ! Read the "curvefit" array. + dset = open_dataset(group_id, "curvefit") + call get_shape(dset, dims_3d) + allocate(this % curvefit(dims_3d(1), dims_3d(2), dims_3d(3))) + call read_dataset(this % curvefit, dset) + call close_dataset(dset) + this % fit_order = int(dims_3d(2), 4) - 1 - ! Allocate curvefit - if(multipole % fissionable) then - allocate(multipole % curvefit(FIT_F, multipole % fit_order+1, multipole % windows)) - else - allocate(multipole % curvefit(FIT_A, multipole % fit_order+1, multipole % windows)) - end if - end subroutine + ! Close the group and file. + call close_group(group_id) + call file_close(file_id) + end subroutine multipole_from_hdf5 end module multipole_header From ba15959728ed996e1fd11f6b6f7c7fd4d87af539 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Tue, 13 Mar 2018 21:21:12 -0400 Subject: [PATCH 099/231] Add WMP writing functionality to PyAPI --- openmc/data/multipole.py | 52 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/openmc/data/multipole.py b/openmc/data/multipole.py index fd5bf28b3b..ac1e93447d 100644 --- a/openmc/data/multipole.py +++ b/openmc/data/multipole.py @@ -332,7 +332,7 @@ class WindowedMultipole(EqualityMixin): raise ValueError('For the Multi-level Breit-Wigner ' 'formalism, data.shape[1] must be 4 or 5. One value ' 'for the pole. One each for the total, competitive, ' - 'and absorption residues. Possibly one mor efor a ' + 'and absorption residues. Possibly one more for a ' 'fission residue.') if not np.issubdtype(data.dtype, complex): raise TypeError('Multipole data arrays must be complex dtype') @@ -428,6 +428,7 @@ class WindowedMultipole(EqualityMixin): format. """ + if isinstance(group_or_filename, h5py.Group): group = group_or_filename else: @@ -442,7 +443,7 @@ class WindowedMultipole(EqualityMixin): 'Python API expects version ' + WMP_VERSION) group = h5file['nuclide'] - # Read scalar values. Note that group['max_w'] is ignored. + # Read scalars. if group['formalism'].value == _FORM_MLBW: out = cls('MLBW') @@ -489,8 +490,6 @@ class WindowedMultipole(EqualityMixin): raise ValueError("Windowed multipole is only supported for " "curvefits with 3 or more terms.") - # Note that all the file 3 data (group['reactions/MT...']) are ignored. - return out def _evaluate(self, E, T): @@ -652,3 +651,48 @@ class WindowedMultipole(EqualityMixin): fun = np.vectorize(lambda x: self._evaluate(x, T)) return fun(E) + + def to_hdf5(self, path, libver='earliest'): + """Export windowed multipole data to an HDF5 file. + + Parameters + ---------- + path : str + Path to write HDF5 file to + libver : {'earliest', 'latest'} + Compatibility mode for the HDF5 file. 'latest' will produce files + that are less backwards compatible but have performance benefits. + + """ + + # Open file and write version. + f = h5py.File(path, 'w', libver=libver) + f.create_dataset('version', (1, ), dtype='S10') + f['version'][:] = WMP_VERSION.encode('ASCII') + + # Make a nuclide group. + g = f.create_group('nuclide') + + # Write scalars. + if self.formalism == 'MLBW': + g.create_dataset('formalism', + data=np.array(_FORM_MLBW, dtype=np.int32)) + else: + # Assume RM. + g.create_dataset('formalism', + data=np.array(_FORM_RM, dtype=np.int32)) + g.create_dataset('spacing', data=np.array(self.spacing)) + g.create_dataset('sqrtAWR', data=np.array(self.sqrtAWR)) + g.create_dataset('start_E', data=np.array(self.start_E)) + g.create_dataset('end_E', data=np.array(self.end_E)) + + # Write arrays. + g.create_dataset('data', data=self.data) + g.create_dataset('l_value', data=self.l_value) + g.create_dataset('pseudo_K0RS', data=self.pseudo_k0RS) + g.create_dataset('w_start', data=self.w_start) + g.create_dataset('w_end', data=self.w_end) + g.create_dataset('broaden_poly', data=self.broaden_poly) + g.create_dataset('curvefit', data=self.curvefit) + + f.close() From d0b59a21be2d2d0e0f598db12214cc14502fa614 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Tue, 13 Mar 2018 21:44:54 -0400 Subject: [PATCH 100/231] Remove unused File 3 stuff from wmp format docs --- docs/source/io_formats/data_wmp.rst | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/source/io_formats/data_wmp.rst b/docs/source/io_formats/data_wmp.rst index 4fa25ee3b6..6174e85ff7 100644 --- a/docs/source/io_formats/data_wmp.rst +++ b/docs/source/io_formats/data_wmp.rst @@ -28,8 +28,6 @@ Windowed Multipole Library Format ":math:`r`" and ":math:`i`" identifiers, similar to how `h5py`_ does it. - **end_E** (*double*) Highest energy the windowed multipole part of the library is valid for. - - **energy_points** (*double[]*) - Energy grid for the pointwise library in the reaction group. - **formalism** (*int*) The formalism of the underlying data. Uses the `ENDF-6`_ format formalism numbers. @@ -47,12 +45,6 @@ Windowed Multipole Library Format - **l_value** (*int[]*) The index for a corresponding pole. Equivalent to the :math:`l` quantum number of the resonance the pole comes from :math:`+1`. - - **max_w** (*int*) - Maximum number of poles in a window. - - **MT_count** (*int*) - Number of pointwise tables in the library. - - **MT_list** (*int[]*) - A list of available MT identifiers. See `ENDF-6`_ for meaning. - **pseudo_K0RS** (*double[]*) :math:`l` dependent value of From b71ad222d090497aab04a76b684a3c8e4c72cd02 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Tue, 13 Mar 2018 22:05:59 -0400 Subject: [PATCH 101/231] Expand windowed multipole unit test --- tests/unit_tests/test_data_multipole.py | 26 +++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/tests/unit_tests/test_data_multipole.py b/tests/unit_tests/test_data_multipole.py index 4a4a9f0d21..de7c1cc931 100644 --- a/tests/unit_tests/test_data_multipole.py +++ b/tests/unit_tests/test_data_multipole.py @@ -17,6 +17,13 @@ def u235(): return openmc.data.WindowedMultipole.from_hdf5(filename) +@pytest.fixture(scope='module') +def u234(): + directory = os.environ['OPENMC_MULTIPOLE_LIBRARY'] + filename = os.path.join(directory, '092234.h5') + return openmc.data.WindowedMultipole.from_hdf5(filename) + + @pytest.fixture(scope='module') def fe56(): directory = os.environ['OPENMC_MULTIPOLE_LIBRARY'] @@ -24,8 +31,8 @@ def fe56(): return openmc.data.WindowedMultipole.from_hdf5(filename) -def test_evaluate(u235): - """Make sure multipole object can be called.""" +def test_evaluate_rm(u235): + """Make sure a Reich-Moore multipole object can be called.""" energies = [1e-3, 1.0, 10.0, 50.] total, absorption, fission = u235(energies, 0.0) assert total[1] == pytest.approx(90.64895383) @@ -33,6 +40,15 @@ def test_evaluate(u235): assert total[1] == pytest.approx(91.12534964) +def test_evaluate_mlbw(u234): + """Make sure a Multi-Level Breit-Wigner multipole object can be called.""" + energies = [1e-3, 1.0, 10.0, 50.] + total, absorption, fission = u234(energies, 0.0) + assert total[3] == pytest.approx(15.02827953) + total, absorption, fission = u234(energies, 300.0) + assert total[3] == pytest.approx(15.08269143) + + def test_high_l(fe56): """Test a nuclide (Fe56) with a high l-value (4).""" energies = [1e-3, 1.0, 10.0, 1e3, 1e5] @@ -40,3 +56,9 @@ def test_high_l(fe56): assert total[0] == pytest.approx(25.072619556789267) total, absorption, fission = fe56(energies, 300.0) assert total[0] == pytest.approx(27.85535792368082) + + +def test_to_hdf5(tmpdir, u235): + filename = str(tmpdir.join('092235.h5')) + u235.to_hdf5(filename) + assert os.path.exists(filename) From 1e49f3c889c379b667a9f23db1d64f5b2c1be17d Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Wed, 14 Mar 2018 12:51:19 -0400 Subject: [PATCH 102/231] Fix multipole l value counting --- src/multipole_header.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/multipole_header.F90 b/src/multipole_header.F90 index ec82b16a4e..7fb438bce1 100644 --- a/src/multipole_header.F90 +++ b/src/multipole_header.F90 @@ -147,7 +147,7 @@ contains ! Figure out the number of unique l values in the l_value array. do i = 1, n_poles if (.not. l_val_dict % has(this % l_value(i))) then - call l_val_dict % set(i, 0) + call l_val_dict % set(this % l_value(i), 0) end if end do this % num_l = l_val_dict % size() From 0508274a3dd97029b914c9031df5e9ff753f042b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 2 Mar 2018 10:36:08 -0600 Subject: [PATCH 103/231] Add useful warnings for add_nuclide/add_element --- docs/source/usersguide/materials.rst | 14 ++++++-- openmc/data/ace.py | 4 +-- openmc/data/data.py | 5 +-- openmc/data/endf.py | 4 +-- openmc/material.py | 49 ++++++++++------------------ tests/unit_tests/test_material.py | 4 +-- 6 files changed, 38 insertions(+), 42 deletions(-) diff --git a/docs/source/usersguide/materials.rst b/docs/source/usersguide/materials.rst index b1e0c151f2..8472768489 100644 --- a/docs/source/usersguide/materials.rst +++ b/docs/source/usersguide/materials.rst @@ -43,14 +43,22 @@ of an element, you specify the element itself. For example, Internally, OpenMC stores data on the atomic masses and natural abundances of all known isotopes and then uses this data to determine what isotopes should be added to the material. When the material is later exported to XML for use by the -:ref:`scripts_openmc` executable, you'll see that any natural elements are +:ref:`scripts_openmc` executable, you'll see that any natural elements were expanded to the naturally-occurring isotopes. +The :meth:`Material.add_element` method can also be used to add uranium at a +specified enrichment through the `enrichment` argument. For example, the +following would add 3.2% enriched uranium to a material:: + + mat.add_element('U', 1.0, enrichment=3.2) + +In addition to U235 and U238, concentrations of U234 and U236 will be present +and are determined through a correlation based on measured data. + Often, cross section libraries don't actually have all naturally-occurring isotopes for a given element. For example, in ENDF/B-VII.1, cross section evaluations are given for O16 and O17 but not for O18. If OpenMC is aware of -what cross sections you will be using (either through the -:attr:`Materials.cross_sections` attribute or the +what cross sections you will be using (through the :envvar:`OPENMC_CROSS_SECTIONS` environment variable), it will attempt to only put isotopes in your model for which you have cross section data. In the case of oxygen in ENDF/B-VII.1, the abundance of O18 would end up being lumped with O16. diff --git a/openmc/data/ace.py b/openmc/data/ace.py index 385408bd48..fa2705220b 100644 --- a/openmc/data/ace.py +++ b/openmc/data/ace.py @@ -22,7 +22,7 @@ import sys import numpy as np from openmc.mixin import EqualityMixin -from openmc.data.endf import ENDF_FLOAT_RE +from openmc.data.endf import _ENDF_FLOAT_RE def ascii_to_binary(ascii_file, binary_file): """Convert an ACE file in ASCII format (type 1) to binary format (type 2). @@ -349,7 +349,7 @@ class Library(EqualityMixin): # after it). If it's too short, then we apply the ENDF float regular # expression. We don't do this by default because it's expensive! if xss.size != nxs[1] + 1: - datastr = ENDF_FLOAT_RE.sub(r'\1e\2', datastr) + datastr = _ENDF_FLOAT_RE.sub(r'\1e\2', datastr) xss = np.fromstring(datastr, sep=' ') assert xss.size == nxs[1] + 1 diff --git a/openmc/data/data.py b/openmc/data/data.py index fd13299617..3a625b6229 100644 --- a/openmc/data/data.py +++ b/openmc/data/data.py @@ -136,6 +136,8 @@ ATOMIC_NUMBER = {value: key for key, value in ATOMIC_SYMBOL.items()} _ATOMIC_MASS = {} +_GND_NAME_RE = re.compile(r'([A-Zn][a-z]*)(\d+)((?:_[em]\d+)?)') + def atomic_mass(isotope): """Return atomic mass of isotope in atomic mass units. @@ -352,8 +354,7 @@ def zam(name): """ try: - symbol, A, state = re.match(r'([A-Zn][a-z]*)(\d+)((?:_[em]\d+)?)', - name).groups() + symbol, A, state = _GND_NAME_RE.match(name).groups() except AttributeError: raise ValueError("'{}' does not appear to be a nuclide name in GND " "format.".format(name)) diff --git a/openmc/data/endf.py b/openmc/data/endf.py index c44c66be0c..0d1f402c2f 100644 --- a/openmc/data/endf.py +++ b/openmc/data/endf.py @@ -45,7 +45,7 @@ SUM_RULES = {1: [2, 3], 106: list(range(750, 800)), 107: list(range(800, 850))} -ENDF_FLOAT_RE = re.compile(r'([\s\-\+]?\d*\.\d+)([\+\-]\d+)') +_ENDF_FLOAT_RE = re.compile(r'([\s\-\+]?\d*\.\d+)([\+\-]\d+)') def float_endf(s): @@ -68,7 +68,7 @@ def float_endf(s): The number """ - return float(ENDF_FLOAT_RE.sub(r'\1e\2', s)) + return float(_ENDF_FLOAT_RE.sub(r'\1e\2', s)) def get_text_record(file_obj): diff --git a/openmc/material.py b/openmc/material.py index d52d8a27b4..053e516fae 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -379,33 +379,27 @@ class Material(IDManagerMixin): Parameters ---------- nuclide : str - Nuclide to add + Nuclide to add, e.g., 'Mo95' percent : float Atom or weight percent percent_type : {'ao', 'wo'} 'ao' for atom percent and 'wo' for weight percent """ + cv.check_type('nuclide', nuclide, str) + cv.check_type('percent', percent, Real) + cv.check_value('percent type', percent_type, {'ao', 'wo'}) if self._macroscopic is not None: msg = 'Unable to add a Nuclide to Material ID="{}" as a ' \ 'macroscopic data-set has already been added'.format(self._id) raise ValueError(msg) - if not isinstance(nuclide, str): - msg = 'Unable to add a Nuclide to Material ID="{}" with a ' \ - 'non-string value "{}"'.format(self._id, nuclide) - raise ValueError(msg) - - elif not isinstance(percent, Real): - msg = 'Unable to add a Nuclide to Material ID="{}" with a ' \ - 'non-floating point value "{}"'.format(self._id, percent) - raise ValueError(msg) - - elif percent_type not in ('ao', 'wo'): - msg = 'Unable to add a Nuclide to Material ID="{}" with a ' \ - 'percent type "{}"'.format(self._id, percent_type) - raise ValueError(msg) + # If nuclide name doesn't look valid, give a warning + try: + openmc.data.zam(nuclide) + except ValueError as e: + warnings.warn(str(e)) self._nuclides.append((nuclide, percent, percent_type)) @@ -493,7 +487,7 @@ class Material(IDManagerMixin): Parameters ---------- element : str - Element to add + Element to add, e.g., 'Zr' percent : float Atom or weight percent percent_type : {'ao', 'wo'}, optional @@ -505,27 +499,15 @@ class Material(IDManagerMixin): (natural composition). """ + cv.check_type('nuclide', element, str) + cv.check_type('percent', percent, Real) + cv.check_value('percent type', percent_type, {'ao', 'wo'}) if self._macroscopic is not None: msg = 'Unable to add an Element to Material ID="{}" as a ' \ 'macroscopic data-set has already been added'.format(self._id) raise ValueError(msg) - if not isinstance(element, str): - msg = 'Unable to add an Element to Material ID="{}" with a ' \ - 'non-string value "{}"'.format(self._id, element) - raise ValueError(msg) - - if not isinstance(percent, Real): - msg = 'Unable to add an Element to Material ID="{}" with a ' \ - 'non-floating point value "{}"'.format(self._id, percent) - raise ValueError(msg) - - if percent_type not in ['ao', 'wo']: - msg = 'Unable to add an Element to Material ID="{}" with a ' \ - 'percent type "{}"'.format(self._id, percent_type) - raise ValueError(msg) - if enrichment is not None: if not isinstance(enrichment, Real): msg = 'Unable to add an Element to Material ID="{}" with a ' \ @@ -551,6 +533,11 @@ class Material(IDManagerMixin): format(enrichment, self._id) warnings.warn(msg) + # Make sure element name is just that + if not element.isalpha(): + raise ValueError("Element name should be given by the " + "element's symbol, e.g., 'Zr'") + # Add naturally-occuring isotopes element = openmc.Element(element) for nuclide in element.expand(percent, percent_type, enrichment): diff --git a/tests/unit_tests/test_material.py b/tests/unit_tests/test_material.py index c251df3a6d..b7b745408d 100644 --- a/tests/unit_tests/test_material.py +++ b/tests/unit_tests/test_material.py @@ -15,9 +15,9 @@ def test_nuclides(uo2): """Test adding/removing nuclides.""" m = openmc.Material() m.add_nuclide('U235', 1.0) - with pytest.raises(ValueError): + with pytest.raises(TypeError): m.add_nuclide('H1', '1.0') - with pytest.raises(ValueError): + with pytest.raises(TypeError): m.add_nuclide(1.0, 'H1') with pytest.raises(ValueError): m.add_nuclide('H1', 1.0, 'oa') From f415700c86d5e4bbb8498b216c95e5fa5a78e00c Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 2 Mar 2018 10:57:02 -0600 Subject: [PATCH 104/231] Make materials with actinides depletable by default --- openmc/material.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openmc/material.py b/openmc/material.py index 053e516fae..88479d8df6 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -88,7 +88,7 @@ class Material(IDManagerMixin): self.name = name self.temperature = temperature self._density = None - self._density_units = '' + self._density_units = 'sum' self._depletable = False self._paths = None self._num_instances = None @@ -397,9 +397,13 @@ class Material(IDManagerMixin): # If nuclide name doesn't look valid, give a warning try: - openmc.data.zam(nuclide) + Z, _, _ = openmc.data.zam(nuclide) except ValueError as e: warnings.warn(str(e)) + else: + # For actinides, have the material be depletable by default + if Z >= 89: + self.depletable = True self._nuclides.append((nuclide, percent, percent_type)) @@ -541,7 +545,7 @@ class Material(IDManagerMixin): # Add naturally-occuring isotopes element = openmc.Element(element) for nuclide in element.expand(percent, percent_type, enrichment): - self._nuclides.append(nuclide) + self.add_nuclide(*nuclide) def add_s_alpha_beta(self, name, fraction=1.0): r"""Add an :math:`S(\alpha,\beta)` table to the material From ed7edf414179f34ccb9247f847b931e507c3ec21 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 2 Mar 2018 12:09:27 -0600 Subject: [PATCH 105/231] Have Universe.plot return AxesImage. Add Plot.to_image method --- openmc/plots.py | 37 +++++++++++++++++++++++++++++++++++++ openmc/plotter.py | 3 ++- openmc/universe.py | 27 ++++++++++++++------------- 3 files changed, 53 insertions(+), 14 deletions(-) diff --git a/openmc/plots.py b/openmc/plots.py index 4414a39e13..a948c2a48e 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -1,6 +1,7 @@ from collections.abc import Iterable, Mapping from numbers import Real, Integral from xml.etree import ElementTree as ET +import subprocess import sys import warnings @@ -650,6 +651,42 @@ class Plot(IDManagerMixin): return element + def to_image(self, openmc_exec='openmc', cwd='.', convert_exec='convert'): + """Render plot as an image + + Parameters + ---------- + openmc_exec : str + Path to OpenMC executable + cwd : str, optional + Path to working directory to run in + convert_exec : str, optional + Command that can convert PPM files into PNG files + + Returns + ------- + IPython.display.Image + Image generated + + """ + from IPython.display import Image + + # Create plots.xml + Plots([self]).export_to_xml() + + # Run OpenMC in geometry plotting mode + openmc.plot_geometry(False, openmc_exec, cwd) + + # Convert to .png + if self.filename is not None: + ppm_file = '{}.ppm'.format(self.filename) + else: + ppm_file = 'plot_{}.ppm'.format(self.id) + png_file = ppm_file.replace('.ppm', '.png') + subprocess.check_call([convert_exec, ppm_file, png_file]) + + return Image(png_file) + class Plots(cv.CheckedList): """Collection of Plots used for an OpenMC simulation. diff --git a/openmc/plotter.py b/openmc/plotter.py index 1bf6fe46fd..191b50c563 100644 --- a/openmc/plotter.py +++ b/openmc/plotter.py @@ -2,7 +2,6 @@ from numbers import Integral, Real from itertools import chain import string -import matplotlib.pyplot as plt import numpy as np import openmc.checkvalue as cv @@ -125,6 +124,8 @@ def plot_xs(this, types, divisor_types=None, temperature=294., data_type=None, generated. """ + import matplotlib.pyplot as plt + cv.check_type("plot_CE", plot_CE, bool) if data_type is None: diff --git a/openmc/universe.py b/openmc/universe.py index 55f574c536..77138adcce 100644 --- a/openmc/universe.py +++ b/openmc/universe.py @@ -4,7 +4,6 @@ from numbers import Integral, Real import random import sys -import matplotlib.pyplot as plt import numpy as np import openmc @@ -184,10 +183,14 @@ class Universe(IDManagerMixin): return [] def plot(self, origin=(0., 0., 0.), width=(1., 1.), pixels=(200, 200), - basis='xy', color_by='cell', colors=None, filename=None, seed=None, + basis='xy', color_by='cell', colors=None, seed=None, **kwargs): """Display a slice plot of the universe. + To display or save the plot, call :func:`matplotlib.pyplot.show` or + :func:`matplotlib.pyplot.savefig`. In a Jupyter notebook, enabling the + matplotlib inline backend will show the plot inline. + Parameters ---------- origin : Iterable of float @@ -212,9 +215,6 @@ class Universe(IDManagerMixin): water = openmc.Cell(fill=h2o) universe.plot(..., colors={water: (0., 0., 1.)) - filename : str or None - Filename to save plot to. If no filename is given, the plot will be - displayed using the currently enabled matplotlib backend. seed : hashable object or None Hashable object which is used to seed the random number generator used to select colors. If None, the generator is seeded from the @@ -223,7 +223,14 @@ class Universe(IDManagerMixin): All keyword arguments are passed to :func:`matplotlib.pyplot.imshow`. + Returns + ------- + matplotlib.image.AxesImage + Resulting image + """ + import matplotlib.pyplot as plt + # Seed the random number generator if seed is not None: random.seed(seed) @@ -298,14 +305,8 @@ class Universe(IDManagerMixin): img[j, i, :] = colors[obj] # Display image - plt.imshow(img, extent=(x_min, x_max, y_min, y_max), - interpolation='nearest', **kwargs) - - # Show or save the plot - if filename is None: - plt.show() - else: - plt.savefig(filename) + return plt.imshow(img, extent=(x_min, x_max, y_min, y_max), + interpolation='nearest', **kwargs) def add_cell(self, cell): """Add a cell to the universe. From 23324fe24b62b0f92e609a4e78c40847277ed3d8 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 2 Mar 2018 16:18:51 -0600 Subject: [PATCH 106/231] Fix broken tests --- tests/regression_tests/asymmetric_lattice/inputs_true.dat | 2 +- .../create_fission_neutrons/inputs_true.dat | 2 +- tests/regression_tests/diff_tally/inputs_true.dat | 2 +- tests/regression_tests/distribmat/inputs_true.dat | 4 ++-- tests/regression_tests/filter_energyfun/inputs_true.dat | 4 ++-- tests/regression_tests/filter_mesh/inputs_true.dat | 2 +- tests/regression_tests/fixed_source/inputs_true.dat | 2 +- tests/regression_tests/iso_in_lab/inputs_true.dat | 2 +- .../mgxs_library_ce_to_mg/inputs_true.dat | 2 +- .../mgxs_library_condense/inputs_true.dat | 2 +- .../mgxs_library_distribcell/inputs_true.dat | 2 +- tests/regression_tests/mgxs_library_hdf5/inputs_true.dat | 2 +- tests/regression_tests/mgxs_library_mesh/inputs_true.dat | 2 +- .../mgxs_library_no_nuclides/inputs_true.dat | 2 +- .../mgxs_library_nuclides/inputs_true.dat | 2 +- tests/regression_tests/multipole/inputs_true.dat | 2 +- tests/regression_tests/periodic/inputs_true.dat | 2 +- .../regression_tests/resonance_scattering/inputs_true.dat | 2 +- tests/regression_tests/salphabeta/inputs_true.dat | 8 ++++---- tests/regression_tests/source/inputs_true.dat | 2 +- tests/regression_tests/surface_tally/inputs_true.dat | 2 +- tests/regression_tests/tallies/inputs_true.dat | 2 +- tests/regression_tests/tally_aggregation/inputs_true.dat | 2 +- tests/regression_tests/tally_arithmetic/inputs_true.dat | 2 +- tests/regression_tests/tally_slice_merge/inputs_true.dat | 2 +- tests/regression_tests/triso/inputs_true.dat | 2 +- tests/regression_tests/volume_calc/inputs_true.dat | 2 +- tests/unit_tests/test_universe.py | 1 - 28 files changed, 32 insertions(+), 33 deletions(-) diff --git a/tests/regression_tests/asymmetric_lattice/inputs_true.dat b/tests/regression_tests/asymmetric_lattice/inputs_true.dat index 672f6bee12..bbdc79715b 100644 --- a/tests/regression_tests/asymmetric_lattice/inputs_true.dat +++ b/tests/regression_tests/asymmetric_lattice/inputs_true.dat @@ -56,7 +56,7 @@ - + diff --git a/tests/regression_tests/create_fission_neutrons/inputs_true.dat b/tests/regression_tests/create_fission_neutrons/inputs_true.dat index 9aeabbb57b..b0ca896476 100644 --- a/tests/regression_tests/create_fission_neutrons/inputs_true.dat +++ b/tests/regression_tests/create_fission_neutrons/inputs_true.dat @@ -10,7 +10,7 @@ - + diff --git a/tests/regression_tests/diff_tally/inputs_true.dat b/tests/regression_tests/diff_tally/inputs_true.dat index ff134bd5c3..909475f962 100644 --- a/tests/regression_tests/diff_tally/inputs_true.dat +++ b/tests/regression_tests/diff_tally/inputs_true.dat @@ -148,7 +148,7 @@ - + diff --git a/tests/regression_tests/distribmat/inputs_true.dat b/tests/regression_tests/distribmat/inputs_true.dat index 85d35b0810..39e611e16a 100644 --- a/tests/regression_tests/distribmat/inputs_true.dat +++ b/tests/regression_tests/distribmat/inputs_true.dat @@ -26,11 +26,11 @@ - + - + diff --git a/tests/regression_tests/filter_energyfun/inputs_true.dat b/tests/regression_tests/filter_energyfun/inputs_true.dat index d857451cb0..418354fc2b 100644 --- a/tests/regression_tests/filter_energyfun/inputs_true.dat +++ b/tests/regression_tests/filter_energyfun/inputs_true.dat @@ -148,7 +148,7 @@ - + @@ -156,7 +156,7 @@ - + diff --git a/tests/regression_tests/filter_mesh/inputs_true.dat b/tests/regression_tests/filter_mesh/inputs_true.dat index 6d14f9e7e3..ca063b7ce9 100644 --- a/tests/regression_tests/filter_mesh/inputs_true.dat +++ b/tests/regression_tests/filter_mesh/inputs_true.dat @@ -148,7 +148,7 @@ - + diff --git a/tests/regression_tests/fixed_source/inputs_true.dat b/tests/regression_tests/fixed_source/inputs_true.dat index 2e0d57b0c1..f1aebb3b2b 100644 --- a/tests/regression_tests/fixed_source/inputs_true.dat +++ b/tests/regression_tests/fixed_source/inputs_true.dat @@ -5,7 +5,7 @@ - + diff --git a/tests/regression_tests/iso_in_lab/inputs_true.dat b/tests/regression_tests/iso_in_lab/inputs_true.dat index 9e30f245f9..2a302ada67 100644 --- a/tests/regression_tests/iso_in_lab/inputs_true.dat +++ b/tests/regression_tests/iso_in_lab/inputs_true.dat @@ -148,7 +148,7 @@ - + diff --git a/tests/regression_tests/mgxs_library_ce_to_mg/inputs_true.dat b/tests/regression_tests/mgxs_library_ce_to_mg/inputs_true.dat index 8e8cde2818..70996fe378 100644 --- a/tests/regression_tests/mgxs_library_ce_to_mg/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_ce_to_mg/inputs_true.dat @@ -12,7 +12,7 @@ - + diff --git a/tests/regression_tests/mgxs_library_condense/inputs_true.dat b/tests/regression_tests/mgxs_library_condense/inputs_true.dat index d2f28d0fe0..ef6c4c5206 100644 --- a/tests/regression_tests/mgxs_library_condense/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_condense/inputs_true.dat @@ -12,7 +12,7 @@ - + diff --git a/tests/regression_tests/mgxs_library_distribcell/inputs_true.dat b/tests/regression_tests/mgxs_library_distribcell/inputs_true.dat index d7a4a186ac..ba7dc05ff7 100644 --- a/tests/regression_tests/mgxs_library_distribcell/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_distribcell/inputs_true.dat @@ -39,7 +39,7 @@ - + diff --git a/tests/regression_tests/mgxs_library_hdf5/inputs_true.dat b/tests/regression_tests/mgxs_library_hdf5/inputs_true.dat index d2f28d0fe0..ef6c4c5206 100644 --- a/tests/regression_tests/mgxs_library_hdf5/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_hdf5/inputs_true.dat @@ -12,7 +12,7 @@ - + diff --git a/tests/regression_tests/mgxs_library_mesh/inputs_true.dat b/tests/regression_tests/mgxs_library_mesh/inputs_true.dat index 4756b27bfb..aa2c904b19 100644 --- a/tests/regression_tests/mgxs_library_mesh/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_mesh/inputs_true.dat @@ -148,7 +148,7 @@ - + diff --git a/tests/regression_tests/mgxs_library_no_nuclides/inputs_true.dat b/tests/regression_tests/mgxs_library_no_nuclides/inputs_true.dat index d2f28d0fe0..ef6c4c5206 100644 --- a/tests/regression_tests/mgxs_library_no_nuclides/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_no_nuclides/inputs_true.dat @@ -12,7 +12,7 @@ - + diff --git a/tests/regression_tests/mgxs_library_nuclides/inputs_true.dat b/tests/regression_tests/mgxs_library_nuclides/inputs_true.dat index 826eb5b623..b720bfcbba 100644 --- a/tests/regression_tests/mgxs_library_nuclides/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_nuclides/inputs_true.dat @@ -12,7 +12,7 @@ - + diff --git a/tests/regression_tests/multipole/inputs_true.dat b/tests/regression_tests/multipole/inputs_true.dat index 0d1fe99bdc..d1ef3e00aa 100644 --- a/tests/regression_tests/multipole/inputs_true.dat +++ b/tests/regression_tests/multipole/inputs_true.dat @@ -27,7 +27,7 @@ - + diff --git a/tests/regression_tests/periodic/inputs_true.dat b/tests/regression_tests/periodic/inputs_true.dat index 61958701b2..6f613a1602 100644 --- a/tests/regression_tests/periodic/inputs_true.dat +++ b/tests/regression_tests/periodic/inputs_true.dat @@ -18,7 +18,7 @@ - + diff --git a/tests/regression_tests/resonance_scattering/inputs_true.dat b/tests/regression_tests/resonance_scattering/inputs_true.dat index 70fe165fd5..2301ccf762 100644 --- a/tests/regression_tests/resonance_scattering/inputs_true.dat +++ b/tests/regression_tests/resonance_scattering/inputs_true.dat @@ -5,7 +5,7 @@ - + diff --git a/tests/regression_tests/salphabeta/inputs_true.dat b/tests/regression_tests/salphabeta/inputs_true.dat index 02e6813f02..ede96d3769 100644 --- a/tests/regression_tests/salphabeta/inputs_true.dat +++ b/tests/regression_tests/salphabeta/inputs_true.dat @@ -12,19 +12,19 @@ - + - + - + @@ -32,7 +32,7 @@ - + diff --git a/tests/regression_tests/source/inputs_true.dat b/tests/regression_tests/source/inputs_true.dat index da230e0e50..6dd913edc0 100644 --- a/tests/regression_tests/source/inputs_true.dat +++ b/tests/regression_tests/source/inputs_true.dat @@ -5,7 +5,7 @@ - + 294 diff --git a/tests/regression_tests/surface_tally/inputs_true.dat b/tests/regression_tests/surface_tally/inputs_true.dat index e66d44273a..fc10110eee 100644 --- a/tests/regression_tests/surface_tally/inputs_true.dat +++ b/tests/regression_tests/surface_tally/inputs_true.dat @@ -11,7 +11,7 @@ - + diff --git a/tests/regression_tests/tallies/inputs_true.dat b/tests/regression_tests/tallies/inputs_true.dat index a85491e943..2c33a8fa0d 100644 --- a/tests/regression_tests/tallies/inputs_true.dat +++ b/tests/regression_tests/tallies/inputs_true.dat @@ -148,7 +148,7 @@ - + diff --git a/tests/regression_tests/tally_aggregation/inputs_true.dat b/tests/regression_tests/tally_aggregation/inputs_true.dat index 7a8bf46133..86806572a0 100644 --- a/tests/regression_tests/tally_aggregation/inputs_true.dat +++ b/tests/regression_tests/tally_aggregation/inputs_true.dat @@ -148,7 +148,7 @@ - + diff --git a/tests/regression_tests/tally_arithmetic/inputs_true.dat b/tests/regression_tests/tally_arithmetic/inputs_true.dat index 743ca3c582..3605005add 100644 --- a/tests/regression_tests/tally_arithmetic/inputs_true.dat +++ b/tests/regression_tests/tally_arithmetic/inputs_true.dat @@ -148,7 +148,7 @@ - + diff --git a/tests/regression_tests/tally_slice_merge/inputs_true.dat b/tests/regression_tests/tally_slice_merge/inputs_true.dat index b1c089c965..ccd3655f9e 100644 --- a/tests/regression_tests/tally_slice_merge/inputs_true.dat +++ b/tests/regression_tests/tally_slice_merge/inputs_true.dat @@ -148,7 +148,7 @@ - + diff --git a/tests/regression_tests/triso/inputs_true.dat b/tests/regression_tests/triso/inputs_true.dat index fdbc1cb5f1..6d674b4502 100644 --- a/tests/regression_tests/triso/inputs_true.dat +++ b/tests/regression_tests/triso/inputs_true.dat @@ -393,7 +393,7 @@ - + diff --git a/tests/regression_tests/volume_calc/inputs_true.dat b/tests/regression_tests/volume_calc/inputs_true.dat index 28f1cbd9fc..607921af26 100644 --- a/tests/regression_tests/volume_calc/inputs_true.dat +++ b/tests/regression_tests/volume_calc/inputs_true.dat @@ -18,7 +18,7 @@ - + diff --git a/tests/unit_tests/test_universe.py b/tests/unit_tests/test_universe.py index 59e34e2017..89904524b6 100644 --- a/tests/unit_tests/test_universe.py +++ b/tests/unit_tests/test_universe.py @@ -59,7 +59,6 @@ def test_plot(run_in_tmpdir, sphere_model): pixels=(10, 10), color_by='material', colors=colors, - filename='test.png' ) From 8487915f2a66e2875b9970e65f77be45b32982aa Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 2 Mar 2018 16:19:10 -0600 Subject: [PATCH 107/231] Use ufloat for k_combined in statepoint --- openmc/mgxs/library.py | 2 +- openmc/model/model.py | 2 +- openmc/search.py | 4 ++-- openmc/statepoint.py | 17 ++++++++++------- tests/regression_tests/entropy/test.py | 4 ++-- tests/regression_tests/mg_convert/test.py | 4 ++-- tests/testing_harness.py | 2 +- 7 files changed, 19 insertions(+), 16 deletions(-) diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index 9add7004bb..ed8e3f076c 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -587,7 +587,7 @@ class Library(object): self._nuclides = statepoint.summary.nuclides if statepoint.run_mode == 'eigenvalue': - self._keff = statepoint.k_combined[0] + self._keff = statepoint.k_combined.n # Load tallies for each MGXS for each domain and mgxs type for domain in self.domains: diff --git a/openmc/model/model.py b/openmc/model/model.py index cd51533217..7a81292c1a 100644 --- a/openmc/model/model.py +++ b/openmc/model/model.py @@ -210,7 +210,7 @@ class Model(object): Returns ------- - 2-tuple of float + uncertainties.UFloat Combined estimator of k-effective from the statepoint """ diff --git a/openmc/search.py b/openmc/search.py index 75935097e4..6be8a50ea5 100644 --- a/openmc/search.py +++ b/openmc/search.py @@ -60,9 +60,9 @@ def _search_keff(guess, target, model_builder, model_args, print_iterations, if print_iterations: text = 'Iteration: {}; Guess of {:.2e} produced a keff of ' + \ '{:1.5f} +/- {:1.5f}' - print(text.format(len(guesses), guess, keff[0], keff[1])) + print(text.format(len(guesses), guess, keff.n, keff.s)) - return (keff[0] - target) + return keff.n - target def search_for_keff(model_builder, initial_guess=None, target=1.0, diff --git a/openmc/statepoint.py b/openmc/statepoint.py index 4656e08560..eb011d8742 100644 --- a/openmc/statepoint.py +++ b/openmc/statepoint.py @@ -1,3 +1,4 @@ +from datetime import datetime import re import os import warnings @@ -5,6 +6,7 @@ import glob import numpy as np import h5py +from uncertainties import ufloat import openmc import openmc.checkvalue as cv @@ -47,8 +49,8 @@ class StatePoint(object): CMFD fission source distribution over all mesh cells and energy groups. current_batch : int Number of batches simulated - date_and_time : str - Date and time when simulation began + date_and_time : datetime.datetime + Date and time at which statepoint was written entropy : numpy.ndarray Shannon entropy of fission source at each batch filters : dict @@ -59,8 +61,8 @@ class StatePoint(object): global_tallies : numpy.ndarray of compound datatype Global tallies for k-effective estimates and leakage. The compound datatype has fields 'name', 'sum', 'sum_sq', 'mean', and 'std_dev'. - k_combined : list - Combined estimator for k-effective and its uncertainty + k_combined : uncertainties.UFloat + Combined estimator for k-effective k_col_abs : float Cross-product of collision and absorption estimates of k-effective k_col_tra : float @@ -187,7 +189,8 @@ class StatePoint(object): @property def date_and_time(self): - return self._f.attrs['date_and_time'].decode() + s = self._f.attrs['date_and_time'].decode() + return datetime.strptime(s, '%Y-%m-%d %H:%M:%S') @property def entropy(self): @@ -255,7 +258,7 @@ class StatePoint(object): @property def k_combined(self): if self.run_mode == 'eigenvalue': - return self._f['k_combined'].value + return ufloat(*self._f['k_combined'].value) else: return None @@ -457,7 +460,7 @@ class StatePoint(object): @property def version(self): - return tuple(self._f.attrs['version']) + return tuple(self._f.attrs['openmc_version']) @property def summary(self): diff --git a/tests/regression_tests/entropy/test.py b/tests/regression_tests/entropy/test.py index 0f1052b6b8..10a11e3008 100644 --- a/tests/regression_tests/entropy/test.py +++ b/tests/regression_tests/entropy/test.py @@ -14,11 +14,11 @@ class EntropyTestHarness(TestHarness): with StatePoint(statepoint) as sp: # Write out k-combined. outstr = 'k-combined:\n' - outstr += '{0:12.6E} {1:12.6E}\n'.format(*sp.k_combined) + outstr += '{:12.6E} {:12.6E}\n'.format(sp.k_combined.n, sp.k_combined.s) # Write out entropy data. outstr += 'entropy:\n' - results = ['{0:12.6E}'.format(x) for x in sp.entropy] + results = ['{:12.6E}'.format(x) for x in sp.entropy] outstr += '\n'.join(results) + '\n' return outstr diff --git a/tests/regression_tests/mg_convert/test.py b/tests/regression_tests/mg_convert/test.py index 5b816a1cd0..1ace10c80b 100755 --- a/tests/regression_tests/mg_convert/test.py +++ b/tests/regression_tests/mg_convert/test.py @@ -144,8 +144,8 @@ class MGXSTestHarness(PyAPITestHarness): with openmc.StatePoint('statepoint.{}.h5'.format(batches)) as sp: # Write out k-combined. outstr += 'k-combined:\n' - form = '{0:12.6E} {1:12.6E}\n' - outstr += form.format(sp.k_combined[0], sp.k_combined[1]) + form = '{:12.6E} {:12.6E}\n' + outstr += form.format(sp.k_combined.n, sp.k_combined.s) return outstr diff --git a/tests/testing_harness.py b/tests/testing_harness.py index 92d477e238..fb07575ce7 100644 --- a/tests/testing_harness.py +++ b/tests/testing_harness.py @@ -75,7 +75,7 @@ class TestHarness(object): # Write out k-combined. outstr = 'k-combined:\n' form = '{0:12.6E} {1:12.6E}\n' - outstr += form.format(sp.k_combined[0], sp.k_combined[1]) + outstr += form.format(sp.k_combined.n, sp.k_combined.s) # Write out tally data. for i, tally_ind in enumerate(sp.tallies): From ac28407aa2d54b96ff911f69fdb982f2f14728e0 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sat, 3 Mar 2018 15:55:12 -0600 Subject: [PATCH 108/231] Don't have atomic_mass/atomic_weight return None for invalid --- openmc/data/data.py | 29 +++++++++++++++-------------- tests/unit_tests/test_data_misc.py | 13 +++++++++++++ 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/openmc/data/data.py b/openmc/data/data.py index 3a625b6229..90d5903e73 100644 --- a/openmc/data/data.py +++ b/openmc/data/data.py @@ -1,10 +1,9 @@ import itertools +from math import sqrt import os import re from warnings import warn -from numpy import sqrt - # Isotopic abundances from Meija J, Coplen T B, et al, "Isotopic compositions # of the elements 2013 (IUPAC Technical Report)", Pure. Appl. Chem. 88 (3), @@ -142,19 +141,18 @@ _GND_NAME_RE = re.compile(r'([A-Zn][a-z]*)(\d+)((?:_[em]\d+)?)') def atomic_mass(isotope): """Return atomic mass of isotope in atomic mass units. - Atomic mass data comes from the Atomic Mass Evaluation 2012, published in - Chinese Physics C 36 (2012), 1287--1602. + Atomic mass data comes from the `Atomic Mass Evaluation 2012 + `_. Parameters ---------- isotope : str - Name of isotope, e.g. 'Pu239' + Name of isotope, e.g., 'Pu239' Returns ------- - float or None - Atomic mass of isotope in atomic mass units. If the isotope listed does - not have a known atomic mass, None is returned. + float + Atomic mass of isotope in [amu] """ if not _ATOMIC_MASS: @@ -185,7 +183,7 @@ def atomic_mass(isotope): if '_' in isotope: isotope = isotope[:isotope.find('_')] - return _ATOMIC_MASS.get(isotope.lower()) + return _ATOMIC_MASS[isotope.lower()] def atomic_weight(element): @@ -201,16 +199,19 @@ def atomic_weight(element): Returns ------- - float or None - Atomic weight of element in atomic mass units. If the element listed does - not exist, None is returned. + float + Atomic weight of element in [amu] """ weight = 0. for nuclide, abundance in NATURAL_ABUNDANCE.items(): if re.match(r'{}\d+'.format(element), nuclide): weight += atomic_mass(nuclide) * abundance - return None if weight == 0. else weight + if weight > 0.: + return weight + else: + raise ValueError("No naturally-occurring isotopes for element '{}'." + .format(element)) def water_density(temperature, pressure=0.1013): @@ -236,7 +237,7 @@ def water_density(temperature, pressure=0.1013): Returns ------- float - Water density in units of [g / cm^3] + Water density in units of [g/cm^3] """ diff --git a/tests/unit_tests/test_data_misc.py b/tests/unit_tests/test_data_misc.py index 04ca0f1031..34686b567f 100644 --- a/tests/unit_tests/test_data_misc.py +++ b/tests/unit_tests/test_data_misc.py @@ -50,6 +50,19 @@ def test_thin(): assert f(1.0) == pytest.approx(np.sin(1.0), 0.001) +def test_atomic_mass(): + assert openmc.data.atomic_mass('H1') == 1.00782503223 + assert openmc.data.atomic_mass('U235') == 235.043930131 + with pytest.raises(KeyError): + openmc.data.atomic_mass('U100') + + +def test_atomic_weight(): + assert openmc.data.atomic_weight('C') == 12.011115164862904 + with pytest.raises(ValueError): + openmc.data.atomic_weight('Qt') + + def test_water_density(): dens = openmc.data.water_density # These test values are from IAPWS R7-97(2012). They are actually specific From 0efd0424204b0568ff6b48875b3618cd954a4dcd Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sat, 3 Mar 2018 16:27:45 -0600 Subject: [PATCH 109/231] Fix display of version number and copyright year --- src/output.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/output.F90 b/src/output.F90 index 1bf0c46d08..964289126c 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -165,12 +165,12 @@ contains subroutine print_version() if (master) then - write(UNIT=OUTPUT_UNIT, FMT='(1X,A,1X,I1,".",I1,".",I1)') & + write(UNIT=OUTPUT_UNIT, FMT='(1X,A,1X,I1,".",I2,".",I1)') & "OpenMC version", VERSION_MAJOR, VERSION_MINOR, VERSION_RELEASE #ifdef GIT_SHA1 write(UNIT=OUTPUT_UNIT, FMT='(1X,A,A)') "Git SHA1: ", GIT_SHA1 #endif - write(UNIT=OUTPUT_UNIT, FMT=*) "Copyright (c) 2011-2015 & + write(UNIT=OUTPUT_UNIT, FMT=*) "Copyright (c) 2011-2018 & &Massachusetts Institute of Technology" write(UNIT=OUTPUT_UNIT, FMT=*) "MIT/X license at & &" From dca39f87e2730aba4152e7d51849b42916319ab0 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 5 Mar 2018 19:56:42 -0600 Subject: [PATCH 110/231] Use gnd_name in _get_metadata --- openmc/data/neutron.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/openmc/data/neutron.py b/openmc/data/neutron.py index 0aa1fe7d83..1cc0e38879 100644 --- a/openmc/data/neutron.py +++ b/openmc/data/neutron.py @@ -15,7 +15,7 @@ import h5py from . import HDF5_VERSION, HDF5_VERSION_MAJOR from .ace import Library, Table, get_table -from .data import ATOMIC_SYMBOL, K_BOLTZMANN, EV_PER_MEV +from .data import ATOMIC_SYMBOL, K_BOLTZMANN, EV_PER_MEV, gnd_name from .endf import Evaluation, SUM_RULES, get_head_record, get_tab1_record from .fission_energy import FissionEnergyRelease from .function import Tabulated1D, Sum, ResonancesWithBackground @@ -93,9 +93,7 @@ def _get_metadata(zaid, metastable_scheme='nndc'): # Determine name element = ATOMIC_SYMBOL[Z] - name = '{}{}'.format(element, mass_number) - if metastable > 0: - name += '_m{}'.format(metastable) + name = gnd_name(Z, mass_number, metastable) return (name, element, Z, mass_number, metastable) From 9904e64910eec94e63c071f1c5d8077be9b756e7 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 7 Mar 2018 06:31:27 -0600 Subject: [PATCH 111/231] Add three papers to list of publications --- docs/source/publications.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/source/publications.rst b/docs/source/publications.rst index 7578fee6b1..b88bdc0f0c 100644 --- a/docs/source/publications.rst +++ b/docs/source/publications.rst @@ -57,6 +57,11 @@ Benchmarking Coupling and Multi-physics -------------------------- +- Jun Chen, Liangzhi Cao, Chuanqi Zhao, and Zhouyu Liu, "`Development of + Subchannel Code SUBSC for high-fidelity multi-physics coupling application + `_", Energy Procedia, **127**, + 264-274 (2017). + - 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 `_," @@ -98,6 +103,11 @@ Coupling and Multi-physics Geometry and Visualization -------------------------- +- Jin-Yang Li, Long Gu, Hu-Shan Xu, Nadezha Korepanova, Rui Yu, Yan-Lei Zhu, and + Chang-Ping Qin, "`CAD modeling study on FLUKA and OpenMC for accelerator + driven system simulation `_", + *Ann. Nucl. Energy*, **114**, 329-341 (2018). + - Logan Abel, William Boyd, Benoit Forget, and Kord Smith, "Interactive Visualization of Multi-Group Cross Sections on High-Fidelity Spatial Meshes," *Trans. Am. Nucl. Soc.*, **114**, 391-394 (2016). @@ -114,6 +124,11 @@ Geometry and Visualization Miscellaneous ------------- +- Bruno Merk, Dzianis Litskevich, R. Gregg, and A. R. Mount, "`Demand driven + salt clean-up in a molten salt fast reactor -- Defining a priority list + `_", *PLOS One*, **13**, + e0192020 (2018). + - 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). From 9e912a933dcadab2c240d928dd685088548d3193 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 15 Mar 2018 10:41:43 -0500 Subject: [PATCH 112/231] Support energyout filters in C API --- openmc/capi/filter.py | 2 +- src/tallies/tally_filter_energy.F90 | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/openmc/capi/filter.py b/openmc/capi/filter.py index 79c19a6248..5a5df4814d 100644 --- a/openmc/capi/filter.py +++ b/openmc/capi/filter.py @@ -128,7 +128,7 @@ class EnergyFilter(Filter): self._index, len(energies), energies_p) -class EnergyoutFilter(Filter): +class EnergyoutFilter(EnergyFilter): filter_type = 'energyout' diff --git a/src/tallies/tally_filter_energy.F90 b/src/tallies/tally_filter_energy.F90 index 2a247cf358..caba6755d1 100644 --- a/src/tallies/tally_filter_energy.F90 +++ b/src/tallies/tally_filter_energy.F90 @@ -211,6 +211,10 @@ contains energies = C_LOC(f % bins) n = size(f % bins) err = 0 + type is (EnergyoutFilter) + energies = C_LOC(f % bins) + n = size(f % bins) + err = 0 class default err = E_INVALID_TYPE call set_errmsg("Tried to get energy bins on a non-energy filter.") @@ -242,6 +246,11 @@ contains if (allocated(f % bins)) deallocate(f % bins) allocate(f % bins(n)) f % bins(:) = energies + type is (EnergyoutFilter) + f % n_bins = n - 1 + if (allocated(f % bins)) deallocate(f % bins) + allocate(f % bins(n)) + f % bins(:) = energies class default err = E_INVALID_TYPE call set_errmsg("Tried to get energy bins on a non-energy filter.") From bd5b7afc2d6e64bf03fb9e1400f6778baf3bbe81 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 16 Mar 2018 13:47:01 -0500 Subject: [PATCH 113/231] Fix bug related to bin ordering for mesh filters --- openmc/filter.py | 50 ++-- openmc/mesh.py | 18 ++ openmc/mgxs/mgxs.py | 16 +- openmc/tallies.py | 4 +- .../mgxs_library_mesh/results_true.dat | 256 +++++++++--------- .../tally_slice_merge/results_true.dat | 34 +-- .../tally_slice_merge/test.py | 8 +- 7 files changed, 200 insertions(+), 186 deletions(-) diff --git a/openmc/filter.py b/openmc/filter.py index 8763515f4e..6cb81d97a3 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -732,37 +732,40 @@ class MeshFilter(Filter): # Filter bins for a mesh are an (x,y,z) tuple. Convert (x,y,z) to a # single bin -- this is similar to subroutine mesh_indices_to_bin in # openmc/src/mesh.F90. - if len(self.mesh.dimension) == 3: + n_dim = len(self.mesh.dimension) + if n_dim == 3: + i, j, k = filter_bin nx, ny, nz = self.mesh.dimension - val = (filter_bin[0] - 1) * ny * nz + \ - (filter_bin[1] - 1) * nz + \ - (filter_bin[2] - 1) - else: + return (i - 1) + (j - 1)*nx + (k - 1)*nx*ny + elif n_dim == 2: + i, j, *_ = filter_bin nx, ny = self.mesh.dimension - val = (filter_bin[0] - 1) * ny + \ - (filter_bin[1] - 1) - - return val + return (i - 1) + (j - 1)*nx + else: + return filter_bin[0] - 1 def get_bin(self, bin_index): cv.check_type('bin_index', bin_index, Integral) cv.check_greater_than('bin_index', bin_index, 0, equality=True) cv.check_less_than('bin_index', bin_index, self.num_bins) - # Construct 3-tuple of x,y,z cell indices for a 3D mesh - if len(self.mesh.dimension) == 3: + n_dim = len(self.mesh.dimension) + if n_dim == 3: + # Construct 3-tuple of x,y,z cell indices for a 3D mesh nx, ny, nz = self.mesh.dimension - x = bin_index / (ny * nz) - y = (bin_index - (x * ny * nz)) / nz - z = bin_index - (x * ny * nz) - (y * nz) + x = bin_index % nx + 1 + y = (bin_index % (nx * ny)) // nx + 1 + z = bin_index // (nx * ny) + 1 return (x, y, z) - # Construct 2-tuple of x,y cell indices for a 2D mesh - else: + elif n_dim == 2: + # Construct 2-tuple of x,y cell indices for a 2D mesh nx, ny = self.mesh.dimension - x = bin_index / ny - y = bin_index - (x * ny) + x = bin_index % nx + 1 + y = bin_index // nx + 1 return (x, y) + else: + return (bin_index + 1,) def get_pandas_dataframe(self, data_size, stride, **kwargs): """Builds a Pandas DataFrame for the Filter's bins. @@ -802,9 +805,10 @@ class MeshFilter(Filter): mesh_key = 'mesh {0}'.format(self.mesh.id) # Find mesh dimensions - use 3D indices for simplicity - if len(self.mesh.dimension) == 3: + n_dim = len(self.mesh.dimension) + if n_dim == 3: nx, ny, nz = self.mesh.dimension - elif len(self.mesh.dimension) == 2: + elif n_dim == 2: nx, ny = self.mesh.dimension nz = 1 else: @@ -813,7 +817,7 @@ class MeshFilter(Filter): # Generate multi-index sub-column for x-axis filter_bins = np.arange(1, nx + 1) - repeat_factor = ny * nz * stride + repeat_factor = stride filter_bins = np.repeat(filter_bins, repeat_factor) tile_factor = data_size // len(filter_bins) filter_bins = np.tile(filter_bins, tile_factor) @@ -821,7 +825,7 @@ class MeshFilter(Filter): # Generate multi-index sub-column for y-axis filter_bins = np.arange(1, ny + 1) - repeat_factor = nz * stride + repeat_factor = nx * stride filter_bins = np.repeat(filter_bins, repeat_factor) tile_factor = data_size // len(filter_bins) filter_bins = np.tile(filter_bins, tile_factor) @@ -829,7 +833,7 @@ class MeshFilter(Filter): # Generate multi-index sub-column for z-axis filter_bins = np.arange(1, nz + 1) - repeat_factor = stride + repeat_factor = nx * ny * stride filter_bins = np.repeat(filter_bins, repeat_factor) tile_factor = data_size // len(filter_bins) filter_bins = np.tile(filter_bins, tile_factor) diff --git a/openmc/mesh.py b/openmc/mesh.py index d937e25ce9..cd8eb3c5ed 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -82,6 +82,24 @@ class Mesh(IDManagerMixin): def num_mesh_cells(self): return np.prod(self._dimension) + @property + def indices(self): + ndim = len(self._dimension) + if ndim == 3: + nx, ny, nz = self.dimension + return ((x, y, z) + for z in range(1, nz + 1) + for y in range(1, ny + 1) + for x in range(1, nx + 1)) + elif ndim == 2: + nx, ny = self.dimension + return ((x, y) + for y in range(1, ny + 1) + for x in range(1, nx + 1)) + else: + nx, = self.dimension + return ((x,) for x in range(1, nx + 1)) + @name.setter def name(self, name): if name is not None: diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index ecedc8e63a..4932feff1e 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -4,7 +4,6 @@ import warnings import os import copy from abc import ABCMeta -import itertools import numpy as np import h5py @@ -937,8 +936,7 @@ class MGXS(metaclass=ABCMeta): # NOTE: This is important if tally merging was used if self.domain_type == 'mesh': filters = [_DOMAIN_TO_FILTER[self.domain_type]] - xyz = [range(1, x + 1) for x in self.domain.dimension] - filter_bins = [tuple(itertools.product(*xyz))] + filter_bins = [tuple(self.domain.indices)] elif self.domain_type != 'distribcell': filters = [_DOMAIN_TO_FILTER[self.domain_type]] filter_bins = [(self.domain.id,)] @@ -1531,8 +1529,7 @@ class MGXS(metaclass=ABCMeta): elif self.domain_type == 'distribcell': subdomains = np.arange(self.num_subdomains, dtype=np.int) elif self.domain_type == 'mesh': - xyz = [range(1, x + 1) for x in self.domain.dimension] - subdomains = list(itertools.product(*xyz)) + subdomains = list(self.domain.indices) else: subdomains = [self.domain.id] @@ -1702,8 +1699,7 @@ class MGXS(metaclass=ABCMeta): domain_filter = self.xs_tally.find_filter('sum(distribcell)') subdomains = domain_filter.bins elif self.domain_type == 'mesh': - xyz = [range(1, x+1) for x in self.domain.dimension] - subdomains = list(itertools.product(*xyz)) + subdomains = list(self.domain.indices) else: subdomains = [self.domain.id] @@ -2342,8 +2338,7 @@ class MatrixMGXS(MGXS): elif self.domain_type == 'distribcell': subdomains = np.arange(self.num_subdomains, dtype=np.int) elif self.domain_type == 'mesh': - xyz = [range(1, x + 1) for x in self.domain.dimension] - subdomains = list(itertools.product(*xyz)) + subdomains = list(self.domain.indices) else: subdomains = [self.domain.id] @@ -4530,8 +4525,7 @@ class ScatterMatrixXS(MatrixMGXS): elif self.domain_type == 'distribcell': subdomains = np.arange(self.num_subdomains, dtype=np.int) elif self.domain_type == 'mesh': - xyz = [range(1, x + 1) for x in self.domain.dimension] - subdomains = list(itertools.product(*xyz)) + subdomains = list(self.domain.indices) else: subdomains = [self.domain.id] diff --git a/openmc/tallies.py b/openmc/tallies.py index d22cfdcb46..34424acb08 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -1164,9 +1164,7 @@ class Tally(IDManagerMixin): if not user_filter: # Create list of 2- or 3-tuples tuples for mesh cell bins if isinstance(self_filter, openmc.MeshFilter): - dimension = self_filter.mesh.dimension - xyz = [range(1, x+1) for x in dimension] - bins = list(product(*xyz)) + bins = list(self_filter.mesh.indices) # Create list of 2-tuples for energy boundary bins elif isinstance(self_filter, (openmc.EnergyFilter, diff --git a/tests/regression_tests/mgxs_library_mesh/results_true.dat b/tests/regression_tests/mgxs_library_mesh/results_true.dat index c167628bcc..4b9303fbf3 100644 --- a/tests/regression_tests/mgxs_library_mesh/results_true.dat +++ b/tests/regression_tests/mgxs_library_mesh/results_true.dat @@ -1,62 +1,62 @@ mesh 1 group in nuclide mean std. dev. x y z 0 1 1 1 1 total 0.762544 0.085298 -1 1 2 1 1 total 0.653375 0.153317 -2 2 1 1 1 total 0.644837 0.088457 +2 1 2 1 1 total 0.644837 0.088457 +1 2 1 1 1 total 0.653375 0.153317 3 2 2 1 1 total 0.676480 0.094215 mesh 1 group in nuclide mean std. dev. x y z 0 1 1 1 1 total 0.473988 0.088732 -1 1 2 1 1 total 0.379821 0.167092 -2 2 1 1 1 total 0.399254 0.091318 +2 1 2 1 1 total 0.399254 0.091318 +1 2 1 1 1 total 0.379821 0.167092 3 2 2 1 1 total 0.424265 0.099551 mesh 1 group in nuclide mean std. dev. x y z 0 1 1 1 1 total 0.473988 0.088732 -1 1 2 1 1 total 0.379821 0.167092 -2 2 1 1 1 total 0.399254 0.091318 +2 1 2 1 1 total 0.399254 0.091318 +1 2 1 1 1 total 0.379821 0.167092 3 2 2 1 1 total 0.424265 0.099551 mesh 1 group in nuclide mean std. dev. x y z 0 1 1 1 1 total 0.027288 0.005813 -1 1 2 1 1 total 0.019449 0.004420 -2 2 1 1 1 total 0.020262 0.003701 +2 1 2 1 1 total 0.020262 0.003701 +1 2 1 1 1 total 0.019449 0.004420 3 2 2 1 1 total 0.021266 0.002869 mesh 1 group in nuclide mean std. dev. x y z 0 1 1 1 1 total 0.016037 0.006339 -1 1 2 1 1 total 0.012153 0.003804 -2 2 1 1 1 total 0.013018 0.003521 +2 1 2 1 1 total 0.013018 0.003521 +1 2 1 1 1 total 0.012153 0.003804 3 2 2 1 1 total 0.012965 0.002454 mesh 1 group in nuclide mean std. dev. x y z 0 1 1 1 1 total 0.011251 0.003050 -1 1 2 1 1 total 0.007296 0.001795 -2 2 1 1 1 total 0.007243 0.001219 +2 1 2 1 1 total 0.007243 0.001219 +1 2 1 1 1 total 0.007296 0.001795 3 2 2 1 1 total 0.008301 0.001066 mesh 1 group in nuclide mean std. dev. x y z 0 1 1 1 1 total 0.027498 0.007445 -1 1 2 1 1 total 0.017912 0.004426 -2 2 1 1 1 total 0.017954 0.003077 +2 1 2 1 1 total 0.017954 0.003077 +1 2 1 1 1 total 0.017912 0.004426 3 2 2 1 1 total 0.020469 0.002617 mesh 1 group in nuclide mean std. dev. x y z 0 1 1 1 1 total 2.177345e+06 589804.299388 -1 1 2 1 1 total 1.413154e+06 347806.623417 -2 2 1 1 1 total 1.404096e+06 236476.851953 +2 1 2 1 1 total 1.404096e+06 236476.851953 +1 2 1 1 1 total 1.413154e+06 347806.623417 3 2 2 1 1 total 1.608259e+06 206502.707865 mesh 1 group in nuclide mean std. dev. x y z 0 1 1 1 1 total 0.735256 0.080216 -1 1 2 1 1 total 0.633925 0.149098 -2 2 1 1 1 total 0.624575 0.084974 +2 1 2 1 1 total 0.624575 0.084974 +1 2 1 1 1 total 0.633925 0.149098 3 2 2 1 1 total 0.655214 0.091422 mesh 1 group in nuclide mean std. dev. x y z 0 1 1 1 1 total 0.763779 0.070696 -1 1 2 1 1 total 0.640809 0.158369 -2 2 1 1 1 total 0.628158 0.064356 +2 1 2 1 1 total 0.628158 0.064356 +1 2 1 1 1 total 0.640809 0.158369 3 2 2 1 1 total 0.645171 0.080467 mesh 1 group in group out nuclide moment mean std. dev. x y z @@ -64,14 +64,14 @@ 1 1 1 1 1 1 total P1 0.288556 0.024446 2 1 1 1 1 1 total P2 0.082441 0.011443 3 1 1 1 1 1 total P3 -0.005627 0.012638 -4 1 2 1 1 1 total P0 0.640809 0.158369 -5 1 2 1 1 1 total P1 0.273553 0.066437 -6 1 2 1 1 1 total P2 0.108446 0.024435 -7 1 2 1 1 1 total P3 0.012229 0.003785 -8 2 1 1 1 1 total P0 0.628158 0.064356 -9 2 1 1 1 1 total P1 0.245583 0.022676 -10 2 1 1 1 1 total P2 0.086370 0.007833 -11 2 1 1 1 1 total P3 0.019590 0.005345 +8 1 2 1 1 1 total P0 0.628158 0.064356 +9 1 2 1 1 1 total P1 0.245583 0.022676 +10 1 2 1 1 1 total P2 0.086370 0.007833 +11 1 2 1 1 1 total P3 0.019590 0.005345 +4 2 1 1 1 1 total P0 0.640809 0.158369 +5 2 1 1 1 1 total P1 0.273553 0.066437 +6 2 1 1 1 1 total P2 0.108446 0.024435 +7 2 1 1 1 1 total P3 0.012229 0.003785 12 2 2 1 1 1 total P0 0.645171 0.080467 13 2 2 1 1 1 total P1 0.252215 0.032154 14 2 2 1 1 1 total P2 0.089251 0.009734 @@ -82,14 +82,14 @@ 1 1 1 1 1 1 total P1 0.288556 0.024446 2 1 1 1 1 1 total P2 0.082441 0.011443 3 1 1 1 1 1 total P3 -0.005627 0.012638 -4 1 2 1 1 1 total P0 0.640809 0.158369 -5 1 2 1 1 1 total P1 0.273553 0.066437 -6 1 2 1 1 1 total P2 0.108446 0.024435 -7 1 2 1 1 1 total P3 0.012229 0.003785 -8 2 1 1 1 1 total P0 0.628158 0.064356 -9 2 1 1 1 1 total P1 0.245583 0.022676 -10 2 1 1 1 1 total P2 0.086370 0.007833 -11 2 1 1 1 1 total P3 0.019590 0.005345 +8 1 2 1 1 1 total P0 0.628158 0.064356 +9 1 2 1 1 1 total P1 0.245583 0.022676 +10 1 2 1 1 1 total P2 0.086370 0.007833 +11 1 2 1 1 1 total P3 0.019590 0.005345 +4 2 1 1 1 1 total P0 0.640809 0.158369 +5 2 1 1 1 1 total P1 0.273553 0.066437 +6 2 1 1 1 1 total P2 0.108446 0.024435 +7 2 1 1 1 1 total P3 0.012229 0.003785 12 2 2 1 1 1 total P0 0.645171 0.080467 13 2 2 1 1 1 total P1 0.252215 0.032154 14 2 2 1 1 1 total P2 0.089251 0.009734 @@ -97,20 +97,20 @@ mesh 1 group in group out nuclide mean std. dev. x y z 0 1 1 1 1 1 total 1.0 0.108337 -1 1 2 1 1 1 total 1.0 0.238517 -2 2 1 1 1 1 total 1.0 0.113128 +2 1 2 1 1 1 total 1.0 0.113128 +1 2 1 1 1 1 total 1.0 0.238517 3 2 2 1 1 1 total 1.0 0.132597 mesh 1 group in group out nuclide mean std. dev. x y z 0 1 1 1 1 1 total 0.015584 0.003404 -1 1 2 1 1 1 total 0.014200 0.003676 -2 2 1 1 1 1 total 0.017684 0.002499 +2 1 2 1 1 1 total 0.017684 0.002499 +1 2 1 1 1 1 total 0.014200 0.003676 3 2 2 1 1 1 total 0.022409 0.002481 mesh 1 group in group out nuclide mean std. dev. x y z 0 1 1 1 1 1 total 1.0 0.108337 -1 1 2 1 1 1 total 1.0 0.238517 -2 2 1 1 1 1 total 1.0 0.113128 +2 1 2 1 1 1 total 1.0 0.113128 +1 2 1 1 1 1 total 1.0 0.238517 3 2 2 1 1 1 total 1.0 0.132597 mesh 1 group in group out nuclide moment mean std. dev. x y z @@ -118,14 +118,14 @@ 1 1 1 1 1 1 total P1 0.277780 0.041434 2 1 1 1 1 1 total P2 0.079362 0.014706 3 1 1 1 1 1 total P3 -0.005417 0.012184 -4 1 2 1 1 1 total P0 0.633925 0.212349 -5 1 2 1 1 1 total P1 0.270615 0.089799 -6 1 2 1 1 1 total P2 0.107281 0.034246 -7 1 2 1 1 1 total P3 0.012098 0.004637 -8 2 1 1 1 1 total P0 0.624575 0.110512 -9 2 1 1 1 1 total P1 0.244182 0.041824 -10 2 1 1 1 1 total P2 0.085877 0.014634 -11 2 1 1 1 1 total P3 0.019478 0.006012 +8 1 2 1 1 1 total P0 0.624575 0.110512 +9 1 2 1 1 1 total P1 0.244182 0.041824 +10 1 2 1 1 1 total P2 0.085877 0.014634 +11 1 2 1 1 1 total P3 0.019478 0.006012 +4 2 1 1 1 1 total P0 0.633925 0.212349 +5 2 1 1 1 1 total P1 0.270615 0.089799 +6 2 1 1 1 1 total P2 0.107281 0.034246 +7 2 1 1 1 1 total P3 0.012098 0.004637 12 2 2 1 1 1 total P0 0.655214 0.126119 13 2 2 1 1 1 total P1 0.256141 0.049765 14 2 2 1 1 1 total P2 0.090641 0.016563 @@ -136,14 +136,14 @@ 1 1 1 1 1 1 total P1 0.277780 0.051210 2 1 1 1 1 1 total P2 0.079362 0.017035 3 1 1 1 1 1 total P3 -0.005417 0.012198 -4 1 2 1 1 1 total P0 0.633925 0.260681 -5 1 2 1 1 1 total P1 0.270615 0.110590 -6 1 2 1 1 1 total P2 0.107281 0.042750 -7 1 2 1 1 1 total P3 0.012098 0.005462 -8 2 1 1 1 1 total P0 0.624575 0.131169 -9 2 1 1 1 1 total P1 0.244182 0.050123 -10 2 1 1 1 1 total P2 0.085877 0.017565 -11 2 1 1 1 1 total P3 0.019478 0.006403 +8 1 2 1 1 1 total P0 0.624575 0.131169 +9 1 2 1 1 1 total P1 0.244182 0.050123 +10 1 2 1 1 1 total P2 0.085877 0.017565 +11 1 2 1 1 1 total P3 0.019478 0.006403 +4 2 1 1 1 1 total P0 0.633925 0.260681 +5 2 1 1 1 1 total P1 0.270615 0.110590 +6 2 1 1 1 1 total P2 0.107281 0.042750 +7 2 1 1 1 1 total P3 0.012098 0.005462 12 2 2 1 1 1 total P0 0.655214 0.153147 13 2 2 1 1 1 total P1 0.256141 0.060250 14 2 2 1 1 1 total P2 0.090641 0.020464 @@ -151,32 +151,32 @@ mesh 1 group out nuclide mean std. dev. x y z 0 1 1 1 1 total 1.0 0.300047 -1 1 2 1 1 total 1.0 0.262180 -2 2 1 1 1 total 1.0 0.178169 +2 1 2 1 1 total 1.0 0.178169 +1 2 1 1 1 total 1.0 0.262180 3 2 2 1 1 total 1.0 0.104797 mesh 1 group out nuclide mean std. dev. x y z 0 1 1 1 1 total 1.0 0.300047 -1 1 2 1 1 total 1.0 0.262180 -2 2 1 1 1 total 1.0 0.178169 +2 1 2 1 1 total 1.0 0.178169 +1 2 1 1 1 total 1.0 0.262180 3 2 2 1 1 total 1.0 0.108931 mesh 1 group in nuclide mean std. dev. x y z 0 1 1 1 1 total 7.097008e-07 1.458546e-07 -1 1 2 1 1 total 3.984535e-07 1.157576e-07 -2 2 1 1 1 total 4.407745e-07 7.903907e-08 +2 1 2 1 1 total 4.407745e-07 7.903907e-08 +1 2 1 1 1 total 3.984535e-07 1.157576e-07 3 2 2 1 1 total 4.750476e-07 6.207437e-08 mesh 1 group in nuclide mean std. dev. x y z 0 1 1 1 1 total 0.027311 0.007397 -1 1 2 1 1 total 0.017783 0.004394 -2 2 1 1 1 total 0.017820 0.003054 +2 1 2 1 1 total 0.017820 0.003054 +1 2 1 1 1 total 0.017783 0.004394 3 2 2 1 1 total 0.020320 0.002598 mesh 1 group in group out nuclide mean std. dev. x y z 0 1 1 1 1 1 total 0.015584 0.003404 -1 1 2 1 1 1 total 0.014200 0.003676 -2 2 1 1 1 1 total 0.017684 0.002499 +2 1 2 1 1 1 total 0.017684 0.002499 +1 2 1 1 1 1 total 0.014200 0.003676 3 2 2 1 1 1 total 0.022259 0.002508 mesh 1 delayedgroup group in nuclide mean std. dev. x y z @@ -186,18 +186,18 @@ 3 1 1 1 4 1 total 0.000072 1.866015e-05 4 1 1 1 5 1 total 0.000031 7.654909e-06 5 1 1 1 6 1 total 0.000013 3.206343e-06 -6 1 2 1 1 1 total 0.000004 1.003100e-06 -7 1 2 1 2 1 total 0.000022 5.425275e-06 -8 1 2 1 3 1 total 0.000021 5.324236e-06 -9 1 2 1 4 1 total 0.000050 1.251572e-05 -10 1 2 1 5 1 total 0.000022 5.762184e-06 -11 1 2 1 6 1 total 0.000009 2.391676e-06 -12 2 1 1 1 1 total 0.000004 6.723192e-07 -13 2 1 1 2 1 total 0.000022 3.706235e-06 -14 2 1 1 3 1 total 0.000022 3.674263e-06 -15 2 1 1 4 1 total 0.000052 8.774048e-06 -16 2 1 1 5 1 total 0.000024 4.168024e-06 -17 2 1 1 6 1 total 0.000010 1.726268e-06 +12 1 2 1 1 1 total 0.000004 6.723192e-07 +13 1 2 1 2 1 total 0.000022 3.706235e-06 +14 1 2 1 3 1 total 0.000022 3.674263e-06 +15 1 2 1 4 1 total 0.000052 8.774048e-06 +16 1 2 1 5 1 total 0.000024 4.168024e-06 +17 1 2 1 6 1 total 0.000010 1.726268e-06 +6 2 1 1 1 1 total 0.000004 1.003100e-06 +7 2 1 1 2 1 total 0.000022 5.425275e-06 +8 2 1 1 3 1 total 0.000021 5.324236e-06 +9 2 1 1 4 1 total 0.000050 1.251572e-05 +10 2 1 1 5 1 total 0.000022 5.762184e-06 +11 2 1 1 6 1 total 0.000009 2.391676e-06 18 2 2 1 1 1 total 0.000005 5.962367e-07 19 2 2 1 2 1 total 0.000025 3.200900e-06 20 2 2 1 3 1 total 0.000025 3.127442e-06 @@ -212,18 +212,18 @@ 3 1 1 1 4 1 total 0.0 0.000000 4 1 1 1 5 1 total 0.0 0.000000 5 1 1 1 6 1 total 0.0 0.000000 -6 1 2 1 1 1 total 0.0 0.000000 -7 1 2 1 2 1 total 0.0 0.000000 -8 1 2 1 3 1 total 0.0 0.000000 -9 1 2 1 4 1 total 0.0 0.000000 -10 1 2 1 5 1 total 0.0 0.000000 -11 1 2 1 6 1 total 0.0 0.000000 -12 2 1 1 1 1 total 0.0 0.000000 -13 2 1 1 2 1 total 0.0 0.000000 -14 2 1 1 3 1 total 0.0 0.000000 -15 2 1 1 4 1 total 0.0 0.000000 -16 2 1 1 5 1 total 0.0 0.000000 -17 2 1 1 6 1 total 0.0 0.000000 +12 1 2 1 1 1 total 0.0 0.000000 +13 1 2 1 2 1 total 0.0 0.000000 +14 1 2 1 3 1 total 0.0 0.000000 +15 1 2 1 4 1 total 0.0 0.000000 +16 1 2 1 5 1 total 0.0 0.000000 +17 1 2 1 6 1 total 0.0 0.000000 +6 2 1 1 1 1 total 0.0 0.000000 +7 2 1 1 2 1 total 0.0 0.000000 +8 2 1 1 3 1 total 0.0 0.000000 +9 2 1 1 4 1 total 0.0 0.000000 +10 2 1 1 5 1 total 0.0 0.000000 +11 2 1 1 6 1 total 0.0 0.000000 18 2 2 1 1 1 total 0.0 0.000000 19 2 2 1 2 1 total 0.0 0.000000 20 2 2 1 3 1 total 1.0 1.414214 @@ -238,18 +238,18 @@ 3 1 1 1 4 1 total 0.002629 0.000950 4 1 1 1 5 1 total 0.001125 0.000398 5 1 1 1 6 1 total 0.000470 0.000166 -6 1 2 1 1 1 total 0.000228 0.000057 -7 1 2 1 2 1 total 0.001222 0.000309 -8 1 2 1 3 1 total 0.001193 0.000304 -9 1 2 1 4 1 total 0.002780 0.000713 -10 1 2 1 5 1 total 0.001250 0.000328 -11 1 2 1 6 1 total 0.000520 0.000136 -12 2 1 1 1 1 total 0.000225 0.000044 -13 2 1 1 2 1 total 0.001232 0.000242 -14 2 1 1 3 1 total 0.001216 0.000239 -15 2 1 1 4 1 total 0.002882 0.000570 -16 2 1 1 5 1 total 0.001345 0.000270 -17 2 1 1 6 1 total 0.000558 0.000112 +12 1 2 1 1 1 total 0.000225 0.000044 +13 1 2 1 2 1 total 0.001232 0.000242 +14 1 2 1 3 1 total 0.001216 0.000239 +15 1 2 1 4 1 total 0.002882 0.000570 +16 1 2 1 5 1 total 0.001345 0.000270 +17 1 2 1 6 1 total 0.000558 0.000112 +6 2 1 1 1 1 total 0.000228 0.000057 +7 2 1 1 2 1 total 0.001222 0.000309 +8 2 1 1 3 1 total 0.001193 0.000304 +9 2 1 1 4 1 total 0.002780 0.000713 +10 2 1 1 5 1 total 0.001250 0.000328 +11 2 1 1 6 1 total 0.000520 0.000136 18 2 2 1 1 1 total 0.000227 0.000027 19 2 2 1 2 1 total 0.001225 0.000143 20 2 2 1 3 1 total 0.001201 0.000140 @@ -264,18 +264,18 @@ 3 1 1 1 4 1 total 0.304289 0.106753 4 1 1 1 5 1 total 0.855760 0.286466 5 1 1 1 6 1 total 2.874120 0.965609 -6 1 2 1 1 1 total 0.013357 0.003345 -7 1 2 1 2 1 total 0.032590 0.008273 -8 1 2 1 3 1 total 0.121103 0.031074 -9 1 2 1 4 1 total 0.306111 0.080011 -10 1 2 1 5 1 total 0.862660 0.235694 -11 1 2 1 6 1 total 2.897534 0.788926 -12 2 1 1 1 1 total 0.013367 0.002548 -13 2 1 1 2 1 total 0.032520 0.006266 -14 2 1 1 3 1 total 0.121250 0.023544 -15 2 1 1 4 1 total 0.307552 0.060464 -16 2 1 1 5 1 total 0.867665 0.175131 -17 2 1 1 6 1 total 2.914635 0.587161 +12 1 2 1 1 1 total 0.013367 0.002548 +13 1 2 1 2 1 total 0.032520 0.006266 +14 1 2 1 3 1 total 0.121250 0.023544 +15 1 2 1 4 1 total 0.307552 0.060464 +16 1 2 1 5 1 total 0.867665 0.175131 +17 1 2 1 6 1 total 2.914635 0.587161 +6 2 1 1 1 1 total 0.013357 0.003345 +7 2 1 1 2 1 total 0.032590 0.008273 +8 2 1 1 3 1 total 0.121103 0.031074 +9 2 1 1 4 1 total 0.306111 0.080011 +10 2 1 1 5 1 total 0.862660 0.235694 +11 2 1 1 6 1 total 2.897534 0.788926 18 2 2 1 1 1 total 0.013360 0.001587 19 2 2 1 2 1 total 0.032564 0.003810 20 2 2 1 3 1 total 0.121158 0.014038 @@ -290,18 +290,18 @@ 3 1 1 1 4 1 1 total 0.00000 0.000000 4 1 1 1 5 1 1 total 0.00000 0.000000 5 1 1 1 6 1 1 total 0.00000 0.000000 -6 1 2 1 1 1 1 total 0.00000 0.000000 -7 1 2 1 2 1 1 total 0.00000 0.000000 -8 1 2 1 3 1 1 total 0.00000 0.000000 -9 1 2 1 4 1 1 total 0.00000 0.000000 -10 1 2 1 5 1 1 total 0.00000 0.000000 -11 1 2 1 6 1 1 total 0.00000 0.000000 -12 2 1 1 1 1 1 total 0.00000 0.000000 -13 2 1 1 2 1 1 total 0.00000 0.000000 -14 2 1 1 3 1 1 total 0.00000 0.000000 -15 2 1 1 4 1 1 total 0.00000 0.000000 -16 2 1 1 5 1 1 total 0.00000 0.000000 -17 2 1 1 6 1 1 total 0.00000 0.000000 +12 1 2 1 1 1 1 total 0.00000 0.000000 +13 1 2 1 2 1 1 total 0.00000 0.000000 +14 1 2 1 3 1 1 total 0.00000 0.000000 +15 1 2 1 4 1 1 total 0.00000 0.000000 +16 1 2 1 5 1 1 total 0.00000 0.000000 +17 1 2 1 6 1 1 total 0.00000 0.000000 +6 2 1 1 1 1 1 total 0.00000 0.000000 +7 2 1 1 2 1 1 total 0.00000 0.000000 +8 2 1 1 3 1 1 total 0.00000 0.000000 +9 2 1 1 4 1 1 total 0.00000 0.000000 +10 2 1 1 5 1 1 total 0.00000 0.000000 +11 2 1 1 6 1 1 total 0.00000 0.000000 18 2 2 1 1 1 1 total 0.00000 0.000000 19 2 2 1 2 1 1 total 0.00000 0.000000 20 2 2 1 3 1 1 total 0.00015 0.000151 diff --git a/tests/regression_tests/tally_slice_merge/results_true.dat b/tests/regression_tests/tally_slice_merge/results_true.dat index 4f1d6c6e2c..461c4faa87 100644 --- a/tests/regression_tests/tally_slice_merge/results_true.dat +++ b/tests/regression_tests/tally_slice_merge/results_true.dat @@ -48,20 +48,20 @@ 13 (500, 5000, 50000) 6.25e-01 2.00e+07 U235 nu-fission 0.00e+00 0.00e+00 14 (500, 5000, 50000) 6.25e-01 2.00e+07 U238 fission 0.00e+00 0.00e+00 15 (500, 5000, 50000) 6.25e-01 2.00e+07 U238 nu-fission 0.00e+00 0.00e+00 - sum(mesh) energy low [eV] energy high [eV] nuclide score mean std. dev. -0 ((1, 1, 1), (1, 2, 1)) 0.00e+00 6.25e-01 U235 fission 1.48e-02 3.65e-03 -1 ((1, 1, 1), (1, 2, 1)) 0.00e+00 6.25e-01 U235 nu-fission 3.60e-02 8.90e-03 -2 ((1, 1, 1), (1, 2, 1)) 0.00e+00 6.25e-01 U238 fission 2.06e-08 4.98e-09 -3 ((1, 1, 1), (1, 2, 1)) 0.00e+00 6.25e-01 U238 nu-fission 5.14e-08 1.24e-08 -4 ((1, 1, 1), (1, 2, 1)) 6.25e-01 2.00e+07 U235 fission 2.23e-03 3.92e-04 -5 ((1, 1, 1), (1, 2, 1)) 6.25e-01 2.00e+07 U235 nu-fission 5.45e-03 9.56e-04 -6 ((1, 1, 1), (1, 2, 1)) 6.25e-01 2.00e+07 U238 fission 5.58e-04 2.08e-04 -7 ((1, 1, 1), (1, 2, 1)) 6.25e-01 2.00e+07 U238 nu-fission 1.50e-03 5.43e-04 -8 ((2, 1, 1), (2, 2, 1)) 0.00e+00 6.25e-01 U235 fission 2.56e-02 5.50e-03 -9 ((2, 1, 1), (2, 2, 1)) 0.00e+00 6.25e-01 U235 nu-fission 6.24e-02 1.34e-02 -10 ((2, 1, 1), (2, 2, 1)) 0.00e+00 6.25e-01 U238 fission 3.55e-08 7.70e-09 -11 ((2, 1, 1), (2, 2, 1)) 0.00e+00 6.25e-01 U238 nu-fission 8.85e-08 1.92e-08 -12 ((2, 1, 1), (2, 2, 1)) 6.25e-01 2.00e+07 U235 fission 5.01e-03 1.38e-03 -13 ((2, 1, 1), (2, 2, 1)) 6.25e-01 2.00e+07 U235 nu-fission 1.22e-02 3.37e-03 -14 ((2, 1, 1), (2, 2, 1)) 6.25e-01 2.00e+07 U238 fission 2.40e-03 2.69e-04 -15 ((2, 1, 1), (2, 2, 1)) 6.25e-01 2.00e+07 U238 nu-fission 6.60e-03 7.63e-04 + sum(mesh) energy low [eV] energy high [eV] nuclide score mean std. dev. +0 ((1, 1), (1, 2)) 0.00e+00 6.25e-01 U235 fission 0.00e+00 0.00e+00 +1 ((1, 1), (1, 2)) 0.00e+00 6.25e-01 U235 nu-fission 0.00e+00 0.00e+00 +2 ((1, 1), (1, 2)) 0.00e+00 6.25e-01 U238 fission 0.00e+00 0.00e+00 +3 ((1, 1), (1, 2)) 0.00e+00 6.25e-01 U238 nu-fission 0.00e+00 0.00e+00 +4 ((1, 1), (1, 2)) 6.25e-01 2.00e+07 U235 fission 1.60e-04 1.60e-04 +5 ((1, 1), (1, 2)) 6.25e-01 2.00e+07 U235 nu-fission 3.91e-04 3.91e-04 +6 ((1, 1), (1, 2)) 6.25e-01 2.00e+07 U238 fission 5.12e-05 5.12e-05 +7 ((1, 1), (1, 2)) 6.25e-01 2.00e+07 U238 nu-fission 1.36e-04 1.36e-04 +8 ((2, 1), (2, 2)) 0.00e+00 6.25e-01 U235 fission 4.04e-02 6.60e-03 +9 ((2, 1), (2, 2)) 0.00e+00 6.25e-01 U235 nu-fission 9.85e-02 1.61e-02 +10 ((2, 1), (2, 2)) 0.00e+00 6.25e-01 U238 fission 5.61e-08 9.18e-09 +11 ((2, 1), (2, 2)) 0.00e+00 6.25e-01 U238 nu-fission 1.40e-07 2.29e-08 +12 ((2, 1), (2, 2)) 6.25e-01 2.00e+07 U235 fission 7.08e-03 1.43e-03 +13 ((2, 1), (2, 2)) 6.25e-01 2.00e+07 U235 nu-fission 1.73e-02 3.48e-03 +14 ((2, 1), (2, 2)) 6.25e-01 2.00e+07 U238 fission 2.91e-03 3.36e-04 +15 ((2, 1), (2, 2)) 6.25e-01 2.00e+07 U238 nu-fission 7.96e-03 9.27e-04 diff --git a/tests/regression_tests/tally_slice_merge/test.py b/tests/regression_tests/tally_slice_merge/test.py index f79c8b2685..e52d0fde49 100644 --- a/tests/regression_tests/tally_slice_merge/test.py +++ b/tests/regression_tests/tally_slice_merge/test.py @@ -126,10 +126,10 @@ class TallySliceMergeTestHarness(PyAPITestHarness): # Sum up a few subdomains from the distribcell tally sum1 = distribcell_tally.summation(filter_type=openmc.DistribcellFilter, - filter_bins=[0,100,2000,30000]) + filter_bins=[0, 100, 2000, 30000]) # Sum up a few subdomains from the distribcell tally sum2 = distribcell_tally.summation(filter_type=openmc.DistribcellFilter, - filter_bins=[500,5000,50000]) + filter_bins=[500, 5000, 50000]) # Merge the distribcell tally slices merge_tally = sum1.merge(sum2) @@ -143,10 +143,10 @@ class TallySliceMergeTestHarness(PyAPITestHarness): # Sum up a few subdomains from the mesh tally sum1 = mesh_tally.summation(filter_type=openmc.MeshFilter, - filter_bins=[(1,1,1), (1,2,1)]) + filter_bins=[(1, 1), (1, 2)]) # Sum up a few subdomains from the mesh tally sum2 = mesh_tally.summation(filter_type=openmc.MeshFilter, - filter_bins=[(2,1,1), (2,2,1)]) + filter_bins=[(2, 1), (2, 2)]) # Merge the mesh tally slices merge_tally = sum1.merge(sum2) From 0b6333810f7f73317f459a701a7d5cbd487f31ff Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 16 Mar 2018 14:07:38 -0500 Subject: [PATCH 114/231] Avoid divide-by-zero warnings in tally arithmetic --- openmc/tallies.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/openmc/tallies.py b/openmc/tallies.py index 34424acb08..d8bc2136a1 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -1674,19 +1674,22 @@ class Tally(IDManagerMixin): new_tally._std_dev = np.sqrt(data['self']['std. dev.']**2 + data['other']['std. dev.']**2) elif binary_op == '*': - self_rel_err = data['self']['std. dev.'] / data['self']['mean'] - other_rel_err = data['other']['std. dev.'] / data['other']['mean'] + with np.errstate(divide='ignore', invalid='ignore'): + self_rel_err = data['self']['std. dev.'] / data['self']['mean'] + other_rel_err = data['other']['std. dev.'] / data['other']['mean'] new_tally._mean = data['self']['mean'] * data['other']['mean'] new_tally._std_dev = np.abs(new_tally.mean) * \ np.sqrt(self_rel_err**2 + other_rel_err**2) elif binary_op == '/': - self_rel_err = data['self']['std. dev.'] / data['self']['mean'] - other_rel_err = data['other']['std. dev.'] / data['other']['mean'] - new_tally._mean = data['self']['mean'] / data['other']['mean'] + with np.errstate(divide='ignore', invalid='ignore'): + self_rel_err = data['self']['std. dev.'] / data['self']['mean'] + other_rel_err = data['other']['std. dev.'] / data['other']['mean'] + new_tally._mean = data['self']['mean'] / data['other']['mean'] new_tally._std_dev = np.abs(new_tally.mean) * \ np.sqrt(self_rel_err**2 + other_rel_err**2) elif binary_op == '^': - mean_ratio = data['other']['mean'] / data['self']['mean'] + with np.errstate(divide='ignore', invalid='ignore'): + mean_ratio = data['other']['mean'] / data['self']['mean'] first_term = mean_ratio * data['self']['std. dev.'] second_term = \ np.log(data['self']['mean']) * data['other']['std. dev.'] From c83b89086912d2363778b609224c42b7acab7038 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Mar 2018 10:13:51 -0500 Subject: [PATCH 115/231] Use ufloat for stochastic volume results --- openmc/cell.py | 4 +- openmc/data/decay.py | 5 +- openmc/material.py | 2 +- openmc/universe.py | 4 +- openmc/volume.py | 10 ++-- .../volume_calc/results_true.dat | 54 +++++++++---------- tests/regression_tests/volume_calc/test.py | 3 +- 7 files changed, 39 insertions(+), 43 deletions(-) diff --git a/openmc/cell.py b/openmc/cell.py index c7587e136a..cbfd74b21b 100644 --- a/openmc/cell.py +++ b/openmc/cell.py @@ -295,7 +295,7 @@ class Cell(IDManagerMixin): """ if volume_calc.domain_type == 'cell': if self.id in volume_calc.volumes: - self._volume = volume_calc.volumes[self.id][0] + self._volume = volume_calc.volumes[self.id].n self._atoms = volume_calc.atoms[self.id] else: raise ValueError('No volume information found for this cell.') @@ -335,7 +335,7 @@ class Cell(IDManagerMixin): volume = self.volume for name, atoms in self._atoms.items(): nuclide = openmc.Nuclide(name) - density = 1.0e-24 * atoms[0]/volume # density in atoms/b-cm + density = 1.0e-24 * atoms.n/volume # density in atoms/b-cm nuclides[name] = (nuclide, density) else: raise RuntimeError( diff --git a/openmc/data/decay.py b/openmc/data/decay.py index fa18759396..bbb059f4fa 100644 --- a/openmc/data/decay.py +++ b/openmc/data/decay.py @@ -7,10 +7,7 @@ import re from warnings import warn import numpy as np -try: - from uncertainties import ufloat, unumpy, UFloat -except ImportError: - ufloat = UFloat = namedtuple('UFloat', ['nominal_value', 'std_dev']) +from uncertainties import ufloat, unumpy, UFloat import openmc.checkvalue as cv from openmc.mixin import EqualityMixin diff --git a/openmc/material.py b/openmc/material.py index 88479d8df6..6bfe58f4ac 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -313,7 +313,7 @@ class Material(IDManagerMixin): """ if volume_calc.domain_type == 'material': if self.id in volume_calc.volumes: - self._volume = volume_calc.volumes[self.id][0] + self._volume = volume_calc.volumes[self.id].n self._atoms = volume_calc.atoms[self.id] else: raise ValueError('No volume information found for this material.') diff --git a/openmc/universe.py b/openmc/universe.py index 77138adcce..294b114dd2 100644 --- a/openmc/universe.py +++ b/openmc/universe.py @@ -145,7 +145,7 @@ class Universe(IDManagerMixin): """ if volume_calc.domain_type == 'universe': if self.id in volume_calc.volumes: - self._volume = volume_calc.volumes[self.id][0] + self._volume = volume_calc.volumes[self.id].n self._atoms = volume_calc.atoms[self.id] else: raise ValueError('No volume information found for this universe.') @@ -406,7 +406,7 @@ class Universe(IDManagerMixin): volume = self.volume for name, atoms in self._atoms.items(): nuclide = openmc.Nuclide(name) - density = 1.0e-24 * atoms[0]/volume # density in atoms/b-cm + density = 1.0e-24 * atoms.n/volume # density in atoms/b-cm nuclides[name] = (nuclide, density) else: raise RuntimeError( diff --git a/openmc/volume.py b/openmc/volume.py index d61093a178..af7c356aed 100644 --- a/openmc/volume.py +++ b/openmc/volume.py @@ -7,6 +7,7 @@ import warnings import numpy as np import pandas as pd import h5py +from uncertainties import ufloat import openmc import openmc.checkvalue as cv @@ -137,11 +138,10 @@ class VolumeCalculation(object): @property def atoms_dataframe(self): items = [] - columns = [self.domain_type.capitalize(), 'Nuclide', 'Atoms', - 'Uncertainty'] + columns = [self.domain_type.capitalize(), 'Nuclide', 'Atoms'] for uid, atoms_dict in self.atoms.items(): for name, atoms in atoms_dict.items(): - items.append((uid, name, atoms[0], atoms[1])) + items.append((uid, name, atoms)) return pd.DataFrame.from_records(items, columns=columns) @@ -211,13 +211,13 @@ class VolumeCalculation(object): domain_id = int(obj_name[7:]) ids.append(domain_id) group = f[obj_name] - volume = tuple(group['volume'].value) + volume = ufloat(*group['volume'].value) nucnames = group['nuclides'].value atoms_ = group['atoms'].value atom_dict = OrderedDict() for name_i, atoms_i in zip(nucnames, atoms_): - atom_dict[name_i.decode()] = tuple(atoms_i) + atom_dict[name_i.decode()] = ufloat(*atoms_i) volumes[domain_id] = volume atoms[domain_id] = atom_dict diff --git a/tests/regression_tests/volume_calc/results_true.dat b/tests/regression_tests/volume_calc/results_true.dat index 8eb2a61acf..466139cd68 100644 --- a/tests/regression_tests/volume_calc/results_true.dat +++ b/tests/regression_tests/volume_calc/results_true.dat @@ -1,30 +1,30 @@ Volume calculation 0 -Domain 1: 31.4693 +/- 0.0721 cm^3 -Domain 2: 2.0933 +/- 0.0310 cm^3 -Domain 3: 2.0486 +/- 0.0307 cm^3 - Cell Nuclide Atoms Uncertainty -0 1 U235 3.481769e+23 7.979991e+20 -1 1 Mo99 3.481769e+22 7.979991e+19 -2 2 H1 1.399770e+23 2.072914e+21 -3 2 O16 6.998852e+22 1.036457e+21 -4 2 B10 6.998852e+18 1.036457e+17 -5 3 H1 1.369920e+23 2.051689e+21 -6 3 O16 6.849599e+22 1.025844e+21 -7 3 B10 6.849599e+18 1.025844e+17 +Domain 1: 31.47+/-0.07 cm^3 +Domain 2: 2.093+/-0.031 cm^3 +Domain 3: 2.049+/-0.031 cm^3 + Cell Nuclide Atoms +0 1 U235 (3.482+/-0.008)e+23 +1 1 Mo99 (3.482+/-0.008)e+22 +2 2 H1 (1.400+/-0.021)e+23 +3 2 O16 (7.00+/-0.10)e+22 +4 2 B10 (7.00+/-0.10)e+18 +5 3 H1 (1.370+/-0.021)e+23 +6 3 O16 (6.85+/-0.10)e+22 +7 3 B10 (6.85+/-0.10)e+18 Volume calculation 1 -Domain 1: 4.1419 +/- 0.0426 cm^3 -Domain 2: 31.4693 +/- 0.0721 cm^3 - Material Nuclide Atoms Uncertainty -0 1 H1 2.769690e+23 2.850067e+21 -1 1 O16 1.384845e+23 1.425034e+21 -2 1 B10 1.384845e+19 1.425034e+17 -3 2 U235 3.481769e+23 7.979991e+20 -4 2 Mo99 3.481769e+22 7.979991e+19 +Domain 1: 4.14+/-0.04 cm^3 +Domain 2: 31.47+/-0.07 cm^3 + Material Nuclide Atoms +0 1 H1 (2.770+/-0.029)e+23 +1 1 O16 (1.385+/-0.014)e+23 +2 1 B10 (1.385+/-0.014)e+19 +3 2 U235 (3.482+/-0.008)e+23 +4 2 Mo99 (3.482+/-0.008)e+22 Volume calculation 2 -Domain 0: 35.6112 +/- 0.0664 cm^3 - Universe Nuclide Atoms Uncertainty -0 0 H1 2.769690e+23 2.850067e+21 -1 0 O16 1.384845e+23 1.425034e+21 -2 0 B10 1.384845e+19 1.425034e+17 -3 0 U235 3.481769e+23 7.979991e+20 -4 0 Mo99 3.481769e+22 7.979991e+19 +Domain 0: 35.61+/-0.07 cm^3 + Universe Nuclide Atoms +0 0 H1 (2.770+/-0.029)e+23 +1 0 O16 (1.385+/-0.014)e+23 +2 0 B10 (1.385+/-0.014)e+19 +3 0 U235 (3.482+/-0.008)e+23 +4 0 Mo99 (3.482+/-0.008)e+22 diff --git a/tests/regression_tests/volume_calc/test.py b/tests/regression_tests/volume_calc/test.py index a6b62b9be9..fda4b33210 100644 --- a/tests/regression_tests/volume_calc/test.py +++ b/tests/regression_tests/volume_calc/test.py @@ -64,8 +64,7 @@ class VolumeTest(PyAPITestHarness): # Write cell volumes and total # of atoms for each nuclide for uid, volume in sorted(volume_calc.volumes.items()): - outstr += 'Domain {0}: {1[0]:.4f} +/- {1[1]:.4f} cm^3\n'.format( - uid, volume) + outstr += 'Domain {}: {} cm^3\n'.format(uid, volume) outstr += str(volume_calc.atoms_dataframe) + '\n' return outstr From 5dc25569f2b54d87e6c9cf7b263c06cdb1914094 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Mar 2018 10:15:08 -0500 Subject: [PATCH 116/231] Use latest HDF5 format for openmc-get-jeff-data --- scripts/openmc-get-jeff-data | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/openmc-get-jeff-data b/scripts/openmc-get-jeff-data index 9f426a4930..03b58163b0 100755 --- a/scripts/openmc-get-jeff-data +++ b/scripts/openmc-get-jeff-data @@ -41,7 +41,7 @@ parser.add_argument('-b', '--batch', action='store_true', parser.add_argument('-d', '--destination', default='jeff-3.2-hdf5', help='Directory to create new library in') parser.add_argument('--libver', choices=['earliest', 'latest'], - default='earliest', help="Output HDF5 versioning. Use " + default='latest', help="Output HDF5 versioning. Use " "'earliest' for backwards compatibility or 'latest' for " "performance") args = parser.parse_args() From efade329a8ccf2ca56ffda48e2dfe64c6a6aab43 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Mon, 19 Mar 2018 12:55:46 -0400 Subject: [PATCH 117/231] Address #983 comments --- openmc/data/multipole.py | 55 ++++++++++++------------- tests/unit_tests/test_data_multipole.py | 4 +- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/openmc/data/multipole.py b/openmc/data/multipole.py index ac1e93447d..f7a78d9532 100644 --- a/openmc/data/multipole.py +++ b/openmc/data/multipole.py @@ -652,7 +652,7 @@ class WindowedMultipole(EqualityMixin): fun = np.vectorize(lambda x: self._evaluate(x, T)) return fun(E) - def to_hdf5(self, path, libver='earliest'): + def export_to_hdf5(self, path, libver='earliest'): """Export windowed multipole data to an HDF5 file. Parameters @@ -666,33 +666,32 @@ class WindowedMultipole(EqualityMixin): """ # Open file and write version. - f = h5py.File(path, 'w', libver=libver) - f.create_dataset('version', (1, ), dtype='S10') - f['version'][:] = WMP_VERSION.encode('ASCII') + with h5py.File(path, 'w', libver=libver) as f: + f.create_dataset('version', (1, ), dtype='S10') + f['version'][:] = WMP_VERSION.encode('ASCII') - # Make a nuclide group. - g = f.create_group('nuclide') + # Make a nuclide group. + g = f.create_group('nuclide') - # Write scalars. - if self.formalism == 'MLBW': - g.create_dataset('formalism', - data=np.array(_FORM_MLBW, dtype=np.int32)) - else: - # Assume RM. - g.create_dataset('formalism', - data=np.array(_FORM_RM, dtype=np.int32)) - g.create_dataset('spacing', data=np.array(self.spacing)) - g.create_dataset('sqrtAWR', data=np.array(self.sqrtAWR)) - g.create_dataset('start_E', data=np.array(self.start_E)) - g.create_dataset('end_E', data=np.array(self.end_E)) + # Write scalars. + if self.formalism == 'MLBW': + g.create_dataset('formalism', + data=np.array(_FORM_MLBW, dtype=np.int32)) + else: + # Assume RM. + g.create_dataset('formalism', + data=np.array(_FORM_RM, dtype=np.int32)) + g.create_dataset('spacing', data=np.array(self.spacing)) + g.create_dataset('sqrtAWR', data=np.array(self.sqrtAWR)) + g.create_dataset('start_E', data=np.array(self.start_E)) + g.create_dataset('end_E', data=np.array(self.end_E)) - # Write arrays. - g.create_dataset('data', data=self.data) - g.create_dataset('l_value', data=self.l_value) - g.create_dataset('pseudo_K0RS', data=self.pseudo_k0RS) - g.create_dataset('w_start', data=self.w_start) - g.create_dataset('w_end', data=self.w_end) - g.create_dataset('broaden_poly', data=self.broaden_poly) - g.create_dataset('curvefit', data=self.curvefit) - - f.close() + # Write arrays. + g.create_dataset('data', data=self.data) + g.create_dataset('l_value', data=self.l_value) + g.create_dataset('pseudo_K0RS', data=self.pseudo_k0RS) + g.create_dataset('w_start', data=self.w_start) + g.create_dataset('w_end', data=self.w_end) + g.create_dataset('broaden_poly', + data=self.broaden_poly.astype(np.int8)) + g.create_dataset('curvefit', data=self.curvefit) diff --git a/tests/unit_tests/test_data_multipole.py b/tests/unit_tests/test_data_multipole.py index de7c1cc931..a1cc5bc02c 100644 --- a/tests/unit_tests/test_data_multipole.py +++ b/tests/unit_tests/test_data_multipole.py @@ -58,7 +58,7 @@ def test_high_l(fe56): assert total[0] == pytest.approx(27.85535792368082) -def test_to_hdf5(tmpdir, u235): +def test_export_to_hdf5(tmpdir, u235): filename = str(tmpdir.join('092235.h5')) - u235.to_hdf5(filename) + u235.export_to_hdf5(filename) assert os.path.exists(filename) From 85af75c459da55b3d77cf15e5b556b61ca97aa4b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Mar 2018 13:58:58 -0500 Subject: [PATCH 118/231] Address comments on #985 --- openmc/filter.py | 4 ++-- openmc/plots.py | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/openmc/filter.py b/openmc/filter.py index 6cb81d97a3..26629dafe0 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -753,7 +753,7 @@ class MeshFilter(Filter): if n_dim == 3: # Construct 3-tuple of x,y,z cell indices for a 3D mesh nx, ny, nz = self.mesh.dimension - x = bin_index % nx + 1 + x = (bin_index % nx) + 1 y = (bin_index % (nx * ny)) // nx + 1 z = bin_index // (nx * ny) + 1 return (x, y, z) @@ -761,7 +761,7 @@ class MeshFilter(Filter): elif n_dim == 2: # Construct 2-tuple of x,y cell indices for a 2D mesh nx, ny = self.mesh.dimension - x = bin_index % nx + 1 + x = (bin_index % nx) + 1 y = bin_index // nx + 1 return (x, y) else: diff --git a/openmc/plots.py b/openmc/plots.py index a948c2a48e..8eff78b1d9 100644 --- a/openmc/plots.py +++ b/openmc/plots.py @@ -651,9 +651,16 @@ class Plot(IDManagerMixin): return element - def to_image(self, openmc_exec='openmc', cwd='.', convert_exec='convert'): + def to_ipython_image(self, openmc_exec='openmc', cwd='.', + convert_exec='convert'): """Render plot as an image + This method runs OpenMC in plotting mode to produce a bitmap image which + is then converted to a .png file and loaded in as an + :class:`IPython.display.Image` object. As such, it requires that your + model geometry, materials, and settings have already been exported to + XML. + Parameters ---------- openmc_exec : str From 794ac9255ae077a1dc6e496f24df194d5d669099 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 15 Mar 2018 14:07:42 -0500 Subject: [PATCH 119/231] Add initial Fortran implementation of MeshSurfaceFilter --- CMakeLists.txt | 1 + src/constants.F90 | 5 +- src/input_xml.F90 | 11 +- src/tallies/tally_filter.F90 | 5 + src/tallies/tally_filter_mesh.F90 | 3 - src/tallies/tally_filter_meshsurface.F90 | 392 +++++++++++++++++++++++ src/tallies/tally_header.F90 | 2 + 7 files changed, 411 insertions(+), 8 deletions(-) create mode 100644 src/tallies/tally_filter_meshsurface.F90 diff --git a/CMakeLists.txt b/CMakeLists.txt index be62dcd57b..9517fe2ec3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -422,6 +422,7 @@ set(LIBOPENMC_FORTRAN_SRC src/tallies/tally_filter_energyfunc.F90 src/tallies/tally_filter_material.F90 src/tallies/tally_filter_mesh.F90 + src/tallies/tally_filter_meshsurface.F90 src/tallies/tally_filter_mu.F90 src/tallies/tally_filter_polar.F90 src/tallies/tally_filter_surface.F90 diff --git a/src/constants.F90 b/src/constants.F90 index 3334a4cc76..75a9471490 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -358,7 +358,7 @@ module constants integer, parameter :: NO_BIN_FOUND = -1 ! Tally filter and map types - integer, parameter :: N_FILTER_TYPES = 15 + integer, parameter :: N_FILTER_TYPES = 16 integer, parameter :: & FILTER_UNIVERSE = 1, & FILTER_MATERIAL = 2, & @@ -374,7 +374,8 @@ module constants FILTER_AZIMUTHAL = 12, & FILTER_DELAYEDGROUP = 13, & FILTER_ENERGYFUNCTION = 14, & - FILTER_CELLFROM = 15 + FILTER_CELLFROM = 15, & + FILTER_MESHSURFACE = 16 ! Mesh types integer, parameter :: & diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 918d471d3c..792450e517 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -10,7 +10,7 @@ module input_xml use distribution_multivariate use distribution_univariate use endf, only: reaction_name - use error, only: fatal_error, warning, write_message + use error, only: fatal_error, warning, write_message, openmc_err_msg use geometry, only: calc_offsets, maximum_levels, count_instance, & neighbor_lists use geometry_header @@ -2358,13 +2358,13 @@ contains call get_node_value(node_filt, "type", temp_str) temp_str = to_lower(temp_str) - ! Determine number of bins + ! Make sure bins have been set select case(temp_str) case ("energy", "energyout", "mu", "polar", "azimuthal") if (.not. check_for_node(node_filt, "bins")) then call fatal_error("Bins not set in filter " // trim(to_str(filter_id))) end if - case ("mesh", "universe", "material", "cell", "distribcell", & + case ("mesh", "meshsurface", "universe", "material", "cell", "distribcell", & "cellborn", "cellfrom", "surface", "delayedgroup") if (.not. check_for_node(node_filt, "bins")) then call fatal_error("Bins not set in filter " // trim(to_str(filter_id))) @@ -2373,6 +2373,9 @@ contains ! Allocate according to the filter type err = openmc_filter_set_type(i_start + i - 1, to_c_string(temp_str)) + if (err /= 0) then + call fatal_error(to_f_string(openmc_err_msg)) + end if ! Read filter data from XML call f % obj % from_xml(node_filt) @@ -2923,6 +2926,8 @@ contains ! Set filters err = openmc_tally_set_filters(i_start + i - 1, n_filter, temp_filter) deallocate(temp_filter) + else + t % score_bins(j) = SCORE_CURRENT end if case ('events') diff --git a/src/tallies/tally_filter.F90 b/src/tallies/tally_filter.F90 index 587f8dd902..3d6eaaef21 100644 --- a/src/tallies/tally_filter.F90 +++ b/src/tallies/tally_filter.F90 @@ -19,6 +19,7 @@ module tally_filter use tally_filter_energyfunc use tally_filter_material use tally_filter_mesh + use tally_filter_meshsurface use tally_filter_mu use tally_filter_polar use tally_filter_surface @@ -67,6 +68,8 @@ contains type_ = 'material' type is (MeshFilter) type_ = 'mesh' + type is (MeshSurfaceFilter) + type_ = 'meshsurface' type is (MuFilter) type_ = 'mu' type is (PolarFilter) @@ -136,6 +139,8 @@ contains allocate(MaterialFilter :: filters(index) % obj) case ('mesh') allocate(MeshFilter :: filters(index) % obj) + case ('meshsurface') + allocate(MeshSurfaceFilter :: filters(index) % obj) case ('mu') allocate(MuFilter :: filters(index) % obj) case ('polar') diff --git a/src/tallies/tally_filter_mesh.F90 b/src/tallies/tally_filter_mesh.F90 index 2092e7e717..3c0e6250c2 100644 --- a/src/tallies/tally_filter_mesh.F90 +++ b/src/tallies/tally_filter_mesh.F90 @@ -84,7 +84,6 @@ contains integer :: ijk1(3) ! indices of ending coordinates integer :: search_iter ! loop count for intersection search integer :: bin - real(8) :: weight ! weight to be pushed back real(8) :: uvw(3) ! cosine of angle of particle real(8) :: xyz0(3) ! starting/intermediate coordinates real(8) :: xyz1(3) ! ending coordinates of particle @@ -96,8 +95,6 @@ contains logical :: end_in_mesh ! ending coordinates inside mesh? type(RegularMesh), pointer :: m - weight = ERROR_REAL - ! Get a pointer to the mesh. m => meshes(this % mesh) n = m % n_dimension diff --git a/src/tallies/tally_filter_meshsurface.F90 b/src/tallies/tally_filter_meshsurface.F90 new file mode 100644 index 0000000000..e45261f440 --- /dev/null +++ b/src/tallies/tally_filter_meshsurface.F90 @@ -0,0 +1,392 @@ +module tally_filter_meshsurface + + use, intrinsic :: ISO_C_BINDING + + use hdf5 + + use constants + use dict_header, only: EMPTY + use error + use mesh_header, only: RegularMesh, meshes, n_meshes, mesh_dict + use hdf5_interface + use particle_header, only: Particle + use string, only: to_str + use tally_filter_header + use xml_interface + + implicit none + private + public :: openmc_meshsurface_filter_set_mesh + +!=============================================================================== +! MESHFILTER indexes the location of particle events to a regular mesh. For +! tracklength tallies, it will produce multiple valid bins and the bin weight +! will correspond to the fraction of the track length that lies in that bin. +!=============================================================================== + + type, public, extends(TallyFilter) :: MeshSurfaceFilter + integer :: mesh + contains + procedure :: from_xml + procedure :: get_all_bins + procedure :: to_statepoint + procedure :: text_label + end type MeshSurfaceFilter + +contains + + subroutine from_xml(this, node) + class(MeshSurfaceFilter), intent(inout) :: this + type(XMLNode), intent(in) :: node + + integer :: i_mesh + integer :: id + integer :: n + integer :: n_dim + integer :: val + + n = node_word_count(node, "bins") + + if (n /= 1) call fatal_error("Only one mesh can be & + &specified per mesh filter.") + + ! Determine id of mesh + call get_node_value(node, "bins", id) + + ! Get pointer to mesh + val = mesh_dict % get(id) + if (val /= EMPTY) then + i_mesh = val + else + call fatal_error("Could not find mesh " // trim(to_str(id)) & + // " specified on filter.") + end if + + ! Determine number of bins + n_dim = meshes(i_mesh) % n_dimension + this % n_bins = 4*n_dim*product(meshes(i_mesh) % dimension + 1) + + ! Store the index of the mesh + this % mesh = i_mesh + end subroutine from_xml + + subroutine get_all_bins(this, p, estimator, match) + class(MeshSurfaceFilter), intent(in) :: this + type(Particle), intent(in) :: p + integer, intent(in) :: estimator + type(TallyFilterMatch), intent(inout) :: match + + integer :: j ! loop indices + integer :: n_dim ! num dimensions of the mesh + integer :: d1 ! dimension index + integer :: d2 ! dimension index + integer :: d3 ! dimension index + integer :: ijk0(3) ! indices of starting coordinates + integer :: ijk1(3) ! indices of ending coordinates + integer :: n_cross ! number of surface crossings + integer :: i_mesh ! flattened mesh bin index + integer :: i_surf ! surface index (1--12) + integer :: i_bin ! actual index for filter + real(8) :: uvw(3) ! cosine of angle of particle + real(8) :: xyz0(3) ! starting/intermediate coordinates + real(8) :: xyz1(3) ! ending coordinates of particle + real(8) :: xyz_cross(3) ! coordinates of bounding surfaces + real(8) :: d(3) ! distance to each bounding surface + real(8) :: distance ! actual distance traveled + logical :: start_in_mesh ! particle's starting xyz in mesh? + logical :: end_in_mesh ! particle's ending xyz in mesh? + logical :: cross_surface ! whether the particle crosses a surface + + ! Copy starting and ending location of particle + xyz0 = p % last_xyz_current + xyz1 = p % coord(1) % xyz + + associate (m => meshes(this % mesh)) + n_dim = m % n_dimension + + ! Determine indices for starting and ending location + call m % get_indices(xyz0, ijk0, start_in_mesh) + call m % get_indices(xyz1, ijk1, end_in_mesh) + + ! Check to see if start or end is in mesh -- if not, check if track still + ! intersects with mesh + if ((.not. start_in_mesh) .and. (.not. end_in_mesh)) then + if (.not. m % intersects(xyz0, xyz1)) return + end if + + ! Calculate number of surface crossings + n_cross = sum(abs(ijk1(:n_dim) - ijk0(:n_dim))) + if (n_cross == 0) return + + ! Copy particle's direction + uvw = p % coord(1) % uvw + + ! Bounding coordinates + do d1 = 1, n_dim + if (uvw(d1) > 0) then + xyz_cross(d1) = m % lower_left(d1) + ijk0(d1) * m % width(d1) + else + xyz_cross(d1) = m % lower_left(d1) + (ijk0(d1) - 1) * m % width(d1) + end if + end do + + do j = 1, n_cross + ! Set the distances to infinity + d = INFINITY + + ! Calculate distance to each bounding surface. We need to treat + ! special case where the cosine of the angle is zero since this would + ! result in a divide-by-zero. + do d1 = 1, n_dim + if (uvw(d1) == 0) then + d(d1) = INFINITY + else + d(d1) = (xyz_cross(d1) - xyz0(d1))/uvw(d1) + end if + end do + + ! Determine the closest bounding surface of the mesh cell by + ! calculating the minimum distance. Then use the minimum distance and + ! direction of the particle to determine which surface was crossed. + distance = minval(d) + + ! Loop over the dimensions + do d1 = 1, n_dim + + ! Get the other dimensions. + if (d1 == 1) then + d2 = mod(d1, 3) + 1 + d3 = mod(d1 + 1, 3) + 1 + else + d2 = mod(d1 + 1, 3) + 1 + d3 = mod(d1, 3) + 1 + end if + + ! Check whether distance is the shortest distance + if (distance == d(d1)) then + + ! Check whether particle is moving in positive d1 direction + if (uvw(d1) > 0) then + + ! Outward current on d1 max surface + if (all(ijk0(:n_dim) >= 1) .and. & + all(ijk0(:n_dim) <= m % dimension)) then + i_surf = d1 * 4 - 1 + i_mesh = m % get_bin_from_indices(ijk0) + i_bin = 4*n_dim*i_mesh + i_surf + 1 + + call match % bins % push_back(i_bin) + call match % weights % push_back(ONE) + end if + + ! Inward current on d1 min surface + cross_surface = .false. + select case(n_dim) + + case (1) + if (ijk0(d1) >= 0 .and. ijk0(d1) < m % dimension(d1)) then + cross_surface = .true. + end if + + case (2) + if (ijk0(d1) >= 0 .and. ijk0(d1) < m % dimension(d1) .and. & + ijk0(d2) >= 1 .and. ijk0(d2) <= m % dimension(d2)) then + cross_surface = .true. + end if + + case (3) + if (ijk0(d1) >= 0 .and. ijk0(d1) < m % dimension(d1) .and. & + ijk0(d2) >= 1 .and. ijk0(d2) <= m % dimension(d2) .and. & + ijk0(d3) >= 1 .and. ijk0(d3) <= m % dimension(d3)) then + cross_surface = .true. + end if + end select + + ! If the particle crossed the surface, tally the current + if (cross_surface) then + ijk0(d1) = ijk0(d1) + 1 + i_surf = d1 * 4 - 2 + i_mesh = m % get_bin_from_indices(ijk0) + i_bin = 4*n_dim*i_mesh + i_surf + 1 + + call match % bins % push_back(i_bin) + call match % weights % push_back(ONE) + + ijk0(d1) = ijk0(d1) - 1 + end if + + ijk0(d1) = ijk0(d1) + 1 + xyz_cross(d1) = xyz_cross(d1) + m % width(d1) + + ! The particle is moving in the negative d1 direction + else + + ! Outward current on d1 min surface + if (all(ijk0(:n_dim) >= 1) .and. & + all(ijk0(:n_dim) <= m % dimension)) then + i_surf = d1 * 4 - 3 + i_mesh = m % get_bin_from_indices(ijk0) + i_bin = 4*n_dim*i_mesh + i_surf + 1 + + call match % bins % push_back(i_bin) + call match % weights % push_back(ONE) + end if + + ! Inward current on d1 max surface + cross_surface = .false. + select case(n_dim) + + case (1) + if (ijk0(d1) > 1 .and. ijk0(d1) <= m % dimension(d1) + 1) then + cross_surface = .true. + end if + + case (2) + if (ijk0(d1) > 1 .and. ijk0(d1) <= m % dimension(d1) + 1 .and.& + ijk0(d2) >= 1 .and. ijk0(d2) <= m % dimension(d2)) then + cross_surface = .true. + end if + + case (3) + if (ijk0(d1) > 1 .and. ijk0(d1) <= m % dimension(d1) + 1 .and.& + ijk0(d2) >= 1 .and. ijk0(d2) <= m % dimension(d2) .and. & + ijk0(d3) >= 1 .and. ijk0(d3) <= m % dimension(d3)) then + cross_surface = .true. + end if + end select + + ! If the particle crossed the surface, tally the current + if (cross_surface) then + ijk0(d1) = ijk0(d1) - 1 + i_surf = d1 * 4 + i_mesh = m % get_bin_from_indices(ijk0) + i_bin = 4*n_dim*i_mesh + i_surf + 1 + + call match % bins % push_back(i_bin) + call match % weights % push_back(ONE) + + ijk0(d1) = ijk0(d1) + 1 + end if + + ijk0(d1) = ijk0(d1) - 1 + xyz_cross(d1) = xyz_cross(d1) - m % width(d1) + end if + end if + end do + + ! Calculate new coordinates + xyz0 = xyz0 + distance * uvw + end do + end associate + + end subroutine get_all_bins + + subroutine to_statepoint(this, filter_group) + class(MeshSurfaceFilter), intent(in) :: this + integer(HID_T), intent(in) :: filter_group + + call write_dataset(filter_group, "type", "meshsurface") + call write_dataset(filter_group, "n_bins", this % n_bins) + call write_dataset(filter_group, "bins", meshes(this % mesh) % id) + end subroutine to_statepoint + + function text_label(this, bin) result(label) + class(MeshSurfaceFilter), intent(in) :: this + integer, intent(in) :: bin + character(MAX_LINE_LEN) :: label + + integer :: i_mesh + integer :: i_surf + integer :: n_dim + integer, allocatable :: ijk(:) + + associate (m => meshes(this % mesh)) + n_dim = m % n_dimension + allocate(ijk(n_dim)) + + ! Get flattend mesh index and surface index + i_mesh = (bin - 1) / (4*n_dim) + i_surf = mod(bin - 1, 4*n_dim) + 1 + + ! Get mesh index part of label + call m % get_indices_from_bin(i_mesh, ijk) + if (m % n_dimension == 1) then + label = "Mesh Index (" // trim(to_str(ijk(1))) // ")" + elseif (m % n_dimension == 2) then + label = "Mesh Index (" // trim(to_str(ijk(1))) // ", " // & + trim(to_str(ijk(2))) // ")" + elseif (m % n_dimension == 3) then + label = "Mesh Index (" // trim(to_str(ijk(1))) // ", " // & + trim(to_str(ijk(2))) // ", " // trim(to_str(ijk(3))) // ")" + end if + + ! Get surface part of label + select case (i_surf) + case (OUT_LEFT) + label = trim(label) // " Outgoing, x-min" + case (IN_LEFT) + label = trim(label) // " Incoming, x-min" + case (OUT_RIGHT) + label = trim(label) // " Outgoing, x-max" + case (IN_RIGHT) + label = trim(label) // " Incoming, x-max" + case (OUT_BACK) + label = trim(label) // " Outgoing, y-min" + case (IN_BACK) + label = trim(label) // " Incoming, y-min" + case (OUT_FRONT) + label = trim(label) // " Outgoing, y-max" + case (IN_FRONT) + label = trim(label) // " Incoming, y-max" + case (OUT_BOTTOM) + label = trim(label) // " Outgoing, z-min" + case (IN_BOTTOM) + label = trim(label) // " Incoming, z-min" + case (OUT_TOP) + label = trim(label) // " Outgoing, z-max" + case (IN_TOP) + label = trim(label) // " Incoming, z-max" + end select + end associate + end function text_label + +!=============================================================================== +! C API FUNCTIONS +!=============================================================================== + + function openmc_meshsurface_filter_set_mesh(index, index_mesh) result(err) bind(C) + ! Set the mesh for a mesh filter + integer(C_INT32_T), value, intent(in) :: index + integer(C_INT32_T), value, intent(in) :: index_mesh + integer(C_INT) :: err + + integer :: n_dim + + err = 0 + if (index >= 1 .and. index <= n_filters) then + if (allocated(filters(index) % obj)) then + select type (f => filters(index) % obj) + type is (MeshSurfaceFilter) + if (index_mesh >= 1 .and. index_mesh <= n_meshes) then + f % mesh = index_mesh + n_dim = meshes(index_mesh) % n_dimension + f % n_bins = 4*n_dim*product(meshes(index_mesh) % dimension + 1) + else + err = E_OUT_OF_BOUNDS + call set_errmsg("Index in 'meshes' array is out of bounds.") + end if + class default + err = E_INVALID_TYPE + call set_errmsg("Tried to set mesh on a non-mesh filter.") + end select + else + err = E_ALLOCATE + call set_errmsg("Filter type has not been set yet.") + end if + else + err = E_OUT_OF_BOUNDS + call set_errmsg("Index in filters array out of bounds.") + end if + end function openmc_meshsurface_filter_set_mesh + +end module tally_filter_meshsurface diff --git a/src/tallies/tally_header.F90 b/src/tallies/tally_header.F90 index 9604d2382a..6266005c2c 100644 --- a/src/tallies/tally_header.F90 +++ b/src/tallies/tally_header.F90 @@ -336,6 +336,8 @@ contains j = FILTER_SURFACE type is (MeshFilter) j = FILTER_MESH + type is (MeshSurfaceFilter) + j = FILTER_MESHSURFACE type is (EnergyFilter) j = FILTER_ENERGYIN type is (EnergyoutFilter) From 616d492d01aaeb6b5232408cbb58e40dbb1d04ce Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 15 Mar 2018 15:52:57 -0500 Subject: [PATCH 120/231] Don't include 0-index mesh cells for mesh surface filter --- src/input_xml.F90 | 1 + src/output.F90 | 6 - src/tallies/tally.F90 | 350 +++++++---------------- src/tallies/tally_filter_meshsurface.F90 | 122 +++----- 4 files changed, 130 insertions(+), 349 deletions(-) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 792450e517..39369287ea 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -2927,6 +2927,7 @@ contains err = openmc_tally_set_filters(i_start + i - 1, n_filter, temp_filter) deallocate(temp_filter) else + t % type = TALLY_MESH_CURRENT t % score_bins(j) = SCORE_CURRENT end if diff --git a/src/output.F90 b/src/output.F90 index 964289126c..ecfaa94d5c 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -771,12 +771,6 @@ contains end associate end if - ! Handle surface current tallies separately - if (t % type == TALLY_MESH_CURRENT) then - call write_surface_current(t, unit_tally) - cycle - end if - ! WARNING: Admittedly, the logic for moving for printing results is ! extremely confusing and took quite a bit of time to get correct. The ! logic is structured this way since it is not practical to have a do diff --git a/src/tallies/tally.F90 b/src/tallies/tally.F90 index a9a5fd8bfc..d112961397 100644 --- a/src/tallies/tally.F90 +++ b/src/tallies/tally.F90 @@ -3064,7 +3064,7 @@ contains ! tally total or partial currents between two cells !=============================================================================== - subroutine score_surface_tally(p) + subroutine score_surface_tally(p) type(Particle), intent(in) :: p @@ -3199,277 +3199,121 @@ contains integer :: i integer :: i_tally - integer :: j, k ! loop indices - integer :: n_dim ! num dimensions of the mesh - integer :: d1 ! dimension index - integer :: d2 ! dimension index - integer :: d3 ! dimension index - integer :: ijk0(3) ! indices of starting coordinates - integer :: ijk1(3) ! indices of ending coordinates - integer :: n_cross ! number of surface crossings - integer :: filter_index ! index of scoring bin - integer :: i_filter_mesh ! index of mesh filter in filters array - integer :: i_filter_surf ! index of surface filter in filters - integer :: i_filter_energy ! index of energy filter in filters - real(8) :: uvw(3) ! cosine of angle of particle - real(8) :: xyz0(3) ! starting/intermediate coordinates - real(8) :: xyz1(3) ! ending coordinates of particle - real(8) :: xyz_cross(3) ! coordinates of bounding surfaces - real(8) :: d(3) ! distance to each bounding surface - real(8) :: distance ! actual distance traveled - integer :: matching_bin ! next valid filter bin - logical :: start_in_mesh ! particle's starting xyz in mesh? - logical :: end_in_mesh ! particle's ending xyz in mesh? - logical :: cross_surface ! whether the particle crosses a surface - logical :: energy_filter ! energy filter present - type(RegularMesh), pointer :: m + integer :: i_filt + integer :: i_bin + integer :: q ! loop index for scoring bins + integer :: k ! working index for expand and score + integer :: score_bin ! scoring bin, e.g. SCORE_FLUX + integer :: score_index ! scoring bin index + integer :: j ! loop index for scoring bins + integer :: filter_index ! single index for single bin + real(8) :: flux ! collision estimate of flux + real(8) :: filter_weight ! combined weight of all filters + real(8) :: score ! analog tally score + logical :: finished ! found all valid bin combinations + + ! No collision, so no weight change when survival biasing + flux = p % wgt TALLY_LOOP: do i = 1, active_current_tallies % size() - ! Copy starting and ending location of particle - xyz0 = p % last_xyz_current - xyz1 = p % coord(1) % xyz - - ! Get pointer to tally + ! Get index of tally and pointer to tally i_tally = active_current_tallies % data(i) associate (t => tallies(i_tally) % obj) - ! Check for energy filter - energy_filter = (t % find_filter(FILTER_ENERGYIN) > 0) - - ! Get index for mesh, surface, and energy filters - i_filter_mesh = t % filter(t % find_filter(FILTER_MESH)) - i_filter_surf = t % filter(t % find_filter(FILTER_SURFACE)) - if (energy_filter) then - i_filter_energy = t % filter(t % find_filter(FILTER_ENERGYIN)) - end if - - ! Reset the matching bins arrays - call filter_matches(i_filter_mesh) % bins % resize(1) - call filter_matches(i_filter_surf) % bins % resize(1) - if (energy_filter) then - call filter_matches(i_filter_energy) % bins % resize(1) - end if - - ! Get pointer to mesh - select type(filt => filters(i_filter_mesh) % obj) - type is (MeshFilter) - m => meshes(filt % mesh) - end select - - n_dim = m % n_dimension - - ! Determine indices for starting and ending location - call m % get_indices(xyz0, ijk0, start_in_mesh) - call m % get_indices(xyz1, ijk1, end_in_mesh) - - ! Check to see if start or end is in mesh -- if not, check if track still - ! intersects with mesh - if ((.not. start_in_mesh) .and. (.not. end_in_mesh)) then - if (.not. m % intersects(xyz0, xyz1)) cycle - end if - - ! Calculate number of surface crossings - n_cross = sum(abs(ijk1(:n_dim) - ijk0(:n_dim))) - if (n_cross == 0) then - cycle - end if - - ! Copy particle's direction - uvw = p % coord(1) % uvw - - ! Determine incoming energy bin. We need to tell the energy filter this - ! is a tracklength tally so it uses the pre-collision energy. - if (energy_filter) then - call filter_matches(i_filter_energy) % bins % clear() - call filter_matches(i_filter_energy) % weights % clear() - call filters(i_filter_energy) % obj % get_all_bins(p, & - ESTIMATOR_TRACKLENGTH, filter_matches(i_filter_energy)) - if (filter_matches(i_filter_energy) % bins % size() == 0) cycle - matching_bin = filter_matches(i_filter_energy) % bins % data(1) - filter_matches(i_filter_energy) % bins % data(1) = matching_bin - end if - - ! Bounding coordinates - do d1 = 1, n_dim - if (uvw(d1) > 0) then - xyz_cross(d1) = m % lower_left(d1) + ijk0(d1) * m % width(d1) - else - xyz_cross(d1) = m % lower_left(d1) + (ijk0(d1) - 1) * m % width(d1) + ! Find all valid bins in each filter if they have not already been found + ! for a previous tally. + do j = 1, size(t % filter) + i_filt = t % filter(j) + if (.not. filter_matches(i_filt) % bins_present) then + call filter_matches(i_filt) % bins % clear() + call filter_matches(i_filt) % weights % clear() + call filters(i_filt) % obj % get_all_bins(p, t % estimator, & + filter_matches(i_filt)) + filter_matches(i_filt) % bins_present = .true. end if + ! If there are no valid bins for this filter, then there is nothing to + ! score and we can move on to the next tally. + if (filter_matches(i_filt) % bins % size() == 0) cycle TALLY_LOOP + + ! Set the index of the bin used in the first filter combination + filter_matches(i_filt) % i_bin = 1 end do - do j = 1, n_cross - ! Reset scoring bin index - filter_matches(i_filter_surf) % bins % data(1) = 0 + ! ======================================================================== + ! Loop until we've covered all valid bins on each of the filters. - ! Set the distances to infinity - d = INFINITY + FILTER_LOOP: do - ! Calculate distance to each bounding surface. We need to treat - ! special case where the cosine of the angle is zero since this would - ! result in a divide-by-zero. - do d1 = 1, n_dim - if (uvw(d1) == 0) then - d(d1) = INFINITY + ! Reset scoring index and weight + filter_index = 1 + filter_weight = ONE + + ! Determine scoring index and weight for this filter combination + do j = 1, size(t % filter) + i_filt = t % filter(j) + i_bin = filter_matches(i_filt) % i_bin + filter_index = filter_index + (filter_matches(i_filt) % bins % & + data(i_bin) - 1) * t % stride(j) + filter_weight = filter_weight * filter_matches(i_filt) % weights % & + data(i_bin) + end do + + ! Determine score + score = flux * filter_weight + + ! Currently only one score type + k = 0 + SCORE_LOOP: do q = 1, t % n_user_score_bins + k = k + 1 + + ! determine what type of score bin + score_bin = t % score_bins(q) + + ! determine scoring bin index, no offset from nuclide bins + score_index = q + + call expand_and_score(p, t, score_index, filter_index, score_bin, & + score, k) + end do SCORE_LOOP + + ! ====================================================================== + ! Filter logic + + ! Increment the filter bins, starting with the last filter to find the + ! next valid bin combination + finished = .true. + do j = size(t % filter), 1, -1 + i_filt = t % filter(j) + if (filter_matches(i_filt) % i_bin < filter_matches(i_filt) % & + bins % size()) then + filter_matches(i_filt) % i_bin = filter_matches(i_filt) % i_bin + 1 + finished = .false. + exit else - d(d1) = (xyz_cross(d1) - xyz0(d1))/uvw(d1) + filter_matches(i_filt) % i_bin = 1 end if end do - ! Determine the closest bounding surface of the mesh cell by - ! calculating the minimum distance. Then use the minimum distance and - ! direction of the particle to determine which surface was crossed. - distance = minval(d) + ! Once we have finished all valid bins for each of the filters, exit + ! the loop. + if (finished) exit FILTER_LOOP - ! Loop over the dimensions - do d1 = 1, n_dim - - ! Get the other dimensions. - if (d1 == 1) then - d2 = mod(d1, 3) + 1 - d3 = mod(d1 + 1, 3) + 1 - else - d2 = mod(d1 + 1, 3) + 1 - d3 = mod(d1, 3) + 1 - end if - - ! Check whether distance is the shortest distance - if (distance == d(d1)) then - - ! Check whether particle is moving in positive d1 direction - if (uvw(d1) > 0) then - - ! Outward current on d1 max surface - if (all(ijk0(:n_dim) >= 1) .and. & - all(ijk0(:n_dim) <= m % dimension)) then - filter_matches(i_filter_surf) % bins % data(1) = d1 * 4 - 1 - filter_matches(i_filter_mesh) % bins % data(1) = & - m % get_bin_from_indices(ijk0) - filter_index = 1 - do k = 1, size(t % filter) - filter_index = filter_index + (filter_matches(t % & - filter(k)) % bins % data(1) - 1) * t % stride(k) - end do -!$omp atomic - t % results(RESULT_VALUE, 1, filter_index) = & - t % results(RESULT_VALUE, 1, filter_index) + p % wgt - end if - - ! Inward current on d1 min surface - cross_surface = .false. - select case(n_dim) - - case (1) - if (ijk0(d1) >= 0 .and. ijk0(d1) < m % dimension(d1)) then - cross_surface = .true. - end if - - case (2) - if (ijk0(d1) >= 0 .and. ijk0(d1) < m % dimension(d1) .and. & - ijk0(d2) >= 1 .and. ijk0(d2) <= m % dimension(d2)) then - cross_surface = .true. - end if - - case (3) - if (ijk0(d1) >= 0 .and. ijk0(d1) < m % dimension(d1) .and. & - ijk0(d2) >= 1 .and. ijk0(d2) <= m % dimension(d2) .and. & - ijk0(d3) >= 1 .and. ijk0(d3) <= m % dimension(d3)) then - cross_surface = .true. - end if - end select - - ! If the particle crossed the surface, tally the current - if (cross_surface) then - ijk0(d1) = ijk0(d1) + 1 - filter_matches(i_filter_surf) % bins % data(1) = d1 * 4 - 2 - filter_matches(i_filter_mesh) % bins % data(1) = & - m % get_bin_from_indices(ijk0) - filter_index = 1 - do k = 1, size(t % filter) - filter_index = filter_index + (filter_matches(t % & - filter(k)) % bins % data(1) - 1) * t % stride(k) - end do -!$omp atomic - t % results(RESULT_VALUE, 1, filter_index) = & - t % results(RESULT_VALUE, 1, filter_index) + p % wgt - ijk0(d1) = ijk0(d1) - 1 - end if - - ijk0(d1) = ijk0(d1) + 1 - xyz_cross(d1) = xyz_cross(d1) + m % width(d1) - - ! The particle is moving in the negative d1 direction - else - - ! Outward current on d1 min surface - if (all(ijk0(:n_dim) >= 1) .and. & - all(ijk0(:n_dim) <= m % dimension)) then - filter_matches(i_filter_surf) % bins % data(1) = d1 * 4 - 3 - filter_matches(i_filter_mesh) % bins % data(1) = & - m % get_bin_from_indices(ijk0) - filter_index = 1 - do k = 1, size(t % filter) - filter_index = filter_index + (filter_matches(t % & - filter(k)) % bins % data(1) - 1) * t % stride(k) - end do -!$omp atomic - t % results(RESULT_VALUE, 1, filter_index) = & - t % results(RESULT_VALUE, 1, filter_index) + p % wgt - end if - - ! Inward current on d1 max surface - cross_surface = .false. - select case(n_dim) - - case (1) - if (ijk0(d1) > 1 .and. ijk0(d1) <= m % dimension(d1) + 1) then - cross_surface = .true. - end if - - case (2) - if (ijk0(d1) > 1 .and. ijk0(d1) <= m % dimension(d1) + 1 .and.& - ijk0(d2) >= 1 .and. ijk0(d2) <= m % dimension(d2)) then - cross_surface = .true. - end if - - case (3) - if (ijk0(d1) > 1 .and. ijk0(d1) <= m % dimension(d1) + 1 .and.& - ijk0(d2) >= 1 .and. ijk0(d2) <= m % dimension(d2) .and. & - ijk0(d3) >= 1 .and. ijk0(d3) <= m % dimension(d3)) then - cross_surface = .true. - end if - end select - - ! If the particle crossed the surface, tally the current - if (cross_surface) then - ijk0(d1) = ijk0(d1) - 1 - filter_matches(i_filter_surf) % bins % data(1) = d1 * 4 - filter_matches(i_filter_mesh) % bins % data(1) = & - m % get_bin_from_indices(ijk0) - filter_index = 1 - do k = 1, size(t % filter) - filter_index = filter_index + (filter_matches(t % & - filter(k)) % bins % data(1) - 1) * t % stride(k) - end do -!$omp atomic - t % results(RESULT_VALUE, 1, filter_index) = & - t % results(RESULT_VALUE, 1, filter_index) + p % wgt - ijk0(d1) = ijk0(d1) + 1 - end if - - ijk0(d1) = ijk0(d1) - 1 - xyz_cross(d1) = xyz_cross(d1) - m % width(d1) - end if - end if - end do - - ! Calculate new coordinates - xyz0 = xyz0 + distance * uvw - end do + end do FILTER_LOOP end associate + + ! If the user has specified that we can assume all tallies are spatially + ! separate, this implies that once a tally has been scored to, we needn't + ! check the others. This cuts down on overhead when there are many + ! tallies specified + + if (assume_separate) exit TALLY_LOOP + end do TALLY_LOOP + ! Reset filter matches flag + filter_matches(:) % bins_present = .false. + end subroutine score_surface_current !=============================================================================== diff --git a/src/tallies/tally_filter_meshsurface.F90 b/src/tallies/tally_filter_meshsurface.F90 index e45261f440..1913c8b0de 100644 --- a/src/tallies/tally_filter_meshsurface.F90 +++ b/src/tallies/tally_filter_meshsurface.F90 @@ -64,7 +64,7 @@ contains ! Determine number of bins n_dim = meshes(i_mesh) % n_dimension - this % n_bins = 4*n_dim*product(meshes(i_mesh) % dimension + 1) + this % n_bins = 4*n_dim*product(meshes(i_mesh) % dimension) ! Store the index of the mesh this % mesh = i_mesh @@ -79,8 +79,6 @@ contains integer :: j ! loop indices integer :: n_dim ! num dimensions of the mesh integer :: d1 ! dimension index - integer :: d2 ! dimension index - integer :: d3 ! dimension index integer :: ijk0(3) ! indices of starting coordinates integer :: ijk1(3) ! indices of ending coordinates integer :: n_cross ! number of surface crossings @@ -95,7 +93,6 @@ contains real(8) :: distance ! actual distance traveled logical :: start_in_mesh ! particle's starting xyz in mesh? logical :: end_in_mesh ! particle's ending xyz in mesh? - logical :: cross_surface ! whether the particle crosses a surface ! Copy starting and ending location of particle xyz0 = p % last_xyz_current @@ -153,15 +150,6 @@ contains ! Loop over the dimensions do d1 = 1, n_dim - ! Get the other dimensions. - if (d1 == 1) then - d2 = mod(d1, 3) + 1 - d3 = mod(d1 + 1, 3) + 1 - else - d2 = mod(d1 + 1, 3) + 1 - d3 = mod(d1, 3) + 1 - end if - ! Check whether distance is the shortest distance if (distance == d(d1)) then @@ -173,103 +161,57 @@ contains all(ijk0(:n_dim) <= m % dimension)) then i_surf = d1 * 4 - 1 i_mesh = m % get_bin_from_indices(ijk0) - i_bin = 4*n_dim*i_mesh + i_surf + 1 + i_bin = 4*n_dim*(i_mesh - 1) + i_surf call match % bins % push_back(i_bin) call match % weights % push_back(ONE) end if - ! Inward current on d1 min surface - cross_surface = .false. - select case(n_dim) - - case (1) - if (ijk0(d1) >= 0 .and. ijk0(d1) < m % dimension(d1)) then - cross_surface = .true. - end if - - case (2) - if (ijk0(d1) >= 0 .and. ijk0(d1) < m % dimension(d1) .and. & - ijk0(d2) >= 1 .and. ijk0(d2) <= m % dimension(d2)) then - cross_surface = .true. - end if - - case (3) - if (ijk0(d1) >= 0 .and. ijk0(d1) < m % dimension(d1) .and. & - ijk0(d2) >= 1 .and. ijk0(d2) <= m % dimension(d2) .and. & - ijk0(d3) >= 1 .and. ijk0(d3) <= m % dimension(d3)) then - cross_surface = .true. - end if - end select - - ! If the particle crossed the surface, tally the current - if (cross_surface) then - ijk0(d1) = ijk0(d1) + 1 - i_surf = d1 * 4 - 2 - i_mesh = m % get_bin_from_indices(ijk0) - i_bin = 4*n_dim*i_mesh + i_surf + 1 - - call match % bins % push_back(i_bin) - call match % weights % push_back(ONE) - - ijk0(d1) = ijk0(d1) - 1 - end if - + ! Advance position ijk0(d1) = ijk0(d1) + 1 xyz_cross(d1) = xyz_cross(d1) + m % width(d1) - ! The particle is moving in the negative d1 direction + ! If the particle crossed the surface, tally the inward current on + ! d1 min surface + if (all(ijk0(:n_dim) >= 1) .and. & + all(ijk0(:n_dim) <= m % dimension)) then + i_surf = d1 * 4 - 2 + i_mesh = m % get_bin_from_indices(ijk0) + i_bin = 4*n_dim*(i_mesh - 1) + i_surf + + call match % bins % push_back(i_bin) + call match % weights % push_back(ONE) + end if + else + ! The particle is moving in the negative d1 direction ! Outward current on d1 min surface if (all(ijk0(:n_dim) >= 1) .and. & all(ijk0(:n_dim) <= m % dimension)) then i_surf = d1 * 4 - 3 i_mesh = m % get_bin_from_indices(ijk0) - i_bin = 4*n_dim*i_mesh + i_surf + 1 + i_bin = 4*n_dim*(i_mesh - 1) + i_surf call match % bins % push_back(i_bin) call match % weights % push_back(ONE) end if - ! Inward current on d1 max surface - cross_surface = .false. - select case(n_dim) - - case (1) - if (ijk0(d1) > 1 .and. ijk0(d1) <= m % dimension(d1) + 1) then - cross_surface = .true. - end if - - case (2) - if (ijk0(d1) > 1 .and. ijk0(d1) <= m % dimension(d1) + 1 .and.& - ijk0(d2) >= 1 .and. ijk0(d2) <= m % dimension(d2)) then - cross_surface = .true. - end if - - case (3) - if (ijk0(d1) > 1 .and. ijk0(d1) <= m % dimension(d1) + 1 .and.& - ijk0(d2) >= 1 .and. ijk0(d2) <= m % dimension(d2) .and. & - ijk0(d3) >= 1 .and. ijk0(d3) <= m % dimension(d3)) then - cross_surface = .true. - end if - end select - - ! If the particle crossed the surface, tally the current - if (cross_surface) then - ijk0(d1) = ijk0(d1) - 1 - i_surf = d1 * 4 - i_mesh = m % get_bin_from_indices(ijk0) - i_bin = 4*n_dim*i_mesh + i_surf + 1 - - call match % bins % push_back(i_bin) - call match % weights % push_back(ONE) - - ijk0(d1) = ijk0(d1) + 1 - end if - + ! Advance position ijk0(d1) = ijk0(d1) - 1 xyz_cross(d1) = xyz_cross(d1) - m % width(d1) + + ! If the particle crossed the surface, tally the inward current on + ! d1 max surface + if (all(ijk0(:n_dim) >= 1) .and. & + all(ijk0(:n_dim) <= m % dimension)) then + i_surf = d1 * 4 + i_mesh = m % get_bin_from_indices(ijk0) + i_bin = 4*n_dim*(i_mesh - 1) + i_surf + + call match % bins % push_back(i_bin) + call match % weights % push_back(ONE) + end if end if end if end do @@ -305,7 +247,7 @@ contains allocate(ijk(n_dim)) ! Get flattend mesh index and surface index - i_mesh = (bin - 1) / (4*n_dim) + i_mesh = (bin - 1) / (4*n_dim) + 1 i_surf = mod(bin - 1, 4*n_dim) + 1 ! Get mesh index part of label @@ -370,7 +312,7 @@ contains if (index_mesh >= 1 .and. index_mesh <= n_meshes) then f % mesh = index_mesh n_dim = meshes(index_mesh) % n_dimension - f % n_bins = 4*n_dim*product(meshes(index_mesh) % dimension + 1) + f % n_bins = 4*n_dim*product(meshes(index_mesh) % dimension) else err = E_OUT_OF_BOUNDS call set_errmsg("Index in 'meshes' array is out of bounds.") From c51091a1d7ee8f9ce24650a5d5975e2199f29cd0 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 15 Mar 2018 22:08:44 -0500 Subject: [PATCH 121/231] Use new MeshSurfaceFilter for CMFD (tests pass) --- include/openmc.h | 1 + openmc/filter.py | 4 + src/api.F90 | 1 + src/cmfd_data.F90 | 65 +- src/cmfd_input.F90 | 45 +- src/constants.F90 | 2 +- src/input_xml.F90 | 86 +- src/output.F90 | 182 ---- src/tallies/tally.F90 | 2 +- src/tallies/trigger.F90 | 2 +- .../cmfd_feed/results_true.dat | 816 ------------------ .../cmfd_nofeed/results_true.dat | 816 ------------------ 12 files changed, 51 insertions(+), 1971 deletions(-) diff --git a/include/openmc.h b/include/openmc.h index bb04907a52..10c0b2de8e 100644 --- a/include/openmc.h +++ b/include/openmc.h @@ -52,6 +52,7 @@ extern "C" { int openmc_material_filter_get_bins(int32_t index, int32_t** bins, int32_t* n); int openmc_material_filter_set_bins(int32_t index, int32_t n, const int32_t* bins); int openmc_mesh_filter_set_mesh(int32_t index, int32_t index_mesh); + int openmc_meshsurface_filter_set_mesh(int32_t index, int32_t index_mesh); int openmc_next_batch(); int openmc_nuclide_name(int index, char** name); void openmc_plot_geometry(); diff --git a/openmc/filter.py b/openmc/filter.py index 26629dafe0..d7b8267e96 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -845,6 +845,10 @@ class MeshFilter(Filter): return df +class MeshSurfaceFilter(MeshFilter): + pass + + class RealFilter(Filter): """Tally modifier that describes phase-space and other characteristics diff --git a/src/api.F90 b/src/api.F90 index d79a32d945..64324da3b1 100644 --- a/src/api.F90 +++ b/src/api.F90 @@ -75,6 +75,7 @@ module openmc_api public :: openmc_material_filter_get_bins public :: openmc_material_filter_set_bins public :: openmc_mesh_filter_set_mesh + public :: openmc_meshsurface_filter_set_mesh public :: openmc_next_batch public :: openmc_nuclide_name public :: openmc_plot_geometry diff --git a/src/cmfd_data.F90 b/src/cmfd_data.F90 index 521be5e3f2..3152f1eb2b 100644 --- a/src/cmfd_data.F90 +++ b/src/cmfd_data.F90 @@ -73,12 +73,10 @@ contains integer :: ital ! tally object index integer :: ijk(3) ! indices for mesh cell integer :: score_index ! index to pull from tally object - integer :: i_filt ! index in filters array integer :: i_filter_mesh ! index for mesh filter integer :: i_filter_ein ! index for incoming energy filter integer :: i_filter_eout ! index for outgoing energy filter - integer :: i_filter_surf ! index for surface filter - integer :: stride_surf ! stride for surface filter + integer :: i_mesh ! flattend index for mesh logical :: energy_filters! energy filters present real(8) :: flux ! temp variable for flux type(RegularMesh), pointer :: m ! pointer for mesh object @@ -95,10 +93,10 @@ contains ! Associate tallies and mesh associate (t => cmfd_tallies(1) % obj) - i_filt = t % filter(t % find_filter(FILTER_MESH)) + i_filter_mesh = t % filter(t % find_filter(FILTER_MESH)) end associate - select type(filt => filters(i_filt) % obj) + select type(filt => filters(i_filter_mesh) % obj) type is (MeshFilter) m => meshes(filt % mesh) end select @@ -115,16 +113,16 @@ contains ! Associate tallies and mesh associate (t => cmfd_tallies(ital) % obj) - i_filt = t % filter(t % find_filter(FILTER_MESH)) - select type(filt => filters(i_filt) % obj) - type is (MeshFilter) - m => meshes(filt % mesh) - end select + + if (ital < 3) then + i_filter_mesh = t % filter(t % find_filter(FILTER_MESH)) + else + i_filter_mesh = t % filter(t % find_filter(FILTER_MESHSURFACE)) + end if ! Check for energy filters energy_filters = (t % find_filter(FILTER_ENERGYIN) > 0) - i_filter_mesh = t % filter(t % find_filter(FILTER_MESH)) if (energy_filters) then i_filter_ein = t % filter(t % find_filter(FILTER_ENERGYIN)) i_filter_eout = t % filter(t % find_filter(FILTER_ENERGYOUT)) @@ -247,65 +245,62 @@ contains else if (ital == 3) then - i_filter_surf = t % filter(t % find_filter(FILTER_SURFACE)) - stride_surf = t % stride(t % find_filter(FILTER_SURFACE)) - ! Initialize and filter for energy do l = 1, size(t % filter) call filter_matches(t % filter(l)) % bins % clear() call filter_matches(t % filter(l)) % bins % push_back(1) end do + + ! Set the bin for this mesh cell + i_mesh = m % get_bin_from_indices([ i, j, k ]) + filter_matches(i_filter_mesh) % bins % data(1) = 12*(i_mesh - 1) + 1 + + ! Set the energy bin if needed if (energy_filters) then filter_matches(i_filter_ein) % bins % data(1) = ng - h + 1 end if - ! Get the bin for this mesh cell - filter_matches(i_filter_mesh) % bins % data(1) = & - m % get_bin_from_indices([ i, j, k ]) - - score_index = 1 + score_index = 0 do l = 1, size(t % filter) - if (t % filter(l) == i_filter_surf) cycle score_index = score_index + (filter_matches(t % filter(l)) & % bins % data(1) - 1) * t % stride(l) end do ! Left surface cmfd % current(1,h,i,j,k) = t % results(RESULT_SUM, 1, & - score_index + (OUT_LEFT - 1) * stride_surf) + score_index + OUT_LEFT) cmfd % current(2,h,i,j,k) = t % results(RESULT_SUM, 1, & - score_index + (IN_LEFT - 1) * stride_surf) + score_index + IN_LEFT) ! Right surface cmfd % current(3,h,i,j,k) = t % results(RESULT_SUM, 1, & - score_index + (IN_RIGHT - 1) * stride_surf) + score_index + IN_RIGHT) cmfd % current(4,h,i,j,k) = t % results(RESULT_SUM, 1, & - score_index + (OUT_RIGHT - 1) * stride_surf) + score_index + OUT_RIGHT) ! Back surface cmfd % current(5,h,i,j,k) = t % results(RESULT_SUM, 1, & - score_index + (OUT_BACK - 1) * stride_surf) + score_index + OUT_BACK) cmfd % current(6,h,i,j,k) = t % results(RESULT_SUM, 1, & - score_index + (IN_BACK - 1) * stride_surf) + score_index + IN_BACK) ! Front surface cmfd % current(7,h,i,j,k) = t % results(RESULT_SUM, 1, & - score_index + (IN_FRONT - 1) * stride_surf) + score_index + IN_FRONT) cmfd % current(8,h,i,j,k) = t % results(RESULT_SUM, 1, & - score_index + (OUT_FRONT - 1) * stride_surf) + score_index + OUT_FRONT) - ! Bottom surface + ! Left surface cmfd % current(9,h,i,j,k) = t % results(RESULT_SUM, 1, & - score_index + (OUT_BOTTOM - 1) * stride_surf) + score_index + OUT_BOTTOM) cmfd % current(10,h,i,j,k) = t % results(RESULT_SUM, 1, & - score_index + (IN_BOTTOM - 1) * stride_surf) + score_index + IN_BOTTOM) - ! Top surface + ! Right surface cmfd % current(11,h,i,j,k) = t % results(RESULT_SUM, 1, & - score_index + (IN_TOP - 1) * stride_surf) + score_index + IN_TOP) cmfd % current(12,h,i,j,k) = t % results(RESULT_SUM, 1, & - score_index + (OUT_TOP - 1) * stride_surf) - + score_index + OUT_TOP) end if TALLY end do OUTGROUP diff --git a/src/cmfd_input.F90 b/src/cmfd_input.F90 index dbfabb2540..86f4e2400e 100644 --- a/src/cmfd_input.F90 +++ b/src/cmfd_input.F90 @@ -373,7 +373,7 @@ contains ! Determine number of filters energy_filters = check_for_node(node_mesh, "energy") - n = merge(5, 3, energy_filters) + n = merge(4, 2, energy_filters) ! Extend filters array so we can add CMFD filters err = openmc_extend_filters(n, i_filt_start, i_filt_end) @@ -409,44 +409,15 @@ contains ! Duplicate the mesh filter for the mesh current tally since other ! tallies use this filter and we need to change the dimension i_filt = i_filt + 1 - err = openmc_filter_set_type(i_filt, C_CHAR_'mesh' // C_NULL_CHAR) + err = openmc_filter_set_type(i_filt, C_CHAR_'meshsurface' // C_NULL_CHAR) call openmc_get_filter_next_id(filt_id) err = openmc_filter_set_id(i_filt, filt_id) - err = openmc_mesh_filter_set_mesh(i_filt, i_start) + err = openmc_meshsurface_filter_set_mesh(i_filt, i_start) - ! We need to increase the dimension by one since we also need - ! currents coming into and out of the boundary mesh cells. - filters(i_filt) % obj % n_bins = product(m % dimension + 1) - - ! Set up surface filter - i_filt = i_filt + 1 - allocate(SurfaceFilter :: filters(i_filt) % obj) - select type(filt => filters(i_filt) % obj) - type is(SurfaceFilter) - filt % id = i_filt - filt % n_bins = 4 * m % n_dimension - allocate(filt % surfaces(4 * m % n_dimension)) - if (m % n_dimension == 2) then - filt % surfaces = (/ OUT_LEFT, IN_LEFT, IN_RIGHT, OUT_RIGHT, & - OUT_BACK, IN_BACK, IN_FRONT, OUT_FRONT /) - elseif (m % n_dimension == 3) then - filt % surfaces = (/ OUT_LEFT, IN_LEFT, IN_RIGHT, OUT_RIGHT, & - OUT_BACK, IN_BACK, IN_FRONT, OUT_FRONT, & - OUT_BOTTOM, IN_BOTTOM, IN_TOP, OUT_TOP /) - end if - filt % current = .true. - ! Add filter to dictionary - call filter_dict % set(filt % id, i_filt) - end select ! Initialize filters do i = i_filt_start, i_filt_end - select type (filt => filters(i) % obj) - type is (SurfaceFilter) - ! Don't do anything - class default - call filt % initialize() - end select + call filters(i) % obj % initialize() end do ! Allocate tallies @@ -564,13 +535,9 @@ contains ! Set tally estimator to analog t % estimator = ESTIMATOR_ANALOG - ! Set the surface filter index in the tally find_filter array - n_filter = n_filter + 1 - ! Allocate and set filters allocate(filter_indices(n_filter)) - filter_indices(1) = i_filt_end - 1 - filter_indices(n_filter) = i_filt_end + filter_indices(1) = i_filt_end if (energy_filters) then filter_indices(2) = i_filt_start + 1 end if @@ -588,7 +555,7 @@ contains ! Set macro bins t % score_bins(1) = SCORE_CURRENT - t % type = TALLY_MESH_CURRENT + t % type = TALLY_MESH_SURFACE end if ! Make CMFD tallies active from the start diff --git a/src/constants.F90 b/src/constants.F90 index 75a9471490..0e138f0ee5 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -292,7 +292,7 @@ module constants ! Tally type integer, parameter :: & TALLY_VOLUME = 1, & - TALLY_MESH_CURRENT = 2, & + TALLY_MESH_SURFACE = 2, & TALLY_SURFACE = 3 ! Tally estimator types diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 39369287ea..a0b077a940 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -2197,7 +2197,6 @@ contains integer :: l ! another loop index integer :: filter_id ! user-specified identifier for filter integer :: i_filt ! index in filters array - integer :: i_filter_mesh ! index of mesh filter integer :: i_elem ! index of entry in dictionary integer :: n ! size of arrays in mesh specification integer :: n_words ! number of words read @@ -2209,7 +2208,6 @@ contains integer :: trig_ind ! index of triggers array for each tally integer :: user_trig_ind ! index of user-specified triggers for each tally integer :: i_start, i_end - integer :: i_filt_start, i_filt_end integer(C_INT) :: err real(8) :: threshold ! trigger convergence threshold integer :: n_order ! moment order requested @@ -2838,18 +2836,18 @@ contains &t % find_filter(FILTER_CELL) > 0 .or. & &t % find_filter(FILTER_CELLFROM) > 0) then - ! Check to make sure that mesh currents are not desired as well - if (t % find_filter(FILTER_MESH) > 0) then - call fatal_error("Cannot tally other mesh currents & - &in the same tally as surface currents") + ! Check to make sure that mesh surface currents are not desired as well + if (t % find_filter(FILTER_MESHSURFACE) > 0) then + call fatal_error("Cannot tally mesh surface currents & + &in the same tally as normal surface currents") end if t % type = TALLY_SURFACE t % score_bins(j) = SCORE_CURRENT - else if (t % find_filter(FILTER_MESH) > 0) then + else if (t % find_filter(FILTER_MESHSURFACE) > 0) then t % score_bins(j) = SCORE_CURRENT - t % type = TALLY_MESH_CURRENT + t % type = TALLY_MESH_SURFACE ! Check to make sure that current is the only desired response ! for this tally @@ -2857,78 +2855,6 @@ contains call fatal_error("Cannot tally other scores in the & &same tally as surface currents") end if - - ! Get index of mesh filter - i_filter_mesh = t % filter(t % find_filter(FILTER_MESH)) - - ! Check to make sure mesh filter was specified - if (i_filter_mesh == 0) then - call fatal_error("Cannot tally surface current without a mesh & - &filter.") - end if - - ! Get pointer to mesh - select type(filt => filters(i_filter_mesh) % obj) - type is (MeshFilter) - m => meshes(filt % mesh) - end select - - ! Extend the filters array so we can add a surface filter and - ! mesh filter - err = openmc_extend_filters(2, i_filt_start, i_filt_end) - - ! Duplicate the mesh filter since other tallies might use this - ! filter and we need to change the dimension - filters(i_filt_start) = filters(i_filter_mesh) - - ! We need to increase the dimension by one since we also need - ! currents coming into and out of the boundary mesh cells. - filters(i_filt_start) % obj % n_bins = product(m % dimension + 1) - - ! Set ID - call openmc_get_filter_next_id(filter_id) - err = openmc_filter_set_id(i_filt_start, filter_id) - - - ! Add surface filter - allocate(SurfaceFilter :: filters(i_filt_end) % obj) - select type (filt => filters(i_filt_end) % obj) - type is (SurfaceFilter) - filt % n_bins = 4 * m % n_dimension - allocate(filt % surfaces(4 * m % n_dimension)) - if (m % n_dimension == 1) then - filt % surfaces = (/ OUT_LEFT, IN_LEFT, OUT_RIGHT, IN_RIGHT /) - elseif (m % n_dimension == 2) then - filt % surfaces = (/ OUT_LEFT, IN_LEFT, OUT_RIGHT, IN_RIGHT, & - OUT_BACK, IN_BACK, OUT_FRONT, IN_FRONT /) - elseif (m % n_dimension == 3) then - filt % surfaces = (/ OUT_LEFT, IN_LEFT, OUT_RIGHT, IN_RIGHT, & - OUT_BACK, IN_BACK, OUT_FRONT, IN_FRONT, OUT_BOTTOM, & - IN_BOTTOM, OUT_TOP, IN_TOP /) - end if - filt % current = .true. - - ! Set ID - call openmc_get_filter_next_id(filter_id) - err = openmc_filter_set_id(i_filt_end, filter_id) - end select - - ! Copy filter indices to resized array - n_filter = size(t % filter) - allocate(temp_filter(n_filter + 1)) - temp_filter(1:size(t % filter)) = t % filter - n_filter = n_filter + 1 - - ! Set mesh and surface filters - temp_filter(t % find_filter(FILTER_MESH)) = i_filt_start - temp_filter(n_filter) = i_filt_end - - ! Set filters - err = openmc_tally_set_filters(i_start + i - 1, n_filter, temp_filter) - deallocate(temp_filter) - else - t % type = TALLY_MESH_CURRENT - t % score_bins(j) = SCORE_CURRENT end if case ('events') diff --git a/src/output.F90 b/src/output.F90 index ecfaa94d5c..b6809ca82f 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -932,188 +932,6 @@ contains end subroutine write_tallies -!=============================================================================== -! WRITE_SURFACE_CURRENT writes out surface current tallies over a mesh to the -! tallies.out file. -!=============================================================================== - - subroutine write_surface_current(t, unit_tally) - type(TallyObject), intent(in) :: t - integer, intent(in) :: unit_tally - - integer :: i ! mesh index - integer :: j ! loop index over tally filters - integer :: ijk(3) ! indices of mesh cells - integer :: n_dim ! number of mesh dimensions - integer :: n_cells ! number of mesh cells - integer :: l ! index for energy - integer :: i_filter_mesh ! index for mesh filter - integer :: i_filter_ein ! index for incoming energy filter - integer :: i_filter_surf ! index for surface filter - integer :: stride_surf ! stride for surface filter - integer :: n ! number of incoming energy bins - integer :: filter_index ! index in results array for filters - integer :: nr ! number of realizations - real(8) :: x(2) ! mean and standard deviation - logical :: print_ebin ! should incoming energy bin be displayed? - logical :: energy_filters ! energy filters present - character(MAX_LINE_LEN) :: string - type(RegularMesh), pointer :: m - type(TallyFilterMatch), allocatable :: matches(:) - - allocate(matches(n_filters)) - - nr = t % n_realizations - - ! Get pointer to mesh - i_filter_mesh = t % filter(t % find_filter(FILTER_MESH)) - select type(filt => filters(i_filter_mesh) % obj) - type is (MeshFilter) - m => meshes(filt % mesh) - end select - - ! Get surface filter index and stride - i_filter_surf = t % filter(t % find_filter(FILTER_SURFACE)) - stride_surf = t % stride(t % find_filter(FILTER_SURFACE)) - - ! initialize bins array - do j = 1, size(t % filter) - call matches(t % filter(j)) % bins % clear() - call matches(t % filter(j)) % bins % push_back(1) - end do - - ! determine how many energy in bins there are - energy_filters = (t % find_filter(FILTER_ENERGYIN) > 0) - if (energy_filters) then - print_ebin = .true. - i_filter_ein = t % filter(t % find_filter(FILTER_ENERGYIN)) - n = filters(i_filter_ein) % obj % n_bins - else - print_ebin = .false. - n = 1 - end if - - ! Get the dimensions and number of cells in the mesh - n_dim = m % n_dimension - n_cells = product(m % dimension) - - ! Loop over all the mesh cells - do i = 1, n_cells - - ! Get the indices for this cell - call m % get_indices_from_bin(i, ijk) - matches(i_filter_mesh) % bins % data(1) = i - - ! Write the header for this cell - if (n_dim == 1) then - string = "Mesh Index (" // trim(to_str(ijk(1))) // ")" - else if (n_dim == 2) then - string = "Mesh Index (" // trim(to_str(ijk(1))) // ", " & - // trim(to_str(ijk(2))) // ")" - else if (n_dim == 3) then - string = "Mesh Index (" // trim(to_str(ijk(1))) // ", " & - // trim(to_str(ijk(2))) // ", " // trim(to_str(ijk(3))) // ")" - end if - - write(UNIT=unit_tally, FMT='(1X,A)') trim(string) - - do l = 1, n - if (print_ebin) then - ! Set incoming energy bin - matches(i_filter_ein) % bins % data(1) = l - - ! Write incoming energy bin - write(UNIT=unit_tally, FMT='(3X,A)') & - trim(filters(i_filter_ein) % obj % text_label( & - matches(i_filter_ein) % bins % data(1))) - end if - - filter_index = 1 - do j = 1, size(t % filter) - if (t % filter(j) == i_filter_surf) cycle - filter_index = filter_index + (matches(t % filter(j)) & - % bins % data(1) - 1) * t % stride(j) - end do - - associate(r => t % results(RESULT_SUM:RESULT_SUM_SQ, :, :)) - - ! Left Surface - x(:) = mean_stdev(r(:, 1, filter_index + (OUT_LEFT - 1) * & - stride_surf), nr) - write(UNIT=unit_tally, FMT='(5X,A,T35,A,"+/- ",A)') & - "Outgoing Current on Left", to_str(x(1)), trim(to_str(x(2))) - - x(:) = mean_stdev(r(:, 1, filter_index + (IN_LEFT - 1) * & - stride_surf), nr) - write(UNIT=unit_tally, FMT='(5X,A,T35,A,"+/- ",A)') & - "Incoming Current on Left", to_str(x(1)), trim(to_str(x(2))) - - ! Right Surface - x(:) = mean_stdev(r(:, 1, filter_index + (OUT_RIGHT - 1) * & - stride_surf), nr) - write(UNIT=unit_tally, FMT='(5X,A,T35,A,"+/- ",A)') & - "Outgoing Current on Right", to_str(x(1)), trim(to_str(x(2))) - - x(:) = mean_stdev(r(:, 1, filter_index + (IN_RIGHT - 1) * & - stride_surf), nr) - write(UNIT=unit_tally, FMT='(5X,A,T35,A,"+/- ",A)') & - "Incoming Current on Right", to_str(x(1)), trim(to_str(x(2))) - - if (n_dim >= 2) then - - ! Back Surface - x(:) = mean_stdev(r(:, 1, filter_index + (OUT_BACK - 1) * & - stride_surf), nr) - write(UNIT=unit_tally, FMT='(5X,A,T35,A,"+/- ",A)') & - "Outgoing Current on Back", to_str(x(1)), trim(to_str(x(2))) - - x(:) = mean_stdev(r(:, 1, filter_index + (IN_BACK - 1) * & - stride_surf), nr) - write(UNIT=unit_tally, FMT='(5X,A,T35,A,"+/- ",A)') & - "Incoming Current on Back", to_str(x(1)), trim(to_str(x(2))) - - ! Front Surface - x(:) = mean_stdev(r(:, 1, filter_index + (OUT_FRONT - 1) * & - stride_surf), nr) - write(UNIT=unit_tally, FMT='(5X,A,T35,A,"+/- ",A)') & - "Outgoing Current on Front", to_str(x(1)), trim(to_str(x(2))) - - x(:) = mean_stdev(r(:, 1, filter_index + (IN_FRONT - 1) * & - stride_surf), nr) - write(UNIT=unit_tally, FMT='(5X,A,T35,A,"+/- ",A)') & - "Incoming Current on Front", to_str(x(1)), trim(to_str(x(2))) - end if - - if (n_dim == 3) then - - ! Bottom Surface - x(:) = mean_stdev(r(:, 1, filter_index + (OUT_BOTTOM - 1) * & - stride_surf), nr) - write(UNIT=unit_tally, FMT='(5X,A,T35,A,"+/- ",A)') & - "Outgoing Current on Bottom", to_str(x(1)), trim(to_str(x(2))) - - x(:) = mean_stdev(r(:, 1, filter_index + (IN_BOTTOM - 1) * & - stride_surf), nr) - write(UNIT=unit_tally, FMT='(5X,A,T35,A,"+/- ",A)') & - "Incoming Current on Bottom", to_str(x(1)), trim(to_str(x(2))) - - ! Top Surface - x(:) = mean_stdev(r(:, 1, filter_index + (OUT_TOP - 1) * & - stride_surf), nr) - write(UNIT=unit_tally, FMT='(5X,A,T35,A,"+/- ",A)') & - "Outgoing Current on Top", to_str(x(1)), trim(to_str(x(2))) - - x(:) = mean_stdev(r(:, 1, filter_index + (IN_TOP - 1) * & - stride_surf), nr) - write(UNIT=unit_tally, FMT='(5X,A,T35,A,"+/- ",A)') & - "Incoming Current on Top", to_str(x(1)), trim(to_str(x(2))) - end if - end associate - end do - end do - - end subroutine write_surface_current - !=============================================================================== ! MEAN_STDEV computes the sample mean and standard deviation of the mean of a ! single tally score diff --git a/src/tallies/tally.F90 b/src/tallies/tally.F90 index d112961397..058c414f22 100644 --- a/src/tallies/tally.F90 +++ b/src/tallies/tally.F90 @@ -4236,7 +4236,7 @@ contains elseif (t % estimator == ESTIMATOR_COLLISION) then call active_collision_tallies % push_back(i) end if - elseif (t % type == TALLY_MESH_CURRENT) then + elseif (t % type == TALLY_MESH_SURFACE) then call active_current_tallies % push_back(i) elseif (t % type == TALLY_SURFACE) then call active_surface_tallies % push_back(i) diff --git a/src/tallies/trigger.F90 b/src/tallies/trigger.F90 index ee2259ed48..7dcb3d71eb 100644 --- a/src/tallies/trigger.F90 +++ b/src/tallies/trigger.F90 @@ -168,7 +168,7 @@ contains trigger % variance = ZERO ! Mesh current tally triggers require special treatment - if (t % type == TALLY_MESH_CURRENT) then + if (t % type == TALLY_MESH_SURFACE) then call compute_tally_current(t, trigger) else diff --git a/tests/regression_tests/cmfd_feed/results_true.dat b/tests/regression_tests/cmfd_feed/results_true.dat index d5eed3d3c5..5e6750fe6b 100644 --- a/tests/regression_tests/cmfd_feed/results_true.dat +++ b/tests/regression_tests/cmfd_feed/results_true.dat @@ -364,822 +364,6 @@ tally 4: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 cmfd indices 1.000000E+01 1.000000E+00 diff --git a/tests/regression_tests/cmfd_nofeed/results_true.dat b/tests/regression_tests/cmfd_nofeed/results_true.dat index a3fbfb9549..f00966cf8f 100644 --- a/tests/regression_tests/cmfd_nofeed/results_true.dat +++ b/tests/regression_tests/cmfd_nofeed/results_true.dat @@ -364,822 +364,6 @@ tally 4: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 cmfd indices 1.000000E+01 1.000000E+00 From 206166cc41ac3de754d22584c9b03cacfc185419 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 15 Mar 2018 22:30:07 -0500 Subject: [PATCH 122/231] Remove redundant surface tally subroutine. Fix broken tests --- openmc/capi/filter.py | 8 + src/api.F90 | 3 +- src/relaxng/tallies.rnc | 16 +- src/relaxng/tallies.rng | 2 + src/tallies/tally.F90 | 142 +----------------- src/tallies/tally_header.F90 | 4 +- src/tracking.F90 | 24 +-- .../filter_mesh/inputs_true.dat | 15 +- .../filter_mesh/results_true.dat | 2 +- tests/regression_tests/filter_mesh/test.py | 9 +- .../score_current/results_true.dat | 2 +- .../score_current/tallies.xml | 2 +- 12 files changed, 63 insertions(+), 166 deletions(-) diff --git a/openmc/capi/filter.py b/openmc/capi/filter.py index 5a5df4814d..691ecc09cc 100644 --- a/openmc/capi/filter.py +++ b/openmc/capi/filter.py @@ -55,6 +55,9 @@ _dll.openmc_material_filter_set_bins.errcheck = _error_handler _dll.openmc_mesh_filter_set_mesh.argtypes = [c_int32, c_int32] _dll.openmc_mesh_filter_set_mesh.restype = c_int _dll.openmc_mesh_filter_set_mesh.errcheck = _error_handler +_dll.openmc_meshsurface_filter_set_mesh.argtypes = [c_int32, c_int32] +_dll.openmc_meshsurface_filter_set_mesh.restype = c_int +_dll.openmc_meshsurface_filter_set_mesh.errcheck = _error_handler class Filter(_FortranObjectWithID): @@ -188,6 +191,10 @@ class MeshFilter(Filter): filter_type = 'mesh' +class MeshSurfaceFilter(Filter): + filter_type = 'meshsurface' + + class MuFilter(Filter): filter_type = 'mu' @@ -216,6 +223,7 @@ _FILTER_TYPE_MAP = { 'energyfunction': EnergyFunctionFilter, 'material': MaterialFilter, 'mesh': MeshFilter, + 'meshsurface': MeshSurfaceFilter, 'mu': MuFilter, 'polar': PolarFilter, 'surface': SurfaceFilter, diff --git a/src/api.F90 b/src/api.F90 index 64324da3b1..df183c292f 100644 --- a/src/api.F90 +++ b/src/api.F90 @@ -276,8 +276,9 @@ contains ! Clear active tally lists call active_analog_tallies % clear() call active_tracklength_tallies % clear() - call active_current_tallies % clear() + call active_meshsurf_tallies % clear() call active_collision_tallies % clear() + call active_surface_tallies % clear() call active_tallies % clear() ! Reset timers diff --git a/src/relaxng/tallies.rnc b/src/relaxng/tallies.rnc index 5ab8971e6c..204284c480 100644 --- a/src/relaxng/tallies.rnc +++ b/src/relaxng/tallies.rnc @@ -35,14 +35,14 @@ element tallies { element filter { (element id { xsd:int } | attribute id { xsd:int }) & ( - ( (element type { ( "cell" | "cellfrom" | "cellborn" | "material" | - "universe" | "surface" | "distribcell" | "mesh" | "energy" | - "energyout" | "mu" | "polar" | "azimuthal" | "delayedgroup" | - "energyfunction") } | - attribute type { ( "cell" | "cellfrom" | "cellborn" | "material" | - "universe" | "surface" | "distribcell" | "mesh" | "energy" | - "energyout" | "mu" | "polar" | "azimuthal" | "delayedgroup" | - "energyfunction") }) & + ( (element type { ( "cell" | "cellfrom" | "cellborn" | "material" | + "universe" | "surface" | "distribcell" | "mesh" | "energy" | + "energyout" | "mu" | "polar" | "azimuthal" | "delayedgroup" | + "energyfunction" | "meshsurface") } | + attribute type { ( "cell" | "cellfrom" | "cellborn" | "material" | + "universe" | "surface" | "distribcell" | "mesh" | "energy" | + "energyout" | "mu" | "polar" | "azimuthal" | "delayedgroup" | + "energyfunction" | "meshsurface") }) & (element bins { list { xsd:double+ } } | attribute bins { list { xsd:double+ } }) ) | diff --git a/src/relaxng/tallies.rng b/src/relaxng/tallies.rng index bad2fdce91..15b6f5b249 100644 --- a/src/relaxng/tallies.rng +++ b/src/relaxng/tallies.rng @@ -182,6 +182,7 @@ azimuthal delayedgroup energyfunction + meshsurface @@ -201,6 +202,7 @@ azimuthal delayedgroup energyfunction + meshsurface diff --git a/src/tallies/tally.F90 b/src/tallies/tally.F90 index 058c414f22..f4d12be7e1 100644 --- a/src/tallies/tally.F90 +++ b/src/tallies/tally.F90 @@ -3064,9 +3064,9 @@ contains ! tally total or partial currents between two cells !=============================================================================== - subroutine score_surface_tally(p) - - type(Particle), intent(in) :: p + subroutine score_surface_tally(p, tally_vec) + type(Particle), intent(in) :: p + type(VectorInt), intent(in) :: tally_vec integer :: i integer :: i_tally @@ -3086,9 +3086,9 @@ contains ! No collision, so no weight change when survival biasing flux = p % wgt - TALLY_LOOP: do i = 1, active_surface_tallies % size() + TALLY_LOOP: do i = 1, tally_vec % size() ! Get index of tally and pointer to tally - i_tally = active_surface_tallies % data(i) + i_tally = tally_vec % data(i) associate (t => tallies(i_tally) % obj) ! Find all valid bins in each filter if they have not already been found @@ -3188,134 +3188,6 @@ contains end subroutine score_surface_tally -!=============================================================================== -! SCORE_SURFACE_CURRENT tallies surface crossings in a mesh tally by manually -! determining which mesh surfaces were crossed -!=============================================================================== - - subroutine score_surface_current(p) - - type(Particle), intent(in) :: p - - integer :: i - integer :: i_tally - integer :: i_filt - integer :: i_bin - integer :: q ! loop index for scoring bins - integer :: k ! working index for expand and score - integer :: score_bin ! scoring bin, e.g. SCORE_FLUX - integer :: score_index ! scoring bin index - integer :: j ! loop index for scoring bins - integer :: filter_index ! single index for single bin - real(8) :: flux ! collision estimate of flux - real(8) :: filter_weight ! combined weight of all filters - real(8) :: score ! analog tally score - logical :: finished ! found all valid bin combinations - - ! No collision, so no weight change when survival biasing - flux = p % wgt - - TALLY_LOOP: do i = 1, active_current_tallies % size() - ! Get index of tally and pointer to tally - i_tally = active_current_tallies % data(i) - associate (t => tallies(i_tally) % obj) - - ! Find all valid bins in each filter if they have not already been found - ! for a previous tally. - do j = 1, size(t % filter) - i_filt = t % filter(j) - if (.not. filter_matches(i_filt) % bins_present) then - call filter_matches(i_filt) % bins % clear() - call filter_matches(i_filt) % weights % clear() - call filters(i_filt) % obj % get_all_bins(p, t % estimator, & - filter_matches(i_filt)) - filter_matches(i_filt) % bins_present = .true. - end if - ! If there are no valid bins for this filter, then there is nothing to - ! score and we can move on to the next tally. - if (filter_matches(i_filt) % bins % size() == 0) cycle TALLY_LOOP - - ! Set the index of the bin used in the first filter combination - filter_matches(i_filt) % i_bin = 1 - end do - - ! ======================================================================== - ! Loop until we've covered all valid bins on each of the filters. - - FILTER_LOOP: do - - ! Reset scoring index and weight - filter_index = 1 - filter_weight = ONE - - ! Determine scoring index and weight for this filter combination - do j = 1, size(t % filter) - i_filt = t % filter(j) - i_bin = filter_matches(i_filt) % i_bin - filter_index = filter_index + (filter_matches(i_filt) % bins % & - data(i_bin) - 1) * t % stride(j) - filter_weight = filter_weight * filter_matches(i_filt) % weights % & - data(i_bin) - end do - - ! Determine score - score = flux * filter_weight - - ! Currently only one score type - k = 0 - SCORE_LOOP: do q = 1, t % n_user_score_bins - k = k + 1 - - ! determine what type of score bin - score_bin = t % score_bins(q) - - ! determine scoring bin index, no offset from nuclide bins - score_index = q - - call expand_and_score(p, t, score_index, filter_index, score_bin, & - score, k) - end do SCORE_LOOP - - ! ====================================================================== - ! Filter logic - - ! Increment the filter bins, starting with the last filter to find the - ! next valid bin combination - finished = .true. - do j = size(t % filter), 1, -1 - i_filt = t % filter(j) - if (filter_matches(i_filt) % i_bin < filter_matches(i_filt) % & - bins % size()) then - filter_matches(i_filt) % i_bin = filter_matches(i_filt) % i_bin + 1 - finished = .false. - exit - else - filter_matches(i_filt) % i_bin = 1 - end if - end do - - ! Once we have finished all valid bins for each of the filters, exit - ! the loop. - if (finished) exit FILTER_LOOP - - end do FILTER_LOOP - - end associate - - ! If the user has specified that we can assume all tallies are spatially - ! separate, this implies that once a tally has been scored to, we needn't - ! check the others. This cuts down on overhead when there are many - ! tallies specified - - if (assume_separate) exit TALLY_LOOP - - end do TALLY_LOOP - - ! Reset filter matches flag - filter_matches(:) % bins_present = .false. - - end subroutine score_surface_current - !=============================================================================== ! APPLY_DERIVATIVE_TO_SCORE multiply the given score by its relative derivative !=============================================================================== @@ -4219,7 +4091,7 @@ contains call active_collision_tallies % clear() call active_tracklength_tallies % clear() call active_surface_tallies % clear() - call active_current_tallies % clear() + call active_meshsurf_tallies % clear() do i = 1, n_tallies associate (t => tallies(i) % obj) @@ -4237,7 +4109,7 @@ contains call active_collision_tallies % push_back(i) end if elseif (t % type == TALLY_MESH_SURFACE) then - call active_current_tallies % push_back(i) + call active_meshsurf_tallies % push_back(i) elseif (t % type == TALLY_SURFACE) then call active_surface_tallies % push_back(i) end if diff --git a/src/tallies/tally_header.F90 b/src/tallies/tally_header.F90 index 6266005c2c..0495ce14dc 100644 --- a/src/tallies/tally_header.F90 +++ b/src/tallies/tally_header.F90 @@ -144,7 +144,7 @@ module tally_header ! Active tally lists type(VectorInt), public :: active_analog_tallies type(VectorInt), public :: active_tracklength_tallies - type(VectorInt), public :: active_current_tallies + type(VectorInt), public :: active_meshsurf_tallies type(VectorInt), public :: active_collision_tallies type(VectorInt), public :: active_tallies type(VectorInt), public :: active_surface_tallies @@ -418,7 +418,7 @@ contains ! Deallocate tally node lists call active_analog_tallies % clear() call active_tracklength_tallies % clear() - call active_current_tallies % clear() + call active_meshsurf_tallies % clear() call active_collision_tallies % clear() call active_surface_tallies % clear() call active_tallies % clear() diff --git a/src/tracking.F90 b/src/tracking.F90 index f5839eb8e9..3fe6a065b7 100644 --- a/src/tracking.F90 +++ b/src/tracking.F90 @@ -19,9 +19,9 @@ module tracking use surface_header use tally_header use tally, only: score_analog_tally, score_tracklength_tally, & - score_collision_tally, score_surface_current, & - score_track_derivative, score_surface_tally, & - score_collision_derivative, zero_flux_derivs + score_collision_tally, score_surface_tally, & + score_track_derivative, zero_flux_derivs, & + score_collision_derivative use track_output, only: initialize_particle_track, write_particle_track, & add_particle_track, finalize_particle_track @@ -185,7 +185,8 @@ contains p % event = EVENT_SURFACE end if ! Score cell to cell partial currents - if(active_surface_tallies % size() > 0) call score_surface_tally(p) + if(active_surface_tallies % size() > 0) & + call score_surface_tally(p, active_surface_tallies) else ! ==================================================================== ! PARTICLE HAS COLLISION @@ -200,7 +201,8 @@ contains ! since the direction of the particle will change and we need to use the ! pre-collision direction to figure out what mesh surfaces were crossed - if (active_current_tallies % size() > 0) call score_surface_current(p) + if (active_meshsurf_tallies % size() > 0) & + call score_surface_tally(p, active_meshsurf_tallies) ! Clear surface component p % surface = NONE @@ -317,12 +319,12 @@ contains ! forward slightly so that if the mesh boundary is on the surface, it is ! still processed - if (active_current_tallies % size() > 0) then + if (active_meshsurf_tallies % size() > 0) then ! TODO: Find a better solution to score surface currents than ! physically moving the particle forward slightly p % coord(1) % xyz = p % coord(1) % xyz + TINY_BIT * p % coord(1) % uvw - call score_surface_current(p) + call score_surface_tally(p, active_meshsurf_tallies) end if ! Score to global leakage tally @@ -350,10 +352,10 @@ contains ! particle to change -- artificially move the particle slightly back in ! case the surface crossing is coincident with a mesh boundary - if (active_current_tallies % size() > 0) then + if (active_meshsurf_tallies % size() > 0) then xyz = p % coord(1) % xyz p % coord(1) % xyz = p % coord(1) % xyz - TINY_BIT * p % coord(1) % uvw - call score_surface_current(p) + call score_surface_tally(p, active_meshsurf_tallies) p % coord(1) % xyz = xyz end if @@ -407,10 +409,10 @@ contains ! Score surface currents since reflection causes the direction of the ! particle to change -- artificially move the particle slightly back in ! case the surface crossing is coincident with a mesh boundary - if (active_current_tallies % size() > 0) then + if (active_meshsurf_tallies % size() > 0) then xyz = p % coord(1) % xyz p % coord(1) % xyz = p % coord(1) % xyz - TINY_BIT * p % coord(1) % uvw - call score_surface_current(p) + call score_surface_tally(p, active_meshsurf_tallies) p % coord(1) % xyz = xyz end if diff --git a/tests/regression_tests/filter_mesh/inputs_true.dat b/tests/regression_tests/filter_mesh/inputs_true.dat index ca063b7ce9..511b298482 100644 --- a/tests/regression_tests/filter_mesh/inputs_true.dat +++ b/tests/regression_tests/filter_mesh/inputs_true.dat @@ -327,18 +327,27 @@ 1 + + 1 + 2 + + 2 + 3 + + 3 + 1 total - 1 + 4 current @@ -346,7 +355,7 @@ total - 2 + 5 current @@ -354,7 +363,7 @@ total - 3 + 6 current diff --git a/tests/regression_tests/filter_mesh/results_true.dat b/tests/regression_tests/filter_mesh/results_true.dat index ac3439da50..f331238b70 100644 --- a/tests/regression_tests/filter_mesh/results_true.dat +++ b/tests/regression_tests/filter_mesh/results_true.dat @@ -1 +1 @@ -804d161cb8eae506d3247a533d122f44a01d3cedd566b3c65c71a0b51326dd9b97f8bbf45af7304b500476f3f854d91b10ccad94122d15f23641b05b835fada6 \ No newline at end of file +46950c046648faaa5ff3cb7b4fdd03667ae3c6da96a7ed8121761291de452cf88481f53e967ed52407d77d90109ae24839967a22ae216531a0e1491f5051ea72 \ No newline at end of file diff --git a/tests/regression_tests/filter_mesh/test.py b/tests/regression_tests/filter_mesh/test.py index e0c6dd0f2f..8a7f7a6fca 100644 --- a/tests/regression_tests/filter_mesh/test.py +++ b/tests/regression_tests/filter_mesh/test.py @@ -30,6 +30,9 @@ class FilterMeshTestHarness(HashedPyAPITestHarness): mesh_1d_filter = openmc.MeshFilter(mesh_1d) mesh_2d_filter = openmc.MeshFilter(mesh_2d) mesh_3d_filter = openmc.MeshFilter(mesh_3d) + meshsurf_1d_filter = openmc.MeshSurfaceFilter(mesh_1d) + meshsurf_2d_filter = openmc.MeshSurfaceFilter(mesh_2d) + meshsurf_3d_filter = openmc.MeshSurfaceFilter(mesh_3d) # Initialized the tallies tally = openmc.Tally(name='tally 1') @@ -38,7 +41,7 @@ class FilterMeshTestHarness(HashedPyAPITestHarness): self._model.tallies.append(tally) tally = openmc.Tally(name='tally 2') - tally.filters = [mesh_1d_filter] + tally.filters = [meshsurf_1d_filter] tally.scores = ['current'] self._model.tallies.append(tally) @@ -48,7 +51,7 @@ class FilterMeshTestHarness(HashedPyAPITestHarness): self._model.tallies.append(tally) tally = openmc.Tally(name='tally 4') - tally.filters = [mesh_2d_filter] + tally.filters = [meshsurf_2d_filter] tally.scores = ['current'] self._model.tallies.append(tally) @@ -58,7 +61,7 @@ class FilterMeshTestHarness(HashedPyAPITestHarness): self._model.tallies.append(tally) tally = openmc.Tally(name='tally 6') - tally.filters = [mesh_3d_filter] + tally.filters = [meshsurf_3d_filter] tally.scores = ['current'] self._model.tallies.append(tally) diff --git a/tests/regression_tests/score_current/results_true.dat b/tests/regression_tests/score_current/results_true.dat index 75d61b7188..dedc473de9 100644 --- a/tests/regression_tests/score_current/results_true.dat +++ b/tests/regression_tests/score_current/results_true.dat @@ -1 +1 @@ -4675d5101f4f829369c39cb33d654430836b934ab07c165777ba6e214bdf3a698b8082f4f9bb9e78f1f0e495b30ea02cf9b3d14622c59915d818d678a1e5b7b1 \ No newline at end of file +138b312cdaa822c9b62f757b3259522004b679c4ed289a92798b29a6442c26d12c53256635be273f13e3703816ff50a1b9f52d79770eade01e482384ac0d389f \ No newline at end of file diff --git a/tests/regression_tests/score_current/tallies.xml b/tests/regression_tests/score_current/tallies.xml index 3b8f60adba..a381e4c2e2 100644 --- a/tests/regression_tests/score_current/tallies.xml +++ b/tests/regression_tests/score_current/tallies.xml @@ -9,7 +9,7 @@ - mesh + meshsurface 1 From 22429dd389b5e6a297473ebcbc0fa1114dff7ad1 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 16 Mar 2018 09:34:16 -0500 Subject: [PATCH 123/231] Implement MeshSurfaceFilter.get_pandas_dataframe. Fix surface/mesh filters --- openmc/filter.py | 164 ++++++++++++++++++++++++++++++++++++++-------- openmc/tallies.py | 2 +- 2 files changed, 136 insertions(+), 30 deletions(-) diff --git a/openmc/filter.py b/openmc/filter.py index d7b8267e96..7fa47cb4df 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -22,12 +22,14 @@ _FILTER_TYPES = ['universe', 'material', 'cell', 'cellborn', 'surface', 'mesh', 'energy', 'energyout', 'mu', 'polar', 'azimuthal', 'distribcell', 'delayedgroup', 'energyfunction', 'cellfrom'] -_CURRENT_NAMES = {1: 'x-min out', 2: 'x-min in', - 3: 'x-max out', 4: 'x-max in', - 5: 'y-min out', 6: 'y-min in', - 7: 'y-max out', 8: 'y-max in', - 9: 'z-min out', 10: 'z-min in', - 11: 'z-max out', 12: 'z-max in'} +_CURRENT_NAMES = OrderedDict([ + (1, 'x-min out'), (2, 'x-min in'), + (3, 'x-max out'), (4, 'x-max in'), + (5, 'y-min out'), (6, 'y-min in'), + (7, 'y-max out'), (8, 'y-max in'), + (9, 'z-min out'), (10, 'z-min in'), + (11, 'z-max out'), (12, 'z-max in') +]) class FilterMeta(ABCMeta): @@ -497,9 +499,9 @@ class CellFilter(WithIDFilter): Parameters ---------- - bins : openmc.Cell, Integral, or iterable thereof - The Cells to tally. Either openmc.Cell objects or their - Integral ID numbers can be used. + bins : openmc.Cell, int, or iterable thereof + The cells to tally. Either openmc.Cell objects or their ID numbers can + be used. filter_id : int Unique identifier for the filter @@ -565,21 +567,21 @@ class CellbornFilter(WithIDFilter): class SurfaceFilter(Filter): - """Bins particle currents on Mesh surfaces. + """Filters particles by surface crossing Parameters ---------- - bins : Iterable of Integral - Indices corresponding to which face of a mesh cell the current is - crossing. + bins : openmc.Surface, int, or iterable of Integral + The surfaces to tally over. Either openmc.Surface objects of their ID + numbers can be used. filter_id : int Unique identifier for the filter Attributes ---------- bins : Iterable of Integral - Indices corresponding to which face of a mesh cell the current is - crossing. + The surfaces to tally over. Either openmc.Surface objects of their ID + numbers can be used. id : int Unique identifier for the filter num_bins : Integral @@ -598,13 +600,6 @@ class SurfaceFilter(Filter): self._bins = bins - @property - def num_bins(self): - # Need to handle number of bins carefully -- for surface current - # tallies, the number of bins depends on the mesh, which we don't have a - # reference to in this filter - return self._num_bins - def get_pandas_dataframe(self, data_size, stride, **kwargs): """Builds a Pandas DataFrame for the Filter's bins. @@ -689,7 +684,6 @@ class MeshFilter(Filter): filter_id = int(group.name.split('/')[-1].lstrip('filter ')) out = cls(mesh_obj, filter_id=filter_id) - out._num_bins = group['n_bins'].value return out @@ -705,10 +699,7 @@ class MeshFilter(Filter): @property def num_bins(self): - try: - return self._num_bins - except AttributeError: - return reduce(operator.mul, self.mesh.dimension) + return reduce(operator.mul, self.mesh.dimension) def check_bins(self, bins): if not len(bins) == 1: @@ -802,7 +793,7 @@ class MeshFilter(Filter): filter_dict = {} # Append Mesh ID as outermost index of multi-index - mesh_key = 'mesh {0}'.format(self.mesh.id) + mesh_key = 'mesh {}'.format(self.mesh.id) # Find mesh dimensions - use 3D indices for simplicity n_dim = len(self.mesh.dimension) @@ -846,7 +837,122 @@ class MeshFilter(Filter): class MeshSurfaceFilter(MeshFilter): - pass + """Filter events by surface crossings on a regular, rectangular mesh. + + Parameters + ---------- + mesh : openmc.Mesh + The Mesh object that events will be tallied onto + filter_id : int + Unique identifier for the filter + + Attributes + ---------- + bins : Integral + The Mesh ID + mesh : openmc.Mesh + The Mesh object that events will be tallied onto + id : int + Unique identifier for the filter + num_bins : Integral + The number of filter bins + + """ + + @property + def num_bins(self): + n_dim = len(self.mesh.dimension) + return 4*n_dim*reduce(operator.mul, self.mesh.dimension) + + def get_bin_index(self, filter_bin): + raise NotImplementedError + + def get_bin(self, bin_index): + raise NotImplementedError + + def get_pandas_dataframe(self, data_size, stride, **kwargs): + """Builds a Pandas DataFrame for the Filter's bins. + + This method constructs a Pandas DataFrame object for the filter with + columns annotated by filter bin information. This is a helper method for + :meth:`Tally.get_pandas_dataframe`. + + Parameters + ---------- + data_size : int + The total number of bins in the tally corresponding to this filter + stride : int + Stride in memory for the filter + + Returns + ------- + pandas.DataFrame + A Pandas DataFrame with three columns describing the x,y,z mesh + cell indices corresponding to each filter bin. The number of rows + in the DataFrame is the same as the total number of bins in the + corresponding tally, with the filter bin appropriately tiled to map + to the corresponding tally bins. + + See also + -------- + Tally.get_pandas_dataframe(), CrossFilter.get_pandas_dataframe() + + """ + # Initialize Pandas DataFrame + df = pd.DataFrame() + + # Initialize dictionary to build Pandas Multi-index column + filter_dict = {} + + # Append Mesh ID as outermost index of multi-index + mesh_key = 'mesh {}'.format(self.mesh.id) + + # Find mesh dimensions - use 3D indices for simplicity + if len(self.mesh.dimension) == 3: + nx, ny, nz = self.mesh.dimension + elif len(self.mesh.dimension) == 2: + nx, ny = self.mesh.dimension + nz = 1 + else: + nx = self.mesh.dimension + ny = nz = 1 + + # Generate multi-index sub-column for x-axis + filter_bins = np.arange(1, nx + 1) + repeat_factor = 12 * stride + filter_bins = np.repeat(filter_bins, repeat_factor) + tile_factor = data_size // len(filter_bins) + filter_bins = np.tile(filter_bins, tile_factor) + filter_dict[(mesh_key, 'x')] = filter_bins + + # Generate multi-index sub-column for y-axis + filter_bins = np.arange(1, ny + 1) + repeat_factor = 12 * nx * stride + filter_bins = np.repeat(filter_bins, repeat_factor) + tile_factor = data_size // len(filter_bins) + filter_bins = np.tile(filter_bins, tile_factor) + filter_dict[(mesh_key, 'y')] = filter_bins + + # Generate multi-index sub-column for z-axis + filter_bins = np.arange(1, nz + 1) + repeat_factor = 12 * nx * ny * stride + filter_bins = np.repeat(filter_bins, repeat_factor) + tile_factor = data_size // len(filter_bins) + filter_bins = np.tile(filter_bins, tile_factor) + filter_dict[(mesh_key, 'z')] = filter_bins + + # Generate multi-index sub-column for surface + filter_bins = list(_CURRENT_NAMES.values()) + repeat_factor = stride + filter_bins = np.repeat(filter_bins, repeat_factor) + tile_factor = data_size // len(filter_bins) + filter_bins = np.tile(filter_bins, tile_factor) + filter_dict[(mesh_key, 'surf')] = filter_bins + + # Initialize a Pandas DataFrame from the mesh dictionary + df = pd.concat([df, pd.DataFrame(filter_dict)]) + + return df class RealFilter(Filter): diff --git a/openmc/tallies.py b/openmc/tallies.py index d8bc2136a1..6c055d1913 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -2738,7 +2738,7 @@ class Tally(IDManagerMixin): new_filter = filter_type(bins) # Set number of bins manually for mesh/distribcell filters - if filter_type in (openmc.DistribcellFilter, openmc.MeshFilter): + if filter_type is openmc.DistribcellFilter: new_filter._num_bins = find_filter._num_bins # Replace existing filter with new one From d393a74906d811e81f1700b8286dbb2b62e16e97 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 16 Mar 2018 14:38:37 -0500 Subject: [PATCH 124/231] Implement get_bin and get_bin_index for MeshSurfaceFilter --- docs/source/pythonapi/base.rst | 1 + openmc/filter.py | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/source/pythonapi/base.rst b/docs/source/pythonapi/base.rst index f1633f3f9d..070b5bd201 100644 --- a/docs/source/pythonapi/base.rst +++ b/docs/source/pythonapi/base.rst @@ -109,6 +109,7 @@ Constructing Tallies openmc.CellbornFilter openmc.SurfaceFilter openmc.MeshFilter + openmc.MeshSurfaceFilter openmc.EnergyFilter openmc.EnergyoutFilter openmc.MuFilter diff --git a/openmc/filter.py b/openmc/filter.py index 7fa47cb4df..26d81112f1 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -865,10 +865,25 @@ class MeshSurfaceFilter(MeshFilter): return 4*n_dim*reduce(operator.mul, self.mesh.dimension) def get_bin_index(self, filter_bin): - raise NotImplementedError + # Split bin into mesh/surface parts + *mesh_tuple, surf = filter_bin + + # Get index for mesh alone + mesh_index = super().get_bin_index(mesh_tuple) + + # Combine surface and mesh index + n_dim = len(self.mesh.dimension) + for surf_index, name in _CURRENT_NAMES.items(): + if surf == name: + return 4*n_dim*mesh_index + surf_index - 1 + else: + raise ValueError("'{}' is not a valid mesh surface.".format(surf)) def get_bin(self, bin_index): - raise NotImplementedError + n_dim = len(self.mesh.dimension) + mesh_index, surf_index = divmod(bin_index, 4*n_dim) + mesh_bin = super().get_bin(mesh_index) + return mesh_bin + (_CURRENT_NAMES[surf_index + 1],) def get_pandas_dataframe(self, data_size, stride, **kwargs): """Builds a Pandas DataFrame for the Filter's bins. From 0da649fd903f2902fe44de471ae2906dacfbf462 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 19 Mar 2018 18:12:59 -0500 Subject: [PATCH 125/231] Simplify use of _CURRENT_NAMES in filter.py --- examples/xml/pincell/tallies.xml | 2 +- openmc/filter.py | 81 +++++--------------------------- 2 files changed, 14 insertions(+), 69 deletions(-) diff --git a/examples/xml/pincell/tallies.xml b/examples/xml/pincell/tallies.xml index 0ae36eceda..7e1e0dafe4 100644 --- a/examples/xml/pincell/tallies.xml +++ b/examples/xml/pincell/tallies.xml @@ -8,7 +8,7 @@ - 1 + 2 diff --git a/openmc/filter.py b/openmc/filter.py index 26d81112f1..2a36a66e05 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -15,6 +15,7 @@ import openmc.checkvalue as cv from .cell import Cell from .material import Material from .mixin import IDManagerMixin +from .surface import Surface from .universe import Universe @@ -22,14 +23,11 @@ _FILTER_TYPES = ['universe', 'material', 'cell', 'cellborn', 'surface', 'mesh', 'energy', 'energyout', 'mu', 'polar', 'azimuthal', 'distribcell', 'delayedgroup', 'energyfunction', 'cellfrom'] -_CURRENT_NAMES = OrderedDict([ - (1, 'x-min out'), (2, 'x-min in'), - (3, 'x-max out'), (4, 'x-max in'), - (5, 'y-min out'), (6, 'y-min in'), - (7, 'y-max out'), (8, 'y-max in'), - (9, 'z-min out'), (10, 'z-min in'), - (11, 'z-max out'), (12, 'z-max in') -]) +_CURRENT_NAMES = ( + 'x-min out', 'x-min in', 'x-max out', 'x-max in', + 'y-min out', 'y-min in', 'y-max out', 'y-max in', + 'z-min out', 'z-min in', 'z-max out', 'z-max in' +) class FilterMeta(ABCMeta): @@ -566,7 +564,7 @@ class CellbornFilter(WithIDFilter): expected_type = Cell -class SurfaceFilter(Filter): +class SurfaceFilter(WithIDFilter): """Filters particles by surface crossing Parameters @@ -588,57 +586,7 @@ class SurfaceFilter(Filter): The number of filter bins """ - @Filter.bins.setter - def bins(self, bins): - # Format the bins as a 1D numpy array. - bins = np.atleast_1d(bins) - - # Check the bin values. - cv.check_iterable_type('filter bins', bins, Integral) - for edge in bins: - cv.check_greater_than('filter bin', edge, 0, equality=True) - - self._bins = bins - - def get_pandas_dataframe(self, data_size, stride, **kwargs): - """Builds a Pandas DataFrame for the Filter's bins. - - This method constructs a Pandas DataFrame object for the filter with - columns annotated by filter bin information. This is a helper method for - :meth:`Tally.get_pandas_dataframe`. - - Parameters - ---------- - data_size : int - The total number of bins in the tally corresponding to this filter - stride : int - Stride in memory for the filter - - Returns - ------- - pandas.DataFrame - A Pandas DataFrame with a column of strings describing which surface - the current is crossing and which direction it points. The number - of rows in the DataFrame is the same as the total number of bins in - the corresponding tally, with the filter bin appropriately tiled to - map to the corresponding tally bins. - - See also - -------- - Tally.get_pandas_dataframe(), CrossFilter.get_pandas_dataframe() - - """ - # Initialize Pandas DataFrame - df = pd.DataFrame() - - filter_bins = np.repeat(self.bins, stride) - tile_factor = data_size // len(filter_bins) - filter_bins = np.tile(filter_bins, tile_factor) - filter_bins = [_CURRENT_NAMES[x] for x in filter_bins] - df = pd.concat([df, pd.DataFrame( - {self.short_name.lower(): filter_bins})]) - - return df + expected_type = Surface class MeshFilter(Filter): @@ -873,9 +821,9 @@ class MeshSurfaceFilter(MeshFilter): # Combine surface and mesh index n_dim = len(self.mesh.dimension) - for surf_index, name in _CURRENT_NAMES.items(): + for surf_index, name in enumerate(_CURRENT_NAMES): if surf == name: - return 4*n_dim*mesh_index + surf_index - 1 + return 4*n_dim*mesh_index + surf_index else: raise ValueError("'{}' is not a valid mesh surface.".format(surf)) @@ -883,7 +831,7 @@ class MeshSurfaceFilter(MeshFilter): n_dim = len(self.mesh.dimension) mesh_index, surf_index = divmod(bin_index, 4*n_dim) mesh_bin = super().get_bin(mesh_index) - return mesh_bin + (_CURRENT_NAMES[surf_index + 1],) + return mesh_bin + (_CURRENT_NAMES[surf_index],) def get_pandas_dataframe(self, data_size, stride, **kwargs): """Builds a Pandas DataFrame for the Filter's bins. @@ -957,17 +905,14 @@ class MeshSurfaceFilter(MeshFilter): filter_dict[(mesh_key, 'z')] = filter_bins # Generate multi-index sub-column for surface - filter_bins = list(_CURRENT_NAMES.values()) repeat_factor = stride - filter_bins = np.repeat(filter_bins, repeat_factor) + filter_bins = np.repeat(_CURRENT_NAMES, repeat_factor) tile_factor = data_size // len(filter_bins) filter_bins = np.tile(filter_bins, tile_factor) filter_dict[(mesh_key, 'surf')] = filter_bins # Initialize a Pandas DataFrame from the mesh dictionary - df = pd.concat([df, pd.DataFrame(filter_dict)]) - - return df + return pd.concat([df, pd.DataFrame(filter_dict)]) class RealFilter(Filter): From e1da965f707cbb66c1b099ce68d3a18c206ee0d1 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 20 Mar 2018 14:15:56 -0500 Subject: [PATCH 126/231] Fix typos (thanks @smharper) --- openmc/filter.py | 4 ++-- src/input_xml.F90 | 4 +--- src/tallies/tally_filter_meshsurface.F90 | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/openmc/filter.py b/openmc/filter.py index 2a36a66e05..c1b9f8dc92 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -570,7 +570,7 @@ class SurfaceFilter(WithIDFilter): Parameters ---------- bins : openmc.Surface, int, or iterable of Integral - The surfaces to tally over. Either openmc.Surface objects of their ID + The surfaces to tally over. Either openmc.Surface objects or their ID numbers can be used. filter_id : int Unique identifier for the filter @@ -578,7 +578,7 @@ class SurfaceFilter(WithIDFilter): Attributes ---------- bins : Iterable of Integral - The surfaces to tally over. Either openmc.Surface objects of their ID + The surfaces to tally over. Either openmc.Surface objects or their ID numbers can be used. id : int Unique identifier for the filter diff --git a/src/input_xml.F90 b/src/input_xml.F90 index a0b077a940..a29bb08e83 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -2371,9 +2371,7 @@ contains ! Allocate according to the filter type err = openmc_filter_set_type(i_start + i - 1, to_c_string(temp_str)) - if (err /= 0) then - call fatal_error(to_f_string(openmc_err_msg)) - end if + if (err /= 0) call fatal_error(to_f_string(openmc_err_msg)) ! Read filter data from XML call f % obj % from_xml(node_filt) diff --git a/src/tallies/tally_filter_meshsurface.F90 b/src/tallies/tally_filter_meshsurface.F90 index 1913c8b0de..e1e8c48033 100644 --- a/src/tallies/tally_filter_meshsurface.F90 +++ b/src/tallies/tally_filter_meshsurface.F90 @@ -48,7 +48,7 @@ contains n = node_word_count(node, "bins") if (n /= 1) call fatal_error("Only one mesh can be & - &specified per mesh filter.") + &specified per meshsurface filter.") ! Determine id of mesh call get_node_value(node, "bins", id) @@ -297,7 +297,7 @@ contains !=============================================================================== function openmc_meshsurface_filter_set_mesh(index, index_mesh) result(err) bind(C) - ! Set the mesh for a mesh filter + ! Set the mesh for a mesh surface filter integer(C_INT32_T), value, intent(in) :: index integer(C_INT32_T), value, intent(in) :: index_mesh integer(C_INT) :: err From 109236710a9a90ecfbe3a8e5dedbc83bb0b1b1e1 Mon Sep 17 00:00:00 2001 From: guillaume Date: Sat, 24 Mar 2018 14:51:24 -0400 Subject: [PATCH 127/231] added python example for depletion --- .../python/pincell_depletion/chain_simple.xml | 49 ++++++ .../python/pincell_depletion/run_depletion.py | 161 ++++++++++++++++++ 2 files changed, 210 insertions(+) create mode 100644 examples/python/pincell_depletion/chain_simple.xml create mode 100644 examples/python/pincell_depletion/run_depletion.py diff --git a/examples/python/pincell_depletion/chain_simple.xml b/examples/python/pincell_depletion/chain_simple.xml new file mode 100644 index 0000000000..c2e50a370f --- /dev/null +++ b/examples/python/pincell_depletion/chain_simple.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + 2.53000e-02 + + Gd157 Gd156 I135 Xe135 Xe136 Cs135 + 1.093250e-04 2.087260e-04 2.780820e-02 6.759540e-03 2.392300e-02 4.356330e-05 + + + + + + + 2.53000e-02 + + Gd157 Gd156 I135 Xe135 Xe136 Cs135 + 6.142710e-5 1.483250e-04 0.0292737 0.002566345 0.0219242 4.9097e-6 + + + + + + + 2.53000e-02 + + Gd157 Gd156 I135 Xe135 Xe136 Cs135 + 4.141120e-04 7.605360e-04 0.0135457 0.00026864 0.0024432 3.7100E-07 + + + + diff --git a/examples/python/pincell_depletion/run_depletion.py b/examples/python/pincell_depletion/run_depletion.py new file mode 100644 index 0000000000..0ee2a411f5 --- /dev/null +++ b/examples/python/pincell_depletion/run_depletion.py @@ -0,0 +1,161 @@ +import openmc +import numpy as np + +############################################################################### +# Simulation Input File Parameters +############################################################################### + +# OpenMC simulation parameters +batches = 100 +inactive = 10 +particles = 1000 + +# Depletion simulation parameters +time_step = 1.*24*60*60 # s +final_time = 45.*24*60*60 # s +time_steps = np.full(np.int(final_time / time_step), time_step) + +chain_file = './chain_simple.xml' +power = 174.1 # W/cm, for 2D simulations only + +############################################################################### +# Define materials +############################################################################### + +# Instantiate some Materials and register the appropriate Nuclides +uo2 = openmc.Material(material_id=1, name='UO2 fuel at 2.4% wt enrichment') +uo2.set_density('g/cm3', 10.29769) +uo2.add_element('U', 1., enrichment=2.4) +uo2.add_element('O', 2.) +uo2.depletable = True + +helium = openmc.Material(material_id=2, name='Helium for gap') +helium.set_density('g/cm3', 0.001598) +helium.add_element('He', 2.4044e-4) +helium.depletable = False + +zircaloy = openmc.Material(material_id=3, name='Zircaloy 4') +zircaloy.set_density('g/cm3', 6.55) +zircaloy.add_element('Sn', 0.014 , 'wo') +zircaloy.add_element('Fe', 0.00165, 'wo') +zircaloy.add_element('Cr', 0.001 , 'wo') +zircaloy.add_element('Zr', 0.98335, 'wo') +zircaloy.depletable = False + +borated_water = openmc.Material(material_id=4, name='Borated water') +borated_water.set_density('g/cm3', 0.740582) +borated_water.add_element('B', 4.0e-5) +borated_water.add_element('H', 5.0e-2) +borated_water.add_element('O', 2.4e-2) +borated_water.add_s_alpha_beta('c_H_in_H2O') +borated_water.depletable = False + +############################################################################### +# Exporting to OpenMC geometry.xml file +############################################################################### + +# Instantiate ZCylinder surfaces +fuel_or = openmc.ZCylinder(surface_id=1, x0=0, y0=0, R=0.39218, name='Fuel OR') +clad_ir = openmc.ZCylinder(surface_id=2, x0=0, y0=0, R=0.40005, name='Clad IR') +clad_or = openmc.ZCylinder(surface_id=3, x0=0, y0=0, R=0.45720, name='Clad OR') +left = openmc.XPlane(surface_id=4, x0=-0.62992, name='left') +right = openmc.XPlane(surface_id=5, x0=0.62992, name='right') +bottom = openmc.YPlane(surface_id=6, y0=-0.62992, name='bottom') +top = openmc.YPlane(surface_id=7, y0=0.62992, name='top') + +left.boundary_type = 'reflective' +right.boundary_type = 'reflective' +top.boundary_type = 'reflective' +bottom.boundary_type = 'reflective' + +# Instantiate Cells +fuel = openmc.Cell(cell_id=1, name='cell 1') +gap = openmc.Cell(cell_id=2, name='cell 2') +clad = openmc.Cell(cell_id=3, name='cell 3') +water = openmc.Cell(cell_id=4, name='cell 4') + +# Use surface half-spaces to define regions +fuel.region = -fuel_or +gap.region = +fuel_or & -clad_ir +clad.region = +clad_ir & -clad_or +water.region = +clad_or & +left & -right & +bottom & -top + +# Register Materials with Cells +fuel.fill = uo2 +gap.fill = helium +clad.fill = zircaloy +water.fill = borated_water + +# Instantiate Universe +root = openmc.Universe(universe_id=0, name='root universe') + +# Register Cells with Universe +root.add_cells([fuel, gap, clad, water]) + +# Instantiate a Geometry, register the root Universe, and export to XML +geometry = openmc.Geometry(root) +geometry.export_to_xml() + +############################################################################### +# Exporting to OpenMC materials.xml file +############################################################################### + +# Compute cell areas +area = {} +area[fuel] = np.pi * fuel_or.coefficients['R'] ** 2 + +# Set materials volume for depletion. Set to an area for 2D simulations +uo2.volume = area[fuel] + +# Instantiate a Materials collection and export to XML +materials_file = openmc.Materials([uo2, helium, zircaloy, borated_water]) +materials_file.export_to_xml() + +############################################################################### +# Exporting to OpenMC settings.xml file +############################################################################### + +# Instantiate a Settings object, set all runtime parameters, and export to XML +settings_file = openmc.Settings() +settings_file.batches = batches +settings_file.inactive = inactive +settings_file.particles = particles + +# Create an initial uniform spatial source distribution over fissionable zones +bounds = [-0.62992, -0.62992, -1, 0.62992, 0.62992, 1] +uniform_dist = openmc.stats.Box(bounds[:3], bounds[3:], only_fissionable=True) +settings_file.source = openmc.source.Source(space=uniform_dist) + +entropy_mesh = openmc.Mesh() +entropy_mesh.lower_left = [-0.39218, -0.39218, -1.e50] +entropy_mesh.upper_right = [0.39218, 0.39218, 1.e50] +entropy_mesh.dimension = [10, 10, 1] +settings_file.entropy_mesh = entropy_mesh +settings_file.export_to_xml() + +############################################################################### +# Run depletion calculation +############################################################################### + +op = openmc.deplete.Operator(geometry, settings_file, chain_file) +op.round_number = True + +# Perform simulation using the predictor algorithm +openmc.deplete.integrator.predictor(op, time_steps, power) + +############################################################################### +# Read depletion calculation results +############################################################################### + +# Open results file +results = openmc.deplete.ResultsList("depletion_results.h5") + +# Dictionnary of materials and burned nuclides +mat_id_to_ind = results[0].mat_to_ind +nuc_to_ind = results[0].nuc_to_ind + +# Obtain K_eff as a function of time +time, keff = results.get_eigenvalue() + +# Obtain U235 concentration as a function of time +time, U5 = results.get_atoms(mat_id_to_ind['1'], nuc_to_ind['U235']) From 53da3af815aaf3c49fac9dc90fa422a06b602fbb Mon Sep 17 00:00:00 2001 From: guillaume Date: Sat, 24 Mar 2018 15:02:30 -0400 Subject: [PATCH 128/231] small adjustments --- examples/python/pincell_depletion/run_depletion.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/python/pincell_depletion/run_depletion.py b/examples/python/pincell_depletion/run_depletion.py index 0ee2a411f5..9d81812fed 100644 --- a/examples/python/pincell_depletion/run_depletion.py +++ b/examples/python/pincell_depletion/run_depletion.py @@ -12,11 +12,11 @@ particles = 1000 # Depletion simulation parameters time_step = 1.*24*60*60 # s -final_time = 45.*24*60*60 # s +final_time = 15.*24*60*60 # s time_steps = np.full(np.int(final_time / time_step), time_step) chain_file = './chain_simple.xml' -power = 174.1 # W/cm, for 2D simulations only +power = 174 # W/cm, for 2D simulations only (use W for 3D) ############################################################################### # Define materials @@ -134,7 +134,7 @@ settings_file.entropy_mesh = entropy_mesh settings_file.export_to_xml() ############################################################################### -# Run depletion calculation +# Initialize and run depletion calculation ############################################################################### op = openmc.deplete.Operator(geometry, settings_file, chain_file) @@ -158,4 +158,4 @@ nuc_to_ind = results[0].nuc_to_ind time, keff = results.get_eigenvalue() # Obtain U235 concentration as a function of time -time, U5 = results.get_atoms(mat_id_to_ind['1'], nuc_to_ind['U235']) +time, n_U235 = results.get_atoms(mat_id_to_ind['1'], nuc_to_ind['U235']) From 1ee5e56c6ab0157caa22d5d1fe78454aace649db Mon Sep 17 00:00:00 2001 From: guillaume Date: Sat, 24 Mar 2018 15:56:59 -0400 Subject: [PATCH 129/231] added install information to documentation --- docs/source/usersguide/install.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/source/usersguide/install.rst b/docs/source/usersguide/install.rst index 24bcc7164d..5171eb4ecc 100644 --- a/docs/source/usersguide/install.rst +++ b/docs/source/usersguide/install.rst @@ -148,8 +148,8 @@ Prerequisites .. important:: 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. + ``--enable-fortran2003`` as well when configuring HDF5 or else OpenMC + will not be able to compile. .. admonition:: Optional :class: note @@ -416,7 +416,8 @@ 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. +distributions. To run simulations in parallel using MPI, it is recommended to +build mpi4py, hdf5, h5py from source, in that order, using the same compilers. .. admonition:: Required :class: error @@ -455,7 +456,7 @@ distributions. `mpi4py `_ 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. + simulations. `Cython `_ Cython is used for resonance reconstruction for ENDF data converted to From 627c10046789ff753eaa4f3000145597c29516bd Mon Sep 17 00:00:00 2001 From: guillaume Date: Sat, 24 Mar 2018 16:04:57 -0400 Subject: [PATCH 130/231] one more detail on installation --- docs/source/usersguide/install.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/usersguide/install.rst b/docs/source/usersguide/install.rst index 5171eb4ecc..6b24c64ddd 100644 --- a/docs/source/usersguide/install.rst +++ b/docs/source/usersguide/install.rst @@ -417,7 +417,8 @@ 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. To run simulations in parallel using MPI, it is recommended to -build mpi4py, hdf5, h5py from source, in that order, using the same compilers. +build mpi4py, hdf5, h5py from source, in that order, using the same compilers +as for openmc. .. admonition:: Required :class: error From 98b6dc15a94e6911e73c40fd3d0b9a9163aa4513 Mon Sep 17 00:00:00 2001 From: amandalund Date: Sun, 25 Mar 2018 13:47:47 -0500 Subject: [PATCH 131/231] Fix that ensures TRISO particles are completely contained within the domain --- openmc/model/triso.py | 95 +++++++++++++++++++++++++++---------------- 1 file changed, 59 insertions(+), 36 deletions(-) diff --git a/openmc/model/triso.py b/openmc/model/triso.py index 5fe51b6644..b5ee74f90b 100644 --- a/openmc/model/triso.py +++ b/openmc/model/triso.py @@ -113,8 +113,7 @@ class _Domain(metaclass=ABCMeta): Length in x-, y-, and z- directions of each cell in mesh overlaid on domain. limits : list of float - Minimum and maximum position in x-, y-, and z-directions where particle - center can be placed. + Constraint on where particle center can be placed. volume : float Volume of the container. @@ -158,8 +157,6 @@ class _Domain(metaclass=ABCMeta): raise ValueError('Unable to set domain center to {} since it must ' 'be of length 3'.format(center)) self._center = [float(x) for x in center] - self._limits = None - self._cell_length = None def mesh_cell(self, p): """Calculate the index of the cell in a mesh overlaid on the domain in @@ -211,6 +208,19 @@ class _Domain(metaclass=ABCMeta): """ pass + @abstractmethod + def enforce_boundary(self, particle): + """Update the position of the particle if necessary to ensure that the + particle remains entirely within the domain. + + Parameters + ---------- + particle : numpy.ndarray + Cartesian coordinates of particle center. + + """ + pass + class _CubicDomain(_Domain): """Cubic container in which to pack particles. @@ -238,7 +248,7 @@ class _CubicDomain(_Domain): Length in x-, y-, and z- directions of each cell in mesh overlaid on domain. limits : list of float - Minimum and maximum position in x-, y-, and z-directions where particle + Maximum distance from center in x-, y-, or z-direction where particle center can be placed. volume : float Volume of the container. @@ -256,9 +266,7 @@ class _CubicDomain(_Domain): @property def limits(self): if self._limits is None: - xlim = self.length/2 - self.particle_radius - self._limits = [[x - xlim for x in self.center], - [x + xlim for x in self.center]] + self._limits = [self.length/2 - self.particle_radius] return self._limits @property @@ -284,9 +292,14 @@ class _CubicDomain(_Domain): self._limits = limits def random_point(self): - return [uniform(self.limits[0][0], self.limits[1][0]), - uniform(self.limits[0][1], self.limits[1][1]), - uniform(self.limits[0][2], self.limits[1][2])] + x_max = self.limits[0] + return [uniform(-x_max, x_max), + uniform(-x_max, x_max), + uniform(-x_max, x_max)] + + def enforce_boundary(self, particle): + x_max = self.limits[0] + particle[:] = np.clip(particle, -x_max, x_max) class _CylindricalDomain(_Domain): @@ -317,8 +330,8 @@ class _CylindricalDomain(_Domain): Length in x-, y-, and z- directions of each cell in mesh overlaid on domain. limits : list of float - Minimum and maximum position in x-, y-, and z-directions where particle - center can be placed. + Maximum radial distance and maximum distance from center in z-direction + where particle center can be placed. volume : float Volume of the container. @@ -340,12 +353,8 @@ class _CylindricalDomain(_Domain): @property def limits(self): if self._limits is None: - xlim = self.length/2 - self.particle_radius - rlim = self.radius - self.particle_radius - self._limits = [[self.center[0] - rlim, self.center[1] - rlim, - self.center[2] - xlim], - [self.center[0] + rlim, self.center[1] + rlim, - self.center[2] + xlim]] + self._limits = [self.radius - self.particle_radius, + self.length/2 - self.particle_radius] return self._limits @property @@ -377,10 +386,20 @@ class _CylindricalDomain(_Domain): self._limits = limits def random_point(self): - r = sqrt(uniform(0, (self.radius - self.particle_radius)**2)) + r_max = self.limits[0] + z_max = self.limits[1] + r = sqrt(uniform(0, r_max**2)) t = uniform(0, 2*pi) - return [r*cos(t) + self.center[0], r*sin(t) + self.center[1], - uniform(self.limits[0][2], self.limits[1][2])] + return [r*cos(t), r*sin(t), uniform(-z_max, z_max)] + + def enforce_boundary(self, particle): + r_max = self.limits[0] + z_max = self.limits[1] + d = sqrt(particle[0]**2 + particle[1]**2) + if d > r_max: + particle[0] *= r_max / d + particle[1] *= r_max / d + particle[2] = np.clip(particle[2], -z_max, z_max) class _SphericalDomain(_Domain): @@ -407,8 +426,7 @@ class _SphericalDomain(_Domain): Length in x-, y-, and z- directions of each cell in mesh overlaid on domain. limits : list of float - Minimum and maximum position in x-, y-, and z-directions where particle - center can be placed. + Maximum radial distance where particle center can be placed. volume : float Volume of the container. @@ -425,9 +443,7 @@ class _SphericalDomain(_Domain): @property def limits(self): if self._limits is None: - rlim = self.radius - self.particle_radius - self._limits = [[x - rlim for x in self.center], - [x + rlim for x in self.center]] + self._limits = [self.radius - self.particle_radius] return self._limits @property @@ -453,10 +469,18 @@ class _SphericalDomain(_Domain): self._limits = limits def random_point(self): + r_max = self.limits[0] x = (gauss(0, 1), gauss(0, 1), gauss(0, 1)) - r = (uniform(0, (self.radius - self.particle_radius)**3)**(1/3) / - sqrt(x[0]**2 + x[1]**2 + x[2]**2)) - return [r*x[i] + self.center[i] for i in range(3)] + r = (uniform(0, r_max**3)**(1/3) / sqrt(x[0]**2 + x[1]**2 + x[2]**2)) + return [r*s for s in x] + + def enforce_boundary(self, particle): + r_max = self.limits[0] + d = sqrt(particle[0]**2 + particle[1]**2 + particle[2]**2) + if d > r_max: + particle[0] *= r_max / d + particle[1] *= r_max / d + particle[2] *= r_max / d def create_triso_lattice(trisos, lower_left, pitch, shape, background): @@ -767,9 +791,9 @@ def _close_random_pack(domain, particles, contraction_rate): particles[i] += r*v particles[j] -= r*v - # Apply reflective boundary conditions - particles[i] = particles[i].clip(domain.limits[0], domain.limits[1]) - particles[j] = particles[j].clip(domain.limits[0], domain.limits[1]) + # Apply boundary conditions + domain.enforce_boundary(particles[i]) + domain.enforce_boundary(particles[j]) update_mesh(i) update_mesh(j) @@ -1008,8 +1032,7 @@ def pack_trisos(radius, fill, domain_shape='cylinder', domain_length=None, # Recalculate the limits for the initial random sequential packing using # the desired final particle radius to ensure particles are fully contained # within the domain during the close random pack - domain.limits = [[x - initial_radius + radius for x in domain.limits[0]], - [x + initial_radius - radius for x in domain.limits[1]]] + domain.limits = [x + initial_radius - radius for x in domain.limits] # Generate non-overlapping particles for an initial inner radius using # random sequential packing algorithm @@ -1024,5 +1047,5 @@ def pack_trisos(radius, fill, domain_shape='cylinder', domain_length=None, trisos = [] for p in particles: - trisos.append(TRISO(radius, fill, p)) + trisos.append(TRISO(radius, fill, [x + c for x, c in zip(p, domain.center)])) return trisos From 00cb9149082e274dedacade9a0b171b467ab004c Mon Sep 17 00:00:00 2001 From: amandalund Date: Mon, 26 Mar 2018 17:14:26 -0500 Subject: [PATCH 132/231] Add unit tests for TRISO --- openmc/model/triso.py | 213 ++++++++++++++------------- tests/unit_tests/test_model_triso.py | 75 ++++++++++ 2 files changed, 187 insertions(+), 101 deletions(-) create mode 100644 tests/unit_tests/test_model_triso.py diff --git a/openmc/model/triso.py b/openmc/model/triso.py index b5ee74f90b..77488b891b 100644 --- a/openmc/model/triso.py +++ b/openmc/model/triso.py @@ -209,14 +209,21 @@ class _Domain(metaclass=ABCMeta): pass @abstractmethod - def enforce_boundary(self, particle): - """Update the position of the particle if necessary to ensure that the - particle remains entirely within the domain. + def repel_particles(self, p, q, d, d_new): + """Move particles p and q apart according to the following + transformation (accounting for boundary conditions on domain): + + r_i^(n+1) = r_i^(n) + 1/2(d_out^(n+1) - d^(n)) + r_j^(n+1) = r_j^(n) - 1/2(d_out^(n+1) - d^(n)) Parameters ---------- - particle : numpy.ndarray + p, q : numpy.ndarray Cartesian coordinates of particle center. + d : float + distance between centers of particles i and j. + d_new : float + final distance between centers of particles i and j. """ pass @@ -297,9 +304,20 @@ class _CubicDomain(_Domain): uniform(-x_max, x_max), uniform(-x_max, x_max)] - def enforce_boundary(self, particle): + def repel_particles(self, p, q, d, d_new): + # Moving each particle distance 'r' away from the other along the line + # joining the particle centers will ensure their final distance is + # equal to the outer diameter + r = (d_new - d)/2 + + v = (p - q)/d + p += r*v + q -= r*v + + # Apply boundary conditions x_max = self.limits[0] - particle[:] = np.clip(particle, -x_max, x_max) + p[:] = np.clip(p, -x_max, x_max) + q[:] = np.clip(q, -x_max, x_max) class _CylindricalDomain(_Domain): @@ -392,14 +410,29 @@ class _CylindricalDomain(_Domain): t = uniform(0, 2*pi) return [r*cos(t), r*sin(t), uniform(-z_max, z_max)] - def enforce_boundary(self, particle): + def repel_particles(self, p, q, d, d_new): + # Moving each particle distance 'r' away from the other along the line + # joining the particle centers will ensure their final distance is + # equal to the outer diameter + r = (d_new - d)/2 + + v = (p - q)/d + p += r*v + q -= r*v + + # Apply boundary conditions r_max = self.limits[0] z_max = self.limits[1] - d = sqrt(particle[0]**2 + particle[1]**2) + + d = sqrt(p[0]**2 + p[1]**2) if d > r_max: - particle[0] *= r_max / d - particle[1] *= r_max / d - particle[2] = np.clip(particle[2], -z_max, z_max) + p[0:2] *= r_max/d + p[2] = np.clip(p[2], -z_max, z_max) + + d = sqrt(q[0]**2 + q[1]**2) + if d > r_max: + q[0:2] *= r_max/d + q[2] = np.clip(q[2], -z_max, z_max) class _SphericalDomain(_Domain): @@ -474,13 +507,26 @@ class _SphericalDomain(_Domain): r = (uniform(0, r_max**3)**(1/3) / sqrt(x[0]**2 + x[1]**2 + x[2]**2)) return [r*s for s in x] - def enforce_boundary(self, particle): + def repel_particles(self, p, q, d, d_new): + # Moving each particle distance 'r' away from the other along the line + # joining the particle centers will ensure their final distance is + # equal to the outer diameter + r = (d_new - d)/2 + + v = (p - q)/d + p += r*v + q -= r*v + + # Apply boundary conditions r_max = self.limits[0] - d = sqrt(particle[0]**2 + particle[1]**2 + particle[2]**2) + + d = sqrt(p[0]**2 + p[1]**2 + p[2]**2) if d > r_max: - particle[0] *= r_max / d - particle[1] *= r_max / d - particle[2] *= r_max / d + p *= r_max/d + + d = sqrt(q[0]**2 + q[1]**2 + q[2]**2) + if d > r_max: + q *= r_max/d def create_triso_lattice(trisos, lower_left, pitch, shape, background): @@ -711,13 +757,8 @@ def _close_random_pack(domain, particles, contraction_rate): for d, i, j in r: add_rod(d, i, j) - # Inner diameter is set initially to the shortest center-to-center - # distance between any two particles - if rods: - inner_diameter[0] = rods[0][0] - - def update_mesh(i): - """Update which mesh cells the particle is in based on new particle + def update_mesh(indices): + """Update which mesh cells the particles are in based on new particle center coordinates. 'mesh'/'mesh_map' is a two way dictionary used to look up which @@ -727,22 +768,23 @@ def _close_random_pack(domain, particles, contraction_rate): Parameters ---------- - i : int - Index of particle in particles array. + indices : List of int + Indices of particles in particles array. """ - # Determine which mesh cells the particle is in and remove the - # particle id from those cells - for idx in mesh_map[i]: - mesh[idx].remove(i) - del mesh_map[i] + for i in indices: + # Determine which mesh cells the particle is in and remove the + # particle id from those cells + for idx in mesh_map[i]: + mesh[idx].remove(i) + del mesh_map[i] - # Determine which mesh cells are within one diameter of particle's - # center and add this particle to the list of particles in those cells - for idx in domain.nearby_mesh_cells(particles[i]): - mesh[idx].add(i) - mesh_map[i].add(idx) + # Determine which mesh cells are within one diameter of particle's + # center and add this particle to the list of particles in those cells + for idx in domain.nearby_mesh_cells(particles[i]): + mesh[idx].add(i) + mesh_map[i].add(idx) def reduce_outer_diameter(): """Reduce the outer diameter so that at the (i+1)-st iteration it is: @@ -753,50 +795,19 @@ def _close_random_pack(domain, particles, contraction_rate): j = floor(-log10(pf_out - pf_in)). + Returns + ------- + float + New outer diameter + """ - inner_pf = (4/3 * pi * (inner_diameter[0]/2)**3 * n_particles / - domain.volume) - outer_pf = (4/3 * pi * (outer_diameter[0]/2)**3 * n_particles / - domain.volume) + inner_pf = 4/3*pi*(inner_diameter/2)**3*n_particles/domain.volume + outer_pf = 4/3*pi*(outer_diameter/2)**3*n_particles/domain.volume j = floor(-log10(outer_pf - inner_pf)) - outer_diameter[0] = (outer_diameter[0] - 0.5**j * contraction_rate * - initial_outer_diameter / n_particles) - - - def repel_particles(i, j, d): - """Move particles p and q apart according to the following - transformation (accounting for reflective boundary conditions on - domain): - - r_i^(n+1) = r_i^(n) + 1/2(d_out^(n+1) - d^(n)) - r_j^(n+1) = r_j^(n) - 1/2(d_out^(n+1) - d^(n)) - - Parameters - ---------- - i, j : int - Index of particles in particles array. - d : float - distance between centers of particles i and j. - - """ - - # Moving each particle distance 'r' away from the other along the line - # joining the particle centers will ensure their final distance is equal - # to the outer diameter - r = (outer_diameter[0] - d)/2 - - v = (particles[i] - particles[j])/d - particles[i] += r*v - particles[j] -= r*v - - # Apply boundary conditions - domain.enforce_boundary(particles[i]) - domain.enforce_boundary(particles[j]) - - update_mesh(i) - update_mesh(j) + return (outer_diameter - 0.5**j * contraction_rate * + initial_outer_diameter / n_particles) def nearest(i): """Find index of nearest neighbor of particle i. @@ -827,33 +838,25 @@ def _close_random_pack(domain, particles, contraction_rate): else: return None, None - def update_rod_list(i, j): - """Update the rod list with the new nearest neighbors of particles i - and j since their overlap was eliminated. + def update_rod_list(indices): + """Update the rod list with the new nearest neighbors of particles in + list since their overlap was eliminated. Parameters ---------- - i, j : int - Index of particles in particles array. + indices : List of int + Indices of particles in particles array. """ # If the nearest neighbor k of particle i has no nearer neighbors, # remove the rod currently containing k from the rod list and add rod # k-i, keeping the rod list sorted - k, d_ik = nearest(i) - if k and nearest(k)[0] == i: - remove_rod(k) - add_rod(d_ik, i, k) - l, d_jl = nearest(j) - if l and nearest(l)[0] == j: - remove_rod(l) - add_rod(d_jl, j, l) - - # Set inner diameter to the shortest distance between two particle - # centers - if rods: - inner_diameter[0] = rods[0][0] + for i in indices: + k, d_ik = nearest(i) + if k and nearest(k)[0] == i: + remove_rod(k) + add_rod(d_ik, i, k) n_particles = len(particles) diameter = 2*domain.particle_radius @@ -865,8 +868,8 @@ def _close_random_pack(domain, particles, contraction_rate): initial_outer_diameter = 2*(domain.volume/(n_particles*4/3*pi))**(1/3) # Inner and outer diameter of particles will change during packing - outer_diameter = [initial_outer_diameter] - inner_diameter = [0] + outer_diameter = initial_outer_diameter + inner_diameter = 0. rods = [] rods_map = {} @@ -880,14 +883,22 @@ def _close_random_pack(domain, particles, contraction_rate): while True: create_rod_list() - if inner_diameter[0] >= diameter: + if rods: + # Set inner diameter to the shortest center-to-center distance + # between any two particles + inner_diameter = rods[0][0] + if inner_diameter >= diameter: break while True: d, i, j = pop_rod() - reduce_outer_diameter() - repel_particles(i, j, d) - update_rod_list(i, j) - if inner_diameter[0] >= diameter or not rods: + outer_diameter = reduce_outer_diameter() + domain.repel_particles(particles[i], particles[j], d, outer_diameter) + update_mesh([i, j]) + update_rod_list([i, j]) + if not rods: + break + inner_diameter = rods[0][0] + if inner_diameter >= diameter: break @@ -957,7 +968,7 @@ def pack_trisos(radius, fill, domain_shape='cylinder', domain_length=None, to speed up the nearest neighbor search by only searching for a particle's neighbors within that mesh cell. - In CRP, each particle is assigned two diameters, and inner and an outer, + In CRP, each particle is assigned two diameters, an inner and an outer, which approach each other during the simulation. The inner diameter, defined as the minimum center-to-center distance, is the true diameter of the particles and defines the pf. At each iteration the worst overlap diff --git a/tests/unit_tests/test_model_triso.py b/tests/unit_tests/test_model_triso.py new file mode 100644 index 0000000000..c6f717d0b2 --- /dev/null +++ b/tests/unit_tests/test_model_triso.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python + +from math import pi + +import numpy as np +from numpy.linalg import norm +import openmc +import openmc.model +import pytest +import scipy.spatial + + +_PACKING_FRACTION = 0.35 +_RADIUS = 1. +_PARAMS = [{'shape' : 'cube', 'length' : 20., 'radius' : 0.}, + {'shape' : 'cylinder', 'length' : 10., 'radius' : 10.}, + {'shape' : 'sphere', 'length' : 0., 'radius' : 10.}] + + +@pytest.fixture(scope='module', params=_PARAMS) +def domain(request): + return request.param + + +@pytest.fixture(scope='module') +def trisos(domain): + return openmc.model.pack_trisos( + radius=_RADIUS, + fill=openmc.Universe(), + domain_shape=domain['shape'], + domain_length=domain['length'], + domain_radius=domain['radius'], + domain_center=[0., 0., 0.], + initial_packing_fraction=0.2, + packing_fraction=_PACKING_FRACTION + ) + + +def test_overlap(trisos): + """Check that no TRISO particles overlap.""" + tree = scipy.spatial.cKDTree([t.center for t in trisos]) + r = min(tree.query([t.center for t in trisos], k=2)[0][:,1])/2 + assert r > _RADIUS or r == pytest.approx(_RADIUS) + + +def test_contained(trisos, domain): + """Make sure all particles are entirely contained within the domain.""" + if domain['shape'] == 'cube': + x = 2*(max(np.hstack([abs(t.center) for t in trisos])) + _RADIUS) + assert x < domain['length'] or x == pytest.approx(domain['length']) + + elif domain['shape'] == 'cylinder': + r = max([norm(t.center[0:2]) for t in trisos]) + _RADIUS + z = 2*(max([abs(t.center[2]) for t in trisos]) + _RADIUS) + assert r < domain['radius'] or r == pytest.approx(domain['radius']) + assert z < domain['length'] or z == pytest.approx(domain['length']) + + elif domain['shape'] == 'sphere': + r = max([norm(t.center) for t in trisos]) + _RADIUS + assert r < domain['radius'] or r == pytest.approx(domain['radius']) + + +def test_packing_fraction(trisos, domain): + """Check that the actual PF is close to the requested PF.""" + if domain['shape'] == 'cube': + volume = domain['length']**3 + + elif domain['shape'] == 'cylinder': + volume = domain['length']*pi*domain['radius']**2 + + elif domain['shape'] == 'sphere': + volume = 4/3*pi*domain['radius']**3 + + pf = len(trisos)*4/3*pi*_RADIUS**3/volume + assert pf == pytest.approx(_PACKING_FRACTION, rel=1e-2) From 272d0a4b2be05277a9541099796c0f2af38804d9 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 5 Sep 2017 10:14:46 -0500 Subject: [PATCH 133/231] Implement Legendre expansion filter for change in scattering angle --- CMakeLists.txt | 1 + docs/source/pythonapi/base.rst | 1 + openmc/__init__.py | 1 + openmc/filter_legendre.py | 131 ++++++++++++++++++++++++++ src/constants.F90 | 5 +- src/tallies/tally_filter.F90 | 5 + src/tallies/tally_filter_legendre.F90 | 86 +++++++++++++++++ src/tallies/tally_header.F90 | 3 + 8 files changed, 231 insertions(+), 2 deletions(-) create mode 100644 openmc/filter_legendre.py create mode 100644 src/tallies/tally_filter_legendre.F90 diff --git a/CMakeLists.txt b/CMakeLists.txt index 9517fe2ec3..bb3575c9db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -420,6 +420,7 @@ set(LIBOPENMC_FORTRAN_SRC src/tallies/tally_filter_distribcell.F90 src/tallies/tally_filter_energy.F90 src/tallies/tally_filter_energyfunc.F90 + src/tallies/tally_filter_legendre.F90 src/tallies/tally_filter_material.F90 src/tallies/tally_filter_mesh.F90 src/tallies/tally_filter_meshsurface.F90 diff --git a/docs/source/pythonapi/base.rst b/docs/source/pythonapi/base.rst index 070b5bd201..84d2a39da3 100644 --- a/docs/source/pythonapi/base.rst +++ b/docs/source/pythonapi/base.rst @@ -118,6 +118,7 @@ Constructing Tallies openmc.DistribcellFilter openmc.DelayedGroupFilter openmc.EnergyFunctionFilter + openmc.LegendreFilter openmc.Mesh openmc.Trigger openmc.TallyDerivative diff --git a/openmc/__init__.py b/openmc/__init__.py index 9b13fa6927..243796a13f 100644 --- a/openmc/__init__.py +++ b/openmc/__init__.py @@ -15,6 +15,7 @@ from openmc.surface import * from openmc.universe import * from openmc.lattice import * from openmc.filter import * +from openmc.filter_legendre import * from openmc.trigger import * from openmc.tally_derivative import * from openmc.tallies import * diff --git a/openmc/filter_legendre.py b/openmc/filter_legendre.py new file mode 100644 index 0000000000..075fa02dbc --- /dev/null +++ b/openmc/filter_legendre.py @@ -0,0 +1,131 @@ +from numbers import Integral +from xml.etree import ElementTree as ET + +import numpy as np +import pandas as pd + +import openmc.checkvalue as cv +from . import Filter + + +class LegendreFilter(Filter): + r"""Score Legendre expansion moments up to specified order. + + This filter allows scores to be multiplied by Legendre polynomials of the + change in particle angle ($\mu$) up to a user-specified order. + + Parameters + ---------- + order : int + Maximum Legendre polynomial order + filter_id : int or None + Unique identifier for the filter + + Attributes + ---------- + order : int + Maximum Legendre polynomial order + id : int + Unique identifier for the filter + num_bins : int + The number of filter bins + + """ + + def __init__(self, order, filter_id=None): + self.order = order + self.id = filter_id + + def __hash__(self): + string = type(self).__name__ + '\n' + string += '{: <16}=\t{}\n'.format('\tOrder', self.order) + return hash(string) + + def __repr__(self): + string = type(self).__name__ + '\n' + string += '{: <16}=\t{}\n'.format('\tOrder', self.order) + string += '{: <16}=\t{}\n'.format('\tID', self.id) + return string + + @property + def order(self): + return self._order + + @order.setter + def order(self, order): + cv.check_type('Legendre order', order, Integral) + cv.check_greater_than('Legendre order', order, 0, equality=True) + self._order = order + + @property + def num_bins(self): + return self._order + 1 + + @classmethod + def from_hdf5(cls, group, **kwargs): + if group['type'].value.decode() != cls.short_name.lower(): + raise ValueError("Expected HDF5 data for filter type '" + + cls.short_name.lower() + "' but got '" + + group['type'].value.decode() + " instead") + + filter_id = int(group.name.split('/')[-1].lstrip('filter ')) + + out = cls(group['order'].value, filter_id) + + return out + + def get_pandas_dataframe(self, data_size, stride, **kwargs): + """Builds a Pandas DataFrame for the Filter's bins. + + This method constructs a Pandas DataFrame object for the filter with + columns annotated by filter bin information. This is a helper method for + :meth:`Tally.get_pandas_dataframe`. + + Parameters + ---------- + data_size : Integral + The total number of bins in the tally corresponding to this filter + stride : int + Stride in memory for the filter + + Returns + ------- + pandas.DataFrame + A Pandas DataFrame with a column that is filled with strings + indicating Legendre orders. The number of rows in the DataFrame is + the same as the total number of bins in the corresponding tally. + + See also + -------- + Tally.get_pandas_dataframe(), CrossFilter.get_pandas_dataframe() + + """ + # Initialize Pandas DataFrame + df = pd.DataFrame() + + bins = np.array(['P{}'.format(i) for i in range(self.order + 1)]) + filter_bins = np.repeat(bins, stride) + tile_factor = data_size // len(filter_bins) + filter_bins = np.tile(filter_bins, tile_factor) + df = pd.concat([df, pd.DataFrame( + {self.short_name.lower(): filter_bins})]) + + return df + + def to_xml_element(self): + """Return XML Element representing the filter. + + Returns + ------- + element : xml.etree.ElementTree.Element + XML element containing Legendre filter data + + """ + element = ET.Element('filter') + element.set('id', str(self.id)) + element.set('type', self.short_name.lower()) + + subelement = ET.SubElement(element, 'order') + subelement.text = str(self.order) + + return element diff --git a/src/constants.F90 b/src/constants.F90 index 0e138f0ee5..29b68ae1dc 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -358,7 +358,7 @@ module constants integer, parameter :: NO_BIN_FOUND = -1 ! Tally filter and map types - integer, parameter :: N_FILTER_TYPES = 16 + integer, parameter :: N_FILTER_TYPES = 17 integer, parameter :: & FILTER_UNIVERSE = 1, & FILTER_MATERIAL = 2, & @@ -375,7 +375,8 @@ module constants FILTER_DELAYEDGROUP = 13, & FILTER_ENERGYFUNCTION = 14, & FILTER_CELLFROM = 15, & - FILTER_MESHSURFACE = 16 + FILTER_MESHSURFACE = 16, & + FILTER_LEGENDRE = 17 ! Mesh types integer, parameter :: & diff --git a/src/tallies/tally_filter.F90 b/src/tallies/tally_filter.F90 index 3d6eaaef21..056fc198a8 100644 --- a/src/tallies/tally_filter.F90 +++ b/src/tallies/tally_filter.F90 @@ -17,6 +17,7 @@ module tally_filter use tally_filter_distribcell use tally_filter_energy use tally_filter_energyfunc + use tally_filter_legendre use tally_filter_material use tally_filter_mesh use tally_filter_meshsurface @@ -64,6 +65,8 @@ contains type_ = 'energyout' type is (EnergyFunctionFilter) type_ = 'energyfunction' + type is (LegendreFilter) + type_ = 'legendre' type is (MaterialFilter) type_ = 'material' type is (MeshFilter) @@ -135,6 +138,8 @@ contains allocate(EnergyoutFilter :: filters(index) % obj) case ('energyfunction') allocate(EnergyFunctionFilter :: filters(index) % obj) + case ('legendre') + allocate(LegendreFilter :: filters(index) % obj) case ('material') allocate(MaterialFilter :: filters(index) % obj) case ('mesh') diff --git a/src/tallies/tally_filter_legendre.F90 b/src/tallies/tally_filter_legendre.F90 new file mode 100644 index 0000000000..59fb57a72c --- /dev/null +++ b/src/tallies/tally_filter_legendre.F90 @@ -0,0 +1,86 @@ +module tally_filter_legendre + + use, intrinsic :: ISO_C_BINDING + + use hdf5, only: HID_T + + use constants + use error + use hdf5_interface + use math, only: calc_pn + use particle_header, only: Particle + use string, only: to_str + use tally_filter_header + use xml_interface + + implicit none + private + +!=============================================================================== +! LEGENDREFILTER gives Legendre moments of the change in scattering angle +!=============================================================================== + + type, public, extends(TallyFilter) :: LegendreFilter + integer :: order + contains + procedure :: from_xml + procedure :: get_all_bins + procedure :: to_statepoint + procedure :: text_label + end type LegendreFilter + +contains + +!=============================================================================== +! LegendreFilter methods +!=============================================================================== + + subroutine from_xml(this, node) + class(LegendreFilter), intent(inout) :: this + type(XMLNode), intent(in) :: node + + ! Get specified order + call get_node_value(node, "order", this % order) + this % n_bins = this % order + 1 + end subroutine from_xml + + subroutine get_all_bins(this, p, estimator, match) + class(LegendreFilter), intent(in) :: this + type(Particle), intent(in) :: p + integer, intent(in) :: estimator + type(TallyFilterMatch), intent(inout) :: match + + integer :: i + real(8) :: wgt + + ! TODO: Use recursive formula to calculate higher orders + do i = 0, this % order + wgt = calc_pn(i, p % mu) + call match % bins % push_back(i + 1) + call match % weights % push_back(wgt) + end do + end subroutine get_all_bins + + subroutine to_statepoint(this, filter_group) + class(LegendreFilter), intent(in) :: this + integer(HID_T), intent(in) :: filter_group + + call write_dataset(filter_group, "type", "legendre") + call write_dataset(filter_group, "n_bins", this % n_bins) + call write_dataset(filter_group, "order", this % order) + end subroutine to_statepoint + + function text_label(this, bin) result(label) + class(LegendreFilter), intent(in) :: this + integer, intent(in) :: bin + character(MAX_LINE_LEN) :: label + + label = "Legendre expansion order " // trim(to_str(bin - 1)) + end function text_label + +!=============================================================================== +! C API FUNCTIONS +!=============================================================================== + + +end module tally_filter_legendre diff --git a/src/tallies/tally_header.F90 b/src/tallies/tally_header.F90 index 0495ce14dc..1f221c83ba 100644 --- a/src/tallies/tally_header.F90 +++ b/src/tallies/tally_header.F90 @@ -354,6 +354,9 @@ contains j = FILTER_AZIMUTHAL type is (EnergyFunctionFilter) j = FILTER_ENERGYFUNCTION + type is (LegendreFilter) + j = FILTER_LEGENDRE + this % estimator = ESTIMATOR_ANALOG end select this % find_filter(j) = i end do From 15df889c6621e83718e8945bc918e2e89d5271e5 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 5 Sep 2017 14:12:39 -0500 Subject: [PATCH 134/231] Implement spherical harmonics expansion filter --- CMakeLists.txt | 1 + openmc/__init__.py | 1 + openmc/filter_spherical_harmonics.py | 150 ++++++++++++++++++++++++++ src/constants.F90 | 5 +- src/tallies/tally_filter.F90 | 5 + src/tallies/tally_filter_legendre.F90 | 2 +- src/tallies/tally_filter_sph_harm.F90 | 135 +++++++++++++++++++++++ src/tallies/tally_header.F90 | 2 + 8 files changed, 298 insertions(+), 3 deletions(-) create mode 100644 openmc/filter_spherical_harmonics.py create mode 100644 src/tallies/tally_filter_sph_harm.F90 diff --git a/CMakeLists.txt b/CMakeLists.txt index bb3575c9db..654498002b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -426,6 +426,7 @@ set(LIBOPENMC_FORTRAN_SRC src/tallies/tally_filter_meshsurface.F90 src/tallies/tally_filter_mu.F90 src/tallies/tally_filter_polar.F90 + src/tallies/tally_filter_sph_harm.F90 src/tallies/tally_filter_surface.F90 src/tallies/tally_filter_universe.F90 src/tallies/tally_header.F90 diff --git a/openmc/__init__.py b/openmc/__init__.py index 243796a13f..a23b406c99 100644 --- a/openmc/__init__.py +++ b/openmc/__init__.py @@ -16,6 +16,7 @@ from openmc.universe import * from openmc.lattice import * from openmc.filter import * from openmc.filter_legendre import * +from openmc.filter_spherical_harmonics import * from openmc.trigger import * from openmc.tally_derivative import * from openmc.tallies import * diff --git a/openmc/filter_spherical_harmonics.py b/openmc/filter_spherical_harmonics.py new file mode 100644 index 0000000000..3b2e32b140 --- /dev/null +++ b/openmc/filter_spherical_harmonics.py @@ -0,0 +1,150 @@ +from numbers import Integral +from xml.etree import ElementTree as ET + +import numpy as np +import pandas as pd + +import openmc.checkvalue as cv +from . import Filter + + +class SphericalHarmonicsFilter(Filter): + r"""Score spherical harmonic expansion moments up to specified order. + + Parameters + ---------- + order : int + Maximum spherical harmonics order + filter_id : int or None + Unique identifier for the filter + + Attributes + ---------- + order : int + Maximum spherical harmonics order + id : int + Unique identifier for the filter + cosine : {'scatter', 'particle'} + How to handle the cosine term. + num_bins : int + The number of filter bins + + """ + + def __init__(self, order, filter_id=None): + self.order = order + self.id = filter_id + self._cosine = 'particle' + + def __hash__(self): + string = type(self).__name__ + '\n' + string += '{: <16}=\t{}\n'.format('\tOrder', self.order) + string += '{: <16}=\t{}\n'.format('\tCosine', self.cosine) + return hash(string) + + def __repr__(self): + string = type(self).__name__ + '\n' + string += '{: <16}=\t{}\n'.format('\tOrder', self.order) + string += '{: <16}=\t{}\n'.format('\tCosine', self.cosine) + string += '{: <16}=\t{}\n'.format('\tID', self.id) + return string + + @property + def order(self): + return self._order + + @order.setter + def order(self, order): + cv.check_type('spherical harmonics order', order, Integral) + cv.check_greater_than('spherical harmonics order', order, 0, equality=True) + self._order = order + + @property + def cosine(self): + return self._cosine + + @cosine.setter + def cosine(self, cosine): + cv.check_value('Spherical harmonics cosine treatment', cosine, + ('scatter', 'particle')) + self._cosine = cosine + + @property + def num_bins(self): + return (self._order + 1)**2 + + @classmethod + def from_hdf5(cls, group, **kwargs): + if group['type'].value.decode() != cls.short_name.lower(): + raise ValueError("Expected HDF5 data for filter type '" + + cls.short_name.lower() + "' but got '" + + group['type'].value.decode() + " instead") + + filter_id = int(group.name.split('/')[-1].lstrip('filter ')) + + out = cls(group['order'].value, filter_id) + out.cosine = group['cosine'].value.decode() + + return out + + def get_pandas_dataframe(self, data_size, stride, **kwargs): + """Builds a Pandas DataFrame for the Filter's bins. + + This method constructs a Pandas DataFrame object for the filter with + columns annotated by filter bin information. This is a helper method for + :meth:`Tally.get_pandas_dataframe`. + + Parameters + ---------- + data_size : Integral + The total number of bins in the tally corresponding to this filter + stride : int + Stride in memory for the filter + + Returns + ------- + pandas.DataFrame + A Pandas DataFrame with a column that is filled with strings + indicating spherical harmonics orders. The number of rows in the + DataFrame is the same as the total number of bins in the + corresponding tally. + + See also + -------- + Tally.get_pandas_dataframe(), CrossFilter.get_pandas_dataframe() + + """ + # Initialize Pandas DataFrame + df = pd.DataFrame() + + bins = [] + for n in range(self.order + 1): + bins.extend('Y{},{}'.format(n, m) for m in range(-n, n + 1)) + bins = np.array(bins) + + filter_bins = np.repeat(bins, stride) + tile_factor = data_size // len(filter_bins) + filter_bins = np.tile(filter_bins, tile_factor) + df = pd.concat([df, pd.DataFrame( + {self.short_name.lower(): filter_bins})]) + + return df + + def to_xml_element(self): + """Return XML Element representing the filter. + + Returns + ------- + element : xml.etree.ElementTree.Element + XML element containing spherical harmonics filter data + + """ + element = ET.Element('filter') + element.set('id', str(self.id)) + element.set('type', self.short_name.lower()) + element.set('cosine', self.cosine) + + subelement = ET.SubElement(element, 'order') + subelement.text = str(self.order) + + return element diff --git a/src/constants.F90 b/src/constants.F90 index 29b68ae1dc..623b081eb1 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -358,7 +358,7 @@ module constants integer, parameter :: NO_BIN_FOUND = -1 ! Tally filter and map types - integer, parameter :: N_FILTER_TYPES = 17 + integer, parameter :: N_FILTER_TYPES = 18 integer, parameter :: & FILTER_UNIVERSE = 1, & FILTER_MATERIAL = 2, & @@ -376,7 +376,8 @@ module constants FILTER_ENERGYFUNCTION = 14, & FILTER_CELLFROM = 15, & FILTER_MESHSURFACE = 16, & - FILTER_LEGENDRE = 17 + FILTER_LEGENDRE = 17, & + FILTER_SPH_HARMONICS = 18 ! Mesh types integer, parameter :: & diff --git a/src/tallies/tally_filter.F90 b/src/tallies/tally_filter.F90 index 056fc198a8..d2ae63aea4 100644 --- a/src/tallies/tally_filter.F90 +++ b/src/tallies/tally_filter.F90 @@ -23,6 +23,7 @@ module tally_filter use tally_filter_meshsurface use tally_filter_mu use tally_filter_polar + use tally_filter_sph_harm use tally_filter_surface use tally_filter_universe @@ -77,6 +78,8 @@ contains type_ = 'mu' type is (PolarFilter) type_ = 'polar' + type is (SphericalHarmonicsFilter) + type_ = 'sphericalharmonics' type is (SurfaceFilter) type_ = 'surface' type is (UniverseFilter) @@ -150,6 +153,8 @@ contains allocate(MuFilter :: filters(index) % obj) case ('polar') allocate(PolarFilter :: filters(index) % obj) + case ('sphericalharmonics') + allocate(SphericalHarmonicsFilter :: filters(index) % obj) case ('surface') allocate(SurfaceFilter :: filters(index) % obj) case ('universe') diff --git a/src/tallies/tally_filter_legendre.F90 b/src/tallies/tally_filter_legendre.F90 index 59fb57a72c..a97ed7fafe 100644 --- a/src/tallies/tally_filter_legendre.F90 +++ b/src/tallies/tally_filter_legendre.F90 @@ -75,7 +75,7 @@ contains integer, intent(in) :: bin character(MAX_LINE_LEN) :: label - label = "Legendre expansion order " // trim(to_str(bin - 1)) + label = "Legendre expansion, P" // trim(to_str(bin - 1)) end function text_label !=============================================================================== diff --git a/src/tallies/tally_filter_sph_harm.F90 b/src/tallies/tally_filter_sph_harm.F90 new file mode 100644 index 0000000000..9ccfde422c --- /dev/null +++ b/src/tallies/tally_filter_sph_harm.F90 @@ -0,0 +1,135 @@ +module tally_filter_sph_harm + + use, intrinsic :: ISO_C_BINDING + + use hdf5, only: HID_T + + use constants + use error + use hdf5_interface + use math, only: calc_pn, calc_rn + use particle_header, only: Particle + use string, only: to_str, to_lower + use tally_filter_header + use xml_interface + + implicit none + private + + integer, parameter :: COSINE_SCATTER = 1 + integer, parameter :: COSINE_PARTICLE = 2 + +!=============================================================================== +! LEGENDREFILTER gives Legendre moments of the change in scattering angle +!=============================================================================== + + type, public, extends(TallyFilter) :: SphericalHarmonicsFilter + integer :: order + integer :: cosine + contains + procedure :: from_xml + procedure :: get_all_bins + procedure :: to_statepoint + procedure :: text_label + end type SphericalHarmonicsFilter + +contains + +!=============================================================================== +! SphericalHarmonicsFilter methods +!=============================================================================== + + subroutine from_xml(this, node) + class(SphericalHarmonicsFilter), intent(inout) :: this + type(XMLNode), intent(in) :: node + + character(MAX_WORD_LEN) :: temp_str + + ! Get specified order + call get_node_value(node, "order", this % order) + this % n_bins = (this % order + 1)**2 + + ! Determine how cosine term is to be treated + if (check_for_node(node, "cosine")) then + call get_node_value(node, "cosine", temp_str) + select case (to_lower(temp_str)) + case ('scatter') + this % cosine = COSINE_SCATTER + case ('particle') + this % cosine = COSINE_PARTICLE + end select + else + this % cosine = COSINE_PARTICLE + end if + end subroutine from_xml + + subroutine get_all_bins(this, p, estimator, match) + class(SphericalHarmonicsFilter), intent(in) :: this + type(Particle), intent(in) :: p + integer, intent(in) :: estimator + type(TallyFilterMatch), intent(inout) :: match + + integer :: i, j, n + integer :: num_nm + real(8) :: wgt + real(8) :: rn(2*this % order + 1) + + ! TODO: Use recursive formula to calculate higher orders + j = 0 + do n = 0, this % order + ! Determine cosine term for scatter expansion if necessary + if (this % cosine == COSINE_SCATTER) then + wgt = calc_pn(n, p % mu) + else + wgt = ONE + end if + + ! Calculate n-th order spherical harmonics for (u,v,w) + num_nm = 2*n + 1 + rn(1:num_nm) = calc_rn(n, p % last_uvw) + + ! Append matching (bin,weight) for each moment + do i = 1, num_nm + j = j + 1 + call match % bins % push_back(j) + call match % weights % push_back(wgt * rn(i)) + end do + end do + end subroutine get_all_bins + + subroutine to_statepoint(this, filter_group) + class(SphericalHarmonicsFilter), intent(in) :: this + integer(HID_T), intent(in) :: filter_group + + call write_dataset(filter_group, "type", "sphericalharmonics") + call write_dataset(filter_group, "n_bins", this % n_bins) + call write_dataset(filter_group, "order", this % order) + if (this % cosine == COSINE_SCATTER) then + call write_dataset(filter_group, "cosine", "scatter") + else + call write_dataset(filter_group, "cosine", "particle") + end if + end subroutine to_statepoint + + function text_label(this, bin) result(label) + class(SphericalHarmonicsFilter), intent(in) :: this + integer, intent(in) :: bin + character(MAX_LINE_LEN) :: label + + integer :: n, m + + do n = 0, this % order + if (bin <= (n + 1)**2) then + m = (bin - n**2 - 1) - n + label = "Spherical harmonic expansion, Y" // trim(to_str(n)) // & + "," // trim(to_str(m)) + exit + end if + end do + end function text_label + +!=============================================================================== +! C API FUNCTIONS +!=============================================================================== + +end module tally_filter_sph_harm diff --git a/src/tallies/tally_header.F90 b/src/tallies/tally_header.F90 index 1f221c83ba..197687121f 100644 --- a/src/tallies/tally_header.F90 +++ b/src/tallies/tally_header.F90 @@ -357,6 +357,8 @@ contains type is (LegendreFilter) j = FILTER_LEGENDRE this % estimator = ESTIMATOR_ANALOG + type is (SphericalHarmonicsFilter) + j = FILTER_SPH_HARMONICS end select this % find_filter(j) = i end do From 1e81139172e2f846f9309eda199b54a02160ae18 Mon Sep 17 00:00:00 2001 From: Brittany Grayson Date: Thu, 4 Jan 2018 15:28:15 -0600 Subject: [PATCH 135/231] Implement spatial Legendre filter --- CMakeLists.txt | 1 + src/constants.F90 | 5 +- src/tallies/tally_filter.F90 | 5 ++ src/tallies/tally_filter_sptl_legendre.F90 | 91 ++++++++++++++++++++++ src/tallies/tally_header.F90 | 2 + 5 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 src/tallies/tally_filter_sptl_legendre.F90 diff --git a/CMakeLists.txt b/CMakeLists.txt index 654498002b..a0b374259d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -427,6 +427,7 @@ set(LIBOPENMC_FORTRAN_SRC src/tallies/tally_filter_mu.F90 src/tallies/tally_filter_polar.F90 src/tallies/tally_filter_sph_harm.F90 + src/tallies/tally_filter_sptl_legendre.F90 src/tallies/tally_filter_surface.F90 src/tallies/tally_filter_universe.F90 src/tallies/tally_header.F90 diff --git a/src/constants.F90 b/src/constants.F90 index 623b081eb1..b7f776fe80 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -358,7 +358,7 @@ module constants integer, parameter :: NO_BIN_FOUND = -1 ! Tally filter and map types - integer, parameter :: N_FILTER_TYPES = 18 + integer, parameter :: N_FILTER_TYPES = 19 integer, parameter :: & FILTER_UNIVERSE = 1, & FILTER_MATERIAL = 2, & @@ -377,7 +377,8 @@ module constants FILTER_CELLFROM = 15, & FILTER_MESHSURFACE = 16, & FILTER_LEGENDRE = 17, & - FILTER_SPH_HARMONICS = 18 + FILTER_SPH_HARMONICS = 18, & + FILTER_SPTL_LEGENDRE = 19 ! Mesh types integer, parameter :: & diff --git a/src/tallies/tally_filter.F90 b/src/tallies/tally_filter.F90 index d2ae63aea4..bd40b0417a 100644 --- a/src/tallies/tally_filter.F90 +++ b/src/tallies/tally_filter.F90 @@ -24,6 +24,7 @@ module tally_filter use tally_filter_mu use tally_filter_polar use tally_filter_sph_harm + use tally_filter_sptl_legendre use tally_filter_surface use tally_filter_universe @@ -80,6 +81,8 @@ contains type_ = 'polar' type is (SphericalHarmonicsFilter) type_ = 'sphericalharmonics' + type is (SpatialLegendreFilter) + type_ = 'spatiallegendre' type is (SurfaceFilter) type_ = 'surface' type is (UniverseFilter) @@ -155,6 +158,8 @@ contains allocate(PolarFilter :: filters(index) % obj) case ('sphericalharmonics') allocate(SphericalHarmonicsFilter :: filters(index) % obj) + case ('spatiallegendre') + allocate(SpatialLegendreFilter :: filters(index) % obj) case ('surface') allocate(SurfaceFilter :: filters(index) % obj) case ('universe') diff --git a/src/tallies/tally_filter_sptl_legendre.F90 b/src/tallies/tally_filter_sptl_legendre.F90 new file mode 100644 index 0000000000..349c280959 --- /dev/null +++ b/src/tallies/tally_filter_sptl_legendre.F90 @@ -0,0 +1,91 @@ +module tally_filter_sptl_legendre + + use, intrinsic :: ISO_C_BINDING + + use hdf5, only: HID_T + + use constants + use error + use hdf5_interface + use math, only: calc_pn + use particle_header, only: Particle + use string, only: to_str + use tally_filter_header + use xml_interface + + implicit none + private + +!=============================================================================== +! SpatialLEGENDREFILTER gives Legendre moments +!=============================================================================== + + type, public, extends(TallyFilter) :: SpatialLegendreFilter + integer :: order + contains + procedure :: from_xml + procedure :: get_all_bins + procedure :: to_statepoint + procedure :: text_label + end type SpatialLegendreFilter + +contains + +!=============================================================================== +! SpatialLegendreFilter methods +!=============================================================================== + + subroutine from_xml(this, node) + class(SpatialLegendreFilter), intent(inout) :: this + type(XMLNode), intent(in) :: node + + ! Get specified order + call get_node_value(node, "order", this % order) + this % n_bins = this % order + 1 + end subroutine from_xml + + subroutine get_all_bins(this, p, estimator, match) + class(SpatialLegendreFilter), intent(in) :: this + type(Particle), intent(in) :: p + integer, intent(in) :: estimator + type(TallyFilterMatch), intent(inout) :: match + + integer :: i + real(8) :: wgt + real(8) :: leg_x + real(8) :: xmin + real(8) :: xmax + + ! TODO: Use recursive formula to calculate higher orders + do i = 0, this % order + !i is the order, second var is the value normalized between 0 and 1 given by + ! norm_x = 2*(leg_x-xmin)/(xmax-xmin)-1 + wgt = 2.0*(leg_x - xmin)/(xmax - xmin) - 1 + call match % bins % push_back(i + 1) + call match % weights % push_back(wgt) + end do + end subroutine get_all_bins + + subroutine to_statepoint(this, filter_group) + class(SpatialLegendreFilter), intent(in) :: this + integer(HID_T), intent(in) :: filter_group + + call write_dataset(filter_group, "type", "legendre") + call write_dataset(filter_group, "n_bins", this % n_bins) + call write_dataset(filter_group, "order", this % order) + end subroutine to_statepoint + + function text_label(this, bin) result(label) + class(SpatialLegendreFilter), intent(in) :: this + integer, intent(in) :: bin + character(MAX_LINE_LEN) :: label + + label = "Legendre expansion, P" // trim(to_str(bin - 1)) + end function text_label + +!=============================================================================== +! C API FUNCTIONS +!=============================================================================== + + +end module tally_filter_sptl_legendre diff --git a/src/tallies/tally_header.F90 b/src/tallies/tally_header.F90 index 197687121f..84dc27e3f9 100644 --- a/src/tallies/tally_header.F90 +++ b/src/tallies/tally_header.F90 @@ -359,6 +359,8 @@ contains this % estimator = ESTIMATOR_ANALOG type is (SphericalHarmonicsFilter) j = FILTER_SPH_HARMONICS + type is (SpatialLegendreFilter) + j = FILTER_SPTL_LEGENDRE end select this % find_filter(j) = i end do From 1afbb8d10979e15f2e2267f8b43f6385be58104d Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 4 Jan 2018 16:10:06 -0600 Subject: [PATCH 136/231] Fix spatial Legendre filter and add associated Python class --- openmc/__init__.py | 1 + openmc/filter_spatial_legendre.py | 173 +++++++++++++++++++++ src/tallies/tally_filter_sptl_legendre.F90 | 62 ++++++-- 3 files changed, 222 insertions(+), 14 deletions(-) create mode 100644 openmc/filter_spatial_legendre.py diff --git a/openmc/__init__.py b/openmc/__init__.py index a23b406c99..e9dd0bd8c3 100644 --- a/openmc/__init__.py +++ b/openmc/__init__.py @@ -16,6 +16,7 @@ from openmc.universe import * from openmc.lattice import * from openmc.filter import * from openmc.filter_legendre import * +from openmc.filter_spatial_legendre import * from openmc.filter_spherical_harmonics import * from openmc.trigger import * from openmc.tally_derivative import * diff --git a/openmc/filter_spatial_legendre.py b/openmc/filter_spatial_legendre.py new file mode 100644 index 0000000000..1ad23666bb --- /dev/null +++ b/openmc/filter_spatial_legendre.py @@ -0,0 +1,173 @@ +from numbers import Integral, Real +from xml.etree import ElementTree as ET + +import numpy as np +import pandas as pd + +import openmc.checkvalue as cv +from . import Filter + + +class SpatialLegendreFilter(Filter): + r"""Score Legendre expansion moments in space up to specified order. + + This filter allows scores to be multiplied by Legendre polynomials of the + the particle's position along a particular axis, normalized to a given + range, up to a user-specified order. + + Parameters + ---------- + order : int + Maximum Legendre polynomial order + axis : {'x', 'y', 'z'} + Axis along which to take the expansion + minimum : float + Minimum value along selected axis + maximum : float + Maximum value along selected axis + filter_id : int or None + Unique identifier for the filter + + Attributes + ---------- + order : int + Maximum Legendre polynomial order + id : int + Unique identifier for the filter + num_bins : int + The number of filter bins + + """ + + def __init__(self, order, axis, minimum, maximum, filter_id=None): + self.order = order + self.axis = axis + self.minimum = minimum + self.maximum = maximum + self.id = filter_id + + def __hash__(self): + string = type(self).__name__ + '\n' + string += '{: <16}=\t{}\n'.format('\tOrder', self.order) + return hash(string) + + def __repr__(self): + string = type(self).__name__ + '\n' + string += '{: <16}=\t{}\n'.format('\tOrder', self.order) + string += '{: <16}=\t{}\n'.format('\tID', self.id) + return string + + @property + def order(self): + return self._order + + @order.setter + def order(self, order): + cv.check_type('Legendre order', order, Integral) + cv.check_greater_than('Legendre order', order, 0, equality=True) + self._order = order + + @property + def axis(self): + return self._axis + + @axis.setter + def axis(self, axis): + cv.check_value('axis', axis, ('x', 'y', 'z')) + self._axis = axis + + @property + def minimum(self): + return self._minimum + + @minimum.setter + def minimum(self, minimum): + cv.check_type('minimum', minimum, Real) + self._minimum = minimum + + @property + def maximum(self): + return self._maximum + + @maximum.setter + def maximum(self, maximum): + cv.check_type('maximum', maximum, Real) + self._maximum = maximum + + @property + def num_bins(self): + return self._order + 1 + + @classmethod + def from_hdf5(cls, group, **kwargs): + if group['type'].value.decode() != cls.short_name.lower(): + raise ValueError("Expected HDF5 data for filter type '" + + cls.short_name.lower() + "' but got '" + + group['type'].value.decode() + " instead") + + filter_id = int(group.name.split('/')[-1].lstrip('filter ')) + order = group['order'].value + axis = group['axis'].value.decode() + min_, max_ = group['min'].value, group['max'].value + + return cls(order, axis, min_, max_, filter_id) + + def get_pandas_dataframe(self, data_size, stride, **kwargs): + """Builds a Pandas DataFrame for the Filter's bins. + + This method constructs a Pandas DataFrame object for the filter with + columns annotated by filter bin information. This is a helper method for + :meth:`Tally.get_pandas_dataframe`. + + Parameters + ---------- + data_size : Integral + The total number of bins in the tally corresponding to this filter + + Returns + ------- + pandas.DataFrame + A Pandas DataFrame with a column that is filled with strings + indicating Legendre orders. The number of rows in the DataFrame is + the same as the total number of bins in the corresponding tally. + + See also + -------- + Tally.get_pandas_dataframe(), CrossFilter.get_pandas_dataframe() + + """ + # Initialize Pandas DataFrame + df = pd.DataFrame() + + bins = np.array(['P{}'.format(i) for i in range(self.order + 1)]) + filter_bins = np.repeat(bins, stride) + tile_factor = data_size // len(filter_bins) + filter_bins = np.tile(filter_bins, tile_factor) + df = pd.concat([df, pd.DataFrame( + {self.short_name.lower(): filter_bins})]) + + return df + + def to_xml_element(self): + """Return XML Element representing the filter. + + Returns + ------- + element : xml.etree.ElementTree.Element + XML element containing Legendre filter data + + """ + element = ET.Element('filter') + element.set('id', str(self.id)) + element.set('type', self.short_name.lower()) + + subelement = ET.SubElement(element, 'order') + subelement.text = str(self.order) + subelement = ET.SubElement(element, 'axis') + subelement.text = self.axis + subelement = ET.SubElement(element, 'min') + subelement.text = str(self.minimum) + subelement = ET.SubElement(element, 'max') + subelement.text = str(self.maximum) + + return element diff --git a/src/tallies/tally_filter_sptl_legendre.F90 b/src/tallies/tally_filter_sptl_legendre.F90 index 349c280959..8de87f8664 100644 --- a/src/tallies/tally_filter_sptl_legendre.F90 +++ b/src/tallies/tally_filter_sptl_legendre.F90 @@ -9,19 +9,26 @@ module tally_filter_sptl_legendre use hdf5_interface use math, only: calc_pn use particle_header, only: Particle - use string, only: to_str + use string, only: to_str, to_lower use tally_filter_header use xml_interface implicit none private + integer, parameter :: AXIS_X = 1 + integer, parameter :: AXIS_Y = 2 + integer, parameter :: AXIS_Z = 3 + !=============================================================================== ! SpatialLEGENDREFILTER gives Legendre moments !=============================================================================== type, public, extends(TallyFilter) :: SpatialLegendreFilter integer :: order + integer :: axis + real(8) :: min + real(8) :: max contains procedure :: from_xml procedure :: get_all_bins @@ -39,8 +46,22 @@ contains class(SpatialLegendreFilter), intent(inout) :: this type(XMLNode), intent(in) :: node - ! Get specified order + character(MAX_WORD_LEN) :: axis + + ! Get attributes from XML call get_node_value(node, "order", this % order) + call get_node_value(node, "axis", axis) + select case (to_lower(axis)) + case ('x') + this % axis = AXIS_X + case ('y') + this % axis = AXIS_Y + case ('z') + this % axis = AXIS_Z + end select + call get_node_value(node, "min", this % min) + call get_node_value(node, "max", this % max) + this % n_bins = this % order + 1 end subroutine from_xml @@ -52,27 +73,40 @@ contains integer :: i real(8) :: wgt - real(8) :: leg_x - real(8) :: xmin - real(8) :: xmax + real(8) :: x ! Position on specified axis + real(8) :: x_norm ! Normalized position - ! TODO: Use recursive formula to calculate higher orders - do i = 0, this % order - !i is the order, second var is the value normalized between 0 and 1 given by - ! norm_x = 2*(leg_x-xmin)/(xmax-xmin)-1 - wgt = 2.0*(leg_x - xmin)/(xmax - xmin) - 1 - call match % bins % push_back(i + 1) - call match % weights % push_back(wgt) - end do + x = p % coord(1) % xyz(this % axis) + if (this % min <= x .and. x <= this % max) then + ! Calculate normalized position between min and max + x_norm = TWO*(x - this % min)/(this % max - this % min) - ONE + + ! TODO: Use recursive formula to calculate higher orders + do i = 0, this % order + wgt = calc_pn(i, x_norm) + call match % bins % push_back(i + 1) + call match % weights % push_back(wgt) + end do + end if end subroutine get_all_bins subroutine to_statepoint(this, filter_group) class(SpatialLegendreFilter), intent(in) :: this integer(HID_T), intent(in) :: filter_group - call write_dataset(filter_group, "type", "legendre") + call write_dataset(filter_group, "type", "spatiallegendre") call write_dataset(filter_group, "n_bins", this % n_bins) call write_dataset(filter_group, "order", this % order) + select case (this % axis) + case (AXIS_X) + call write_dataset(filter_group, 'axis', 'x') + case (AXIS_Y) + call write_dataset(filter_group, 'axis', 'y') + case (AXIS_Z) + call write_dataset(filter_group, 'axis', 'z') + end select + call write_dataset(filter_group, 'min', this % min) + call write_dataset(filter_group, 'max', this % max) end subroutine to_statepoint function text_label(this, bin) result(label) From a6746ab016ac4abcbd68eee0c696bd6dd193955e Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 5 Jan 2018 10:45:23 -0600 Subject: [PATCH 137/231] Force tallies with spatial Legendre filters to use collision estimator --- src/tallies/tally_header.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tallies/tally_header.F90 b/src/tallies/tally_header.F90 index 84dc27e3f9..15b8c2df5d 100644 --- a/src/tallies/tally_header.F90 +++ b/src/tallies/tally_header.F90 @@ -361,6 +361,7 @@ contains j = FILTER_SPH_HARMONICS type is (SpatialLegendreFilter) j = FILTER_SPTL_LEGENDRE + this % estimator = ESTIMATOR_COLLISION end select this % find_filter(j) = i end do From ac776a5b512a36a95085ccf176600b493793e5a7 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 9 Jan 2018 22:35:37 -0600 Subject: [PATCH 138/231] Start implemented Zernike FE filter --- CMakeLists.txt | 1 + src/constants.F90 | 5 +- src/tallies/tally_filter.F90 | 5 + src/tallies/tally_filter_zernike.F90 | 1281 ++++++++++++++++++++++++++ src/tallies/tally_header.F90 | 3 + 5 files changed, 1293 insertions(+), 2 deletions(-) create mode 100644 src/tallies/tally_filter_zernike.F90 diff --git a/CMakeLists.txt b/CMakeLists.txt index a0b374259d..1797ae5d31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -430,6 +430,7 @@ set(LIBOPENMC_FORTRAN_SRC src/tallies/tally_filter_sptl_legendre.F90 src/tallies/tally_filter_surface.F90 src/tallies/tally_filter_universe.F90 + src/tallies/tally_filter_zernike.F90 src/tallies/tally_header.F90 src/tallies/trigger.F90 src/tallies/trigger_header.F90 diff --git a/src/constants.F90 b/src/constants.F90 index b7f776fe80..b335b78c86 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -358,7 +358,7 @@ module constants integer, parameter :: NO_BIN_FOUND = -1 ! Tally filter and map types - integer, parameter :: N_FILTER_TYPES = 19 + integer, parameter :: N_FILTER_TYPES = 20 integer, parameter :: & FILTER_UNIVERSE = 1, & FILTER_MATERIAL = 2, & @@ -378,7 +378,8 @@ module constants FILTER_MESHSURFACE = 16, & FILTER_LEGENDRE = 17, & FILTER_SPH_HARMONICS = 18, & - FILTER_SPTL_LEGENDRE = 19 + FILTER_SPTL_LEGENDRE = 19, & + FILTER_ZERNIKE = 20 ! Mesh types integer, parameter :: & diff --git a/src/tallies/tally_filter.F90 b/src/tallies/tally_filter.F90 index bd40b0417a..0277f24652 100644 --- a/src/tallies/tally_filter.F90 +++ b/src/tallies/tally_filter.F90 @@ -27,6 +27,7 @@ module tally_filter use tally_filter_sptl_legendre use tally_filter_surface use tally_filter_universe + use tally_filter_zernike implicit none @@ -87,6 +88,8 @@ contains type_ = 'surface' type is (UniverseFilter) type_ = 'universe' + type is (ZernikeFilter) + type_ = 'zernike' end select ! Convert Fortran string to null-terminated C string. We assume the @@ -164,6 +167,8 @@ contains allocate(SurfaceFilter :: filters(index) % obj) case ('universe') allocate(UniverseFilter :: filters(index) % obj) + case ('zernike') + allocate(ZernikeFilter :: filters(index) % obj) case default err = E_UNASSIGNED call set_errmsg("Unknown filter type: " // trim(type_)) diff --git a/src/tallies/tally_filter_zernike.F90 b/src/tallies/tally_filter_zernike.F90 new file mode 100644 index 0000000000..8ee07a67c8 --- /dev/null +++ b/src/tallies/tally_filter_zernike.F90 @@ -0,0 +1,1281 @@ +module tally_filter_zernike + + use, intrinsic :: ISO_C_BINDING + + use hdf5, only: HID_T + + use constants + use error + use hdf5_interface + use particle_header, only: Particle + use string, only: to_str + use tally_filter_header + use xml_interface + + implicit none + private + +!=============================================================================== +! ZERNIKEFILTER gives Zernike polynomial moments of a particle's position +!=============================================================================== + + type, public, extends(TallyFilter) :: ZernikeFilter + integer :: order + real(8) :: x + real(8) :: y + real(8) :: r + contains + procedure :: from_xml + procedure :: get_all_bins + procedure :: to_statepoint + procedure :: text_label + end type ZernikeFilter + +contains + +!=============================================================================== +! ZernikeFilter methods +!=============================================================================== + + subroutine from_xml(this, node) + class(ZernikeFilter), intent(inout) :: this + type(XMLNode), intent(in) :: node + + integer :: n + + ! Get center of cylinder and radius + call get_node_value(node, "x", this % x) + call get_node_value(node, "y", this % y) + call get_node_value(node, "r", this % r) + + ! Get specified order + call get_node_value(node, "order", n) + this % order = n + this % n_bins = (n + 1)*(n + 2)/2 + end subroutine from_xml + + subroutine get_all_bins(this, p, estimator, match) + class(ZernikeFilter), intent(in) :: this + type(Particle), intent(in) :: p + integer, intent(in) :: estimator + type(TallyFilterMatch), intent(inout) :: match + + integer :: n + integer :: j + integer :: i + real(8) :: wgt + real(8) :: tmp(this % order + 1) + real(8) :: x, y, r, theta + + ! Determine normalized (r,theta) positions + x = p % coord(1) % xyz(1) - this % x + y = p % coord(1) % xyz(2) - this % y + r = sqrt(x*x + y*y)/this % r + theta = atan2(y, x) + + i = 0 + do n = 0, this % order + ! Get moments for n-th order Zernike polynomial + tmp(1:n+1) = calc_zn_scaled(n, r, theta) + + ! Indicate matching bins/weights + do j = 1, n + 1 + call match % bins % push_back(i + j) + call match % weights % push_back(tmp(j)) + end do + i = i + n + 1 + end do + end subroutine get_all_bins + + subroutine to_statepoint(this, filter_group) + class(ZernikeFilter), intent(in) :: this + integer(HID_T), intent(in) :: filter_group + + call write_dataset(filter_group, "type", "zernike") + call write_dataset(filter_group, "n_bins", this % n_bins) + call write_dataset(filter_group, "order", this % order) + call write_dataset(filter_group, "x", this % x) + call write_dataset(filter_group, "y", this % y) + call write_dataset(filter_group, "r", this % r) + end subroutine to_statepoint + + function text_label(this, bin) result(label) + class(ZernikeFilter), intent(in) :: this + integer, intent(in) :: bin + character(MAX_LINE_LEN) :: label + + integer :: n, m + integer :: first, last + + do n = 0, this % order + last = (n + 1)*(n + 2)/2 + if (bin <= last) then + first = last - n + m = -n + (bin - first)*2 + label = "Zernike expansion, Y" // trim(to_str(n)) // "," & + // trim(to_str(m)) + exit + end if + end do + end function text_label + + +!=============================================================================== +! CALC_ZN calculates the n-th order Zernike polynomial moment for a given angle +! (rho, theta) location in the unit disk. +!=============================================================================== + + pure function calc_zn(n, rho, phi) result(zn) + + integer, intent(in) :: n ! Order requested + real(8), intent(in) :: rho ! Radial location in the unit disk + real(8), intent(in) :: phi ! Theta (radians) location in the unit disk + real(8) :: zn(n + 1) ! The resultant Z_n(uvw) + + ! n == radial degree + ! m == azimuthal frequency + + select case(n) + case(0) + ! n = 0, m = 0 + zn(1) = ( ( 1.00 ) ) & + * ( 1.000000000000 ) + case(1) + ! n = 1, m = -1 + zn(1) = ( ( 1.00 ) * rho ) & + * ( 2.000000000000 ) * sin(1.00 * phi) + ! n = 1, m = 1 + zn(2) = ( ( 1.00 ) * rho ) & + * ( 2.000000000000 ) * cos(1.00 * phi) + case(2) + ! n = 2, m = -2 + zn(1) = ( ( 1.00 ) *rho * rho ) & + * ( 2.449489742783 ) * sin(2.00 * phi) + ! n = 2, m = 0 + zn(2) = ( ( -1.00 ) + & + ( 2.00 ) *rho * rho ) & + * ( 1.732050807569 ) + ! n = 2, m = 2 + zn(3) = ( ( 1.00 ) *rho * rho ) & + * ( 2.449489742783 ) * cos(2.00 * phi) + case(3) + ! n = 3, m = -3 + zn(1) = ( ( 1.00 ) *rho *rho * rho ) & + * ( 2.828427124746 ) * sin(3.00 * phi) + ! n = 3, m = -1 + zn(2) = ( ( -2.00 ) * rho + & + ( 3.00 ) *rho *rho * rho ) & + * ( 2.828427124746 ) * sin(3.00 * phi) + ! n = 3, m = 1 + zn(3) = ( ( -2.00 ) * rho + & + ( 3.00 ) *rho *rho * rho ) & + * ( 2.828427124746 ) * cos(3.00 * phi) + ! n = 3, m = 3 + zn(4) = ( ( 1.00 ) *rho *rho * rho ) & + * ( 2.828427124746 ) * cos(3.00 * phi) + case(4) + ! n = 4, m = -4 + zn(1) = ( ( 1.00 ) *rho *rho *rho * rho ) & + * ( 3.162277660168 ) * sin(4.00 * phi) + ! n = 4, m = -2 + zn(2) = ( ( -3.00 ) *rho * rho + & + ( 4.00 ) *rho *rho *rho * rho ) & + * ( 3.162277660168 ) * sin(4.00 * phi) + ! n = 4, m = 0 + zn(3) = ( ( 1.00 ) + & + ( -6.00 ) *rho * rho + & + ( 6.00 ) *rho *rho *rho * rho ) & + * ( 2.236067977500 ) + ! n = 4, m = 2 + zn(4) = ( ( -3.00 ) *rho * rho + & + ( 4.00 ) *rho *rho *rho * rho ) & + * ( 3.162277660168 ) * cos(4.00 * phi) + ! n = 4, m = 4 + zn(5) = ( ( 1.00 ) *rho *rho *rho * rho ) & + * ( 3.162277660168 ) * cos(4.00 * phi) + case(5) + ! n = 5, m = -5 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho * rho ) & + * ( 3.464101615138 ) * sin(5.00 * phi) + ! n = 5, m = -3 + zn(2) = ( ( -4.00 ) *rho *rho * rho + & + ( 5.00 ) *rho *rho *rho *rho * rho ) & + * ( 3.464101615138 ) * sin(5.00 * phi) + ! n = 5, m = -1 + zn(3) = ( ( 3.00 ) * rho + & + ( -12.00 ) *rho *rho * rho + & + ( 10.00 ) *rho *rho *rho *rho * rho ) & + * ( 3.464101615138 ) * sin(5.00 * phi) + ! n = 5, m = 1 + zn(4) = ( ( 3.00 ) * rho + & + ( -12.00 ) *rho *rho * rho + & + ( 10.00 ) *rho *rho *rho *rho * rho ) & + * ( 3.464101615138 ) * cos(5.00 * phi) + ! n = 5, m = 3 + zn(5) = ( ( -4.00 ) *rho *rho * rho + & + ( 5.00 ) *rho *rho *rho *rho * rho ) & + * ( 3.464101615138 ) * cos(5.00 * phi) + ! n = 5, m = 5 + zn(6) = ( ( 1.00 ) *rho *rho *rho *rho * rho ) & + * ( 3.464101615138 ) * cos(5.00 * phi) + case(6) + ! n = 6, m = -6 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho * rho ) & + * ( 3.741657386774 ) * sin(6.00 * phi) + ! n = 6, m = -4 + zn(2) = ( ( -5.00 ) *rho *rho *rho * rho + & + ( 6.00 ) *rho *rho *rho *rho *rho * rho ) & + * ( 3.741657386774 ) * sin(6.00 * phi) + ! n = 6, m = -2 + zn(3) = ( ( 6.00 ) *rho * rho + & + ( -20.00 ) *rho *rho *rho * rho + & + ( 15.00 ) *rho *rho *rho *rho *rho * rho ) & + * ( 3.741657386774 ) * sin(6.00 * phi) + ! n = 6, m = 0 + zn(4) = ( ( -1.00 ) + & + ( 12.00 ) *rho * rho + & + ( -30.00 ) *rho *rho *rho * rho + & + ( 20.00 ) *rho *rho *rho *rho *rho * rho ) & + * ( 2.645751311065 ) + ! n = 6, m = 2 + zn(5) = ( ( 6.00 ) *rho * rho + & + ( -20.00 ) *rho *rho *rho * rho + & + ( 15.00 ) *rho *rho *rho *rho *rho * rho ) & + * ( 3.741657386774 ) * cos(6.00 * phi) + ! n = 6, m = 4 + zn(6) = ( ( -5.00 ) *rho *rho *rho * rho + & + ( 6.00 ) *rho *rho *rho *rho *rho * rho ) & + * ( 3.741657386774 ) * cos(6.00 * phi) + ! n = 6, m = 6 + zn(7) = ( ( 1.00 ) *rho *rho *rho *rho *rho * rho ) & + * ( 3.741657386774 ) * cos(6.00 * phi) + case(7) + ! n = 7, m = -7 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.000000000000 ) * sin(7.00 * phi) + ! n = 7, m = -5 + zn(2) = ( ( -6.00 ) *rho *rho *rho *rho * rho + & + ( 7.00 ) *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.000000000000 ) * sin(7.00 * phi) + ! n = 7, m = -3 + zn(3) = ( ( 10.00 ) *rho *rho * rho + & + ( -30.00 ) *rho *rho *rho *rho * rho + & + ( 21.00 ) *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.000000000000 ) * sin(7.00 * phi) + ! n = 7, m = -1 + zn(4) = ( ( -4.00 ) * rho + & + ( 30.00 ) *rho *rho * rho + & + ( -60.00 ) *rho *rho *rho *rho * rho + & + ( 35.00 ) *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.000000000000 ) * sin(7.00 * phi) + ! n = 7, m = 1 + zn(5) = ( ( -4.00 ) * rho + & + ( 30.00 ) *rho *rho * rho + & + ( -60.00 ) *rho *rho *rho *rho * rho + & + ( 35.00 ) *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.000000000000 ) * cos(7.00 * phi) + ! n = 7, m = 3 + zn(6) = ( ( 10.00 ) *rho *rho * rho + & + ( -30.00 ) *rho *rho *rho *rho * rho + & + ( 21.00 ) *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.000000000000 ) * cos(7.00 * phi) + ! n = 7, m = 5 + zn(7) = ( ( -6.00 ) *rho *rho *rho *rho * rho + & + ( 7.00 ) *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.000000000000 ) * cos(7.00 * phi) + ! n = 7, m = 7 + zn(8) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.000000000000 ) * cos(7.00 * phi) + case(8) + ! n = 8, m = -8 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.242640687119 ) * sin(8.00 * phi) + ! n = 8, m = -6 + zn(2) = ( ( -7.00 ) *rho *rho *rho *rho *rho * rho + & + ( 8.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.242640687119 ) * sin(8.00 * phi) + ! n = 8, m = -4 + zn(3) = ( ( 15.00 ) *rho *rho *rho * rho + & + ( -42.00 ) *rho *rho *rho *rho *rho * rho + & + ( 28.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.242640687119 ) * sin(8.00 * phi) + ! n = 8, m = -2 + zn(4) = ( ( -10.00 ) *rho * rho + & + ( 60.00 ) *rho *rho *rho * rho + & + ( -105.00 ) *rho *rho *rho *rho *rho * rho + & + ( 56.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.242640687119 ) * sin(8.00 * phi) + ! n = 8, m = 0 + zn(5) = ( ( 1.00 ) + & + ( -20.00 ) *rho * rho + & + ( 90.00 ) *rho *rho *rho * rho + & + ( -140.00 ) *rho *rho *rho *rho *rho * rho + & + ( 70.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 3.000000000000 ) + ! n = 8, m = 2 + zn(6) = ( ( -10.00 ) *rho * rho + & + ( 60.00 ) *rho *rho *rho * rho + & + ( -105.00 ) *rho *rho *rho *rho *rho * rho + & + ( 56.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.242640687119 ) * cos(8.00 * phi) + ! n = 8, m = 4 + zn(7) = ( ( 15.00 ) *rho *rho *rho * rho + & + ( -42.00 ) *rho *rho *rho *rho *rho * rho + & + ( 28.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.242640687119 ) * cos(8.00 * phi) + ! n = 8, m = 6 + zn(8) = ( ( -7.00 ) *rho *rho *rho *rho *rho * rho + & + ( 8.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.242640687119 ) * cos(8.00 * phi) + ! n = 8, m = 8 + zn(9) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.242640687119 ) * cos(8.00 * phi) + case(9) + ! n = 9, m = -9 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * sin(9.00 * phi) + ! n = 9, m = -7 + zn(2) = ( ( -8.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 9.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * sin(9.00 * phi) + ! n = 9, m = -5 + zn(3) = ( ( 21.00 ) *rho *rho *rho *rho * rho + & + ( -56.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 36.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * sin(9.00 * phi) + ! n = 9, m = -3 + zn(4) = ( ( -20.00 ) *rho *rho * rho + & + ( 105.00 ) *rho *rho *rho *rho * rho + & + ( -168.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 84.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * sin(9.00 * phi) + ! n = 9, m = -1 + zn(5) = ( ( 5.00 ) * rho + & + ( -60.00 ) *rho *rho * rho + & + ( 210.00 ) *rho *rho *rho *rho * rho + & + ( -280.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 126.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * sin(9.00 * phi) + ! n = 9, m = 1 + zn(6) = ( ( 5.00 ) * rho + & + ( -60.00 ) *rho *rho * rho + & + ( 210.00 ) *rho *rho *rho *rho * rho + & + ( -280.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 126.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * cos(9.00 * phi) + ! n = 9, m = 3 + zn(7) = ( ( -20.00 ) *rho *rho * rho + & + ( 105.00 ) *rho *rho *rho *rho * rho + & + ( -168.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 84.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * cos(9.00 * phi) + ! n = 9, m = 5 + zn(8) = ( ( 21.00 ) *rho *rho *rho *rho * rho + & + ( -56.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 36.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * cos(9.00 * phi) + ! n = 9, m = 7 + zn(9) = ( ( -8.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 9.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * cos(9.00 * phi) + ! n = 9, m = 9 + zn(10) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * cos(9.00 * phi) + case(10) + ! n = 10, m = -10 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * sin(10.00 * phi) + ! n = 10, m = -8 + zn(2) = ( ( -9.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 10.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * sin(10.00 * phi) + ! n = 10, m = -6 + zn(3) = ( ( 28.00 ) *rho *rho *rho *rho *rho * rho + & + ( -72.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 45.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * sin(10.00 * phi) + ! n = 10, m = -4 + zn(4) = ( ( -35.00 ) *rho *rho *rho * rho + & + ( 168.00 ) *rho *rho *rho *rho *rho * rho + & + ( -252.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * sin(10.00 * phi) + ! n = 10, m = -2 + zn(5) = ( ( 15.00 ) *rho * rho + & + ( -140.00 ) *rho *rho *rho * rho + & + ( 420.00 ) *rho *rho *rho *rho *rho * rho + & + ( -504.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * sin(10.00 * phi) + ! n = 10, m = 0 + zn(6) = ( ( -1.00 ) + & + ( 30.00 ) *rho * rho + & + ( -210.00 ) *rho *rho *rho * rho + & + ( 560.00 ) *rho *rho *rho *rho *rho * rho + & + ( -630.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 252.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 3.316624790355 ) + ! n = 10, m = 2 + zn(7) = ( ( 15.00 ) *rho * rho + & + ( -140.00 ) *rho *rho *rho * rho + & + ( 420.00 ) *rho *rho *rho *rho *rho * rho + & + ( -504.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * cos(10.00 * phi) + ! n = 10, m = 4 + zn(8) = ( ( -35.00 ) *rho *rho *rho * rho + & + ( 168.00 ) *rho *rho *rho *rho *rho * rho + & + ( -252.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * cos(10.00 * phi) + ! n = 10, m = 6 + zn(9) = ( ( 28.00 ) *rho *rho *rho *rho *rho * rho + & + ( -72.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 45.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * cos(10.00 * phi) + ! n = 10, m = 8 + zn(10) = ( ( -9.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 10.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * cos(10.00 * phi) + ! n = 10, m = 10 + zn(11) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * cos(10.00 * phi) + case(11) + ! n = 11, m = -11 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * sin(11.00 * phi) + ! n = 11, m = -9 + zn(2) = ( ( -10.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 11.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * sin(11.00 * phi) + ! n = 11, m = -7 + zn(3) = ( ( 36.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -90.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 55.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * sin(11.00 * phi) + ! n = 11, m = -5 + zn(4) = ( ( -56.00 ) *rho *rho *rho *rho * rho + & + ( 252.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 165.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * sin(11.00 * phi) + ! n = 11, m = -3 + zn(5) = ( ( 35.00 ) *rho *rho * rho + & + ( -280.00 ) *rho *rho *rho *rho * rho + & + ( 756.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 330.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * sin(11.00 * phi) + ! n = 11, m = -1 + zn(6) = ( ( -6.00 ) * rho + & + ( 105.00 ) *rho *rho * rho + & + ( -560.00 ) *rho *rho *rho *rho * rho + & + ( 1260.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -1260.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 462.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * sin(11.00 * phi) + ! n = 11, m = 1 + zn(7) = ( ( -6.00 ) * rho + & + ( 105.00 ) *rho *rho * rho + & + ( -560.00 ) *rho *rho *rho *rho * rho + & + ( 1260.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -1260.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 462.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * cos(11.00 * phi) + ! n = 11, m = 3 + zn(8) = ( ( 35.00 ) *rho *rho * rho + & + ( -280.00 ) *rho *rho *rho *rho * rho + & + ( 756.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 330.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * cos(11.00 * phi) + ! n = 11, m = 5 + zn(9) = ( ( -56.00 ) *rho *rho *rho *rho * rho + & + ( 252.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 165.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * cos(11.00 * phi) + ! n = 11, m = 7 + zn(10) = ( ( 36.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -90.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 55.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * cos(11.00 * phi) + ! n = 11, m = 9 + zn(11) = ( ( -10.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 11.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * cos(11.00 * phi) + ! n = 11, m = 11 + zn(12) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * cos(11.00 * phi) + case(12) + ! n = 12, m = -12 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * sin(12.00 * phi) + ! n = 12, m = -10 + zn(2) = ( ( -11.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 12.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * sin(12.00 * phi) + ! n = 12, m = -8 + zn(3) = ( ( 45.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -110.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 66.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * sin(12.00 * phi) + ! n = 12, m = -6 + zn(4) = ( ( -84.00 ) *rho *rho *rho *rho *rho * rho + & + ( 360.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 220.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * sin(12.00 * phi) + ! n = 12, m = -4 + zn(5) = ( ( 70.00 ) *rho *rho *rho * rho + & + ( -504.00 ) *rho *rho *rho *rho *rho * rho + & + ( 1260.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1320.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * sin(12.00 * phi) + ! n = 12, m = -2 + zn(6) = ( ( -21.00 ) *rho * rho + & + ( 280.00 ) *rho *rho *rho * rho + & + ( -1260.00 ) *rho *rho *rho *rho *rho * rho + & + ( 2520.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -2310.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 792.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * sin(12.00 * phi) + ! n = 12, m = 0 + zn(7) = ( ( 1.00 ) + & + ( -42.00 ) *rho * rho + & + ( 420.00 ) *rho *rho *rho * rho + & + ( -1680.00 ) *rho *rho *rho *rho *rho * rho + & + ( 3150.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -2772.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 924.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 3.605551275464 ) + ! n = 12, m = 2 + zn(8) = ( ( -21.00 ) *rho * rho + & + ( 280.00 ) *rho *rho *rho * rho + & + ( -1260.00 ) *rho *rho *rho *rho *rho * rho + & + ( 2520.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -2310.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 792.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * cos(12.00 * phi) + ! n = 12, m = 4 + zn(9) = ( ( 70.00 ) *rho *rho *rho * rho + & + ( -504.00 ) *rho *rho *rho *rho *rho * rho + & + ( 1260.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1320.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * cos(12.00 * phi) + ! n = 12, m = 6 + zn(10) = ( ( -84.00 ) *rho *rho *rho *rho *rho * rho + & + ( 360.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 220.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * cos(12.00 * phi) + ! n = 12, m = 8 + zn(11) = ( ( 45.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -110.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 66.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * cos(12.00 * phi) + ! n = 12, m = 10 + zn(12) = ( ( -11.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 12.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * cos(12.00 * phi) + ! n = 12, m = 12 + zn(13) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * cos(12.00 * phi) + case(13) + ! n = 13, m = -13 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * sin(13.00 * phi) + ! n = 13, m = -11 + zn(2) = ( ( -12.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 13.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * sin(13.00 * phi) + ! n = 13, m = -9 + zn(3) = ( ( 55.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -132.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 78.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * sin(13.00 * phi) + ! n = 13, m = -7 + zn(4) = ( ( -120.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -660.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 286.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * sin(13.00 * phi) + ! n = 13, m = -5 + zn(5) = ( ( 126.00 ) *rho *rho *rho *rho * rho + & + ( -840.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 715.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * sin(13.00 * phi) + ! n = 13, m = -3 + zn(6) = ( ( -56.00 ) *rho *rho * rho + & + ( 630.00 ) *rho *rho *rho *rho * rho + & + ( -2520.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 4620.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -3960.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1287.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * sin(13.00 * phi) + ! n = 13, m = -1 + zn(7) = ( ( 7.00 ) * rho + & + ( -168.00 ) *rho *rho * rho + & + ( 1260.00 ) *rho *rho *rho *rho * rho + & + ( -4200.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 6930.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -5544.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1716.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * sin(13.00 * phi) + ! n = 13, m = 1 + zn(8) = ( ( 7.00 ) * rho + & + ( -168.00 ) *rho *rho * rho + & + ( 1260.00 ) *rho *rho *rho *rho * rho + & + ( -4200.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 6930.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -5544.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1716.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * cos(13.00 * phi) + ! n = 13, m = 3 + zn(9) = ( ( -56.00 ) *rho *rho * rho + & + ( 630.00 ) *rho *rho *rho *rho * rho + & + ( -2520.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 4620.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -3960.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1287.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * cos(13.00 * phi) + ! n = 13, m = 5 + zn(10) = ( ( 126.00 ) *rho *rho *rho *rho * rho + & + ( -840.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 715.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * cos(13.00 * phi) + ! n = 13, m = 7 + zn(11) = ( ( -120.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -660.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 286.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * cos(13.00 * phi) + ! n = 13, m = 9 + zn(12) = ( ( 55.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -132.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 78.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * cos(13.00 * phi) + ! n = 13, m = 11 + zn(13) = ( ( -12.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 13.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * cos(13.00 * phi) + ! n = 13, m = 13 + zn(14) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * cos(13.00 * phi) + case(14) + ! n = 14, m = -14 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * sin(14.00 * phi) + ! n = 14, m = -12 + zn(2) = ( ( -13.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 14.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * sin(14.00 * phi) + ! n = 14, m = -10 + zn(3) = ( ( 66.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -156.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 91.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * sin(14.00 * phi) + ! n = 14, m = -8 + zn(4) = ( ( -165.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 660.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -858.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 364.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * sin(14.00 * phi) + ! n = 14, m = -6 + zn(5) = ( ( 210.00 ) *rho *rho *rho *rho *rho * rho + & + ( -1320.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 2970.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -2860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1001.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * sin(14.00 * phi) + ! n = 14, m = -4 + zn(6) = ( ( -126.00 ) *rho *rho *rho * rho + & + ( 1260.00 ) *rho *rho *rho *rho *rho * rho + & + ( -4620.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 7920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 2002.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * sin(14.00 * phi) + ! n = 14, m = -2 + zn(7) = ( ( 28.00 ) *rho * rho + & + ( -504.00 ) *rho *rho *rho * rho + & + ( 3150.00 ) *rho *rho *rho *rho *rho * rho + & + ( -9240.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 13860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -10296.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 3003.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * sin(14.00 * phi) + ! n = 14, m = 0 + zn(8) = ( ( -1.00 ) + & + ( 56.00 ) *rho * rho + & + ( -756.00 ) *rho *rho *rho * rho + & + ( 4200.00 ) *rho *rho *rho *rho *rho * rho + & + ( -11550.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 16632.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -12012.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 3432.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 3.872983346207 ) + ! n = 14, m = 2 + zn(9) = ( ( 28.00 ) *rho * rho + & + ( -504.00 ) *rho *rho *rho * rho + & + ( 3150.00 ) *rho *rho *rho *rho *rho * rho + & + ( -9240.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 13860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -10296.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 3003.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * cos(14.00 * phi) + ! n = 14, m = 4 + zn(10) = ( ( -126.00 ) *rho *rho *rho * rho + & + ( 1260.00 ) *rho *rho *rho *rho *rho * rho + & + ( -4620.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 7920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 2002.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * cos(14.00 * phi) + ! n = 14, m = 6 + zn(11) = ( ( 210.00 ) *rho *rho *rho *rho *rho * rho + & + ( -1320.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 2970.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -2860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1001.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * cos(14.00 * phi) + ! n = 14, m = 8 + zn(12) = ( ( -165.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 660.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -858.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 364.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * cos(14.00 * phi) + ! n = 14, m = 10 + zn(13) = ( ( 66.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -156.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 91.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * cos(14.00 * phi) + ! n = 14, m = 12 + zn(14) = ( ( -13.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 14.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * cos(14.00 * phi) + ! n = 14, m = 14 + zn(15) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * cos(14.00 * phi) + case(15) + ! n = 15, m = -15 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * sin(15.00 * phi) + ! n = 15, m = -13 + zn(2) = ( ( -14.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 15.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * sin(15.00 * phi) + ! n = 15, m = -11 + zn(3) = ( ( 78.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -182.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 105.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * sin(15.00 * phi) + ! n = 15, m = -9 + zn(4) = ( ( -220.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 858.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1092.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 455.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * sin(15.00 * phi) + ! n = 15, m = -7 + zn(5) = ( ( 330.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 4290.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -4004.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * sin(15.00 * phi) + ! n = 15, m = -5 + zn(6) = ( ( -252.00 ) *rho *rho *rho *rho * rho + & + ( 2310.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -7920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -10010.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 3003.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * sin(15.00 * phi) + ! n = 15, m = -3 + zn(7) = ( ( 84.00 ) *rho *rho * rho + & + ( -1260.00 ) *rho *rho *rho *rho * rho + & + ( 6930.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -18480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 25740.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -18018.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 5005.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * sin(15.00 * phi) + ! n = 15, m = -1 + zn(8) = ( ( -8.00 ) * rho + & + ( 252.00 ) *rho *rho * rho + & + ( -2520.00 ) *rho *rho *rho *rho * rho + & + ( 11550.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -27720.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 36036.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -24024.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * sin(15.00 * phi) + ! n = 15, m = 1 + zn(9) = ( ( -8.00 ) * rho + & + ( 252.00 ) *rho *rho * rho + & + ( -2520.00 ) *rho *rho *rho *rho * rho + & + ( 11550.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -27720.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 36036.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -24024.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * cos(15.00 * phi) + ! n = 15, m = 3 + zn(10) = ( ( 84.00 ) *rho *rho * rho + & + ( -1260.00 ) *rho *rho *rho *rho * rho + & + ( 6930.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -18480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 25740.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -18018.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 5005.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * cos(15.00 * phi) + ! n = 15, m = 5 + zn(11) = ( ( -252.00 ) *rho *rho *rho *rho * rho + & + ( 2310.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -7920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -10010.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 3003.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * cos(15.00 * phi) + ! n = 15, m = 7 + zn(12) = ( ( 330.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 4290.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -4004.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * cos(15.00 * phi) + ! n = 15, m = 9 + zn(13) = ( ( -220.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 858.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1092.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 455.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * cos(15.00 * phi) + ! n = 15, m = 11 + zn(14) = ( ( 78.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -182.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 105.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * cos(15.00 * phi) + ! n = 15, m = 13 + zn(15) = ( ( -14.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 15.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * cos(15.00 * phi) + ! n = 15, m = 15 + zn(16) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * cos(15.00 * phi) + case(16) + ! n = 16, m = -16 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * sin(16.00 * phi) + ! n = 16, m = -14 + zn(2) = ( ( -15.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 16.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * sin(16.00 * phi) + ! n = 16, m = -12 + zn(3) = ( ( 91.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * sin(16.00 * phi) + ! n = 16, m = -10 + zn(4) = ( ( -286.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1092.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 560.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * sin(16.00 * phi) + ! n = 16, m = -8 + zn(5) = ( ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -2860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 6006.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -5460.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1820.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * sin(16.00 * phi) + ! n = 16, m = -6 + zn(6) = ( ( -462.00 ) *rho *rho *rho *rho *rho * rho + & + ( 3960.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 20020.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -15015.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 4368.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * sin(16.00 * phi) + ! n = 16, m = -4 + zn(7) = ( ( 210.00 ) *rho *rho *rho * rho + & + ( -2772.00 ) *rho *rho *rho *rho *rho * rho + & + ( 13860.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -34320.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 8008.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * sin(16.00 * phi) + ! n = 16, m = -2 + zn(8) = ( ( -36.00 ) *rho * rho + & + ( 840.00 ) *rho *rho *rho * rho + & + ( -6930.00 ) *rho *rho *rho *rho *rho * rho + & + ( 27720.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 72072.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 11440.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * sin(16.00 * phi) + ! n = 16, m = 0 + zn(9) = ( ( 1.00 ) + & + ( -72.00 ) *rho * rho + & + ( 1260.00 ) *rho *rho *rho * rho + & + ( -9240.00 ) *rho *rho *rho *rho *rho * rho + & + ( 34650.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -72072.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 84084.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -51480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.123105625618 ) + ! n = 16, m = 2 + zn(10) = ( ( -36.00 ) *rho * rho + & + ( 840.00 ) *rho *rho *rho * rho + & + ( -6930.00 ) *rho *rho *rho *rho *rho * rho + & + ( 27720.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 72072.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 11440.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * cos(16.00 * phi) + ! n = 16, m = 4 + zn(11) = ( ( 210.00 ) *rho *rho *rho * rho + & + ( -2772.00 ) *rho *rho *rho *rho *rho * rho + & + ( 13860.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -34320.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 8008.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * cos(16.00 * phi) + ! n = 16, m = 6 + zn(12) = ( ( -462.00 ) *rho *rho *rho *rho *rho * rho + & + ( 3960.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 20020.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -15015.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 4368.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * cos(16.00 * phi) + ! n = 16, m = 8 + zn(13) = ( ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -2860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 6006.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -5460.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1820.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * cos(16.00 * phi) + ! n = 16, m = 10 + zn(14) = ( ( -286.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1092.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 560.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * cos(16.00 * phi) + ! n = 16, m = 12 + zn(15) = ( ( 91.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * cos(16.00 * phi) + ! n = 16, m = 14 + zn(16) = ( ( -15.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 16.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * cos(16.00 * phi) + ! n = 16, m = 16 + zn(17) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * cos(16.00 * phi) + case(17) + ! n = 17, m = -17 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * sin(17.00 * phi) + ! n = 17, m = -15 + zn(2) = ( ( -16.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 17.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * sin(17.00 * phi) + ! n = 17, m = -13 + zn(3) = ( ( 105.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -240.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 136.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * sin(17.00 * phi) + ! n = 17, m = -11 + zn(4) = ( ( -364.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * sin(17.00 * phi) + ! n = 17, m = -9 + zn(5) = ( ( 715.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -4004.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 8190.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -7280.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 2380.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * sin(17.00 * phi) + ! n = 17, m = -7 + zn(6) = ( ( -792.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -20020.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -21840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 6188.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * sin(17.00 * phi) + ! n = 17, m = -5 + zn(7) = ( ( 462.00 ) *rho *rho *rho *rho * rho + & + ( -5544.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 25740.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 75075.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -48048.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 12376.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * sin(17.00 * phi) + ! n = 17, m = -3 + zn(8) = ( ( -120.00 ) *rho *rho * rho + & + ( 2310.00 ) *rho *rho *rho *rho * rho + & + ( -16632.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 135135.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -80080.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 19448.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * sin(17.00 * phi) + ! n = 17, m = -1 + zn(9) = ( ( 9.00 ) * rho + & + ( -360.00 ) *rho *rho * rho + & + ( 4620.00 ) *rho *rho *rho *rho * rho + & + ( -27720.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 90090.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -168168.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 180180.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -102960.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 24310.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * sin(17.00 * phi) + ! n = 17, m = 1 + zn(10) = ( ( 9.00 ) * rho + & + ( -360.00 ) *rho *rho * rho + & + ( 4620.00 ) *rho *rho *rho *rho * rho + & + ( -27720.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 90090.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -168168.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 180180.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -102960.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 24310.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * cos(17.00 * phi) + ! n = 17, m = 3 + zn(11) = ( ( -120.00 ) *rho *rho * rho + & + ( 2310.00 ) *rho *rho *rho *rho * rho + & + ( -16632.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 135135.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -80080.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 19448.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * cos(17.00 * phi) + ! n = 17, m = 5 + zn(12) = ( ( 462.00 ) *rho *rho *rho *rho * rho + & + ( -5544.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 25740.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 75075.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -48048.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 12376.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * cos(17.00 * phi) + ! n = 17, m = 7 + zn(13) = ( ( -792.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -20020.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -21840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 6188.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * cos(17.00 * phi) + ! n = 17, m = 9 + zn(14) = ( ( 715.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -4004.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 8190.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -7280.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 2380.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * cos(17.00 * phi) + ! n = 17, m = 11 + zn(15) = ( ( -364.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * cos(17.00 * phi) + ! n = 17, m = 13 + zn(16) = ( ( 105.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -240.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 136.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * cos(17.00 * phi) + ! n = 17, m = 15 + zn(17) = ( ( -16.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 17.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * cos(17.00 * phi) + ! n = 17, m = 17 + zn(18) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * cos(17.00 * phi) + case(18) + ! n = 18, m = -18 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * sin(18.00 * phi) + ! n = 18, m = -16 + zn(2) = ( ( -17.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 18.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * sin(18.00 * phi) + ! n = 18, m = -14 + zn(3) = ( ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -272.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 153.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * sin(18.00 * phi) + ! n = 18, m = -12 + zn(4) = ( ( -455.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -2040.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 816.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * sin(18.00 * phi) + ! n = 18, m = -10 + zn(5) = ( ( 1001.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -5460.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 10920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -9520.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 3060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * sin(18.00 * phi) + ! n = 18, m = -8 + zn(6) = ( ( -1287.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 10010.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 43680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -30940.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 8568.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * sin(18.00 * phi) + ! n = 18, m = -6 + zn(7) = ( ( 924.00 ) *rho *rho *rho *rho *rho * rho + & + ( -10296.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -100100.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -74256.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 18564.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * sin(18.00 * phi) + ! n = 18, m = -4 + zn(8) = ( ( -330.00 ) *rho *rho *rho * rho + & + ( 5544.00 ) *rho *rho *rho *rho *rho * rho + & + ( -36036.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -225225.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 240240.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -136136.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 31824.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * sin(18.00 * phi) + ! n = 18, m = -2 + zn(9) = ( ( 45.00 ) *rho * rho + & + ( -1320.00 ) *rho *rho *rho * rho + & + ( 13860.00 ) *rho *rho *rho *rho *rho * rho + & + ( -72072.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 210210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -360360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 360360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -194480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 43758.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * sin(18.00 * phi) + ! n = 18, m = 0 + zn(10) = ( ( -1.00 ) + & + ( 90.00 ) *rho * rho + & + ( -1980.00 ) *rho *rho *rho * rho + & + ( 18480.00 ) *rho *rho *rho *rho *rho * rho + & + ( -90090.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 252252.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -420420.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 411840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -218790.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 48620.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.358898943541 ) + ! n = 18, m = 2 + zn(11) = ( ( 45.00 ) *rho * rho + & + ( -1320.00 ) *rho *rho *rho * rho + & + ( 13860.00 ) *rho *rho *rho *rho *rho * rho + & + ( -72072.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 210210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -360360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 360360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -194480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 43758.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * cos(18.00 * phi) + ! n = 18, m = 4 + zn(12) = ( ( -330.00 ) *rho *rho *rho * rho + & + ( 5544.00 ) *rho *rho *rho *rho *rho * rho + & + ( -36036.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -225225.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 240240.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -136136.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 31824.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * cos(18.00 * phi) + ! n = 18, m = 6 + zn(13) = ( ( 924.00 ) *rho *rho *rho *rho *rho * rho + & + ( -10296.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -100100.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -74256.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 18564.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * cos(18.00 * phi) + ! n = 18, m = 8 + zn(14) = ( ( -1287.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 10010.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 43680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -30940.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 8568.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * cos(18.00 * phi) + ! n = 18, m = 10 + zn(15) = ( ( 1001.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -5460.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 10920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -9520.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 3060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * cos(18.00 * phi) + ! n = 18, m = 12 + zn(16) = ( ( -455.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -2040.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 816.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * cos(18.00 * phi) + ! n = 18, m = 14 + zn(17) = ( ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -272.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 153.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * cos(18.00 * phi) + ! n = 18, m = 16 + zn(18) = ( ( -17.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 18.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * cos(18.00 * phi) + ! n = 18, m = 18 + zn(19) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * cos(18.00 * phi) + case default + zn = ONE + end select + + end function calc_zn + +!=============================================================================== +! CALC_ZN_SCALED calculates the n-th order Zernike polynomial moment for a given +! angle (rho, theta) location in the unit disk, scaled correctly for orthogonal +! integration. +!=============================================================================== + + pure function calc_zn_scaled(n, rho, phi) result(zn) + + integer, intent(in) :: n ! Order requested + real(8), intent(in) :: rho ! Radial location in the unit disk + real(8), intent(in) :: phi ! Theta (radians) location in the unit disk + real(8) :: zn(n + 1) ! The resultant Z_n(uvw) + + zn = calc_zn(n, rho, phi) / SQRT_PI + + end function calc_zn_scaled + +!=============================================================================== +! C API FUNCTIONS +!=============================================================================== + + +end module tally_filter_zernike diff --git a/src/tallies/tally_header.F90 b/src/tallies/tally_header.F90 index 15b8c2df5d..29362fee3c 100644 --- a/src/tallies/tally_header.F90 +++ b/src/tallies/tally_header.F90 @@ -362,6 +362,9 @@ contains type is (SpatialLegendreFilter) j = FILTER_SPTL_LEGENDRE this % estimator = ESTIMATOR_COLLISION + type is (ZernikeFilter) + j = FILTER_ZERNIKE + this % estimator = ESTIMATOR_COLLISION end select this % find_filter(j) = i end do From 175942c221cd3c37345fbf08ee9bfc63e5b57aab Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 10 Jan 2018 06:35:26 -0600 Subject: [PATCH 139/231] Add ZernikeFilter class --- openmc/__init__.py | 1 + openmc/filter_spatial_legendre.py | 6 + openmc/filter_zernike.py | 183 +++++++++++++++++++++++++++ src/tallies/tally_filter_zernike.F90 | 4 +- 4 files changed, 192 insertions(+), 2 deletions(-) create mode 100644 openmc/filter_zernike.py diff --git a/openmc/__init__.py b/openmc/__init__.py index e9dd0bd8c3..100aff8c8a 100644 --- a/openmc/__init__.py +++ b/openmc/__init__.py @@ -18,6 +18,7 @@ from openmc.filter import * from openmc.filter_legendre import * from openmc.filter_spatial_legendre import * from openmc.filter_spherical_harmonics import * +from openmc.filter_zernike import * from openmc.trigger import * from openmc.tally_derivative import * from openmc.tallies import * diff --git a/openmc/filter_spatial_legendre.py b/openmc/filter_spatial_legendre.py index 1ad23666bb..690447d9cb 100644 --- a/openmc/filter_spatial_legendre.py +++ b/openmc/filter_spatial_legendre.py @@ -49,11 +49,17 @@ class SpatialLegendreFilter(Filter): def __hash__(self): string = type(self).__name__ + '\n' string += '{: <16}=\t{}\n'.format('\tOrder', self.order) + string += '{: <16}=\t{}\n'.format('\tAxis', self.axis) + string += '{: <16}=\t{}\n'.format('\tMin', self.minimum) + string += '{: <16}=\t{}\n'.format('\tMax', self.maximum) return hash(string) def __repr__(self): string = type(self).__name__ + '\n' string += '{: <16}=\t{}\n'.format('\tOrder', self.order) + string += '{: <16}=\t{}\n'.format('\tAxis', self.axis) + string += '{: <16}=\t{}\n'.format('\tMin', self.minimum) + string += '{: <16}=\t{}\n'.format('\tMax', self.maximum) string += '{: <16}=\t{}\n'.format('\tID', self.id) return string diff --git a/openmc/filter_zernike.py b/openmc/filter_zernike.py new file mode 100644 index 0000000000..3b4efe5d58 --- /dev/null +++ b/openmc/filter_zernike.py @@ -0,0 +1,183 @@ +from numbers import Integral, Real +from xml.etree import ElementTree as ET + +import numpy as np +import pandas as pd + +import openmc.checkvalue as cv +from . import Filter + + +class ZernikeFilter(Filter): + r"""Score Zernike expansion moments in space up to specified order. + + This filter allows scores to be multiplied by Zernike polynomials of the the + particle's position along a particular axis, normalized to a given unit + circle, up to a user-specified order. + + Parameters + ---------- + order : int + Maximum Zernike polynomial order + x : float + x-coordinate of center of circle for normalization + y : float + y-coordinate of center of circle for normalization + r : int or None + Radius of circle for normalization + + Attributes + ---------- + order : int + Maximum Zernike polynomial order + x : float + x-coordinate of center of circle for normalization + y : float + y-coordinate of center of circle for normalization + r : int or None + Radius of circle for normalization + id : int + Unique identifier for the filter + num_bins : int + The number of filter bins + + """ + + def __init__(self, order, x, y, r, filter_id=None): + self.order = order + self.x = x + self.y = y + self.r = r + self.id = filter_id + + def __hash__(self): + string = type(self).__name__ + '\n' + string += '{: <16}=\t{}\n'.format('\tOrder', self.order) + return hash(string) + + def __repr__(self): + string = type(self).__name__ + '\n' + string += '{: <16}=\t{}\n'.format('\tOrder', self.order) + string += '{: <16}=\t{}\n'.format('\tID', self.id) + return string + + @property + def order(self): + return self._order + + @order.setter + def order(self, order): + cv.check_type('Zernike order', order, Integral) + cv.check_greater_than('Zernike order', order, 0, equality=True) + self._order = order + + @property + def x(self): + return self._x + + @x.setter + def x(self, x): + cv.check_type('x', x, Real) + self._x = x + + @property + def y(self): + return self._y + + @y.setter + def y(self, y): + cv.check_type('y', y, Real) + self._y = y + + @property + def r(self): + return self._r + + @r.setter + def r(self, r): + cv.check_type('r', r, Real) + self._r = r + + @property + def num_bins(self): + n = self._order + return ((n + 1)*(n + 2))//2 + + @classmethod + def from_hdf5(cls, group, **kwargs): + if group['type'].value.decode() != cls.short_name.lower(): + raise ValueError("Expected HDF5 data for filter type '" + + cls.short_name.lower() + "' but got '" + + group['type'].value.decode() + " instead") + + filter_id = int(group.name.split('/')[-1].lstrip('filter ')) + order = group['order'].value + x, y, r = group['x'].value, group['y'].value, group['r'].value + + return cls(order, x, y, r, filter_id) + + def get_pandas_dataframe(self, data_size, stride, **kwargs): + """Builds a Pandas DataFrame for the Filter's bins. + + This method constructs a Pandas DataFrame object for the filter with + columns annotated by filter bin information. This is a helper method for + :meth:`Tally.get_pandas_dataframe`. + + Parameters + ---------- + data_size : Integral + The total number of bins in the tally corresponding to this filter + + Returns + ------- + pandas.DataFrame + A Pandas DataFrame with a column that is filled with strings + indicating Zernike orders. The number of rows in the DataFrame is + the same as the total number of bins in the corresponding tally. + + See also + -------- + Tally.get_pandas_dataframe(), CrossFilter.get_pandas_dataframe() + + """ + # Initialize Pandas DataFrame + df = pd.DataFrame() + + # Create list of strings for each order + orders = [] + for n in range(self.order + 1): + for m in range(-n, n + 1, 2): + orders.append('Z{},{}'.format(n, m)) + + bins = np.array(orders) + filter_bins = np.repeat(bins, stride) + tile_factor = data_size // len(filter_bins) + filter_bins = np.tile(filter_bins, tile_factor) + df = pd.concat([df, pd.DataFrame( + {self.short_name.lower(): filter_bins})]) + + return df + + def to_xml_element(self): + """Return XML Element representing the filter. + + Returns + ------- + element : xml.etree.ElementTree.Element + XML element containing Zernike filter data + + """ + element = ET.Element('filter') + element.set('id', str(self.id)) + element.set('type', self.short_name.lower()) + + subelement = ET.SubElement(element, 'order') + subelement.text = str(self.order) + subelement = ET.SubElement(element, 'x') + subelement.text = str(self.x) + subelement = ET.SubElement(element, 'y') + subelement.text = str(self.y) + subelement = ET.SubElement(element, 'r') + subelement.text = str(self.r) + + return element diff --git a/src/tallies/tally_filter_zernike.F90 b/src/tallies/tally_filter_zernike.F90 index 8ee07a67c8..6f00e131d8 100644 --- a/src/tallies/tally_filter_zernike.F90 +++ b/src/tallies/tally_filter_zernike.F90 @@ -51,7 +51,7 @@ contains ! Get specified order call get_node_value(node, "order", n) this % order = n - this % n_bins = (n + 1)*(n + 2)/2 + this % n_bins = ((n + 1)*(n + 2))/2 end subroutine from_xml subroutine get_all_bins(this, p, estimator, match) @@ -112,7 +112,7 @@ contains if (bin <= last) then first = last - n m = -n + (bin - first)*2 - label = "Zernike expansion, Y" // trim(to_str(n)) // "," & + label = "Zernike expansion, Z" // trim(to_str(n)) // "," & // trim(to_str(m)) exit end if From 6b5fb87d350610964d6444eddf8c57004ec7c890 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 10 Jan 2018 12:43:00 -0600 Subject: [PATCH 140/231] Move calc_zn to math module, remove calc_zn_scaled --- src/math.F90 | 1136 +++++++++++++++++++++++++ src/tallies/tally_filter_zernike.F90 | 1157 +------------------------- 2 files changed, 1138 insertions(+), 1155 deletions(-) diff --git a/src/math.F90 b/src/math.F90 index 2fa0a6ce1e..b96562734f 100644 --- a/src/math.F90 +++ b/src/math.F90 @@ -574,6 +574,1142 @@ contains end function calc_rn +!=============================================================================== +! CALC_ZN calculates the n-th order Zernike polynomial moment for a given angle +! (rho, theta) location in the unit disk. +!=============================================================================== + + pure function calc_zn(n, rho, phi) result(zn) + + integer, intent(in) :: n ! Order requested + real(8), intent(in) :: rho ! Radial location in the unit disk + real(8), intent(in) :: phi ! Theta (radians) location in the unit disk + real(8) :: zn(n + 1) ! The resultant Z_n(uvw) + + ! n == radial degree + ! m == azimuthal frequency + + select case(n) + case(0) + ! n = 0, m = 0 + zn(1) = ( ( 1.00 ) ) & + * ( 1.000000000000 ) + case(1) + ! n = 1, m = -1 + zn(1) = ( ( 1.00 ) * rho ) & + * ( 2.000000000000 ) * sin(1.00 * phi) + ! n = 1, m = 1 + zn(2) = ( ( 1.00 ) * rho ) & + * ( 2.000000000000 ) * cos(1.00 * phi) + case(2) + ! n = 2, m = -2 + zn(1) = ( ( 1.00 ) *rho * rho ) & + * ( 2.449489742783 ) * sin(2.00 * phi) + ! n = 2, m = 0 + zn(2) = ( ( -1.00 ) + & + ( 2.00 ) *rho * rho ) & + * ( 1.732050807569 ) + ! n = 2, m = 2 + zn(3) = ( ( 1.00 ) *rho * rho ) & + * ( 2.449489742783 ) * cos(2.00 * phi) + case(3) + ! n = 3, m = -3 + zn(1) = ( ( 1.00 ) *rho *rho * rho ) & + * ( 2.828427124746 ) * sin(3.00 * phi) + ! n = 3, m = -1 + zn(2) = ( ( -2.00 ) * rho + & + ( 3.00 ) *rho *rho * rho ) & + * ( 2.828427124746 ) * sin(3.00 * phi) + ! n = 3, m = 1 + zn(3) = ( ( -2.00 ) * rho + & + ( 3.00 ) *rho *rho * rho ) & + * ( 2.828427124746 ) * cos(3.00 * phi) + ! n = 3, m = 3 + zn(4) = ( ( 1.00 ) *rho *rho * rho ) & + * ( 2.828427124746 ) * cos(3.00 * phi) + case(4) + ! n = 4, m = -4 + zn(1) = ( ( 1.00 ) *rho *rho *rho * rho ) & + * ( 3.162277660168 ) * sin(4.00 * phi) + ! n = 4, m = -2 + zn(2) = ( ( -3.00 ) *rho * rho + & + ( 4.00 ) *rho *rho *rho * rho ) & + * ( 3.162277660168 ) * sin(4.00 * phi) + ! n = 4, m = 0 + zn(3) = ( ( 1.00 ) + & + ( -6.00 ) *rho * rho + & + ( 6.00 ) *rho *rho *rho * rho ) & + * ( 2.236067977500 ) + ! n = 4, m = 2 + zn(4) = ( ( -3.00 ) *rho * rho + & + ( 4.00 ) *rho *rho *rho * rho ) & + * ( 3.162277660168 ) * cos(4.00 * phi) + ! n = 4, m = 4 + zn(5) = ( ( 1.00 ) *rho *rho *rho * rho ) & + * ( 3.162277660168 ) * cos(4.00 * phi) + case(5) + ! n = 5, m = -5 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho * rho ) & + * ( 3.464101615138 ) * sin(5.00 * phi) + ! n = 5, m = -3 + zn(2) = ( ( -4.00 ) *rho *rho * rho + & + ( 5.00 ) *rho *rho *rho *rho * rho ) & + * ( 3.464101615138 ) * sin(5.00 * phi) + ! n = 5, m = -1 + zn(3) = ( ( 3.00 ) * rho + & + ( -12.00 ) *rho *rho * rho + & + ( 10.00 ) *rho *rho *rho *rho * rho ) & + * ( 3.464101615138 ) * sin(5.00 * phi) + ! n = 5, m = 1 + zn(4) = ( ( 3.00 ) * rho + & + ( -12.00 ) *rho *rho * rho + & + ( 10.00 ) *rho *rho *rho *rho * rho ) & + * ( 3.464101615138 ) * cos(5.00 * phi) + ! n = 5, m = 3 + zn(5) = ( ( -4.00 ) *rho *rho * rho + & + ( 5.00 ) *rho *rho *rho *rho * rho ) & + * ( 3.464101615138 ) * cos(5.00 * phi) + ! n = 5, m = 5 + zn(6) = ( ( 1.00 ) *rho *rho *rho *rho * rho ) & + * ( 3.464101615138 ) * cos(5.00 * phi) + case(6) + ! n = 6, m = -6 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho * rho ) & + * ( 3.741657386774 ) * sin(6.00 * phi) + ! n = 6, m = -4 + zn(2) = ( ( -5.00 ) *rho *rho *rho * rho + & + ( 6.00 ) *rho *rho *rho *rho *rho * rho ) & + * ( 3.741657386774 ) * sin(6.00 * phi) + ! n = 6, m = -2 + zn(3) = ( ( 6.00 ) *rho * rho + & + ( -20.00 ) *rho *rho *rho * rho + & + ( 15.00 ) *rho *rho *rho *rho *rho * rho ) & + * ( 3.741657386774 ) * sin(6.00 * phi) + ! n = 6, m = 0 + zn(4) = ( ( -1.00 ) + & + ( 12.00 ) *rho * rho + & + ( -30.00 ) *rho *rho *rho * rho + & + ( 20.00 ) *rho *rho *rho *rho *rho * rho ) & + * ( 2.645751311065 ) + ! n = 6, m = 2 + zn(5) = ( ( 6.00 ) *rho * rho + & + ( -20.00 ) *rho *rho *rho * rho + & + ( 15.00 ) *rho *rho *rho *rho *rho * rho ) & + * ( 3.741657386774 ) * cos(6.00 * phi) + ! n = 6, m = 4 + zn(6) = ( ( -5.00 ) *rho *rho *rho * rho + & + ( 6.00 ) *rho *rho *rho *rho *rho * rho ) & + * ( 3.741657386774 ) * cos(6.00 * phi) + ! n = 6, m = 6 + zn(7) = ( ( 1.00 ) *rho *rho *rho *rho *rho * rho ) & + * ( 3.741657386774 ) * cos(6.00 * phi) + case(7) + ! n = 7, m = -7 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.000000000000 ) * sin(7.00 * phi) + ! n = 7, m = -5 + zn(2) = ( ( -6.00 ) *rho *rho *rho *rho * rho + & + ( 7.00 ) *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.000000000000 ) * sin(7.00 * phi) + ! n = 7, m = -3 + zn(3) = ( ( 10.00 ) *rho *rho * rho + & + ( -30.00 ) *rho *rho *rho *rho * rho + & + ( 21.00 ) *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.000000000000 ) * sin(7.00 * phi) + ! n = 7, m = -1 + zn(4) = ( ( -4.00 ) * rho + & + ( 30.00 ) *rho *rho * rho + & + ( -60.00 ) *rho *rho *rho *rho * rho + & + ( 35.00 ) *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.000000000000 ) * sin(7.00 * phi) + ! n = 7, m = 1 + zn(5) = ( ( -4.00 ) * rho + & + ( 30.00 ) *rho *rho * rho + & + ( -60.00 ) *rho *rho *rho *rho * rho + & + ( 35.00 ) *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.000000000000 ) * cos(7.00 * phi) + ! n = 7, m = 3 + zn(6) = ( ( 10.00 ) *rho *rho * rho + & + ( -30.00 ) *rho *rho *rho *rho * rho + & + ( 21.00 ) *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.000000000000 ) * cos(7.00 * phi) + ! n = 7, m = 5 + zn(7) = ( ( -6.00 ) *rho *rho *rho *rho * rho + & + ( 7.00 ) *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.000000000000 ) * cos(7.00 * phi) + ! n = 7, m = 7 + zn(8) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.000000000000 ) * cos(7.00 * phi) + case(8) + ! n = 8, m = -8 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.242640687119 ) * sin(8.00 * phi) + ! n = 8, m = -6 + zn(2) = ( ( -7.00 ) *rho *rho *rho *rho *rho * rho + & + ( 8.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.242640687119 ) * sin(8.00 * phi) + ! n = 8, m = -4 + zn(3) = ( ( 15.00 ) *rho *rho *rho * rho + & + ( -42.00 ) *rho *rho *rho *rho *rho * rho + & + ( 28.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.242640687119 ) * sin(8.00 * phi) + ! n = 8, m = -2 + zn(4) = ( ( -10.00 ) *rho * rho + & + ( 60.00 ) *rho *rho *rho * rho + & + ( -105.00 ) *rho *rho *rho *rho *rho * rho + & + ( 56.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.242640687119 ) * sin(8.00 * phi) + ! n = 8, m = 0 + zn(5) = ( ( 1.00 ) + & + ( -20.00 ) *rho * rho + & + ( 90.00 ) *rho *rho *rho * rho + & + ( -140.00 ) *rho *rho *rho *rho *rho * rho + & + ( 70.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 3.000000000000 ) + ! n = 8, m = 2 + zn(6) = ( ( -10.00 ) *rho * rho + & + ( 60.00 ) *rho *rho *rho * rho + & + ( -105.00 ) *rho *rho *rho *rho *rho * rho + & + ( 56.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.242640687119 ) * cos(8.00 * phi) + ! n = 8, m = 4 + zn(7) = ( ( 15.00 ) *rho *rho *rho * rho + & + ( -42.00 ) *rho *rho *rho *rho *rho * rho + & + ( 28.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.242640687119 ) * cos(8.00 * phi) + ! n = 8, m = 6 + zn(8) = ( ( -7.00 ) *rho *rho *rho *rho *rho * rho + & + ( 8.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.242640687119 ) * cos(8.00 * phi) + ! n = 8, m = 8 + zn(9) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.242640687119 ) * cos(8.00 * phi) + case(9) + ! n = 9, m = -9 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * sin(9.00 * phi) + ! n = 9, m = -7 + zn(2) = ( ( -8.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 9.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * sin(9.00 * phi) + ! n = 9, m = -5 + zn(3) = ( ( 21.00 ) *rho *rho *rho *rho * rho + & + ( -56.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 36.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * sin(9.00 * phi) + ! n = 9, m = -3 + zn(4) = ( ( -20.00 ) *rho *rho * rho + & + ( 105.00 ) *rho *rho *rho *rho * rho + & + ( -168.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 84.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * sin(9.00 * phi) + ! n = 9, m = -1 + zn(5) = ( ( 5.00 ) * rho + & + ( -60.00 ) *rho *rho * rho + & + ( 210.00 ) *rho *rho *rho *rho * rho + & + ( -280.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 126.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * sin(9.00 * phi) + ! n = 9, m = 1 + zn(6) = ( ( 5.00 ) * rho + & + ( -60.00 ) *rho *rho * rho + & + ( 210.00 ) *rho *rho *rho *rho * rho + & + ( -280.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 126.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * cos(9.00 * phi) + ! n = 9, m = 3 + zn(7) = ( ( -20.00 ) *rho *rho * rho + & + ( 105.00 ) *rho *rho *rho *rho * rho + & + ( -168.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 84.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * cos(9.00 * phi) + ! n = 9, m = 5 + zn(8) = ( ( 21.00 ) *rho *rho *rho *rho * rho + & + ( -56.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 36.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * cos(9.00 * phi) + ! n = 9, m = 7 + zn(9) = ( ( -8.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 9.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * cos(9.00 * phi) + ! n = 9, m = 9 + zn(10) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.472135955000 ) * cos(9.00 * phi) + case(10) + ! n = 10, m = -10 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * sin(10.00 * phi) + ! n = 10, m = -8 + zn(2) = ( ( -9.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 10.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * sin(10.00 * phi) + ! n = 10, m = -6 + zn(3) = ( ( 28.00 ) *rho *rho *rho *rho *rho * rho + & + ( -72.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 45.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * sin(10.00 * phi) + ! n = 10, m = -4 + zn(4) = ( ( -35.00 ) *rho *rho *rho * rho + & + ( 168.00 ) *rho *rho *rho *rho *rho * rho + & + ( -252.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * sin(10.00 * phi) + ! n = 10, m = -2 + zn(5) = ( ( 15.00 ) *rho * rho + & + ( -140.00 ) *rho *rho *rho * rho + & + ( 420.00 ) *rho *rho *rho *rho *rho * rho + & + ( -504.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * sin(10.00 * phi) + ! n = 10, m = 0 + zn(6) = ( ( -1.00 ) + & + ( 30.00 ) *rho * rho + & + ( -210.00 ) *rho *rho *rho * rho + & + ( 560.00 ) *rho *rho *rho *rho *rho * rho + & + ( -630.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 252.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 3.316624790355 ) + ! n = 10, m = 2 + zn(7) = ( ( 15.00 ) *rho * rho + & + ( -140.00 ) *rho *rho *rho * rho + & + ( 420.00 ) *rho *rho *rho *rho *rho * rho + & + ( -504.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * cos(10.00 * phi) + ! n = 10, m = 4 + zn(8) = ( ( -35.00 ) *rho *rho *rho * rho + & + ( 168.00 ) *rho *rho *rho *rho *rho * rho + & + ( -252.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * cos(10.00 * phi) + ! n = 10, m = 6 + zn(9) = ( ( 28.00 ) *rho *rho *rho *rho *rho * rho + & + ( -72.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 45.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * cos(10.00 * phi) + ! n = 10, m = 8 + zn(10) = ( ( -9.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 10.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * cos(10.00 * phi) + ! n = 10, m = 10 + zn(11) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.690415759823 ) * cos(10.00 * phi) + case(11) + ! n = 11, m = -11 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * sin(11.00 * phi) + ! n = 11, m = -9 + zn(2) = ( ( -10.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 11.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * sin(11.00 * phi) + ! n = 11, m = -7 + zn(3) = ( ( 36.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -90.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 55.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * sin(11.00 * phi) + ! n = 11, m = -5 + zn(4) = ( ( -56.00 ) *rho *rho *rho *rho * rho + & + ( 252.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 165.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * sin(11.00 * phi) + ! n = 11, m = -3 + zn(5) = ( ( 35.00 ) *rho *rho * rho + & + ( -280.00 ) *rho *rho *rho *rho * rho + & + ( 756.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 330.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * sin(11.00 * phi) + ! n = 11, m = -1 + zn(6) = ( ( -6.00 ) * rho + & + ( 105.00 ) *rho *rho * rho + & + ( -560.00 ) *rho *rho *rho *rho * rho + & + ( 1260.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -1260.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 462.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * sin(11.00 * phi) + ! n = 11, m = 1 + zn(7) = ( ( -6.00 ) * rho + & + ( 105.00 ) *rho *rho * rho + & + ( -560.00 ) *rho *rho *rho *rho * rho + & + ( 1260.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -1260.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 462.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * cos(11.00 * phi) + ! n = 11, m = 3 + zn(8) = ( ( 35.00 ) *rho *rho * rho + & + ( -280.00 ) *rho *rho *rho *rho * rho + & + ( 756.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 330.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * cos(11.00 * phi) + ! n = 11, m = 5 + zn(9) = ( ( -56.00 ) *rho *rho *rho *rho * rho + & + ( 252.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 165.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * cos(11.00 * phi) + ! n = 11, m = 7 + zn(10) = ( ( 36.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -90.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 55.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * cos(11.00 * phi) + ! n = 11, m = 9 + zn(11) = ( ( -10.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 11.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * cos(11.00 * phi) + ! n = 11, m = 11 + zn(12) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.898979485566 ) * cos(11.00 * phi) + case(12) + ! n = 12, m = -12 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * sin(12.00 * phi) + ! n = 12, m = -10 + zn(2) = ( ( -11.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 12.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * sin(12.00 * phi) + ! n = 12, m = -8 + zn(3) = ( ( 45.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -110.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 66.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * sin(12.00 * phi) + ! n = 12, m = -6 + zn(4) = ( ( -84.00 ) *rho *rho *rho *rho *rho * rho + & + ( 360.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 220.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * sin(12.00 * phi) + ! n = 12, m = -4 + zn(5) = ( ( 70.00 ) *rho *rho *rho * rho + & + ( -504.00 ) *rho *rho *rho *rho *rho * rho + & + ( 1260.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1320.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * sin(12.00 * phi) + ! n = 12, m = -2 + zn(6) = ( ( -21.00 ) *rho * rho + & + ( 280.00 ) *rho *rho *rho * rho + & + ( -1260.00 ) *rho *rho *rho *rho *rho * rho + & + ( 2520.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -2310.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 792.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * sin(12.00 * phi) + ! n = 12, m = 0 + zn(7) = ( ( 1.00 ) + & + ( -42.00 ) *rho * rho + & + ( 420.00 ) *rho *rho *rho * rho + & + ( -1680.00 ) *rho *rho *rho *rho *rho * rho + & + ( 3150.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -2772.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 924.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 3.605551275464 ) + ! n = 12, m = 2 + zn(8) = ( ( -21.00 ) *rho * rho + & + ( 280.00 ) *rho *rho *rho * rho + & + ( -1260.00 ) *rho *rho *rho *rho *rho * rho + & + ( 2520.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -2310.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 792.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * cos(12.00 * phi) + ! n = 12, m = 4 + zn(9) = ( ( 70.00 ) *rho *rho *rho * rho + & + ( -504.00 ) *rho *rho *rho *rho *rho * rho + & + ( 1260.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1320.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * cos(12.00 * phi) + ! n = 12, m = 6 + zn(10) = ( ( -84.00 ) *rho *rho *rho *rho *rho * rho + & + ( 360.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 220.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * cos(12.00 * phi) + ! n = 12, m = 8 + zn(11) = ( ( 45.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -110.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 66.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * cos(12.00 * phi) + ! n = 12, m = 10 + zn(12) = ( ( -11.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 12.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * cos(12.00 * phi) + ! n = 12, m = 12 + zn(13) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.099019513593 ) * cos(12.00 * phi) + case(13) + ! n = 13, m = -13 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * sin(13.00 * phi) + ! n = 13, m = -11 + zn(2) = ( ( -12.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 13.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * sin(13.00 * phi) + ! n = 13, m = -9 + zn(3) = ( ( 55.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -132.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 78.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * sin(13.00 * phi) + ! n = 13, m = -7 + zn(4) = ( ( -120.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -660.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 286.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * sin(13.00 * phi) + ! n = 13, m = -5 + zn(5) = ( ( 126.00 ) *rho *rho *rho *rho * rho + & + ( -840.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 715.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * sin(13.00 * phi) + ! n = 13, m = -3 + zn(6) = ( ( -56.00 ) *rho *rho * rho + & + ( 630.00 ) *rho *rho *rho *rho * rho + & + ( -2520.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 4620.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -3960.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1287.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * sin(13.00 * phi) + ! n = 13, m = -1 + zn(7) = ( ( 7.00 ) * rho + & + ( -168.00 ) *rho *rho * rho + & + ( 1260.00 ) *rho *rho *rho *rho * rho + & + ( -4200.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 6930.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -5544.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1716.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * sin(13.00 * phi) + ! n = 13, m = 1 + zn(8) = ( ( 7.00 ) * rho + & + ( -168.00 ) *rho *rho * rho + & + ( 1260.00 ) *rho *rho *rho *rho * rho + & + ( -4200.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 6930.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -5544.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1716.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * cos(13.00 * phi) + ! n = 13, m = 3 + zn(9) = ( ( -56.00 ) *rho *rho * rho + & + ( 630.00 ) *rho *rho *rho *rho * rho + & + ( -2520.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 4620.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -3960.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1287.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * cos(13.00 * phi) + ! n = 13, m = 5 + zn(10) = ( ( 126.00 ) *rho *rho *rho *rho * rho + & + ( -840.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 715.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * cos(13.00 * phi) + ! n = 13, m = 7 + zn(11) = ( ( -120.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -660.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 286.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * cos(13.00 * phi) + ! n = 13, m = 9 + zn(12) = ( ( 55.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -132.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 78.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * cos(13.00 * phi) + ! n = 13, m = 11 + zn(13) = ( ( -12.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 13.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * cos(13.00 * phi) + ! n = 13, m = 13 + zn(14) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.291502622129 ) * cos(13.00 * phi) + case(14) + ! n = 14, m = -14 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * sin(14.00 * phi) + ! n = 14, m = -12 + zn(2) = ( ( -13.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 14.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * sin(14.00 * phi) + ! n = 14, m = -10 + zn(3) = ( ( 66.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -156.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 91.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * sin(14.00 * phi) + ! n = 14, m = -8 + zn(4) = ( ( -165.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 660.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -858.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 364.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * sin(14.00 * phi) + ! n = 14, m = -6 + zn(5) = ( ( 210.00 ) *rho *rho *rho *rho *rho * rho + & + ( -1320.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 2970.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -2860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1001.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * sin(14.00 * phi) + ! n = 14, m = -4 + zn(6) = ( ( -126.00 ) *rho *rho *rho * rho + & + ( 1260.00 ) *rho *rho *rho *rho *rho * rho + & + ( -4620.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 7920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 2002.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * sin(14.00 * phi) + ! n = 14, m = -2 + zn(7) = ( ( 28.00 ) *rho * rho + & + ( -504.00 ) *rho *rho *rho * rho + & + ( 3150.00 ) *rho *rho *rho *rho *rho * rho + & + ( -9240.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 13860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -10296.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 3003.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * sin(14.00 * phi) + ! n = 14, m = 0 + zn(8) = ( ( -1.00 ) + & + ( 56.00 ) *rho * rho + & + ( -756.00 ) *rho *rho *rho * rho + & + ( 4200.00 ) *rho *rho *rho *rho *rho * rho + & + ( -11550.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 16632.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -12012.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 3432.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 3.872983346207 ) + ! n = 14, m = 2 + zn(9) = ( ( 28.00 ) *rho * rho + & + ( -504.00 ) *rho *rho *rho * rho + & + ( 3150.00 ) *rho *rho *rho *rho *rho * rho + & + ( -9240.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 13860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -10296.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 3003.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * cos(14.00 * phi) + ! n = 14, m = 4 + zn(10) = ( ( -126.00 ) *rho *rho *rho * rho + & + ( 1260.00 ) *rho *rho *rho *rho *rho * rho + & + ( -4620.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 7920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 2002.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * cos(14.00 * phi) + ! n = 14, m = 6 + zn(11) = ( ( 210.00 ) *rho *rho *rho *rho *rho * rho + & + ( -1320.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 2970.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -2860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1001.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * cos(14.00 * phi) + ! n = 14, m = 8 + zn(12) = ( ( -165.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 660.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -858.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 364.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * cos(14.00 * phi) + ! n = 14, m = 10 + zn(13) = ( ( 66.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -156.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 91.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * cos(14.00 * phi) + ! n = 14, m = 12 + zn(14) = ( ( -13.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 14.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * cos(14.00 * phi) + ! n = 14, m = 14 + zn(15) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.477225575052 ) * cos(14.00 * phi) + case(15) + ! n = 15, m = -15 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * sin(15.00 * phi) + ! n = 15, m = -13 + zn(2) = ( ( -14.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 15.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * sin(15.00 * phi) + ! n = 15, m = -11 + zn(3) = ( ( 78.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -182.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 105.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * sin(15.00 * phi) + ! n = 15, m = -9 + zn(4) = ( ( -220.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 858.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1092.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 455.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * sin(15.00 * phi) + ! n = 15, m = -7 + zn(5) = ( ( 330.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 4290.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -4004.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * sin(15.00 * phi) + ! n = 15, m = -5 + zn(6) = ( ( -252.00 ) *rho *rho *rho *rho * rho + & + ( 2310.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -7920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -10010.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 3003.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * sin(15.00 * phi) + ! n = 15, m = -3 + zn(7) = ( ( 84.00 ) *rho *rho * rho + & + ( -1260.00 ) *rho *rho *rho *rho * rho + & + ( 6930.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -18480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 25740.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -18018.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 5005.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * sin(15.00 * phi) + ! n = 15, m = -1 + zn(8) = ( ( -8.00 ) * rho + & + ( 252.00 ) *rho *rho * rho + & + ( -2520.00 ) *rho *rho *rho *rho * rho + & + ( 11550.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -27720.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 36036.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -24024.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * sin(15.00 * phi) + ! n = 15, m = 1 + zn(9) = ( ( -8.00 ) * rho + & + ( 252.00 ) *rho *rho * rho + & + ( -2520.00 ) *rho *rho *rho *rho * rho + & + ( 11550.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -27720.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 36036.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -24024.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * cos(15.00 * phi) + ! n = 15, m = 3 + zn(10) = ( ( 84.00 ) *rho *rho * rho + & + ( -1260.00 ) *rho *rho *rho *rho * rho + & + ( 6930.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -18480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 25740.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -18018.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 5005.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * cos(15.00 * phi) + ! n = 15, m = 5 + zn(11) = ( ( -252.00 ) *rho *rho *rho *rho * rho + & + ( 2310.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -7920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -10010.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 3003.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * cos(15.00 * phi) + ! n = 15, m = 7 + zn(12) = ( ( 330.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( -1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 4290.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -4004.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * cos(15.00 * phi) + ! n = 15, m = 9 + zn(13) = ( ( -220.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 858.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1092.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 455.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * cos(15.00 * phi) + ! n = 15, m = 11 + zn(14) = ( ( 78.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -182.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 105.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * cos(15.00 * phi) + ! n = 15, m = 13 + zn(15) = ( ( -14.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 15.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * cos(15.00 * phi) + ! n = 15, m = 15 + zn(16) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.656854249492 ) * cos(15.00 * phi) + case(16) + ! n = 16, m = -16 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * sin(16.00 * phi) + ! n = 16, m = -14 + zn(2) = ( ( -15.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 16.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * sin(16.00 * phi) + ! n = 16, m = -12 + zn(3) = ( ( 91.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * sin(16.00 * phi) + ! n = 16, m = -10 + zn(4) = ( ( -286.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1092.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 560.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * sin(16.00 * phi) + ! n = 16, m = -8 + zn(5) = ( ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -2860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 6006.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -5460.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1820.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * sin(16.00 * phi) + ! n = 16, m = -6 + zn(6) = ( ( -462.00 ) *rho *rho *rho *rho *rho * rho + & + ( 3960.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 20020.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -15015.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 4368.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * sin(16.00 * phi) + ! n = 16, m = -4 + zn(7) = ( ( 210.00 ) *rho *rho *rho * rho + & + ( -2772.00 ) *rho *rho *rho *rho *rho * rho + & + ( 13860.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -34320.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 8008.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * sin(16.00 * phi) + ! n = 16, m = -2 + zn(8) = ( ( -36.00 ) *rho * rho + & + ( 840.00 ) *rho *rho *rho * rho + & + ( -6930.00 ) *rho *rho *rho *rho *rho * rho + & + ( 27720.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 72072.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 11440.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * sin(16.00 * phi) + ! n = 16, m = 0 + zn(9) = ( ( 1.00 ) + & + ( -72.00 ) *rho * rho + & + ( 1260.00 ) *rho *rho *rho * rho + & + ( -9240.00 ) *rho *rho *rho *rho *rho * rho + & + ( 34650.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -72072.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 84084.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -51480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.123105625618 ) + ! n = 16, m = 2 + zn(10) = ( ( -36.00 ) *rho * rho + & + ( 840.00 ) *rho *rho *rho * rho + & + ( -6930.00 ) *rho *rho *rho *rho *rho * rho + & + ( 27720.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 72072.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 11440.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * cos(16.00 * phi) + ! n = 16, m = 4 + zn(11) = ( ( 210.00 ) *rho *rho *rho * rho + & + ( -2772.00 ) *rho *rho *rho *rho *rho * rho + & + ( 13860.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -34320.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 8008.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * cos(16.00 * phi) + ! n = 16, m = 6 + zn(12) = ( ( -462.00 ) *rho *rho *rho *rho *rho * rho + & + ( 3960.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 20020.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -15015.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 4368.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * cos(16.00 * phi) + ! n = 16, m = 8 + zn(13) = ( ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -2860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 6006.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -5460.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1820.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * cos(16.00 * phi) + ! n = 16, m = 10 + zn(14) = ( ( -286.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1092.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 560.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * cos(16.00 * phi) + ! n = 16, m = 12 + zn(15) = ( ( 91.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * cos(16.00 * phi) + ! n = 16, m = 14 + zn(16) = ( ( -15.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 16.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * cos(16.00 * phi) + ! n = 16, m = 16 + zn(17) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 5.830951894845 ) * cos(16.00 * phi) + case(17) + ! n = 17, m = -17 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * sin(17.00 * phi) + ! n = 17, m = -15 + zn(2) = ( ( -16.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 17.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * sin(17.00 * phi) + ! n = 17, m = -13 + zn(3) = ( ( 105.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -240.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 136.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * sin(17.00 * phi) + ! n = 17, m = -11 + zn(4) = ( ( -364.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * sin(17.00 * phi) + ! n = 17, m = -9 + zn(5) = ( ( 715.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -4004.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 8190.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -7280.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 2380.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * sin(17.00 * phi) + ! n = 17, m = -7 + zn(6) = ( ( -792.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -20020.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -21840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 6188.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * sin(17.00 * phi) + ! n = 17, m = -5 + zn(7) = ( ( 462.00 ) *rho *rho *rho *rho * rho + & + ( -5544.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 25740.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 75075.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -48048.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 12376.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * sin(17.00 * phi) + ! n = 17, m = -3 + zn(8) = ( ( -120.00 ) *rho *rho * rho + & + ( 2310.00 ) *rho *rho *rho *rho * rho + & + ( -16632.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 135135.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -80080.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 19448.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * sin(17.00 * phi) + ! n = 17, m = -1 + zn(9) = ( ( 9.00 ) * rho + & + ( -360.00 ) *rho *rho * rho + & + ( 4620.00 ) *rho *rho *rho *rho * rho + & + ( -27720.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 90090.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -168168.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 180180.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -102960.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 24310.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * sin(17.00 * phi) + ! n = 17, m = 1 + zn(10) = ( ( 9.00 ) * rho + & + ( -360.00 ) *rho *rho * rho + & + ( 4620.00 ) *rho *rho *rho *rho * rho + & + ( -27720.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 90090.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -168168.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 180180.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -102960.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 24310.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * cos(17.00 * phi) + ! n = 17, m = 3 + zn(11) = ( ( -120.00 ) *rho *rho * rho + & + ( 2310.00 ) *rho *rho *rho *rho * rho + & + ( -16632.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 135135.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -80080.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 19448.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * cos(17.00 * phi) + ! n = 17, m = 5 + zn(12) = ( ( 462.00 ) *rho *rho *rho *rho * rho + & + ( -5544.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 25740.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 75075.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -48048.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 12376.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * cos(17.00 * phi) + ! n = 17, m = 7 + zn(13) = ( ( -792.00 ) *rho *rho *rho *rho *rho *rho * rho + & + ( 6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -20020.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -21840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 6188.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * cos(17.00 * phi) + ! n = 17, m = 9 + zn(14) = ( ( 715.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -4004.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 8190.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -7280.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 2380.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * cos(17.00 * phi) + ! n = 17, m = 11 + zn(15) = ( ( -364.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -1680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * cos(17.00 * phi) + ! n = 17, m = 13 + zn(16) = ( ( 105.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -240.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 136.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * cos(17.00 * phi) + ! n = 17, m = 15 + zn(17) = ( ( -16.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 17.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * cos(17.00 * phi) + ! n = 17, m = 17 + zn(18) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.000000000000 ) * cos(17.00 * phi) + case(18) + ! n = 18, m = -18 + zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * sin(18.00 * phi) + ! n = 18, m = -16 + zn(2) = ( ( -17.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 18.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * sin(18.00 * phi) + ! n = 18, m = -14 + zn(3) = ( ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -272.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 153.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * sin(18.00 * phi) + ! n = 18, m = -12 + zn(4) = ( ( -455.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -2040.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 816.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * sin(18.00 * phi) + ! n = 18, m = -10 + zn(5) = ( ( 1001.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -5460.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 10920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -9520.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 3060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * sin(18.00 * phi) + ! n = 18, m = -8 + zn(6) = ( ( -1287.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 10010.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 43680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -30940.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 8568.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * sin(18.00 * phi) + ! n = 18, m = -6 + zn(7) = ( ( 924.00 ) *rho *rho *rho *rho *rho * rho + & + ( -10296.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -100100.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -74256.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 18564.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * sin(18.00 * phi) + ! n = 18, m = -4 + zn(8) = ( ( -330.00 ) *rho *rho *rho * rho + & + ( 5544.00 ) *rho *rho *rho *rho *rho * rho + & + ( -36036.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -225225.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 240240.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -136136.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 31824.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * sin(18.00 * phi) + ! n = 18, m = -2 + zn(9) = ( ( 45.00 ) *rho * rho + & + ( -1320.00 ) *rho *rho *rho * rho + & + ( 13860.00 ) *rho *rho *rho *rho *rho * rho + & + ( -72072.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 210210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -360360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 360360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -194480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 43758.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * sin(18.00 * phi) + ! n = 18, m = 0 + zn(10) = ( ( -1.00 ) + & + ( 90.00 ) *rho * rho + & + ( -1980.00 ) *rho *rho *rho * rho + & + ( 18480.00 ) *rho *rho *rho *rho *rho * rho + & + ( -90090.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 252252.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -420420.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 411840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -218790.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 48620.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 4.358898943541 ) + ! n = 18, m = 2 + zn(11) = ( ( 45.00 ) *rho * rho + & + ( -1320.00 ) *rho *rho *rho * rho + & + ( 13860.00 ) *rho *rho *rho *rho *rho * rho + & + ( -72072.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 210210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -360360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 360360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -194480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 43758.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * cos(18.00 * phi) + ! n = 18, m = 4 + zn(12) = ( ( -330.00 ) *rho *rho *rho * rho + & + ( 5544.00 ) *rho *rho *rho *rho *rho * rho + & + ( -36036.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -225225.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 240240.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -136136.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 31824.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * cos(18.00 * phi) + ! n = 18, m = 6 + zn(13) = ( ( 924.00 ) *rho *rho *rho *rho *rho * rho + & + ( -10296.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -100100.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -74256.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 18564.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * cos(18.00 * phi) + ! n = 18, m = 8 + zn(14) = ( ( -1287.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 10010.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 43680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -30940.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 8568.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * cos(18.00 * phi) + ! n = 18, m = 10 + zn(15) = ( ( 1001.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -5460.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 10920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -9520.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 3060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * cos(18.00 * phi) + ! n = 18, m = 12 + zn(16) = ( ( -455.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 1680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -2040.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 816.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * cos(18.00 * phi) + ! n = 18, m = 14 + zn(17) = ( ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( -272.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 153.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * cos(18.00 * phi) + ! n = 18, m = 16 + zn(18) = ( ( -17.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & + ( 18.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * cos(18.00 * phi) + ! n = 18, m = 18 + zn(19) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & + * ( 6.164414002969 ) * cos(18.00 * phi) + case default + zn = ONE + end select + + end function calc_zn + !=============================================================================== ! EXPAND_HARMONIC expands a given series of real spherical harmonics !=============================================================================== diff --git a/src/tallies/tally_filter_zernike.F90 b/src/tallies/tally_filter_zernike.F90 index 6f00e131d8..08bc24e605 100644 --- a/src/tallies/tally_filter_zernike.F90 +++ b/src/tallies/tally_filter_zernike.F90 @@ -7,6 +7,7 @@ module tally_filter_zernike use constants use error use hdf5_interface + use math, only: calc_zn use particle_header, only: Particle use string, only: to_str use tally_filter_header @@ -76,7 +77,7 @@ contains i = 0 do n = 0, this % order ! Get moments for n-th order Zernike polynomial - tmp(1:n+1) = calc_zn_scaled(n, r, theta) + tmp(1:n+1) = calc_zn(n, r, theta) / SQRT_PI ! Indicate matching bins/weights do j = 1, n + 1 @@ -119,1160 +120,6 @@ contains end do end function text_label - -!=============================================================================== -! CALC_ZN calculates the n-th order Zernike polynomial moment for a given angle -! (rho, theta) location in the unit disk. -!=============================================================================== - - pure function calc_zn(n, rho, phi) result(zn) - - integer, intent(in) :: n ! Order requested - real(8), intent(in) :: rho ! Radial location in the unit disk - real(8), intent(in) :: phi ! Theta (radians) location in the unit disk - real(8) :: zn(n + 1) ! The resultant Z_n(uvw) - - ! n == radial degree - ! m == azimuthal frequency - - select case(n) - case(0) - ! n = 0, m = 0 - zn(1) = ( ( 1.00 ) ) & - * ( 1.000000000000 ) - case(1) - ! n = 1, m = -1 - zn(1) = ( ( 1.00 ) * rho ) & - * ( 2.000000000000 ) * sin(1.00 * phi) - ! n = 1, m = 1 - zn(2) = ( ( 1.00 ) * rho ) & - * ( 2.000000000000 ) * cos(1.00 * phi) - case(2) - ! n = 2, m = -2 - zn(1) = ( ( 1.00 ) *rho * rho ) & - * ( 2.449489742783 ) * sin(2.00 * phi) - ! n = 2, m = 0 - zn(2) = ( ( -1.00 ) + & - ( 2.00 ) *rho * rho ) & - * ( 1.732050807569 ) - ! n = 2, m = 2 - zn(3) = ( ( 1.00 ) *rho * rho ) & - * ( 2.449489742783 ) * cos(2.00 * phi) - case(3) - ! n = 3, m = -3 - zn(1) = ( ( 1.00 ) *rho *rho * rho ) & - * ( 2.828427124746 ) * sin(3.00 * phi) - ! n = 3, m = -1 - zn(2) = ( ( -2.00 ) * rho + & - ( 3.00 ) *rho *rho * rho ) & - * ( 2.828427124746 ) * sin(3.00 * phi) - ! n = 3, m = 1 - zn(3) = ( ( -2.00 ) * rho + & - ( 3.00 ) *rho *rho * rho ) & - * ( 2.828427124746 ) * cos(3.00 * phi) - ! n = 3, m = 3 - zn(4) = ( ( 1.00 ) *rho *rho * rho ) & - * ( 2.828427124746 ) * cos(3.00 * phi) - case(4) - ! n = 4, m = -4 - zn(1) = ( ( 1.00 ) *rho *rho *rho * rho ) & - * ( 3.162277660168 ) * sin(4.00 * phi) - ! n = 4, m = -2 - zn(2) = ( ( -3.00 ) *rho * rho + & - ( 4.00 ) *rho *rho *rho * rho ) & - * ( 3.162277660168 ) * sin(4.00 * phi) - ! n = 4, m = 0 - zn(3) = ( ( 1.00 ) + & - ( -6.00 ) *rho * rho + & - ( 6.00 ) *rho *rho *rho * rho ) & - * ( 2.236067977500 ) - ! n = 4, m = 2 - zn(4) = ( ( -3.00 ) *rho * rho + & - ( 4.00 ) *rho *rho *rho * rho ) & - * ( 3.162277660168 ) * cos(4.00 * phi) - ! n = 4, m = 4 - zn(5) = ( ( 1.00 ) *rho *rho *rho * rho ) & - * ( 3.162277660168 ) * cos(4.00 * phi) - case(5) - ! n = 5, m = -5 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho * rho ) & - * ( 3.464101615138 ) * sin(5.00 * phi) - ! n = 5, m = -3 - zn(2) = ( ( -4.00 ) *rho *rho * rho + & - ( 5.00 ) *rho *rho *rho *rho * rho ) & - * ( 3.464101615138 ) * sin(5.00 * phi) - ! n = 5, m = -1 - zn(3) = ( ( 3.00 ) * rho + & - ( -12.00 ) *rho *rho * rho + & - ( 10.00 ) *rho *rho *rho *rho * rho ) & - * ( 3.464101615138 ) * sin(5.00 * phi) - ! n = 5, m = 1 - zn(4) = ( ( 3.00 ) * rho + & - ( -12.00 ) *rho *rho * rho + & - ( 10.00 ) *rho *rho *rho *rho * rho ) & - * ( 3.464101615138 ) * cos(5.00 * phi) - ! n = 5, m = 3 - zn(5) = ( ( -4.00 ) *rho *rho * rho + & - ( 5.00 ) *rho *rho *rho *rho * rho ) & - * ( 3.464101615138 ) * cos(5.00 * phi) - ! n = 5, m = 5 - zn(6) = ( ( 1.00 ) *rho *rho *rho *rho * rho ) & - * ( 3.464101615138 ) * cos(5.00 * phi) - case(6) - ! n = 6, m = -6 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho * rho ) & - * ( 3.741657386774 ) * sin(6.00 * phi) - ! n = 6, m = -4 - zn(2) = ( ( -5.00 ) *rho *rho *rho * rho + & - ( 6.00 ) *rho *rho *rho *rho *rho * rho ) & - * ( 3.741657386774 ) * sin(6.00 * phi) - ! n = 6, m = -2 - zn(3) = ( ( 6.00 ) *rho * rho + & - ( -20.00 ) *rho *rho *rho * rho + & - ( 15.00 ) *rho *rho *rho *rho *rho * rho ) & - * ( 3.741657386774 ) * sin(6.00 * phi) - ! n = 6, m = 0 - zn(4) = ( ( -1.00 ) + & - ( 12.00 ) *rho * rho + & - ( -30.00 ) *rho *rho *rho * rho + & - ( 20.00 ) *rho *rho *rho *rho *rho * rho ) & - * ( 2.645751311065 ) - ! n = 6, m = 2 - zn(5) = ( ( 6.00 ) *rho * rho + & - ( -20.00 ) *rho *rho *rho * rho + & - ( 15.00 ) *rho *rho *rho *rho *rho * rho ) & - * ( 3.741657386774 ) * cos(6.00 * phi) - ! n = 6, m = 4 - zn(6) = ( ( -5.00 ) *rho *rho *rho * rho + & - ( 6.00 ) *rho *rho *rho *rho *rho * rho ) & - * ( 3.741657386774 ) * cos(6.00 * phi) - ! n = 6, m = 6 - zn(7) = ( ( 1.00 ) *rho *rho *rho *rho *rho * rho ) & - * ( 3.741657386774 ) * cos(6.00 * phi) - case(7) - ! n = 7, m = -7 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.000000000000 ) * sin(7.00 * phi) - ! n = 7, m = -5 - zn(2) = ( ( -6.00 ) *rho *rho *rho *rho * rho + & - ( 7.00 ) *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.000000000000 ) * sin(7.00 * phi) - ! n = 7, m = -3 - zn(3) = ( ( 10.00 ) *rho *rho * rho + & - ( -30.00 ) *rho *rho *rho *rho * rho + & - ( 21.00 ) *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.000000000000 ) * sin(7.00 * phi) - ! n = 7, m = -1 - zn(4) = ( ( -4.00 ) * rho + & - ( 30.00 ) *rho *rho * rho + & - ( -60.00 ) *rho *rho *rho *rho * rho + & - ( 35.00 ) *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.000000000000 ) * sin(7.00 * phi) - ! n = 7, m = 1 - zn(5) = ( ( -4.00 ) * rho + & - ( 30.00 ) *rho *rho * rho + & - ( -60.00 ) *rho *rho *rho *rho * rho + & - ( 35.00 ) *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.000000000000 ) * cos(7.00 * phi) - ! n = 7, m = 3 - zn(6) = ( ( 10.00 ) *rho *rho * rho + & - ( -30.00 ) *rho *rho *rho *rho * rho + & - ( 21.00 ) *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.000000000000 ) * cos(7.00 * phi) - ! n = 7, m = 5 - zn(7) = ( ( -6.00 ) *rho *rho *rho *rho * rho + & - ( 7.00 ) *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.000000000000 ) * cos(7.00 * phi) - ! n = 7, m = 7 - zn(8) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.000000000000 ) * cos(7.00 * phi) - case(8) - ! n = 8, m = -8 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.242640687119 ) * sin(8.00 * phi) - ! n = 8, m = -6 - zn(2) = ( ( -7.00 ) *rho *rho *rho *rho *rho * rho + & - ( 8.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.242640687119 ) * sin(8.00 * phi) - ! n = 8, m = -4 - zn(3) = ( ( 15.00 ) *rho *rho *rho * rho + & - ( -42.00 ) *rho *rho *rho *rho *rho * rho + & - ( 28.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.242640687119 ) * sin(8.00 * phi) - ! n = 8, m = -2 - zn(4) = ( ( -10.00 ) *rho * rho + & - ( 60.00 ) *rho *rho *rho * rho + & - ( -105.00 ) *rho *rho *rho *rho *rho * rho + & - ( 56.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.242640687119 ) * sin(8.00 * phi) - ! n = 8, m = 0 - zn(5) = ( ( 1.00 ) + & - ( -20.00 ) *rho * rho + & - ( 90.00 ) *rho *rho *rho * rho + & - ( -140.00 ) *rho *rho *rho *rho *rho * rho + & - ( 70.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 3.000000000000 ) - ! n = 8, m = 2 - zn(6) = ( ( -10.00 ) *rho * rho + & - ( 60.00 ) *rho *rho *rho * rho + & - ( -105.00 ) *rho *rho *rho *rho *rho * rho + & - ( 56.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.242640687119 ) * cos(8.00 * phi) - ! n = 8, m = 4 - zn(7) = ( ( 15.00 ) *rho *rho *rho * rho + & - ( -42.00 ) *rho *rho *rho *rho *rho * rho + & - ( 28.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.242640687119 ) * cos(8.00 * phi) - ! n = 8, m = 6 - zn(8) = ( ( -7.00 ) *rho *rho *rho *rho *rho * rho + & - ( 8.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.242640687119 ) * cos(8.00 * phi) - ! n = 8, m = 8 - zn(9) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.242640687119 ) * cos(8.00 * phi) - case(9) - ! n = 9, m = -9 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * sin(9.00 * phi) - ! n = 9, m = -7 - zn(2) = ( ( -8.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 9.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * sin(9.00 * phi) - ! n = 9, m = -5 - zn(3) = ( ( 21.00 ) *rho *rho *rho *rho * rho + & - ( -56.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 36.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * sin(9.00 * phi) - ! n = 9, m = -3 - zn(4) = ( ( -20.00 ) *rho *rho * rho + & - ( 105.00 ) *rho *rho *rho *rho * rho + & - ( -168.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 84.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * sin(9.00 * phi) - ! n = 9, m = -1 - zn(5) = ( ( 5.00 ) * rho + & - ( -60.00 ) *rho *rho * rho + & - ( 210.00 ) *rho *rho *rho *rho * rho + & - ( -280.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 126.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * sin(9.00 * phi) - ! n = 9, m = 1 - zn(6) = ( ( 5.00 ) * rho + & - ( -60.00 ) *rho *rho * rho + & - ( 210.00 ) *rho *rho *rho *rho * rho + & - ( -280.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 126.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * cos(9.00 * phi) - ! n = 9, m = 3 - zn(7) = ( ( -20.00 ) *rho *rho * rho + & - ( 105.00 ) *rho *rho *rho *rho * rho + & - ( -168.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 84.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * cos(9.00 * phi) - ! n = 9, m = 5 - zn(8) = ( ( 21.00 ) *rho *rho *rho *rho * rho + & - ( -56.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 36.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * cos(9.00 * phi) - ! n = 9, m = 7 - zn(9) = ( ( -8.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 9.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * cos(9.00 * phi) - ! n = 9, m = 9 - zn(10) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * cos(9.00 * phi) - case(10) - ! n = 10, m = -10 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * sin(10.00 * phi) - ! n = 10, m = -8 - zn(2) = ( ( -9.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 10.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * sin(10.00 * phi) - ! n = 10, m = -6 - zn(3) = ( ( 28.00 ) *rho *rho *rho *rho *rho * rho + & - ( -72.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 45.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * sin(10.00 * phi) - ! n = 10, m = -4 - zn(4) = ( ( -35.00 ) *rho *rho *rho * rho + & - ( 168.00 ) *rho *rho *rho *rho *rho * rho + & - ( -252.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * sin(10.00 * phi) - ! n = 10, m = -2 - zn(5) = ( ( 15.00 ) *rho * rho + & - ( -140.00 ) *rho *rho *rho * rho + & - ( 420.00 ) *rho *rho *rho *rho *rho * rho + & - ( -504.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * sin(10.00 * phi) - ! n = 10, m = 0 - zn(6) = ( ( -1.00 ) + & - ( 30.00 ) *rho * rho + & - ( -210.00 ) *rho *rho *rho * rho + & - ( 560.00 ) *rho *rho *rho *rho *rho * rho + & - ( -630.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 252.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 3.316624790355 ) - ! n = 10, m = 2 - zn(7) = ( ( 15.00 ) *rho * rho + & - ( -140.00 ) *rho *rho *rho * rho + & - ( 420.00 ) *rho *rho *rho *rho *rho * rho + & - ( -504.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * cos(10.00 * phi) - ! n = 10, m = 4 - zn(8) = ( ( -35.00 ) *rho *rho *rho * rho + & - ( 168.00 ) *rho *rho *rho *rho *rho * rho + & - ( -252.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * cos(10.00 * phi) - ! n = 10, m = 6 - zn(9) = ( ( 28.00 ) *rho *rho *rho *rho *rho * rho + & - ( -72.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 45.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * cos(10.00 * phi) - ! n = 10, m = 8 - zn(10) = ( ( -9.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 10.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * cos(10.00 * phi) - ! n = 10, m = 10 - zn(11) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * cos(10.00 * phi) - case(11) - ! n = 11, m = -11 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * sin(11.00 * phi) - ! n = 11, m = -9 - zn(2) = ( ( -10.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 11.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * sin(11.00 * phi) - ! n = 11, m = -7 - zn(3) = ( ( 36.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -90.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 55.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * sin(11.00 * phi) - ! n = 11, m = -5 - zn(4) = ( ( -56.00 ) *rho *rho *rho *rho * rho + & - ( 252.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 165.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * sin(11.00 * phi) - ! n = 11, m = -3 - zn(5) = ( ( 35.00 ) *rho *rho * rho + & - ( -280.00 ) *rho *rho *rho *rho * rho + & - ( 756.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 330.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * sin(11.00 * phi) - ! n = 11, m = -1 - zn(6) = ( ( -6.00 ) * rho + & - ( 105.00 ) *rho *rho * rho + & - ( -560.00 ) *rho *rho *rho *rho * rho + & - ( 1260.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -1260.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 462.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * sin(11.00 * phi) - ! n = 11, m = 1 - zn(7) = ( ( -6.00 ) * rho + & - ( 105.00 ) *rho *rho * rho + & - ( -560.00 ) *rho *rho *rho *rho * rho + & - ( 1260.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -1260.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 462.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * cos(11.00 * phi) - ! n = 11, m = 3 - zn(8) = ( ( 35.00 ) *rho *rho * rho + & - ( -280.00 ) *rho *rho *rho *rho * rho + & - ( 756.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 330.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * cos(11.00 * phi) - ! n = 11, m = 5 - zn(9) = ( ( -56.00 ) *rho *rho *rho *rho * rho + & - ( 252.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 165.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * cos(11.00 * phi) - ! n = 11, m = 7 - zn(10) = ( ( 36.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -90.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 55.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * cos(11.00 * phi) - ! n = 11, m = 9 - zn(11) = ( ( -10.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 11.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * cos(11.00 * phi) - ! n = 11, m = 11 - zn(12) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * cos(11.00 * phi) - case(12) - ! n = 12, m = -12 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * sin(12.00 * phi) - ! n = 12, m = -10 - zn(2) = ( ( -11.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 12.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * sin(12.00 * phi) - ! n = 12, m = -8 - zn(3) = ( ( 45.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -110.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 66.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * sin(12.00 * phi) - ! n = 12, m = -6 - zn(4) = ( ( -84.00 ) *rho *rho *rho *rho *rho * rho + & - ( 360.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 220.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * sin(12.00 * phi) - ! n = 12, m = -4 - zn(5) = ( ( 70.00 ) *rho *rho *rho * rho + & - ( -504.00 ) *rho *rho *rho *rho *rho * rho + & - ( 1260.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1320.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * sin(12.00 * phi) - ! n = 12, m = -2 - zn(6) = ( ( -21.00 ) *rho * rho + & - ( 280.00 ) *rho *rho *rho * rho + & - ( -1260.00 ) *rho *rho *rho *rho *rho * rho + & - ( 2520.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -2310.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 792.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * sin(12.00 * phi) - ! n = 12, m = 0 - zn(7) = ( ( 1.00 ) + & - ( -42.00 ) *rho * rho + & - ( 420.00 ) *rho *rho *rho * rho + & - ( -1680.00 ) *rho *rho *rho *rho *rho * rho + & - ( 3150.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -2772.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 924.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 3.605551275464 ) - ! n = 12, m = 2 - zn(8) = ( ( -21.00 ) *rho * rho + & - ( 280.00 ) *rho *rho *rho * rho + & - ( -1260.00 ) *rho *rho *rho *rho *rho * rho + & - ( 2520.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -2310.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 792.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * cos(12.00 * phi) - ! n = 12, m = 4 - zn(9) = ( ( 70.00 ) *rho *rho *rho * rho + & - ( -504.00 ) *rho *rho *rho *rho *rho * rho + & - ( 1260.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1320.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * cos(12.00 * phi) - ! n = 12, m = 6 - zn(10) = ( ( -84.00 ) *rho *rho *rho *rho *rho * rho + & - ( 360.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 220.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * cos(12.00 * phi) - ! n = 12, m = 8 - zn(11) = ( ( 45.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -110.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 66.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * cos(12.00 * phi) - ! n = 12, m = 10 - zn(12) = ( ( -11.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 12.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * cos(12.00 * phi) - ! n = 12, m = 12 - zn(13) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * cos(12.00 * phi) - case(13) - ! n = 13, m = -13 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * sin(13.00 * phi) - ! n = 13, m = -11 - zn(2) = ( ( -12.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 13.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * sin(13.00 * phi) - ! n = 13, m = -9 - zn(3) = ( ( 55.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -132.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 78.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * sin(13.00 * phi) - ! n = 13, m = -7 - zn(4) = ( ( -120.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -660.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 286.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * sin(13.00 * phi) - ! n = 13, m = -5 - zn(5) = ( ( 126.00 ) *rho *rho *rho *rho * rho + & - ( -840.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 715.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * sin(13.00 * phi) - ! n = 13, m = -3 - zn(6) = ( ( -56.00 ) *rho *rho * rho + & - ( 630.00 ) *rho *rho *rho *rho * rho + & - ( -2520.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 4620.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -3960.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1287.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * sin(13.00 * phi) - ! n = 13, m = -1 - zn(7) = ( ( 7.00 ) * rho + & - ( -168.00 ) *rho *rho * rho + & - ( 1260.00 ) *rho *rho *rho *rho * rho + & - ( -4200.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 6930.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -5544.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1716.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * sin(13.00 * phi) - ! n = 13, m = 1 - zn(8) = ( ( 7.00 ) * rho + & - ( -168.00 ) *rho *rho * rho + & - ( 1260.00 ) *rho *rho *rho *rho * rho + & - ( -4200.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 6930.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -5544.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1716.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * cos(13.00 * phi) - ! n = 13, m = 3 - zn(9) = ( ( -56.00 ) *rho *rho * rho + & - ( 630.00 ) *rho *rho *rho *rho * rho + & - ( -2520.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 4620.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -3960.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1287.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * cos(13.00 * phi) - ! n = 13, m = 5 - zn(10) = ( ( 126.00 ) *rho *rho *rho *rho * rho + & - ( -840.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 715.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * cos(13.00 * phi) - ! n = 13, m = 7 - zn(11) = ( ( -120.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -660.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 286.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * cos(13.00 * phi) - ! n = 13, m = 9 - zn(12) = ( ( 55.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -132.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 78.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * cos(13.00 * phi) - ! n = 13, m = 11 - zn(13) = ( ( -12.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 13.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * cos(13.00 * phi) - ! n = 13, m = 13 - zn(14) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * cos(13.00 * phi) - case(14) - ! n = 14, m = -14 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * sin(14.00 * phi) - ! n = 14, m = -12 - zn(2) = ( ( -13.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 14.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * sin(14.00 * phi) - ! n = 14, m = -10 - zn(3) = ( ( 66.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -156.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 91.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * sin(14.00 * phi) - ! n = 14, m = -8 - zn(4) = ( ( -165.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 660.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -858.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 364.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * sin(14.00 * phi) - ! n = 14, m = -6 - zn(5) = ( ( 210.00 ) *rho *rho *rho *rho *rho * rho + & - ( -1320.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 2970.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -2860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1001.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * sin(14.00 * phi) - ! n = 14, m = -4 - zn(6) = ( ( -126.00 ) *rho *rho *rho * rho + & - ( 1260.00 ) *rho *rho *rho *rho *rho * rho + & - ( -4620.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 7920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 2002.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * sin(14.00 * phi) - ! n = 14, m = -2 - zn(7) = ( ( 28.00 ) *rho * rho + & - ( -504.00 ) *rho *rho *rho * rho + & - ( 3150.00 ) *rho *rho *rho *rho *rho * rho + & - ( -9240.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 13860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -10296.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 3003.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * sin(14.00 * phi) - ! n = 14, m = 0 - zn(8) = ( ( -1.00 ) + & - ( 56.00 ) *rho * rho + & - ( -756.00 ) *rho *rho *rho * rho + & - ( 4200.00 ) *rho *rho *rho *rho *rho * rho + & - ( -11550.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 16632.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -12012.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 3432.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 3.872983346207 ) - ! n = 14, m = 2 - zn(9) = ( ( 28.00 ) *rho * rho + & - ( -504.00 ) *rho *rho *rho * rho + & - ( 3150.00 ) *rho *rho *rho *rho *rho * rho + & - ( -9240.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 13860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -10296.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 3003.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * cos(14.00 * phi) - ! n = 14, m = 4 - zn(10) = ( ( -126.00 ) *rho *rho *rho * rho + & - ( 1260.00 ) *rho *rho *rho *rho *rho * rho + & - ( -4620.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 7920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 2002.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * cos(14.00 * phi) - ! n = 14, m = 6 - zn(11) = ( ( 210.00 ) *rho *rho *rho *rho *rho * rho + & - ( -1320.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 2970.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -2860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1001.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * cos(14.00 * phi) - ! n = 14, m = 8 - zn(12) = ( ( -165.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 660.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -858.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 364.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * cos(14.00 * phi) - ! n = 14, m = 10 - zn(13) = ( ( 66.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -156.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 91.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * cos(14.00 * phi) - ! n = 14, m = 12 - zn(14) = ( ( -13.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 14.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * cos(14.00 * phi) - ! n = 14, m = 14 - zn(15) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * cos(14.00 * phi) - case(15) - ! n = 15, m = -15 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * sin(15.00 * phi) - ! n = 15, m = -13 - zn(2) = ( ( -14.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 15.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * sin(15.00 * phi) - ! n = 15, m = -11 - zn(3) = ( ( 78.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -182.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 105.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * sin(15.00 * phi) - ! n = 15, m = -9 - zn(4) = ( ( -220.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 858.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1092.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 455.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * sin(15.00 * phi) - ! n = 15, m = -7 - zn(5) = ( ( 330.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 4290.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -4004.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * sin(15.00 * phi) - ! n = 15, m = -5 - zn(6) = ( ( -252.00 ) *rho *rho *rho *rho * rho + & - ( 2310.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -7920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -10010.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 3003.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * sin(15.00 * phi) - ! n = 15, m = -3 - zn(7) = ( ( 84.00 ) *rho *rho * rho + & - ( -1260.00 ) *rho *rho *rho *rho * rho + & - ( 6930.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -18480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 25740.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -18018.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 5005.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * sin(15.00 * phi) - ! n = 15, m = -1 - zn(8) = ( ( -8.00 ) * rho + & - ( 252.00 ) *rho *rho * rho + & - ( -2520.00 ) *rho *rho *rho *rho * rho + & - ( 11550.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -27720.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 36036.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -24024.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * sin(15.00 * phi) - ! n = 15, m = 1 - zn(9) = ( ( -8.00 ) * rho + & - ( 252.00 ) *rho *rho * rho + & - ( -2520.00 ) *rho *rho *rho *rho * rho + & - ( 11550.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -27720.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 36036.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -24024.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * cos(15.00 * phi) - ! n = 15, m = 3 - zn(10) = ( ( 84.00 ) *rho *rho * rho + & - ( -1260.00 ) *rho *rho *rho *rho * rho + & - ( 6930.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -18480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 25740.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -18018.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 5005.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * cos(15.00 * phi) - ! n = 15, m = 5 - zn(11) = ( ( -252.00 ) *rho *rho *rho *rho * rho + & - ( 2310.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -7920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -10010.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 3003.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * cos(15.00 * phi) - ! n = 15, m = 7 - zn(12) = ( ( 330.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 4290.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -4004.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * cos(15.00 * phi) - ! n = 15, m = 9 - zn(13) = ( ( -220.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 858.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1092.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 455.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * cos(15.00 * phi) - ! n = 15, m = 11 - zn(14) = ( ( 78.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -182.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 105.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * cos(15.00 * phi) - ! n = 15, m = 13 - zn(15) = ( ( -14.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 15.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * cos(15.00 * phi) - ! n = 15, m = 15 - zn(16) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * cos(15.00 * phi) - case(16) - ! n = 16, m = -16 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * sin(16.00 * phi) - ! n = 16, m = -14 - zn(2) = ( ( -15.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 16.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * sin(16.00 * phi) - ! n = 16, m = -12 - zn(3) = ( ( 91.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * sin(16.00 * phi) - ! n = 16, m = -10 - zn(4) = ( ( -286.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1092.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 560.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * sin(16.00 * phi) - ! n = 16, m = -8 - zn(5) = ( ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -2860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 6006.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -5460.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1820.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * sin(16.00 * phi) - ! n = 16, m = -6 - zn(6) = ( ( -462.00 ) *rho *rho *rho *rho *rho * rho + & - ( 3960.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 20020.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -15015.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 4368.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * sin(16.00 * phi) - ! n = 16, m = -4 - zn(7) = ( ( 210.00 ) *rho *rho *rho * rho + & - ( -2772.00 ) *rho *rho *rho *rho *rho * rho + & - ( 13860.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -34320.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 8008.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * sin(16.00 * phi) - ! n = 16, m = -2 - zn(8) = ( ( -36.00 ) *rho * rho + & - ( 840.00 ) *rho *rho *rho * rho + & - ( -6930.00 ) *rho *rho *rho *rho *rho * rho + & - ( 27720.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 72072.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 11440.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * sin(16.00 * phi) - ! n = 16, m = 0 - zn(9) = ( ( 1.00 ) + & - ( -72.00 ) *rho * rho + & - ( 1260.00 ) *rho *rho *rho * rho + & - ( -9240.00 ) *rho *rho *rho *rho *rho * rho + & - ( 34650.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -72072.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 84084.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -51480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.123105625618 ) - ! n = 16, m = 2 - zn(10) = ( ( -36.00 ) *rho * rho + & - ( 840.00 ) *rho *rho *rho * rho + & - ( -6930.00 ) *rho *rho *rho *rho *rho * rho + & - ( 27720.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 72072.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 11440.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * cos(16.00 * phi) - ! n = 16, m = 4 - zn(11) = ( ( 210.00 ) *rho *rho *rho * rho + & - ( -2772.00 ) *rho *rho *rho *rho *rho * rho + & - ( 13860.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -34320.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 8008.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * cos(16.00 * phi) - ! n = 16, m = 6 - zn(12) = ( ( -462.00 ) *rho *rho *rho *rho *rho * rho + & - ( 3960.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 20020.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -15015.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 4368.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * cos(16.00 * phi) - ! n = 16, m = 8 - zn(13) = ( ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -2860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 6006.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -5460.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1820.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * cos(16.00 * phi) - ! n = 16, m = 10 - zn(14) = ( ( -286.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1092.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 560.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * cos(16.00 * phi) - ! n = 16, m = 12 - zn(15) = ( ( 91.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * cos(16.00 * phi) - ! n = 16, m = 14 - zn(16) = ( ( -15.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 16.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * cos(16.00 * phi) - ! n = 16, m = 16 - zn(17) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * cos(16.00 * phi) - case(17) - ! n = 17, m = -17 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * sin(17.00 * phi) - ! n = 17, m = -15 - zn(2) = ( ( -16.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 17.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * sin(17.00 * phi) - ! n = 17, m = -13 - zn(3) = ( ( 105.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -240.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 136.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * sin(17.00 * phi) - ! n = 17, m = -11 - zn(4) = ( ( -364.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * sin(17.00 * phi) - ! n = 17, m = -9 - zn(5) = ( ( 715.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -4004.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 8190.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -7280.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 2380.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * sin(17.00 * phi) - ! n = 17, m = -7 - zn(6) = ( ( -792.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -20020.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -21840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 6188.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * sin(17.00 * phi) - ! n = 17, m = -5 - zn(7) = ( ( 462.00 ) *rho *rho *rho *rho * rho + & - ( -5544.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 25740.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 75075.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -48048.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 12376.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * sin(17.00 * phi) - ! n = 17, m = -3 - zn(8) = ( ( -120.00 ) *rho *rho * rho + & - ( 2310.00 ) *rho *rho *rho *rho * rho + & - ( -16632.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 135135.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -80080.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 19448.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * sin(17.00 * phi) - ! n = 17, m = -1 - zn(9) = ( ( 9.00 ) * rho + & - ( -360.00 ) *rho *rho * rho + & - ( 4620.00 ) *rho *rho *rho *rho * rho + & - ( -27720.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 90090.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -168168.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 180180.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -102960.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 24310.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * sin(17.00 * phi) - ! n = 17, m = 1 - zn(10) = ( ( 9.00 ) * rho + & - ( -360.00 ) *rho *rho * rho + & - ( 4620.00 ) *rho *rho *rho *rho * rho + & - ( -27720.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 90090.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -168168.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 180180.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -102960.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 24310.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * cos(17.00 * phi) - ! n = 17, m = 3 - zn(11) = ( ( -120.00 ) *rho *rho * rho + & - ( 2310.00 ) *rho *rho *rho *rho * rho + & - ( -16632.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 135135.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -80080.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 19448.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * cos(17.00 * phi) - ! n = 17, m = 5 - zn(12) = ( ( 462.00 ) *rho *rho *rho *rho * rho + & - ( -5544.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 25740.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 75075.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -48048.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 12376.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * cos(17.00 * phi) - ! n = 17, m = 7 - zn(13) = ( ( -792.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -20020.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -21840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 6188.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * cos(17.00 * phi) - ! n = 17, m = 9 - zn(14) = ( ( 715.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -4004.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 8190.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -7280.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 2380.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * cos(17.00 * phi) - ! n = 17, m = 11 - zn(15) = ( ( -364.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * cos(17.00 * phi) - ! n = 17, m = 13 - zn(16) = ( ( 105.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -240.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 136.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * cos(17.00 * phi) - ! n = 17, m = 15 - zn(17) = ( ( -16.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 17.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * cos(17.00 * phi) - ! n = 17, m = 17 - zn(18) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * cos(17.00 * phi) - case(18) - ! n = 18, m = -18 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * sin(18.00 * phi) - ! n = 18, m = -16 - zn(2) = ( ( -17.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 18.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * sin(18.00 * phi) - ! n = 18, m = -14 - zn(3) = ( ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -272.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 153.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * sin(18.00 * phi) - ! n = 18, m = -12 - zn(4) = ( ( -455.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -2040.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 816.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * sin(18.00 * phi) - ! n = 18, m = -10 - zn(5) = ( ( 1001.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -5460.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 10920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -9520.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 3060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * sin(18.00 * phi) - ! n = 18, m = -8 - zn(6) = ( ( -1287.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 10010.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 43680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -30940.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 8568.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * sin(18.00 * phi) - ! n = 18, m = -6 - zn(7) = ( ( 924.00 ) *rho *rho *rho *rho *rho * rho + & - ( -10296.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -100100.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -74256.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 18564.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * sin(18.00 * phi) - ! n = 18, m = -4 - zn(8) = ( ( -330.00 ) *rho *rho *rho * rho + & - ( 5544.00 ) *rho *rho *rho *rho *rho * rho + & - ( -36036.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -225225.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 240240.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -136136.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 31824.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * sin(18.00 * phi) - ! n = 18, m = -2 - zn(9) = ( ( 45.00 ) *rho * rho + & - ( -1320.00 ) *rho *rho *rho * rho + & - ( 13860.00 ) *rho *rho *rho *rho *rho * rho + & - ( -72072.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 210210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -360360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 360360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -194480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 43758.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * sin(18.00 * phi) - ! n = 18, m = 0 - zn(10) = ( ( -1.00 ) + & - ( 90.00 ) *rho * rho + & - ( -1980.00 ) *rho *rho *rho * rho + & - ( 18480.00 ) *rho *rho *rho *rho *rho * rho + & - ( -90090.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 252252.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -420420.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 411840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -218790.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 48620.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.358898943541 ) - ! n = 18, m = 2 - zn(11) = ( ( 45.00 ) *rho * rho + & - ( -1320.00 ) *rho *rho *rho * rho + & - ( 13860.00 ) *rho *rho *rho *rho *rho * rho + & - ( -72072.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 210210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -360360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 360360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -194480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 43758.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * cos(18.00 * phi) - ! n = 18, m = 4 - zn(12) = ( ( -330.00 ) *rho *rho *rho * rho + & - ( 5544.00 ) *rho *rho *rho *rho *rho * rho + & - ( -36036.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -225225.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 240240.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -136136.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 31824.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * cos(18.00 * phi) - ! n = 18, m = 6 - zn(13) = ( ( 924.00 ) *rho *rho *rho *rho *rho * rho + & - ( -10296.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -100100.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -74256.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 18564.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * cos(18.00 * phi) - ! n = 18, m = 8 - zn(14) = ( ( -1287.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 10010.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 43680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -30940.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 8568.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * cos(18.00 * phi) - ! n = 18, m = 10 - zn(15) = ( ( 1001.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -5460.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 10920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -9520.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 3060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * cos(18.00 * phi) - ! n = 18, m = 12 - zn(16) = ( ( -455.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -2040.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 816.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * cos(18.00 * phi) - ! n = 18, m = 14 - zn(17) = ( ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -272.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 153.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * cos(18.00 * phi) - ! n = 18, m = 16 - zn(18) = ( ( -17.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 18.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * cos(18.00 * phi) - ! n = 18, m = 18 - zn(19) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * cos(18.00 * phi) - case default - zn = ONE - end select - - end function calc_zn - -!=============================================================================== -! CALC_ZN_SCALED calculates the n-th order Zernike polynomial moment for a given -! angle (rho, theta) location in the unit disk, scaled correctly for orthogonal -! integration. -!=============================================================================== - - pure function calc_zn_scaled(n, rho, phi) result(zn) - - integer, intent(in) :: n ! Order requested - real(8), intent(in) :: rho ! Radial location in the unit disk - real(8), intent(in) :: phi ! Theta (radians) location in the unit disk - real(8) :: zn(n + 1) ! The resultant Z_n(uvw) - - zn = calc_zn(n, rho, phi) / SQRT_PI - - end function calc_zn_scaled - !=============================================================================== ! C API FUNCTIONS !=============================================================================== From 39bbb2de46617403998524beec05b988bb860bec Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 10 Jan 2018 15:45:00 -0600 Subject: [PATCH 141/231] Use fast Zernike algorithm from Chong --- src/math.F90 | 1203 ++------------------------ src/tallies/tally_filter_zernike.F90 | 21 +- 2 files changed, 88 insertions(+), 1136 deletions(-) diff --git a/src/math.F90 b/src/math.F90 index b96562734f..1d7d0bfaf3 100644 --- a/src/math.F90 +++ b/src/math.F90 @@ -579,1136 +579,95 @@ contains ! (rho, theta) location in the unit disk. !=============================================================================== - pure function calc_zn(n, rho, phi) result(zn) + subroutine calc_zn(n, rho, phi, zn) + ! This efficient method for calculation R(m,n) is taken from + ! Chong, C. W., Raveendran, P., & Mukundan, R. (2003). A comparative + ! analysis of algorithms for fast computation of Zernike moments. + ! Pattern Recognition, 36(3), 731-742. - integer, intent(in) :: n ! Order requested + integer, intent(in) :: n ! Maximum order real(8), intent(in) :: rho ! Radial location in the unit disk real(8), intent(in) :: phi ! Theta (radians) location in the unit disk - real(8) :: zn(n + 1) ! The resultant Z_n(uvw) + real(8), intent(out) :: zn(:) ! The resulting list of coefficients + + real(8) :: sin_phi, cos_phi ! Sine and Cosine of phi + real(8) :: sin_phi_vec(n+1) ! Contains sin(n*phi) + real(8) :: cos_phi_vec(n+1) ! Contains cos(n*phi) + real(8) :: zn_mat(n+1, n+1) ! Matrix form of the coefficients which is + ! easier to work with + real(8) :: k1, k2, k3, k4 ! Variables for R_m_n calculation + real(8) :: sqrt_norm ! normalization for radial moments + integer :: i,p,q ! Loop counters + + real(8), parameter :: SQRT_N_1(0:10) = [& + sqrt(1.0_8), sqrt(2.0_8), sqrt(3.0_8), sqrt(4.0_8), & + sqrt(5.0_8), sqrt(6.0_8), sqrt(7.0_8), sqrt(8.0_8), & + sqrt(9.0_8), sqrt(10.0_8), sqrt(11.0_8)] + real(8), parameter :: SQRT_2N_2(0:10) = SQRT_N_1*sqrt(2.0_8) ! n == radial degree ! m == azimuthal frequency - select case(n) - case(0) - ! n = 0, m = 0 - zn(1) = ( ( 1.00 ) ) & - * ( 1.000000000000 ) - case(1) - ! n = 1, m = -1 - zn(1) = ( ( 1.00 ) * rho ) & - * ( 2.000000000000 ) * sin(1.00 * phi) - ! n = 1, m = 1 - zn(2) = ( ( 1.00 ) * rho ) & - * ( 2.000000000000 ) * cos(1.00 * phi) - case(2) - ! n = 2, m = -2 - zn(1) = ( ( 1.00 ) *rho * rho ) & - * ( 2.449489742783 ) * sin(2.00 * phi) - ! n = 2, m = 0 - zn(2) = ( ( -1.00 ) + & - ( 2.00 ) *rho * rho ) & - * ( 1.732050807569 ) - ! n = 2, m = 2 - zn(3) = ( ( 1.00 ) *rho * rho ) & - * ( 2.449489742783 ) * cos(2.00 * phi) - case(3) - ! n = 3, m = -3 - zn(1) = ( ( 1.00 ) *rho *rho * rho ) & - * ( 2.828427124746 ) * sin(3.00 * phi) - ! n = 3, m = -1 - zn(2) = ( ( -2.00 ) * rho + & - ( 3.00 ) *rho *rho * rho ) & - * ( 2.828427124746 ) * sin(3.00 * phi) - ! n = 3, m = 1 - zn(3) = ( ( -2.00 ) * rho + & - ( 3.00 ) *rho *rho * rho ) & - * ( 2.828427124746 ) * cos(3.00 * phi) - ! n = 3, m = 3 - zn(4) = ( ( 1.00 ) *rho *rho * rho ) & - * ( 2.828427124746 ) * cos(3.00 * phi) - case(4) - ! n = 4, m = -4 - zn(1) = ( ( 1.00 ) *rho *rho *rho * rho ) & - * ( 3.162277660168 ) * sin(4.00 * phi) - ! n = 4, m = -2 - zn(2) = ( ( -3.00 ) *rho * rho + & - ( 4.00 ) *rho *rho *rho * rho ) & - * ( 3.162277660168 ) * sin(4.00 * phi) - ! n = 4, m = 0 - zn(3) = ( ( 1.00 ) + & - ( -6.00 ) *rho * rho + & - ( 6.00 ) *rho *rho *rho * rho ) & - * ( 2.236067977500 ) - ! n = 4, m = 2 - zn(4) = ( ( -3.00 ) *rho * rho + & - ( 4.00 ) *rho *rho *rho * rho ) & - * ( 3.162277660168 ) * cos(4.00 * phi) - ! n = 4, m = 4 - zn(5) = ( ( 1.00 ) *rho *rho *rho * rho ) & - * ( 3.162277660168 ) * cos(4.00 * phi) - case(5) - ! n = 5, m = -5 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho * rho ) & - * ( 3.464101615138 ) * sin(5.00 * phi) - ! n = 5, m = -3 - zn(2) = ( ( -4.00 ) *rho *rho * rho + & - ( 5.00 ) *rho *rho *rho *rho * rho ) & - * ( 3.464101615138 ) * sin(5.00 * phi) - ! n = 5, m = -1 - zn(3) = ( ( 3.00 ) * rho + & - ( -12.00 ) *rho *rho * rho + & - ( 10.00 ) *rho *rho *rho *rho * rho ) & - * ( 3.464101615138 ) * sin(5.00 * phi) - ! n = 5, m = 1 - zn(4) = ( ( 3.00 ) * rho + & - ( -12.00 ) *rho *rho * rho + & - ( 10.00 ) *rho *rho *rho *rho * rho ) & - * ( 3.464101615138 ) * cos(5.00 * phi) - ! n = 5, m = 3 - zn(5) = ( ( -4.00 ) *rho *rho * rho + & - ( 5.00 ) *rho *rho *rho *rho * rho ) & - * ( 3.464101615138 ) * cos(5.00 * phi) - ! n = 5, m = 5 - zn(6) = ( ( 1.00 ) *rho *rho *rho *rho * rho ) & - * ( 3.464101615138 ) * cos(5.00 * phi) - case(6) - ! n = 6, m = -6 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho * rho ) & - * ( 3.741657386774 ) * sin(6.00 * phi) - ! n = 6, m = -4 - zn(2) = ( ( -5.00 ) *rho *rho *rho * rho + & - ( 6.00 ) *rho *rho *rho *rho *rho * rho ) & - * ( 3.741657386774 ) * sin(6.00 * phi) - ! n = 6, m = -2 - zn(3) = ( ( 6.00 ) *rho * rho + & - ( -20.00 ) *rho *rho *rho * rho + & - ( 15.00 ) *rho *rho *rho *rho *rho * rho ) & - * ( 3.741657386774 ) * sin(6.00 * phi) - ! n = 6, m = 0 - zn(4) = ( ( -1.00 ) + & - ( 12.00 ) *rho * rho + & - ( -30.00 ) *rho *rho *rho * rho + & - ( 20.00 ) *rho *rho *rho *rho *rho * rho ) & - * ( 2.645751311065 ) - ! n = 6, m = 2 - zn(5) = ( ( 6.00 ) *rho * rho + & - ( -20.00 ) *rho *rho *rho * rho + & - ( 15.00 ) *rho *rho *rho *rho *rho * rho ) & - * ( 3.741657386774 ) * cos(6.00 * phi) - ! n = 6, m = 4 - zn(6) = ( ( -5.00 ) *rho *rho *rho * rho + & - ( 6.00 ) *rho *rho *rho *rho *rho * rho ) & - * ( 3.741657386774 ) * cos(6.00 * phi) - ! n = 6, m = 6 - zn(7) = ( ( 1.00 ) *rho *rho *rho *rho *rho * rho ) & - * ( 3.741657386774 ) * cos(6.00 * phi) - case(7) - ! n = 7, m = -7 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.000000000000 ) * sin(7.00 * phi) - ! n = 7, m = -5 - zn(2) = ( ( -6.00 ) *rho *rho *rho *rho * rho + & - ( 7.00 ) *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.000000000000 ) * sin(7.00 * phi) - ! n = 7, m = -3 - zn(3) = ( ( 10.00 ) *rho *rho * rho + & - ( -30.00 ) *rho *rho *rho *rho * rho + & - ( 21.00 ) *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.000000000000 ) * sin(7.00 * phi) - ! n = 7, m = -1 - zn(4) = ( ( -4.00 ) * rho + & - ( 30.00 ) *rho *rho * rho + & - ( -60.00 ) *rho *rho *rho *rho * rho + & - ( 35.00 ) *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.000000000000 ) * sin(7.00 * phi) - ! n = 7, m = 1 - zn(5) = ( ( -4.00 ) * rho + & - ( 30.00 ) *rho *rho * rho + & - ( -60.00 ) *rho *rho *rho *rho * rho + & - ( 35.00 ) *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.000000000000 ) * cos(7.00 * phi) - ! n = 7, m = 3 - zn(6) = ( ( 10.00 ) *rho *rho * rho + & - ( -30.00 ) *rho *rho *rho *rho * rho + & - ( 21.00 ) *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.000000000000 ) * cos(7.00 * phi) - ! n = 7, m = 5 - zn(7) = ( ( -6.00 ) *rho *rho *rho *rho * rho + & - ( 7.00 ) *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.000000000000 ) * cos(7.00 * phi) - ! n = 7, m = 7 - zn(8) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.000000000000 ) * cos(7.00 * phi) - case(8) - ! n = 8, m = -8 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.242640687119 ) * sin(8.00 * phi) - ! n = 8, m = -6 - zn(2) = ( ( -7.00 ) *rho *rho *rho *rho *rho * rho + & - ( 8.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.242640687119 ) * sin(8.00 * phi) - ! n = 8, m = -4 - zn(3) = ( ( 15.00 ) *rho *rho *rho * rho + & - ( -42.00 ) *rho *rho *rho *rho *rho * rho + & - ( 28.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.242640687119 ) * sin(8.00 * phi) - ! n = 8, m = -2 - zn(4) = ( ( -10.00 ) *rho * rho + & - ( 60.00 ) *rho *rho *rho * rho + & - ( -105.00 ) *rho *rho *rho *rho *rho * rho + & - ( 56.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.242640687119 ) * sin(8.00 * phi) - ! n = 8, m = 0 - zn(5) = ( ( 1.00 ) + & - ( -20.00 ) *rho * rho + & - ( 90.00 ) *rho *rho *rho * rho + & - ( -140.00 ) *rho *rho *rho *rho *rho * rho + & - ( 70.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 3.000000000000 ) - ! n = 8, m = 2 - zn(6) = ( ( -10.00 ) *rho * rho + & - ( 60.00 ) *rho *rho *rho * rho + & - ( -105.00 ) *rho *rho *rho *rho *rho * rho + & - ( 56.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.242640687119 ) * cos(8.00 * phi) - ! n = 8, m = 4 - zn(7) = ( ( 15.00 ) *rho *rho *rho * rho + & - ( -42.00 ) *rho *rho *rho *rho *rho * rho + & - ( 28.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.242640687119 ) * cos(8.00 * phi) - ! n = 8, m = 6 - zn(8) = ( ( -7.00 ) *rho *rho *rho *rho *rho * rho + & - ( 8.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.242640687119 ) * cos(8.00 * phi) - ! n = 8, m = 8 - zn(9) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.242640687119 ) * cos(8.00 * phi) - case(9) - ! n = 9, m = -9 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * sin(9.00 * phi) - ! n = 9, m = -7 - zn(2) = ( ( -8.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 9.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * sin(9.00 * phi) - ! n = 9, m = -5 - zn(3) = ( ( 21.00 ) *rho *rho *rho *rho * rho + & - ( -56.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 36.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * sin(9.00 * phi) - ! n = 9, m = -3 - zn(4) = ( ( -20.00 ) *rho *rho * rho + & - ( 105.00 ) *rho *rho *rho *rho * rho + & - ( -168.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 84.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * sin(9.00 * phi) - ! n = 9, m = -1 - zn(5) = ( ( 5.00 ) * rho + & - ( -60.00 ) *rho *rho * rho + & - ( 210.00 ) *rho *rho *rho *rho * rho + & - ( -280.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 126.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * sin(9.00 * phi) - ! n = 9, m = 1 - zn(6) = ( ( 5.00 ) * rho + & - ( -60.00 ) *rho *rho * rho + & - ( 210.00 ) *rho *rho *rho *rho * rho + & - ( -280.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 126.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * cos(9.00 * phi) - ! n = 9, m = 3 - zn(7) = ( ( -20.00 ) *rho *rho * rho + & - ( 105.00 ) *rho *rho *rho *rho * rho + & - ( -168.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 84.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * cos(9.00 * phi) - ! n = 9, m = 5 - zn(8) = ( ( 21.00 ) *rho *rho *rho *rho * rho + & - ( -56.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 36.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * cos(9.00 * phi) - ! n = 9, m = 7 - zn(9) = ( ( -8.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 9.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * cos(9.00 * phi) - ! n = 9, m = 9 - zn(10) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.472135955000 ) * cos(9.00 * phi) - case(10) - ! n = 10, m = -10 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * sin(10.00 * phi) - ! n = 10, m = -8 - zn(2) = ( ( -9.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 10.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * sin(10.00 * phi) - ! n = 10, m = -6 - zn(3) = ( ( 28.00 ) *rho *rho *rho *rho *rho * rho + & - ( -72.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 45.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * sin(10.00 * phi) - ! n = 10, m = -4 - zn(4) = ( ( -35.00 ) *rho *rho *rho * rho + & - ( 168.00 ) *rho *rho *rho *rho *rho * rho + & - ( -252.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * sin(10.00 * phi) - ! n = 10, m = -2 - zn(5) = ( ( 15.00 ) *rho * rho + & - ( -140.00 ) *rho *rho *rho * rho + & - ( 420.00 ) *rho *rho *rho *rho *rho * rho + & - ( -504.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * sin(10.00 * phi) - ! n = 10, m = 0 - zn(6) = ( ( -1.00 ) + & - ( 30.00 ) *rho * rho + & - ( -210.00 ) *rho *rho *rho * rho + & - ( 560.00 ) *rho *rho *rho *rho *rho * rho + & - ( -630.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 252.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 3.316624790355 ) - ! n = 10, m = 2 - zn(7) = ( ( 15.00 ) *rho * rho + & - ( -140.00 ) *rho *rho *rho * rho + & - ( 420.00 ) *rho *rho *rho *rho *rho * rho + & - ( -504.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * cos(10.00 * phi) - ! n = 10, m = 4 - zn(8) = ( ( -35.00 ) *rho *rho *rho * rho + & - ( 168.00 ) *rho *rho *rho *rho *rho * rho + & - ( -252.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * cos(10.00 * phi) - ! n = 10, m = 6 - zn(9) = ( ( 28.00 ) *rho *rho *rho *rho *rho * rho + & - ( -72.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 45.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * cos(10.00 * phi) - ! n = 10, m = 8 - zn(10) = ( ( -9.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 10.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * cos(10.00 * phi) - ! n = 10, m = 10 - zn(11) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.690415759823 ) * cos(10.00 * phi) - case(11) - ! n = 11, m = -11 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * sin(11.00 * phi) - ! n = 11, m = -9 - zn(2) = ( ( -10.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 11.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * sin(11.00 * phi) - ! n = 11, m = -7 - zn(3) = ( ( 36.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -90.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 55.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * sin(11.00 * phi) - ! n = 11, m = -5 - zn(4) = ( ( -56.00 ) *rho *rho *rho *rho * rho + & - ( 252.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 165.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * sin(11.00 * phi) - ! n = 11, m = -3 - zn(5) = ( ( 35.00 ) *rho *rho * rho + & - ( -280.00 ) *rho *rho *rho *rho * rho + & - ( 756.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 330.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * sin(11.00 * phi) - ! n = 11, m = -1 - zn(6) = ( ( -6.00 ) * rho + & - ( 105.00 ) *rho *rho * rho + & - ( -560.00 ) *rho *rho *rho *rho * rho + & - ( 1260.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -1260.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 462.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * sin(11.00 * phi) - ! n = 11, m = 1 - zn(7) = ( ( -6.00 ) * rho + & - ( 105.00 ) *rho *rho * rho + & - ( -560.00 ) *rho *rho *rho *rho * rho + & - ( 1260.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -1260.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 462.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * cos(11.00 * phi) - ! n = 11, m = 3 - zn(8) = ( ( 35.00 ) *rho *rho * rho + & - ( -280.00 ) *rho *rho *rho *rho * rho + & - ( 756.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 330.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * cos(11.00 * phi) - ! n = 11, m = 5 - zn(9) = ( ( -56.00 ) *rho *rho *rho *rho * rho + & - ( 252.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 165.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * cos(11.00 * phi) - ! n = 11, m = 7 - zn(10) = ( ( 36.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -90.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 55.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * cos(11.00 * phi) - ! n = 11, m = 9 - zn(11) = ( ( -10.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 11.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * cos(11.00 * phi) - ! n = 11, m = 11 - zn(12) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.898979485566 ) * cos(11.00 * phi) - case(12) - ! n = 12, m = -12 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * sin(12.00 * phi) - ! n = 12, m = -10 - zn(2) = ( ( -11.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 12.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * sin(12.00 * phi) - ! n = 12, m = -8 - zn(3) = ( ( 45.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -110.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 66.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * sin(12.00 * phi) - ! n = 12, m = -6 - zn(4) = ( ( -84.00 ) *rho *rho *rho *rho *rho * rho + & - ( 360.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 220.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * sin(12.00 * phi) - ! n = 12, m = -4 - zn(5) = ( ( 70.00 ) *rho *rho *rho * rho + & - ( -504.00 ) *rho *rho *rho *rho *rho * rho + & - ( 1260.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1320.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * sin(12.00 * phi) - ! n = 12, m = -2 - zn(6) = ( ( -21.00 ) *rho * rho + & - ( 280.00 ) *rho *rho *rho * rho + & - ( -1260.00 ) *rho *rho *rho *rho *rho * rho + & - ( 2520.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -2310.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 792.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * sin(12.00 * phi) - ! n = 12, m = 0 - zn(7) = ( ( 1.00 ) + & - ( -42.00 ) *rho * rho + & - ( 420.00 ) *rho *rho *rho * rho + & - ( -1680.00 ) *rho *rho *rho *rho *rho * rho + & - ( 3150.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -2772.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 924.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 3.605551275464 ) - ! n = 12, m = 2 - zn(8) = ( ( -21.00 ) *rho * rho + & - ( 280.00 ) *rho *rho *rho * rho + & - ( -1260.00 ) *rho *rho *rho *rho *rho * rho + & - ( 2520.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -2310.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 792.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * cos(12.00 * phi) - ! n = 12, m = 4 - zn(9) = ( ( 70.00 ) *rho *rho *rho * rho + & - ( -504.00 ) *rho *rho *rho *rho *rho * rho + & - ( 1260.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1320.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * cos(12.00 * phi) - ! n = 12, m = 6 - zn(10) = ( ( -84.00 ) *rho *rho *rho *rho *rho * rho + & - ( 360.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 220.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * cos(12.00 * phi) - ! n = 12, m = 8 - zn(11) = ( ( 45.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -110.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 66.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * cos(12.00 * phi) - ! n = 12, m = 10 - zn(12) = ( ( -11.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 12.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * cos(12.00 * phi) - ! n = 12, m = 12 - zn(13) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.099019513593 ) * cos(12.00 * phi) - case(13) - ! n = 13, m = -13 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * sin(13.00 * phi) - ! n = 13, m = -11 - zn(2) = ( ( -12.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 13.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * sin(13.00 * phi) - ! n = 13, m = -9 - zn(3) = ( ( 55.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -132.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 78.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * sin(13.00 * phi) - ! n = 13, m = -7 - zn(4) = ( ( -120.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -660.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 286.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * sin(13.00 * phi) - ! n = 13, m = -5 - zn(5) = ( ( 126.00 ) *rho *rho *rho *rho * rho + & - ( -840.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 715.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * sin(13.00 * phi) - ! n = 13, m = -3 - zn(6) = ( ( -56.00 ) *rho *rho * rho + & - ( 630.00 ) *rho *rho *rho *rho * rho + & - ( -2520.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 4620.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -3960.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1287.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * sin(13.00 * phi) - ! n = 13, m = -1 - zn(7) = ( ( 7.00 ) * rho + & - ( -168.00 ) *rho *rho * rho + & - ( 1260.00 ) *rho *rho *rho *rho * rho + & - ( -4200.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 6930.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -5544.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1716.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * sin(13.00 * phi) - ! n = 13, m = 1 - zn(8) = ( ( 7.00 ) * rho + & - ( -168.00 ) *rho *rho * rho + & - ( 1260.00 ) *rho *rho *rho *rho * rho + & - ( -4200.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 6930.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -5544.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1716.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * cos(13.00 * phi) - ! n = 13, m = 3 - zn(9) = ( ( -56.00 ) *rho *rho * rho + & - ( 630.00 ) *rho *rho *rho *rho * rho + & - ( -2520.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 4620.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -3960.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1287.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * cos(13.00 * phi) - ! n = 13, m = 5 - zn(10) = ( ( 126.00 ) *rho *rho *rho *rho * rho + & - ( -840.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 715.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * cos(13.00 * phi) - ! n = 13, m = 7 - zn(11) = ( ( -120.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -660.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 286.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * cos(13.00 * phi) - ! n = 13, m = 9 - zn(12) = ( ( 55.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -132.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 78.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * cos(13.00 * phi) - ! n = 13, m = 11 - zn(13) = ( ( -12.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 13.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * cos(13.00 * phi) - ! n = 13, m = 13 - zn(14) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.291502622129 ) * cos(13.00 * phi) - case(14) - ! n = 14, m = -14 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * sin(14.00 * phi) - ! n = 14, m = -12 - zn(2) = ( ( -13.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 14.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * sin(14.00 * phi) - ! n = 14, m = -10 - zn(3) = ( ( 66.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -156.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 91.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * sin(14.00 * phi) - ! n = 14, m = -8 - zn(4) = ( ( -165.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 660.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -858.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 364.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * sin(14.00 * phi) - ! n = 14, m = -6 - zn(5) = ( ( 210.00 ) *rho *rho *rho *rho *rho * rho + & - ( -1320.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 2970.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -2860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1001.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * sin(14.00 * phi) - ! n = 14, m = -4 - zn(6) = ( ( -126.00 ) *rho *rho *rho * rho + & - ( 1260.00 ) *rho *rho *rho *rho *rho * rho + & - ( -4620.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 7920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 2002.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * sin(14.00 * phi) - ! n = 14, m = -2 - zn(7) = ( ( 28.00 ) *rho * rho + & - ( -504.00 ) *rho *rho *rho * rho + & - ( 3150.00 ) *rho *rho *rho *rho *rho * rho + & - ( -9240.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 13860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -10296.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 3003.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * sin(14.00 * phi) - ! n = 14, m = 0 - zn(8) = ( ( -1.00 ) + & - ( 56.00 ) *rho * rho + & - ( -756.00 ) *rho *rho *rho * rho + & - ( 4200.00 ) *rho *rho *rho *rho *rho * rho + & - ( -11550.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 16632.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -12012.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 3432.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 3.872983346207 ) - ! n = 14, m = 2 - zn(9) = ( ( 28.00 ) *rho * rho + & - ( -504.00 ) *rho *rho *rho * rho + & - ( 3150.00 ) *rho *rho *rho *rho *rho * rho + & - ( -9240.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 13860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -10296.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 3003.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * cos(14.00 * phi) - ! n = 14, m = 4 - zn(10) = ( ( -126.00 ) *rho *rho *rho * rho + & - ( 1260.00 ) *rho *rho *rho *rho *rho * rho + & - ( -4620.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 7920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 2002.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * cos(14.00 * phi) - ! n = 14, m = 6 - zn(11) = ( ( 210.00 ) *rho *rho *rho *rho *rho * rho + & - ( -1320.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 2970.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -2860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1001.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * cos(14.00 * phi) - ! n = 14, m = 8 - zn(12) = ( ( -165.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 660.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -858.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 364.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * cos(14.00 * phi) - ! n = 14, m = 10 - zn(13) = ( ( 66.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -156.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 91.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * cos(14.00 * phi) - ! n = 14, m = 12 - zn(14) = ( ( -13.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 14.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * cos(14.00 * phi) - ! n = 14, m = 14 - zn(15) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.477225575052 ) * cos(14.00 * phi) - case(15) - ! n = 15, m = -15 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * sin(15.00 * phi) - ! n = 15, m = -13 - zn(2) = ( ( -14.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 15.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * sin(15.00 * phi) - ! n = 15, m = -11 - zn(3) = ( ( 78.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -182.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 105.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * sin(15.00 * phi) - ! n = 15, m = -9 - zn(4) = ( ( -220.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 858.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1092.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 455.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * sin(15.00 * phi) - ! n = 15, m = -7 - zn(5) = ( ( 330.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 4290.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -4004.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * sin(15.00 * phi) - ! n = 15, m = -5 - zn(6) = ( ( -252.00 ) *rho *rho *rho *rho * rho + & - ( 2310.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -7920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -10010.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 3003.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * sin(15.00 * phi) - ! n = 15, m = -3 - zn(7) = ( ( 84.00 ) *rho *rho * rho + & - ( -1260.00 ) *rho *rho *rho *rho * rho + & - ( 6930.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -18480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 25740.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -18018.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 5005.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * sin(15.00 * phi) - ! n = 15, m = -1 - zn(8) = ( ( -8.00 ) * rho + & - ( 252.00 ) *rho *rho * rho + & - ( -2520.00 ) *rho *rho *rho *rho * rho + & - ( 11550.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -27720.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 36036.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -24024.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * sin(15.00 * phi) - ! n = 15, m = 1 - zn(9) = ( ( -8.00 ) * rho + & - ( 252.00 ) *rho *rho * rho + & - ( -2520.00 ) *rho *rho *rho *rho * rho + & - ( 11550.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -27720.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 36036.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -24024.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * cos(15.00 * phi) - ! n = 15, m = 3 - zn(10) = ( ( 84.00 ) *rho *rho * rho + & - ( -1260.00 ) *rho *rho *rho *rho * rho + & - ( 6930.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -18480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 25740.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -18018.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 5005.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * cos(15.00 * phi) - ! n = 15, m = 5 - zn(11) = ( ( -252.00 ) *rho *rho *rho *rho * rho + & - ( 2310.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -7920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -10010.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 3003.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * cos(15.00 * phi) - ! n = 15, m = 7 - zn(12) = ( ( 330.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( -1980.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 4290.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -4004.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * cos(15.00 * phi) - ! n = 15, m = 9 - zn(13) = ( ( -220.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 858.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1092.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 455.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * cos(15.00 * phi) - ! n = 15, m = 11 - zn(14) = ( ( 78.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -182.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 105.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * cos(15.00 * phi) - ! n = 15, m = 13 - zn(15) = ( ( -14.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 15.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * cos(15.00 * phi) - ! n = 15, m = 15 - zn(16) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.656854249492 ) * cos(15.00 * phi) - case(16) - ! n = 16, m = -16 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * sin(16.00 * phi) - ! n = 16, m = -14 - zn(2) = ( ( -15.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 16.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * sin(16.00 * phi) - ! n = 16, m = -12 - zn(3) = ( ( 91.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * sin(16.00 * phi) - ! n = 16, m = -10 - zn(4) = ( ( -286.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1092.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 560.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * sin(16.00 * phi) - ! n = 16, m = -8 - zn(5) = ( ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -2860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 6006.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -5460.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1820.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * sin(16.00 * phi) - ! n = 16, m = -6 - zn(6) = ( ( -462.00 ) *rho *rho *rho *rho *rho * rho + & - ( 3960.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 20020.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -15015.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 4368.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * sin(16.00 * phi) - ! n = 16, m = -4 - zn(7) = ( ( 210.00 ) *rho *rho *rho * rho + & - ( -2772.00 ) *rho *rho *rho *rho *rho * rho + & - ( 13860.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -34320.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 8008.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * sin(16.00 * phi) - ! n = 16, m = -2 - zn(8) = ( ( -36.00 ) *rho * rho + & - ( 840.00 ) *rho *rho *rho * rho + & - ( -6930.00 ) *rho *rho *rho *rho *rho * rho + & - ( 27720.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 72072.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 11440.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * sin(16.00 * phi) - ! n = 16, m = 0 - zn(9) = ( ( 1.00 ) + & - ( -72.00 ) *rho * rho + & - ( 1260.00 ) *rho *rho *rho * rho + & - ( -9240.00 ) *rho *rho *rho *rho *rho * rho + & - ( 34650.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -72072.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 84084.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -51480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.123105625618 ) - ! n = 16, m = 2 - zn(10) = ( ( -36.00 ) *rho * rho + & - ( 840.00 ) *rho *rho *rho * rho + & - ( -6930.00 ) *rho *rho *rho *rho *rho * rho + & - ( 27720.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 72072.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 11440.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * cos(16.00 * phi) - ! n = 16, m = 4 - zn(11) = ( ( 210.00 ) *rho *rho *rho * rho + & - ( -2772.00 ) *rho *rho *rho *rho *rho * rho + & - ( 13860.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -34320.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 8008.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * cos(16.00 * phi) - ! n = 16, m = 6 - zn(12) = ( ( -462.00 ) *rho *rho *rho *rho *rho * rho + & - ( 3960.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -12870.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 20020.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -15015.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 4368.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * cos(16.00 * phi) - ! n = 16, m = 8 - zn(13) = ( ( 495.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -2860.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 6006.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -5460.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1820.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * cos(16.00 * phi) - ! n = 16, m = 10 - zn(14) = ( ( -286.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1092.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 560.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * cos(16.00 * phi) - ! n = 16, m = 12 - zn(15) = ( ( 91.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * cos(16.00 * phi) - ! n = 16, m = 14 - zn(16) = ( ( -15.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 16.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * cos(16.00 * phi) - ! n = 16, m = 16 - zn(17) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 5.830951894845 ) * cos(16.00 * phi) - case(17) - ! n = 17, m = -17 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * sin(17.00 * phi) - ! n = 17, m = -15 - zn(2) = ( ( -16.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 17.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * sin(17.00 * phi) - ! n = 17, m = -13 - zn(3) = ( ( 105.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -240.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 136.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * sin(17.00 * phi) - ! n = 17, m = -11 - zn(4) = ( ( -364.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * sin(17.00 * phi) - ! n = 17, m = -9 - zn(5) = ( ( 715.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -4004.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 8190.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -7280.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 2380.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * sin(17.00 * phi) - ! n = 17, m = -7 - zn(6) = ( ( -792.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -20020.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -21840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 6188.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * sin(17.00 * phi) - ! n = 17, m = -5 - zn(7) = ( ( 462.00 ) *rho *rho *rho *rho * rho + & - ( -5544.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 25740.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 75075.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -48048.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 12376.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * sin(17.00 * phi) - ! n = 17, m = -3 - zn(8) = ( ( -120.00 ) *rho *rho * rho + & - ( 2310.00 ) *rho *rho *rho *rho * rho + & - ( -16632.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 135135.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -80080.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 19448.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * sin(17.00 * phi) - ! n = 17, m = -1 - zn(9) = ( ( 9.00 ) * rho + & - ( -360.00 ) *rho *rho * rho + & - ( 4620.00 ) *rho *rho *rho *rho * rho + & - ( -27720.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 90090.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -168168.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 180180.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -102960.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 24310.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * sin(17.00 * phi) - ! n = 17, m = 1 - zn(10) = ( ( 9.00 ) * rho + & - ( -360.00 ) *rho *rho * rho + & - ( 4620.00 ) *rho *rho *rho *rho * rho + & - ( -27720.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 90090.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -168168.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 180180.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -102960.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 24310.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * cos(17.00 * phi) - ! n = 17, m = 3 - zn(11) = ( ( -120.00 ) *rho *rho * rho + & - ( 2310.00 ) *rho *rho *rho *rho * rho + & - ( -16632.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 135135.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -80080.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 19448.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * cos(17.00 * phi) - ! n = 17, m = 5 - zn(12) = ( ( 462.00 ) *rho *rho *rho *rho * rho + & - ( -5544.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 25740.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -60060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 75075.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -48048.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 12376.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * cos(17.00 * phi) - ! n = 17, m = 7 - zn(13) = ( ( -792.00 ) *rho *rho *rho *rho *rho *rho * rho + & - ( 6435.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -20020.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -21840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 6188.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * cos(17.00 * phi) - ! n = 17, m = 9 - zn(14) = ( ( 715.00 ) *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -4004.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 8190.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -7280.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 2380.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * cos(17.00 * phi) - ! n = 17, m = 11 - zn(15) = ( ( -364.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1365.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -1680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * cos(17.00 * phi) - ! n = 17, m = 13 - zn(16) = ( ( 105.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -240.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 136.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * cos(17.00 * phi) - ! n = 17, m = 15 - zn(17) = ( ( -16.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 17.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * cos(17.00 * phi) - ! n = 17, m = 17 - zn(18) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.000000000000 ) * cos(17.00 * phi) - case(18) - ! n = 18, m = -18 - zn(1) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * sin(18.00 * phi) - ! n = 18, m = -16 - zn(2) = ( ( -17.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 18.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * sin(18.00 * phi) - ! n = 18, m = -14 - zn(3) = ( ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -272.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 153.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * sin(18.00 * phi) - ! n = 18, m = -12 - zn(4) = ( ( -455.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -2040.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 816.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * sin(18.00 * phi) - ! n = 18, m = -10 - zn(5) = ( ( 1001.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -5460.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 10920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -9520.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 3060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * sin(18.00 * phi) - ! n = 18, m = -8 - zn(6) = ( ( -1287.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 10010.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 43680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -30940.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 8568.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * sin(18.00 * phi) - ! n = 18, m = -6 - zn(7) = ( ( 924.00 ) *rho *rho *rho *rho *rho * rho + & - ( -10296.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -100100.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -74256.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 18564.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * sin(18.00 * phi) - ! n = 18, m = -4 - zn(8) = ( ( -330.00 ) *rho *rho *rho * rho + & - ( 5544.00 ) *rho *rho *rho *rho *rho * rho + & - ( -36036.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -225225.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 240240.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -136136.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 31824.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * sin(18.00 * phi) - ! n = 18, m = -2 - zn(9) = ( ( 45.00 ) *rho * rho + & - ( -1320.00 ) *rho *rho *rho * rho + & - ( 13860.00 ) *rho *rho *rho *rho *rho * rho + & - ( -72072.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 210210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -360360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 360360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -194480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 43758.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * sin(18.00 * phi) - ! n = 18, m = 0 - zn(10) = ( ( -1.00 ) + & - ( 90.00 ) *rho * rho + & - ( -1980.00 ) *rho *rho *rho * rho + & - ( 18480.00 ) *rho *rho *rho *rho *rho * rho + & - ( -90090.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 252252.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -420420.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 411840.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -218790.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 48620.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 4.358898943541 ) - ! n = 18, m = 2 - zn(11) = ( ( 45.00 ) *rho * rho + & - ( -1320.00 ) *rho *rho *rho * rho + & - ( 13860.00 ) *rho *rho *rho *rho *rho * rho + & - ( -72072.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 210210.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -360360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 360360.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -194480.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 43758.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * cos(18.00 * phi) - ! n = 18, m = 4 - zn(12) = ( ( -330.00 ) *rho *rho *rho * rho + & - ( 5544.00 ) *rho *rho *rho *rho *rho * rho + & - ( -36036.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -225225.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 240240.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -136136.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 31824.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * cos(18.00 * phi) - ! n = 18, m = 6 - zn(13) = ( ( 924.00 ) *rho *rho *rho *rho *rho * rho + & - ( -10296.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 45045.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -100100.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 120120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -74256.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 18564.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * cos(18.00 * phi) - ! n = 18, m = 8 - zn(14) = ( ( -1287.00 ) *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 10010.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -30030.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 43680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -30940.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 8568.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * cos(18.00 * phi) - ! n = 18, m = 10 - zn(15) = ( ( 1001.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -5460.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 10920.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -9520.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 3060.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * cos(18.00 * phi) - ! n = 18, m = 12 - zn(16) = ( ( -455.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 1680.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -2040.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 816.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * cos(18.00 * phi) - ! n = 18, m = 14 - zn(17) = ( ( 120.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( -272.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 153.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * cos(18.00 * phi) - ! n = 18, m = 16 - zn(18) = ( ( -17.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho + & - ( 18.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * cos(18.00 * phi) - ! n = 18, m = 18 - zn(19) = ( ( 1.00 ) *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho *rho * rho ) & - * ( 6.164414002969 ) * cos(18.00 * phi) - case default - zn = ONE - end select + ! Deterine vector of sin(n*phi) and cos(n*phi) + sin_phi = sin(phi) + cos_phi = cos(phi) - end function calc_zn + sin_phi_vec(1) = 1.0_8 + cos_phi_vec(1) = 1.0_8 + + sin_phi_vec(2) = 2.0_8 * cos_phi + cos_phi_vec(2) = cos_phi + + do i = 3, n+1 + sin_phi_vec(i) = 2.0_8 * cos_phi * sin_phi_vec(i-1) - sin_phi_vec(i-2) + cos_phi_vec(i) = 2.0_8 * cos_phi * cos_phi_vec(i-1) - cos_phi_vec(i-2) + end do + + do i = 1, n+1 + sin_phi_vec(i) = sin_phi_vec(i) * sin_phi + end do + + ! Calculate R_m_n(rho) + ! Fill the main diagonal first + do p = 0, n + zn_mat(p+1, p+1) = rho**p + end do + + ! Fill in the second diagonal + do q = 0, n-2 + zn_mat(q+2+1, q+1) = (q+2) * zn_mat(q+2+1, q+2+1) - (q+1) * zn_mat(q+1, q+1) + end do + ! Fill in the rest of the values using the original results + do p = 4, n + k2 = 2 * p * (p - 1) * (p - 2) + do q = p-4, 0, -2 + k1 = (p + q) * (p - q) * (p - 2) / 2 + k3 = -q**2*(p - 1) - p * (p - 1) * (p - 2) + k4 = -p * (p + q - 2) * (p - q - 2) / 2 + zn_mat(p+1, q+1) = ((k2 * rho**2 + k3) * zn_mat(p-2+1, q+1) + k4 * zn_mat(p-4+1, q+1)) / k1 + end do + end do + + ! Roll into a single vector for easier computation later + ! The vector is ordered (0,0), (1,-1), (1,1), (2,-2), (2,0), + ! (2, 2), .... in (n,m) indices + ! Note that the cos and sin vectors are offest by one + ! sin_phi_vec = [sin(x), sin(2x), sin(3x) ...] + ! cos_phi_vec = [1.0, cos(x), cos(2x)... ] + i = 1 + do p = 0, n + do q = -p, p, 2 + if (q < 0) then + zn(i) = zn_mat(p+1, abs(q)+1) * sin_phi_vec(p) * SQRT_2N_2(p) + else if (q == 0) then + zn(i) = zn_mat(p+1, q+1) * SQRT_N_1(p) + else + zn(i) = zn_mat(p+1, q+1) * cos_phi_vec(p+1) * SQRT_2N_2(p) + end if + i = i + 1 + end do + end do + end subroutine calc_zn !=============================================================================== ! EXPAND_HARMONIC expands a given series of real spherical harmonics diff --git a/src/tallies/tally_filter_zernike.F90 b/src/tallies/tally_filter_zernike.F90 index 08bc24e605..91619827a1 100644 --- a/src/tallies/tally_filter_zernike.F90 +++ b/src/tallies/tally_filter_zernike.F90 @@ -61,12 +61,10 @@ contains integer, intent(in) :: estimator type(TallyFilterMatch), intent(inout) :: match - integer :: n - integer :: j integer :: i - real(8) :: wgt - real(8) :: tmp(this % order + 1) + integer :: n real(8) :: x, y, r, theta + real(8) :: zn(this % n_bins) ! Determine normalized (r,theta) positions x = p % coord(1) % xyz(1) - this % x @@ -74,17 +72,12 @@ contains r = sqrt(x*x + y*y)/this % r theta = atan2(y, x) - i = 0 - do n = 0, this % order - ! Get moments for n-th order Zernike polynomial - tmp(1:n+1) = calc_zn(n, r, theta) / SQRT_PI + ! Get moments for Zernike polynomial orders 0..n + call calc_zn(this % order, r, theta, zn) - ! Indicate matching bins/weights - do j = 1, n + 1 - call match % bins % push_back(i + j) - call match % weights % push_back(tmp(j)) - end do - i = i + n + 1 + do i = 1, this % n_bins + call match % bins % push_back(i) + call match % weights % push_back(zn(i) / SQRT_PI) end do end subroutine get_all_bins From d41ac4846763db146642ea32374bc0acfee6e5b2 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 28 Mar 2018 15:56:03 -0500 Subject: [PATCH 142/231] Force all filters to have a .bins attribute that makes sense --- openmc/checkvalue.py | 4 +- openmc/filter.py | 695 +++++++----------- openmc/filter_legendre.py | 43 +- openmc/filter_spatial_legendre.py | 37 +- openmc/filter_spherical_harmonics.py | 46 +- openmc/filter_zernike.py | 45 +- openmc/mesh.py | 3 + openmc/mgxs/mgxs.py | 12 +- openmc/tallies.py | 195 ++--- .../tally_slice_merge/test.py | 6 +- 10 files changed, 350 insertions(+), 736 deletions(-) diff --git a/openmc/checkvalue.py b/openmc/checkvalue.py index 2f80ee4c0c..3b334319f6 100644 --- a/openmc/checkvalue.py +++ b/openmc/checkvalue.py @@ -196,7 +196,7 @@ def check_less_than(name, value, maximum, equality=False): maximum : object Maximum value to check against equality : bool, optional - Whether equality is allowed. Defaluts to False. + Whether equality is allowed. Defaults to False. """ @@ -223,7 +223,7 @@ def check_greater_than(name, value, minimum, equality=False): minimum : object Minimum value to check against equality : bool, optional - Whether equality is allowed. Defaluts to False. + Whether equality is allowed. Defaults to False. """ diff --git a/openmc/filter.py b/openmc/filter.py index c1b9f8dc92..d59d739a39 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -3,6 +3,7 @@ from collections import Iterable, OrderedDict import copy from functools import reduce import hashlib +from itertools import product from numbers import Real, Integral import operator from xml.etree import ElementTree as ET @@ -192,9 +193,6 @@ class Filter(IDManagerMixin, metaclass=FilterMeta): @bins.setter def bins(self, bins): - # Format the bins as a 1D numpy array. - bins = np.atleast_1d(bins) - # Check the bin values. self.check_bins(bins) @@ -221,8 +219,6 @@ class Filter(IDManagerMixin, metaclass=FilterMeta): XML element containing filter data """ - - element = ET.Element('filter') element.set('id', str(self.id)) element.set('type', self.short_name.lower()) @@ -332,7 +328,10 @@ class Filter(IDManagerMixin, metaclass=FilterMeta): 'is not one of the bins'.format(filter_bin) raise ValueError(msg) - return np.where(self.bins == filter_bin)[0][0] + if isinstance(self.bins, np.ndarray): + return np.where(self.bins == filter_bin)[0][0] + else: + return self.bins.index(filter_bin) def get_bin(self, bin_index): """Returns the filter bin for some filter bin index. @@ -423,25 +422,24 @@ class Filter(IDManagerMixin, metaclass=FilterMeta): class WithIDFilter(Filter): - """Abstract parent for filters of types with ids (Cell, Material, etc.).""" - - @Filter.bins.setter - def bins(self, bins): - # Format the bins as a 1D numpy array. + """Abstract parent for filters of types with IDs (Cell, Material, etc.).""" + def __init__(self, bins, filter_id=None): bins = np.atleast_1d(bins) - # Check the bin values. + # Make sure bins are either integers or appropriate objects cv.check_iterable_type('filter bins', bins, (Integral, self.expected_type)) + + # Extract ID values + bins = np.array([b if isinstance(b, Integral) else b.id + for b in bins]) + self.bins = bins + self.id = filter_id + + def check_bins(self, bins): + # Check the bin values. for edge in bins: - if isinstance(edge, Integral): - cv.check_greater_than('filter bin', edge, 0, equality=True) - - # Extract id values. - bins = np.atleast_1d([b if isinstance(b, Integral) else b.id - for b in bins]) - - self._bins = bins + cv.check_greater_than('filter bin', edge, 0, equality=True) class UniverseFilter(WithIDFilter): @@ -601,12 +599,13 @@ class MeshFilter(Filter): Attributes ---------- - bins : Integral - The Mesh ID mesh : openmc.Mesh The Mesh object that events will be tallied onto id : int Unique identifier for the filter + bins : list of tuple + A list of mesh indices for each filter bin, e.g. [(1, 1, 1), (2, 1, 1), + ...] num_bins : Integral The number of filter bins @@ -614,7 +613,7 @@ class MeshFilter(Filter): def __init__(self, mesh, filter_id=None): self.mesh = mesh - super().__init__(mesh.id, filter_id) + self.id = filter_id @classmethod def from_hdf5(cls, group, **kwargs): @@ -643,68 +642,14 @@ class MeshFilter(Filter): def mesh(self, mesh): cv.check_type('filter mesh', mesh, openmc.Mesh) self._mesh = mesh - self.bins = mesh.id - - @property - def num_bins(self): - return reduce(operator.mul, self.mesh.dimension) - - def check_bins(self, bins): - if not len(bins) == 1: - msg = 'Unable to add bins "{0}" to a MeshFilter since ' \ - 'only a single mesh can be used per tally'.format(bins) - raise ValueError(msg) - elif not isinstance(bins[0], Integral): - msg = 'Unable to add bin "{0}" to MeshFilter since it ' \ - 'is a non-integer'.format(bins[0]) - raise ValueError(msg) - elif bins[0] < 0: - msg = 'Unable to add bin "{0}" to MeshFilter since it ' \ - 'is a negative integer'.format(bins[0]) - raise ValueError(msg) + self.bins = list(mesh.indices) def can_merge(self, other): # Mesh filters cannot have more than one bin return False - def get_bin_index(self, filter_bin): - # Filter bins for a mesh are an (x,y,z) tuple. Convert (x,y,z) to a - # single bin -- this is similar to subroutine mesh_indices_to_bin in - # openmc/src/mesh.F90. - n_dim = len(self.mesh.dimension) - if n_dim == 3: - i, j, k = filter_bin - nx, ny, nz = self.mesh.dimension - return (i - 1) + (j - 1)*nx + (k - 1)*nx*ny - elif n_dim == 2: - i, j, *_ = filter_bin - nx, ny = self.mesh.dimension - return (i - 1) + (j - 1)*nx - else: - return filter_bin[0] - 1 - def get_bin(self, bin_index): - cv.check_type('bin_index', bin_index, Integral) - cv.check_greater_than('bin_index', bin_index, 0, equality=True) - cv.check_less_than('bin_index', bin_index, self.num_bins) - - n_dim = len(self.mesh.dimension) - if n_dim == 3: - # Construct 3-tuple of x,y,z cell indices for a 3D mesh - nx, ny, nz = self.mesh.dimension - x = (bin_index % nx) + 1 - y = (bin_index % (nx * ny)) // nx + 1 - z = bin_index // (nx * ny) + 1 - return (x, y, z) - - elif n_dim == 2: - # Construct 2-tuple of x,y cell indices for a 2D mesh - nx, ny = self.mesh.dimension - x = (bin_index % nx) + 1 - y = bin_index // nx + 1 - return (x, y) - else: - return (bin_index + 1,) + return self.bins[bin_index] def get_pandas_dataframe(self, data_size, stride, **kwargs): """Builds a Pandas DataFrame for the Filter's bins. @@ -783,6 +728,19 @@ class MeshFilter(Filter): return df + def to_xml_element(self): + """Return XML Element representing the Filter. + + Returns + ------- + element : xml.etree.ElementTree.Element + XML element containing filter data + + """ + element = super().to_xml_element() + element[0].text = str(self.mesh.id) + return element + class MeshSurfaceFilter(MeshFilter): """Filter events by surface crossings on a regular, rectangular mesh. @@ -802,36 +760,25 @@ class MeshSurfaceFilter(MeshFilter): The Mesh object that events will be tallied onto id : int Unique identifier for the filter + bins : list of tuple + + A list of mesh indices / surfaces for each filter bin, e.g. [(1, 1, + 'x-min out'), (1, 1, 'x-min in'), ...] + num_bins : Integral The number of filter bins """ - @property - def num_bins(self): - n_dim = len(self.mesh.dimension) - return 4*n_dim*reduce(operator.mul, self.mesh.dimension) + @MeshFilter.mesh.setter + def mesh(self, mesh): + cv.check_type('filter mesh', mesh, openmc.Mesh) + self._mesh = mesh - def get_bin_index(self, filter_bin): - # Split bin into mesh/surface parts - *mesh_tuple, surf = filter_bin - - # Get index for mesh alone - mesh_index = super().get_bin_index(mesh_tuple) - - # Combine surface and mesh index - n_dim = len(self.mesh.dimension) - for surf_index, name in enumerate(_CURRENT_NAMES): - if surf == name: - return 4*n_dim*mesh_index + surf_index - else: - raise ValueError("'{}' is not a valid mesh surface.".format(surf)) - - def get_bin(self, bin_index): - n_dim = len(self.mesh.dimension) - mesh_index, surf_index = divmod(bin_index, 4*n_dim) - mesh_bin = super().get_bin(mesh_index) - return mesh_bin + (_CURRENT_NAMES[surf_index],) + # Take the product of mesh indices and current names + n_dim = len(mesh.dimension) + self.bins = [mesh_tuple + (surf,) for mesh_tuple, surf in + product(mesh.indices, _CURRENT_NAMES[:4*n_dim])] def get_pandas_dataframe(self, data_size, stride, **kwargs): """Builds a Pandas DataFrame for the Filter's bins. @@ -920,42 +867,68 @@ class RealFilter(Filter): Parameters ---------- - bins : Iterable of Real - A grid of bin values. + values : iterable of float + A list of values for which each successive pair constitutes a range of + values for a single bin filter_id : int Unique identifier for the filter Attributes ---------- - bins : Iterable of Real - A grid of bin values. + values : numpy.ndarray + An array of values for which each successive pair constitutes a range of + values for a single bin id : int Unique identifier for the filter + bins : numpy.ndarray + An array of shape (N, 2) where each row is a pair of values indicating a + filter bin range num_bins : int The number of filter bins """ + def __init__(self, values, filter_id=None): + self.values = np.asarray(values) + self.bins = np.vstack((self.values[:-1], self.values[1:])).T + self.id = filter_id def __gt__(self, other): if type(self) is type(other): # Compare largest/smallest bin edges in filters # This logic is used when merging tallies with real filters - return self.bins[0] >= other.bins[-1] + return self.values[0] >= other.values[-1] else: return super().__gt__(other) - @property - def num_bins(self): - return len(self.bins) - 1 + @Filter.bins.setter + def bins(self, bins): + Filter.bins.__set__(self, np.asarray(bins)) + + def check_bins(self, bins): + for v0, v1 in bins: + # Values should be real + cv.check_type('filter value', v0, Real) + cv.check_type('filter value', v1, Real) + + # Make sure that each tuple has values that are increasing + if v1 < v0: + raise ValueError('Values {} and {} appear to be out of order' + .format(v0, v1)) + + for pair0, pair1 in zip(bins[:-1], bins[1:]): + # Successive pairs should be ordered + if pair1[1] < pair0[1]: + raise ValueError('Values {} and {} appear to be out of order' + .format(pair1[1], pair0[1])) def can_merge(self, other): if type(self) is not type(other): return False - if self.bins[0] == other.bins[-1]: + if self.bins[0, 0] == other.bins[-1][1]: # This low edge coincides with other's high edge return True - elif self.bins[-1] == other.bins[0]: + elif self.bins[-1][1] == other.bins[0, 0]: # This high edge coincides with other's low edge return True else: @@ -968,11 +941,11 @@ class RealFilter(Filter): raise ValueError(msg) # Merge unique filter bins - merged_bins = np.concatenate((self.bins, other.bins)) - merged_bins = np.unique(merged_bins) + merged_values = np.concatenate((self.values, other.values)) + merged_values = np.unique(merged_values) # Create a new filter with these bins and a new auto-generated ID - return type(self)(sorted(merged_bins)) + return type(self)(sorted(merged_values)) def is_subset(self, other): """Determine if another filter is a subset of this filter. @@ -994,80 +967,19 @@ class RealFilter(Filter): if type(self) is not type(other): return False - elif len(self.bins) != len(other.bins): + elif self.num_bins != other.num_bins: return False else: - return np.allclose(self.bins, other.bins) + return np.allclose(self.values, other.values) def get_bin_index(self, filter_bin): - i = np.where(self.bins == filter_bin[1])[0] + i = np.where(self.bins[:, 1] == filter_bin[1])[0] if len(i) == 0: msg = 'Unable to get the bin index for Filter since "{0}" ' \ 'is not one of the bins'.format(filter_bin) raise ValueError(msg) else: - return i[0] - 1 - - def get_bin(self, bin_index): - cv.check_type('bin_index', bin_index, Integral) - cv.check_greater_than('bin_index', bin_index, 0, equality=True) - cv.check_less_than('bin_index', bin_index, self.num_bins) - - # Construct 2-tuple of lower, upper bins for real-valued filters - return (self.bins[bin_index], self.bins[bin_index + 1]) - - -class EnergyFilter(RealFilter): - """Bins tally events based on incident particle energy. - - Parameters - ---------- - bins : Iterable of Real - A grid of energy values in eV. - filter_id : int - Unique identifier for the filter - - Attributes - ---------- - bins : Iterable of Real - A grid of energy values in eV. - id : int - Unique identifier for the filter - num_bins : int - The number of filter bins - - """ - - def get_bin_index(self, filter_bin): - # Use lower energy bound to find index for RealFilters - deltas = np.abs(self.bins - filter_bin[1]) / filter_bin[1] - min_delta = np.min(deltas) - if min_delta < 1E-3: - return deltas.argmin() - 1 - else: - msg = 'Unable to get the bin index for Filter since "{0}" ' \ - 'is not one of the bins'.format(filter_bin) - raise ValueError(msg) - - def check_bins(self, bins): - for edge in bins: - if not isinstance(edge, Real): - msg = 'Unable to add bin edge "{0}" to a "{1}" ' \ - 'since it is a non-integer or floating point ' \ - 'value'.format(edge, type(self)) - raise ValueError(msg) - elif edge < 0.: - msg = 'Unable to add bin edge "{0}" to a "{1}" ' \ - 'since it is a negative value'.format(edge, type(self)) - raise ValueError(msg) - - # Check that bin edges are monotonically increasing - for index in range(1, len(bins)): - if bins[index] < bins[index-1]: - msg = 'Unable to add bin edges "{0}" to a "{1}" Filter ' \ - 'since they are not monotonically ' \ - 'increasing'.format(bins, type(self)) - raise ValueError(msg) + return i[0] def get_pandas_dataframe(self, data_size, stride, **kwargs): """Builds a Pandas DataFrame for the Filter's bins. @@ -1102,35 +1014,103 @@ class EnergyFilter(RealFilter): # Extract the lower and upper energy bounds, then repeat and tile # them as necessary to account for other filters. - lo_bins = np.repeat(self.bins[:-1], stride) - hi_bins = np.repeat(self.bins[1:], stride) + lo_bins = np.repeat(self.bins[:, 0], stride) + hi_bins = np.repeat(self.bins[:, 1], stride) tile_factor = data_size // len(lo_bins) lo_bins = np.tile(lo_bins, tile_factor) hi_bins = np.tile(hi_bins, tile_factor) # Add the new energy columns to the DataFrame. - df.loc[:, self.short_name.lower() + ' low [eV]'] = lo_bins - df.loc[:, self.short_name.lower() + ' high [eV]'] = hi_bins + if hasattr(self, 'units'): + units = ' [{}]'.format(self.units) + else: + units = '' + + df.loc[:, self.short_name.lower() + ' low' + units] = lo_bins + df.loc[:, self.short_name.lower() + ' high' + units] = hi_bins return df + def to_xml_element(self): + """Return XML Element representing the Filter. + + Returns + ------- + element : xml.etree.ElementTree.Element + XML element containing filter data + + """ + element = super().to_xml_element() + element[0].text = ' '.join(str(x) for x in self.values) + return element + + +class EnergyFilter(RealFilter): + """Bins tally events based on incident particle energy. + + Parameters + ---------- + values : Iterable of Real + A list of values for which each successive pair constitutes a range of + energies in [eV] for a single bin + filter_id : int + Unique identifier for the filter + + Attributes + ---------- + values : numpy.ndarray + An array of values for which each successive pair constitutes a range of + energies in [eV] for a single bin + id : int + Unique identifier for the filter + bins : numpy.ndarray + An array of shape (N, 2) where each row is a pair of energies in [eV] + for a single filter bin + num_bins : int + The number of filter bins + + """ + units = 'eV' + + def get_bin_index(self, filter_bin): + # Use lower energy bound to find index for RealFilters + deltas = np.abs(self.bins[:, 1] - filter_bin[1]) / filter_bin[1] + min_delta = np.min(deltas) + if min_delta < 1E-3: + return deltas.argmin() + else: + msg = 'Unable to get the bin index for Filter since "{0}" ' \ + 'is not one of the bins'.format(filter_bin) + raise ValueError(msg) + + def check_bins(self, bins): + super().check_bins(bins) + for v0, v1 in bins: + cv.check_greater_than('filter value', v0, 0., equality=True) + cv.check_greater_than('filter value', v1, 0., equality=True) + class EnergyoutFilter(EnergyFilter): """Bins tally events based on outgoing particle energy. Parameters ---------- - bins : Iterable of Real - A grid of energy values in eV. + values : Iterable of Real + A list of values for which each successive pair constitutes a range of + energies in [eV] for a single bin filter_id : int Unique identifier for the filter Attributes ---------- - bins : Iterable of Real - A grid of energy values in eV. + values : numpy.ndarray + An array of values for which each successive pair constitutes a range of + energies in [eV] for a single bin id : int Unique identifier for the filter + bins : numpy.ndarray + An array of shape (N, 2) where each row is a pair of energies in [eV] + for a single filter bin num_bins : int The number of filter bins @@ -1412,98 +1392,41 @@ class MuFilter(RealFilter): Parameters ---------- - bins : Iterable of Real or Integral - A grid of scattering angles which events will binned into. Values - represent the cosine of the scattering angle. If an Iterable is given, - the values will be used explicitly as grid points. If a single Integral - is given, the range [-1, 1] will be divided up equally into that number - of bins. + values : int or Iterable of Real + A grid of scattering angles which events will binned into. Values + represent the cosine of the scattering angle. If an iterable is given, + the values will be used explicitly as grid points. If a single int is + given, the range [-1, 1] will be divided up equally into that number of + bins. filter_id : int Unique identifier for the filter Attributes ---------- - bins : Integral - A grid of scattering angles which events will binned into. Values - represent the cosine of the scattering angle. If an Iterable is given, - the values will be used explicitly as grid points. If a single Integral - is given, the range [-1, 1] will be divided up equally into that number - of bins. + values : numpy.ndarray + An array of values for which each successive pair constitutes a range of + scattering angle cosines for a single bin id : int Unique identifier for the filter + bins : numpy.ndarray + An array of shape (N, 2) where each row is a pair of scattering angle + cosines for a single filter bin num_bins : Integral The number of filter bins """ + def __init__(self, values, filter_id=None): + if isinstance(values, Integral): + values = np.linspace(-1., 1., values + 1) + super().__init__(values, filter_id) def check_bins(self, bins): - for edge in bins: - if not isinstance(edge, Real): - msg = 'Unable to add bin edge "{0}" to a "{1}" ' \ - 'since it is a non-integer or floating point ' \ - 'value'.format(edge, type(self)) - raise ValueError(msg) - elif edge < -1.: - msg = 'Unable to add bin edge "{0}" to a "{1}" ' \ - 'since it is less than -1'.format(edge, type(self)) - raise ValueError(msg) - elif edge > 1.: - msg = 'Unable to add bin edge "{0}" to a "{1}" ' \ - 'since it is greater than 1'.format(edge, type(self)) - raise ValueError(msg) - - # Check that bin edges are monotonically increasing - for index in range(1, len(bins)): - if bins[index] < bins[index-1]: - msg = 'Unable to add bin edges "{0}" to a "{1}" Filter ' \ - 'since they are not monotonically ' \ - 'increasing'.format(bins, type(self)) - raise ValueError(msg) - - def get_pandas_dataframe(self, data_size, stride, **kwargs): - """Builds a Pandas DataFrame for the Filter's bins. - - This method constructs a Pandas DataFrame object for the filter with - columns annotated by filter bin information. This is a helper method - for :meth:`Tally.get_pandas_dataframe`. - - Parameters - ---------- - data_size : int - The total number of bins in the tally corresponding to this filter - stride : int - Stride in memory for the filter - - Returns - ------- - pandas.DataFrame - A Pandas DataFrame with one column of the lower energy bound and one - column of upper energy bound for each filter bin. The number of - rows in the DataFrame is the same as the total number of bins in the - corresponding tally, with the filter bin appropriately tiled to map - to the corresponding tally bins. - - See also - -------- - Tally.get_pandas_dataframe(), CrossFilter.get_pandas_dataframe() - - """ - # Initialize Pandas DataFrame - df = pd.DataFrame() - - # Extract the lower and upper energy bounds, then repeat and tile - # them as necessary to account for other filters. - lo_bins = np.repeat(self.bins[:-1], stride) - hi_bins = np.repeat(self.bins[1:], stride) - tile_factor = data_size // len(lo_bins) - lo_bins = np.tile(lo_bins, tile_factor) - hi_bins = np.tile(hi_bins, tile_factor) - - # Add the new energy columns to the DataFrame. - df.loc[:, self.short_name.lower() + ' low'] = lo_bins - df.loc[:, self.short_name.lower() + ' high'] = hi_bins - - return df + super().check_bins(bins) + for x in np.ravel(bins): + if not np.isclose(x, -1.): + cv.check_greater_than('filter value', x, -1., equality=True) + if not np.isclose(x, 1.): + cv.check_less_than('filter value', x, 1., equality=True) class PolarFilter(RealFilter): @@ -1511,98 +1434,44 @@ class PolarFilter(RealFilter): Parameters ---------- - bins : Iterable of Real or Integral - A grid of polar angles which events will binned into. Values represent - an angle in radians relative to the z-axis. If an Iterable is given, - the values will be used explicitly as grid points. If a single Integral - is given, the range [0, pi] will be divided up equally into that number - of bins. + values : int or Iterable of Real + A grid of polar angles which events will binned into. Values represent + an angle in radians relative to the z-axis. If an iterable is given, the + values will be used explicitly as grid points. If a single int is given, + the range [0, pi] will be divided up equally into that number of bins. filter_id : int Unique identifier for the filter Attributes ---------- - bins : Iterable of Real or Integral - A grid of polar angles which events will binned into. Values represent - an angle in radians relative to the z-axis. If an Iterable is given, - the values will be used explicitly as grid points. If a single Integral - is given, the range [0, pi] will be divided up equally into that number - of bins. + values : numpy.ndarray + An array of values for which each successive pair constitutes a range of + polar angles in [rad] for a single bin + id : int + Unique identifier for the filter + bins : numpy.ndarray + An array of shape (N, 2) where each row is a pair of polar angles for a + single filter bin id : int Unique identifier for the filter num_bins : Integral The number of filter bins """ + units = 'rad' + + def __init__(self, values, filter_id=None): + if isinstance(values, Integral): + values = np.linspace(0., np.pi, values + 1) + super().__init__(values, filter_id) def check_bins(self, bins): - for edge in bins: - if not isinstance(edge, Real): - msg = 'Unable to add bin edge "{0}" to a "{1}" ' \ - 'since it is a non-integer or floating point ' \ - 'value'.format(edge, type(self)) - raise ValueError(msg) - elif edge < 0.: - msg = 'Unable to add bin edge "{0}" to a "{1}" ' \ - 'since it is less than 0'.format(edge, type(self)) - raise ValueError(msg) - elif not np.isclose(edge, np.pi) and edge > np.pi: - msg = 'Unable to add bin edge "{0}" to a "{1}" ' \ - 'since it is greater than pi'.format(edge, type(self)) - raise ValueError(msg) - - # Check that bin edges are monotonically increasing - for index in range(1, len(bins)): - if bins[index] < bins[index-1]: - msg = 'Unable to add bin edges "{0}" to a "{1}" Filter ' \ - 'since they are not monotonically ' \ - 'increasing'.format(bins, type(self)) - raise ValueError(msg) - - def get_pandas_dataframe(self, data_size, stride, **kwargs): - """Builds a Pandas DataFrame for the Filter's bins. - - This method constructs a Pandas DataFrame object for the filter with - columns annotated by filter bin information. This is a helper method for - :meth:`Tally.get_pandas_dataframe`. - - Parameters - ---------- - data_size : int - The total number of bins in the tally corresponding to this filter - stride : int - Stride in memory for the filter - - Returns - ------- - pandas.DataFrame - A Pandas DataFrame with a column corresponding to the lower polar - angle bound for each of the filter's bins. The number of rows in - the DataFrame is the same as the total number of bins in the - corresponding tally, with the filter bin appropriately tiled to map - to the corresponding tally bins. - - See also - -------- - Tally.get_pandas_dataframe(), CrossFilter.get_pandas_dataframe() - - """ - # Initialize Pandas DataFrame - df = pd.DataFrame() - - # Extract the lower and upper angle bounds, then repeat and tile - # them as necessary to account for other filters. - lo_bins = np.repeat(self.bins[:-1], stride) - hi_bins = np.repeat(self.bins[1:], stride) - tile_factor = data_size // len(lo_bins) - lo_bins = np.tile(lo_bins, tile_factor) - hi_bins = np.tile(hi_bins, tile_factor) - - # Add the new angle columns to the DataFrame. - df.loc[:, 'polar low'] = lo_bins - df.loc[:, 'polar high'] = hi_bins - - return df + super().check_bins(bins) + for x in np.ravel(bins): + if not np.isclose(x, 0.): + cv.check_greater_than('filter value', x, 0., equality=True) + if not np.isclose(x, np.pi): + cv.check_less_than('filter value', x, np.pi, equality=True) class AzimuthalFilter(RealFilter): @@ -1610,98 +1479,43 @@ class AzimuthalFilter(RealFilter): Parameters ---------- - bins : Iterable of Real or Integral - A grid of azimuthal angles which events will binned into. Values + values : int or Iterable of Real + A grid of azimuthal angles which events will binned into. Values represent an angle in radians relative to the x-axis and perpendicular - to the z-axis. If an Iterable is given, the values will be used - explicitly as grid points. If a single Integral is given, the range + to the z-axis. If an iterable is given, the values will be used + explicitly as grid points. If a single int is given, the range [-pi, pi) will be divided up equally into that number of bins. filter_id : int Unique identifier for the filter Attributes ---------- - bins : Iterable of Real or Integral - A grid of azimuthal angles which events will binned into. Values - represent an angle in radians relative to the x-axis and perpendicular - to the z-axis. If an Iterable is given, the values will be used - explicitly as grid points. If a single Integral is given, the range - [-pi, pi) will be divided up equally into that number of bins. + values : numpy.ndarray + An array of values for which each successive pair constitutes a range of + azimuthal angles in [rad] for a single bin id : int Unique identifier for the filter + bins : numpy.ndarray + An array of shape (N, 2) where each row is a pair of azimuthal angles + for a single filter bin num_bins : Integral The number of filter bins """ + units = 'rad' + + def __init__(self, values, filter_id=None): + if isinstance(values, Integral): + values = np.linspace(-np.pi, np.pi, values + 1) + super().__init__(values, filter_id) def check_bins(self, bins): - for edge in bins: - if not isinstance(edge, Real): - msg = 'Unable to add bin edge "{0}" to a "{1}" ' \ - 'since it is a non-integer or floating point ' \ - 'value'.format(edge, type(self)) - raise ValueError(msg) - elif not np.isclose(edge, -np.pi) and edge < -np.pi: - msg = 'Unable to add bin edge "{0}" to a "{1}" ' \ - 'since it is less than -pi'.format(edge, type(self)) - raise ValueError(msg) - elif not np.isclose(edge, np.pi) and edge > np.pi: - msg = 'Unable to add bin edge "{0}" to a "{1}" ' \ - 'since it is greater than pi'.format(edge, type(self)) - raise ValueError(msg) - - # Check that bin edges are monotonically increasing - for index in range(1, len(bins)): - if bins[index] < bins[index-1]: - msg = 'Unable to add bin edges "{0}" to a "{1}" Filter ' \ - 'since they are not monotonically ' \ - 'increasing'.format(bins, type(self)) - raise ValueError(msg) - - def get_pandas_dataframe(self, data_size, stride, paths=True): - """Builds a Pandas DataFrame for the Filter's bins. - - This method constructs a Pandas DataFrame object for the filter with - columns annotated by filter bin information. This is a helper method for - :meth:`Tally.get_pandas_dataframe`. - - Parameters - ---------- - data_size : int - The total number of bins in the tally corresponding to this filter - stride : int - Stride in memory for the filter - - Returns - ------- - pandas.DataFrame - A Pandas DataFrame with a column corresponding to the lower - azimuthal angle bound for each of the filter's bins. The number of - rows in the DataFrame is the same as the total number of bins in the - corresponding tally, with the filter bin appropriately tiled to map - to the corresponding tally bins. - - See also - -------- - Tally.get_pandas_dataframe(), CrossFilter.get_pandas_dataframe() - - """ - # Initialize Pandas DataFrame - df = pd.DataFrame() - - # Extract the lower and upper angle bounds, then repeat and tile - # them as necessary to account for other filters. - lo_bins = np.repeat(self.bins[:-1], stride) - hi_bins = np.repeat(self.bins[1:], stride) - tile_factor = data_size // len(lo_bins) - lo_bins = np.tile(lo_bins, tile_factor) - hi_bins = np.tile(hi_bins, tile_factor) - - # Add the new angle columns to the DataFrame. - df.loc[:, 'azimuthal low'] = lo_bins - df.loc[:, 'azimuthal high'] = hi_bins - - return df + super().check_bins(bins) + for x in np.ravel(bins): + if not np.isclose(x, -np.pi): + cv.check_greater_than('filter value', x, -np.pi, equality=True) + if not np.isclose(x, np.pi): + cv.check_less_than('filter value', x, np.pi, equality=True) class DelayedGroupFilter(Filter): @@ -1709,7 +1523,7 @@ class DelayedGroupFilter(Filter): Parameters ---------- - bins : Integral or Iterable of Integral + bins : iterable of int The delayed neutron precursor groups. For example, ENDF/B-VII.1 uses 6 precursor groups so a tally with all groups will have bins = [1, 2, 3, 4, 5, 6]. @@ -1718,7 +1532,7 @@ class DelayedGroupFilter(Filter): Attributes ---------- - bins : Integral or Iterable of Integral + bins : iterable of int The delayed neutron precursor groups. For example, ENDF/B-VII.1 uses 6 precursor groups so a tally with all groups will have bins = [1, 2, 3, 4, 5, 6]. @@ -1728,17 +1542,10 @@ class DelayedGroupFilter(Filter): The number of filter bins """ - @Filter.bins.setter - def bins(self, bins): - # Format the bins as a 1D numpy array. - bins = np.atleast_1d(bins) - + def check_bins(self, bins): # Check the bin values. - cv.check_iterable_type('filter bins', bins, Integral) - for edge in bins: - cv.check_greater_than('filter bin', edge, 0, equality=True) - - self._bins = bins + for g in bins: + cv.check_greater_than('delayed group', g, 0) class EnergyFunctionFilter(Filter): @@ -1751,18 +1558,18 @@ class EnergyFunctionFilter(Filter): Parameters ---------- energy : Iterable of Real - A grid of energy values in eV. + A grid of energy values in [eV] y : iterable of Real - A grid of interpolant values in eV. + A grid of interpolant values in [eV] filter_id : int Unique identifier for the filter Attributes ---------- energy : Iterable of Real - A grid of energy values in eV. + A grid of energy values in [eV] y : iterable of Real - A grid of interpolant values in eV. + A grid of interpolant values in [eV] id : int Unique identifier for the filter num_bins : Integral @@ -1903,6 +1710,14 @@ class EnergyFunctionFilter(Filter): raise RuntimeError('EnergyFunctionFilters have no bins.') def to_xml_element(self): + """Return XML Element representing the Filter. + + Returns + ------- + element : xml.etree.ElementTree.Element + XML element containing filter data + + """ element = ET.Element('filter') element.set('id', str(self.id)) element.set('type', self.short_name.lower()) diff --git a/openmc/filter_legendre.py b/openmc/filter_legendre.py index 075fa02dbc..18998d5cc8 100644 --- a/openmc/filter_legendre.py +++ b/openmc/filter_legendre.py @@ -34,6 +34,7 @@ class LegendreFilter(Filter): def __init__(self, order, filter_id=None): self.order = order + self.bins = ['P{}'.format(i) for i in range(order + 1)] self.id = filter_id def __hash__(self): @@ -57,10 +58,6 @@ class LegendreFilter(Filter): cv.check_greater_than('Legendre order', order, 0, equality=True) self._order = order - @property - def num_bins(self): - return self._order + 1 - @classmethod def from_hdf5(cls, group, **kwargs): if group['type'].value.decode() != cls.short_name.lower(): @@ -74,44 +71,6 @@ class LegendreFilter(Filter): return out - def get_pandas_dataframe(self, data_size, stride, **kwargs): - """Builds a Pandas DataFrame for the Filter's bins. - - This method constructs a Pandas DataFrame object for the filter with - columns annotated by filter bin information. This is a helper method for - :meth:`Tally.get_pandas_dataframe`. - - Parameters - ---------- - data_size : Integral - The total number of bins in the tally corresponding to this filter - stride : int - Stride in memory for the filter - - Returns - ------- - pandas.DataFrame - A Pandas DataFrame with a column that is filled with strings - indicating Legendre orders. The number of rows in the DataFrame is - the same as the total number of bins in the corresponding tally. - - See also - -------- - Tally.get_pandas_dataframe(), CrossFilter.get_pandas_dataframe() - - """ - # Initialize Pandas DataFrame - df = pd.DataFrame() - - bins = np.array(['P{}'.format(i) for i in range(self.order + 1)]) - filter_bins = np.repeat(bins, stride) - tile_factor = data_size // len(filter_bins) - filter_bins = np.tile(filter_bins, tile_factor) - df = pd.concat([df, pd.DataFrame( - {self.short_name.lower(): filter_bins})]) - - return df - def to_xml_element(self): """Return XML Element representing the filter. diff --git a/openmc/filter_spatial_legendre.py b/openmc/filter_spatial_legendre.py index 690447d9cb..726a3bfdfe 100644 --- a/openmc/filter_spatial_legendre.py +++ b/openmc/filter_spatial_legendre.py @@ -44,6 +44,7 @@ class SpatialLegendreFilter(Filter): self.axis = axis self.minimum = minimum self.maximum = maximum + self.bins = ['P{}'.format(i) for i in range(order + 1)] self.id = filter_id def __hash__(self): @@ -118,42 +119,6 @@ class SpatialLegendreFilter(Filter): return cls(order, axis, min_, max_, filter_id) - def get_pandas_dataframe(self, data_size, stride, **kwargs): - """Builds a Pandas DataFrame for the Filter's bins. - - This method constructs a Pandas DataFrame object for the filter with - columns annotated by filter bin information. This is a helper method for - :meth:`Tally.get_pandas_dataframe`. - - Parameters - ---------- - data_size : Integral - The total number of bins in the tally corresponding to this filter - - Returns - ------- - pandas.DataFrame - A Pandas DataFrame with a column that is filled with strings - indicating Legendre orders. The number of rows in the DataFrame is - the same as the total number of bins in the corresponding tally. - - See also - -------- - Tally.get_pandas_dataframe(), CrossFilter.get_pandas_dataframe() - - """ - # Initialize Pandas DataFrame - df = pd.DataFrame() - - bins = np.array(['P{}'.format(i) for i in range(self.order + 1)]) - filter_bins = np.repeat(bins, stride) - tile_factor = data_size // len(filter_bins) - filter_bins = np.tile(filter_bins, tile_factor) - df = pd.concat([df, pd.DataFrame( - {self.short_name.lower(): filter_bins})]) - - return df - def to_xml_element(self): """Return XML Element representing the filter. diff --git a/openmc/filter_spherical_harmonics.py b/openmc/filter_spherical_harmonics.py index 3b2e32b140..f95c09c303 100644 --- a/openmc/filter_spherical_harmonics.py +++ b/openmc/filter_spherical_harmonics.py @@ -34,6 +34,9 @@ class SphericalHarmonicsFilter(Filter): def __init__(self, order, filter_id=None): self.order = order self.id = filter_id + self.bins = ['Y{},{}'.format(n, m) + for n in range(order + 1) + for m in range(-n, n + 1)] self._cosine = 'particle' def __hash__(self): @@ -87,49 +90,6 @@ class SphericalHarmonicsFilter(Filter): return out - def get_pandas_dataframe(self, data_size, stride, **kwargs): - """Builds a Pandas DataFrame for the Filter's bins. - - This method constructs a Pandas DataFrame object for the filter with - columns annotated by filter bin information. This is a helper method for - :meth:`Tally.get_pandas_dataframe`. - - Parameters - ---------- - data_size : Integral - The total number of bins in the tally corresponding to this filter - stride : int - Stride in memory for the filter - - Returns - ------- - pandas.DataFrame - A Pandas DataFrame with a column that is filled with strings - indicating spherical harmonics orders. The number of rows in the - DataFrame is the same as the total number of bins in the - corresponding tally. - - See also - -------- - Tally.get_pandas_dataframe(), CrossFilter.get_pandas_dataframe() - - """ - # Initialize Pandas DataFrame - df = pd.DataFrame() - - bins = [] - for n in range(self.order + 1): - bins.extend('Y{},{}'.format(n, m) for m in range(-n, n + 1)) - bins = np.array(bins) - - filter_bins = np.repeat(bins, stride) - tile_factor = data_size // len(filter_bins) - filter_bins = np.tile(filter_bins, tile_factor) - df = pd.concat([df, pd.DataFrame( - {self.short_name.lower(): filter_bins})]) - - return df - def to_xml_element(self): """Return XML Element representing the filter. diff --git a/openmc/filter_zernike.py b/openmc/filter_zernike.py index 3b4efe5d58..a7697f5d0e 100644 --- a/openmc/filter_zernike.py +++ b/openmc/filter_zernike.py @@ -48,6 +48,9 @@ class ZernikeFilter(Filter): self.x = x self.y = y self.r = r + self.bins = ['Z{},{}'.format(n, m) + for n in range(order + 1) + for m in range(-n, n + 1, 2)] self.id = filter_id def __hash__(self): @@ -116,48 +119,6 @@ class ZernikeFilter(Filter): return cls(order, x, y, r, filter_id) - def get_pandas_dataframe(self, data_size, stride, **kwargs): - """Builds a Pandas DataFrame for the Filter's bins. - - This method constructs a Pandas DataFrame object for the filter with - columns annotated by filter bin information. This is a helper method for - :meth:`Tally.get_pandas_dataframe`. - - Parameters - ---------- - data_size : Integral - The total number of bins in the tally corresponding to this filter - - Returns - ------- - pandas.DataFrame - A Pandas DataFrame with a column that is filled with strings - indicating Zernike orders. The number of rows in the DataFrame is - the same as the total number of bins in the corresponding tally. - - See also - -------- - Tally.get_pandas_dataframe(), CrossFilter.get_pandas_dataframe() - - """ - # Initialize Pandas DataFrame - df = pd.DataFrame() - - # Create list of strings for each order - orders = [] - for n in range(self.order + 1): - for m in range(-n, n + 1, 2): - orders.append('Z{},{}'.format(n, m)) - - bins = np.array(orders) - filter_bins = np.repeat(bins, stride) - tile_factor = data_size // len(filter_bins) - filter_bins = np.tile(filter_bins, tile_factor) - df = pd.concat([df, pd.DataFrame( - {self.short_name.lower(): filter_bins})]) - - return df - def to_xml_element(self): """Return XML Element representing the filter. diff --git a/openmc/mesh.py b/openmc/mesh.py index cd8eb3c5ed..aed7a46d8c 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -38,6 +38,9 @@ class Mesh(IDManagerMixin): are given, it is assumed that the mesh is an x-y mesh. width : Iterable of float The width of mesh cells in each direction. + indices : list of tuple + A list of mesh indices for each mesh element, e.g. [(1, 1, 1), (2, 1, + 1), ...] """ diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index 4932feff1e..5bc00cbc95 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -1164,12 +1164,14 @@ class MGXS(metaclass=ABCMeta): if not isinstance(tally_filter, (openmc.EnergyFilter, openmc.EnergyoutFilter)): continue - elif len(tally_filter.bins) != len(fine_edges): + elif len(tally_filter.bins) != len(fine_edges) - 1: continue - elif not np.allclose(tally_filter.bins, fine_edges): + elif not np.allclose(tally_filter.bins[:, 0], fine_edges[:-1]): continue else: - tally_filter.bins = coarse_groups.group_edges + cedge = coarse_groups.group_edges + tally_filter.values = cedge + tally_filter.bins = np.vstack((cedge[:-1], cedge[1:])).T mean = np.add.reduceat(mean, energy_indices, axis=i) std_dev = np.add.reduceat(std_dev**2, energy_indices, axis=i) @@ -2738,7 +2740,7 @@ class TransportXS(MGXS): if self._rxn_rate_tally is None: # Switch EnergyoutFilter to EnergyFilter. old_filt = self.tallies['scatter-1'].filters[-1] - new_filt = openmc.EnergyFilter(old_filt.bins) + new_filt = openmc.EnergyFilter(old_filt.values) self.tallies['scatter-1'].filters[-1] = new_filt self._rxn_rate_tally = \ @@ -2757,7 +2759,7 @@ class TransportXS(MGXS): # Switch EnergyoutFilter to EnergyFilter. old_filt = self.tallies['scatter-1'].filters[-1] - new_filt = openmc.EnergyFilter(old_filt.bins) + new_filt = openmc.EnergyFilter(old_filt.values) self.tallies['scatter-1'].filters[-1] = new_filt # Compute total cross section diff --git a/openmc/tallies.py b/openmc/tallies.py index 6c055d1913..08db20e399 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -218,10 +218,9 @@ class Tally(IDManagerMixin): f = h5py.File(self._sp_filename, 'r') # Extract Tally data from the file - data = f['tallies/tally {0}/results'.format( - self.id)].value - sum = data[:,:,0] - sum_sq = data[:,:,1] + data = f['tallies/tally {0}/results'.format(self.id)].value + sum = data[:, :, 0] + sum_sq = data[:, :, 1] # Reshape the results arrays sum = np.reshape(sum, self.shape) @@ -273,8 +272,8 @@ class Tally(IDManagerMixin): # Convert NumPy array to SciPy sparse LIL matrix if self.sparse: - self._mean = \ - sps.lil_matrix(self._mean.flatten(), self._mean.shape) + self._mean = sps.lil_matrix(self._mean.flatten(), + self._mean.shape) if self.sparse: return np.reshape(self._mean.toarray(), self.shape) @@ -295,8 +294,8 @@ class Tally(IDManagerMixin): # Convert NumPy array to SciPy sparse LIL matrix if self.sparse: - self._std_dev = \ - sps.lil_matrix(self._std_dev.flatten(), self._std_dev.shape) + self._std_dev = sps.lil_matrix(self._std_dev.flatten(), + self._std_dev.shape) self.with_batch_statistics = True @@ -436,17 +435,16 @@ class Tally(IDManagerMixin): # Convert NumPy arrays to SciPy sparse LIL matrices if sparse and not self.sparse: if self._sum is not None: - self._sum = \ - sps.lil_matrix(self._sum.flatten(), self._sum.shape) + self._sum = sps.lil_matrix(self._sum.flatten(), self._sum.shape) if self._sum_sq is not None: - self._sum_sq = \ - sps.lil_matrix(self._sum_sq.flatten(), self._sum_sq.shape) + self._sum_sq = sps.lil_matrix(self._sum_sq.flatten(), + self._sum_sq.shape) if self._mean is not None: - self._mean = \ - sps.lil_matrix(self._mean.flatten(), self._mean.shape) + self._mean = sps.lil_matrix(self._mean.flatten(), + self._mean.shape) if self._std_dev is not None: - self._std_dev = \ - sps.lil_matrix(self._std_dev.flatten(), self._std_dev.shape) + self._std_dev = sps.lil_matrix(self._std_dev.flatten(), + self._std_dev.shape) self._sparse = True @@ -776,11 +774,11 @@ class Tally(IDManagerMixin): other_sum = other_copy.get_reshaped_data(value='sum') if join_right: - merged_sum = \ - np.concatenate((self_sum, other_sum), axis=merge_axis) + merged_sum = np.concatenate((self_sum, other_sum), + axis=merge_axis) else: - merged_sum = \ - np.concatenate((other_sum, self_sum), axis=merge_axis) + merged_sum = np.concatenate((other_sum, self_sum), + axis=merge_axis) merged_tally._sum = np.reshape(merged_sum, merged_tally.shape) @@ -790,11 +788,11 @@ class Tally(IDManagerMixin): other_sum_sq = other_copy.get_reshaped_data(value='sum_sq') if join_right: - merged_sum_sq = \ - np.concatenate((self_sum_sq, other_sum_sq), axis=merge_axis) + merged_sum_sq = np.concatenate((self_sum_sq, other_sum_sq), + axis=merge_axis) else: - merged_sum_sq = \ - np.concatenate((other_sum_sq, self_sum_sq), axis=merge_axis) + merged_sum_sq = np.concatenate((other_sum_sq, self_sum_sq), + axis=merge_axis) merged_tally._sum_sq = np.reshape(merged_sum_sq, merged_tally.shape) @@ -804,11 +802,11 @@ class Tally(IDManagerMixin): other_mean = other_copy.get_reshaped_data(value='mean') if join_right: - merged_mean = \ - np.concatenate((self_mean, other_mean), axis=merge_axis) + merged_mean = np.concatenate((self_mean, other_mean), + axis=merge_axis) else: - merged_mean = \ - np.concatenate((other_mean, self_mean), axis=merge_axis) + merged_mean = np.concatenate((other_mean, self_mean), + axis=merge_axis) merged_tally._mean = np.reshape(merged_mean, merged_tally.shape) @@ -818,11 +816,11 @@ class Tally(IDManagerMixin): other_std_dev = other_copy.get_reshaped_data(value='std_dev') if join_right: - merged_std_dev = \ - np.concatenate((self_std_dev, other_std_dev), axis=merge_axis) + merged_std_dev = np.concatenate((self_std_dev, other_std_dev), + axis=merge_axis) else: - merged_std_dev = \ - np.concatenate((other_std_dev, self_std_dev), axis=merge_axis) + merged_std_dev = np.concatenate((other_std_dev, self_std_dev), + axis=merge_axis) merged_tally._std_dev = np.reshape(merged_std_dev, merged_tally.shape) @@ -1003,35 +1001,6 @@ class Tally(IDManagerMixin): return filter_found - def get_filter_index(self, filter_type, filter_bin): - """Returns the index in the Tally's results array for a Filter bin - - Parameters - ---------- - filter_type : openmc.FilterMeta - Type of the filter, e.g. MeshFilter - filter_bin : int or tuple - The bin is an integer ID for 'material', 'surface', 'cell', - 'cellborn', and 'universe' Filters. The bin is an integer for the - cell instance ID for 'distribcell' Filters. The bin is a 2-tuple of - floats for 'energy' and 'energyout' filters corresponding to the - energy boundaries of the bin of interest. The bin is a (x,y,z) - 3-tuple for 'mesh' filters corresponding to the mesh cell of - interest. - - Returns - ------- - The index in the Tally data array for this filter bin - - """ - - # Find the equivalent Filter in this Tally's list of Filters - filter_found = self.find_filter(filter_type) - - # Get the index for the requested bin from the Filter and return it - filter_index = filter_found.get_bin_index(filter_bin) - return filter_index - def get_nuclide_index(self, nuclide): """Returns the index in the Tally's results array for a Nuclide bin @@ -1151,48 +1120,28 @@ class Tally(IDManagerMixin): # Loop over all of the Tally's Filters for i, self_filter in enumerate(self.filters): - user_filter = False - # If a user-requested Filter, get the user-requested bins for j, test_filter in enumerate(filters): if type(self_filter) is test_filter: bins = filter_bins[j] - user_filter = True break + else: + # If not a user-requested Filter, get all bins + if isinstance(self_filter, openmc.DistribcellFilter): + # Create list of cell instance IDs for distribcell Filters + bins = list(range(self_filter.num_bins)) - # If not a user-requested Filter, get all bins - if not user_filter: - # Create list of 2- or 3-tuples tuples for mesh cell bins - if isinstance(self_filter, openmc.MeshFilter): - bins = list(self_filter.mesh.indices) - - # Create list of 2-tuples for energy boundary bins - elif isinstance(self_filter, (openmc.EnergyFilter, - openmc.EnergyoutFilter, openmc.MuFilter, - openmc.PolarFilter, openmc.AzimuthalFilter)): - bins = [] - for k in range(self_filter.num_bins): - bins.append((self_filter.bins[k], self_filter.bins[k+1])) - - # Create list of cell instance IDs for distribcell Filters - elif isinstance(self_filter, openmc.DistribcellFilter): - bins = [b for b in range(self_filter.num_bins)] - - # EnergyFunctionFilters don't have bins so just add a None elif isinstance(self_filter, openmc.EnergyFunctionFilter): + # EnergyFunctionFilters don't have bins so just add a None bins = [None] - # Create list of IDs for bins for all other filter types else: + # Create list of IDs for bins for all other filter types bins = self_filter.bins - # Initialize a NumPy array for the Filter bin indices - filter_indices.append(np.zeros(len(bins), dtype=np.int)) - # Add indices for each bin in this Filter to the list - for j, bin in enumerate(bins): - filter_index = self.get_filter_index(type(self_filter), bin) - filter_indices[i][j] = filter_index + indices = np.array([self_filter.get_bin_index(b) for b in bins]) + filter_indices.append(indices) # Account for stride in each of the previous filters for indices in filter_indices[:i]: @@ -1956,14 +1905,14 @@ class Tally(IDManagerMixin): elif isinstance(filter1, openmc.EnergyFunctionFilter): filter1_bins = [None] else: - filter1_bins = [filter1.get_bin(i) for i in range(filter1.num_bins)] + filter1_bins = filter1.bins if isinstance(filter2, openmc.DistribcellFilter): filter2_bins = [b for b in range(filter2.num_bins)] elif isinstance(filter2, openmc.EnergyFunctionFilter): filter2_bins = [None] else: - filter2_bins = [filter2.get_bin(i) for i in range(filter2.num_bins)] + filter2_bins = filter2.bins # Create variables to store views of data in the misaligned structure mean = {} @@ -2604,7 +2553,8 @@ class Tally(IDManagerMixin): new_tally = self * -1 return new_tally - def get_slice(self, scores=[], filters=[], filter_bins=[], nuclides=[]): + def get_slice(self, scores=[], filters=[], filter_bins=[], nuclides=[], + squeeze=False): """Build a sliced tally for the specified filters, scores and nuclides. This method constructs a new tally to encapsulate a subset of the data @@ -2615,26 +2565,26 @@ class Tally(IDManagerMixin): Parameters ---------- scores : list of str - A list of one or more score strings - (e.g., ['absorption', 'nu-fission']; default is []) + A list of one or more score strings (e.g., ['absorption', + 'nu-fission'] filters : Iterable of openmc.FilterMeta - An iterable of filter types - (e.g., [MeshFilter, EnergyFilter]; default is []) + An iterable of filter types (e.g., [MeshFilter, EnergyFilter]) filter_bins : list of Iterables - A list of tuples of filter bins corresponding to the filter_types - parameter (e.g., [(1,), ((0., 0.625e-6),)]; default is []). Each - tuple contains bins to slice for the corresponding filter type in - the filters parameter. Each bins is the integer ID for 'material', + A list of iterables of filter bins corresponding to the specified + filter types (e.g., [(1,), ((0., 0.625e-6),)]). Each iterable + contains bins to slice for the corresponding filter type in the + filters parameter. Each bin is the integer ID for 'material', 'surface', 'cell', 'cellborn', and 'universe' Filters. Each bin is an integer for the cell instance ID for 'distribcell' Filters. Each bin is a 2-tuple of floats for 'energy' and 'energyout' filters corresponding to the energy boundaries of the bin of interest. The bin is an (x,y,z) 3-tuple for 'mesh' filters corresponding to the mesh cell of interest. The order of the bins in the list must - correspond to the filter_types parameter. + correspond to the `filters` argument. nuclides : list of str - A list of nuclide name strings - (e.g., ['U235', 'U238']; default is []) + A list of nuclide name strings (e.g., ['U235', 'U238']) + squeeze : bool + Whether to remove filters with only a single bin in the sliced tally Returns ------- @@ -2714,32 +2664,29 @@ class Tally(IDManagerMixin): # Determine the filter indices from any of the requested filters for i, filter_type in enumerate(filters): - find_filter = new_tally.find_filter(filter_type) + f = new_tally.find_filter(filter_type) + + # Remove filters with only a single bin if requested + if squeeze: + if len(filter_bins[i]) == 1: + new_tally.filters.remove(f) + continue + else: + raise RuntimeError('Cannot remove sliced filter with ' + 'more than one bin.') # Remove and/or reorder filter bins to user specifications - bin_indices = [] + bin_indices = [f.get_bin_index(b) + for b in filter_bins[i]] + bin_indices = np.unique(bin_indices) - for filter_bin in filter_bins[i]: - bin_index = find_filter.get_bin_index(filter_bin) - if issubclass(filter_type, openmc.RealFilter): - bin_indices.extend([bin_index, bin_index+1]) - else: - bin_indices.append(bin_index) - - # Set bins for mesh/distribcell filters apart from others - if filter_type is openmc.MeshFilter: - bins = find_filter.mesh - elif filter_type is openmc.DistribcellFilter: - bins = find_filter.bins - else: - bins = np.unique(find_filter.bins[bin_indices]) - - # Create new filter - new_filter = filter_type(bins) + # Set bins for sliced filter + new_filter = copy.copy(f) + new_filter.bins = [f.bins[i] for i in bin_indices] # Set number of bins manually for mesh/distribcell filters if filter_type is openmc.DistribcellFilter: - new_filter._num_bins = find_filter._num_bins + new_filter._num_bins = f._num_bins # Replace existing filter with new one for j, test_filter in enumerate(new_tally.filters): diff --git a/tests/regression_tests/tally_slice_merge/test.py b/tests/regression_tests/tally_slice_merge/test.py index e52d0fde49..7146c0d098 100644 --- a/tests/regression_tests/tally_slice_merge/test.py +++ b/tests/regression_tests/tally_slice_merge/test.py @@ -87,12 +87,14 @@ class TallySliceMergeTestHarness(PyAPITestHarness): # Slice the tallies by cell filter bins cell_filter_prod = itertools.product(tallies, self.cell_filters) tallies = map(lambda tf: tf[0].get_slice(filters=[type(tf[1])], - filter_bins=[tf[1].get_bin(0)]), cell_filter_prod) + filter_bins=[tf[1].get_bin(0)]), + cell_filter_prod) # Slice the tallies by energy filter bins energy_filter_prod = itertools.product(tallies, self.energy_filters) tallies = map(lambda tf: tf[0].get_slice(filters=[type(tf[1])], - filter_bins=[(tf[1].get_bin(0),)]), energy_filter_prod) + filter_bins=[tf[1].get_bin(0)]), + energy_filter_prod) # Slice the tallies by nuclide nuclide_prod = itertools.product(tallies, self.nuclides) From 772c27ecb1f126cbf62b7bcdb86b823a679da54a Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 29 Mar 2018 10:19:27 -0500 Subject: [PATCH 143/231] Combine expansion filters into single Python module --- docs/source/pythonapi/base.rst | 3 + openmc/__init__.py | 5 +- openmc/filter_expansion.py | 457 +++++++++++++++++++++++++++ openmc/filter_legendre.py | 90 ------ openmc/filter_spatial_legendre.py | 144 --------- openmc/filter_spherical_harmonics.py | 110 ------- openmc/filter_zernike.py | 144 --------- 7 files changed, 461 insertions(+), 492 deletions(-) create mode 100644 openmc/filter_expansion.py delete mode 100644 openmc/filter_legendre.py delete mode 100644 openmc/filter_spatial_legendre.py delete mode 100644 openmc/filter_spherical_harmonics.py delete mode 100644 openmc/filter_zernike.py diff --git a/docs/source/pythonapi/base.rst b/docs/source/pythonapi/base.rst index 84d2a39da3..ef692755d5 100644 --- a/docs/source/pythonapi/base.rst +++ b/docs/source/pythonapi/base.rst @@ -119,6 +119,9 @@ Constructing Tallies openmc.DelayedGroupFilter openmc.EnergyFunctionFilter openmc.LegendreFilter + openmc.SpatialLegendreFilter + openmc.SphericalHarmonicsFilter + openmc.ZernikeFilter openmc.Mesh openmc.Trigger openmc.TallyDerivative diff --git a/openmc/__init__.py b/openmc/__init__.py index 100aff8c8a..191528327c 100644 --- a/openmc/__init__.py +++ b/openmc/__init__.py @@ -15,10 +15,7 @@ from openmc.surface import * from openmc.universe import * from openmc.lattice import * from openmc.filter import * -from openmc.filter_legendre import * -from openmc.filter_spatial_legendre import * -from openmc.filter_spherical_harmonics import * -from openmc.filter_zernike import * +from openmc.filter_expansion import * from openmc.trigger import * from openmc.tally_derivative import * from openmc.tallies import * diff --git a/openmc/filter_expansion.py b/openmc/filter_expansion.py new file mode 100644 index 0000000000..5129f707c8 --- /dev/null +++ b/openmc/filter_expansion.py @@ -0,0 +1,457 @@ +from numbers import Integral, Real +from xml.etree import ElementTree as ET + +import numpy as np +import pandas as pd + +import openmc.checkvalue as cv +from . import Filter + + +class LegendreFilter(Filter): + r"""Score Legendre expansion moments up to specified order. + + This filter allows scores to be multiplied by Legendre polynomials of the + change in particle angle ($\mu$) up to a user-specified order. + + Parameters + ---------- + order : int + Maximum Legendre polynomial order + filter_id : int or None + Unique identifier for the filter + + Attributes + ---------- + order : int + Maximum Legendre polynomial order + id : int + Unique identifier for the filter + num_bins : int + The number of filter bins + + """ + + def __init__(self, order, filter_id=None): + self.order = order + self.bins = ['P{}'.format(i) for i in range(order + 1)] + self.id = filter_id + + def __hash__(self): + string = type(self).__name__ + '\n' + string += '{: <16}=\t{}\n'.format('\tOrder', self.order) + return hash(string) + + def __repr__(self): + string = type(self).__name__ + '\n' + string += '{: <16}=\t{}\n'.format('\tOrder', self.order) + string += '{: <16}=\t{}\n'.format('\tID', self.id) + return string + + @property + def order(self): + return self._order + + @order.setter + def order(self, order): + cv.check_type('Legendre order', order, Integral) + cv.check_greater_than('Legendre order', order, 0, equality=True) + self._order = order + + @classmethod + def from_hdf5(cls, group, **kwargs): + if group['type'].value.decode() != cls.short_name.lower(): + raise ValueError("Expected HDF5 data for filter type '" + + cls.short_name.lower() + "' but got '" + + group['type'].value.decode() + " instead") + + filter_id = int(group.name.split('/')[-1].lstrip('filter ')) + + out = cls(group['order'].value, filter_id) + + return out + + def to_xml_element(self): + """Return XML Element representing the filter. + + Returns + ------- + element : xml.etree.ElementTree.Element + XML element containing Legendre filter data + + """ + element = ET.Element('filter') + element.set('id', str(self.id)) + element.set('type', self.short_name.lower()) + + subelement = ET.SubElement(element, 'order') + subelement.text = str(self.order) + + return element + + +class SpatialLegendreFilter(Filter): + r"""Score Legendre expansion moments in space up to specified order. + + This filter allows scores to be multiplied by Legendre polynomials of the + the particle's position along a particular axis, normalized to a given + range, up to a user-specified order. + + Parameters + ---------- + order : int + Maximum Legendre polynomial order + axis : {'x', 'y', 'z'} + Axis along which to take the expansion + minimum : float + Minimum value along selected axis + maximum : float + Maximum value along selected axis + filter_id : int or None + Unique identifier for the filter + + Attributes + ---------- + order : int + Maximum Legendre polynomial order + axis : {'x', 'y', 'z'} + Axis along which to take the expansion + minimum : float + Minimum value along selected axis + maximum : float + Maximum value along selected axis + id : int + Unique identifier for the filter + num_bins : int + The number of filter bins + + """ + + def __init__(self, order, axis, minimum, maximum, filter_id=None): + self.order = order + self.axis = axis + self.minimum = minimum + self.maximum = maximum + self.bins = ['P{}'.format(i) for i in range(order + 1)] + self.id = filter_id + + def __hash__(self): + string = type(self).__name__ + '\n' + string += '{: <16}=\t{}\n'.format('\tOrder', self.order) + string += '{: <16}=\t{}\n'.format('\tAxis', self.axis) + string += '{: <16}=\t{}\n'.format('\tMin', self.minimum) + string += '{: <16}=\t{}\n'.format('\tMax', self.maximum) + return hash(string) + + def __repr__(self): + string = type(self).__name__ + '\n' + string += '{: <16}=\t{}\n'.format('\tOrder', self.order) + string += '{: <16}=\t{}\n'.format('\tAxis', self.axis) + string += '{: <16}=\t{}\n'.format('\tMin', self.minimum) + string += '{: <16}=\t{}\n'.format('\tMax', self.maximum) + string += '{: <16}=\t{}\n'.format('\tID', self.id) + return string + + @property + def order(self): + return self._order + + @order.setter + def order(self, order): + cv.check_type('Legendre order', order, Integral) + cv.check_greater_than('Legendre order', order, 0, equality=True) + self._order = order + + @property + def axis(self): + return self._axis + + @axis.setter + def axis(self, axis): + cv.check_value('axis', axis, ('x', 'y', 'z')) + self._axis = axis + + @property + def minimum(self): + return self._minimum + + @minimum.setter + def minimum(self, minimum): + cv.check_type('minimum', minimum, Real) + self._minimum = minimum + + @property + def maximum(self): + return self._maximum + + @maximum.setter + def maximum(self, maximum): + cv.check_type('maximum', maximum, Real) + self._maximum = maximum + + @classmethod + def from_hdf5(cls, group, **kwargs): + if group['type'].value.decode() != cls.short_name.lower(): + raise ValueError("Expected HDF5 data for filter type '" + + cls.short_name.lower() + "' but got '" + + group['type'].value.decode() + " instead") + + filter_id = int(group.name.split('/')[-1].lstrip('filter ')) + order = group['order'].value + axis = group['axis'].value.decode() + min_, max_ = group['min'].value, group['max'].value + + return cls(order, axis, min_, max_, filter_id) + + def to_xml_element(self): + """Return XML Element representing the filter. + + Returns + ------- + element : xml.etree.ElementTree.Element + XML element containing Legendre filter data + + """ + element = ET.Element('filter') + element.set('id', str(self.id)) + element.set('type', self.short_name.lower()) + + subelement = ET.SubElement(element, 'order') + subelement.text = str(self.order) + subelement = ET.SubElement(element, 'axis') + subelement.text = self.axis + subelement = ET.SubElement(element, 'min') + subelement.text = str(self.minimum) + subelement = ET.SubElement(element, 'max') + subelement.text = str(self.maximum) + + return element + + +class SphericalHarmonicsFilter(Filter): + r"""Score spherical harmonic expansion moments up to specified order. + + Parameters + ---------- + order : int + Maximum spherical harmonics order + filter_id : int or None + Unique identifier for the filter + + Attributes + ---------- + order : int + Maximum spherical harmonics order + id : int + Unique identifier for the filter + cosine : {'scatter', 'particle'} + How to handle the cosine term. + num_bins : int + The number of filter bins + + """ + + def __init__(self, order, filter_id=None): + self.order = order + self.id = filter_id + self.bins = ['Y{},{}'.format(n, m) + for n in range(order + 1) + for m in range(-n, n + 1)] + self._cosine = 'particle' + + def __hash__(self): + string = type(self).__name__ + '\n' + string += '{: <16}=\t{}\n'.format('\tOrder', self.order) + string += '{: <16}=\t{}\n'.format('\tCosine', self.cosine) + return hash(string) + + def __repr__(self): + string = type(self).__name__ + '\n' + string += '{: <16}=\t{}\n'.format('\tOrder', self.order) + string += '{: <16}=\t{}\n'.format('\tCosine', self.cosine) + string += '{: <16}=\t{}\n'.format('\tID', self.id) + return string + + @property + def order(self): + return self._order + + @order.setter + def order(self, order): + cv.check_type('spherical harmonics order', order, Integral) + cv.check_greater_than('spherical harmonics order', order, 0, equality=True) + self._order = order + + @property + def cosine(self): + return self._cosine + + @cosine.setter + def cosine(self, cosine): + cv.check_value('Spherical harmonics cosine treatment', cosine, + ('scatter', 'particle')) + self._cosine = cosine + + @classmethod + def from_hdf5(cls, group, **kwargs): + if group['type'].value.decode() != cls.short_name.lower(): + raise ValueError("Expected HDF5 data for filter type '" + + cls.short_name.lower() + "' but got '" + + group['type'].value.decode() + " instead") + + filter_id = int(group.name.split('/')[-1].lstrip('filter ')) + + out = cls(group['order'].value, filter_id) + out.cosine = group['cosine'].value.decode() + + return out + + def to_xml_element(self): + """Return XML Element representing the filter. + + Returns + ------- + element : xml.etree.ElementTree.Element + XML element containing spherical harmonics filter data + + """ + element = ET.Element('filter') + element.set('id', str(self.id)) + element.set('type', self.short_name.lower()) + element.set('cosine', self.cosine) + + subelement = ET.SubElement(element, 'order') + subelement.text = str(self.order) + + return element + + +class ZernikeFilter(Filter): + r"""Score Zernike expansion moments in space up to specified order. + + This filter allows scores to be multiplied by Zernike polynomials of the the + particle's position along a particular axis, normalized to a given unit + circle, up to a user-specified order. + + Parameters + ---------- + order : int + Maximum Zernike polynomial order + x : float + x-coordinate of center of circle for normalization + y : float + y-coordinate of center of circle for normalization + r : int or None + Radius of circle for normalization + + Attributes + ---------- + order : int + Maximum Zernike polynomial order + x : float + x-coordinate of center of circle for normalization + y : float + y-coordinate of center of circle for normalization + r : int or None + Radius of circle for normalization + id : int + Unique identifier for the filter + num_bins : int + The number of filter bins + + """ + + def __init__(self, order, x, y, r, filter_id=None): + self.order = order + self.x = x + self.y = y + self.r = r + self.bins = ['Z{},{}'.format(n, m) + for n in range(order + 1) + for m in range(-n, n + 1, 2)] + self.id = filter_id + + def __hash__(self): + string = type(self).__name__ + '\n' + string += '{: <16}=\t{}\n'.format('\tOrder', self.order) + return hash(string) + + def __repr__(self): + string = type(self).__name__ + '\n' + string += '{: <16}=\t{}\n'.format('\tOrder', self.order) + string += '{: <16}=\t{}\n'.format('\tID', self.id) + return string + + @property + def order(self): + return self._order + + @order.setter + def order(self, order): + cv.check_type('Zernike order', order, Integral) + cv.check_greater_than('Zernike order', order, 0, equality=True) + self._order = order + + @property + def x(self): + return self._x + + @x.setter + def x(self, x): + cv.check_type('x', x, Real) + self._x = x + + @property + def y(self): + return self._y + + @y.setter + def y(self, y): + cv.check_type('y', y, Real) + self._y = y + + @property + def r(self): + return self._r + + @r.setter + def r(self, r): + cv.check_type('r', r, Real) + self._r = r + + @classmethod + def from_hdf5(cls, group, **kwargs): + if group['type'].value.decode() != cls.short_name.lower(): + raise ValueError("Expected HDF5 data for filter type '" + + cls.short_name.lower() + "' but got '" + + group['type'].value.decode() + " instead") + + filter_id = int(group.name.split('/')[-1].lstrip('filter ')) + order = group['order'].value + x, y, r = group['x'].value, group['y'].value, group['r'].value + + return cls(order, x, y, r, filter_id) + + def to_xml_element(self): + """Return XML Element representing the filter. + + Returns + ------- + element : xml.etree.ElementTree.Element + XML element containing Zernike filter data + + """ + element = ET.Element('filter') + element.set('id', str(self.id)) + element.set('type', self.short_name.lower()) + + subelement = ET.SubElement(element, 'order') + subelement.text = str(self.order) + subelement = ET.SubElement(element, 'x') + subelement.text = str(self.x) + subelement = ET.SubElement(element, 'y') + subelement.text = str(self.y) + subelement = ET.SubElement(element, 'r') + subelement.text = str(self.r) + + return element diff --git a/openmc/filter_legendre.py b/openmc/filter_legendre.py deleted file mode 100644 index 18998d5cc8..0000000000 --- a/openmc/filter_legendre.py +++ /dev/null @@ -1,90 +0,0 @@ -from numbers import Integral -from xml.etree import ElementTree as ET - -import numpy as np -import pandas as pd - -import openmc.checkvalue as cv -from . import Filter - - -class LegendreFilter(Filter): - r"""Score Legendre expansion moments up to specified order. - - This filter allows scores to be multiplied by Legendre polynomials of the - change in particle angle ($\mu$) up to a user-specified order. - - Parameters - ---------- - order : int - Maximum Legendre polynomial order - filter_id : int or None - Unique identifier for the filter - - Attributes - ---------- - order : int - Maximum Legendre polynomial order - id : int - Unique identifier for the filter - num_bins : int - The number of filter bins - - """ - - def __init__(self, order, filter_id=None): - self.order = order - self.bins = ['P{}'.format(i) for i in range(order + 1)] - self.id = filter_id - - def __hash__(self): - string = type(self).__name__ + '\n' - string += '{: <16}=\t{}\n'.format('\tOrder', self.order) - return hash(string) - - def __repr__(self): - string = type(self).__name__ + '\n' - string += '{: <16}=\t{}\n'.format('\tOrder', self.order) - string += '{: <16}=\t{}\n'.format('\tID', self.id) - return string - - @property - def order(self): - return self._order - - @order.setter - def order(self, order): - cv.check_type('Legendre order', order, Integral) - cv.check_greater_than('Legendre order', order, 0, equality=True) - self._order = order - - @classmethod - def from_hdf5(cls, group, **kwargs): - if group['type'].value.decode() != cls.short_name.lower(): - raise ValueError("Expected HDF5 data for filter type '" - + cls.short_name.lower() + "' but got '" - + group['type'].value.decode() + " instead") - - filter_id = int(group.name.split('/')[-1].lstrip('filter ')) - - out = cls(group['order'].value, filter_id) - - return out - - def to_xml_element(self): - """Return XML Element representing the filter. - - Returns - ------- - element : xml.etree.ElementTree.Element - XML element containing Legendre filter data - - """ - element = ET.Element('filter') - element.set('id', str(self.id)) - element.set('type', self.short_name.lower()) - - subelement = ET.SubElement(element, 'order') - subelement.text = str(self.order) - - return element diff --git a/openmc/filter_spatial_legendre.py b/openmc/filter_spatial_legendre.py deleted file mode 100644 index 726a3bfdfe..0000000000 --- a/openmc/filter_spatial_legendre.py +++ /dev/null @@ -1,144 +0,0 @@ -from numbers import Integral, Real -from xml.etree import ElementTree as ET - -import numpy as np -import pandas as pd - -import openmc.checkvalue as cv -from . import Filter - - -class SpatialLegendreFilter(Filter): - r"""Score Legendre expansion moments in space up to specified order. - - This filter allows scores to be multiplied by Legendre polynomials of the - the particle's position along a particular axis, normalized to a given - range, up to a user-specified order. - - Parameters - ---------- - order : int - Maximum Legendre polynomial order - axis : {'x', 'y', 'z'} - Axis along which to take the expansion - minimum : float - Minimum value along selected axis - maximum : float - Maximum value along selected axis - filter_id : int or None - Unique identifier for the filter - - Attributes - ---------- - order : int - Maximum Legendre polynomial order - id : int - Unique identifier for the filter - num_bins : int - The number of filter bins - - """ - - def __init__(self, order, axis, minimum, maximum, filter_id=None): - self.order = order - self.axis = axis - self.minimum = minimum - self.maximum = maximum - self.bins = ['P{}'.format(i) for i in range(order + 1)] - self.id = filter_id - - def __hash__(self): - string = type(self).__name__ + '\n' - string += '{: <16}=\t{}\n'.format('\tOrder', self.order) - string += '{: <16}=\t{}\n'.format('\tAxis', self.axis) - string += '{: <16}=\t{}\n'.format('\tMin', self.minimum) - string += '{: <16}=\t{}\n'.format('\tMax', self.maximum) - return hash(string) - - def __repr__(self): - string = type(self).__name__ + '\n' - string += '{: <16}=\t{}\n'.format('\tOrder', self.order) - string += '{: <16}=\t{}\n'.format('\tAxis', self.axis) - string += '{: <16}=\t{}\n'.format('\tMin', self.minimum) - string += '{: <16}=\t{}\n'.format('\tMax', self.maximum) - string += '{: <16}=\t{}\n'.format('\tID', self.id) - return string - - @property - def order(self): - return self._order - - @order.setter - def order(self, order): - cv.check_type('Legendre order', order, Integral) - cv.check_greater_than('Legendre order', order, 0, equality=True) - self._order = order - - @property - def axis(self): - return self._axis - - @axis.setter - def axis(self, axis): - cv.check_value('axis', axis, ('x', 'y', 'z')) - self._axis = axis - - @property - def minimum(self): - return self._minimum - - @minimum.setter - def minimum(self, minimum): - cv.check_type('minimum', minimum, Real) - self._minimum = minimum - - @property - def maximum(self): - return self._maximum - - @maximum.setter - def maximum(self, maximum): - cv.check_type('maximum', maximum, Real) - self._maximum = maximum - - @property - def num_bins(self): - return self._order + 1 - - @classmethod - def from_hdf5(cls, group, **kwargs): - if group['type'].value.decode() != cls.short_name.lower(): - raise ValueError("Expected HDF5 data for filter type '" - + cls.short_name.lower() + "' but got '" - + group['type'].value.decode() + " instead") - - filter_id = int(group.name.split('/')[-1].lstrip('filter ')) - order = group['order'].value - axis = group['axis'].value.decode() - min_, max_ = group['min'].value, group['max'].value - - return cls(order, axis, min_, max_, filter_id) - - def to_xml_element(self): - """Return XML Element representing the filter. - - Returns - ------- - element : xml.etree.ElementTree.Element - XML element containing Legendre filter data - - """ - element = ET.Element('filter') - element.set('id', str(self.id)) - element.set('type', self.short_name.lower()) - - subelement = ET.SubElement(element, 'order') - subelement.text = str(self.order) - subelement = ET.SubElement(element, 'axis') - subelement.text = self.axis - subelement = ET.SubElement(element, 'min') - subelement.text = str(self.minimum) - subelement = ET.SubElement(element, 'max') - subelement.text = str(self.maximum) - - return element diff --git a/openmc/filter_spherical_harmonics.py b/openmc/filter_spherical_harmonics.py deleted file mode 100644 index f95c09c303..0000000000 --- a/openmc/filter_spherical_harmonics.py +++ /dev/null @@ -1,110 +0,0 @@ -from numbers import Integral -from xml.etree import ElementTree as ET - -import numpy as np -import pandas as pd - -import openmc.checkvalue as cv -from . import Filter - - -class SphericalHarmonicsFilter(Filter): - r"""Score spherical harmonic expansion moments up to specified order. - - Parameters - ---------- - order : int - Maximum spherical harmonics order - filter_id : int or None - Unique identifier for the filter - - Attributes - ---------- - order : int - Maximum spherical harmonics order - id : int - Unique identifier for the filter - cosine : {'scatter', 'particle'} - How to handle the cosine term. - num_bins : int - The number of filter bins - - """ - - def __init__(self, order, filter_id=None): - self.order = order - self.id = filter_id - self.bins = ['Y{},{}'.format(n, m) - for n in range(order + 1) - for m in range(-n, n + 1)] - self._cosine = 'particle' - - def __hash__(self): - string = type(self).__name__ + '\n' - string += '{: <16}=\t{}\n'.format('\tOrder', self.order) - string += '{: <16}=\t{}\n'.format('\tCosine', self.cosine) - return hash(string) - - def __repr__(self): - string = type(self).__name__ + '\n' - string += '{: <16}=\t{}\n'.format('\tOrder', self.order) - string += '{: <16}=\t{}\n'.format('\tCosine', self.cosine) - string += '{: <16}=\t{}\n'.format('\tID', self.id) - return string - - @property - def order(self): - return self._order - - @order.setter - def order(self, order): - cv.check_type('spherical harmonics order', order, Integral) - cv.check_greater_than('spherical harmonics order', order, 0, equality=True) - self._order = order - - @property - def cosine(self): - return self._cosine - - @cosine.setter - def cosine(self, cosine): - cv.check_value('Spherical harmonics cosine treatment', cosine, - ('scatter', 'particle')) - self._cosine = cosine - - @property - def num_bins(self): - return (self._order + 1)**2 - - @classmethod - def from_hdf5(cls, group, **kwargs): - if group['type'].value.decode() != cls.short_name.lower(): - raise ValueError("Expected HDF5 data for filter type '" - + cls.short_name.lower() + "' but got '" - + group['type'].value.decode() + " instead") - - filter_id = int(group.name.split('/')[-1].lstrip('filter ')) - - out = cls(group['order'].value, filter_id) - out.cosine = group['cosine'].value.decode() - - return out - - def to_xml_element(self): - """Return XML Element representing the filter. - - Returns - ------- - element : xml.etree.ElementTree.Element - XML element containing spherical harmonics filter data - - """ - element = ET.Element('filter') - element.set('id', str(self.id)) - element.set('type', self.short_name.lower()) - element.set('cosine', self.cosine) - - subelement = ET.SubElement(element, 'order') - subelement.text = str(self.order) - - return element diff --git a/openmc/filter_zernike.py b/openmc/filter_zernike.py deleted file mode 100644 index a7697f5d0e..0000000000 --- a/openmc/filter_zernike.py +++ /dev/null @@ -1,144 +0,0 @@ -from numbers import Integral, Real -from xml.etree import ElementTree as ET - -import numpy as np -import pandas as pd - -import openmc.checkvalue as cv -from . import Filter - - -class ZernikeFilter(Filter): - r"""Score Zernike expansion moments in space up to specified order. - - This filter allows scores to be multiplied by Zernike polynomials of the the - particle's position along a particular axis, normalized to a given unit - circle, up to a user-specified order. - - Parameters - ---------- - order : int - Maximum Zernike polynomial order - x : float - x-coordinate of center of circle for normalization - y : float - y-coordinate of center of circle for normalization - r : int or None - Radius of circle for normalization - - Attributes - ---------- - order : int - Maximum Zernike polynomial order - x : float - x-coordinate of center of circle for normalization - y : float - y-coordinate of center of circle for normalization - r : int or None - Radius of circle for normalization - id : int - Unique identifier for the filter - num_bins : int - The number of filter bins - - """ - - def __init__(self, order, x, y, r, filter_id=None): - self.order = order - self.x = x - self.y = y - self.r = r - self.bins = ['Z{},{}'.format(n, m) - for n in range(order + 1) - for m in range(-n, n + 1, 2)] - self.id = filter_id - - def __hash__(self): - string = type(self).__name__ + '\n' - string += '{: <16}=\t{}\n'.format('\tOrder', self.order) - return hash(string) - - def __repr__(self): - string = type(self).__name__ + '\n' - string += '{: <16}=\t{}\n'.format('\tOrder', self.order) - string += '{: <16}=\t{}\n'.format('\tID', self.id) - return string - - @property - def order(self): - return self._order - - @order.setter - def order(self, order): - cv.check_type('Zernike order', order, Integral) - cv.check_greater_than('Zernike order', order, 0, equality=True) - self._order = order - - @property - def x(self): - return self._x - - @x.setter - def x(self, x): - cv.check_type('x', x, Real) - self._x = x - - @property - def y(self): - return self._y - - @y.setter - def y(self, y): - cv.check_type('y', y, Real) - self._y = y - - @property - def r(self): - return self._r - - @r.setter - def r(self, r): - cv.check_type('r', r, Real) - self._r = r - - @property - def num_bins(self): - n = self._order - return ((n + 1)*(n + 2))//2 - - @classmethod - def from_hdf5(cls, group, **kwargs): - if group['type'].value.decode() != cls.short_name.lower(): - raise ValueError("Expected HDF5 data for filter type '" - + cls.short_name.lower() + "' but got '" - + group['type'].value.decode() + " instead") - - filter_id = int(group.name.split('/')[-1].lstrip('filter ')) - order = group['order'].value - x, y, r = group['x'].value, group['y'].value, group['r'].value - - return cls(order, x, y, r, filter_id) - - def to_xml_element(self): - """Return XML Element representing the filter. - - Returns - ------- - element : xml.etree.ElementTree.Element - XML element containing Zernike filter data - - """ - element = ET.Element('filter') - element.set('id', str(self.id)) - element.set('type', self.short_name.lower()) - - subelement = ET.SubElement(element, 'order') - subelement.text = str(self.order) - subelement = ET.SubElement(element, 'x') - subelement.text = str(self.x) - subelement = ET.SubElement(element, 'y') - subelement.text = str(self.y) - subelement = ET.SubElement(element, 'r') - subelement.text = str(self.r) - - return element From f5270f183aa698227feb5d9275793425d35f7012 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 29 Mar 2018 13:35:58 -0500 Subject: [PATCH 144/231] Remove get_bin() method. Fix __repr__ for some filters --- openmc/filter.py | 92 ++++++------------- openmc/tallies.py | 8 +- .../tally_slice_merge/test.py | 4 +- 3 files changed, 30 insertions(+), 74 deletions(-) diff --git a/openmc/filter.py b/openmc/filter.py index d59d739a39..2bab17dbb6 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -1,11 +1,9 @@ from abc import ABCMeta from collections import Iterable, OrderedDict import copy -from functools import reduce import hashlib from itertools import product from numbers import Real, Integral -import operator from xml.etree import ElementTree as ET import numpy as np @@ -20,9 +18,12 @@ from .surface import Surface from .universe import Universe -_FILTER_TYPES = ['universe', 'material', 'cell', 'cellborn', 'surface', - 'mesh', 'energy', 'energyout', 'mu', 'polar', 'azimuthal', - 'distribcell', 'delayedgroup', 'energyfunction', 'cellfrom'] +_FILTER_TYPES = ( + 'universe', 'material', 'cell', 'cellborn', 'surface', 'mesh', 'energy', + 'energyout', 'mu', 'polar', 'azimuthal', 'distribcell', 'delayedgroup', + 'energyfunction', 'cellfrom', 'legendre', 'spatiallegendre', + 'sphericalharmonics', 'zernike' +) _CURRENT_NAMES = ( 'x-min out', 'x-min in', 'x-max out', 'x-max in', @@ -187,17 +188,15 @@ class Filter(IDManagerMixin, metaclass=FilterMeta): def bins(self): return self._bins + @bins.setter + def bins(self, bins): + self.check_bins(bins) + self._bins = bins + @property def num_bins(self): return len(self.bins) - @bins.setter - def bins(self, bins): - # Check the bin values. - self.check_bins(bins) - - self._bins = bins - def check_bins(self, bins): """Make sure given bins are valid for this filter. @@ -303,7 +302,7 @@ class Filter(IDManagerMixin, metaclass=FilterMeta): Parameters ---------- - filter_bin : Integral or tuple + filter_bin : int or tuple The bin is the integer ID for 'material', 'surface', 'cell', 'cellborn', and 'universe' Filters. The bin is an integer for the cell instance ID for 'distribcell' Filters. The bin is a 2-tuple of @@ -314,13 +313,9 @@ class Filter(IDManagerMixin, metaclass=FilterMeta): Returns ------- - filter_index : Integral + filter_index : int The index in the Tally data array for this filter bin. - See also - -------- - Filter.get_bin() - """ if filter_bin not in self.bins: @@ -333,46 +328,6 @@ class Filter(IDManagerMixin, metaclass=FilterMeta): else: return self.bins.index(filter_bin) - def get_bin(self, bin_index): - """Returns the filter bin for some filter bin index. - - Parameters - ---------- - bin_index : Integral - The zero-based index into the filter's array of bins. The bin - index for 'material', 'surface', 'cell', 'cellborn', and 'universe' - filters corresponds to the ID in the filter's list of bins. For - 'distribcell' tallies the bin index necessarily can only be zero - since only one cell can be tracked per tally. The bin index for - 'energy' and 'energyout' filters corresponds to the energy range of - interest in the filter bins of energies. The bin index for 'mesh' - filters is the index into the flattened array of (x,y) or (x,y,z) - mesh cell bins. - - Returns - ------- - bin : 1-, 2-, or 3-tuple of Real - The bin in the Tally data array. The bin for 'material', surface', - 'cell', 'cellborn', 'universe' and 'distribcell' filters is a - 1-tuple of the ID corresponding to the appropriate filter bin. - The bin for 'energy' and 'energyout' filters is a 2-tuple of the - lower and upper energies bounding the energy interval for the filter - bin. The bin for 'mesh' tallies is a 2-tuple or 3-tuple of the x,y - or x,y,z mesh cell indices corresponding to the bin in a 2D/3D mesh. - - See also - -------- - Filter.get_bin_index() - - """ - - cv.check_type('bin_index', bin_index, Integral) - cv.check_greater_than('bin_index', bin_index, 0, equality=True) - cv.check_less_than('bin_index', bin_index, self.num_bins) - - # Return a 1-tuple of the bin. - return (self.bins[bin_index],) - def get_pandas_dataframe(self, data_size, stride, **kwargs): """Builds a Pandas DataFrame for the Filter's bins. @@ -447,7 +402,7 @@ class UniverseFilter(WithIDFilter): Parameters ---------- - bins : openmc.Universe, Integral, or iterable thereof + bins : openmc.Universe, int, or iterable thereof The Universes to tally. Either openmc.Universe objects or their Integral ID numbers can be used. filter_id : int @@ -615,6 +570,12 @@ class MeshFilter(Filter): self.mesh = mesh self.id = filter_id + def __repr__(self): + string = type(self).__name__ + '\n' + string += '{: <16}=\t{}\n'.format('\tMesh ID', self.mesh.id) + string += '{: <16}=\t{}\n'.format('\tID', self.id) + return string + @classmethod def from_hdf5(cls, group, **kwargs): if group['type'].value.decode() != cls.short_name.lower(): @@ -648,9 +609,6 @@ class MeshFilter(Filter): # Mesh filters cannot have more than one bin return False - def get_bin(self, bin_index): - return self.bins[bin_index] - def get_pandas_dataframe(self, data_size, stride, **kwargs): """Builds a Pandas DataFrame for the Filter's bins. @@ -900,6 +858,12 @@ class RealFilter(Filter): else: return super().__gt__(other) + def __repr__(self): + string = type(self).__name__ + '\n' + string += '{: <16}=\t{}\n'.format('\tValues', self.values) + string += '{: <16}=\t{}\n'.format('\tID', self.id) + return string + @Filter.bins.setter def bins(self, bins): Filter.bins.__set__(self, np.asarray(bins)) @@ -1740,10 +1704,6 @@ class EnergyFunctionFilter(Filter): # This filter only has one bin. Always return 0. return 0 - def get_bin(self, bin_index): - """This function is invalid for EnergyFunctionFilters.""" - raise RuntimeError('EnergyFunctionFilters have no get_bin() method') - def get_pandas_dataframe(self, data_size, stride, **kwargs): """Builds a Pandas DataFrame for the Filter's bins. diff --git a/openmc/tallies.py b/openmc/tallies.py index 08db20e399..50398b786e 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -2763,9 +2763,7 @@ class Tally(IDManagerMixin): elif isinstance(find_filter, openmc.EnergyFunctionFilter): filter_bins = [None] else: - num_bins = find_filter.num_bins - filter_bins = \ - [(find_filter.get_bin(i)) for i in range(num_bins)] + filter_bins = find_filter.bins # Only sum across bins specified by the user else: @@ -2917,9 +2915,7 @@ class Tally(IDManagerMixin): elif isinstance(find_filter, openmc.EnergyFunctionFilter): filter_bins = [None] else: - num_bins = find_filter.num_bins - filter_bins = \ - [(find_filter.get_bin(i)) for i in range(num_bins)] + filter_bins = find_filter.bins # Only average across bins specified by the user else: diff --git a/tests/regression_tests/tally_slice_merge/test.py b/tests/regression_tests/tally_slice_merge/test.py index 7146c0d098..20ab57a077 100644 --- a/tests/regression_tests/tally_slice_merge/test.py +++ b/tests/regression_tests/tally_slice_merge/test.py @@ -87,13 +87,13 @@ class TallySliceMergeTestHarness(PyAPITestHarness): # Slice the tallies by cell filter bins cell_filter_prod = itertools.product(tallies, self.cell_filters) tallies = map(lambda tf: tf[0].get_slice(filters=[type(tf[1])], - filter_bins=[tf[1].get_bin(0)]), + filter_bins=[(tf[1].bins[0],)]), cell_filter_prod) # Slice the tallies by energy filter bins energy_filter_prod = itertools.product(tallies, self.energy_filters) tallies = map(lambda tf: tf[0].get_slice(filters=[type(tf[1])], - filter_bins=[tf[1].get_bin(0)]), + filter_bins=[(tf[1].bins[0],)]), energy_filter_prod) # Slice the tallies by nuclide From 31ef72f2cd9029194a662019f0e6a157e29d893d Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 29 Mar 2018 14:08:06 -0500 Subject: [PATCH 145/231] Introduce ExpansionFilter class and start adding filter tests --- openmc/filter_expansion.py | 154 +++++++++++++------------------ tests/unit_tests/test_filters.py | 80 ++++++++++++++++ 2 files changed, 142 insertions(+), 92 deletions(-) create mode 100644 tests/unit_tests/test_filters.py diff --git a/openmc/filter_expansion.py b/openmc/filter_expansion.py index 5129f707c8..f51e2f58dc 100644 --- a/openmc/filter_expansion.py +++ b/openmc/filter_expansion.py @@ -8,7 +8,42 @@ import openmc.checkvalue as cv from . import Filter -class LegendreFilter(Filter): +class ExpansionFilter(Filter): + """Abstract filter class for functional expansions.""" + def __init__(self, order, filter_id=None): + self.order = order + self.id = filter_id + + @property + def order(self): + return self._order + + @order.setter + def order(self, order): + cv.check_type('expansion order', order, Integral) + cv.check_greater_than('expansion order', order, 0, equality=True) + self._order = order + + def to_xml_element(self): + """Return XML Element representing the filter. + + Returns + ------- + element : xml.etree.ElementTree.Element + XML element containing Legendre filter data + + """ + element = ET.Element('filter') + element.set('id', str(self.id)) + element.set('type', self.short_name.lower()) + + subelement = ET.SubElement(element, 'order') + subelement.text = str(self.order) + + return element + + +class LegendreFilter(ExpansionFilter): r"""Score Legendre expansion moments up to specified order. This filter allows scores to be multiplied by Legendre polynomials of the @@ -32,11 +67,6 @@ class LegendreFilter(Filter): """ - def __init__(self, order, filter_id=None): - self.order = order - self.bins = ['P{}'.format(i) for i in range(order + 1)] - self.id = filter_id - def __hash__(self): string = type(self).__name__ + '\n' string += '{: <16}=\t{}\n'.format('\tOrder', self.order) @@ -48,15 +78,10 @@ class LegendreFilter(Filter): string += '{: <16}=\t{}\n'.format('\tID', self.id) return string - @property - def order(self): - return self._order - - @order.setter + @ExpansionFilter.order.setter def order(self, order): - cv.check_type('Legendre order', order, Integral) - cv.check_greater_than('Legendre order', order, 0, equality=True) - self._order = order + ExpansionFilter.order.__set__(self, order) + self.bins = ['P{}'.format(i) for i in range(order + 1)] @classmethod def from_hdf5(cls, group, **kwargs): @@ -71,26 +96,8 @@ class LegendreFilter(Filter): return out - def to_xml_element(self): - """Return XML Element representing the filter. - Returns - ------- - element : xml.etree.ElementTree.Element - XML element containing Legendre filter data - - """ - element = ET.Element('filter') - element.set('id', str(self.id)) - element.set('type', self.short_name.lower()) - - subelement = ET.SubElement(element, 'order') - subelement.text = str(self.order) - - return element - - -class SpatialLegendreFilter(Filter): +class SpatialLegendreFilter(ExpansionFilter): r"""Score Legendre expansion moments in space up to specified order. This filter allows scores to be multiplied by Legendre polynomials of the @@ -128,12 +135,10 @@ class SpatialLegendreFilter(Filter): """ def __init__(self, order, axis, minimum, maximum, filter_id=None): - self.order = order + super().__init__(order, filter_id) self.axis = axis self.minimum = minimum self.maximum = maximum - self.bins = ['P{}'.format(i) for i in range(order + 1)] - self.id = filter_id def __hash__(self): string = type(self).__name__ + '\n' @@ -152,15 +157,10 @@ class SpatialLegendreFilter(Filter): string += '{: <16}=\t{}\n'.format('\tID', self.id) return string - @property - def order(self): - return self._order - - @order.setter + @ExpansionFilter.order.setter def order(self, order): - cv.check_type('Legendre order', order, Integral) - cv.check_greater_than('Legendre order', order, 0, equality=True) - self._order = order + ExpansionFilter.order.__set__(self, order) + self.bins = ['P{}'.format(i) for i in range(order + 1)] @property def axis(self): @@ -212,12 +212,7 @@ class SpatialLegendreFilter(Filter): XML element containing Legendre filter data """ - element = ET.Element('filter') - element.set('id', str(self.id)) - element.set('type', self.short_name.lower()) - - subelement = ET.SubElement(element, 'order') - subelement.text = str(self.order) + element = super().to_xml_element() subelement = ET.SubElement(element, 'axis') subelement.text = self.axis subelement = ET.SubElement(element, 'min') @@ -228,7 +223,7 @@ class SpatialLegendreFilter(Filter): return element -class SphericalHarmonicsFilter(Filter): +class SphericalHarmonicsFilter(ExpansionFilter): r"""Score spherical harmonic expansion moments up to specified order. Parameters @@ -252,11 +247,7 @@ class SphericalHarmonicsFilter(Filter): """ def __init__(self, order, filter_id=None): - self.order = order - self.id = filter_id - self.bins = ['Y{},{}'.format(n, m) - for n in range(order + 1) - for m in range(-n, n + 1)] + super().__init__(order, filter_id) self._cosine = 'particle' def __hash__(self): @@ -272,15 +263,12 @@ class SphericalHarmonicsFilter(Filter): string += '{: <16}=\t{}\n'.format('\tID', self.id) return string - @property - def order(self): - return self._order - - @order.setter + @ExpansionFilter.order.setter def order(self, order): - cv.check_type('spherical harmonics order', order, Integral) - cv.check_greater_than('spherical harmonics order', order, 0, equality=True) - self._order = order + ExpansionFilter.order.__set__(self, order) + self.bins = ['Y{},{}'.format(n, m) + for n in range(order + 1) + for m in range(-n, n + 1)] @property def cosine(self): @@ -315,18 +303,12 @@ class SphericalHarmonicsFilter(Filter): XML element containing spherical harmonics filter data """ - element = ET.Element('filter') - element.set('id', str(self.id)) - element.set('type', self.short_name.lower()) + element = super().to_xml_element() element.set('cosine', self.cosine) - - subelement = ET.SubElement(element, 'order') - subelement.text = str(self.order) - return element -class ZernikeFilter(Filter): +class ZernikeFilter(ExpansionFilter): r"""Score Zernike expansion moments in space up to specified order. This filter allows scores to be multiplied by Zernike polynomials of the the @@ -361,15 +343,11 @@ class ZernikeFilter(Filter): """ - def __init__(self, order, x, y, r, filter_id=None): - self.order = order + def __init__(self, order, x=0.0, y=0.0, r=1.0, filter_id=None): + super().__init__(order, filter_id) self.x = x self.y = y self.r = r - self.bins = ['Z{},{}'.format(n, m) - for n in range(order + 1) - for m in range(-n, n + 1, 2)] - self.id = filter_id def __hash__(self): string = type(self).__name__ + '\n' @@ -382,15 +360,12 @@ class ZernikeFilter(Filter): string += '{: <16}=\t{}\n'.format('\tID', self.id) return string - @property - def order(self): - return self._order - - @order.setter + @ExpansionFilter.order.setter def order(self, order): - cv.check_type('Zernike order', order, Integral) - cv.check_greater_than('Zernike order', order, 0, equality=True) - self._order = order + ExpansionFilter.order.__set__(self, order) + self.bins = ['Z{},{}'.format(n, m) + for n in range(order + 1) + for m in range(-n, n + 1, 2)] @property def x(self): @@ -441,12 +416,7 @@ class ZernikeFilter(Filter): XML element containing Zernike filter data """ - element = ET.Element('filter') - element.set('id', str(self.id)) - element.set('type', self.short_name.lower()) - - subelement = ET.SubElement(element, 'order') - subelement.text = str(self.order) + element = super().to_xml_element() subelement = ET.SubElement(element, 'x') subelement.text = str(self.x) subelement = ET.SubElement(element, 'y') diff --git a/tests/unit_tests/test_filters.py b/tests/unit_tests/test_filters.py new file mode 100644 index 0000000000..53f8f74b56 --- /dev/null +++ b/tests/unit_tests/test_filters.py @@ -0,0 +1,80 @@ +import openmc + + +def test_legendre(): + n = 5 + f = openmc.LegendreFilter(n) + assert f.order == n + assert f.bins[0] == 'P0' + assert f.bins[-1] == 'P5' + assert len(f.bins) == n + 1 + + # Make sure __repr__ works + repr(f) + + # to_xml_element() + elem = f.to_xml_element() + assert elem.tag == 'filter' + assert elem.attrib['type'] == 'legendre' + assert elem.find('order').text == str(n) + + +def test_spatial_legendre(): + n = 5 + axis = 'x' + f = openmc.SpatialLegendreFilter(n, axis, -10., 10.) + assert f.order == n + assert f.axis == axis + assert f.minimum == -10. + assert f.maximum == 10. + assert f.bins[0] == 'P0' + assert f.bins[-1] == 'P5' + assert len(f.bins) == n + 1 + + # Make sure __repr__ works + repr(f) + + # to_xml_element() + elem = f.to_xml_element() + assert elem.tag == 'filter' + assert elem.attrib['type'] == 'spatiallegendre' + assert elem.find('order').text == str(n) + assert elem.find('axis').text == str(axis) + + +def test_spherical_harmonics(): + n = 3 + f = openmc.SphericalHarmonicsFilter(n) + f.cosine = 'particle' + assert f.order == n + assert f.bins[0] == 'Y0,0' + assert f.bins[-1] == 'Y{0},{0}'.format(n, n) + assert len(f.bins) == (n + 1)**2 + + # Make sure __repr__ works + repr(f) + + # to_xml_element() + elem = f.to_xml_element() + assert elem.tag == 'filter' + assert elem.attrib['type'] == 'sphericalharmonics' + assert elem.attrib['cosine'] == f.cosine + assert elem.find('order').text == str(n) + + +def test_zernike(): + n = 4 + f = openmc.ZernikeFilter(n, 0., 0., 1.) + assert f.order == n + assert f.bins[0] == 'Z0,0' + assert f.bins[-1] == 'Z{0},{0}'.format(n) + assert len(f.bins) == (n + 1)*(n + 2)//2 + + # Make sure __repr__ works + repr(f) + + # to_xml_element() + elem = f.to_xml_element() + assert elem.tag == 'filter' + assert elem.attrib['type'] == 'zernike' + assert elem.find('order').text == str(n) From f5137f7316fcab1f8be3b4eca36356b0894eb8b5 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 30 Mar 2018 09:29:17 -0500 Subject: [PATCH 146/231] Add first moment test for expansion filters --- openmc/filter_expansion.py | 11 +++++- tests/unit_tests/test_filters.py | 68 ++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 2 deletions(-) diff --git a/openmc/filter_expansion.py b/openmc/filter_expansion.py index f51e2f58dc..20bb08e77c 100644 --- a/openmc/filter_expansion.py +++ b/openmc/filter_expansion.py @@ -311,9 +311,16 @@ class SphericalHarmonicsFilter(ExpansionFilter): class ZernikeFilter(ExpansionFilter): r"""Score Zernike expansion moments in space up to specified order. - This filter allows scores to be multiplied by Zernike polynomials of the the + This filter allows scores to be multiplied by Zernike polynomials of the particle's position along a particular axis, normalized to a given unit - circle, up to a user-specified order. + circle, up to a user-specified order. Specifying a filter with order N + tallies moments for all radial orders from 0 to N and each azimuthal order + for a given radial order. The ordering of the Zernike polynomial moments + follows the ANSI Z80.28 standard, where bin :math:`j` corresponds to the + radial index :math:`n` and the azimuthal index :math:`m` by + + .. math:: + j = \frac{n(n + 2) + m}{2}. Parameters ---------- diff --git a/tests/unit_tests/test_filters.py b/tests/unit_tests/test_filters.py index 53f8f74b56..6060b55d77 100644 --- a/tests/unit_tests/test_filters.py +++ b/tests/unit_tests/test_filters.py @@ -1,4 +1,25 @@ +from math import sqrt, pi + import openmc +from pytest import fixture, approx + + +@fixture(scope='module') +def box_model(): + model = openmc.model.Model() + m = openmc.Material() + m.add_nuclide('U235', 1.0) + m.set_density('g/cm3', 1.0) + + box = openmc.model.get_rectangular_prism(10., 10., boundary_type='vacuum') + c = openmc.Cell(fill=m, region=box) + model.geometry.root_universe = openmc.Universe(cells=[c]) + + model.settings.particles = 100 + model.settings.batches = 10 + model.settings.inactive = 0 + model.settings.source = openmc.Source(space=openmc.stats.Point()) + return model def test_legendre(): @@ -78,3 +99,50 @@ def test_zernike(): assert elem.tag == 'filter' assert elem.attrib['type'] == 'zernike' assert elem.find('order').text == str(n) + + +def test_first_moment(run_in_tmpdir, box_model): + plain_tally = openmc.Tally() + plain_tally.scores = ['flux', 'scatter'] + + # Create tallies with expansion filters + leg_tally = openmc.Tally() + leg_tally.filters = [openmc.LegendreFilter(3)] + leg_tally.scores = ['scatter'] + leg_sptl_tally = openmc.Tally() + leg_sptl_tally.filters = [openmc.SpatialLegendreFilter(3, 'x', -5., 5.)] + leg_sptl_tally.scores = ['scatter'] + sph_scat_filter = openmc.SphericalHarmonicsFilter(5) + sph_scat_filter.cosine = 'scatter' + sph_scat_tally = openmc.Tally() + sph_scat_tally.filters = [sph_scat_filter] + sph_scat_tally.scores = ['scatter'] + sph_flux_filter = openmc.SphericalHarmonicsFilter(5) + sph_flux_filter.cosine = 'particle' + sph_flux_tally = openmc.Tally() + sph_flux_tally.filters = [sph_flux_filter] + sph_flux_tally.scores = ['flux'] + zernike_tally = openmc.Tally() + zernike_tally.filters = [openmc.ZernikeFilter(3, r=10.)] + zernike_tally.scores = ['scatter'] + + # Add tallies to model and ensure they all use the same estimator + box_model.tallies = [plain_tally, leg_tally, leg_sptl_tally, + sph_scat_tally, sph_flux_tally, zernike_tally] + for t in box_model.tallies: + t.estimator = 'analog' + + box_model.run() + + # Check that first moment matches the score from the plain tally + with openmc.StatePoint('statepoint.10.h5') as sp: + # Get scores from tally without expansion filters + flux, scatter = sp.tallies[plain_tally.id].mean.ravel() + + # Check that first moment matches + first_score = lambda t: sp.tallies[t.id].mean.ravel()[0] + assert first_score(leg_tally) == scatter + assert first_score(leg_sptl_tally) == scatter + assert first_score(sph_scat_tally) == scatter + assert first_score(sph_flux_tally) == approx(flux) + assert first_score(zernike_tally)*sqrt(pi) == approx(scatter) From a3240b69c37faa6c4c62ea5b2bcb371280bf9e2e Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 30 Mar 2018 13:21:15 -0500 Subject: [PATCH 147/231] Add C API functions for expansion filters --- docs/source/capi/index.rst | 5 +- include/openmc.h | 18 +++- src/tallies/tally_filter.F90 | 112 ++++++++++----------- src/tallies/tally_filter_energy.F90 | 75 ++++++-------- src/tallies/tally_filter_header.F90 | 22 ++++ src/tallies/tally_filter_legendre.F90 | 41 +++++++- src/tallies/tally_filter_material.F90 | 71 ++++++------- src/tallies/tally_filter_sph_harm.F90 | 108 +++++++++++++++++++- src/tallies/tally_filter_sptl_legendre.F90 | 97 +++++++++++++++++- src/tallies/tally_filter_zernike.F90 | 83 +++++++++++++++ 10 files changed, 475 insertions(+), 157 deletions(-) diff --git a/docs/source/capi/index.rst b/docs/source/capi/index.rst index d63ed1f3ae..0e6a2536c6 100644 --- a/docs/source/capi/index.rst +++ b/docs/source/capi/index.rst @@ -247,11 +247,12 @@ Functions :return: Return status (negative if an error occurs) :rtype: int -.. c:function:: int openmc_get_nuclide_index(char name[], int* index) +.. c:function:: int openmc_get_nuclide_index(const 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 name: Name of the nuclide + :type name: const char[] :param int* index: Index in the nuclides array :return: Return status (negative if an error occurs) :rtype: int diff --git a/include/openmc.h b/include/openmc.h index 10c0b2de8e..1c2106432a 100644 --- a/include/openmc.h +++ b/include/openmc.h @@ -38,10 +38,12 @@ extern "C" { void openmc_get_filter_next_id(int32_t* id); int openmc_get_keff(double k_combined[]); int openmc_get_material_index(int32_t id, int32_t* index); - int openmc_get_nuclide_index(char name[], int* index); + int openmc_get_nuclide_index(const char name[], int* index); int openmc_get_tally_index(int32_t id, int32_t* index); void openmc_hard_reset(); void openmc_init(const int* intracomm); + int openmc_legendre_filter_get_order(int32_t index, int* order); + int openmc_legendre_filter_set_order(int32_t index, int order); int openmc_load_nuclide(char name[]); int openmc_material_add_nuclide(int32_t index, const char name[], double density); int openmc_material_get_densities(int32_t index, int** nuclides, double** densities, int* n); @@ -62,6 +64,15 @@ extern "C" { void openmc_simulation_init(); int openmc_source_bank(struct Bank** ptr, int64_t* n); int openmc_source_set_strength(int32_t index, double strength); + int openmc_spatial_legendre_filter_get_order(int32_t index, int* order); + int openmc_spatial_legendre_filter_get_params(int32_t index, int* axis, double* min, double* max); + int openmc_spatial_legendre_filter_set_order(int32_t index, int order); + int openmc_spatial_legendre_filter_set_params(int32_t index, const int* axis, + const double* min, const double* max); + int openmc_sphharm_filter_get_order(int32_t index, int* order); + int openmc_sphharm_filter_get_cosine(int32_t index, char cosine[]); + int openmc_sphharm_filter_set_order(int32_t index, int order); + int openmc_sphharm_filter_set_cosine(int32_t index, const char cosine[]); void openmc_statepoint_write(const char filename[]); int openmc_tally_get_id(int32_t index, int32_t* id); int openmc_tally_get_filters(int32_t index, int32_t** indices, int* n); @@ -73,6 +84,11 @@ extern "C" { int openmc_tally_set_id(int32_t index, int32_t id); int openmc_tally_set_nuclides(int32_t index, int n, const char** nuclides); int openmc_tally_set_scores(int32_t index, int n, const int* scores); + int openmc_zernike_filter_get_order(int32_t index, int* order); + int openmc_zernike_filter_get_params(int32_t index, double* x, double* y, double* r); + int openmc_zernike_filter_set_order(int32_t index, int order); + int openmc_zernike_filter_set_params(int32_t index, const double* x, + const double* y, const double* r); // Error codes extern int E_UNASSIGNED; diff --git a/src/tallies/tally_filter.F90 b/src/tallies/tally_filter.F90 index 0277f24652..e484ac2315 100644 --- a/src/tallies/tally_filter.F90 +++ b/src/tallies/tally_filter.F90 @@ -46,68 +46,60 @@ contains integer :: i character(20) :: type_ - if (index >= 1 .and. index <= n_filters) then - if (allocated(filters(index) % obj)) then - ! Get type as a Fortran string - select type (f => filters(index) % obj) - type is (AzimuthalFilter) - type_ = 'azimuthal' - type is (CellFilter) - type_ = 'cell' - type is (CellbornFilter) - type_ = 'cellborn' - type is (CellfromFilter) - type_ = 'cellfrom' - type is (DelayedGroupFilter) - type_ = 'delayedgroup' - type is (DistribcellFilter) - type_ = 'distribcell' - type is (EnergyFilter) - type_ = 'energy' - type is (EnergyoutFilter) - type_ = 'energyout' - type is (EnergyFunctionFilter) - type_ = 'energyfunction' - type is (LegendreFilter) - type_ = 'legendre' - type is (MaterialFilter) - type_ = 'material' - type is (MeshFilter) - type_ = 'mesh' - type is (MeshSurfaceFilter) - type_ = 'meshsurface' - type is (MuFilter) - type_ = 'mu' - type is (PolarFilter) - type_ = 'polar' - type is (SphericalHarmonicsFilter) - type_ = 'sphericalharmonics' - type is (SpatialLegendreFilter) - type_ = 'spatiallegendre' - type is (SurfaceFilter) - type_ = 'surface' - type is (UniverseFilter) - type_ = 'universe' - type is (ZernikeFilter) - type_ = 'zernike' - end select + err = verify_filter(index) + if (err == 0) then + ! Get type as a Fortran string + select type (f => filters(index) % obj) + type is (AzimuthalFilter) + type_ = 'azimuthal' + type is (CellFilter) + type_ = 'cell' + type is (CellbornFilter) + type_ = 'cellborn' + type is (CellfromFilter) + type_ = 'cellfrom' + type is (DelayedGroupFilter) + type_ = 'delayedgroup' + type is (DistribcellFilter) + type_ = 'distribcell' + type is (EnergyFilter) + type_ = 'energy' + type is (EnergyoutFilter) + type_ = 'energyout' + type is (EnergyFunctionFilter) + type_ = 'energyfunction' + type is (LegendreFilter) + type_ = 'legendre' + type is (MaterialFilter) + type_ = 'material' + type is (MeshFilter) + type_ = 'mesh' + type is (MeshSurfaceFilter) + type_ = 'meshsurface' + type is (MuFilter) + type_ = 'mu' + type is (PolarFilter) + type_ = 'polar' + type is (SphericalHarmonicsFilter) + type_ = 'sphericalharmonics' + type is (SpatialLegendreFilter) + type_ = 'spatiallegendre' + type is (SurfaceFilter) + type_ = 'surface' + type is (UniverseFilter) + type_ = 'universe' + type is (ZernikeFilter) + type_ = 'zernike' + end select - ! Convert Fortran string to null-terminated C string. We assume the - ! caller has allocated a char array buffer - do i = 1, len_trim(type_) - type(i) = type_(i:i) - end do - type(len_trim(type_) + 1) = C_NULL_CHAR - - err = 0 - else - err = E_ALLOCATE - call set_errmsg("Filter type has not been set yet.") - end if - else - err = E_OUT_OF_BOUNDS - call set_errmsg("Index in filters array is out of bounds.") + ! Convert Fortran string to null-terminated C string. We assume the + ! caller has allocated a char array buffer + do i = 1, len_trim(type_) + type(i) = type_(i:i) + end do + type(len_trim(type_) + 1) = C_NULL_CHAR end if + end function openmc_filter_get_type diff --git a/src/tallies/tally_filter_energy.F90 b/src/tallies/tally_filter_energy.F90 index caba6755d1..d186fa62a8 100644 --- a/src/tallies/tally_filter_energy.F90 +++ b/src/tallies/tally_filter_energy.F90 @@ -204,28 +204,21 @@ contains integer(C_INT32_T), intent(out) :: n integer(C_INT) :: err - if (index >= 1 .and. index <= n_filters) then - if (allocated(filters(index) % obj)) then - select type (f => filters(index) % obj) - type is (EnergyFilter) - energies = C_LOC(f % bins) - n = size(f % bins) - err = 0 - type is (EnergyoutFilter) - energies = C_LOC(f % bins) - n = size(f % bins) - err = 0 + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (EnergyFilter) + energies = C_LOC(f % bins) + n = size(f % bins) + err = 0 + type is (EnergyoutFilter) + energies = C_LOC(f % bins) + n = size(f % bins) + err = 0 class default - err = E_INVALID_TYPE - call set_errmsg("Tried to get energy bins on a non-energy filter.") - end select - else - err = E_ALLOCATE - call set_errmsg("Filter type has not been set yet.") - end if - else - err = E_OUT_OF_BOUNDS - call set_errmsg("Index in filters array out of bounds.") + err = E_INVALID_TYPE + call set_errmsg("Tried to get energy bins on a non-energy filter.") + end select end if end function openmc_energy_filter_get_bins @@ -237,31 +230,23 @@ contains real(C_DOUBLE), intent(in) :: energies(n) integer(C_INT) :: err - err = 0 - if (index >= 1 .and. index <= n_filters) then - if (allocated(filters(index) % obj)) then - select type (f => filters(index) % obj) - type is (EnergyFilter) - f % n_bins = n - 1 - if (allocated(f % bins)) deallocate(f % bins) - allocate(f % bins(n)) - f % bins(:) = energies - type is (EnergyoutFilter) - f % n_bins = n - 1 - if (allocated(f % bins)) deallocate(f % bins) - allocate(f % bins(n)) - f % bins(:) = energies + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (EnergyFilter) + f % n_bins = n - 1 + if (allocated(f % bins)) deallocate(f % bins) + allocate(f % bins(n)) + f % bins(:) = energies + type is (EnergyoutFilter) + f % n_bins = n - 1 + if (allocated(f % bins)) deallocate(f % bins) + allocate(f % bins(n)) + f % bins(:) = energies class default - err = E_INVALID_TYPE - call set_errmsg("Tried to get energy bins on a non-energy filter.") - end select - else - err = E_ALLOCATE - call set_errmsg("Filter type has not been set yet.") - end if - else - err = E_OUT_OF_BOUNDS - call set_errmsg("Index in filters array out of bounds.") + err = E_INVALID_TYPE + call set_errmsg("Tried to get energy bins on a non-energy filter.") + end select end if end function openmc_energy_filter_set_bins diff --git a/src/tallies/tally_filter_header.F90 b/src/tallies/tally_filter_header.F90 index 34ad75388f..93d050b1af 100644 --- a/src/tallies/tally_filter_header.F90 +++ b/src/tallies/tally_filter_header.F90 @@ -15,6 +15,7 @@ module tally_filter_header implicit none private public :: free_memory_tally_filter + public :: verify_filter public :: openmc_extend_filters public :: openmc_filter_get_id public :: openmc_filter_set_id @@ -148,6 +149,27 @@ contains largest_filter_id = 0 end subroutine free_memory_tally_filter +!=============================================================================== +! VERIFY_FILTER makes sure that given a filter index, the size of the filters +! array is sufficient and a filter object has already been allocated. +!=============================================================================== + + function verify_filter(index) result(err) + integer(C_INT32_T), intent(in) :: index + integer(C_INT) :: err + + err = 0 + if (index >= 1 .and. index <= n_filters) then + if (.not. allocated(filters(index) % obj)) then + err = E_ALLOCATE + call set_errmsg("Filter type has not been set yet.") + end if + else + err = E_OUT_OF_BOUNDS + call set_errmsg("Index in filters array out of bounds.") + end if + end function verify_filter + !=============================================================================== ! C API FUNCTIONS !=============================================================================== diff --git a/src/tallies/tally_filter_legendre.F90 b/src/tallies/tally_filter_legendre.F90 index a97ed7fafe..9545b86926 100644 --- a/src/tallies/tally_filter_legendre.F90 +++ b/src/tallies/tally_filter_legendre.F90 @@ -15,13 +15,15 @@ module tally_filter_legendre implicit none private + public :: openmc_legendre_filter_get_order + public :: openmc_legendre_filter_set_order !=============================================================================== ! LEGENDREFILTER gives Legendre moments of the change in scattering angle !=============================================================================== type, public, extends(TallyFilter) :: LegendreFilter - integer :: order + integer(C_INT) :: order contains procedure :: from_xml procedure :: get_all_bins @@ -82,5 +84,42 @@ contains ! C API FUNCTIONS !=============================================================================== + function openmc_legendre_filter_get_order(index, order) result(err) bind(C) + ! Get the order of an expansion filter + integer(C_INT32_T), value :: index + integer(C_INT), intent(out) :: order + integer(C_INT) :: err + + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (LegendreFilter) + order = f % order + class default + err = E_INVALID_TYPE + call set_errmsg("Tried to get order on a non-expansion filter.") + end select + end if + end function openmc_legendre_filter_get_order + + + function openmc_legendre_filter_set_order(index, order) result(err) bind(C) + ! Set the order of an expansion filter + integer(C_INT32_T), value :: index + integer(C_INT), value :: order + integer(C_INT) :: err + + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (LegendreFilter) + f % order = order + f % n_bins = order + 1 + class default + err = E_INVALID_TYPE + call set_errmsg("Tried to set order on a non-expansion filter.") + end select + end if + end function openmc_legendre_filter_set_order end module tally_filter_legendre diff --git a/src/tallies/tally_filter_material.F90 b/src/tallies/tally_filter_material.F90 index 778fec4b68..3b9f843f84 100644 --- a/src/tallies/tally_filter_material.F90 +++ b/src/tallies/tally_filter_material.F90 @@ -126,25 +126,18 @@ contains integer(C_INT32_T), intent(out) :: n integer(C_INT) :: err - if (index >= 1 .and. index <= n_filters) then - if (allocated(filters(index) % obj)) then - select type (f => filters(index) % obj) - type is (MaterialFilter) - bins = C_LOC(f % materials) - n = size(f % materials) - err = 0 + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (MaterialFilter) + bins = C_LOC(f % materials) + n = size(f % materials) + err = 0 class default - err = E_INVALID_TYPE - call set_errmsg("Tried to get material filter bins on a & - &non-material filter.") - end select - else - err = E_ALLOCATE - call set_errmsg("Filter type has not been set yet.") - end if - else - err = E_OUT_OF_BOUNDS - call set_errmsg("Index in filters array out of bounds.") + err = E_INVALID_TYPE + call set_errmsg("Tried to get material filter bins on a & + &non-material filter.") + end select end if end function openmc_material_filter_get_bins @@ -158,34 +151,26 @@ contains integer :: i - err = 0 - if (index >= 1 .and. index <= n_filters) then - if (allocated(filters(index) % obj)) then - select type (f => filters(index) % obj) - type is (MaterialFilter) - f % n_bins = n - if (allocated(f % materials)) deallocate(f % materials) - allocate(f % materials(n)) - f % materials(:) = bins + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (MaterialFilter) + f % n_bins = n + if (allocated(f % materials)) deallocate(f % materials) + allocate(f % materials(n)) + f % materials(:) = bins - ! Generate mapping from material indices to filter bins. - call f % map % clear() - do i = 1, n - call f % map % set(f % materials(i), i) - end do + ! Generate mapping from material indices to filter bins. + call f % map % clear() + do i = 1, n + call f % map % set(f % materials(i), i) + end do class default - err = E_INVALID_TYPE - call set_errmsg("Tried to set material filter bins on a & - &non-material filter.") - end select - else - err = E_ALLOCATE - call set_errmsg("Filter type has not been set yet.") - end if - else - err = E_OUT_OF_BOUNDS - call set_errmsg("Index in filters array out of bounds.") + err = E_INVALID_TYPE + call set_errmsg("Tried to set material filter bins on a & + &non-material filter.") + end select end if end function openmc_material_filter_set_bins diff --git a/src/tallies/tally_filter_sph_harm.F90 b/src/tallies/tally_filter_sph_harm.F90 index 9ccfde422c..2d3c0bf6dd 100644 --- a/src/tallies/tally_filter_sph_harm.F90 +++ b/src/tallies/tally_filter_sph_harm.F90 @@ -9,12 +9,16 @@ module tally_filter_sph_harm use hdf5_interface use math, only: calc_pn, calc_rn use particle_header, only: Particle - use string, only: to_str, to_lower + use string, only: to_str, to_lower, to_f_string use tally_filter_header use xml_interface implicit none private + public :: openmc_sphharm_filter_get_order + public :: openmc_sphharm_filter_get_cosine + public :: openmc_sphharm_filter_set_order + public :: openmc_sphharm_filter_set_cosine integer, parameter :: COSINE_SCATTER = 1 integer, parameter :: COSINE_PARTICLE = 2 @@ -132,4 +136,106 @@ contains ! C API FUNCTIONS !=============================================================================== + function openmc_sphharm_filter_get_order(index, order) result(err) bind(C) + ! Get the order of an expansion filter + integer(C_INT32_T), value :: index + integer(C_INT), intent(out) :: order + integer(C_INT) :: err + + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (SphericalHarmonicsFilter) + order = f % order + class default + err = E_INVALID_TYPE + call set_errmsg("Tried to get order on a non-expansion filter.") + end select + end if + end function openmc_sphharm_filter_get_order + + + function openmc_sphharm_filter_get_cosine(index, cosine) result(err) bind(C) + ! Get the order of an expansion filter + integer(C_INT32_T), value :: index + character(kind=C_CHAR), intent(out) :: cosine(*) + integer(C_INT) :: err + + integer :: i + character(10) :: cosine_ + + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (SphericalHarmonicsFilter) + select case (f % cosine) + case (COSINE_SCATTER) + cosine_ = 'scatter' + case (COSINE_PARTICLE) + cosine_ = 'particle' + end select + + ! Convert to C string + do i = 1, len_trim(cosine_) + cosine(i) = cosine_(i:i) + end do + cosine(len_trim(cosine_) + 1) = C_NULL_CHAR + + class default + err = E_INVALID_TYPE + call set_errmsg("Tried to get order on a non-expansion filter.") + end select + end if + end function openmc_sphharm_filter_get_cosine + + + function openmc_sphharm_filter_set_order(index, order) result(err) bind(C) + ! Set the order of an expansion filter + integer(C_INT32_T), value :: index + integer(C_INT), value :: order + integer(C_INT) :: err + + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (SphericalHarmonicsFilter) + f % order = order + f % n_bins = (order + 1)**2 + class default + err = E_INVALID_TYPE + call set_errmsg("Tried to set order on a non-expansion filter.") + end select + end if + end function openmc_sphharm_filter_set_order + + + function openmc_sphharm_filter_set_cosine(index, cosine) result(err) bind(C) + ! Set the cosine parameter + integer(C_INT32_T), value :: index + character(kind=C_CHAR), intent(in) :: cosine(*) + integer(C_INT) :: err + + character(:), allocatable :: cosine_ + + ! Convert C string to Fortran string + cosine_ = to_f_string(cosine) + + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (SphericalHarmonicsFilter) + select case (cosine_) + case ('scatter') + f % cosine = COSINE_SCATTER + case ('particle') + f % cosine = COSINE_PARTICLE + end select + + class default + err = E_INVALID_TYPE + call set_errmsg("Tried to get order on a non-expansion filter.") + end select + end if + end function openmc_sphharm_filter_set_cosine + end module tally_filter_sph_harm diff --git a/src/tallies/tally_filter_sptl_legendre.F90 b/src/tallies/tally_filter_sptl_legendre.F90 index 8de87f8664..29dd848eaf 100644 --- a/src/tallies/tally_filter_sptl_legendre.F90 +++ b/src/tallies/tally_filter_sptl_legendre.F90 @@ -15,6 +15,10 @@ module tally_filter_sptl_legendre implicit none private + public :: openmc_spatial_legendre_filter_get_order + public :: openmc_spatial_legendre_filter_get_params + public :: openmc_spatial_legendre_filter_set_order + public :: openmc_spatial_legendre_filter_set_params integer, parameter :: AXIS_X = 1 integer, parameter :: AXIS_Y = 2 @@ -25,10 +29,10 @@ module tally_filter_sptl_legendre !=============================================================================== type, public, extends(TallyFilter) :: SpatialLegendreFilter - integer :: order - integer :: axis - real(8) :: min - real(8) :: max + integer(C_INT) :: order + integer(C_INT) :: axis + real(C_DOUBLE) :: min + real(C_DOUBLE) :: max contains procedure :: from_xml procedure :: get_all_bins @@ -121,5 +125,90 @@ contains ! C API FUNCTIONS !=============================================================================== + function openmc_spatial_legendre_filter_get_order(index, order) result(err) bind(C) + ! Get the order of an expansion filter + integer(C_INT32_T), value :: index + integer(C_INT), intent(out) :: order + integer(C_INT) :: err + + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (SpatialLegendreFilter) + order = f % order + class default + err = E_INVALID_TYPE + call set_errmsg("Tried to get order on a non-expansion filter.") + end select + end if + end function openmc_spatial_legendre_filter_get_order + + + function openmc_spatial_legendre_filter_set_order(index, order) result(err) bind(C) + ! Set the order of an expansion filter + integer(C_INT32_T), value :: index + integer(C_INT), value :: order + integer(C_INT) :: err + + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (SpatialLegendreFilter) + f % order = order + f % n_bins = order + 1 + class default + err = E_INVALID_TYPE + call set_errmsg("Tried to set order on a non-expansion filter.") + end select + end if + end function openmc_spatial_legendre_filter_set_order + + + function openmc_spatial_legendre_filter_get_params(index, axis, min, max) & + result(err) bind(C) + ! Get the parameters for a spatial Legendre filter + integer(C_INT32_T), value :: index + integer(C_INT), intent(out) :: axis + real(C_DOUBLE), intent(out) :: min + real(C_DOUBLE), intent(out) :: max + integer(C_INT) :: err + + err = verify_filter(index) + if (err == 0) then + select type(f => filters(index) % obj) + type is (SpatialLegendreFilter) + axis = f % axis + min = f % min + max = f % max + class default + err = E_INVALID_TYPE + call set_errmsg("Tried to set order on a non-expansion filter.") + end select + end if + end function openmc_spatial_legendre_filter_get_params + + + function openmc_spatial_legendre_filter_set_params(index, axis, min, max) & + result(err) bind(C) + ! Set the parameters for a spatial Legendre filter + integer(C_INT32_T), value :: index + integer(C_INT), intent(in), optional :: axis + real(C_DOUBLE), intent(in), optional :: min + real(C_DOUBLE), intent(in), optional :: max + integer(C_INT) :: err + + err = verify_filter(index) + if (err == 0) then + select type(f => filters(index) % obj) + type is (SpatialLegendreFilter) + if (present(axis)) f % axis = axis + if (present(min)) f % min = min + if (present(max)) f % max = max + class default + err = E_INVALID_TYPE + call set_errmsg("Tried to set order on a non-expansion filter.") + end select + end if + end function openmc_spatial_legendre_filter_set_params end module tally_filter_sptl_legendre diff --git a/src/tallies/tally_filter_zernike.F90 b/src/tallies/tally_filter_zernike.F90 index 91619827a1..ce732af0e1 100644 --- a/src/tallies/tally_filter_zernike.F90 +++ b/src/tallies/tally_filter_zernike.F90 @@ -117,5 +117,88 @@ contains ! C API FUNCTIONS !=============================================================================== + function openmc_zernike_filter_get_order(index, order) result(err) bind(C) + ! Get the order of an expansion filter + integer(C_INT32_T), value :: index + integer(C_INT), intent(out) :: order + integer(C_INT) :: err + + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (ZernikeFilter) + order = f % order + class default + err = E_INVALID_TYPE + call set_errmsg("Tried to get order on a non-expansion filter.") + end select + end if + end function openmc_zernike_filter_get_order + + + function openmc_zernike_filter_get_params(index, x, y, r) result(err) bind(C) + ! Get the Zernike filter parameters + integer(C_INT32_T), value :: index + real(C_DOUBLE), intent(out) :: x + real(C_DOUBLE), intent(out) :: y + real(C_DOUBLE), intent(out) :: r + integer(C_INT) :: err + + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (ZernikeFilter) + x = f % x + y = f % y + r = f % r + class default + err = E_INVALID_TYPE + call set_errmsg("Tried to get order on a non-expansion filter.") + end select + end if + end function openmc_zernike_filter_get_params + + + function openmc_zernike_filter_set_order(index, order) result(err) bind(C) + ! Set the order of an expansion filter + integer(C_INT32_T), value :: index + integer(C_INT), value :: order + integer(C_INT) :: err + + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (ZernikeFilter) + f % order = order + f % n_bins = ((order + 1)*(order + 2))/2 + class default + err = E_INVALID_TYPE + call set_errmsg("Tried to set order on a non-expansion filter.") + end select + end if + end function openmc_zernike_filter_set_order + + + function openmc_zernike_filter_set_params(index, x, y, r) result(err) bind(C) + ! Set the Zernike filter parameters + integer(C_INT32_T), value :: index + real(C_DOUBLE), intent(in), optional :: x + real(C_DOUBLE), intent(in), optional :: y + real(C_DOUBLE), intent(in), optional :: r + integer(C_INT) :: err + + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (ZernikeFilter) + if (present(x)) f % x = x + if (present(y)) f % y = y + if (present(r)) f % r = r + class default + err = E_INVALID_TYPE + call set_errmsg("Tried to get order on a non-expansion filter.") + end select + end if + end function openmc_zernike_filter_set_params end module tally_filter_zernike From 964a5da3e2520b55d2c26926bc4682cbafe9b495 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 30 Mar 2018 17:45:45 -0500 Subject: [PATCH 148/231] Remove unused variable in tally_filter_zernike.F90 --- src/tallies/tally_filter_zernike.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tallies/tally_filter_zernike.F90 b/src/tallies/tally_filter_zernike.F90 index ce732af0e1..bf172a6e4f 100644 --- a/src/tallies/tally_filter_zernike.F90 +++ b/src/tallies/tally_filter_zernike.F90 @@ -62,7 +62,6 @@ contains type(TallyFilterMatch), intent(inout) :: match integer :: i - integer :: n real(8) :: x, y, r, theta real(8) :: zn(this % n_bins) From 8838f14720f23c198bc112a2a0fc957917b3379a Mon Sep 17 00:00:00 2001 From: amandalund Date: Fri, 30 Mar 2018 20:00:28 -0500 Subject: [PATCH 149/231] Added some more TRISO unit tests --- openmc/model/triso.py | 12 ++- tests/unit_tests/test_model_triso.py | 144 ++++++++++++++++++++++----- 2 files changed, 127 insertions(+), 29 deletions(-) diff --git a/openmc/model/triso.py b/openmc/model/triso.py index 77488b891b..7040d02cab 100644 --- a/openmc/model/triso.py +++ b/openmc/model/triso.py @@ -314,7 +314,9 @@ class _CubicDomain(_Domain): p += r*v q -= r*v - # Apply boundary conditions + # Enforce the rigid boundary by moving each particle back along the + # surface normal until it is completely within the container if it + # overlaps the surface x_max = self.limits[0] p[:] = np.clip(p, -x_max, x_max) q[:] = np.clip(q, -x_max, x_max) @@ -420,7 +422,9 @@ class _CylindricalDomain(_Domain): p += r*v q -= r*v - # Apply boundary conditions + # Enforce the rigid boundary by moving each particle back along the + # surface normal until it is completely within the container if it + # overlaps the surface r_max = self.limits[0] z_max = self.limits[1] @@ -517,7 +521,9 @@ class _SphericalDomain(_Domain): p += r*v q -= r*v - # Apply boundary conditions + # Enforce the rigid boundary by moving each particle back along the + # surface normal until it is completely within the container if it + # overlaps the surface r_max = self.limits[0] d = sqrt(p[0]**2 + p[1]**2 + p[2]**2) diff --git a/tests/unit_tests/test_model_triso.py b/tests/unit_tests/test_model_triso.py index c6f717d0b2..bfd7319d21 100644 --- a/tests/unit_tests/test_model_triso.py +++ b/tests/unit_tests/test_model_triso.py @@ -11,49 +11,75 @@ import scipy.spatial _PACKING_FRACTION = 0.35 -_RADIUS = 1. -_PARAMS = [{'shape' : 'cube', 'length' : 20., 'radius' : 0.}, - {'shape' : 'cylinder', 'length' : 10., 'radius' : 10.}, - {'shape' : 'sphere', 'length' : 0., 'radius' : 10.}] +_RADIUS = 4.25e-2 -@pytest.fixture(scope='module', params=_PARAMS) +@pytest.fixture(scope='module', + params=[{'shape': 'cube', + 'length': 0.75, + 'radius': 0., + 'volume': 0.75**3}, + {'shape': 'cylinder', + 'length': 0.5, + 'radius': 0.5, + 'volume': 0.5*pi*0.5**2}, + {'shape': 'sphere', + 'length': 0., + 'radius': 0.5, + 'volume': 4/3*pi*0.5**3}]) def domain(request): return request.param @pytest.fixture(scope='module') -def trisos(domain): - return openmc.model.pack_trisos( +def triso_universe(): + sphere = openmc.Sphere(R=_RADIUS) + cell = openmc.Cell(region=-sphere) + univ = openmc.Universe(cells=[cell]) + return univ + + +@pytest.fixture(scope='module') +def trisos(domain, triso_universe): + trisos = openmc.model.pack_trisos( radius=_RADIUS, - fill=openmc.Universe(), + fill=triso_universe, domain_shape=domain['shape'], domain_length=domain['length'], domain_radius=domain['radius'], - domain_center=[0., 0., 0.], + domain_center=(0., 0., 0.), initial_packing_fraction=0.2, packing_fraction=_PACKING_FRACTION ) + return trisos def test_overlap(trisos): """Check that no TRISO particles overlap.""" - tree = scipy.spatial.cKDTree([t.center for t in trisos]) - r = min(tree.query([t.center for t in trisos], k=2)[0][:,1])/2 - assert r > _RADIUS or r == pytest.approx(_RADIUS) + centers = [t.center for t in trisos] + + # Create KD tree for quick nearest neighbor search + tree = scipy.spatial.cKDTree(centers) + + # Find distance to nearest neighbor for all particles + d = tree.query(centers, k=2)[0] + + # Get the smallest distance between any two particles + d_min = min(d[:,1]) + assert d_min > 2*_RADIUS or d_min == pytest.approx(2*_RADIUS) def test_contained(trisos, domain): """Make sure all particles are entirely contained within the domain.""" if domain['shape'] == 'cube': - x = 2*(max(np.hstack([abs(t.center) for t in trisos])) + _RADIUS) - assert x < domain['length'] or x == pytest.approx(domain['length']) + x = max(np.hstack([abs(t.center) for t in trisos])) + _RADIUS + assert x < 0.5*domain['length'] or x == pytest.approx(0.5*domain['length']) elif domain['shape'] == 'cylinder': r = max([norm(t.center[0:2]) for t in trisos]) + _RADIUS - z = 2*(max([abs(t.center[2]) for t in trisos]) + _RADIUS) + z = max([abs(t.center[2]) for t in trisos]) + _RADIUS assert r < domain['radius'] or r == pytest.approx(domain['radius']) - assert z < domain['length'] or z == pytest.approx(domain['length']) + assert z < 0.5*domain['length'] or z == pytest.approx(0.5*domain['length']) elif domain['shape'] == 'sphere': r = max([norm(t.center) for t in trisos]) + _RADIUS @@ -62,14 +88,80 @@ def test_contained(trisos, domain): def test_packing_fraction(trisos, domain): """Check that the actual PF is close to the requested PF.""" - if domain['shape'] == 'cube': - volume = domain['length']**3 - - elif domain['shape'] == 'cylinder': - volume = domain['length']*pi*domain['radius']**2 - - elif domain['shape'] == 'sphere': - volume = 4/3*pi*domain['radius']**3 - - pf = len(trisos)*4/3*pi*_RADIUS**3/volume + pf = len(trisos)*4/3*pi*_RADIUS**3/domain['volume'] assert pf == pytest.approx(_PACKING_FRACTION, rel=1e-2) + + +def test_n_particles(triso_universe): + """Check that the function returns the correct number of particles""" + trisos = openmc.model.pack_trisos( + radius=_RADIUS, fill=triso_universe, domain_shape='cube', + domain_length=1.0, n_particles=800 + ) + assert len(trisos) == 800 + + +def test_triso_lattice(triso_universe): + trisos = openmc.model.pack_trisos( + radius=_RADIUS, fill=triso_universe, domain_shape='cube', + domain_length=1.0, domain_center=(0., 0., 0.), packing_fraction=0.2 + ) + + lower_left = np.array((-.5, -.5, -.5)) + upper_right = np.array((.5, .5, .5)) + shape = (3, 3, 3) + pitch = (upper_right - lower_left)/shape + background = openmc.Material() + + lattice = openmc.model.create_triso_lattice( + trisos, lower_left, pitch, shape, background + ) + + +def test_domain_input(triso_universe): + # Invalid domain shape + with pytest.raises(ValueError): + trisos = openmc.model.pack_trisos( + radius=1, fill=triso_universe, n_particles=100, + domain_shape='circle' + ) + # Don't specify domain length on a cube + with pytest.raises(ValueError): + trisos = openmc.model.pack_trisos( + radius=1, fill=triso_universe, n_particles=100, + domain_shape='cube' + ) + # Don't specify domain radius on a sphere + with pytest.raises(ValueError): + trisos = openmc.model.pack_trisos( + radius=1, fill=triso_universe, n_particles=100, + domain_shape='sphere' + ) + + +def test_packing_fraction_input(triso_universe): + # Provide neither packing fraction nor number of particles + with pytest.raises(ValueError): + trisos = openmc.model.pack_trisos( + radius=1, fill=triso_universe, domain_shape='cube', + domain_length=10 + ) + # Provide both packing fraction and number of particles + with pytest.raises(ValueError): + trisos = openmc.model.pack_trisos( + radius=1, fill=triso_universe, domain_shape='cube', + domain_length=10, n_particles=100, packing_fraction=0.2 + ) + # Specify a packing fraction that is too high for CRP + with pytest.raises(ValueError): + trisos = openmc.model.pack_trisos( + radius=1, fill=triso_universe, domain_shape='cube', + domain_length=10, packing_fraction=1 + ) + # Specify a packing fraction that is too high for RSP + with pytest.raises(ValueError): + trisos = openmc.model.pack_trisos( + radius=1, fill=triso_universe, domain_shape='cube', + domain_length=10, packing_fraction=0.5, + initial_packing_fraction=0.4 + ) From 0d6cb83f2692a89b6262c93885a43814086fa1fb Mon Sep 17 00:00:00 2001 From: guillaume Date: Mon, 2 Apr 2018 13:51:46 -0400 Subject: [PATCH 150/231] in doc : fixed naming conventions, mistake on depletion requirements --- docs/source/usersguide/install.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/usersguide/install.rst b/docs/source/usersguide/install.rst index 6b24c64ddd..34c8395e0a 100644 --- a/docs/source/usersguide/install.rst +++ b/docs/source/usersguide/install.rst @@ -417,8 +417,8 @@ 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. To run simulations in parallel using MPI, it is recommended to -build mpi4py, hdf5, h5py from source, in that order, using the same compilers -as for openmc. +build mpi4py, HDF5, h5py from source, in that order, using the same compilers +as for openMC. .. admonition:: Required :class: error @@ -457,7 +457,7 @@ as for openmc. `mpi4py `_ mpi4py provides Python bindings to MPI for running distributed-memory parallel runs. This package is needed if you plan on running depletion - simulations. + simulations in parallel using MPI. `Cython `_ Cython is used for resonance reconstruction for ENDF data converted to From 8c14c8230fc6c2f000c8c2ddcf529a3223b30812 Mon Sep 17 00:00:00 2001 From: guillaume Date: Mon, 2 Apr 2018 14:02:55 -0400 Subject: [PATCH 151/231] in doc : naming convention --- docs/source/usersguide/install.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/usersguide/install.rst b/docs/source/usersguide/install.rst index 34c8395e0a..b0618818e3 100644 --- a/docs/source/usersguide/install.rst +++ b/docs/source/usersguide/install.rst @@ -418,7 +418,7 @@ 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. To run simulations in parallel using MPI, it is recommended to build mpi4py, HDF5, h5py from source, in that order, using the same compilers -as for openMC. +as for OpenMC. .. admonition:: Required :class: error From cade109745e586e61118d10b60d0754d326ff353 Mon Sep 17 00:00:00 2001 From: guillaume Date: Mon, 2 Apr 2018 14:23:36 -0400 Subject: [PATCH 152/231] took into account PR comments, got rid of redundant exports and dictionaries --- .../python/pincell_depletion/run_depletion.py | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/examples/python/pincell_depletion/run_depletion.py b/examples/python/pincell_depletion/run_depletion.py index 9d81812fed..8c12211bca 100644 --- a/examples/python/pincell_depletion/run_depletion.py +++ b/examples/python/pincell_depletion/run_depletion.py @@ -1,4 +1,5 @@ import openmc +import openmc.deplete import numpy as np ############################################################################### @@ -11,9 +12,9 @@ inactive = 10 particles = 1000 # Depletion simulation parameters -time_step = 1.*24*60*60 # s -final_time = 15.*24*60*60 # s -time_steps = np.full(np.int(final_time / time_step), time_step) +time_step = 1*24*60*60 # s +final_time = 15*24*60*60 # s +time_steps = np.full(final_time // time_step, time_step) chain_file = './chain_simple.xml' power = 174 # W/cm, for 2D simulations only (use W for 3D) @@ -32,7 +33,6 @@ uo2.depletable = True helium = openmc.Material(material_id=2, name='Helium for gap') helium.set_density('g/cm3', 0.001598) helium.add_element('He', 2.4044e-4) -helium.depletable = False zircaloy = openmc.Material(material_id=3, name='Zircaloy 4') zircaloy.set_density('g/cm3', 6.55) @@ -40,7 +40,6 @@ zircaloy.add_element('Sn', 0.014 , 'wo') zircaloy.add_element('Fe', 0.00165, 'wo') zircaloy.add_element('Cr', 0.001 , 'wo') zircaloy.add_element('Zr', 0.98335, 'wo') -zircaloy.depletable = False borated_water = openmc.Material(material_id=4, name='Borated water') borated_water.set_density('g/cm3', 0.740582) @@ -48,7 +47,6 @@ borated_water.add_element('B', 4.0e-5) borated_water.add_element('H', 5.0e-2) borated_water.add_element('O', 2.4e-2) borated_water.add_s_alpha_beta('c_H_in_H2O') -borated_water.depletable = False ############################################################################### # Exporting to OpenMC geometry.xml file @@ -92,9 +90,8 @@ root = openmc.Universe(universe_id=0, name='root universe') # Register Cells with Universe root.add_cells([fuel, gap, clad, water]) -# Instantiate a Geometry, register the root Universe, and export to XML +# Instantiate a Geometry, register the root Universe geometry = openmc.Geometry(root) -geometry.export_to_xml() ############################################################################### # Exporting to OpenMC materials.xml file @@ -107,10 +104,6 @@ area[fuel] = np.pi * fuel_or.coefficients['R'] ** 2 # Set materials volume for depletion. Set to an area for 2D simulations uo2.volume = area[fuel] -# Instantiate a Materials collection and export to XML -materials_file = openmc.Materials([uo2, helium, zircaloy, borated_water]) -materials_file.export_to_xml() - ############################################################################### # Exporting to OpenMC settings.xml file ############################################################################### @@ -131,14 +124,12 @@ entropy_mesh.lower_left = [-0.39218, -0.39218, -1.e50] entropy_mesh.upper_right = [0.39218, 0.39218, 1.e50] entropy_mesh.dimension = [10, 10, 1] settings_file.entropy_mesh = entropy_mesh -settings_file.export_to_xml() ############################################################################### # Initialize and run depletion calculation ############################################################################### op = openmc.deplete.Operator(geometry, settings_file, chain_file) -op.round_number = True # Perform simulation using the predictor algorithm openmc.deplete.integrator.predictor(op, time_steps, power) @@ -150,12 +141,8 @@ openmc.deplete.integrator.predictor(op, time_steps, power) # Open results file results = openmc.deplete.ResultsList("depletion_results.h5") -# Dictionnary of materials and burned nuclides -mat_id_to_ind = results[0].mat_to_ind -nuc_to_ind = results[0].nuc_to_ind - # Obtain K_eff as a function of time time, keff = results.get_eigenvalue() # Obtain U235 concentration as a function of time -time, n_U235 = results.get_atoms(mat_id_to_ind['1'], nuc_to_ind['U235']) +time, n_U235 = results.get_atoms('1', 'U235') From b0a8e810104a281c2e6a17badab96147990b7019 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 3 Apr 2018 16:54:34 -0500 Subject: [PATCH 153/231] Respond to comments on #990. Add FE example notebook. --- docs/source/examples/expansion-filters.rst | 13 + docs/source/examples/index.rst | 14 +- examples/jupyter/expansion-filters.ipynb | 463 +++++++++++++++++++++ openmc/filter_expansion.py | 9 +- src/math.F90 | 2 +- src/tallies/tally_filter_sph_harm.F90 | 11 +- src/tallies/tally_filter_sptl_legendre.F90 | 32 +- src/tallies/tally_filter_zernike.F90 | 8 +- 8 files changed, 524 insertions(+), 28 deletions(-) create mode 100644 docs/source/examples/expansion-filters.rst create mode 100644 examples/jupyter/expansion-filters.ipynb diff --git a/docs/source/examples/expansion-filters.rst b/docs/source/examples/expansion-filters.rst new file mode 100644 index 0000000000..f06d2bde6b --- /dev/null +++ b/docs/source/examples/expansion-filters.rst @@ -0,0 +1,13 @@ +.. _notebook_expansion: + +===================== +Functional Expansions +===================== + +.. only:: html + + .. notebook:: ../../../examples/jupyter/expansion-filters.ipynb + +.. only:: latex + + IPython notebooks must be viewed in the online HTML documentation. diff --git a/docs/source/examples/index.rst b/docs/source/examples/index.rst index 5c1efb57ce..89a1f1fe0b 100644 --- a/docs/source/examples/index.rst +++ b/docs/source/examples/index.rst @@ -1,13 +1,12 @@ .. _examples: -================= -Example Notebooks -================= +======== +Examples +======== -The following series of Jupyter_ Notebooks provide examples for usage of OpenMC -features via the :ref:`pythonapi`. - -.. _Jupyter: https://jupyter.org/ +The following series of `Jupyter `_ Notebooks provide +examples for how to use various features of OpenMC by leveraging the +:ref:`pythonapi`. ----------- Basic Usage @@ -20,6 +19,7 @@ Basic Usage post-processing pandas-dataframes tally-arithmetic + expansion-filters search triso candu diff --git a/examples/jupyter/expansion-filters.ipynb b/examples/jupyter/expansion-filters.ipynb new file mode 100644 index 0000000000..7870faffe5 --- /dev/null +++ b/examples/jupyter/expansion-filters.ipynb @@ -0,0 +1,463 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "OpenMC's general tally system accommodates a wide range of tally *filters*. While most filters are meant to identify regions of phase space that contribute to a tally, there are a special set of functional expansion filters that will multiply the tally by a set of orthogonal functions, e.g. Legendre polynomials, so that continuous functions of space or angle can be reconstructed from the tallied moments.\n", + "\n", + "In this example, we will determine the spatial dependence of the flux along the $z$ axis by making a Legendre polynomial expansion. Let us represent the flux along the z axis, $\\phi(z)$, by the function\n", + "\n", + "$$ \\phi(z') = \\sum\\limits_{n=0}^N a_n P_n(z') $$\n", + "\n", + "where $z'$ is the position normalized to the range [-1, 1]. Since $P_n(z')$ are known functions, our only task is to determine the expansion coefficients, $a_n$. By the orthogonality properties of the Legendre polynomials, one can deduce that the coefficients, $a_n$, are given by\n", + "\n", + "$$ a_n = \\frac{2n + 1}{2} \\int_{-1}^1 dz' P_n(z') \\phi(z').$$\n", + "\n", + "Thus, the problem reduces to finding the integral of the flux times each Legendre polynomial -- a problem which can be solved by using a Monte Carlo tally. By using a Legendre polynomial filter, we obtain stochastic estimates of these integrals for each polynomial order." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "%matplotlib inline\n", + "import openmc\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To begin, let us first create a simple model. The model will be a slab of fuel material with reflective boundaries conditions in the x- and y-directions and vacuum boundaries in the z-direction. However, to make the distribution slightly more interesting, we'll put some B4C in the middle of the slab." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "# Define fuel and B4C materials\n", + "fuel = openmc.Material()\n", + "fuel.add_element('U', 1.0, enrichment=4.5)\n", + "fuel.add_nuclide('O16', 2.0)\n", + "fuel.set_density('g/cm3', 10.0)\n", + "\n", + "b4c = openmc.Material()\n", + "b4c.add_element('B', 4.0)\n", + "b4c.add_element('C', 1.0)\n", + "b4c.set_density('g/cm3', 2.5)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "# Define surfaces used to construct regions\n", + "zmin, zmax = -10., 10.\n", + "box = openmc.model.get_rectangular_prism(10., 10., boundary_type='reflective')\n", + "bottom = openmc.ZPlane(z0=zmin, boundary_type='vacuum')\n", + "boron_lower = openmc.ZPlane(z0=-0.5)\n", + "boron_upper = openmc.ZPlane(z0=0.5)\n", + "top = openmc.ZPlane(z0=zmax, boundary_type='vacuum')\n", + "\n", + "# Create three cells and add them to geometry\n", + "fuel1 = openmc.Cell(fill=fuel, region=box & +bottom & -boron_lower)\n", + "absorber = openmc.Cell(fill=b4c, region=box & +boron_lower & -boron_upper)\n", + "fuel2 = openmc.Cell(fill=fuel, region=box & +boron_upper & -top)\n", + "geom = openmc.Geometry([fuel1, absorber, fuel2])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For the starting source, we'll use a uniform distribution over the entire box geometry." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "settings = openmc.Settings()\n", + "spatial_dist = openmc.stats.Box(*geom.bounding_box)\n", + "settings.source = openmc.Source(space=spatial_dist)\n", + "settings.batches = 210\n", + "settings.inactive = 10\n", + "settings.particles = 1000" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Defining the tally is relatively straightforward. One simply needs to list 'flux' as a score and then add an expansion filter. For this case, we will want to use the `SpatialLegendreFilter` class which multiplies tally scores by Legendre polynomials evaluated on normalized spatial positions along an axis." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "# Create a flux tally\n", + "flux_tally = openmc.Tally()\n", + "flux_tally.scores = ['flux']\n", + "\n", + "# Create a Legendre polynomial expansion filter and add to tally\n", + "order = 8\n", + "expand_filter = openmc.SpatialLegendreFilter(order, 'z', zmin, zmax)\n", + "flux_tally.filters.append(expand_filter)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The last thing we need to do is create a `Tallies` collection and export the entire model, which we'll do using the `Model` convenience class." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "tallies = openmc.Tallies([flux_tally])\n", + "model = openmc.model.Model(geometry=geom, settings=settings, tallies=tallies)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Running a simulation is now as simple as calling the `run()` method of `Model`." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "0.3016877031715249+/-0.0006126949350699303" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "model.run(output=False)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now that the run is finished, we need to load the results from the statepoint file." + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "with openmc.StatePoint('statepoint.210.h5') as sp:\n", + " df = sp.tallies[flux_tally.id].get_pandas_dataframe()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We've used the `get_pandas_dataframe()` method that returns tally data as a Pandas dataframe. Let's see what the raw data looks like." + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "

\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
spatiallegendrenuclidescoremeanstd. dev.
0P0totalflux36.4348280.076755
1P1totalflux0.0217970.043545
2P2totalflux-4.3808920.025739
3P3totalflux0.0014480.020740
4P4totalflux-0.2954390.014215
5P5totalflux0.0035140.012017
6P6totalflux0.1052130.010103
7P7totalflux0.0025950.009265
8P8totalflux-0.0961970.007513
\n", + "
" + ], + "text/plain": [ + " spatiallegendre nuclide score mean std. dev.\n", + "0 P0 total flux 3.64e+01 7.68e-02\n", + "1 P1 total flux 2.18e-02 4.35e-02\n", + "2 P2 total flux -4.38e+00 2.57e-02\n", + "3 P3 total flux 1.45e-03 2.07e-02\n", + "4 P4 total flux -2.95e-01 1.42e-02\n", + "5 P5 total flux 3.51e-03 1.20e-02\n", + "6 P6 total flux 1.05e-01 1.01e-02\n", + "7 P7 total flux 2.60e-03 9.27e-03\n", + "8 P8 total flux -9.62e-02 7.51e-03" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Since the expansion coefficients are given as\n", + "\n", + "$$ a_n = \\frac{2n + 1}{2} \\int_{-1}^1 dz' P_n(z') \\phi(z')$$\n", + "\n", + "we just need to multiply the Legendre moments by $(2n + 1)/2$." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "n = np.arange(order + 1)\n", + "a_n = (2*n + 1)/2 * df['mean']" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To plot the flux distribution, we can use the `numpy.polynomial.Legendre` class which represents a truncated Legendre polynomial series. Since we really want to plot $\\phi(z)$ and not $\\phi(z')$ we first need to perform a change of variables. Since\n", + "\n", + "$$ \\lvert \\phi(z) dz \\rvert = \\lvert \\phi(z') dz' \\rvert $$\n", + "\n", + "and, for this case, $z = 10z'$, it follows that\n", + "\n", + "$$ \\phi(z) = \\frac{\\phi(z')}{10} = \\sum_{n=0}^N \\frac{a_n}{10} P_n(z'). $$" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [], + "source": [ + "phi = np.polynomial.Legendre(a_n/10, domain=(zmin, zmax))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let's plot it and see how our flux looks!" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAEKCAYAAAAB0GKPAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8FfXZ9/HPlT2BEBIStiSQsO9r2BQUXFjUilZb0d4u\nbZVH617t/tRarb3vLrdPa+tGLXWp+1ZRcUGRxYUloOwCIWFJDCQQIASy53r+OAM90iwnkMmcnFzv\n1+u8cs7MnJlvJie5MvOb+f1EVTHGGGOaEuZ1AGOMMW2DFQxjjDEBsYJhjDEmIFYwjDHGBMQKhjHG\nmIBYwTDGGBMQKxjGGGMCYgXDGGNMQKxgGGOMCUiE1wFaUnJysmZkZHgdwxhj2ow1a9bsV9WUQJYN\nqYKRkZFBdna21zGMMabNEJFdgS5rp6SMMcYExAqGMcaYgFjBMMYYExArGMYYYwJiBcMYY0xArGAY\nY4wJiBUMY4wxAQmp+zCMCYSqUllTR2l5NaUVNZRWVFNaXk1FdS1VtUpNbR3VtXVU1SrVNXXU1n19\nGGOR+tcrfjOOD32sCoo6X7/+2n9Z//nHtyHHv4o4r4Uw4cTziHAhLiqc2KgI4iLDiYsKJy46gqS4\nKJLjo4iLsl9v07Jc+0SJSDrwNNAN3+/CPFX980nLfAf4Cb7fjSPATaq6zpm305lWC9SoapZbWU3o\nqaiuJW//UXKKytheVEbBwXL2lpaz93AFew9XcLSq1uuIrouLCie5YzTdO8XQu0scGckdyOjSgX5d\nO9I3pQMR4XaCwTSPm/+C1AB3qepaEYkH1ojIIlXd7LdMHnC2qh4UkVnAPGCC3/xpqrrfxYwmBKgq\nO4rLWLPrIGt3HWLN7oPkFpdx/MAgTKB7pxi6JcQwsHs8Zw1IIbljNJ1iI+kUE3Hia0xkONERYUSG\n+x4R4UJUeBjhYXLi6EH9Dg30axn8XwDif5Qg/z5aQE4coZz4ivzH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ltSZY\n2BGGMcGvDJjbUjfuAW8CrTEynAkxdoRhjDEmIHaEYYwxJiBWMIwxxgTECoYxxpiAWMEwxhgTECsY\nxhhjAmIFwxhjTED+PzCTROuSYv2mAAAAAElFTkSuQmCC\n", + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "z = np.linspace(zmin, zmax, 1000)\n", + "plt.plot(z, phi(z))\n", + "plt.xlabel('Z position [cm]')\n", + "plt.ylabel('Flux [n/src]')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "As you might expect, we get a rough cosine shape but with a flux depression in the middle due to the boron slab that we introduced. To get a more accurate distribution, we'd likely need to use a higher order expansion.\n", + "\n", + "One more thing we can do is confirm that integrating the distribution gives us the same value as the first moment (since $P_0(z') = 1$). This can easily be done by numerically integrating using the trapezoidal rule:" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "36.434786672754925" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "np.trapz(phi(z), z)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In addition to being able to tally Legendre moments, there are also functional expansion filters available for spherical harmonics (`SphericalHarmonicsFilter`) and Zernike polynomials over a unit disk (`ZernikeFilter`). A separate `LegendreFilter` class can also be used for determining Legendre scattering moments (i.e., an expansion of the scattering cosine, $\\mu$)." + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.2" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/openmc/filter_expansion.py b/openmc/filter_expansion.py index 20bb08e77c..f6e808dd2b 100644 --- a/openmc/filter_expansion.py +++ b/openmc/filter_expansion.py @@ -226,17 +226,22 @@ class SpatialLegendreFilter(ExpansionFilter): class SphericalHarmonicsFilter(ExpansionFilter): r"""Score spherical harmonic expansion moments up to specified order. + This filter allows you to obtain real spherical harmonic moments of either + the particle's direction or the cosine of the scattering angle. Specifying a + filter with order :math:`\ell` tallies moments for all orders from 0 to + :math:`\ell`. + Parameters ---------- order : int - Maximum spherical harmonics order + Maximum spherical harmonics order, :math:`\ell` filter_id : int or None Unique identifier for the filter Attributes ---------- order : int - Maximum spherical harmonics order + Maximum spherical harmonics order, :math:`\ell` id : int Unique identifier for the filter cosine : {'scatter', 'particle'} diff --git a/src/math.F90 b/src/math.F90 index 1d7d0bfaf3..ce3c9b8073 100644 --- a/src/math.F90 +++ b/src/math.F90 @@ -181,7 +181,7 @@ contains end function calc_pn !=============================================================================== -! CALC_RN calculates the n-th order spherical harmonics for a given angle +! CALC_RN calculates the n-th order real spherical harmonics for a given angle ! (in terms of (u,v,w)). All Rn,m values are provided (where -n<=m<=n) !=============================================================================== diff --git a/src/tallies/tally_filter_sph_harm.F90 b/src/tallies/tally_filter_sph_harm.F90 index 2d3c0bf6dd..5cd3f59c3b 100644 --- a/src/tallies/tally_filter_sph_harm.F90 +++ b/src/tallies/tally_filter_sph_harm.F90 @@ -24,7 +24,8 @@ module tally_filter_sph_harm integer, parameter :: COSINE_PARTICLE = 2 !=============================================================================== -! LEGENDREFILTER gives Legendre moments of the change in scattering angle +! SPHERICALHARMONICSFILTER gives spherical harmonics expansion moments of a +! tally score !=============================================================================== type, public, extends(TallyFilter) :: SphericalHarmonicsFilter @@ -149,7 +150,7 @@ contains order = f % order class default err = E_INVALID_TYPE - call set_errmsg("Tried to get order on a non-expansion filter.") + call set_errmsg("Not a spherical harmonics filter.") end select end if end function openmc_sphharm_filter_get_order @@ -183,7 +184,7 @@ contains class default err = E_INVALID_TYPE - call set_errmsg("Tried to get order on a non-expansion filter.") + call set_errmsg("Not a spherical harmonics filter.") end select end if end function openmc_sphharm_filter_get_cosine @@ -203,7 +204,7 @@ contains f % n_bins = (order + 1)**2 class default err = E_INVALID_TYPE - call set_errmsg("Tried to set order on a non-expansion filter.") + call set_errmsg("Not a spherical harmonics filter.") end select end if end function openmc_sphharm_filter_set_order @@ -233,7 +234,7 @@ contains class default err = E_INVALID_TYPE - call set_errmsg("Tried to get order on a non-expansion filter.") + call set_errmsg("Not a spherical harmonics filter.") end select end if end function openmc_sphharm_filter_set_cosine diff --git a/src/tallies/tally_filter_sptl_legendre.F90 b/src/tallies/tally_filter_sptl_legendre.F90 index 29dd848eaf..d6594d05a9 100644 --- a/src/tallies/tally_filter_sptl_legendre.F90 +++ b/src/tallies/tally_filter_sptl_legendre.F90 @@ -25,7 +25,8 @@ module tally_filter_sptl_legendre integer, parameter :: AXIS_Z = 3 !=============================================================================== -! SpatialLEGENDREFILTER gives Legendre moments +! SPATIALLEGENDREFILTER gives Legendre moments of the particle's normalized +! position along an axis !=============================================================================== type, public, extends(TallyFilter) :: SpatialLegendreFilter @@ -97,18 +98,20 @@ contains subroutine to_statepoint(this, filter_group) class(SpatialLegendreFilter), intent(in) :: this integer(HID_T), intent(in) :: filter_group + character(kind=C_CHAR) :: axis call write_dataset(filter_group, "type", "spatiallegendre") call write_dataset(filter_group, "n_bins", this % n_bins) call write_dataset(filter_group, "order", this % order) select case (this % axis) case (AXIS_X) - call write_dataset(filter_group, 'axis', 'x') + axis = 'x' case (AXIS_Y) - call write_dataset(filter_group, 'axis', 'y') + axis = 'y' case (AXIS_Z) - call write_dataset(filter_group, 'axis', 'z') + axis = 'z' end select + call write_dataset(filter_group, 'axis', axis) call write_dataset(filter_group, 'min', this % min) call write_dataset(filter_group, 'max', this % max) end subroutine to_statepoint @@ -118,7 +121,18 @@ contains integer, intent(in) :: bin character(MAX_LINE_LEN) :: label - label = "Legendre expansion, P" // trim(to_str(bin - 1)) + character(1) :: axis + + select case (this % axis) + case (AXIS_X) + axis = 'x' + case (AXIS_Y) + axis = 'y' + case (AXIS_Z) + axis = 'z' + end select + label = "Legendre expansion, " // axis // " axis, P" // & + trim(to_str(bin - 1)) end function text_label !=============================================================================== @@ -138,7 +152,7 @@ contains order = f % order class default err = E_INVALID_TYPE - call set_errmsg("Tried to get order on a non-expansion filter.") + call set_errmsg("Not a spatial Legendre filter.") end select end if end function openmc_spatial_legendre_filter_get_order @@ -158,7 +172,7 @@ contains f % n_bins = order + 1 class default err = E_INVALID_TYPE - call set_errmsg("Tried to set order on a non-expansion filter.") + call set_errmsg("Not a spatial Legendre filter.") end select end if end function openmc_spatial_legendre_filter_set_order @@ -182,7 +196,7 @@ contains max = f % max class default err = E_INVALID_TYPE - call set_errmsg("Tried to set order on a non-expansion filter.") + call set_errmsg("Not a spatial Legendre filter.") end select end if end function openmc_spatial_legendre_filter_get_params @@ -206,7 +220,7 @@ contains if (present(max)) f % max = max class default err = E_INVALID_TYPE - call set_errmsg("Tried to set order on a non-expansion filter.") + call set_errmsg("Not a spatial Legendre filter.") end select end if end function openmc_spatial_legendre_filter_set_params diff --git a/src/tallies/tally_filter_zernike.F90 b/src/tallies/tally_filter_zernike.F90 index bf172a6e4f..19b7cd980a 100644 --- a/src/tallies/tally_filter_zernike.F90 +++ b/src/tallies/tally_filter_zernike.F90 @@ -129,7 +129,7 @@ contains order = f % order class default err = E_INVALID_TYPE - call set_errmsg("Tried to get order on a non-expansion filter.") + call set_errmsg("Not a Zernike filter.") end select end if end function openmc_zernike_filter_get_order @@ -152,7 +152,7 @@ contains r = f % r class default err = E_INVALID_TYPE - call set_errmsg("Tried to get order on a non-expansion filter.") + call set_errmsg("Not a Zernike filter.") end select end if end function openmc_zernike_filter_get_params @@ -172,7 +172,7 @@ contains f % n_bins = ((order + 1)*(order + 2))/2 class default err = E_INVALID_TYPE - call set_errmsg("Tried to set order on a non-expansion filter.") + call set_errmsg("Not a Zernike filter.") end select end if end function openmc_zernike_filter_set_order @@ -195,7 +195,7 @@ contains if (present(r)) f % r = r class default err = E_INVALID_TYPE - call set_errmsg("Tried to get order on a non-expansion filter.") + call set_errmsg("Not a Zernike filter.") end select end if end function openmc_zernike_filter_set_params From b28f6f270187c70c820810918eed2bb60a97ea01 Mon Sep 17 00:00:00 2001 From: liangjg Date: Tue, 3 Apr 2018 21:17:07 -0400 Subject: [PATCH 154/231] updated for tallying currents with meshsurface filter --- docs/source/usersguide/tallies.rst | 4 +- examples/jupyter/tally-arithmetic.ipynb | 96 ++++++++++--------------- src/input_xml.F90 | 3 + 3 files changed, 42 insertions(+), 61 deletions(-) diff --git a/docs/source/usersguide/tallies.rst b/docs/source/usersguide/tallies.rst index 3a742b59e8..e0f8ab1797 100644 --- a/docs/source/usersguide/tallies.rst +++ b/docs/source/usersguide/tallies.rst @@ -261,7 +261,7 @@ The following tables show all valid scores: +----------------------+---------------------------------------------------+ |Score | Description | +======================+===================================================+ - |current |Used in combination with a mesh filter: | + |current |Used in combination with a meshsurface filter: | | |Partial currents on the boundaries of each cell in | | |a mesh. It may not be used in conjunction with any | | |other score. Only energy and mesh filters may be | @@ -269,7 +269,7 @@ The following tables show all valid scores: | |Used in combination with a surface filter: | | |Net currents on any surface previously defined in | | |the geometry. It may be used along with any other | - | |filter, except mesh filters. | + | |filter, except meshsurface filters. | | |Surfaces can alternatively be defined with cell | | |from and cell filters thereby resulting in tallying| | |partial currents. | diff --git a/examples/jupyter/tally-arithmetic.ipynb b/examples/jupyter/tally-arithmetic.ipynb index 391dc809a7..5e904759cf 100644 --- a/examples/jupyter/tally-arithmetic.ipynb +++ b/examples/jupyter/tally-arithmetic.ipynb @@ -287,18 +287,7 @@ "metadata": { "collapsed": false }, - "outputs": [ - { - "data": { - "text/plain": [ - "0" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# Run openmc in plotting mode\n", "openmc.plot_geometry(output=False)" @@ -313,7 +302,7 @@ "outputs": [ { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6AgMAAAD1grKuAAAABGdBTUEAALGPC/xhBQA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PTzjvY/v9gEOHz58+PBX+6v/f/wPvnd54f3j6venE/yl769Xv7+j3x/o98/V\n32/o9+fl389Xnx+g5x/o+Qt6/oOeP6HnX+j5G3z+h54/ouefV5/foufP6Pk3ev4On/+j9w/o/Qd6\n/4Le/6D3T/D9V67Y/ZsVQBq+s+8f0ftP+P41axXguP9NWgDuu/Cdfv+N3r/D9/9TAID+A7T/Ae2/\ngPs/0P4TtP8F7r9J3AIO9P+g/Udw/9Oygbf7r9D+L7j/DO1/Q/vv4P4/tP8Q7n9E+y/h/k+0/xTu\nf4X7b+H+X7T/+BPuf3aM8OHDhw8fPnz4w/4vzcvgeY10sY0AAAAldEVYdGRhdGU6Y3JlYXRlADIw\nMTgtMDQtMDNUMjE6MTE6MzgtMDQ6MDD1dVTHAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE4LTA0LTAz\nVDIxOjExOjM4LTA0OjAwhCjsewAAAABJRU5ErkJggg==\n", "text/plain": [ "" ] @@ -392,21 +381,21 @@ "mesh.dimension = [1, 1, 1]\n", "mesh.lower_left = [-0.63, -0.63, -100.]\n", "mesh.width = [1.26, 1.26, 200.]\n", - "mesh_filter = openmc.MeshFilter(mesh)\n", + "meshsurface_filter = openmc.MeshSurfaceFilter(mesh)\n", "\n", "# Instantiate thermal, fast, and total leakage tallies\n", "leak = openmc.Tally(name='leakage')\n", - "leak.filters = [mesh_filter]\n", + "leak.filters = [meshsurface_filter]\n", "leak.scores = ['current']\n", "tallies_file.append(leak)\n", "\n", "thermal_leak = openmc.Tally(name='thermal leakage')\n", - "thermal_leak.filters = [mesh_filter, openmc.EnergyFilter([0., 0.625])]\n", + "thermal_leak.filters = [meshsurface_filter, openmc.EnergyFilter([0., 0.625])]\n", "thermal_leak.scores = ['current']\n", "tallies_file.append(thermal_leak)\n", "\n", "fast_leak = openmc.Tally(name='fast leakage')\n", - "fast_leak.filters = [mesh_filter, openmc.EnergyFilter([0.625, 20.0e6])]\n", + "fast_leak.filters = [meshsurface_filter, openmc.EnergyFilter([0.625, 20.0e6])]\n", "fast_leak.scores = ['current']\n", "tallies_file.append(fast_leak)" ] @@ -504,11 +493,11 @@ "name": "stderr", "output_type": "stream", "text": [ - "/home/romano/openmc/openmc/mixin.py:61: IDWarning: Another EnergyFilter instance already exists with id=6.\n", + "/home/liangjg/.local/lib/python3.5/site-packages/openmc-0.10.0-py3.5.egg/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=6.\n", " warn(msg, IDWarning)\n", - "/home/romano/openmc/openmc/mixin.py:61: IDWarning: Another CellFilter instance already exists with id=3.\n", + "/home/liangjg/.local/lib/python3.5/site-packages/openmc-0.10.0-py3.5.egg/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=3.\n", " warn(msg, IDWarning)\n", - "/home/romano/openmc/openmc/mixin.py:61: IDWarning: Another CellFilter instance already exists with id=2.\n", + "/home/liangjg/.local/lib/python3.5/site-packages/openmc-0.10.0-py3.5.egg/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=2.\n", " warn(msg, IDWarning)\n" ] } @@ -563,24 +552,25 @@ " %%%%%%%%%%%\n", "\n", " | The OpenMC Monte Carlo Code\n", - " Copyright | 2011-2017 Massachusetts Institute of Technology\n", + " Copyright | 2011-2018 Massachusetts Institute of Technology\n", " License | http://openmc.readthedocs.io/en/latest/license.html\n", - " Version | 0.9.0\n", - " Git SHA1 | 9b7cebf7bc34d60e0f1750c3d6cb103df11e8dc4\n", - " Date/Time | 2017-12-04 20:43:15\n", - " OpenMP Threads | 4\n", + " Version | 0.10.0\n", + " Git SHA1 | 47fbf8282ea94c138f75219bd10fdb31501d3fb7\n", + " Date/Time | 2018-04-03 21:12:27\n", + " MPI Processes | 1\n", + " OpenMP Threads | 20\n", "\n", " Reading settings XML file...\n", " Reading cross sections XML file...\n", " Reading materials XML file...\n", " Reading geometry XML file...\n", " Building neighboring cells lists for each surface...\n", - " Reading U235 from /home/romano/openmc/scripts/nndc_hdf5/U235.h5\n", - " Reading U238 from /home/romano/openmc/scripts/nndc_hdf5/U238.h5\n", - " Reading O16 from /home/romano/openmc/scripts/nndc_hdf5/O16.h5\n", - " Reading H1 from /home/romano/openmc/scripts/nndc_hdf5/H1.h5\n", - " Reading B10 from /home/romano/openmc/scripts/nndc_hdf5/B10.h5\n", - " Reading Zr90 from /home/romano/openmc/scripts/nndc_hdf5/Zr90.h5\n", + " Reading U235 from /home/liangjg/nucdata/nndc_hdf5/U235.h5\n", + " Reading U238 from /home/liangjg/nucdata/nndc_hdf5/U238.h5\n", + " Reading O16 from /home/liangjg/nucdata/nndc_hdf5/O16.h5\n", + " Reading H1 from /home/liangjg/nucdata/nndc_hdf5/H1.h5\n", + " Reading B10 from /home/liangjg/nucdata/nndc_hdf5/B10.h5\n", + " Reading Zr90 from /home/liangjg/nucdata/nndc_hdf5/Zr90.h5\n", " Maximum neutron transport energy: 2.00000E+07 eV for U235\n", " Reading tallies XML file...\n", " Writing summary.h5 file...\n", @@ -614,20 +604,20 @@ "\n", " =======================> TIMING STATISTICS <=======================\n", "\n", - " Total time for initialization = 5.6782E-01 seconds\n", - " Reading cross sections = 5.3276E-01 seconds\n", - " Total time in simulation = 6.4149E+00 seconds\n", - " Time in transport only = 6.2767E+00 seconds\n", - " Time in inactive batches = 6.8747E-01 seconds\n", - " Time in active batches = 5.7274E+00 seconds\n", - " Time synchronizing fission bank = 2.7492E-03 seconds\n", - " Sampling source sites = 1.9584E-03 seconds\n", - " SEND/RECV source sites = 7.4113E-04 seconds\n", - " Time accumulating tallies = 1.0576E-04 seconds\n", - " Total time for finalization = 2.2075E-03 seconds\n", - " Total time elapsed = 7.0056E+00 seconds\n", - " Calculation Rate (inactive) = 18182.5 neutrons/second\n", - " Calculation Rate (active) = 6547.45 neutrons/second\n", + " Total time for initialization = 4.9090E-01 seconds\n", + " Reading cross sections = 4.2387E-01 seconds\n", + " Total time in simulation = 1.4928E+00 seconds\n", + " Time in transport only = 1.3545E+00 seconds\n", + " Time in inactive batches = 1.3625E-01 seconds\n", + " Time in active batches = 1.3565E+00 seconds\n", + " Time synchronizing fission bank = 2.4053E-03 seconds\n", + " Sampling source sites = 1.6466E-03 seconds\n", + " SEND/RECV source sites = 5.6159E-04 seconds\n", + " Time accumulating tallies = 3.3647E-04 seconds\n", + " Total time for finalization = 1.6066E-02 seconds\n", + " Total time elapsed = 2.0336E+00 seconds\n", + " Calculation Rate (inactive) = 91743.2 neutrons/second\n", + " Calculation Rate (active) = 27644.5 neutrons/second\n", "\n", " ============================> RESULTS <============================\n", "\n", @@ -638,16 +628,6 @@ " Leakage Fraction = 0.01717 +/- 0.00107\n", "\n" ] - }, - { - "data": { - "text/plain": [ - "0" - ] - }, - "execution_count": 21, - "metadata": {}, - "output_type": "execute_result" } ], "source": [ @@ -741,8 +721,7 @@ "\n", "# Get the leakage tally\n", "leak = sp.get_tally(name='leakage')\n", - "leak = leak.summation(filter_type=openmc.SurfaceFilter, remove_filter=True)\n", - "leak = leak.summation(filter_type=openmc.MeshFilter, remove_filter=True)\n", + "leak = leak.summation(filter_type=openmc.MeshSurfaceFilter, remove_filter=True)\n", "\n", "# Compute k-infinity using tally arithmetic\n", "keff = fiss_rate / (abs_rate + leak)\n", @@ -812,8 +791,7 @@ "# Compute resonance escape probability using tally arithmetic\n", "therm_abs_rate = sp.get_tally(name='therm. abs. rate')\n", "thermal_leak = sp.get_tally(name='thermal leakage')\n", - "thermal_leak = thermal_leak.summation(filter_type=openmc.SurfaceFilter, remove_filter=True)\n", - "thermal_leak = thermal_leak.summation(filter_type=openmc.MeshFilter, remove_filter=True)\n", + "thermal_leak = thermal_leak.summation(filter_type=openmc.MeshSurfaceFilter, remove_filter=True)\n", "res_esc = (therm_abs_rate + thermal_leak) / (abs_rate + thermal_leak)\n", "res_esc.get_pandas_dataframe()" ] diff --git a/src/input_xml.F90 b/src/input_xml.F90 index a29bb08e83..63e5cd7a49 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -2853,6 +2853,9 @@ contains call fatal_error("Cannot tally other scores in the & &same tally as surface currents") end if + else + call fatal_error("Cannot tally currents without surface & + &type filters") end if case ('events') From 9ce837330a27440e217c0cf96a5eb4c0ee89595d Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 4 Apr 2018 22:23:20 -0500 Subject: [PATCH 155/231] Fix bug in calc_zn and add better comments (huge thanks to @GiudGiud) --- src/math.F90 | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/src/math.F90 b/src/math.F90 index ce3c9b8073..35855c6148 100644 --- a/src/math.F90 +++ b/src/math.F90 @@ -580,10 +580,10 @@ contains !=============================================================================== subroutine calc_zn(n, rho, phi, zn) - ! This efficient method for calculation R(m,n) is taken from - ! Chong, C. W., Raveendran, P., & Mukundan, R. (2003). A comparative - ! analysis of algorithms for fast computation of Zernike moments. - ! Pattern Recognition, 36(3), 731-742. + ! This procedure uses the modified Kintner's method for calculating Zernike + ! polynomials as outlined in Chong, C. W., Raveendran, P., & Mukundan, + ! R. (2003). A comparative analysis of algorithms for fast computation of + ! Zernike moments. Pattern Recognition, 36(3), 731-742. integer, intent(in) :: n ! Maximum order real(8), intent(in) :: rho ! Radial location in the unit disk @@ -608,7 +608,14 @@ contains ! n == radial degree ! m == azimuthal frequency - ! Deterine vector of sin(n*phi) and cos(n*phi) + ! ========================================================================== + ! Determine vector of sin(n*phi) and cos(n*phi). This takes advantage of the + ! following recurrence relations so that only a single sin/cos have to be + ! evaluated (http://mathworld.wolfram.com/Multiple-AngleFormulas.html) + ! + ! sin(nx) = 2 cos(x) sin((n-1)x) - sin((n-2)x) + ! cos(nx) = 2 cos(x) cos((n-1)x) - cos((n-2)x) + sin_phi = sin(phi) cos_phi = cos(phi) @@ -627,17 +634,20 @@ contains sin_phi_vec(i) = sin_phi_vec(i) * sin_phi end do - ! Calculate R_m_n(rho) - ! Fill the main diagonal first + ! ========================================================================== + ! Calculate R_pq(rho) + + ! Fill the main diagonal first (Eq. 3.9 in Chong) do p = 0, n zn_mat(p+1, p+1) = rho**p end do - ! Fill in the second diagonal + ! Fill in the second diagonal (Eq. 3.10 in Chong) do q = 0, n-2 zn_mat(q+2+1, q+1) = (q+2) * zn_mat(q+2+1, q+2+1) - (q+1) * zn_mat(q+1, q+1) end do - ! Fill in the rest of the values using the original results + + ! Fill in the rest of the values using the original results (Eq. 3.8 in Chong) do p = 4, n k2 = 2 * p * (p - 1) * (p - 2) do q = p-4, 0, -2 @@ -651,18 +661,18 @@ contains ! Roll into a single vector for easier computation later ! The vector is ordered (0,0), (1,-1), (1,1), (2,-2), (2,0), ! (2, 2), .... in (n,m) indices - ! Note that the cos and sin vectors are offest by one + ! Note that the cos and sin vectors are offset by one ! sin_phi_vec = [sin(x), sin(2x), sin(3x) ...] ! cos_phi_vec = [1.0, cos(x), cos(2x)... ] i = 1 do p = 0, n do q = -p, p, 2 if (q < 0) then - zn(i) = zn_mat(p+1, abs(q)+1) * sin_phi_vec(p) * SQRT_2N_2(p) + zn(i) = zn_mat(p+1, abs(q)+1) * sin_phi_vec(abs(q)) * SQRT_2N_2(p) else if (q == 0) then zn(i) = zn_mat(p+1, q+1) * SQRT_N_1(p) else - zn(i) = zn_mat(p+1, q+1) * cos_phi_vec(p+1) * SQRT_2N_2(p) + zn(i) = zn_mat(p+1, q+1) * cos_phi_vec(abs(q)+1) * SQRT_2N_2(p) end if i = i + 1 end do From 78b993eda5709af0e074ab85abb85ccf2f93454b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 4 Apr 2018 22:59:15 -0500 Subject: [PATCH 156/231] Change normalization of Zernike filter values --- openmc/filter_expansion.py | 27 +++++++++++++++++++++------ src/tallies/tally_filter_zernike.F90 | 2 +- tests/unit_tests/test_filters.py | 2 +- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/openmc/filter_expansion.py b/openmc/filter_expansion.py index f6e808dd2b..e46bf7be16 100644 --- a/openmc/filter_expansion.py +++ b/openmc/filter_expansion.py @@ -317,12 +317,27 @@ class ZernikeFilter(ExpansionFilter): r"""Score Zernike expansion moments in space up to specified order. This filter allows scores to be multiplied by Zernike polynomials of the - particle's position along a particular axis, normalized to a given unit - circle, up to a user-specified order. Specifying a filter with order N - tallies moments for all radial orders from 0 to N and each azimuthal order - for a given radial order. The ordering of the Zernike polynomial moments - follows the ANSI Z80.28 standard, where bin :math:`j` corresponds to the - radial index :math:`n` and the azimuthal index :math:`m` by + particle's position normalized to a given unit circle, up to a + user-specified order. The Zernike polynomials are defined as + + .. math:: + Z_n^m(\rho, \theta) = R_n^m(\rho) \cos (m\theta) + + and + + .. math:: + Z_n^{-m}(\rho, \theta) = R_n^{-m}(\rho) \sin (m\theta) + + where the radial polynomials are + + .. math:: + R_n^m(\rho) = \sum\limits_{k=0}^{(n-m)/2} \frac{(-1)^k (n-k)!}{k! ( + \frac{n+m}{2} - k)! (\frac{n-m}{2} - k)!} \rho^{n-2k}. + + Specifying a filter with order N tallies moments for all :math:`n` from 0 to + N and each value of :math:`m`. The ordering of the Zernike polynomial + moments follows the ANSI Z80.28 standard, where the one-dimensional index + :math:`j` corresponds to the :math:`n` and :math:`m` by .. math:: j = \frac{n(n + 2) + m}{2}. diff --git a/src/tallies/tally_filter_zernike.F90 b/src/tallies/tally_filter_zernike.F90 index 19b7cd980a..e96a53a7f9 100644 --- a/src/tallies/tally_filter_zernike.F90 +++ b/src/tallies/tally_filter_zernike.F90 @@ -76,7 +76,7 @@ contains do i = 1, this % n_bins call match % bins % push_back(i) - call match % weights % push_back(zn(i) / SQRT_PI) + call match % weights % push_back(zn(i)) end do end subroutine get_all_bins diff --git a/tests/unit_tests/test_filters.py b/tests/unit_tests/test_filters.py index 6060b55d77..488badbfaf 100644 --- a/tests/unit_tests/test_filters.py +++ b/tests/unit_tests/test_filters.py @@ -145,4 +145,4 @@ def test_first_moment(run_in_tmpdir, box_model): assert first_score(leg_sptl_tally) == scatter assert first_score(sph_scat_tally) == scatter assert first_score(sph_flux_tally) == approx(flux) - assert first_score(zernike_tally)*sqrt(pi) == approx(scatter) + assert first_score(zernike_tally) == approx(scatter) From e0e1dc6bd509d9d0eef7ff6fafb39b70c744c541 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 5 Apr 2018 12:15:28 -0500 Subject: [PATCH 157/231] Clarify normalization of Zernike polynomials --- openmc/filter_expansion.py | 13 ++++++++----- src/math.F90 | 6 ++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/openmc/filter_expansion.py b/openmc/filter_expansion.py index e46bf7be16..872eaac9f5 100644 --- a/openmc/filter_expansion.py +++ b/openmc/filter_expansion.py @@ -318,15 +318,15 @@ class ZernikeFilter(ExpansionFilter): This filter allows scores to be multiplied by Zernike polynomials of the particle's position normalized to a given unit circle, up to a - user-specified order. The Zernike polynomials are defined as + user-specified order. The Zernike polynomials follow the definition by `Noll + `_ and are defined as .. math:: - Z_n^m(\rho, \theta) = R_n^m(\rho) \cos (m\theta) + Z_n^m(\rho, \theta) = \sqrt{2n + 2} R_n^m(\rho) \cos (m\theta), \quad m > 0 - and + Z_n^{m}(\rho, \theta) = \sqrt{2n + 2} R_n^{m}(\rho) \sin (m\theta), \quad m < 0 - .. math:: - Z_n^{-m}(\rho, \theta) = R_n^{-m}(\rho) \sin (m\theta) + Z_n^{m}(\rho, \theta) = \sqrt{n + 1} R_n^{m}(\rho), \quad m = 0 where the radial polynomials are @@ -334,6 +334,9 @@ class ZernikeFilter(ExpansionFilter): R_n^m(\rho) = \sum\limits_{k=0}^{(n-m)/2} \frac{(-1)^k (n-k)!}{k! ( \frac{n+m}{2} - k)! (\frac{n-m}{2} - k)!} \rho^{n-2k}. + With this definition, the integral of :math:`(Z_n^m)^2` over the unit disk + is exactly :math:`\pi` for each polynomial. + Specifying a filter with order N tallies moments for all :math:`n` from 0 to N and each value of :math:`m`. The ordering of the Zernike polynomial moments follows the ANSI Z80.28 standard, where the one-dimensional index diff --git a/src/math.F90 b/src/math.F90 index 35855c6148..ee8cd0530b 100644 --- a/src/math.F90 +++ b/src/math.F90 @@ -575,8 +575,10 @@ contains end function calc_rn !=============================================================================== -! CALC_ZN calculates the n-th order Zernike polynomial moment for a given angle -! (rho, theta) location in the unit disk. +! CALC_ZN calculates the n-th order modified Zernike polynomial moment for a +! given angle (rho, theta) location in the unit disk. The normlization of the +! polynomials is such that the integral of Z_pq*Z_pq over the unit disk is +! exactly pi !=============================================================================== subroutine calc_zn(n, rho, phi, zn) From 69f97e6f2c029e0c70ec6eeb832bbaaf71f83434 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 11 Apr 2018 11:41:49 -0500 Subject: [PATCH 158/231] Force analog for tallies with spherical harmonics filter with cosine=scatter --- src/tallies/tally_filter_sph_harm.F90 | 4 ++-- src/tallies/tally_header.F90 | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tallies/tally_filter_sph_harm.F90 b/src/tallies/tally_filter_sph_harm.F90 index 5cd3f59c3b..5c47c2c71f 100644 --- a/src/tallies/tally_filter_sph_harm.F90 +++ b/src/tallies/tally_filter_sph_harm.F90 @@ -20,8 +20,8 @@ module tally_filter_sph_harm public :: openmc_sphharm_filter_set_order public :: openmc_sphharm_filter_set_cosine - integer, parameter :: COSINE_SCATTER = 1 - integer, parameter :: COSINE_PARTICLE = 2 + integer, public, parameter :: COSINE_SCATTER = 1 + integer, public, parameter :: COSINE_PARTICLE = 2 !=============================================================================== ! SPHERICALHARMONICSFILTER gives spherical harmonics expansion moments of a diff --git a/src/tallies/tally_header.F90 b/src/tallies/tally_header.F90 index 29362fee3c..02a578d7e0 100644 --- a/src/tallies/tally_header.F90 +++ b/src/tallies/tally_header.F90 @@ -359,6 +359,9 @@ contains this % estimator = ESTIMATOR_ANALOG type is (SphericalHarmonicsFilter) j = FILTER_SPH_HARMONICS + if (filt % cosine == COSINE_SCATTER) then + this % estimator = ESTIMATOR_ANALOG + end if type is (SpatialLegendreFilter) j = FILTER_SPTL_LEGENDRE this % estimator = ESTIMATOR_COLLISION From 8a6c6d139813c3abf6836ab760b95a8a97afdd1b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 1 Apr 2018 07:50:14 -0500 Subject: [PATCH 159/231] Add C API bindings to create/modify meshes (and filters) --- docs/source/pythonapi/capi.rst | 3 + include/openmc.h | 8 + openmc/capi/__init__.py | 1 + openmc/capi/cell.py | 2 +- openmc/capi/filter.py | 39 ++++- openmc/capi/mesh.py | 172 ++++++++++++++++++++ src/cmfd_input.F90 | 2 +- src/mesh_header.F90 | 197 ++++++++++++++++++++++- src/tallies/tally_filter_mesh.F90 | 56 ++++--- src/tallies/tally_filter_meshsurface.F90 | 60 ++++--- tests/unit_tests/test_capi.py | 35 ++++ 11 files changed, 519 insertions(+), 56 deletions(-) create mode 100644 openmc/capi/mesh.py diff --git a/docs/source/pythonapi/capi.rst b/docs/source/pythonapi/capi.rst index f358233992..38ce61fb35 100644 --- a/docs/source/pythonapi/capi.rst +++ b/docs/source/pythonapi/capi.rst @@ -44,5 +44,8 @@ Classes EnergyFilter MaterialFilter Material + Mesh + MeshFilter + MeshSurfaceFilter Nuclide Tally diff --git a/include/openmc.h b/include/openmc.h index 1c2106432a..785aaeba53 100644 --- a/include/openmc.h +++ b/include/openmc.h @@ -53,7 +53,15 @@ extern "C" { int openmc_material_set_id(int32_t index, int32_t id); int openmc_material_filter_get_bins(int32_t index, int32_t** bins, int32_t* n); int openmc_material_filter_set_bins(int32_t index, int32_t n, const int32_t* bins); + int openmc_mesh_filter_get_mesh(int32_t index, int32_t* index_mesh); int openmc_mesh_filter_set_mesh(int32_t index, int32_t index_mesh); + int openmc_mesh_get_id(int32_t index, int32_t* id); + int openmc_mesh_get_dimension(int32_t index, int** id, int* n); + int openmc_mesh_get_params(int32_t index, double** ll, double** ur, double** width, int* n); + int openmc_mesh_set_id(int32_t index, int32_t id); + int openmc_mesh_set_dimension(int32_t index, int n, const int* dims); + int openmc_mesh_set_params(int32_t index, const double* ll, const double* ur, const double* width, int n); + int openmc_meshsurface_filter_get_mesh(int32_t index, int32_t* index_mesh); int openmc_meshsurface_filter_set_mesh(int32_t index, int32_t index_mesh); int openmc_next_batch(); int openmc_nuclide_name(int index, char** name); diff --git a/openmc/capi/__init__.py b/openmc/capi/__init__.py index bc173f9946..217e782a84 100644 --- a/openmc/capi/__init__.py +++ b/openmc/capi/__init__.py @@ -43,6 +43,7 @@ from .core import * from .nuclide import * from .material import * from .cell import * +from .mesh import * from .filter import * from .tally import * from .settings import settings diff --git a/openmc/capi/cell.py b/openmc/capi/cell.py index 0ab3f2583e..8f0c0e1bb4 100644 --- a/openmc/capi/cell.py +++ b/openmc/capi/cell.py @@ -44,7 +44,7 @@ class Cell(_FortranObjectWithID): This class exposes a cell that is stored internally in the OpenMC library. To obtain a view of a cell with a given ID, use the - :data:`openmc.capi.nuclides` mapping. + :data:`openmc.capi.cells` mapping. Parameters ---------- diff --git a/openmc/capi/filter.py b/openmc/capi/filter.py index 691ecc09cc..a2b77fa927 100644 --- a/openmc/capi/filter.py +++ b/openmc/capi/filter.py @@ -10,13 +10,14 @@ from . import _dll from .core import _FortranObjectWithID from .error import _error_handler, AllocationError, InvalidIDError from .material import Material +from .mesh import Mesh __all__ = ['Filter', 'AzimuthalFilter', 'CellFilter', 'CellbornFilter', 'CellfromFilter', 'DistribcellFilter', 'DelayedGroupFilter', 'EnergyFilter', 'EnergyoutFilter', 'EnergyFunctionFilter', 'MaterialFilter', 'MeshFilter', - 'MuFilter', 'PolarFilter', 'SurfaceFilter', + 'MeshSurfaceFilter', 'MuFilter', 'PolarFilter', 'SurfaceFilter', 'UniverseFilter', 'filters'] # Tally functions @@ -52,9 +53,15 @@ _dll.openmc_material_filter_get_bins.errcheck = _error_handler _dll.openmc_material_filter_set_bins.argtypes = [c_int32, c_int32, POINTER(c_int32)] _dll.openmc_material_filter_set_bins.restype = c_int _dll.openmc_material_filter_set_bins.errcheck = _error_handler +_dll.openmc_mesh_filter_get_mesh.argtypes = [c_int32, POINTER(c_int32)] +_dll.openmc_mesh_filter_get_mesh.restype = c_int +_dll.openmc_mesh_filter_get_mesh.errcheck = _error_handler _dll.openmc_mesh_filter_set_mesh.argtypes = [c_int32, c_int32] _dll.openmc_mesh_filter_set_mesh.restype = c_int _dll.openmc_mesh_filter_set_mesh.errcheck = _error_handler +_dll.openmc_meshsurface_filter_get_mesh.argtypes = [c_int32, POINTER(c_int32)] +_dll.openmc_meshsurface_filter_get_mesh.restype = c_int +_dll.openmc_meshsurface_filter_get_mesh.errcheck = _error_handler _dll.openmc_meshsurface_filter_set_mesh.argtypes = [c_int32, c_int32] _dll.openmc_meshsurface_filter_set_mesh.restype = c_int _dll.openmc_meshsurface_filter_set_mesh.errcheck = _error_handler @@ -190,10 +197,40 @@ class MaterialFilter(Filter): class MeshFilter(Filter): filter_type = 'mesh' + def __init__(self, mesh=None, uid=None, new=True, index=None): + super().__init__(uid, new, index) + if mesh is not None: + self.mesh = mesh + + @property + def mesh(self): + index_mesh = c_int32() + _dll.openmc_mesh_filter_get_mesh(self._index, index_mesh) + return Mesh(index=index_mesh.value) + + @mesh.setter + def mesh(self, mesh): + _dll.openmc_mesh_filter_set_mesh(self._index, mesh._index) + class MeshSurfaceFilter(Filter): filter_type = 'meshsurface' + def __init__(self, mesh=None, uid=None, new=True, index=None): + super().__init__(uid, new, index) + if mesh is not None: + self.mesh = mesh + + @property + def mesh(self): + index_mesh = c_int32() + _dll.openmc_meshsurface_filter_get_mesh(self._index, index_mesh) + return Mesh(index=index_mesh.value) + + @mesh.setter + def mesh(self, mesh): + _dll.openmc_meshsurface_filter_set_mesh(self._index, mesh._index) + class MuFilter(Filter): filter_type = 'mu' diff --git a/openmc/capi/mesh.py b/openmc/capi/mesh.py new file mode 100644 index 0000000000..c7430f9f3e --- /dev/null +++ b/openmc/capi/mesh.py @@ -0,0 +1,172 @@ +from collections.abc import Mapping, Iterable +from ctypes import c_int, c_int32, c_double, POINTER +from weakref import WeakValueDictionary + +import numpy as np +from numpy.ctypeslib import as_array + +from . import _dll +from .core import _FortranObjectWithID +from .error import _error_handler, AllocationError, InvalidIDError +from .material import Material + +__all__ = ['Mesh', 'meshes'] + +# Mesh functions +_dll.openmc_extend_meshes.argtypes = [c_int32, POINTER(c_int32), POINTER(c_int32)] +_dll.openmc_extend_meshes.restype = c_int +_dll.openmc_extend_meshes.errcheck = _error_handler +_dll.openmc_mesh_get_id.argtypes = [c_int32, POINTER(c_int32)] +_dll.openmc_mesh_get_id.restype = c_int +_dll.openmc_mesh_get_id.errcheck = _error_handler +_dll.openmc_mesh_get_dimension.argtypes = [c_int32, POINTER(POINTER(c_int)), POINTER(c_int)] +_dll.openmc_mesh_get_dimension.restype = c_int +_dll.openmc_mesh_get_dimension.errcheck = _error_handler +_dll.openmc_mesh_get_params.argtypes = [ + c_int32, POINTER(POINTER(c_double)), POINTER(POINTER(c_double)), + POINTER(POINTER(c_double)), POINTER(c_int)] +_dll.openmc_mesh_get_params.restype = c_int +_dll.openmc_mesh_get_params.errcheck = _error_handler +_dll.openmc_mesh_set_id.argtypes = [c_int32, c_int32] +_dll.openmc_mesh_set_id.restype = c_int +_dll.openmc_mesh_set_id.errcheck = _error_handler +_dll.openmc_mesh_set_dimension.argtypes = [c_int32, c_int, POINTER(c_int)] +_dll.openmc_mesh_set_dimension.restype = c_int +_dll.openmc_mesh_set_dimension.errcheck = _error_handler +_dll.openmc_mesh_set_params.argtypes = [ + c_int32, c_int, POINTER(c_double), POINTER(c_double), POINTER(c_double)] +_dll.openmc_mesh_set_params.restype = c_int +_dll.openmc_mesh_set_params.errcheck = _error_handler +_dll.openmc_get_mesh_index.argtypes = [c_int32, POINTER(c_int32)] +_dll.openmc_get_mesh_index.restype = c_int +_dll.openmc_get_mesh_index.errcheck = _error_handler + + +class Mesh(_FortranObjectWithID): + """Mesh stored internally. + + This class exposes a mesh that is stored internally in the OpenMC + library. To obtain a view of a mesh with a given ID, use the + :data:`openmc.capi.meshes` mapping. + + Parameters + ---------- + index : int + Index in the `meshes` array. + + Attributes + ---------- + id : int + ID of the mesh + + """ + __instances = WeakValueDictionary() + + def __new__(cls, uid=None, new=True, index=None): + mapping = meshes + if index is None: + if new: + # Determine ID to assign + if uid is None: + uid = max(mapping, default=0) + 1 + else: + if uid in mapping: + raise AllocationError('A mesh with ID={} has already ' + 'been allocated.'.format(uid)) + + index = c_int32() + _dll.openmc_extend_meshes(1, index, None) + index = index.value + else: + index = mapping[uid]._index + + if index not in cls.__instances: + instance = super().__new__(cls) + instance._index = index + if uid is not None: + instance.id = uid + cls.__instances[index] = instance + + return cls.__instances[index] + + @property + def id(self): + mesh_id = c_int32() + _dll.openmc_mesh_get_id(self._index, mesh_id) + return mesh_id.value + + @id.setter + def id(self, mesh_id): + _dll.openmc_mesh_set_id(self._index, mesh_id) + + @property + def dimension(self): + dims = POINTER(c_int)() + n = c_int() + _dll.openmc_mesh_get_dimension(self._index, dims, n) + return tuple(as_array(dims, (n.value,))) + + @dimension.setter + def dimension(self, dimension): + n = len(dimension) + dimension = (c_int*n)(*dimension) + _dll.openmc_mesh_set_dimension(self._index, n, dimension) + + @property + def lower_left(self): + return self._get_parameters()[0] + + @property + def upper_right(self): + return self._get_parameters()[1] + + @property + def width(self): + return self._get_parameters()[2] + + def _get_parameters(self): + ll = POINTER(c_double)() + ur = POINTER(c_double)() + w = POINTER(c_double)() + n = c_int() + _dll.openmc_mesh_get_params(self._index, ll, ur, w, n) + return ( + as_array(ll, (n.value,)), + as_array(ur, (n.value,)), + as_array(w, (n.value,)) + ) + + def set_parameters(self, lower_left=None, upper_right=None, width=None): + if lower_left is not None: + n = len(lower_left) + lower_left = (c_double*n)(*lower_left) + if upper_right is not None: + n = len(upper_right) + upper_right = (c_double*n)(*upper_right) + if width is not None: + n = len(width) + width = (c_double*n)(*width) + _dll.openmc_mesh_set_params(self._index, n, lower_left, upper_right, width) + + +class _MeshMapping(Mapping): + def __getitem__(self, key): + index = c_int32() + try: + _dll.openmc_get_mesh_index(key, index) + except (AllocationError, InvalidIDError) as e: + # __contains__ expects a KeyError to work correctly + raise KeyError(str(e)) + return Mesh(index=index.value) + + def __iter__(self): + for i in range(len(self)): + yield Mesh(index=i + 1).id + + def __len__(self): + return c_int32.in_dll(_dll, 'n_meshes').value + + def __repr__(self): + return repr(dict(self)) + +meshes = _MeshMapping() diff --git a/src/cmfd_input.F90 b/src/cmfd_input.F90 index 86f4e2400e..40b4abf572 100644 --- a/src/cmfd_input.F90 +++ b/src/cmfd_input.F90 @@ -278,7 +278,7 @@ contains m % id = i_start ! Set mesh type to rectangular - m % type = LATTICE_RECT + m % type = MESH_REGULAR ! Get pointer to mesh XML node node_mesh = root % child("mesh") diff --git a/src/mesh_header.F90 b/src/mesh_header.F90 index 8a2d61fd92..b1751a4676 100644 --- a/src/mesh_header.F90 +++ b/src/mesh_header.F90 @@ -6,7 +6,7 @@ module mesh_header use constants use dict_header, only: DictIntInt - use error, only: warning, fatal_error + use error use hdf5_interface use string, only: to_str, to_lower use xml_interface @@ -15,6 +15,13 @@ module mesh_header private public :: free_memory_mesh public :: openmc_extend_meshes + public :: openmc_get_mesh_index + public :: openmc_mesh_get_id + public :: openmc_mesh_get_dimension + public :: openmc_mesh_get_params + public :: openmc_mesh_set_id + public :: openmc_mesh_set_dimension + public :: openmc_mesh_set_params !=============================================================================== ! STRUCTUREDMESH represents a tessellation of n-dimensional Euclidean space by @@ -23,13 +30,13 @@ module mesh_header type, public :: RegularMesh integer :: id = -1 ! user-specified id - integer :: type ! rectangular, hexagonal - integer :: n_dimension ! rank of mesh + integer :: type = MESH_REGULAR ! rectangular, hexagonal + integer(C_INT) :: n_dimension ! rank of mesh real(8) :: volume_frac ! volume fraction of each cell - integer, allocatable :: dimension(:) ! number of cells in each direction - real(8), allocatable :: lower_left(:) ! lower-left corner of mesh - real(8), allocatable :: upper_right(:) ! upper-right corner of mesh - real(8), allocatable :: width(:) ! width of each mesh cell + integer(C_INT), allocatable :: dimension(:) ! number of cells in each direction + real(C_DOUBLE), allocatable :: lower_left(:) ! lower-left corner of mesh + real(C_DOUBLE), allocatable :: upper_right(:) ! upper-right corner of mesh + real(C_DOUBLE), allocatable :: width(:) ! width of each mesh cell contains procedure :: from_xml => regular_from_xml procedure :: get_bin => regular_get_bin @@ -592,4 +599,180 @@ contains err = 0 end function openmc_extend_meshes + + function openmc_get_mesh_index(id, index) result(err) bind(C) + ! Return the index in the meshes array of a mesh with a given ID + integer(C_INT32_T), value :: id + integer(C_INT32_T), intent(out) :: index + integer(C_INT) :: err + + if (allocated(meshes)) then + if (mesh_dict % has(id)) then + index = mesh_dict % get(id) + err = 0 + else + err = E_INVALID_ID + call set_errmsg("No mesh exists with ID=" // trim(to_str(id)) // ".") + end if + else + err = E_ALLOCATE + call set_errmsg("Memory has not been allocated for meshes.") + end if + end function openmc_get_mesh_index + + + function openmc_mesh_get_id(index, id) result(err) bind(C) + ! Return the ID of a mesh + integer(C_INT32_T), value :: index + integer(C_INT32_T), intent(out) :: id + integer(C_INT) :: err + + if (index >= 1 .and. index <= size(meshes)) then + id = meshes(index) % id + err = 0 + else + err = E_OUT_OF_BOUNDS + call set_errmsg("Index in meshes array is out of bounds.") + end if + end function openmc_mesh_get_id + + + function openmc_mesh_set_id(index, id) result(err) bind(C) + ! Set the ID of a mesh + integer(C_INT32_T), value, intent(in) :: index + integer(C_INT32_T), value, intent(in) :: id + integer(C_INT) :: err + + if (index >= 1 .and. index <= n_meshes) then + meshes(index) % id = id + call mesh_dict % set(id, index) + err = 0 + else + err = E_OUT_OF_BOUNDS + call set_errmsg("Index in meshes array is out of bounds.") + end if + end function openmc_mesh_set_id + + + function openmc_mesh_get_dimension(index, dims, n) result(err) bind(C) + ! Get the dimension of a mesh + integer(C_INT32_T), value, intent(in) :: index + type(C_PTR), intent(out) :: dims + integer(C_INT), intent(out) :: n + integer(C_INT) :: err + + if (index >= 1 .and. index <= n_meshes) then + dims = C_LOC(meshes(index) % dimension) + n = meshes(index) % n_dimension + err = 0 + else + err = E_OUT_OF_BOUNDS + call set_errmsg("Index in meshes array is out of bounds.") + end if + end function openmc_mesh_get_dimension + + + function openmc_mesh_set_dimension(index, n, dims) result(err) bind(C) + ! Set the dimension of a mesh + integer(C_INT32_T), value, intent(in) :: index + integer(C_INT), value, intent(in) :: n + integer(C_INT), intent(in) :: dims(n) + integer(C_INT) :: err + + if (index >= 1 .and. index <= n_meshes) then + associate (m => meshes(index)) + if (allocated(m % dimension)) deallocate (m % dimension) + if (allocated(m % lower_left)) deallocate (m % lower_left) + if (allocated(m % upper_right)) deallocate (m % upper_right) + if (allocated(m % width)) deallocate (m % width) + + m % n_dimension = n + allocate(m % dimension(n)) + allocate(m % lower_left(n)) + allocate(m % upper_right(n)) + allocate(m % width(n)) + + ! Copy dimension + m % dimension(:) = dims + end associate + err = 0 + else + err = E_OUT_OF_BOUNDS + call set_errmsg("Index in meshes array is out of bounds.") + end if + end function openmc_mesh_set_dimension + + + function openmc_mesh_get_params(index, ll, ur, width, n) result(err) bind(C) + ! Get the mesh parameters + integer(C_INT32_T), value, intent(in) :: index + type(C_PTR), intent(out) :: ll + type(C_PTR), intent(out) :: ur + type(C_PTR), intent(out) :: width + integer(C_INT), intent(out) :: n + integer(C_INT) :: err + + err = 0 + if (index >= 1 .and. index <= n_meshes) then + associate (m => meshes(index)) + if (allocated(m % lower_left)) then + ll = C_LOC(m % lower_left) + ur = C_LOC(m % upper_right) + width = C_LOC(m % width) + n = m % n_dimension + else + err = E_ALLOCATE + call set_errmsg("Mesh parameters have not been set.") + end if + end associate + else + err = E_OUT_OF_BOUNDS + call set_errmsg("Index in meshes array is out of bounds.") + end if + end function openmc_mesh_get_params + + + function openmc_mesh_set_params(index, n, ll, ur, width) result(err) bind(C) + ! Set the mesh parameters + integer(C_INT32_T), value, intent(in) :: index + integer(C_INT), value, intent(in) :: n + real(C_DOUBLE), intent(in), optional :: ll(n) + real(C_DOUBLE), intent(in), optional :: ur(n) + real(C_DOUBLE), intent(in), optional :: width(n) + integer(C_INT) :: err + + err = 0 + if (index >= 1 .and. index <= n_meshes) then + associate (m => meshes(index)) + if (allocated(m % lower_left)) deallocate (m % lower_left) + if (allocated(m % upper_right)) deallocate (m % upper_right) + if (allocated(m % width)) deallocate (m % width) + + allocate(m % lower_left(n)) + allocate(m % upper_right(n)) + allocate(m % width(n)) + + if (present(ll) .and. present(ur)) then + m % lower_left(:) = ll + m % upper_right(:) = ur + m % width(:) = (ur - ll) / m % dimension + elseif (present(ll) .and. present(width)) then + m % lower_left(:) = ll + m % width(:) = width + m % upper_right(:) = ll + width * m % dimension + elseif (present(ur) .and. present(width)) then + m % upper_right(:) = ur + m % width(:) = width + m % lower_left(:) = ur - width * m % dimension + else + err = E_INVALID_ARGUMENT + call set_errmsg("At least two parameters must be specified.") + end if + end associate + else + err = E_OUT_OF_BOUNDS + call set_errmsg("Index in meshes array is out of bounds.") + end if + end function openmc_mesh_set_params + end module mesh_header diff --git a/src/tallies/tally_filter_mesh.F90 b/src/tallies/tally_filter_mesh.F90 index 3c0e6250c2..d2acdc4c8a 100644 --- a/src/tallies/tally_filter_mesh.F90 +++ b/src/tallies/tally_filter_mesh.F90 @@ -16,6 +16,7 @@ module tally_filter_mesh implicit none private + public :: openmc_mesh_filter_get_mesh public :: openmc_mesh_filter_set_mesh !=============================================================================== @@ -280,35 +281,46 @@ contains ! C API FUNCTIONS !=============================================================================== + function openmc_mesh_filter_get_mesh(index, index_mesh) result(err) bind(C) + ! Get the mesh for a mesh filter + integer(C_INT32_T), value, intent(in) :: index + integer(C_INT32_T), intent(out) :: index_mesh + integer(C_INT) :: err + + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (MeshFilter) + index_mesh = f % mesh + class default + err = E_INVALID_TYPE + call set_errmsg("Tried to set mesh on a non-mesh filter.") + end select + end if + end function openmc_mesh_filter_get_mesh + + function openmc_mesh_filter_set_mesh(index, index_mesh) result(err) bind(C) ! Set the mesh for a mesh filter integer(C_INT32_T), value, intent(in) :: index integer(C_INT32_T), value, intent(in) :: index_mesh integer(C_INT) :: err - err = 0 - if (index >= 1 .and. index <= n_filters) then - if (allocated(filters(index) % obj)) then - select type (f => filters(index) % obj) - type is (MeshFilter) - if (index_mesh >= 1 .and. index_mesh <= n_meshes) then - f % mesh = index_mesh - f % n_bins = product(meshes(index_mesh) % dimension) - else - err = E_OUT_OF_BOUNDS - call set_errmsg("Index in 'meshes' array is out of bounds.") - end if + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (MeshFilter) + if (index_mesh >= 1 .and. index_mesh <= n_meshes) then + f % mesh = index_mesh + f % n_bins = product(meshes(index_mesh) % dimension) + else + err = E_OUT_OF_BOUNDS + call set_errmsg("Index in 'meshes' array is out of bounds.") + end if class default - err = E_INVALID_TYPE - call set_errmsg("Tried to set mesh on a non-mesh filter.") - end select - else - err = E_ALLOCATE - call set_errmsg("Filter type has not been set yet.") - end if - else - err = E_OUT_OF_BOUNDS - call set_errmsg("Index in filters array out of bounds.") + err = E_INVALID_TYPE + call set_errmsg("Tried to set mesh on a non-mesh filter.") + end select end if end function openmc_mesh_filter_set_mesh diff --git a/src/tallies/tally_filter_meshsurface.F90 b/src/tallies/tally_filter_meshsurface.F90 index e1e8c48033..d90b63664e 100644 --- a/src/tallies/tally_filter_meshsurface.F90 +++ b/src/tallies/tally_filter_meshsurface.F90 @@ -16,6 +16,7 @@ module tally_filter_meshsurface implicit none private + public :: openmc_meshsurface_filter_get_mesh public :: openmc_meshsurface_filter_set_mesh !=============================================================================== @@ -296,6 +297,25 @@ contains ! C API FUNCTIONS !=============================================================================== + function openmc_meshsurface_filter_get_mesh(index, index_mesh) result(err) bind(C) + ! Get the mesh for a mesh surface filter + integer(C_INT32_T), value, intent(in) :: index + integer(C_INT32_T), intent(out) :: index_mesh + integer(C_INT) :: err + + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (MeshSurfaceFilter) + index_mesh = f % mesh + class default + err = E_INVALID_TYPE + call set_errmsg("Tried to set mesh on a non-mesh filter.") + end select + end if + end function openmc_meshsurface_filter_get_mesh + + function openmc_meshsurface_filter_set_mesh(index, index_mesh) result(err) bind(C) ! Set the mesh for a mesh surface filter integer(C_INT32_T), value, intent(in) :: index @@ -304,30 +324,22 @@ contains integer :: n_dim - err = 0 - if (index >= 1 .and. index <= n_filters) then - if (allocated(filters(index) % obj)) then - select type (f => filters(index) % obj) - type is (MeshSurfaceFilter) - if (index_mesh >= 1 .and. index_mesh <= n_meshes) then - f % mesh = index_mesh - n_dim = meshes(index_mesh) % n_dimension - f % n_bins = 4*n_dim*product(meshes(index_mesh) % dimension) - else - err = E_OUT_OF_BOUNDS - call set_errmsg("Index in 'meshes' array is out of bounds.") - end if - class default - err = E_INVALID_TYPE - call set_errmsg("Tried to set mesh on a non-mesh filter.") - end select - else - err = E_ALLOCATE - call set_errmsg("Filter type has not been set yet.") - end if - else - err = E_OUT_OF_BOUNDS - call set_errmsg("Index in filters array out of bounds.") + err = verify_filter(index) + if (err == 0) then + select type (f => filters(index) % obj) + type is (MeshSurfaceFilter) + if (index_mesh >= 1 .and. index_mesh <= n_meshes) then + f % mesh = index_mesh + n_dim = meshes(index_mesh) % n_dimension + f % n_bins = 4*n_dim*product(meshes(index_mesh) % dimension) + else + err = E_OUT_OF_BOUNDS + call set_errmsg("Index in 'meshes' array is out of bounds.") + end if + class default + err = E_INVALID_TYPE + call set_errmsg("Tried to set mesh on a non-mesh filter.") + end select end if end function openmc_meshsurface_filter_set_mesh diff --git a/tests/unit_tests/test_capi.py b/tests/unit_tests/test_capi.py index 8bc6c3d15c..66a6f3bc13 100644 --- a/tests/unit_tests/test_capi.py +++ b/tests/unit_tests/test_capi.py @@ -250,3 +250,38 @@ def test_find_material(capi_init): assert mat is openmc.capi.materials[1] mat = openmc.capi.find_material((0.4, 0., 0.)) assert mat is openmc.capi.materials[2] + + +def test_mesh(capi_init): + mesh = openmc.capi.Mesh() + mesh.dimension = (2, 3, 4) + assert mesh.dimension == (2, 3, 4) + with pytest.raises(openmc.capi.AllocationError): + mesh2 = openmc.capi.Mesh(mesh.id) + + # Make sure each combination of parameters works + ll = (0., 0., 0.) + ur = (10., 10., 10.) + width = (1., 1., 1.) + mesh.set_parameters(lower_left=ll, upper_right=ur) + assert mesh.lower_left == pytest.approx(ll) + assert mesh.upper_right == pytest.approx(ur) + mesh.set_parameters(lower_left=ll, width=width) + assert mesh.lower_left == pytest.approx(ll) + assert mesh.width == pytest.approx(width) + mesh.set_parameters(upper_right=ur, width=width) + assert mesh.upper_right == pytest.approx(ur) + assert mesh.width == pytest.approx(width) + + meshes = openmc.capi.meshes + assert isinstance(meshes, Mapping) + assert len(meshes) == 1 + for mesh_id, mesh in meshes.items(): + assert isinstance(mesh, openmc.capi.Mesh) + assert mesh_id == mesh.id + + mf = openmc.capi.MeshFilter(mesh) + assert mf.mesh == mesh + + msf = openmc.capi.MeshSurfaceFilter(mesh) + assert msf.mesh == mesh From 4be18cb9e905862e939172c5220b1e314fa581a8 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 2 Apr 2018 11:41:02 -0500 Subject: [PATCH 160/231] Prevent ICE on gfortran 4.8 --- src/mesh_header.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesh_header.F90 b/src/mesh_header.F90 index b1751a4676..fc13a868e5 100644 --- a/src/mesh_header.F90 +++ b/src/mesh_header.F90 @@ -716,9 +716,9 @@ contains if (index >= 1 .and. index <= n_meshes) then associate (m => meshes(index)) if (allocated(m % lower_left)) then - ll = C_LOC(m % lower_left) - ur = C_LOC(m % upper_right) - width = C_LOC(m % width) + ll = C_LOC(m % lower_left(1)) + ur = C_LOC(m % upper_right(1)) + width = C_LOC(m % width(1)) n = m % n_dimension else err = E_ALLOCATE From f485693fa0c810279a2e74d2d88385ab89fd56e7 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 4 Apr 2018 06:46:50 -0500 Subject: [PATCH 161/231] Support void materials in C API Python bindings --- openmc/capi/cell.py | 13 +++++++------ openmc/capi/material.py | 3 +++ src/geometry_header.F90 | 14 +++++--------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/openmc/capi/cell.py b/openmc/capi/cell.py index 8f0c0e1bb4..ccc6b6f6eb 100644 --- a/openmc/capi/cell.py +++ b/openmc/capi/cell.py @@ -115,14 +115,15 @@ class Cell(_FortranObjectWithID): def fill(self, fill): if isinstance(fill, Iterable): n = len(fill) - indices = (c_int*n)(*(m._index for m in fill)) - _dll.openmc_cell_set_fill(self._index, 1, 1, indices) + indices = (c_int32*n)(*(m._index if m is not None else -1 + for m in fill)) + _dll.openmc_cell_set_fill(self._index, 1, n, indices) elif isinstance(fill, Material): - materials = [fill] - indices = (c_int*1)(fill._index) + indices = (c_int32*1)(fill._index) + _dll.openmc_cell_set_fill(self._index, 1, 1, indices) + elif fill is None: + indices = (c_int32*1)(-1) _dll.openmc_cell_set_fill(self._index, 1, 1, indices) - else: - raise NotImplementedError def set_temperature(self, T, instance=None): """Set the temperature of a cell diff --git a/openmc/capi/material.py b/openmc/capi/material.py index 62d6df012a..464b8a1a33 100644 --- a/openmc/capi/material.py +++ b/openmc/capi/material.py @@ -89,6 +89,9 @@ class Material(_FortranObjectWithID): index = index.value else: index = mapping[uid]._index + elif index == -1: + # Special value indicates void material + return None if index not in cls.__instances: instance = super(Material, cls).__new__(cls) diff --git a/src/geometry_header.F90 b/src/geometry_header.F90 index e71916d096..f6206adf99 100644 --- a/src/geometry_header.F90 +++ b/src/geometry_header.F90 @@ -544,16 +544,12 @@ contains c % type = FILL_MATERIAL do i = 1, n j = indices(i) - if (j == 0) then - c % material(i) = MATERIAL_VOID + if ((j >= 1 .and. j <= n_materials) .or. j == MATERIAL_VOID) then + c % material(i) = j else - if (j >= 1 .and. j <= n_materials) then - c % material(i) = j - else - err = E_OUT_OF_BOUNDS - call set_errmsg("Index " // trim(to_str(j)) // " in the & - &materials array is out of bounds.") - end if + err = E_OUT_OF_BOUNDS + call set_errmsg("Index " // trim(to_str(j)) // " in the & + &materials array is out of bounds.") end if end do case (FILL_UNIVERSE) From 5fb3031d99e9de48f6e8f68f61abaa412f598b94 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 4 Apr 2018 14:28:10 -0500 Subject: [PATCH 162/231] [backport] Fix/add prototypes in openmc.h --- include/openmc.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/openmc.h b/include/openmc.h index 785aaeba53..1106bf54ca 100644 --- a/include/openmc.h +++ b/include/openmc.h @@ -30,7 +30,9 @@ extern "C" { int openmc_extend_sources(int32_t n, int32_t* index_start, int32_t* index_end); int openmc_extend_tallies(int32_t n, int32_t* index_start, int32_t* index_end); int openmc_filter_get_id(int32_t index, int32_t* id); + int openmc_filter_get_type(int32_t index, const char** type); int openmc_filter_set_id(int32_t index, int32_t id); + int openmc_filter_set_type(int32_t index, const char* type); void openmc_finalize(); int openmc_find(double* xyz, int rtype, int32_t* id, int32_t* instance); int openmc_get_cell_index(int32_t id, int32_t* index); @@ -91,7 +93,8 @@ extern "C" { int openmc_tally_set_filters(int32_t index, int n, const int32_t* indices); int openmc_tally_set_id(int32_t index, int32_t id); int openmc_tally_set_nuclides(int32_t index, int n, const char** nuclides); - int openmc_tally_set_scores(int32_t index, int n, const int* scores); + int openmc_tally_set_scores(int32_t index, int n, const char** scores); + int openmc_tally_set_type(int32_t index, const char* type); int openmc_zernike_filter_get_order(int32_t index, int* order); int openmc_zernike_filter_get_params(int32_t index, double* x, double* y, double* r); int openmc_zernike_filter_set_order(int32_t index, int order); From c78d296bf69b285459468f1bfc4b94206190eaeb Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 5 Apr 2018 16:07:51 -0500 Subject: [PATCH 163/231] Have openmc_next_batch return an actual error --- include/openmc.h | 26 ++++++------- openmc/capi/cell.py | 3 +- openmc/capi/core.py | 30 +++++++++----- openmc/capi/error.py | 73 +++++++++-------------------------- openmc/capi/filter.py | 3 +- openmc/capi/material.py | 3 +- openmc/capi/mesh.py | 3 +- openmc/capi/nuclide.py | 3 +- openmc/capi/tally.py | 3 +- openmc/exceptions.py | 38 ++++++++++++++++++ src/error.F90 | 22 +++++------ src/main.F90 | 5 ++- src/simulation.F90 | 40 ++++++++++++------- tests/unit_tests/test_capi.py | 19 ++++----- 14 files changed, 154 insertions(+), 117 deletions(-) create mode 100644 openmc/exceptions.py diff --git a/include/openmc.h b/include/openmc.h index 1106bf54ca..11a39e1ff3 100644 --- a/include/openmc.h +++ b/include/openmc.h @@ -65,11 +65,11 @@ extern "C" { int openmc_mesh_set_params(int32_t index, const double* ll, const double* ur, const double* width, int n); int openmc_meshsurface_filter_get_mesh(int32_t index, int32_t* index_mesh); int openmc_meshsurface_filter_set_mesh(int32_t index, int32_t index_mesh); - int openmc_next_batch(); + int openmc_next_batch(int* status); int openmc_nuclide_name(int index, char** name); void openmc_plot_geometry(); void openmc_reset(); - void openmc_run(); + int openmc_run(); void openmc_simulation_finalize(); void openmc_simulation_init(); int openmc_source_bank(struct Bank** ptr, int64_t* n); @@ -102,17 +102,17 @@ extern "C" { const double* y, const double* r); // Error codes - extern int E_UNASSIGNED; - extern int E_ALLOCATE; - extern int E_OUT_OF_BOUNDS; - extern int E_INVALID_SIZE; - extern int E_INVALID_ARGUMENT; - extern int E_INVALID_TYPE; - extern int E_INVALID_ID; - extern int E_GEOMETRY; - extern int E_DATA; - extern int E_PHYSICS; - extern int E_WARNING; + extern int OPENMC_E_UNASSIGNED; + extern int OPENMC_E_ALLOCATE; + extern int OPENMC_E_OUT_OF_BOUNDS; + extern int OPENMC_E_INVALID_SIZE; + extern int OPENMC_E_INVALID_ARGUMENT; + extern int OPENMC_E_INVALID_TYPE; + extern int OPENMC_E_INVALID_ID; + extern int OPENMC_E_GEOMETRY; + extern int OPENMC_E_DATA; + extern int OPENMC_E_PHYSICS; + extern int OPENMC_E_WARNING; // Global variables extern char openmc_err_msg[256]; diff --git a/openmc/capi/cell.py b/openmc/capi/cell.py index ccc6b6f6eb..258e773dce 100644 --- a/openmc/capi/cell.py +++ b/openmc/capi/cell.py @@ -5,9 +5,10 @@ from weakref import WeakValueDictionary import numpy as np from numpy.ctypeslib import as_array +from openmc.exceptions import AllocationError, InvalidIDError from . import _dll from .core import _FortranObjectWithID -from .error import _error_handler, AllocationError, InvalidIDError +from .error import _error_handler from .material import Material __all__ = ['Cell', 'cells'] diff --git a/openmc/capi/core.py b/openmc/capi/core.py index 415fa2e936..f80b5fe540 100644 --- a/openmc/capi/core.py +++ b/openmc/capi/core.py @@ -6,8 +6,9 @@ from warnings import warn import numpy as np from numpy.ctypeslib import as_array +from openmc.exceptions import AllocationError from . import _dll -from .error import _error_handler, AllocationError +from .error import _error_handler import openmc.capi @@ -31,9 +32,12 @@ _dll.openmc_init.restype = None _dll.openmc_get_keff.argtypes = [POINTER(c_double*2)] _dll.openmc_get_keff.restype = c_int _dll.openmc_get_keff.errcheck = _error_handler +_dll.openmc_next_batch.argtypes = [POINTER(c_int)] _dll.openmc_next_batch.restype = c_int +_dll.openmc_next_batch.errcheck = _error_handler _dll.openmc_plot_geometry.restype = None -_dll.openmc_run.restype = None +_dll.openmc_run.restype = c_int +_dll.openmc_run.errcheck = _error_handler _dll.openmc_reset.restype = None _dll.openmc_source_bank.argtypes = [POINTER(POINTER(_Bank)), POINTER(c_int64)] _dll.openmc_source_bank.restype = c_int @@ -147,13 +151,13 @@ def iter_batches(): """ while True: # Run next batch - retval = next_batch() + status = next_batch() # Provide opportunity for user to perform action between batches yield # End the iteration - if retval < 0: + if status != 0: break @@ -180,12 +184,18 @@ def keff(): def next_batch(): - """Run next batch.""" - retval = _dll.openmc_next_batch() - if retval == -3: - raise AllocationError('Simulation has not been initialized. You must call ' - 'openmc.capi.simulation_init() first.') - return retval + """Run next batch. + + Returns + ------- + int + Status after running a batch (0=normal, 1=reached maximum number of + batches, 2=tally triggers reached) + + """ + status = c_int() + _dll.openmc_next_batch(status) + return status.value def plot_geometry(): diff --git a/openmc/capi/error.py b/openmc/capi/error.py index a11d6ea87d..b35de4e60c 100644 --- a/openmc/capi/error.py +++ b/openmc/capi/error.py @@ -1,45 +1,10 @@ from ctypes import c_int, c_char from warnings import warn +import openmc.exceptions as exc from . import _dll -class OpenMCError(Exception): - """Root exception class for OpenMC.""" - - -class GeometryError(OpenMCError): - """Geometry-related error""" - - -class InvalidIDError(OpenMCError): - """Use of an ID that is invalid.""" - - -class AllocationError(OpenMCError): - """Error related to memory allocation.""" - - -class OutOfBoundsError(OpenMCError): - """Index in array out of bounds.""" - - -class DataError(OpenMCError): - """Error relating to nuclear data.""" - - -class PhysicsError(OpenMCError): - """Error relating to performing physics.""" - - -class InvalidArgumentError(OpenMCError): - """Argument passed was invalid.""" - - -class InvalidTypeError(OpenMCError): - """Tried to perform an operation on the wrong type.""" - - def _error_handler(err, func, args): """Raise exception according to error code.""" @@ -52,23 +17,23 @@ def _error_handler(err, func, args): msg = errmsg.value.decode() # Raise exception type corresponding to error code - if err == errcode('e_allocate'): - raise AllocationError(msg) - elif err == errcode('e_out_of_bounds'): - raise OutOfBoundsError(msg) - elif err == errcode('e_invalid_argument'): - raise InvalidArgumentError(msg) - elif err == errcode('e_invalid_type'): - raise InvalidTypeError(msg) - if err == errcode('e_invalid_id'): - raise InvalidIDError(msg) - elif err == errcode('e_geometry'): - raise GeometryError(msg) - elif err == errcode('e_data'): - raise DataError(msg) - elif err == errcode('e_physics'): - raise PhysicsError(msg) - elif err == errcode('e_warning'): + if err == errcode('OPENMC_E_ALLOCATE'): + raise exc.AllocationError(msg) + elif err == errcode('OPENMC_E_OUT_OF_BOUNDS'): + raise exc.OutOfBoundsError(msg) + elif err == errcode('OPENMC_E_INVALID_ARGUMENT'): + raise exc.InvalidArgumentError(msg) + elif err == errcode('OPENMC_E_INVALID_TYPE'): + raise exc.InvalidTypeError(msg) + if err == errcode('OPENMC_E_INVALID_ID'): + raise exc.InvalidIDError(msg) + elif err == errcode('OPENMC_E_GEOMETRY'): + raise exc.GeometryError(msg) + elif err == errcode('OPENMC_E_DATA'): + raise exc.DataError(msg) + elif err == errcode('OPENMC_E_PHYSICS'): + raise exc.PhysicsError(msg) + elif err == errcode('OPENMC_E_WARNING'): warn(msg) elif err < 0: - raise OpenMCError("Unknown error encountered (code {}).".format(err)) + raise exc.OpenMCError("Unknown error encountered (code {}).".format(err)) diff --git a/openmc/capi/filter.py b/openmc/capi/filter.py index a2b77fa927..5c21c3ef4b 100644 --- a/openmc/capi/filter.py +++ b/openmc/capi/filter.py @@ -6,9 +6,10 @@ from weakref import WeakValueDictionary import numpy as np from numpy.ctypeslib import as_array +from openmc.exceptions import AllocationError, InvalidIDError from . import _dll from .core import _FortranObjectWithID -from .error import _error_handler, AllocationError, InvalidIDError +from .error import _error_handler from .material import Material from .mesh import Mesh diff --git a/openmc/capi/material.py b/openmc/capi/material.py index 464b8a1a33..a6c29a3751 100644 --- a/openmc/capi/material.py +++ b/openmc/capi/material.py @@ -5,9 +5,10 @@ from weakref import WeakValueDictionary import numpy as np from numpy.ctypeslib import as_array +from openmc.exceptions import AllocationError, InvalidIDError from . import _dll, Nuclide from .core import _FortranObjectWithID -from .error import _error_handler, AllocationError, InvalidIDError +from .error import _error_handler __all__ = ['Material', 'materials'] diff --git a/openmc/capi/mesh.py b/openmc/capi/mesh.py index c7430f9f3e..326f5f61ed 100644 --- a/openmc/capi/mesh.py +++ b/openmc/capi/mesh.py @@ -5,9 +5,10 @@ from weakref import WeakValueDictionary import numpy as np from numpy.ctypeslib import as_array +from openmc.exceptions import AllocationError, InvalidIDError from . import _dll from .core import _FortranObjectWithID -from .error import _error_handler, AllocationError, InvalidIDError +from .error import _error_handler from .material import Material __all__ = ['Mesh', 'meshes'] diff --git a/openmc/capi/nuclide.py b/openmc/capi/nuclide.py index f66212c971..e57653c64d 100644 --- a/openmc/capi/nuclide.py +++ b/openmc/capi/nuclide.py @@ -5,9 +5,10 @@ from weakref import WeakValueDictionary import numpy as np from numpy.ctypeslib import as_array +from openmc.exceptions import DataError, AllocationError from . import _dll from .core import _FortranObject -from .error import _error_handler, DataError, AllocationError +from .error import _error_handler __all__ = ['Nuclide', 'nuclides', 'load_nuclide'] diff --git a/openmc/capi/tally.py b/openmc/capi/tally.py index a78347177d..46a967f690 100644 --- a/openmc/capi/tally.py +++ b/openmc/capi/tally.py @@ -6,10 +6,11 @@ import numpy as np from numpy.ctypeslib import as_array import scipy.stats +from openmc.exceptions import AllocationError, InvalidIDError from openmc.data.reaction import REACTION_NAME from . import _dll, Nuclide from .core import _FortranObjectWithID -from .error import _error_handler, AllocationError, InvalidIDError +from .error import _error_handler from .filter import _get_filter diff --git a/openmc/exceptions.py b/openmc/exceptions.py new file mode 100644 index 0000000000..c87bfc82c9 --- /dev/null +++ b/openmc/exceptions.py @@ -0,0 +1,38 @@ +class OpenMCError(Exception): + """Root exception class for OpenMC.""" + + +class GeometryError(OpenMCError): + """Geometry-related error""" + + +class InvalidIDError(OpenMCError): + """Use of an ID that is invalid.""" + + +class AllocationError(OpenMCError): + """Error related to memory allocation.""" + + +class OutOfBoundsError(OpenMCError): + """Index in array out of bounds.""" + + +class DataError(OpenMCError): + """Error relating to nuclear data.""" + + +class PhysicsError(OpenMCError): + """Error relating to performing physics.""" + + +class InvalidArgumentError(OpenMCError): + """Argument passed was invalid.""" + + +class InvalidTypeError(OpenMCError): + """Tried to perform an operation on the wrong type.""" + + +class SetupError(OpenMCError): + """Error while setting up a problem.""" diff --git a/src/error.F90 b/src/error.F90 index 0a5af302d6..f4fb34173c 100644 --- a/src/error.F90 +++ b/src/error.F90 @@ -15,19 +15,19 @@ module error public :: write_message ! Error codes - integer(C_INT), public, bind(C) :: E_UNASSIGNED = -1 - integer(C_INT), public, bind(C) :: E_ALLOCATE = -2 - integer(C_INT), public, bind(C) :: E_OUT_OF_BOUNDS = -3 - integer(C_INT), public, bind(C) :: E_INVALID_SIZE = -4 - integer(C_INT), public, bind(C) :: E_INVALID_ARGUMENT = -5 - integer(C_INT), public, bind(C) :: E_INVALID_TYPE = -6 - integer(C_INT), public, bind(C) :: E_INVALID_ID = -7 - integer(C_INT), public, bind(C) :: E_GEOMETRY = -8 - integer(C_INT), public, bind(C) :: E_DATA = -9 - integer(C_INT), public, bind(C) :: E_PHYSICS = -10 + integer(C_INT), public, bind(C, name='OPENMC_E_UNASSIGNED') :: E_UNASSIGNED = -1 + integer(C_INT), public, bind(C, name='OPENMC_E_ALLOCATE') :: E_ALLOCATE = -2 + integer(C_INT), public, bind(C, name='OPENMC_E_OUT_OF_BOUNDS') :: E_OUT_OF_BOUNDS = -3 + integer(C_INT), public, bind(C, name='OPENMC_E_INVALID_SIZE') :: E_INVALID_SIZE = -4 + integer(C_INT), public, bind(C, name='OPENMC_E_INVALID_ARGUMENT') :: E_INVALID_ARGUMENT = -5 + integer(C_INT), public, bind(C, name='OPENMC_E_INVALID_TYPE') :: E_INVALID_TYPE = -6 + integer(C_INT), public, bind(C, name='OPENMC_E_INVALID_ID') :: E_INVALID_ID = -7 + integer(C_INT), public, bind(C, name='OPENMC_E_GEOMETRY') :: E_GEOMETRY = -8 + integer(C_INT), public, bind(C, name='OPENMC_E_DATA') :: E_DATA = -9 + integer(C_INT), public, bind(C, name='OPENMC_E_PHYSICS') :: E_PHYSICS = -10 ! Warning codes - integer(C_INT), public, bind(C) :: E_WARNING = 1 + integer(C_INT), public, bind(C, name='OPENMC_E_WARNING') :: E_WARNING = 1 ! Error message character(kind=C_CHAR), public, bind(C) :: openmc_err_msg(256) diff --git a/src/main.F90 b/src/main.F90 index 120bdd1e0c..372e993f5d 100644 --- a/src/main.F90 +++ b/src/main.F90 @@ -1,5 +1,7 @@ program main + use, intrinsic :: ISO_C_BINDING + use constants use message_passing use openmc_api, only: openmc_init, openmc_finalize, openmc_run, & @@ -9,6 +11,7 @@ program main implicit none + integer(C_INT) :: err #ifdef OPENMC_MPI integer :: mpi_err ! MPI error code #endif @@ -27,7 +30,7 @@ program main ! start problem based on mode select case (run_mode) case (MODE_FIXEDSOURCE, MODE_EIGENVALUE) - call openmc_run() + err = openmc_run() case (MODE_PLOTTING) call openmc_plot_geometry() case (MODE_PARTICLE) diff --git a/src/simulation.F90 b/src/simulation.F90 index 8fe4f025c3..68debe52ba 100644 --- a/src/simulation.F90 +++ b/src/simulation.F90 @@ -48,6 +48,10 @@ module simulation public :: openmc_simulation_init public :: openmc_simulation_finalize + integer(C_INT), parameter :: STATUS_EXIT_NORMAL = 0 + integer(C_INT), parameter :: STATUS_EXIT_MAX_BATCH = 1 + integer(C_INT), parameter :: STATUS_EXIT_ON_TRIGGER = 2 + contains !=============================================================================== @@ -56,28 +60,36 @@ contains ! calculation. !=============================================================================== - subroutine openmc_run() bind(C) + function openmc_run() result(err) bind(C) + integer(C_INT) :: err + integer(C_INT) :: status call openmc_simulation_init() - do while (openmc_next_batch() == 0) + do + err = openmc_next_batch(status) + if (status /= 0 .or. err < 0) exit end do call openmc_simulation_finalize() - end subroutine openmc_run + end function openmc_run !=============================================================================== ! OPENMC_NEXT_BATCH !=============================================================================== - function openmc_next_batch() result(retval) bind(C) - integer(C_INT) :: retval + function openmc_next_batch(status) result(err) bind(C) + integer(C_INT), intent(out), optional :: status + integer(C_INT) :: err type(Particle) :: p integer(8) :: i_work + err = 0 + ! Make sure simulation has been initialized if (.not. simulation_initialized) then - retval = -3 + err = E_ALLOCATE + call set_errmsg("Simulation has not been initialized yet.") return end if @@ -86,7 +98,7 @@ contains ! Handle restart runs if (restart_run .and. current_batch <= restart_batch) then call replay_batch_history() - retval = 0 + status = STATUS_EXIT_NORMAL return end if @@ -124,12 +136,14 @@ contains call finalize_batch() ! Check simulation ending criteria - if (current_batch == n_max_batches) then - retval = -1 - elseif (satisfy_triggers) then - retval = -2 - else - retval = 0 + if (present(status)) then + if (current_batch == n_max_batches) then + status = STATUS_EXIT_MAX_BATCH + elseif (satisfy_triggers) then + status = STATUS_EXIT_ON_TRIGGER + else + status = STATUS_EXIT_NORMAL + end if end if end function openmc_next_batch diff --git a/tests/unit_tests/test_capi.py b/tests/unit_tests/test_capi.py index 66a6f3bc13..6c05f5d3e3 100644 --- a/tests/unit_tests/test_capi.py +++ b/tests/unit_tests/test_capi.py @@ -4,6 +4,7 @@ import os import numpy as np import pytest import openmc +import openmc.exceptions as exc import openmc.capi from tests import cdtemp @@ -60,7 +61,7 @@ def test_cell(capi_init): def test_new_cell(capi_init): - with pytest.raises(openmc.capi.AllocationError): + with pytest.raises(exc.AllocationError): openmc.capi.Cell(1) new_cell = openmc.capi.Cell() new_cell_with_id = openmc.capi.Cell(10) @@ -91,7 +92,7 @@ def test_material(capi_init): def test_new_material(capi_init): - with pytest.raises(openmc.capi.AllocationError): + with pytest.raises(exc.AllocationError): openmc.capi.Material(1) new_mat = openmc.capi.Material() new_mat_with_id = openmc.capi.Material(10) @@ -109,7 +110,7 @@ def test_nuclide_mapping(capi_init): def test_load_nuclide(capi_init): openmc.capi.load_nuclide('Pu239') - with pytest.raises(openmc.capi.DataError): + with pytest.raises(exc.DataError): openmc.capi.load_nuclide('Pu3') @@ -145,7 +146,7 @@ def test_tally(capi_init): assert isinstance(t.filters[1], openmc.capi.EnergyFilter) # Create new filter and replace existing - with pytest.raises(openmc.capi.AllocationError): + with pytest.raises(exc.AllocationError): openmc.capi.MaterialFilter(uid=1) mats = openmc.capi.materials f = openmc.capi.MaterialFilter([mats[2], mats[1]]) @@ -153,7 +154,7 @@ def test_tally(capi_init): assert t.filters == [f] assert t.nuclides == ['U235', 'U238'] - with pytest.raises(openmc.capi.DataError): + with pytest.raises(exc.DataError): t.nuclides = ['Zr2'] t.nuclides = ['U234', 'Zr90'] assert t.nuclides == ['U234', 'Zr90'] @@ -165,7 +166,7 @@ def test_tally(capi_init): def test_new_tally(capi_init): - with pytest.raises(openmc.capi.AllocationError): + with pytest.raises(exc.AllocationError): openmc.capi.Material(1) new_tally = openmc.capi.Tally() new_tally.scores = ['flux'] @@ -206,7 +207,7 @@ def test_by_batch(capi_run): # Running next batch before simulation is initialized should raise an # exception - with pytest.raises(openmc.capi.AllocationError): + with pytest.raises(exc.AllocationError): openmc.capi.next_batch() openmc.capi.simulation_init() @@ -241,7 +242,7 @@ def test_find_cell(capi_init): assert cell is openmc.capi.cells[1] cell, instance = openmc.capi.find_cell((0.4, 0., 0.)) assert cell is openmc.capi.cells[2] - with pytest.raises(openmc.capi.GeometryError): + with pytest.raises(exc.GeometryError): openmc.capi.find_cell((100., 100., 100.)) @@ -256,7 +257,7 @@ def test_mesh(capi_init): mesh = openmc.capi.Mesh() mesh.dimension = (2, 3, 4) assert mesh.dimension == (2, 3, 4) - with pytest.raises(openmc.capi.AllocationError): + with pytest.raises(exc.AllocationError): mesh2 = openmc.capi.Mesh(mesh.id) # Make sure each combination of parameters works From 336c38da2f1ef9d9be6ba52536765bde3d1ce541 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 12 Apr 2018 07:18:47 -0500 Subject: [PATCH 164/231] Fix typo in openmc.h --- include/openmc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/openmc.h b/include/openmc.h index 11a39e1ff3..d24ca4af96 100644 --- a/include/openmc.h +++ b/include/openmc.h @@ -16,7 +16,7 @@ extern "C" { int delayed_group; }; - void openmc_calculate_voumes(); + void openmc_calculate_volumes(); int openmc_cell_get_fill(int32_t index, int* type, int32_t** indices, int32_t* n); int openmc_cell_get_id(int32_t index, int32_t* id); int openmc_cell_set_fill(int32_t index, int type, int32_t n, const int32_t* indices); From c80379a48816ea17936c108863ed8633046dacc5 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 13 Apr 2018 15:04:04 -0500 Subject: [PATCH 165/231] Docfix for openmc.data.Library.get_by_material --- openmc/data/library.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openmc/data/library.py b/openmc/data/library.py index 34cd380a55..adfa3e4cb8 100644 --- a/openmc/data/library.py +++ b/openmc/data/library.py @@ -23,9 +23,14 @@ class DataLibrary(EqualityMixin): def __init__(self): self.libraries = [] - def get_by_material(self, value): + def get_by_material(self, name): """Return the library dictionary containing a given material. + Parameters + ---------- + name : str + Name of material, e.g. 'Am241' + Returns ------- library : dict or None @@ -34,7 +39,7 @@ class DataLibrary(EqualityMixin): """ for library in self.libraries: - if value in library['materials']: + if name in library['materials']: return library return None From 932bb7157e6871a71a841384d278e70fc5444a7b Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 13 Apr 2018 16:05:46 -0500 Subject: [PATCH 166/231] Fix file format documentation for settings.xml --- docs/source/io_formats/settings.rst | 87 ++++++++++++++--------------- 1 file changed, 43 insertions(+), 44 deletions(-) diff --git a/docs/source/io_formats/settings.rst b/docs/source/io_formats/settings.rst index 0aa058cdba..d2cb3b1253 100644 --- a/docs/source/io_formats/settings.rst +++ b/docs/source/io_formats/settings.rst @@ -93,29 +93,13 @@ or ``multi-group``. *Default*: continuous-energy ---------------------- -```` Element ---------------------- +-------------------------- +```` Element +-------------------------- -The ```` element describes a mesh that is used for calculating Shannon -entropy. This mesh should cover all possible fissionable materials in the -problem. It has the following attributes/sub-elements: - - :dimension: - The number of mesh cells in the x, y, and z directions, respectively. - - *Default*: If this tag is not present, the number of mesh cells is - automatically determined by the code. - - :lower_left: - The Cartesian coordinates of the lower-left corner of the mesh. - - *Default*: None - - :upper_right: - The Cartesian coordinates of the upper-right corner of the mesh. - - *Default*: None +The ```` element indicates the ID of a mesh that is to be used for +calculating Shannon entropy. The mesh should cover all possible fissionable +materials in the problem and is specified using a :ref:`mesh_element`. ----------------------------------- ```` Element @@ -199,6 +183,36 @@ then, OpenMC will only use up to the :math:`P_1` data. .. note:: This element is not used in the continuous-energy :ref:`energy_mode`. +.. _mesh_element: + +------------------ +```` Element +------------------ + +The ```` element describes a mesh that is used either for calculating +Shannon entropy, applying the uniform fission site method, or in tallies. For +Shannon entropy meshes, the mesh should cover all possible fissionable materials +in the problem. It has the following attributes/sub-elements: + + :id: + A unique integer that is used to identify the mesh. + + :dimension: + The number of mesh cells in the x, y, and z directions, respectively. + + *Default*: If this tag is not present, the number of mesh cells is + automatically determined by the code. + + :lower_left: + The Cartesian coordinates of the lower-left corner of the mesh. + + *Default*: None + + :upper_right: + The Cartesian coordinates of the upper-right corner of the mesh. + + *Default*: None + ----------------------- ```` Element ----------------------- @@ -765,30 +779,15 @@ has the following attributes/sub-elements: ------------------------ -```` Element +```` Element ------------------------ -The ```` element describes a mesh that is used for re-weighting -source sites at every generation based on the uniform fission site methodology -described in Kelly et al., "MC21 Analysis of the Nuclear Energy Agency Monte -Carlo Performance Benchmark Problem," Proceedings of *Physor 2012*, Knoxville, -TN (2012). This mesh should cover all possible fissionable materials in the -problem. It has the following attributes/sub-elements: - - :dimension: - The number of mesh cells in the x, y, and z directions, respectively. - - *Default*: None - - :lower_left: - The Cartesian coordinates of the lower-left corner of the mesh. - - *Default*: None - - :upper_right: - The Cartesian coordinates of the upper-right corner of the mesh. - - *Default*: None +The ```` element indicates the ID of a mesh that is used for +re-weighting source sites at every generation based on the uniform fission site +methodology described in Kelly et al., "MC21 Analysis of the Nuclear Energy +Agency Monte Carlo Performance Benchmark Problem," Proceedings of *Physor 2012*, +Knoxville, TN (2012). The mesh should cover all possible fissionable materials +in the problem and is specified using a :ref:`mesh_element`. .. _verbosity: From 4a64e2a93139574a0d913b9b4c8266264a15bea2 Mon Sep 17 00:00:00 2001 From: amandalund Date: Sat, 14 Apr 2018 14:10:35 -0500 Subject: [PATCH 167/231] Address #991 comments; add comments; add stopping condition and warning on early convergence --- openmc/model/triso.py | 150 ++++++++++++++++----------- tests/unit_tests/test_model_triso.py | 22 ++-- 2 files changed, 97 insertions(+), 75 deletions(-) diff --git a/openmc/model/triso.py b/openmc/model/triso.py index 7040d02cab..1e4b4aa9b1 100644 --- a/openmc/model/triso.py +++ b/openmc/model/triso.py @@ -305,14 +305,14 @@ class _CubicDomain(_Domain): uniform(-x_max, x_max)] def repel_particles(self, p, q, d, d_new): - # Moving each particle distance 'r' away from the other along the line + # Moving each particle distance 's' away from the other along the line # joining the particle centers will ensure their final distance is # equal to the outer diameter - r = (d_new - d)/2 + s = (d_new - d)/2 v = (p - q)/d - p += r*v - q -= r*v + p += s*v + q -= s*v # Enforce the rigid boundary by moving each particle back along the # surface normal until it is completely within the container if it @@ -413,14 +413,14 @@ class _CylindricalDomain(_Domain): return [r*cos(t), r*sin(t), uniform(-z_max, z_max)] def repel_particles(self, p, q, d, d_new): - # Moving each particle distance 'r' away from the other along the line + # Moving each particle distance 's' away from the other along the line # joining the particle centers will ensure their final distance is # equal to the outer diameter - r = (d_new - d)/2 + s = (d_new - d)/2 v = (p - q)/d - p += r*v - q -= r*v + p += s*v + q -= s*v # Enforce the rigid boundary by moving each particle back along the # surface normal until it is completely within the container if it @@ -428,14 +428,14 @@ class _CylindricalDomain(_Domain): r_max = self.limits[0] z_max = self.limits[1] - d = sqrt(p[0]**2 + p[1]**2) - if d > r_max: - p[0:2] *= r_max/d + r = sqrt(p[0]**2 + p[1]**2) + if r > r_max: + p[0:2] *= r_max/r p[2] = np.clip(p[2], -z_max, z_max) - d = sqrt(q[0]**2 + q[1]**2) - if d > r_max: - q[0:2] *= r_max/d + r = sqrt(q[0]**2 + q[1]**2) + if r > r_max: + q[0:2] *= r_max/r q[2] = np.clip(q[2], -z_max, z_max) @@ -512,27 +512,27 @@ class _SphericalDomain(_Domain): return [r*s for s in x] def repel_particles(self, p, q, d, d_new): - # Moving each particle distance 'r' away from the other along the line + # Moving each particle distance 's' away from the other along the line # joining the particle centers will ensure their final distance is # equal to the outer diameter - r = (d_new - d)/2 + s = (d_new - d)/2 v = (p - q)/d - p += r*v - q -= r*v + p += s*v + q -= s*v # Enforce the rigid boundary by moving each particle back along the # surface normal until it is completely within the container if it # overlaps the surface r_max = self.limits[0] - d = sqrt(p[0]**2 + p[1]**2 + p[2]**2) - if d > r_max: - p *= r_max/d + r = sqrt(p[0]**2 + p[1]**2 + p[2]**2) + if r > r_max: + p *= r_max/r - d = sqrt(q[0]**2 + q[1]**2 + q[2]**2) - if d > r_max: - q *= r_max/d + r = sqrt(q[0]**2 + q[1]**2 + q[2]**2) + if r > r_max: + q *= r_max/r def create_triso_lattice(trisos, lower_left, pitch, shape, background): @@ -712,6 +712,7 @@ def _close_random_pack(domain, particles, contraction_rate): del rods_map[i] del rods_map[j] return d, i, j + return None, None, None def create_rod_list(): """Generate sorted list of rods (distances between particle centers). @@ -736,8 +737,8 @@ def _close_random_pack(domain, particles, contraction_rate): # Find distance to nearest neighbor and index of nearest neighbor for # all particles d, n = tree.query(particles, k=2) - d = d[:,1] - n = n[:,1] + d = d[:, 1] + n = n[:, 1] # Array of particle indices, indices of nearest neighbors, and # distances to nearest neighbors @@ -746,8 +747,8 @@ def _close_random_pack(domain, particles, contraction_rate): # Sort along second column and swap first and second columns to create # array of nearest neighbor indices, indices of particles they are # nearest neighbors of, and distances between them - b = a[a[:,1].argsort()] - b[:,[0, 1]] = b[:,[1, 0]] + b = a[a[:, 1].argsort()] + b[:, [0, 1]] = b[:, [1, 0]] # Find the intersection between 'a' and 'b': a list of particles who # are each other's nearest neighbors and the distance between them @@ -761,10 +762,11 @@ def _close_random_pack(domain, particles, contraction_rate): del rods[:] rods_map.clear() for d, i, j in r: - add_rod(d, i, j) + if d < outer_diameter and not np.isclose(d, outer_diameter, atol=1.0e-14): + add_rod(d, i, j) - def update_mesh(indices): - """Update which mesh cells the particles are in based on new particle + def update_mesh(i): + """Update which mesh cells the particle is in based on new particle center coordinates. 'mesh'/'mesh_map' is a two way dictionary used to look up which @@ -774,23 +776,22 @@ def _close_random_pack(domain, particles, contraction_rate): Parameters ---------- - indices : List of int - Indices of particles in particles array. + i : int + Index of particle in particles array. """ - for i in indices: - # Determine which mesh cells the particle is in and remove the - # particle id from those cells - for idx in mesh_map[i]: - mesh[idx].remove(i) - del mesh_map[i] + # Determine which mesh cells the particle is in and remove the + # particle id from those cells + for idx in mesh_map[i]: + mesh[idx].remove(i) + del mesh_map[i] - # Determine which mesh cells are within one diameter of particle's - # center and add this particle to the list of particles in those cells - for idx in domain.nearby_mesh_cells(particles[i]): - mesh[idx].add(i) - mesh_map[i].add(idx) + # Determine which mesh cells are within one diameter of particle's + # center and add this particle to the list of particles in those cells + for idx in domain.nearby_mesh_cells(particles[i]): + mesh[idx].add(i) + mesh_map[i].add(idx) def reduce_outer_diameter(): """Reduce the outer diameter so that at the (i+1)-st iteration it is: @@ -844,25 +845,25 @@ def _close_random_pack(domain, particles, contraction_rate): else: return None, None - def update_rod_list(indices): - """Update the rod list with the new nearest neighbors of particles in - list since their overlap was eliminated. + def update_rod_list(i): + """Update the rod list with the new nearest neighbors of particle since + its overlap was eliminated. Parameters ---------- - indices : List of int - Indices of particles in particles array. + i : int + Index of particle in particles array. """ # If the nearest neighbor k of particle i has no nearer neighbors, # remove the rod currently containing k from the rod list and add rod # k-i, keeping the rod list sorted - for i in indices: - k, d_ik = nearest(i) - if k and nearest(k)[0] == i: - remove_rod(k) - add_rod(d_ik, i, k) + k, d_ik = nearest(i) + if (k and nearest(k)[0] == i and d_ik < outer_diameter + and not np.isclose(d, outer_diameter, atol=1.0e-14)): + remove_rod(k) + add_rod(d_ik, i, k) n_particles = len(particles) diameter = 2*domain.particle_radius @@ -877,41 +878,68 @@ def _close_random_pack(domain, particles, contraction_rate): outer_diameter = initial_outer_diameter inner_diameter = 0. + # List of rods arranged in a heap and mapping of particle ids to rods rods = [] rods_map = {} + + # Initialize two-way dictionary that identifies which particles are near a + # given mesh cell and which mesh cells a particle is near mesh = defaultdict(set) mesh_map = defaultdict(set) - for i in range(n_particles): for idx in domain.nearby_mesh_cells(particles[i]): mesh[idx].add(i) mesh_map[i].add(idx) while True: + # Rebuild the sorted list of rods according to the current particle + # configuration create_rod_list() + + # Set the inner diameter to the shortest center-to-center distance + # between any two particles if rods: - # Set inner diameter to the shortest center-to-center distance - # between any two particles inner_diameter = rods[0][0] + + # Reached the desired particle radius if inner_diameter >= diameter: break + + # The algorithm converged before reaching the desired particle radius. + # This can happen when the desired packing fraction is close to the + # packing fraction limit. The packing fraction is a random variable + # that is determined by the particle locations and the contraction + # rate. A higher packing fraction can be achieved with a smaller + # contraction rate, though at the cost of a longer simulation time -- + # the number of iterations needed to remove all overlaps is inversely + # proportional to the contraction rate. + if inner_diameter >= outer_diameter or not rods: + warnings.warn('Close random pack converged before reaching true ' + 'particle radius; some particles may overlap. Try ' + 'reducing contraction rate or packing fraction.') + break + while True: d, i, j = pop_rod() + if not d: + break outer_diameter = reduce_outer_diameter() domain.repel_particles(particles[i], particles[j], d, outer_diameter) - update_mesh([i, j]) - update_rod_list([i, j]) + update_mesh(i) + update_mesh(j) + update_rod_list(i) + update_rod_list(j) if not rods: break inner_diameter = rods[0][0] - if inner_diameter >= diameter: + if inner_diameter >= diameter or inner_diameter >= outer_diameter: break def pack_trisos(radius, fill, domain_shape='cylinder', domain_length=None, domain_radius=None, domain_center=[0., 0., 0.], n_particles=None, packing_fraction=None, - initial_packing_fraction=0.3, contraction_rate=1/400, seed=1): + initial_packing_fraction=0.3, contraction_rate=1.e-3, seed=1): """Generate a random, non-overlapping configuration of TRISO particles within a container. diff --git a/tests/unit_tests/test_model_triso.py b/tests/unit_tests/test_model_triso.py index bfd7319d21..19c4f9081e 100644 --- a/tests/unit_tests/test_model_triso.py +++ b/tests/unit_tests/test_model_triso.py @@ -12,21 +12,15 @@ import scipy.spatial _PACKING_FRACTION = 0.35 _RADIUS = 4.25e-2 +domain_params = [ + {'shape': 'cube', 'length': 0.75, 'radius': 0., 'volume': 0.75**3}, + {'shape': 'cylinder', 'length': 0.5, 'radius': 0.5, 'volume': 0.5*pi*0.5**2}, + {'shape': 'sphere', 'length': 0., 'radius': 0.5, 'volume': 4/3*pi*0.5**3} +] -@pytest.fixture(scope='module', - params=[{'shape': 'cube', - 'length': 0.75, - 'radius': 0., - 'volume': 0.75**3}, - {'shape': 'cylinder', - 'length': 0.5, - 'radius': 0.5, - 'volume': 0.5*pi*0.5**2}, - {'shape': 'sphere', - 'length': 0., - 'radius': 0.5, - 'volume': 4/3*pi*0.5**3}]) +@pytest.fixture(scope='module', params=domain_params, + ids=['cube', 'cylinder', 'sphere']) def domain(request): return request.param @@ -65,7 +59,7 @@ def test_overlap(trisos): d = tree.query(centers, k=2)[0] # Get the smallest distance between any two particles - d_min = min(d[:,1]) + d_min = min(d[:, 1]) assert d_min > 2*_RADIUS or d_min == pytest.approx(2*_RADIUS) From fccb26735ca1b2621aac8af2cb55b64d71527480 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 17 Apr 2018 14:16:43 -0500 Subject: [PATCH 168/231] Add missing prototypes in openmc.h --- include/openmc.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/openmc.h b/include/openmc.h index d24ca4af96..0837881200 100644 --- a/include/openmc.h +++ b/include/openmc.h @@ -27,6 +27,7 @@ extern "C" { int openmc_extend_cells(int32_t n, int32_t* index_start, int32_t* index_end); int openmc_extend_filters(int32_t n, int32_t* index_start, int32_t* index_end); int openmc_extend_materials(int32_t n, int32_t* index_start, int32_t* index_end); + int openmc_extend_meshes(int32_t n, int32_t* index_start, int32_t* index_end); int openmc_extend_sources(int32_t n, int32_t* index_start, int32_t* index_end); int openmc_extend_tallies(int32_t n, int32_t* index_start, int32_t* index_end); int openmc_filter_get_id(int32_t index, int32_t* id); @@ -40,7 +41,9 @@ extern "C" { void openmc_get_filter_next_id(int32_t* id); int openmc_get_keff(double k_combined[]); int openmc_get_material_index(int32_t id, int32_t* index); + int openmc_get_mesh_index(int32_t id, int32_t* index); int openmc_get_nuclide_index(const char name[], int* index); + int64_t openmc_get_seed(); int openmc_get_tally_index(int32_t id, int32_t* index); void openmc_hard_reset(); void openmc_init(const int* intracomm); @@ -70,6 +73,7 @@ extern "C" { void openmc_plot_geometry(); void openmc_reset(); int openmc_run(); + void openmc_set_seed(int64_t new_seed); void openmc_simulation_finalize(); void openmc_simulation_init(); int openmc_source_bank(struct Bank** ptr, int64_t* n); From 8886313c939da0784ca132883b233cd2335dcc24 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 18 Apr 2018 07:17:02 -0500 Subject: [PATCH 169/231] Add description of openmc.capi.Mesh attributes in docstring --- openmc/capi/mesh.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openmc/capi/mesh.py b/openmc/capi/mesh.py index 326f5f61ed..091c5194b9 100644 --- a/openmc/capi/mesh.py +++ b/openmc/capi/mesh.py @@ -59,6 +59,16 @@ class Mesh(_FortranObjectWithID): ---------- id : int ID of the mesh + dimension : iterable of int + The number of mesh cells in each direction. + lower_left : numpy.ndarray + The lower-left corner of the structured mesh. If only two coordinate are + given, it is assumed that the mesh is an x-y mesh. + upper_right : numpy.ndarray + The upper-right corner of the structrued mesh. If only two coordinate + are given, it is assumed that the mesh is an x-y mesh. + width : numpy.ndarray + The width of mesh cells in each direction. """ __instances = WeakValueDictionary() From 39554e4614fcdddc7411dbdabc5dac5bf7cf924f Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 18 Apr 2018 15:54:04 -0500 Subject: [PATCH 170/231] Allow tallies to be activated from C API (mostly for CMFD) --- include/openmc.h | 2 ++ openmc/capi/tally.py | 18 +++++++++++++++- src/tallies/tally_header.F90 | 39 +++++++++++++++++++++++++++++++++++ tests/unit_tests/test_capi.py | 6 +++++- 4 files changed, 63 insertions(+), 2 deletions(-) diff --git a/include/openmc.h b/include/openmc.h index 0837881200..ed3a86054c 100644 --- a/include/openmc.h +++ b/include/openmc.h @@ -88,12 +88,14 @@ extern "C" { int openmc_sphharm_filter_set_order(int32_t index, int order); int openmc_sphharm_filter_set_cosine(int32_t index, const char cosine[]); void openmc_statepoint_write(const char filename[]); + int openmc_tally_get_active(int32_t index, bool* active); int openmc_tally_get_id(int32_t index, int32_t* id); int openmc_tally_get_filters(int32_t index, int32_t** indices, int* n); int openmc_tally_get_n_realizations(int32_t index, int32_t* n); int openmc_tally_get_nuclides(int32_t index, int** nuclides, int* n); int openmc_tally_get_scores(int32_t index, int** scores, int* n); int openmc_tally_results(int32_t index, double** ptr, int shape_[3]); + int openmc_tally_set_active(int32_t index, bool active); int openmc_tally_set_filters(int32_t index, int n, const int32_t* indices); int openmc_tally_set_id(int32_t index, int32_t id); int openmc_tally_set_nuclides(int32_t index, int n, const char** nuclides); diff --git a/openmc/capi/tally.py b/openmc/capi/tally.py index 46a967f690..a10fae47a3 100644 --- a/openmc/capi/tally.py +++ b/openmc/capi/tally.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from ctypes import c_int, c_int32, c_double, c_char_p, POINTER +from ctypes import c_int, c_int32, c_double, c_char_p, c_bool, POINTER from weakref import WeakValueDictionary import numpy as np @@ -26,6 +26,9 @@ _dll.openmc_get_tally_index.errcheck = _error_handler _dll.openmc_global_tallies.argtypes = [POINTER(POINTER(c_double))] _dll.openmc_global_tallies.restype = c_int _dll.openmc_global_tallies.errcheck = _error_handler +_dll.openmc_tally_get_active.argtypes = [c_int32, POINTER(c_bool)] +_dll.openmc_tally_get_active.restype = c_int +_dll.openmc_tally_get_active.errcheck = _error_handler _dll.openmc_tally_get_id.argtypes = [c_int32, POINTER(c_int32)] _dll.openmc_tally_get_id.restype = c_int _dll.openmc_tally_get_id.errcheck = _error_handler @@ -48,6 +51,9 @@ _dll.openmc_tally_results.argtypes = [ c_int32, POINTER(POINTER(c_double)), POINTER(c_int*3)] _dll.openmc_tally_results.restype = c_int _dll.openmc_tally_results.errcheck = _error_handler +_dll.openmc_tally_set_active.argtypes = [c_int32, c_bool] +_dll.openmc_tally_set_active.restype = c_int +_dll.openmc_tally_set_active.errcheck = _error_handler _dll.openmc_tally_set_filters.argtypes = [c_int32, c_int, POINTER(c_int32)] _dll.openmc_tally_set_filters.restype = c_int _dll.openmc_tally_set_filters.errcheck = _error_handler @@ -178,6 +184,16 @@ class Tally(_FortranObjectWithID): return cls.__instances[index] + @property + def active(self): + active = c_bool() + _dll.openmc_tally_get_active(self._index, active) + return active.value + + @active.setter + def active(self, active): + _dll.openmc_tally_set_active(self._index, active) + @property def id(self): tally_id = c_int32() diff --git a/src/tallies/tally_header.F90 b/src/tallies/tally_header.F90 index 02a578d7e0..413464b7b5 100644 --- a/src/tallies/tally_header.F90 +++ b/src/tallies/tally_header.F90 @@ -24,12 +24,14 @@ module tally_header public :: openmc_extend_tallies public :: openmc_get_tally_index public :: openmc_global_tallies + public :: openmc_tally_get_active public :: openmc_tally_get_id public :: openmc_tally_get_filters public :: openmc_tally_get_n_realizations public :: openmc_tally_get_nuclides public :: openmc_tally_get_scores public :: openmc_tally_results + public :: openmc_tally_set_active public :: openmc_tally_set_filters public :: openmc_tally_set_id public :: openmc_tally_set_nuclides @@ -512,6 +514,22 @@ contains end function openmc_global_tallies + function openmc_tally_get_active(index, active) result(err) bind(C) + ! Return whether a tally is active + integer(C_INT32_T), value :: index + logical(C_BOOL), intent(out) :: active + integer(C_INT) :: err + + if (index >= 1 .and. index <= size(tallies)) then + active = tallies(index) % obj % active + err = 0 + else + err = E_OUT_OF_BOUNDS + call set_errmsg('Index in tallies array is out of bounds.') + end if + end function openmc_tally_get_active + + function openmc_tally_get_id(index, id) result(err) bind(C) ! Return the ID of a tally integer(C_INT32_T), value :: index @@ -667,6 +685,27 @@ contains end function openmc_tally_set_filters + function openmc_tally_set_active(index, active) result(err) bind(C) + ! Set the ID of a tally + integer(C_INT32_T), value, intent(in) :: index + logical(C_BOOL), value, intent(in) :: active + integer(C_INT) :: err + + if (index >= 1 .and. index <= n_tallies) then + if (allocated(tallies(index) % obj)) then + tallies(index) % obj % active = active + err = 0 + else + err = E_ALLOCATE + call set_errmsg("Tally type has not been set yet.") + end if + else + err = E_OUT_OF_BOUNDS + call set_errmsg('Index in tallies array is out of bounds.') + end if + end function openmc_tally_set_active + + function openmc_tally_set_id(index, id) result(err) bind(C) ! Set the ID of a tally integer(C_INT32_T), value, intent(in) :: index diff --git a/tests/unit_tests/test_capi.py b/tests/unit_tests/test_capi.py index 6c05f5d3e3..a21e858fda 100644 --- a/tests/unit_tests/test_capi.py +++ b/tests/unit_tests/test_capi.py @@ -164,6 +164,10 @@ def test_tally(capi_init): t.scores = new_scores assert t.scores == new_scores + assert not t.active + t.active = True + assert t.active + def test_new_tally(capi_init): with pytest.raises(exc.AllocationError): @@ -177,7 +181,7 @@ def test_new_tally(capi_init): def test_tally_results(capi_run): t = openmc.capi.tallies[1] - assert t.num_realizations == 5 + assert t.num_realizations == 10 # t was made active in test_tally assert np.all(t.mean >= 0) nonzero = (t.mean > 0.0) assert np.all(t.std_dev[nonzero] >= 0) From 14455dc43ee623cf6072e33349c90edfe46d0100 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 12 Apr 2018 07:19:25 -0500 Subject: [PATCH 171/231] Write main() from C++ --- CMakeLists.txt | 6 +++-- include/openmc.h | 19 +++++++++++---- openmc/capi/core.py | 5 ++-- openmc/capi/settings.py | 6 ++--- src/main.F90 | 51 --------------------------------------- src/main.cpp | 40 ++++++++++++++++++++++++++++++ src/message_passing.F90 | 4 ++- src/nuclide_header.F90 | 2 +- src/particle_restart.F90 | 11 ++++++--- src/settings.F90 | 4 +-- src/simulation_header.F90 | 7 +++--- 11 files changed, 81 insertions(+), 74 deletions(-) delete mode 100644 src/main.F90 create mode 100644 src/main.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 1797ae5d31..81c16aa484 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -447,7 +447,9 @@ set(LIBOPENMC_CXX_SRC src/pugixml/pugixml.hpp) add_library(libopenmc SHARED ${LIBOPENMC_FORTRAN_SRC} ${LIBOPENMC_CXX_SRC}) set_target_properties(libopenmc PROPERTIES OUTPUT_NAME openmc) -add_executable(${program} src/main.F90) + +add_executable(${program} src/main.cpp) +target_include_directories(${program} PUBLIC include) #=============================================================================== # Add compiler/linker flags @@ -460,7 +462,7 @@ target_include_directories(libopenmc PUBLIC ${HDF5_INCLUDE_DIRS}) # The executable and the faddeeva package use only one language. They can be # set via target_compile_options which accepts a list. -target_compile_options(${program} PUBLIC ${f90flags}) +target_compile_options(${program} PUBLIC ${cxxflags}) target_compile_options(faddeeva PRIVATE ${cflags}) # The libopenmc library has both F90 and C++ so the compile flags must be set diff --git a/include/openmc.h b/include/openmc.h index ed3a86054c..1945453452 100644 --- a/include/openmc.h +++ b/include/openmc.h @@ -70,6 +70,7 @@ extern "C" { int openmc_meshsurface_filter_set_mesh(int32_t index, int32_t index_mesh); int openmc_next_batch(int* status); int openmc_nuclide_name(int index, char** name); + int openmc_particle_restart(); void openmc_plot_geometry(); void openmc_reset(); int openmc_run(); @@ -122,8 +123,9 @@ extern "C" { // Global variables extern char openmc_err_msg[256]; - extern double keff; - extern double keff_std; + extern double openmc_keff; + extern double openmc_keff_std; + extern bool openmc_master; extern int32_t n_batches; extern int32_t n_cells; extern int32_t n_filters; @@ -139,9 +141,16 @@ extern "C" { extern int32_t n_surfaces; extern int32_t n_tallies; extern int32_t n_universes; - extern int run_mode; - extern bool simulation_initialized; - extern int verbosity; + extern int openmc_run_mode; + extern bool openmc_simulation_initialized; + extern int openmc_verbosity; + + // Run modes + constexpr int RUN_MODE_FIXEDSOURCE {1}; + constexpr int RUN_MODE_EIGENVALUE {2}; + constexpr int RUN_MODE_PLOTTING {3}; + constexpr int RUN_MODE_PARTICLE {4}; + constexpr int RUN_MODE_VOLUME {5}; #ifdef __cplusplus } diff --git a/openmc/capi/core.py b/openmc/capi/core.py index f80b5fe540..d356905036 100644 --- a/openmc/capi/core.py +++ b/openmc/capi/core.py @@ -178,8 +178,9 @@ def keff(): return tuple(k) else: # Otherwise, return the tracklength estimator - mean = c_double.in_dll(_dll, 'keff').value - std_dev = c_double.in_dll(_dll, 'keff_std').value if n > 1 else np.inf + mean = c_double.in_dll(_dll, 'openmc_keff').value + std_dev = c_double.in_dll(_dll, 'openmc_keff_std').value \ + if n > 1 else np.inf return (mean, std_dev) diff --git a/openmc/capi/settings.py b/openmc/capi/settings.py index 1063d6463e..d706112c41 100644 --- a/openmc/capi/settings.py +++ b/openmc/capi/settings.py @@ -20,11 +20,11 @@ class _Settings(object): generations_per_batch = _DLLGlobal(c_int32, 'gen_per_batch') inactive = _DLLGlobal(c_int32, 'n_inactive') particles = _DLLGlobal(c_int64, 'n_particles') - verbosity = _DLLGlobal(c_int, 'verbosity') + verbosity = _DLLGlobal(c_int, 'openmc_verbosity') @property def run_mode(self): - i = c_int.in_dll(_dll, 'run_mode').value + i = c_int.in_dll(_dll, 'openmc_run_mode').value try: return _RUN_MODES[i] except KeyError: @@ -32,7 +32,7 @@ class _Settings(object): @run_mode.setter def run_mode(self, mode): - current_idx = c_int.in_dll(_dll, 'run_mode') + current_idx = c_int.in_dll(_dll, 'openmc_run_mode') for idx, mode_value in _RUN_MODES.items(): if mode_value == mode: current_idx.value = idx diff --git a/src/main.F90 b/src/main.F90 deleted file mode 100644 index 372e993f5d..0000000000 --- a/src/main.F90 +++ /dev/null @@ -1,51 +0,0 @@ -program main - - use, intrinsic :: ISO_C_BINDING - - use constants - use message_passing - use openmc_api, only: openmc_init, openmc_finalize, openmc_run, & - openmc_plot_geometry, openmc_calculate_volumes - use particle_restart, only: run_particle_restart - use settings, only: run_mode - - implicit none - - integer(C_INT) :: err -#ifdef OPENMC_MPI - integer :: mpi_err ! MPI error code -#endif - - ! Initialize run -- when run with MPI, pass communicator -#ifdef OPENMC_MPI -#ifdef OPENMC_MPIF08 - call openmc_init(MPI_COMM_WORLD % MPI_VAL) -#else - call openmc_init(MPI_COMM_WORLD) -#endif -#else - call openmc_init() -#endif - - ! start problem based on mode - select case (run_mode) - case (MODE_FIXEDSOURCE, MODE_EIGENVALUE) - err = openmc_run() - case (MODE_PLOTTING) - call openmc_plot_geometry() - case (MODE_PARTICLE) - if (master) call run_particle_restart() - case (MODE_VOLUME) - call openmc_calculate_volumes() - end select - - ! finalize run - call openmc_finalize() - -#ifdef OPENMC_MPI - ! If MPI is in use and enabled, terminate it - call MPI_FINALIZE(mpi_err) -#endif - - -end program main diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000000..7b2ccb5c3e --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,40 @@ +#include "openmc.h" + +#ifdef MPI +#include +#else +#define MPI_COMM_WORLD nullptr +#endif + + +int main(int argc, char** argv) { + int err; + + // Initialize run -- when run with MPI, pass communicator + openmc_init(MPI_COMM_WORLD); + + // start problem based on mode + switch (openmc_run_mode) { + case RUN_MODE_FIXEDSOURCE: + case RUN_MODE_EIGENVALUE: + err = openmc_run(); + break; + case RUN_MODE_PLOTTING: + openmc_plot_geometry(); + break; + case RUN_MODE_PARTICLE: + if (openmc_master) err = openmc_particle_restart(); + break; + case RUN_MODE_VOLUME: + openmc_calculate_volumes(); + break; + } + + // Finalize and free up memory + openmc_finalize(); + + // If MPI is in use and enabled, terminate it +#ifdef MPI + err = MPI_Finalize(); +#endif +} diff --git a/src/message_passing.F90 b/src/message_passing.F90 index 7391a632c7..f9a16ee759 100644 --- a/src/message_passing.F90 +++ b/src/message_passing.F90 @@ -1,5 +1,7 @@ module message_passing + use, intrinsic :: ISO_C_BINDING + #ifdef OPENMC_MPI #ifdef OPENMC_MPIF08 use mpi_f08 @@ -14,7 +16,7 @@ module message_passing integer :: n_procs = 1 ! number of processes integer :: rank = 0 ! rank of process - logical :: master = .true. ! master process? + logical(C_BOOL), bind(C, name='openmc_master') :: master = .true. ! master process? logical :: mpi_enabled = .false. ! is MPI in use and initialized? #ifdef OPENMC_MPIF08 type(MPI_Datatype) :: MPI_BANK ! MPI datatype for fission bank diff --git a/src/nuclide_header.F90 b/src/nuclide_header.F90 index 8362f5d41e..76fc26a748 100644 --- a/src/nuclide_header.F90 +++ b/src/nuclide_header.F90 @@ -277,7 +277,7 @@ contains integer, intent(inout) :: method real(8), intent(in) :: tolerance real(8), intent(in) :: minmax(2) ! range of temperatures - logical, intent(in) :: master ! if this is the master proc + logical(C_BOOL), intent(in) :: master ! if this is the master proc integer, intent(in) :: i_nuclide ! Nuclide index in nuclides integer :: i diff --git a/src/particle_restart.F90 b/src/particle_restart.F90 index 2d15f2ddc4..fc8a05277c 100644 --- a/src/particle_restart.F90 +++ b/src/particle_restart.F90 @@ -20,20 +20,23 @@ module particle_restart implicit none private - public :: run_particle_restart + public :: openmc_particle_restart contains !=============================================================================== -! RUN_PARTICLE_RESTART is the main routine that runs the particle restart +! OPENMC_PARTICLE_RESTART is the main routine that runs the particle restart !=============================================================================== - subroutine run_particle_restart() + function openmc_particle_restart() result(err) bind(C) + integer(C_INT) :: err integer(8) :: particle_seed integer :: previous_run_mode type(Particle) :: p + err = 0 + ! Set verbosity high verbosity = 10 @@ -66,7 +69,7 @@ contains deallocate(micro_xs) - end subroutine run_particle_restart + end function openmc_particle_restart !=============================================================================== ! READ_PARTICLE_RESTART reads the particle restart file diff --git a/src/settings.F90 b/src/settings.F90 index 83aebce860..4de72e8c4d 100644 --- a/src/settings.F90 +++ b/src/settings.F90 @@ -75,14 +75,14 @@ module settings real(8) :: weight_survive = ONE ! Mode to run in (fixed source, eigenvalue, plotting, etc) - integer(C_INT), bind(C) :: run_mode = NONE + integer(C_INT), bind(C, name='openmc_run_mode') :: run_mode = NONE ! Restart run logical :: restart_run = .false. ! The verbosity controls how much information will be printed to the screen ! and in logs - integer(C_INT), bind(C) :: verbosity = 7 + integer(C_INT), bind(C, name='openmc_verbosity') :: verbosity = 7 logical :: check_overlaps = .false. diff --git a/src/simulation_header.F90 b/src/simulation_header.F90 index 11be9bf9ca..67bf3062bd 100644 --- a/src/simulation_header.F90 +++ b/src/simulation_header.F90 @@ -23,7 +23,8 @@ module simulation_header integer :: current_batch ! current batch integer :: current_gen ! current generation within a batch integer :: total_gen = 0 ! total number of generations simulated - logical(C_BOOL), bind(C) :: simulation_initialized = .false. + logical(C_BOOL), bind(C, name='openmc_simulation_initialized') :: & + simulation_initialized = .false. logical :: need_depletion_rx ! need to calculate depletion reaction rx? ! ============================================================================ @@ -40,8 +41,8 @@ module simulation_header ! Temporary k-effective values type(VectorReal) :: k_generation ! single-generation estimates of k - real(C_DOUBLE), bind(C) :: keff = ONE ! average k over active batches - real(C_DOUBLE), bind(C) :: keff_std ! standard deviation of average k + real(C_DOUBLE), bind(C, name='openmc_keff') :: keff = ONE ! average k over active batches + real(C_DOUBLE), bind(C, name='openmc_keff_std') :: keff_std ! standard deviation of average k real(8) :: k_col_abs = ZERO ! sum over batches of k_collision * k_absorption real(8) :: k_col_tra = ZERO ! sum over batches of k_collision * k_tracklength real(8) :: k_abs_tra = ZERO ! sum over batches of k_absorption * k_tracklength From faf35d21bcd4b7e8163aa261e5a44ae948e25748 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 12 Apr 2018 07:45:47 -0500 Subject: [PATCH 172/231] Move openmc_run to C++ side --- CMakeLists.txt | 5 ++--- src/api.F90 | 1 - src/simulation.F90 | 20 -------------------- src/simulation.cpp | 18 ++++++++++++++++++ 4 files changed, 20 insertions(+), 24 deletions(-) create mode 100644 src/simulation.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 81c16aa484..d246cf57c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -440,6 +440,7 @@ set(LIBOPENMC_CXX_SRC src/hdf5_interface.h src/random_lcg.cpp src/random_lcg.h + src/simulation.cpp src/surface.cpp src/surface.h src/xml_interface.h @@ -447,9 +448,7 @@ set(LIBOPENMC_CXX_SRC src/pugixml/pugixml.hpp) add_library(libopenmc SHARED ${LIBOPENMC_FORTRAN_SRC} ${LIBOPENMC_CXX_SRC}) set_target_properties(libopenmc PROPERTIES OUTPUT_NAME openmc) - add_executable(${program} src/main.cpp) -target_include_directories(${program} PUBLIC include) #=============================================================================== # Add compiler/linker flags @@ -458,7 +457,7 @@ target_include_directories(${program} PUBLIC include) set_property(TARGET ${program} libopenmc pugixml_fortran PROPERTY LINKER_LANGUAGE Fortran) -target_include_directories(libopenmc PUBLIC ${HDF5_INCLUDE_DIRS}) +target_include_directories(libopenmc PUBLIC include ${HDF5_INCLUDE_DIRS}) # The executable and the faddeeva package use only one language. They can be # set via target_compile_options which accepts a list. diff --git a/src/api.F90 b/src/api.F90 index df183c292f..d7f3ed0235 100644 --- a/src/api.F90 +++ b/src/api.F90 @@ -80,7 +80,6 @@ module openmc_api public :: openmc_nuclide_name public :: openmc_plot_geometry public :: openmc_reset - public :: openmc_run public :: openmc_set_seed public :: openmc_simulation_finalize public :: openmc_simulation_init diff --git a/src/simulation.F90 b/src/simulation.F90 index 68debe52ba..e9729df038 100644 --- a/src/simulation.F90 +++ b/src/simulation.F90 @@ -44,7 +44,6 @@ module simulation implicit none private public :: openmc_next_batch - public :: openmc_run public :: openmc_simulation_init public :: openmc_simulation_finalize @@ -54,25 +53,6 @@ module simulation contains -!=============================================================================== -! OPENMC_RUN encompasses all the main logic where iterations are performed -! over the batches, generations, and histories in a fixed source or k-eigenvalue -! calculation. -!=============================================================================== - - function openmc_run() result(err) bind(C) - integer(C_INT) :: err - integer(C_INT) :: status - - call openmc_simulation_init() - do - err = openmc_next_batch(status) - if (status /= 0 .or. err < 0) exit - end do - call openmc_simulation_finalize() - - end function openmc_run - !=============================================================================== ! OPENMC_NEXT_BATCH !=============================================================================== diff --git a/src/simulation.cpp b/src/simulation.cpp new file mode 100644 index 0000000000..e9bf81775a --- /dev/null +++ b/src/simulation.cpp @@ -0,0 +1,18 @@ +#include "openmc.h" + +// OPENMC_RUN encompasses all the main logic where iterations are performed +// over the batches, generations, and histories in a fixed source or k-eigenvalue +// calculation. + +int openmc_run() { + openmc_simulation_init(); + + int err = 0; + int status = 0; + while (status == 0 && err == 0) { + err = openmc_next_batch(&status); + } + + openmc_simulation_finalize(); + return err; +} From 05e40a142feae458490704cbf132928919f256de Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 13 Apr 2018 15:03:16 -0500 Subject: [PATCH 173/231] Get rid of include_directories command in CMakeLists.txt --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d246cf57c2..ca3d837173 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,9 +10,6 @@ set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/include) # Set module path set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules) -# Make sure Fortran module directory is included when building -include_directories(${CMAKE_BINARY_DIR}/include) - #=============================================================================== # Architecture specific definitions #=============================================================================== @@ -457,7 +454,10 @@ add_executable(${program} src/main.cpp) set_property(TARGET ${program} libopenmc pugixml_fortran PROPERTY LINKER_LANGUAGE Fortran) -target_include_directories(libopenmc PUBLIC include ${HDF5_INCLUDE_DIRS}) +target_include_directories(libopenmc + PUBLIC include ${HDF5_INCLUDE_DIRS} + PRIVATE ${CMAKE_BINARY_DIR}/include + ) # The executable and the faddeeva package use only one language. They can be # set via target_compile_options which accepts a list. From b0c7f07d02cce03c89ff2b07bd52c2162cfda37e Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Mon, 16 Apr 2018 15:58:03 -0500 Subject: [PATCH 174/231] Start writing more HDF5 interface functions in C++ --- src/hdf5_interface.h | 158 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 148 insertions(+), 10 deletions(-) diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index 7ec9ada9b6..8a445b21e6 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -1,44 +1,153 @@ #ifndef HDF5_INTERFACE_H #define HDF5_INTERFACE_H -#include -#include +#include "error.h" #include "hdf5.h" +#include "hdf5_hl.h" -#include "error.h" +#include +#include +#include namespace openmc { +bool +using_mpio_device(hid_t obj_id) { + // Determine file that this object is part of + hid_t file_id = H5Iget_file_id(obj_id); + + // Get file access property list + hid_t fapl_id = H5Fget_access_plist(file_id); + + // Get low-level driver identifier + hid_t driver = H5Pget_driver(fapl_id); + + // Free resources + H5Pclose(fapl_id); + H5Fclose(file_id); + + return driver == H5FD_MPIO; +} + hid_t create_group(hid_t parent_id, char const *name) { hid_t out = H5Gcreate(parent_id, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (out < 0) { - std::string err_msg{"Failed to create HDF5 group \""}; - err_msg += name; - err_msg += "\""; + std::stringstream err_msg; + err_msg << "Failed to create HDF5 group \"" << name << "\""; fatal_error(err_msg); } return out; } - hid_t create_group(hid_t parent_id, const std::string &name) { return create_group(parent_id, name.c_str()); } +void +close_dataset(hid_t dataset_id) +{ + if (H5Dclose(dataset_id) < 0) fatal_error("Failed to close dataset"); +} + void close_group(hid_t group_id) { - herr_t err = H5Gclose(group_id); - if (err < 0) { - fatal_error("Failed to close HDF5 group"); + if (H5Gclose(group_id) < 0) fatal_error("Failed to close group"); +} + + +hid_t +file_open(const char* filename, char mode, bool parallel=false) +{ + bool create; + unsigned int flags; + switch (mode) { + case 'r': + case 'a': + create = false; + flags = (mode == 'r' ? H5F_ACC_RDONLY : H5F_ACC_RDWR); + break; + case 'w': + case 'x': + create = true; + flags = (mode == 'x' ? H5F_ACC_EXCL : H5F_ACC_TRUNC); + break; + } + + hid_t plist; + if (parallel) { + // Setup file access property list with parallel I/O access + plist = H5Pcreate(H5P_FILE_ACCESS); +#ifdef PHDF5 + H5Pset_fapl_mpio(plist, mpi_intracomm, MPI_INFO_NULL); +#endif + } else { + plist = H5P_DEFAULT; + } + + // Open the file collectively + hid_t file_id; + if (create) { + file_id = H5Fopen(filename, flags, plist); + } else { + file_id = H5Fcreate(filename, flags, H5P_DEFAULT, plist); + } + + // Close the property list + if (parallel) H5Pclose(plist); + + return file_id; +} + +hid_t +file_open(const std::string& filename, char mode, bool parallel=false) { + file_open(filename.c_str(), mode, parallel); +} + +void file_close(hid_t file_id) { + H5Fclose(file_id); +} + +bool +object_exists(hid_t object_id, const char* name) { + htri_t out = H5LTpath_valid(object_id, name, true); + if (out < 0) { + std::stringstream err_msg; + err_msg << "Failed to check if object \"" << name << "\" exists."; + fatal_error(err_msg); + } + return (out > 0); +} + + +hid_t +open_dataset(hid_t group_id, const char* name){ + if (object_exists(group_id, name)) { + return H5Dopen(group_id, name, H5P_DEFAULT); + } else { + std::stringstream err_msg; + err_msg << "Group \"" << name << "\" does not exist"; + fatal_error(err_msg); + } +} + + +hid_t +open_group(hid_t group_id, const char* name){ + if (object_exists(group_id, name)) { + return H5Gopen(group_id, name, H5P_DEFAULT); + } else { + std::stringstream err_msg; + err_msg << "Group \"" << name << "\" does not exist"; + fatal_error(err_msg); } } @@ -60,6 +169,35 @@ write_double_1D(hid_t group_id, char const *name, H5Dclose(dataset); } +void +write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, + double* buffer, bool indep) { + hid_t dspace = H5Screate_simple(ndim, dims, nullptr); + hid_t dset = H5Dcreate(group_id, name, H5T_NATIVE_DOUBLE, dspace, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + if (using_mpio_device(group_id)) { +#ifdef PHDF5 + // Set up collective vs independent I/O + auto data_xfer_mode {indep ? H5FD_MPIO_INDEPENDENT : H5FD_MPIO_COLLECTIVE}; + + // Create dataset transfer property list + hid_t plist = H5Pcreate(H5P_DATASET_XFER); + H5Pset_dxpl_mpio(plist, data_xfer_mode); + + // Write data + H5Dwrite(dset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, plist, buffer); + H5Pclose(plist); +#endif + } else { + H5Dwrite(dset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer); + } + + // Free resources + H5Dclose(dset); + H5Sclose(dspace); +} + void write_string(hid_t group_id, char const *name, char const *buffer) From c74f4738c12c4bf459335508743439efabc1d735 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 17 Apr 2018 14:08:59 -0500 Subject: [PATCH 175/231] Use HDF5 file_open from C side (and remove file_create) --- CMakeLists.txt | 1 + src/error.h | 5 +- src/hdf5_interface.F90 | 98 ++++--------------- src/hdf5_interface.cpp | 212 ++++++++++++++++++++++++++++++++++++++++ src/hdf5_interface.h | 208 +++------------------------------------ src/particle_header.F90 | 2 +- src/plot.F90 | 2 +- src/source.F90 | 4 +- src/state_point.F90 | 8 +- src/summary.F90 | 2 +- src/track_output.F90 | 2 +- src/volume_calc.F90 | 4 +- 12 files changed, 261 insertions(+), 287 deletions(-) create mode 100644 src/hdf5_interface.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index ca3d837173..ff7a3334be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -435,6 +435,7 @@ set(LIBOPENMC_FORTRAN_SRC set(LIBOPENMC_CXX_SRC src/error.h src/hdf5_interface.h + src/hdf5_interface.cpp src/random_lcg.cpp src/random_lcg.h src/simulation.cpp diff --git a/src/error.h b/src/error.h index 4c3373b3e3..91c2727452 100644 --- a/src/error.h +++ b/src/error.h @@ -12,18 +12,19 @@ namespace openmc { extern "C" void fatal_error_from_c(const char *message, int message_len); +inline void fatal_error(const char *message) { fatal_error_from_c(message, strlen(message)); } - +inline void fatal_error(const std::string &message) { fatal_error_from_c(message.c_str(), message.length()); } - +inline void fatal_error(const std::stringstream &message) { std::string out {message.str()}; diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 410149d9e7..0c8d22239a 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -19,6 +19,7 @@ module hdf5_interface #ifdef PHDF5 use message_passing, only: mpi_intracomm, MPI_INFO_NULL #endif + use string, only: to_c_string implicit none private @@ -84,7 +85,6 @@ module hdf5_interface public :: attribute_exists public :: write_attribute public :: read_attribute - public :: file_create public :: file_open public :: file_close public :: create_group @@ -101,98 +101,36 @@ module hdf5_interface contains -!=============================================================================== -! FILE_CREATE creates HDF5 file -!=============================================================================== - - function file_create(filename, parallel) result(file_id) - character(*), intent(in) :: filename ! name of file - logical, optional, intent(in) :: parallel ! whether to write in serial - integer(HID_T) :: file_id - - integer(HID_T) :: plist ! property list handle - integer :: hdf5_err ! HDF5 error code - logical :: parallel_ - - ! Check for serial option - parallel_ = .false. -#ifdef PHDF5 - if (present(parallel)) parallel_ = parallel -#endif - - if (parallel_) then - ! Setup file access property list with parallel I/O access - call h5pcreate_f(H5P_FILE_ACCESS_F, plist, hdf5_err) -#ifdef PHDF5 -#ifdef OPENMC_MPIF08 - call h5pset_fapl_mpio_f(plist, mpi_intracomm%MPI_VAL, & - MPI_INFO_NULL%MPI_VAL, hdf5_err) -#else - call h5pset_fapl_mpio_f(plist, mpi_intracomm, MPI_INFO_NULL, hdf5_err) -#endif -#endif - - ! Create the file collectively - call h5fcreate_f(trim(filename), H5F_ACC_TRUNC_F, file_id, hdf5_err, & - access_prp = plist) - - ! Close the property list - call h5pclose_f(plist, hdf5_err) - else - ! Create the file - call h5fcreate_f(trim(filename), H5F_ACC_TRUNC_F, file_id, hdf5_err) - end if - - end function file_create - !=============================================================================== ! FILE_OPEN opens HDF5 file !=============================================================================== function file_open(filename, mode, parallel) result(file_id) - character(*), intent(in) :: filename ! name of file - character(*), intent(in) :: mode ! access mode to file - logical, optional, intent(in) :: parallel ! whether to write in serial + character(*), intent(in) :: filename ! name of file + character, value :: mode ! access mode to file + logical, optional, intent(in) :: parallel ! whether to write in serial integer(HID_T) :: file_id - logical :: parallel_ - integer(HID_T) :: plist ! property list handle - integer :: hdf5_err ! HDF5 error code - integer :: open_mode ! HDF5 open mode + character(kind=C_CHAR) :: mode_ + logical(C_BOOL) :: parallel_ - ! Check for serial option + interface + function file_open_c(name, mode, parallel) bind(C, name='file_open') result(file_id) + import HID_T, C_CHAR, C_BOOL, C_INT + character(kind=C_CHAR) :: name(*) + character(kind=C_CHAR), value :: mode + logical(C_BOOL), value :: parallel + integer(HID_T) :: file_id + end function file_open_c + end interface + + mode_ = mode parallel_ = .false. #ifdef PHDF5 if (present(parallel)) parallel_ = parallel #endif - ! Determine access type - open_mode = H5F_ACC_RDONLY_F - if (mode == 'w') open_mode = H5F_ACC_RDWR_F - - if (parallel_) then - ! Setup file access property list with parallel I/O access - call h5pcreate_f(H5P_FILE_ACCESS_F, plist, hdf5_err) -#ifdef PHDF5 -#ifdef OPENMC_MPIF08 - call h5pset_fapl_mpio_f(plist, mpi_intracomm%MPI_VAL, & - MPI_INFO_NULL%MPI_VAL, hdf5_err) -#else - call h5pset_fapl_mpio_f(plist, mpi_intracomm, MPI_INFO_NULL, hdf5_err) -#endif -#endif - - ! Open the file collectively - call h5fopen_f(trim(filename), open_mode, file_id, hdf5_err, & - access_prp = plist) - - ! Close the property list - call h5pclose_f(plist, hdf5_err) - else - ! Open file - call h5fopen_f(trim(filename), open_mode, file_id, hdf5_err) - end if - + file_id = file_open_c(to_c_string(filename), mode, parallel_) end function file_open !=============================================================================== diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp new file mode 100644 index 0000000000..10357c91d9 --- /dev/null +++ b/src/hdf5_interface.cpp @@ -0,0 +1,212 @@ +#include "hdf5_interface.h" +#include "error.h" + +#include "hdf5.h" +#include "hdf5_hl.h" + +#include +#include +#include + +namespace openmc { + +bool +using_mpio_device(hid_t obj_id) { + // Determine file that this object is part of + hid_t file_id = H5Iget_file_id(obj_id); + + // Get file access property list + hid_t fapl_id = H5Fget_access_plist(file_id); + + // Get low-level driver identifier + hid_t driver = H5Pget_driver(fapl_id); + + // Free resources + H5Pclose(fapl_id); + H5Fclose(file_id); + + return driver == H5FD_MPIO; +} + + +hid_t +create_group(hid_t parent_id, char const *name) +{ + hid_t out = H5Gcreate(parent_id, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (out < 0) { + std::stringstream err_msg; + err_msg << "Failed to create HDF5 group \"" << name << "\""; + fatal_error(err_msg); + } + return out; +} + +hid_t +create_group(hid_t parent_id, const std::string &name) +{ + return create_group(parent_id, name.c_str()); +} + +void +close_dataset(hid_t dataset_id) +{ + if (H5Dclose(dataset_id) < 0) fatal_error("Failed to close dataset"); +} + + +void +close_group(hid_t group_id) +{ + if (H5Gclose(group_id) < 0) fatal_error("Failed to close group"); +} + + +hid_t +file_open(const char* filename, char mode, bool parallel) +{ + bool create; + unsigned int flags; + switch (mode) { + case 'r': + case 'a': + create = false; + flags = (mode == 'r' ? H5F_ACC_RDONLY : H5F_ACC_RDWR); + break; + case 'w': + case 'x': + create = true; + flags = (mode == 'x' ? H5F_ACC_EXCL : H5F_ACC_TRUNC); + break; + default: + std::stringstream err_msg; + err_msg << "Invalid file mode: " << mode; + fatal_error(err_msg); + } + + hid_t plist = H5P_DEFAULT; +#ifdef PHDF5 + if (parallel) { + // Setup file access property list with parallel I/O access + plist = H5Pcreate(H5P_FILE_ACCESS); + H5Pset_fapl_mpio(plist, mpi_intracomm, MPI_INFO_NULL); + } +#endif + + // Open the file collectively + hid_t file_id; + if (create) { + file_id = H5Fcreate(filename, flags, H5P_DEFAULT, plist); + } else { + file_id = H5Fopen(filename, flags, plist); + } + +#ifdef PHDF5 + // Close the property list + if (parallel) H5Pclose(plist); +#endif + + return file_id; +} + +hid_t +file_open(const std::string& filename, char mode, bool parallel=false) { + file_open(filename.c_str(), mode, parallel); +} + +void file_close(hid_t file_id) { + H5Fclose(file_id); +} + +bool +object_exists(hid_t object_id, const char* name) { + htri_t out = H5LTpath_valid(object_id, name, true); + if (out < 0) { + std::stringstream err_msg; + err_msg << "Failed to check if object \"" << name << "\" exists."; + fatal_error(err_msg); + } + return (out > 0); +} + + +hid_t +open_dataset(hid_t group_id, const char* name){ + if (object_exists(group_id, name)) { + return H5Dopen(group_id, name, H5P_DEFAULT); + } else { + std::stringstream err_msg; + err_msg << "Group \"" << name << "\" does not exist"; + fatal_error(err_msg); + } +} + + +hid_t +open_group(hid_t group_id, const char* name){ + if (object_exists(group_id, name)) { + return H5Gopen(group_id, name, H5P_DEFAULT); + } else { + std::stringstream err_msg; + err_msg << "Group \"" << name << "\" does not exist"; + fatal_error(err_msg); + } +} + + +void +write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, + double* buffer, bool indep) { + hid_t dspace = H5Screate_simple(ndim, dims, nullptr); + hid_t dset = H5Dcreate(group_id, name, H5T_NATIVE_DOUBLE, dspace, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + if (using_mpio_device(group_id)) { +#ifdef PHDF5 + // Set up collective vs independent I/O + auto data_xfer_mode {indep ? H5FD_MPIO_INDEPENDENT : H5FD_MPIO_COLLECTIVE}; + + // Create dataset transfer property list + hid_t plist = H5Pcreate(H5P_DATASET_XFER); + H5Pset_dxpl_mpio(plist, data_xfer_mode); + + // Write data + H5Dwrite(dset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, plist, buffer); + H5Pclose(plist); +#endif + } else { + H5Dwrite(dset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer); + } + + // Free resources + H5Dclose(dset); + H5Sclose(dspace); +} + + +void +write_string(hid_t group_id, char const *name, char const *buffer) +{ + size_t buffer_len = strlen(buffer); + hid_t datatype = H5Tcopy(H5T_C_S1); + H5Tset_size(datatype, buffer_len); + + hid_t dataspace = H5Screate(H5S_SCALAR); + + hid_t dataset = H5Dcreate(group_id, name, datatype, dataspace, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + H5Dwrite(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer); + + H5Tclose(datatype); + H5Sclose(dataspace); + H5Dclose(dataset); +} + + +void +write_string(hid_t group_id, char const *name, const std::string &buffer) +{ + write_string(group_id, name, buffer.c_str()); +} + +} diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index 8a445b21e6..b79e0a29cb 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -1,8 +1,6 @@ #ifndef HDF5_INTERFACE_H #define HDF5_INTERFACE_H -#include "error.h" - #include "hdf5.h" #include "hdf5_hl.h" @@ -13,143 +11,17 @@ namespace openmc { -bool -using_mpio_device(hid_t obj_id) { - // Determine file that this object is part of - hid_t file_id = H5Iget_file_id(obj_id); - - // Get file access property list - hid_t fapl_id = H5Fget_access_plist(file_id); - - // Get low-level driver identifier - hid_t driver = H5Pget_driver(fapl_id); - - // Free resources - H5Pclose(fapl_id); - H5Fclose(file_id); - - return driver == H5FD_MPIO; -} - - -hid_t -create_group(hid_t parent_id, char const *name) -{ - hid_t out = H5Gcreate(parent_id, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (out < 0) { - std::stringstream err_msg; - err_msg << "Failed to create HDF5 group \"" << name << "\""; - fatal_error(err_msg); - } - return out; -} - -hid_t -create_group(hid_t parent_id, const std::string &name) -{ - return create_group(parent_id, name.c_str()); -} - -void -close_dataset(hid_t dataset_id) -{ - if (H5Dclose(dataset_id) < 0) fatal_error("Failed to close dataset"); -} - - -void -close_group(hid_t group_id) -{ - if (H5Gclose(group_id) < 0) fatal_error("Failed to close group"); -} - - -hid_t -file_open(const char* filename, char mode, bool parallel=false) -{ - bool create; - unsigned int flags; - switch (mode) { - case 'r': - case 'a': - create = false; - flags = (mode == 'r' ? H5F_ACC_RDONLY : H5F_ACC_RDWR); - break; - case 'w': - case 'x': - create = true; - flags = (mode == 'x' ? H5F_ACC_EXCL : H5F_ACC_TRUNC); - break; - } - - hid_t plist; - if (parallel) { - // Setup file access property list with parallel I/O access - plist = H5Pcreate(H5P_FILE_ACCESS); -#ifdef PHDF5 - H5Pset_fapl_mpio(plist, mpi_intracomm, MPI_INFO_NULL); -#endif - } else { - plist = H5P_DEFAULT; - } - - // Open the file collectively - hid_t file_id; - if (create) { - file_id = H5Fopen(filename, flags, plist); - } else { - file_id = H5Fcreate(filename, flags, H5P_DEFAULT, plist); - } - - // Close the property list - if (parallel) H5Pclose(plist); - - return file_id; -} - -hid_t -file_open(const std::string& filename, char mode, bool parallel=false) { - file_open(filename.c_str(), mode, parallel); -} - -void file_close(hid_t file_id) { - H5Fclose(file_id); -} - -bool -object_exists(hid_t object_id, const char* name) { - htri_t out = H5LTpath_valid(object_id, name, true); - if (out < 0) { - std::stringstream err_msg; - err_msg << "Failed to check if object \"" << name << "\" exists."; - fatal_error(err_msg); - } - return (out > 0); -} - - -hid_t -open_dataset(hid_t group_id, const char* name){ - if (object_exists(group_id, name)) { - return H5Dopen(group_id, name, H5P_DEFAULT); - } else { - std::stringstream err_msg; - err_msg << "Group \"" << name << "\" does not exist"; - fatal_error(err_msg); - } -} - - -hid_t -open_group(hid_t group_id, const char* name){ - if (object_exists(group_id, name)) { - return H5Gopen(group_id, name, H5P_DEFAULT); - } else { - std::stringstream err_msg; - err_msg << "Group \"" << name << "\" does not exist"; - fatal_error(err_msg); - } -} +bool using_mpio_device(hid_t obj_id); +hid_t create_group(hid_t parent_id, const char* name); +hid_t create_group(hid_t parent_id, const std::string& name); +void close_dataset(hid_t dataset_id); +void close_group(hid_t group_id); +extern "C" hid_t file_open(const char* filename, char mode, bool parallel); +hid_t file_open(const std::string& filename, char mode, bool parallel); +void file_close(hid_t file_id); +bool object_exists(hid_t object_id, const char* name); +hid_t open_dataset(hid_t group_id, const char* name); +hid_t open_group(hid_t group_id, const char* name); template void @@ -169,61 +41,11 @@ write_double_1D(hid_t group_id, char const *name, H5Dclose(dataset); } -void -write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, - double* buffer, bool indep) { - hid_t dspace = H5Screate_simple(ndim, dims, nullptr); - hid_t dset = H5Dcreate(group_id, name, H5T_NATIVE_DOUBLE, dspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); +void write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, + double* buffer, bool indep); - if (using_mpio_device(group_id)) { -#ifdef PHDF5 - // Set up collective vs independent I/O - auto data_xfer_mode {indep ? H5FD_MPIO_INDEPENDENT : H5FD_MPIO_COLLECTIVE}; - - // Create dataset transfer property list - hid_t plist = H5Pcreate(H5P_DATASET_XFER); - H5Pset_dxpl_mpio(plist, data_xfer_mode); - - // Write data - H5Dwrite(dset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, plist, buffer); - H5Pclose(plist); -#endif - } else { - H5Dwrite(dset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer); - } - - // Free resources - H5Dclose(dset); - H5Sclose(dspace); -} - - -void -write_string(hid_t group_id, char const *name, char const *buffer) -{ - size_t buffer_len = strlen(buffer); - hid_t datatype = H5Tcopy(H5T_C_S1); - H5Tset_size(datatype, buffer_len); - - hid_t dataspace = H5Screate(H5S_SCALAR); - - hid_t dataset = H5Dcreate(group_id, name, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - H5Dwrite(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer); - - H5Tclose(datatype); - H5Sclose(dataspace); - H5Dclose(dataset); -} - - -void -write_string(hid_t group_id, char const *name, const std::string &buffer) -{ - write_string(group_id, name, buffer.c_str()); -} +void write_string(hid_t group_id, char const *name, char const *buffer); +void write_string(hid_t group_id, char const *name, const std::string &buffer); } // namespace openmc #endif //HDF5_INTERFACE_H diff --git a/src/particle_header.F90 b/src/particle_header.F90 index 552f9b042d..02fb55405a 100644 --- a/src/particle_header.F90 +++ b/src/particle_header.F90 @@ -312,7 +312,7 @@ contains !$omp critical (WriteParticleRestart) ! Create file - file_id = file_create(filename) + file_id = file_open(filename, 'w') associate (src => source_bank(current_work)) ! Write filetype and version info diff --git a/src/plot.F90 b/src/plot.F90 index 5eb894ce8d..92b8f350df 100644 --- a/src/plot.F90 +++ b/src/plot.F90 @@ -371,7 +371,7 @@ contains p % coord(1) % universe = root_universe ! Open binary plot file for writing - file_id = file_create(pl%path_plot) + file_id = file_open(pl%path_plot, 'w') ! write header info call write_attribute(file_id, "filetype", 'voxel') diff --git a/src/source.F90 b/src/source.F90 index 5beecd8870..9e3a0831de 100644 --- a/src/source.F90 +++ b/src/source.F90 @@ -12,7 +12,7 @@ module source use distribution_multivariate, only: SpatialBox use error, only: fatal_error use geometry, only: find_cell - use hdf5_interface, only: file_create, file_open, file_close, read_dataset + use hdf5_interface, only: file_open, file_close, read_dataset use math use message_passing, only: rank use mgxs_header, only: rev_energy_bins, num_energy_groups @@ -88,7 +88,7 @@ contains if (write_initial_source) then call write_message('Writing out initial source...', 5) filename = trim(path_output) // 'initial_source.h5' - file_id = file_create(filename, parallel=.true.) + file_id = file_open(filename, 'w', parallel=.true.) call write_source_bank(file_id) call file_close(file_id) end if diff --git a/src/state_point.F90 b/src/state_point.F90 index 980a7333cd..62240f110a 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -76,7 +76,7 @@ contains if (master) then ! Create statepoint file - file_id = file_create(filename_) + file_id = file_open(filename_, 'w') ! Write file type call write_attribute(file_id, "filetype", "statepoint") @@ -476,7 +476,7 @@ contains ! Create separate source file if (master .or. parallel) then - file_id = file_create(filename, parallel=.true.) + file_id = file_open(filename, 'w', parallel=.true.) call write_dataset(file_id, "filetype", 'source') end if else @@ -485,7 +485,7 @@ contains filename = trim(filename) // '.h5' if (master .or. parallel) then - file_id = file_open(filename, 'w', parallel=.true.) + file_id = file_open(filename, 'a', parallel=.true.) end if end if @@ -498,7 +498,7 @@ contains filename = trim(path_output) // 'source' // '.h5' call write_message("Creating source file " // trim(filename) // "...", 5) if (master .or. parallel) then - file_id = file_create(filename, parallel=.true.) + file_id = file_open(filename, 'w', parallel=.true.) call write_dataset(file_id, "filetype", 'source') end if diff --git a/src/summary.F90 b/src/summary.F90 index 3aeb42178b..9f27694d1b 100644 --- a/src/summary.F90 +++ b/src/summary.F90 @@ -38,7 +38,7 @@ contains call write_message("Writing summary.h5 file...", 5) ! Create a new file using default properties. - file_id = file_create("summary.h5") + file_id = file_open("summary.h5", 'w') call write_header(file_id) call write_nuclides(file_id) diff --git a/src/track_output.F90 b/src/track_output.F90 index 244bf182e0..350e687b1c 100644 --- a/src/track_output.F90 +++ b/src/track_output.F90 @@ -115,7 +115,7 @@ contains end do !$omp critical (FinalizeParticleTrack) - file_id = file_create(fname) + file_id = file_open(fname, 'w') call write_attribute(file_id, 'filetype', 'track') call write_attribute(file_id, 'version', VERSION_TRACK) call write_attribute(file_id, 'n_particles', n_particle_tracks) diff --git a/src/volume_calc.F90 b/src/volume_calc.F90 index e374f21064..ac813a94af 100644 --- a/src/volume_calc.F90 +++ b/src/volume_calc.F90 @@ -11,7 +11,7 @@ module volume_calc use error, only: write_message use geometry, only: find_cell use geometry_header, only: universes, cells - use hdf5_interface, only: file_create, file_close, write_attribute, & + use hdf5_interface, only: file_open, file_close, write_attribute, & create_group, close_group, write_dataset use output, only: header, time_stamp use material_header, only: materials @@ -435,7 +435,7 @@ contains character(MAX_WORD_LEN), allocatable :: nucnames(:) ! names of nuclides ! Create HDF5 file - file_id = file_create(filename) + file_id = file_open(filename, 'w') ! Write header info call write_attribute(file_id, "filetype", "volume") From b3bd34e51b887d4f9099aa089f2c2bdea4255edd Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 17 Apr 2018 15:29:35 -0500 Subject: [PATCH 176/231] Use file_close from C --- src/hdf5_interface.F90 | 19 +++++++------------ src/hdf5_interface.h | 2 +- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 0c8d22239a..fa1f6093b6 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -99,6 +99,13 @@ module hdf5_interface public :: get_datasets public :: get_name + interface + subroutine file_close(file_id) bind(C) + import HID_T + integer(HID_T), value :: file_id + end subroutine file_close + end interface + contains !=============================================================================== @@ -133,18 +140,6 @@ contains file_id = file_open_c(to_c_string(filename), mode, parallel_) end function file_open -!=============================================================================== -! FILE_CLOSE closes HDF5 file -!=============================================================================== - - subroutine file_close(file_id) - integer(HID_T), intent(in) :: file_id - - integer :: hdf5_err - - call h5fclose_f(file_id, hdf5_err) - end subroutine file_close - !=============================================================================== ! GET_GROUPS Gets a list of all the groups in a given location. !=============================================================================== diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index b79e0a29cb..3ddd59374e 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -18,7 +18,7 @@ void close_dataset(hid_t dataset_id); void close_group(hid_t group_id); extern "C" hid_t file_open(const char* filename, char mode, bool parallel); hid_t file_open(const std::string& filename, char mode, bool parallel); -void file_close(hid_t file_id); +extern "C" void file_close(hid_t file_id); bool object_exists(hid_t object_id, const char* name); hid_t open_dataset(hid_t group_id, const char* name); hid_t open_group(hid_t group_id, const char* name); From dcde6a331a8ddb0e469a7a0cd04c48ae2892e5f9 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 17 Apr 2018 16:14:22 -0500 Subject: [PATCH 177/231] Use HDF5 write_double from C++ --- src/hdf5_interface.F90 | 219 ++++++----------------------------------- src/hdf5_interface.cpp | 2 +- src/hdf5_interface.h | 4 +- 3 files changed, 34 insertions(+), 191 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index fa1f6093b6..040b115482 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -104,6 +104,17 @@ module hdf5_interface import HID_T integer(HID_T), value :: file_id end subroutine file_close + + subroutine write_double_c(group_id, ndim, dims, name, buffer, indep) & + bind(C, name='write_double') + import HID_T, HSIZE_T, C_INT, C_DOUBLE, C_CHAR, C_BOOL, C_PTR + integer(HID_T), value :: group_id + integer(C_INT), value :: ndim + integer(HSIZE_T), intent(in) :: dims(*) + character(kind=C_CHAR), intent(in) :: name(*) + real(C_DOUBLE), intent(in) :: buffer(*) + logical(C_BOOL), intent(in) :: indep + end subroutine write_double_c end interface contains @@ -472,57 +483,15 @@ contains logical, intent(in), optional :: indep ! independent I/O integer(HSIZE_T) :: dims(1) + logical(C_BOOL) :: indep_ dims(:) = shape(buffer) - if (present(indep)) then - call write_double_1D_explicit(group_id, dims, name, buffer, indep) - else - call write_double_1D_explicit(group_id, dims, name, buffer) - end if + indep_ = .false. + if (present(indep)) indep_ = indep + + call write_double_c(group_id, 1, dims, to_c_string(name), buffer, indep_) end subroutine write_double_1D - subroutine write_double_1D_explicit(group_id, dims, name, buffer, indep) - integer(HID_T), intent(in) :: group_id - integer(HSIZE_T), intent(in) :: dims(1) - character(*), intent(in) :: name ! name of data - real(8), intent(in), target :: buffer(dims(1)) ! data to write - logical, intent(in), optional :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - integer(HID_T) :: dset ! data set handle - integer(HID_T) :: dspace ! data or file space handle - type(c_ptr) :: f_ptr - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - call h5screate_simple_f(1, dims, dspace, hdf5_err) - call h5dcreate_f(group_id, trim(name), H5T_NATIVE_DOUBLE, & - dspace, dset, hdf5_err) - f_ptr = c_loc(buffer) - - if (using_mpio_device(group_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dwrite_f(dset, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dwrite_f(dset, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err) - end if - - call h5dclose_f(dset, hdf5_err) - call h5sclose_f(dspace, hdf5_err) - end subroutine write_double_1D_explicit - !=============================================================================== ! READ_DOUBLE_1D reads double precision 1-D array data !=============================================================================== @@ -600,57 +569,15 @@ contains logical, intent(in), optional :: indep ! independent I/O integer(HSIZE_T) :: dims(2) + logical(C_BOOL) :: indep_ dims(:) = shape(buffer) - if (present(indep)) then - call write_double_2D_explicit(group_id, dims, name, buffer, indep) - else - call write_double_2D_explicit(group_id, dims, name, buffer) - end if + indep_ = .false. + if (present(indep)) indep_ = indep + + call write_double_c(group_id, 2, dims, to_c_string(name), buffer, indep_) end subroutine write_double_2D - subroutine write_double_2D_explicit(group_id, dims, name, buffer, indep) - integer(HID_T), intent(in) :: group_id - integer(HSIZE_T), intent(in) :: dims(2) - character(*), intent(in) :: name ! name of data - real(8), intent(in), target :: buffer(dims(1),dims(2)) - logical, intent(in), optional :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - integer(HID_T) :: dset ! data set handle - integer(HID_T) :: dspace ! data or file space handle - type(c_ptr) :: f_ptr - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - call h5screate_simple_f(2, dims, dspace, hdf5_err) - call h5dcreate_f(group_id, trim(name), H5T_NATIVE_DOUBLE, & - dspace, dset, hdf5_err) - f_ptr = c_loc(buffer) - - if (using_mpio_device(group_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dwrite_f(dset, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dwrite_f(dset, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err) - end if - - call h5dclose_f(dset, hdf5_err) - call h5sclose_f(dspace, hdf5_err) - end subroutine write_double_2D_explicit - !=============================================================================== ! READ_DOUBLE_2D reads double precision 2-D array data !=============================================================================== @@ -728,57 +655,15 @@ contains logical, intent(in), optional :: indep ! independent I/O integer(HSIZE_T) :: dims(3) + logical(C_BOOL) :: indep_ dims(:) = shape(buffer) - if (present(indep)) then - call write_double_3D_explicit(group_id, dims, name, buffer, indep) - else - call write_double_3D_explicit(group_id, dims, name, buffer) - end if + indep_ = .false. + if (present(indep)) indep_ = indep + + call write_double_c(group_id, 3, dims, to_c_string(name), buffer, indep_) end subroutine write_double_3D - subroutine write_double_3D_explicit(group_id, dims, name, buffer, indep) - integer(HID_T), intent(in) :: group_id - integer(HSIZE_T), intent(in) :: dims(3) - character(*), intent(in) :: name ! name of data - real(8), intent(in), target :: buffer(dims(1),dims(2),dims(3)) - logical, intent(in), optional :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - integer(HID_T) :: dset ! data set handle - integer(HID_T) :: dspace ! data or file space handle - type(c_ptr) :: f_ptr - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - call h5screate_simple_f(3, dims, dspace, hdf5_err) - call h5dcreate_f(group_id, trim(name), H5T_NATIVE_DOUBLE, & - dspace, dset, hdf5_err) - f_ptr = c_loc(buffer) - - if (using_mpio_device(group_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dwrite_f(dset, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dwrite_f(dset, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err) - end if - - call h5dclose_f(dset, hdf5_err) - call h5sclose_f(dspace, hdf5_err) - end subroutine write_double_3D_explicit - !=============================================================================== ! READ_DOUBLE_3D reads double precision 3-D array data !=============================================================================== @@ -856,57 +741,15 @@ contains logical, intent(in), optional :: indep ! independent I/O integer(HSIZE_T) :: dims(4) + logical(C_BOOL) :: indep_ dims(:) = shape(buffer) - if (present(indep)) then - call write_double_4D_explicit(group_id, dims, name, buffer, indep) - else - call write_double_4D_explicit(group_id, dims, name, buffer) - end if + indep_ = .false. + if (present(indep)) indep_ = indep + + call write_double_c(group_id, 1, dims, to_c_string(name), buffer, indep_) end subroutine write_double_4D - subroutine write_double_4D_explicit(group_id, dims, name, buffer, indep) - integer(HID_T), intent(in) :: group_id - integer(HSIZE_T), intent(in) :: dims(4) - character(*), intent(in) :: name ! name of data - real(8), intent(in), target :: buffer(dims(1),dims(2),dims(3),dims(4)) - logical, intent(in), optional :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - integer(HID_T) :: dset ! data set handle - integer(HID_T) :: dspace ! data or file space handle - type(c_ptr) :: f_ptr - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - call h5screate_simple_f(4, dims, dspace, hdf5_err) - call h5dcreate_f(group_id, trim(name), H5T_NATIVE_DOUBLE, & - dspace, dset, hdf5_err) - f_ptr = c_loc(buffer) - - if (using_mpio_device(group_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dwrite_f(dset, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dwrite_f(dset, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err) - end if - - call h5dclose_f(dset, hdf5_err) - call h5sclose_f(dspace, hdf5_err) - end subroutine write_double_4D_explicit - !=============================================================================== ! READ_DOUBLE_4D reads double precision 4-D array data !=============================================================================== diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index 10357c91d9..a2ccef7f7d 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -155,7 +155,7 @@ open_group(hid_t group_id, const char* name){ void write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, - double* buffer, bool indep) { + const double* buffer, bool indep) { hid_t dspace = H5Screate_simple(ndim, dims, nullptr); hid_t dset = H5Dcreate(group_id, name, H5T_NATIVE_DOUBLE, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index 3ddd59374e..bbf5ce5e88 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -41,8 +41,8 @@ write_double_1D(hid_t group_id, char const *name, H5Dclose(dataset); } -void write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, - double* buffer, bool indep); +extern "C" void write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, + const double* buffer, bool indep); void write_string(hid_t group_id, char const *name, char const *buffer); void write_string(hid_t group_id, char const *name, const std::string &buffer); From ef1956e8113db9618693b8aa49b3ff427272b136 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 17 Apr 2018 22:55:07 -0500 Subject: [PATCH 178/231] Convert HDF5 read_double to C++ --- src/hdf5_interface.F90 | 274 ++++++++--------------------------------- src/hdf5_interface.cpp | 58 +++++++-- src/hdf5_interface.h | 7 +- 3 files changed, 104 insertions(+), 235 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 040b115482..b9e6c414e6 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -105,9 +105,18 @@ module hdf5_interface integer(HID_T), value :: file_id end subroutine file_close + subroutine read_double_c(obj_id, name, buffer, indep) & + bind(C, name='read_double') + import HID_T, C_DOUBLE, C_BOOL, C_PTR + integer(HID_T), value :: obj_id + type(C_PTR), value :: name + real(C_DOUBLE), intent(in) :: buffer(*) + logical(C_BOOL), intent(in) :: indep + end subroutine read_double_c + subroutine write_double_c(group_id, ndim, dims, name, buffer, indep) & bind(C, name='write_double') - import HID_T, HSIZE_T, C_INT, C_DOUBLE, C_CHAR, C_BOOL, C_PTR + import HID_T, HSIZE_T, C_INT, C_DOUBLE, C_CHAR, C_BOOL integer(HID_T), value :: group_id integer(C_INT), value :: ndim integer(HSIZE_T), intent(in) :: dims(*) @@ -388,40 +397,15 @@ contains real(8), intent(in), target :: buffer ! data to write logical, intent(in), optional :: indep ! independent I/O - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - integer(HID_T) :: dset ! data set handle - integer(HID_T) :: dspace ! data or file space handle - type(c_ptr) :: f_ptr + integer(HSIZE_T) :: dims(0) + logical(C_BOOL) :: indep_ + real(C_DOUBLE) :: value(1) - ! Set up independentive vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if + indep_ = .false. + if (present(indep)) indep_ = indep + value(1) = buffer - ! Create dataspace and dataset - call h5screate_f(H5S_SCALAR_F, dspace, hdf5_err) - call h5dcreate_f(group_id, trim(name), H5T_NATIVE_DOUBLE, & - dspace, dset, hdf5_err) - f_ptr = c_loc(buffer) - - if (using_mpio_device(group_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dwrite_f(dset, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dwrite_f(dset, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err) - end if - - call h5dclose_f(dset, hdf5_err) - call h5sclose_f(dspace, hdf5_err) + call write_double_c(group_id, 0, dims, to_c_string(name), value, indep_) end subroutine write_double !=============================================================================== @@ -502,62 +486,22 @@ contains character(*), optional, intent(in) :: name logical, optional, intent(in) :: indep ! independent I/O - integer :: hdf5_err - integer(HID_T) :: dset_id - integer(HSIZE_T) :: dims(1) + logical(C_BOOL) :: indep_ + character(kind=C_CHAR), target, allocatable :: name_(:) + + indep_ = .false. + if (present(indep)) indep_ = indep ! If 'name' argument is passed, obj_id is interpreted to be a group and ! 'name' is the name of the dataset we should read from if (present(name)) then - call h5dopen_f(obj_id, trim(name), dset_id, hdf5_err) + name_ = to_c_string(name) + call read_double_c(obj_id, c_loc(name_), buffer, indep_) else - dset_id = obj_id + call read_double_c(obj_id, C_NULL_PTR, buffer, indep_) end if - - dims(:) = shape(buffer) - - if (present(indep)) then - call read_double_1D_explicit(dset_id, dims, buffer, indep) - else - call read_double_1D_explicit(dset_id, dims, buffer) - end if - - if (present(name)) call h5dclose_f(dset_id, hdf5_err) end subroutine read_double_1D - subroutine read_double_1D_explicit(dset_id, dims, buffer, indep) - integer(HID_T), intent(in) :: dset_id - integer(HSIZE_T), intent(in) :: dims(1) - real(8), target, intent(inout) :: buffer(dims(1)) - logical, optional, intent(in) :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - type(c_ptr) :: f_ptr - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - f_ptr = c_loc(buffer) - - if (using_mpio_device(dset_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dread_f(dset_id, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dread_f(dset_id, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err) - end if - end subroutine read_double_1D_explicit - !=============================================================================== ! WRITE_DOUBLE_2D writes double precision 2-D array data !=============================================================================== @@ -588,62 +532,22 @@ contains character(*), optional, intent(in) :: name logical, optional, intent(in) :: indep ! independent I/O - integer :: hdf5_err - integer(HID_T) :: dset_id - integer(HSIZE_T) :: dims(2) + logical(C_BOOL) :: indep_ + character(kind=C_CHAR), target, allocatable :: name_(:) + + indep_ = .false. + if (present(indep)) indep_ = indep ! If 'name' argument is passed, obj_id is interpreted to be a group and ! 'name' is the name of the dataset we should read from if (present(name)) then - call h5dopen_f(obj_id, trim(name), dset_id, hdf5_err) + name_ = to_c_string(name) + call read_double_c(obj_id, c_loc(name_), buffer, indep_) else - dset_id = obj_id + call read_double_c(obj_id, C_NULL_PTR, buffer, indep_) end if - - dims(:) = shape(buffer) - - if (present(indep)) then - call read_double_2D_explicit(dset_id, dims, buffer, indep) - else - call read_double_2D_explicit(dset_id, dims, buffer) - end if - - if (present(name)) call h5dclose_f(dset_id, hdf5_err) end subroutine read_double_2D - subroutine read_double_2D_explicit(dset_id, dims, buffer, indep) - integer(HID_T), intent(in) :: dset_id - integer(HSIZE_T), intent(in) :: dims(2) - real(8), target, intent(inout) :: buffer(dims(1),dims(2)) - logical, optional, intent(in) :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - type(c_ptr) :: f_ptr - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - f_ptr = c_loc(buffer) - - if (using_mpio_device(dset_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dread_f(dset_id, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dread_f(dset_id, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err) - end if - end subroutine read_double_2D_explicit - !=============================================================================== ! WRITE_DOUBLE_3D writes double precision 3-D array data !=============================================================================== @@ -674,62 +578,22 @@ contains character(*), optional, intent(in) :: name logical, optional, intent(in) :: indep ! independent I/O - integer :: hdf5_err - integer(HID_T) :: dset_id - integer(HSIZE_T) :: dims(3) + logical(C_BOOL) :: indep_ + character(kind=C_CHAR), target, allocatable :: name_(:) + + indep_ = .false. + if (present(indep)) indep_ = indep ! If 'name' argument is passed, obj_id is interpreted to be a group and ! 'name' is the name of the dataset we should read from if (present(name)) then - call h5dopen_f(obj_id, trim(name), dset_id, hdf5_err) + name_ = to_c_string(name) + call read_double_c(obj_id, c_loc(name_), buffer, indep_) else - dset_id = obj_id + call read_double_c(obj_id, C_NULL_PTR, buffer, indep_) end if - - dims(:) = shape(buffer) - - if (present(indep)) then - call read_double_3D_explicit(dset_id, dims, buffer, indep) - else - call read_double_3D_explicit(dset_id, dims, buffer) - end if - - if (present(name)) call h5dclose_f(dset_id, hdf5_err) end subroutine read_double_3D - subroutine read_double_3D_explicit(dset_id, dims, buffer, indep) - integer(HID_T), intent(in) :: dset_id - integer(HSIZE_T), intent(in) :: dims(3) - real(8), target, intent(inout) :: buffer(dims(1),dims(2),dims(3)) - logical, optional, intent(in) :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - type(c_ptr) :: f_ptr - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - f_ptr = c_loc(buffer) - - if (using_mpio_device(dset_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dread_f(dset_id, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dread_f(dset_id, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err) - end if - end subroutine read_double_3D_explicit - !=============================================================================== ! WRITE_DOUBLE_4D writes double precision 4-D array data !=============================================================================== @@ -760,62 +624,22 @@ contains character(*), optional, intent(in) :: name logical, optional, intent(in) :: indep ! independent I/O - integer :: hdf5_err - integer(HID_T) :: dset_id - integer(HSIZE_T) :: dims(4) + logical(C_BOOL) :: indep_ + character(kind=C_CHAR), target, allocatable :: name_(:) + + indep_ = .false. + if (present(indep)) indep_ = indep ! If 'name' argument is passed, obj_id is interpreted to be a group and ! 'name' is the name of the dataset we should read from if (present(name)) then - call h5dopen_f(obj_id, trim(name), dset_id, hdf5_err) + name_ = to_c_string(name) + call read_double_c(obj_id, c_loc(name_), buffer, indep_) else - dset_id = obj_id + call read_double_c(obj_id, C_NULL_PTR, buffer, indep_) end if - - dims(:) = shape(buffer) - - if (present(indep)) then - call read_double_4D_explicit(dset_id, dims, buffer, indep) - else - call read_double_4D_explicit(dset_id, dims, buffer) - end if - - if (present(name)) call h5dclose_f(dset_id, hdf5_err) end subroutine read_double_4D - subroutine read_double_4D_explicit(dset_id, dims, buffer, indep) - integer(HID_T), intent(in) :: dset_id - integer(HSIZE_T), intent(in) :: dims(4) - real(8), target, intent(inout) :: buffer(dims(1),dims(2),dims(3),dims(4)) - logical, optional, intent(in) :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - type(c_ptr) :: f_ptr - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - f_ptr = c_loc(buffer) - - if (using_mpio_device(dset_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dread_f(dset_id, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dread_f(dset_id, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err) - end if - end subroutine read_double_4D_explicit - !=============================================================================== ! WRITE_INTEGER writes integer precision scalar data !=============================================================================== diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index a2ccef7f7d..6b9bd97987 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -11,7 +11,8 @@ namespace openmc { bool -using_mpio_device(hid_t obj_id) { +using_mpio_device(hid_t obj_id) +{ // Determine file that this object is part of hid_t file_id = H5Iget_file_id(obj_id); @@ -109,16 +110,19 @@ file_open(const char* filename, char mode, bool parallel) } hid_t -file_open(const std::string& filename, char mode, bool parallel=false) { +file_open(const std::string& filename, char mode, bool parallel=false) +{ file_open(filename.c_str(), mode, parallel); } -void file_close(hid_t file_id) { +void file_close(hid_t file_id) +{ H5Fclose(file_id); } bool -object_exists(hid_t object_id, const char* name) { +object_exists(hid_t object_id, const char* name) +{ htri_t out = H5LTpath_valid(object_id, name, true); if (out < 0) { std::stringstream err_msg; @@ -130,7 +134,8 @@ object_exists(hid_t object_id, const char* name) { hid_t -open_dataset(hid_t group_id, const char* name){ +open_dataset(hid_t group_id, const char* name) +{ if (object_exists(group_id, name)) { return H5Dopen(group_id, name, H5P_DEFAULT); } else { @@ -142,7 +147,8 @@ open_dataset(hid_t group_id, const char* name){ hid_t -open_group(hid_t group_id, const char* name){ +open_group(hid_t group_id, const char* name) +{ if (object_exists(group_id, name)) { return H5Gopen(group_id, name, H5P_DEFAULT); } else { @@ -153,10 +159,46 @@ open_group(hid_t group_id, const char* name){ } +void +read_double(hid_t obj_id, const char* name, double* buffer, bool indep) +{ + hid_t dset = obj_id; + if (name) dset = H5Dopen(obj_id, name, H5P_DEFAULT); + + if (using_mpio_device(dset)) { +#ifdef PHDF5 + // Set up collective vs independent I/O + auto data_xfer_mode {indep ? H5FD_MPIO_INDEPENDENT : H5FD_MPIO_COLLECTIVE}; + + // Create dataset transfer property list + hid_t plist = H5Pcreate(H5P_DATASET_XFER); + H5Pset_dxpl_mpio(plist, data_xfer_mode); + + // Write data + H5Dread(dset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, plist, buffer); + H5Pclose(plist); +#endif + } else { + H5Dread(dset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer); + } + + if (name) H5Dclose(dset); +} + + void write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, - const double* buffer, bool indep) { - hid_t dspace = H5Screate_simple(ndim, dims, nullptr); + const double* buffer, bool indep) +{ + // If array is given, create a simple dataspace. Otherwise, create a scalar + // datascape. + hid_t dspace; + if (ndim > 0) { + dspace = H5Screate_simple(ndim, dims, nullptr); + } else { + dspace = H5Screate(H5S_SCALAR); + } + hid_t dset = H5Dcreate(group_id, name, H5T_NATIVE_DOUBLE, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index bbf5ce5e88..6902493afb 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -41,8 +41,11 @@ write_double_1D(hid_t group_id, char const *name, H5Dclose(dataset); } -extern "C" void write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, - const double* buffer, bool indep); +extern "C" void read_double(hid_t obj_id, const char* name, double* buffer, + bool indep); + +extern "C" void write_double(hid_t group_id, int ndim, const hsize_t* dims, + const char* name, const double* buffer, bool indep); void write_string(hid_t group_id, char const *name, char const *buffer); void write_string(hid_t group_id, char const *name, const std::string &buffer); From 1648da04a34b39dd5bd688a1dc301a839e79a407 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 17 Apr 2018 22:59:07 -0500 Subject: [PATCH 179/231] Move routines around --- src/hdf5_interface.F90 | 164 +++++++++++++++++------------------------ 1 file changed, 68 insertions(+), 96 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index b9e6c414e6..ece930266e 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -28,7 +28,7 @@ module hdf5_interface integer(HID_T), public :: hdf5_integer8_t ! type for integer(8) interface write_dataset - module procedure write_double + module procedure write_double_0D module procedure write_double_1D module procedure write_double_2D module procedure write_double_3D @@ -387,27 +387,6 @@ contains end if end subroutine close_dataset -!=============================================================================== -! WRITE_DOUBLE writes double precision scalar data -!=============================================================================== - - subroutine write_double(group_id, name, buffer, indep) - integer(HID_T), intent(in) :: group_id - character(*), intent(in) :: name ! name for data - real(8), intent(in), target :: buffer ! data to write - logical, intent(in), optional :: indep ! independent I/O - - integer(HSIZE_T) :: dims(0) - logical(C_BOOL) :: indep_ - real(C_DOUBLE) :: value(1) - - indep_ = .false. - if (present(indep)) indep_ = indep - value(1) = buffer - - call write_double_c(group_id, 0, dims, to_c_string(name), value, indep_) - end subroutine write_double - !=============================================================================== ! READ_DOUBLE reads double precision scalar data !=============================================================================== @@ -457,9 +436,26 @@ contains end subroutine read_double !=============================================================================== -! WRITE_DOUBLE_1D writes double precision 1-D array data +! WRITE_DOUBLE_ND writes double precision N-D array data !=============================================================================== + subroutine write_double_0D(group_id, name, buffer, indep) + integer(HID_T), intent(in) :: group_id + character(*), intent(in) :: name ! name for data + real(8), intent(in), target :: buffer ! data to write + logical, intent(in), optional :: indep ! independent I/O + + integer(HSIZE_T) :: dims(0) + logical(C_BOOL) :: indep_ + real(C_DOUBLE) :: value(1) + + indep_ = .false. + if (present(indep)) indep_ = indep + value(1) = buffer + + call write_double_c(group_id, 0, dims, to_c_string(name), value, indep_) + end subroutine write_double_0D + subroutine write_double_1D(group_id, name, buffer, indep) integer(HID_T), intent(in) :: group_id character(*), intent(in) :: name ! name of data @@ -476,8 +472,56 @@ contains call write_double_c(group_id, 1, dims, to_c_string(name), buffer, indep_) end subroutine write_double_1D + subroutine write_double_2D(group_id, name, buffer, indep) + integer(HID_T), intent(in) :: group_id + character(*), intent(in) :: name ! name of data + real(8), intent(in), target :: buffer(:,:) ! data to write + logical, intent(in), optional :: indep ! independent I/O + + integer(HSIZE_T) :: dims(2) + logical(C_BOOL) :: indep_ + + dims(:) = shape(buffer) + indep_ = .false. + if (present(indep)) indep_ = indep + + call write_double_c(group_id, 2, dims, to_c_string(name), buffer, indep_) + end subroutine write_double_2D + + subroutine write_double_3D(group_id, name, buffer, indep) + integer(HID_T), intent(in) :: group_id + character(*), intent(in) :: name ! name of data + real(8), intent(in), target :: buffer(:,:,:) ! data to write + logical, intent(in), optional :: indep ! independent I/O + + integer(HSIZE_T) :: dims(3) + logical(C_BOOL) :: indep_ + + dims(:) = shape(buffer) + indep_ = .false. + if (present(indep)) indep_ = indep + + call write_double_c(group_id, 3, dims, to_c_string(name), buffer, indep_) + end subroutine write_double_3D + + subroutine write_double_4D(group_id, name, buffer, indep) + integer(HID_T), intent(in) :: group_id + character(*), intent(in) :: name ! name of data + real(8), intent(in), target :: buffer(:,:,:,:) ! data to write + logical, intent(in), optional :: indep ! independent I/O + + integer(HSIZE_T) :: dims(4) + logical(C_BOOL) :: indep_ + + dims(:) = shape(buffer) + indep_ = .false. + if (present(indep)) indep_ = indep + + call write_double_c(group_id, 1, dims, to_c_string(name), buffer, indep_) + end subroutine write_double_4D + !=============================================================================== -! READ_DOUBLE_1D reads double precision 1-D array data +! READ_DOUBLE_ND reads double precision N-D array data !=============================================================================== subroutine read_double_1D(buffer, obj_id, name, indep) @@ -502,30 +546,6 @@ contains end if end subroutine read_double_1D -!=============================================================================== -! WRITE_DOUBLE_2D writes double precision 2-D array data -!=============================================================================== - - subroutine write_double_2D(group_id, name, buffer, indep) - integer(HID_T), intent(in) :: group_id - character(*), intent(in) :: name ! name of data - real(8), intent(in), target :: buffer(:,:) ! data to write - logical, intent(in), optional :: indep ! independent I/O - - integer(HSIZE_T) :: dims(2) - logical(C_BOOL) :: indep_ - - dims(:) = shape(buffer) - indep_ = .false. - if (present(indep)) indep_ = indep - - call write_double_c(group_id, 2, dims, to_c_string(name), buffer, indep_) - end subroutine write_double_2D - -!=============================================================================== -! READ_DOUBLE_2D reads double precision 2-D array data -!=============================================================================== - subroutine read_double_2D(buffer, obj_id, name, indep) real(8), target, intent(inout) :: buffer(:,:) integer(HID_T), intent(in) :: obj_id @@ -548,30 +568,6 @@ contains end if end subroutine read_double_2D -!=============================================================================== -! WRITE_DOUBLE_3D writes double precision 3-D array data -!=============================================================================== - - subroutine write_double_3D(group_id, name, buffer, indep) - integer(HID_T), intent(in) :: group_id - character(*), intent(in) :: name ! name of data - real(8), intent(in), target :: buffer(:,:,:) ! data to write - logical, intent(in), optional :: indep ! independent I/O - - integer(HSIZE_T) :: dims(3) - logical(C_BOOL) :: indep_ - - dims(:) = shape(buffer) - indep_ = .false. - if (present(indep)) indep_ = indep - - call write_double_c(group_id, 3, dims, to_c_string(name), buffer, indep_) - end subroutine write_double_3D - -!=============================================================================== -! READ_DOUBLE_3D reads double precision 3-D array data -!=============================================================================== - subroutine read_double_3D(buffer, obj_id, name, indep) real(8), target, intent(inout) :: buffer(:,:,:) integer(HID_T), intent(in) :: obj_id @@ -594,30 +590,6 @@ contains end if end subroutine read_double_3D -!=============================================================================== -! WRITE_DOUBLE_4D writes double precision 4-D array data -!=============================================================================== - - subroutine write_double_4D(group_id, name, buffer, indep) - integer(HID_T), intent(in) :: group_id - character(*), intent(in) :: name ! name of data - real(8), intent(in), target :: buffer(:,:,:,:) ! data to write - logical, intent(in), optional :: indep ! independent I/O - - integer(HSIZE_T) :: dims(4) - logical(C_BOOL) :: indep_ - - dims(:) = shape(buffer) - indep_ = .false. - if (present(indep)) indep_ = indep - - call write_double_c(group_id, 1, dims, to_c_string(name), buffer, indep_) - end subroutine write_double_4D - -!=============================================================================== -! READ_DOUBLE_4D reads double precision 4-D array data -!=============================================================================== - subroutine read_double_4D(buffer, obj_id, name, indep) real(8), target, intent(inout) :: buffer(:,:,:,:) integer(HID_T), intent(in) :: obj_id From 46270774c543b81fc20ef24ff2dcab85948332db Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 18 Apr 2018 06:22:13 -0500 Subject: [PATCH 180/231] Convert HDF5 write_integer to C++ --- src/hdf5_interface.F90 | 352 +++++++++-------------------------------- src/hdf5_interface.cpp | 26 ++- src/hdf5_interface.h | 4 + 3 files changed, 102 insertions(+), 280 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index ece930266e..562e35661e 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -33,7 +33,7 @@ module hdf5_interface module procedure write_double_2D module procedure write_double_3D module procedure write_double_4D - module procedure write_integer + module procedure write_integer_0D module procedure write_integer_1D module procedure write_integer_2D module procedure write_integer_3D @@ -124,6 +124,17 @@ module hdf5_interface real(C_DOUBLE), intent(in) :: buffer(*) logical(C_BOOL), intent(in) :: indep end subroutine write_double_c + + subroutine write_int_c(group_id, ndim, dims, name, buffer, indep) & + bind(C, name='write_int') + import HID_T, HSIZE_T, C_INT, C_CHAR, C_BOOL + integer(HID_T), value :: group_id + integer(C_INT), value :: ndim + integer(HSIZE_T), intent(in) :: dims(*) + character(kind=C_CHAR), intent(in) :: name(*) + integer(C_INT), intent(in) :: buffer(*) + logical(C_BOOL), intent(in) :: indep + end subroutine write_int_c end interface contains @@ -447,13 +458,13 @@ contains integer(HSIZE_T) :: dims(0) logical(C_BOOL) :: indep_ - real(C_DOUBLE) :: value(1) + real(C_DOUBLE) :: buffer_(1) indep_ = .false. if (present(indep)) indep_ = indep - value(1) = buffer + buffer_(1) = buffer - call write_double_c(group_id, 0, dims, to_c_string(name), value, indep_) + call write_double_c(group_id, 0, dims, to_c_string(name), buffer_, indep_) end subroutine write_double_0D subroutine write_double_1D(group_id, name, buffer, indep) @@ -612,52 +623,6 @@ contains end if end subroutine read_double_4D -!=============================================================================== -! WRITE_INTEGER writes integer precision scalar data -!=============================================================================== - - subroutine write_integer(group_id, name, buffer, indep) - integer(HID_T), intent(in) :: group_id - character(*), intent(in) :: name ! name for data - integer, intent(in), target :: buffer ! data to write - logical, intent(in), optional :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - integer(HID_T) :: dset ! data set handle - integer(HID_T) :: dspace ! data or file space handle - type(c_ptr) :: f_ptr - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - ! Create dataspace and dataset - call h5screate_f(H5S_SCALAR_F, dspace, hdf5_err) - call h5dcreate_f(group_id, trim(name), H5T_NATIVE_INTEGER, & - dspace, dset, hdf5_err) - f_ptr = c_loc(buffer) - - if (using_mpio_device(group_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dwrite_f(dset, H5T_NATIVE_INTEGER, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dwrite_f(dset, H5T_NATIVE_INTEGER, f_ptr, hdf5_err) - end if - - call h5dclose_f(dset, hdf5_err) - call h5sclose_f(dspace, hdf5_err) - end subroutine write_integer - !=============================================================================== ! READ_INTEGER reads integer precision scalar data !=============================================================================== @@ -707,9 +672,26 @@ contains end subroutine read_integer !=============================================================================== -! WRITE_INTEGER_1D writes integer precision 1-D array data +! WRITE_INTEGER_ND writes integer precision N-D array data !=============================================================================== + subroutine write_integer_0D(group_id, name, buffer, indep) + integer(HID_T), intent(in) :: group_id + character(*), intent(in) :: name ! name for data + integer, intent(in), target :: buffer ! data to write + logical, intent(in), optional :: indep ! independent I/O + + integer(HSIZE_T) :: dims(0) + logical(C_BOOL) :: indep_ + integer(C_INT) :: buffer_(1) + + indep_ = .false. + if (present(indep)) indep_ = indep + buffer_(1) = buffer + + call write_int_c(group_id, 0, dims, to_c_string(name), buffer_, indep_) + end subroutine write_integer_0D + subroutine write_integer_1D(group_id, name, buffer, indep) integer(HID_T), intent(in) :: group_id character(*), intent(in) :: name ! name of data @@ -717,56 +699,62 @@ contains logical, intent(in), optional :: indep ! independent I/O integer(HSIZE_T) :: dims(1) + logical(C_BOOL) :: indep_ dims(:) = shape(buffer) - if (present(indep)) then - call write_integer_1D_explicit(group_id, dims, name, buffer, indep) - else - call write_integer_1D_explicit(group_id, dims, name, buffer) - end if + indep_ = .false. + if (present(indep)) indep_ = indep + + call write_int_c(group_id, 1, dims, to_c_string(name), buffer, indep_) end subroutine write_integer_1D - subroutine write_integer_1D_explicit(group_id, dims, name, buffer, indep) + subroutine write_integer_2D(group_id, name, buffer, indep) integer(HID_T), intent(in) :: group_id - integer(HSIZE_T), intent(in) :: dims(1) character(*), intent(in) :: name ! name of data - integer, intent(in), target :: buffer(dims(1)) ! data to write + integer, intent(in), target :: buffer(:,:) ! data to write logical, intent(in), optional :: indep ! independent I/O - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - integer(HID_T) :: dset ! data set handle - integer(HID_T) :: dspace ! data or file space handle - type(c_ptr) :: f_ptr + integer(HSIZE_T) :: dims(2) + logical(C_BOOL) :: indep_ - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if + dims(:) = shape(buffer) + indep_ = .false. + if (present(indep)) indep_ = indep - call h5screate_simple_f(1, dims, dspace, hdf5_err) - call h5dcreate_f(group_id, trim(name), H5T_NATIVE_INTEGER, & - dspace, dset, hdf5_err) - f_ptr = c_loc(buffer) + call write_int_c(group_id, 2, dims, to_c_string(name), buffer, indep_) + end subroutine write_integer_2D - if (using_mpio_device(group_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dwrite_f(dset, H5T_NATIVE_INTEGER, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dwrite_f(dset, H5T_NATIVE_INTEGER, f_ptr, hdf5_err) - end if + subroutine write_integer_3D(group_id, name, buffer, indep) + integer(HID_T), intent(in) :: group_id + character(*), intent(in) :: name ! name of data + integer, intent(in), target :: buffer(:,:,:) ! data to write + logical, intent(in), optional :: indep ! independent I/O - call h5dclose_f(dset, hdf5_err) - call h5sclose_f(dspace, hdf5_err) - end subroutine write_integer_1D_explicit + integer(HSIZE_T) :: dims(3) + logical(C_BOOL) :: indep_ + + dims(:) = shape(buffer) + indep_ = .false. + if (present(indep)) indep_ = indep + + call write_int_c(group_id, 3, dims, to_c_string(name), buffer, indep_) + end subroutine write_integer_3D + + subroutine write_integer_4D(group_id, name, buffer, indep) + integer(HID_T), intent(in) :: group_id + character(*), intent(in) :: name ! name of data + integer, intent(in), target :: buffer(:,:,:,:) ! data to write + logical, intent(in), optional :: indep ! independent I/O + + integer(HSIZE_T) :: dims(4) + logical(C_BOOL) :: indep_ + + dims(:) = shape(buffer) + indep_ = .false. + if (present(indep)) indep_ = indep + + call write_int_c(group_id, 3, dims, to_c_string(name), buffer, indep_) + end subroutine write_integer_4D !=============================================================================== ! READ_INTEGER_1D reads integer precision 1-D array data @@ -834,68 +822,6 @@ contains end if end subroutine read_integer_1D_explicit -!=============================================================================== -! WRITE_INTEGER_2D writes integer precision 2-D array data -!=============================================================================== - - subroutine write_integer_2D(group_id, name, buffer, indep) - integer(HID_T), intent(in) :: group_id - character(*), intent(in) :: name ! name of data - integer, intent(in), target :: buffer(:,:) ! data to write - logical, intent(in), optional :: indep ! independent I/O - - integer(HSIZE_T) :: dims(2) - - dims(:) = shape(buffer) - if (present(indep)) then - call write_integer_2D_explicit(group_id, dims, name, buffer, indep) - else - call write_integer_2D_explicit(group_id, dims, name, buffer) - end if - end subroutine write_integer_2D - - subroutine write_integer_2D_explicit(group_id, dims, name, buffer, indep) - integer(HID_T), intent(in) :: group_id - integer(HSIZE_T), intent(in) :: dims(2) - character(*), intent(in) :: name ! name of data - integer, intent(in), target :: buffer(dims(1),dims(2)) - logical, intent(in), optional :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - integer(HID_T) :: dset ! data set handle - integer(HID_T) :: dspace ! data or file space handle - type(c_ptr) :: f_ptr - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - call h5screate_simple_f(2, dims, dspace, hdf5_err) - call h5dcreate_f(group_id, trim(name), H5T_NATIVE_INTEGER, & - dspace, dset, hdf5_err) - f_ptr = c_loc(buffer) - - if (using_mpio_device(group_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dwrite_f(dset, H5T_NATIVE_INTEGER, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dwrite_f(dset, H5T_NATIVE_INTEGER, f_ptr, hdf5_err) - end if - - call h5dclose_f(dset, hdf5_err) - call h5sclose_f(dspace, hdf5_err) - end subroutine write_integer_2D_explicit - !=============================================================================== ! READ_INTEGER_2D reads integer precision 2-D array data !=============================================================================== @@ -962,68 +888,6 @@ contains end if end subroutine read_integer_2D_explicit -!=============================================================================== -! WRITE_INTEGER_3D writes integer precision 3-D array data -!=============================================================================== - - subroutine write_integer_3D(group_id, name, buffer, indep) - integer(HID_T), intent(in) :: group_id - character(*), intent(in) :: name ! name of data - integer, intent(in), target :: buffer(:,:,:) ! data to write - logical, intent(in), optional :: indep ! independent I/O - - integer(HSIZE_T) :: dims(3) - - dims(:) = shape(buffer) - if (present(indep)) then - call write_integer_3D_explicit(group_id, dims, name, buffer, indep) - else - call write_integer_3D_explicit(group_id, dims, name, buffer) - end if - end subroutine write_integer_3D - - subroutine write_integer_3D_explicit(group_id, dims, name, buffer, indep) - integer(HID_T), intent(in) :: group_id - integer(HSIZE_T), intent(in) :: dims(3) - character(*), intent(in) :: name ! name of data - integer, intent(in), target :: buffer(dims(1),dims(2),dims(3)) - logical, intent(in), optional :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - integer(HID_T) :: dset ! data set handle - integer(HID_T) :: dspace ! data or file space handle - type(c_ptr) :: f_ptr - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - call h5screate_simple_f(3, dims, dspace, hdf5_err) - call h5dcreate_f(group_id, trim(name), H5T_NATIVE_INTEGER, & - dspace, dset, hdf5_err) - f_ptr = c_loc(buffer) - - if (using_mpio_device(group_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dwrite_f(dset, H5T_NATIVE_INTEGER, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dwrite_f(dset, H5T_NATIVE_INTEGER, f_ptr, hdf5_err) - end if - - call h5dclose_f(dset, hdf5_err) - call h5sclose_f(dspace, hdf5_err) - end subroutine write_integer_3D_explicit - !=============================================================================== ! READ_INTEGER_3D reads integer precision 3-D array data !=============================================================================== @@ -1090,68 +954,6 @@ contains end if end subroutine read_integer_3D_explicit -!=============================================================================== -! WRITE_INTEGER_4D writes integer precision 4-D array data -!=============================================================================== - - subroutine write_integer_4D(group_id, name, buffer, indep) - integer(HID_T), intent(in) :: group_id - character(*), intent(in) :: name ! name of data - integer, intent(in), target :: buffer(:,:,:,:) ! data to write - logical, intent(in), optional :: indep ! independent I/O - - integer(HSIZE_T) :: dims(4) - - dims(:) = shape(buffer) - if (present(indep)) then - call write_integer_4D_explicit(group_id, dims, name, buffer, indep) - else - call write_integer_4D_explicit(group_id, dims, name, buffer) - end if - end subroutine write_integer_4D - - subroutine write_integer_4D_explicit(group_id, dims, name, buffer, indep) - integer(HID_T), intent(in) :: group_id - integer(HSIZE_T), intent(in) :: dims(4) - character(*), intent(in) :: name ! name of data - integer, intent(in), target :: buffer(dims(1),dims(2),dims(3),dims(4)) - logical, intent(in), optional :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - integer(HID_T) :: dset ! data set handle - integer(HID_T) :: dspace ! data or file space handle - type(c_ptr) :: f_ptr - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - call h5screate_simple_f(4, dims, dspace, hdf5_err) - call h5dcreate_f(group_id, trim(name), H5T_NATIVE_INTEGER, & - dspace, dset, hdf5_err) - f_ptr = c_loc(buffer) - - if (using_mpio_device(group_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dwrite_f(dset, H5T_NATIVE_INTEGER, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dwrite_f(dset, H5T_NATIVE_INTEGER, f_ptr, hdf5_err) - end if - - call h5dclose_f(dset, hdf5_err) - call h5sclose_f(dspace, hdf5_err) - end subroutine write_integer_4D_explicit - !=============================================================================== ! READ_INTEGER_4D reads integer precision 4-D array data !=============================================================================== diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index 6b9bd97987..349c1876de 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -187,8 +187,8 @@ read_double(hid_t obj_id, const char* name, double* buffer, bool indep) void -write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, - const double* buffer, bool indep) +write_array(hid_t group_id, int ndim, const hsize_t* dims, const char* name, + hid_t mem_type_id, const void* buffer, bool indep) { // If array is given, create a simple dataspace. Otherwise, create a scalar // datascape. @@ -199,7 +199,7 @@ write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, dspace = H5Screate(H5S_SCALAR); } - hid_t dset = H5Dcreate(group_id, name, H5T_NATIVE_DOUBLE, dspace, + hid_t dset = H5Dcreate(group_id, name, mem_type_id, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (using_mpio_device(group_id)) { @@ -212,11 +212,11 @@ write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, H5Pset_dxpl_mpio(plist, data_xfer_mode); // Write data - H5Dwrite(dset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, plist, buffer); + H5Dwrite(dset, mem_type_id, H5S_ALL, H5S_ALL, plist, buffer); H5Pclose(plist); #endif } else { - H5Dwrite(dset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer); + H5Dwrite(dset, mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer); } // Free resources @@ -225,6 +225,22 @@ write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, } +void +write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, + const double* buffer, bool indep) +{ + write_array(group_id, ndim, dims, name, H5T_NATIVE_DOUBLE, buffer, indep); +} + + +void +write_int(hid_t group_id, int ndim, const hsize_t* dims, const char* name, + const int* buffer, bool indep) +{ + write_array(group_id, ndim, dims, name, H5T_NATIVE_INT, buffer, indep); +} + + void write_string(hid_t group_id, char const *name, char const *buffer) { diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index 6902493afb..f2bef3b0b7 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -44,8 +44,12 @@ write_double_1D(hid_t group_id, char const *name, extern "C" void read_double(hid_t obj_id, const char* name, double* buffer, bool indep); +void write_array(hid_t group_id, int ndim, const hsize_t* dims, const char* name, + hid_t mem_type_id, const void* buffer, bool indep); extern "C" void write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, const double* buffer, bool indep); +extern "C" void write_int(hid_t group_id, int ndim, const hsize_t* dims, + const char* name, const int* buffer, bool indep); void write_string(hid_t group_id, char const *name, char const *buffer); void write_string(hid_t group_id, char const *name, const std::string &buffer); From 8338c0022e992782d367ca0647e91b3ce0516a13 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 18 Apr 2018 06:56:41 -0500 Subject: [PATCH 181/231] Convert HDF5 read_integer to C++ --- src/hdf5_interface.F90 | 386 ++++++++++------------------------------- src/hdf5_interface.cpp | 21 ++- src/hdf5_interface.h | 4 + 3 files changed, 114 insertions(+), 297 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 562e35661e..f1de90d726 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -44,12 +44,12 @@ module hdf5_interface end interface write_dataset interface read_dataset - module procedure read_double + module procedure read_double_0D module procedure read_double_1D module procedure read_double_2D module procedure read_double_3D module procedure read_double_4D - module procedure read_integer + module procedure read_integer_0D module procedure read_integer_1D module procedure read_integer_2D module procedure read_integer_3D @@ -114,6 +114,15 @@ module hdf5_interface logical(C_BOOL), intent(in) :: indep end subroutine read_double_c + subroutine read_int_c(obj_id, name, buffer, indep) & + bind(C, name='read_int') + import HID_T, C_INT, C_BOOL, C_PTR + integer(HID_T), value :: obj_id + type(C_PTR), value :: name + integer(C_INT), intent(in) :: buffer(*) + logical(C_BOOL), intent(in) :: indep + end subroutine read_int_c + subroutine write_double_c(group_id, ndim, dims, name, buffer, indep) & bind(C, name='write_double') import HID_T, HSIZE_T, C_INT, C_DOUBLE, C_CHAR, C_BOOL @@ -402,49 +411,6 @@ contains ! READ_DOUBLE reads double precision scalar data !=============================================================================== - subroutine read_double(buffer, obj_id, name, indep) - real(8), target, intent(inout) :: buffer - integer(HID_T), intent(in) :: obj_id - character(*), optional, intent(in) :: name - logical, optional, intent(in) :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - integer(HID_T) :: dset_id - type(c_ptr) :: f_ptr - - ! If 'name' argument is passed, obj_id is interpreted to be a group and - ! 'name' is the name of the dataset we should read from - if (present(name)) then - call h5dopen_f(obj_id, trim(name), dset_id, hdf5_err) - else - dset_id = obj_id - end if - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - f_ptr = c_loc(buffer) - - if (using_mpio_device(dset_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dread_f(dset_id, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dread_f(dset_id, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err) - end if - - if (present(name)) call h5dclose_f(dset_id, hdf5_err) - end subroutine read_double !=============================================================================== ! WRITE_DOUBLE_ND writes double precision N-D array data @@ -535,6 +501,30 @@ contains ! READ_DOUBLE_ND reads double precision N-D array data !=============================================================================== + subroutine read_double_0D(buffer, obj_id, name, indep) + real(8), target, intent(inout) :: buffer + integer(HID_T), intent(in) :: obj_id + character(*), optional, intent(in) :: name + logical, optional, intent(in) :: indep ! independent I/O + + real(C_DOUBLE) :: buffer_(1) + logical(C_BOOL) :: indep_ + character(kind=C_CHAR), target, allocatable :: name_(:) + + indep_ = .false. + if (present(indep)) indep_ = indep + + ! If 'name' argument is passed, obj_id is interpreted to be a group and + ! 'name' is the name of the dataset we should read from + if (present(name)) then + name_ = to_c_string(name) + call read_double_c(obj_id, c_loc(name_), buffer_, indep_) + else + call read_double_c(obj_id, C_NULL_PTR, buffer_, indep_) + end if + buffer = buffer_(1) + end subroutine read_double_0D + subroutine read_double_1D(buffer, obj_id, name, indep) real(8), target, intent(inout) :: buffer(:) integer(HID_T), intent(in) :: obj_id @@ -627,50 +617,6 @@ contains ! READ_INTEGER reads integer precision scalar data !=============================================================================== - subroutine read_integer(buffer, obj_id, name, indep) - integer, target, intent(inout) :: buffer - integer(HID_T), intent(in) :: obj_id - character(*), optional, intent(in) :: name - logical, optional, intent(in) :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - integer(HID_T) :: dset_id - type(c_ptr) :: f_ptr - - ! If 'name' argument is passed, obj_id is interpreted to be a group and - ! 'name' is the name of the dataset we should read from - if (present(name)) then - call h5dopen_f(obj_id, trim(name), dset_id, hdf5_err) - else - dset_id = obj_id - end if - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - f_ptr = c_loc(buffer) - - if (using_mpio_device(dset_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dread_f(dset_id, H5T_NATIVE_INTEGER, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dread_f(dset_id, H5T_NATIVE_INTEGER, f_ptr, hdf5_err) - end if - - if (present(name)) call h5dclose_f(dset_id, hdf5_err) - end subroutine read_integer - !=============================================================================== ! WRITE_INTEGER_ND writes integer precision N-D array data !=============================================================================== @@ -757,269 +703,121 @@ contains end subroutine write_integer_4D !=============================================================================== -! READ_INTEGER_1D reads integer precision 1-D array data +! READ_INTEGER_ND reads integer precision N-D array data !=============================================================================== + subroutine read_integer_0D(buffer, obj_id, name, indep) + integer, target, intent(inout) :: buffer + integer(HID_T), intent(in) :: obj_id + character(*), optional, intent(in) :: name + logical, optional, intent(in) :: indep ! independent I/O + + integer(C_INT) :: buffer_(1) + logical(C_BOOL) :: indep_ + character(kind=C_CHAR), target, allocatable :: name_(:) + + indep_ = .false. + if (present(indep)) indep_ = indep + + ! If 'name' argument is passed, obj_id is interpreted to be a group and + ! 'name' is the name of the dataset we should read from + if (present(name)) then + name_ = to_c_string(name) + call read_int_c(obj_id, c_loc(name_), buffer_, indep_) + else + call read_int_c(obj_id, C_NULL_PTR, buffer_, indep_) + end if + buffer = buffer_(1) + end subroutine read_integer_0D + subroutine read_integer_1D(buffer, obj_id, name, indep) integer, target, intent(inout) :: buffer(:) integer(HID_T), intent(in) :: obj_id character(*), optional, intent(in) :: name logical, optional, intent(in) :: indep ! independent I/O - integer :: hdf5_err - integer(HID_T) :: dset_id - integer(HSIZE_T) :: dims(1) + logical(C_BOOL) :: indep_ + character(kind=C_CHAR), target, allocatable :: name_(:) + + indep_ = .false. + if (present(indep)) indep_ = indep ! If 'name' argument is passed, obj_id is interpreted to be a group and ! 'name' is the name of the dataset we should read from if (present(name)) then - call h5dopen_f(obj_id, trim(name), dset_id, hdf5_err) + name_ = to_c_string(name) + call read_int_c(obj_id, c_loc(name_), buffer, indep_) else - dset_id = obj_id + call read_int_c(obj_id, C_NULL_PTR, buffer, indep_) end if - - dims(:) = shape(buffer) - - if (present(indep)) then - call read_integer_1D_explicit(dset_id, dims, buffer, indep) - else - call read_integer_1D_explicit(dset_id, dims, buffer) - end if - - if (present(name)) call h5dclose_f(dset_id, hdf5_err) end subroutine read_integer_1D - subroutine read_integer_1D_explicit(dset_id, dims, buffer, indep) - integer(HID_T), intent(in) :: dset_id - integer(HSIZE_T), intent(in) :: dims(1) - integer, target, intent(inout) :: buffer(dims(1)) - logical, optional, intent(in) :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - type(c_ptr) :: f_ptr - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - f_ptr = c_loc(buffer) - - if (using_mpio_device(dset_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dread_f(dset_id, H5T_NATIVE_INTEGER, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dread_f(dset_id, H5T_NATIVE_INTEGER, f_ptr, hdf5_err) - end if - end subroutine read_integer_1D_explicit - -!=============================================================================== -! READ_INTEGER_2D reads integer precision 2-D array data -!=============================================================================== - subroutine read_integer_2D(buffer, obj_id, name, indep) integer, target, intent(inout) :: buffer(:,:) integer(HID_T), intent(in) :: obj_id character(*), optional, intent(in) :: name logical, optional, intent(in) :: indep ! independent I/O - integer :: hdf5_err - integer(HID_T) :: dset_id - integer(HSIZE_T) :: dims(2) + logical(C_BOOL) :: indep_ + character(kind=C_CHAR), target, allocatable :: name_(:) + + indep_ = .false. + if (present(indep)) indep_ = indep ! If 'name' argument is passed, obj_id is interpreted to be a group and ! 'name' is the name of the dataset we should read from if (present(name)) then - call h5dopen_f(obj_id, trim(name), dset_id, hdf5_err) + name_ = to_c_string(name) + call read_int_c(obj_id, c_loc(name_), buffer, indep_) else - dset_id = obj_id + call read_int_c(obj_id, C_NULL_PTR, buffer, indep_) end if - - dims(:) = shape(buffer) - - if (present(indep)) then - call read_integer_2D_explicit(dset_id, dims, buffer, indep) - else - call read_integer_2D_explicit(dset_id, dims, buffer) - end if - - if (present(name)) call h5dclose_f(dset_id, hdf5_err) end subroutine read_integer_2D - subroutine read_integer_2D_explicit(dset_id, dims, buffer, indep) - integer(HID_T), intent(in) :: dset_id - integer(HSIZE_T), intent(in) :: dims(2) - integer, target, intent(inout) :: buffer(dims(1),dims(2)) - logical, optional, intent(in) :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - type(c_ptr) :: f_ptr - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - f_ptr = c_loc(buffer) - - if (using_mpio_device(dset_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dread_f(dset_id, H5T_NATIVE_INTEGER, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dread_f(dset_id, H5T_NATIVE_INTEGER, f_ptr, hdf5_err) - end if - end subroutine read_integer_2D_explicit - -!=============================================================================== -! READ_INTEGER_3D reads integer precision 3-D array data -!=============================================================================== - subroutine read_integer_3D(buffer, obj_id, name, indep) integer, target, intent(inout) :: buffer(:,:,:) integer(HID_T), intent(in) :: obj_id character(*), optional, intent(in) :: name logical, optional, intent(in) :: indep ! independent I/O - integer :: hdf5_err - integer(HID_T) :: dset_id - integer(HSIZE_T) :: dims(3) + logical(C_BOOL) :: indep_ + character(kind=C_CHAR), target, allocatable :: name_(:) + + indep_ = .false. + if (present(indep)) indep_ = indep ! If 'name' argument is passed, obj_id is interpreted to be a group and ! 'name' is the name of the dataset we should read from if (present(name)) then - call h5dopen_f(obj_id, trim(name), dset_id, hdf5_err) + name_ = to_c_string(name) + call read_int_c(obj_id, c_loc(name_), buffer, indep_) else - dset_id = obj_id + call read_int_c(obj_id, C_NULL_PTR, buffer, indep_) end if - - dims(:) = shape(buffer) - - if (present(indep)) then - call read_integer_3D_explicit(dset_id, dims, buffer, indep) - else - call read_integer_3D_explicit(dset_id, dims, buffer) - end if - - if (present(name)) call h5dclose_f(dset_id, hdf5_err) end subroutine read_integer_3D - subroutine read_integer_3D_explicit(dset_id, dims, buffer, indep) - integer(HID_T), intent(in) :: dset_id - integer(HSIZE_T), intent(in) :: dims(3) - integer, target, intent(inout) :: buffer(dims(1),dims(2),dims(3)) - logical, optional, intent(in) :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - type(c_ptr) :: f_ptr - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - f_ptr = c_loc(buffer) - - if (using_mpio_device(dset_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dread_f(dset_id, H5T_NATIVE_INTEGER, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dread_f(dset_id, H5T_NATIVE_INTEGER, f_ptr, hdf5_err) - end if - end subroutine read_integer_3D_explicit - -!=============================================================================== -! READ_INTEGER_4D reads integer precision 4-D array data -!=============================================================================== - subroutine read_integer_4D(buffer, obj_id, name, indep) integer, target, intent(inout) :: buffer(:,:,:,:) integer(HID_T), intent(in) :: obj_id character(*), optional, intent(in) :: name logical, optional, intent(in) :: indep ! independent I/O - integer :: hdf5_err - integer(HID_T) :: dset_id - integer(HSIZE_T) :: dims(4) + logical(C_BOOL) :: indep_ + character(kind=C_CHAR), target, allocatable :: name_(:) + + indep_ = .false. + if (present(indep)) indep_ = indep ! If 'name' argument is passed, obj_id is interpreted to be a group and ! 'name' is the name of the dataset we should read from if (present(name)) then - call h5dopen_f(obj_id, trim(name), dset_id, hdf5_err) + name_ = to_c_string(name) + call read_int_c(obj_id, c_loc(name_), buffer, indep_) else - dset_id = obj_id + call read_int_c(obj_id, C_NULL_PTR, buffer, indep_) end if - - dims(:) = shape(buffer) - - if (present(indep)) then - call read_integer_4D_explicit(dset_id, dims, buffer, indep) - else - call read_integer_4D_explicit(dset_id, dims, buffer) - end if - - if (present(name)) call h5dclose_f(dset_id, hdf5_err) end subroutine read_integer_4D - subroutine read_integer_4D_explicit(dset_id, dims, buffer, indep) - integer(HID_T), intent(in) :: dset_id - integer(HSIZE_T), intent(in) :: dims(4) - integer, target, intent(inout) :: buffer(dims(1),dims(2),dims(3),dims(4)) - logical, optional, intent(in) :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - type(c_ptr) :: f_ptr - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - f_ptr = c_loc(buffer) - - if (using_mpio_device(dset_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dread_f(dset_id, H5T_NATIVE_INTEGER, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dread_f(dset_id, H5T_NATIVE_INTEGER, f_ptr, hdf5_err) - end if - end subroutine read_integer_4D_explicit - !=============================================================================== ! WRITE_LONG writes long integer scalar data !=============================================================================== diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index 349c1876de..76b3d6feae 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -160,7 +160,8 @@ open_group(hid_t group_id, const char* name) void -read_double(hid_t obj_id, const char* name, double* buffer, bool indep) +read_array(hid_t obj_id, const char* name, hid_t mem_type_id, + void* buffer, bool indep) { hid_t dset = obj_id; if (name) dset = H5Dopen(obj_id, name, H5P_DEFAULT); @@ -175,17 +176,31 @@ read_double(hid_t obj_id, const char* name, double* buffer, bool indep) H5Pset_dxpl_mpio(plist, data_xfer_mode); // Write data - H5Dread(dset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, plist, buffer); + H5Dread(dset, mem_type_id, H5S_ALL, H5S_ALL, plist, buffer); H5Pclose(plist); #endif } else { - H5Dread(dset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer); + H5Dread(dset, mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer); } if (name) H5Dclose(dset); } +void +read_double(hid_t obj_id, const char* name, double* buffer, bool indep) +{ + read_array(obj_id, name, H5T_NATIVE_DOUBLE, buffer, indep); +} + + +void +read_int(hid_t obj_id, const char* name, int* buffer, bool indep) +{ + read_array(obj_id, name, H5T_NATIVE_INT, buffer, indep); +} + + void write_array(hid_t group_id, int ndim, const hsize_t* dims, const char* name, hid_t mem_type_id, const void* buffer, bool indep) diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index f2bef3b0b7..b3efda48c2 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -41,8 +41,12 @@ write_double_1D(hid_t group_id, char const *name, H5Dclose(dataset); } +void read_array(hid_t obj_id, const char* name, double* buffer, + hid_t mem_type_id, bool indep); extern "C" void read_double(hid_t obj_id, const char* name, double* buffer, bool indep); +extern "C" void read_int(hid_t obj_id, const char* name, int* buffer, + bool indep); void write_array(hid_t group_id, int ndim, const hsize_t* dims, const char* name, hid_t mem_type_id, const void* buffer, bool indep); From aa5a5cf7db0d33e1801e71f02b9fcd0060ede4af Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 18 Apr 2018 07:14:44 -0500 Subject: [PATCH 182/231] Convert HDF5 read/write_long to C++ --- src/hdf5_interface.F90 | 108 ++++++++++++++--------------------------- src/hdf5_interface.cpp | 15 ++++++ src/hdf5_interface.h | 4 ++ 3 files changed, 56 insertions(+), 71 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index f1de90d726..7514c5ba03 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -123,6 +123,15 @@ module hdf5_interface logical(C_BOOL), intent(in) :: indep end subroutine read_int_c + subroutine read_llong_c(obj_id, name, buffer, indep) & + bind(C, name='read_llong') + import HID_T, C_INT, C_BOOL, C_PTR, C_LONG_LONG + integer(HID_T), value :: obj_id + type(C_PTR), value :: name + integer(C_LONG_LONG), intent(in) :: buffer(*) + logical(C_BOOL), intent(in) :: indep + end subroutine read_llong_c + subroutine write_double_c(group_id, ndim, dims, name, buffer, indep) & bind(C, name='write_double') import HID_T, HSIZE_T, C_INT, C_DOUBLE, C_CHAR, C_BOOL @@ -144,6 +153,17 @@ module hdf5_interface integer(C_INT), intent(in) :: buffer(*) logical(C_BOOL), intent(in) :: indep end subroutine write_int_c + + subroutine write_llong_c(group_id, ndim, dims, name, buffer, indep) & + bind(C, name='write_llong') + import HID_T, HSIZE_T, C_INT, C_CHAR, C_BOOL, C_LONG_LONG + integer(HID_T), value :: group_id + integer(C_INT), value :: ndim + integer(HSIZE_T), intent(in) :: dims(*) + character(kind=C_CHAR), intent(in) :: name(*) + integer(C_LONG_LONG), intent(in) :: buffer(*) + logical(C_BOOL), intent(in) :: indep + end subroutine write_llong_c end interface contains @@ -407,11 +427,6 @@ contains end if end subroutine close_dataset -!=============================================================================== -! READ_DOUBLE reads double precision scalar data -!=============================================================================== - - !=============================================================================== ! WRITE_DOUBLE_ND writes double precision N-D array data !=============================================================================== @@ -613,10 +628,6 @@ contains end if end subroutine read_double_4D -!=============================================================================== -! READ_INTEGER reads integer precision scalar data -!=============================================================================== - !=============================================================================== ! WRITE_INTEGER_ND writes integer precision N-D array data !=============================================================================== @@ -828,40 +839,15 @@ contains integer(8), intent(in), target :: buffer ! data to write logical, intent(in), optional :: indep ! independent I/O - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - integer(HID_T) :: dset ! data set handle - integer(HID_T) :: dspace ! data or file space handle - type(c_ptr) :: f_ptr + integer(HSIZE_T) :: dims(0) + logical(C_BOOL) :: indep_ + integer(C_LONG_LONG) :: buffer_(1) - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if + indep_ = .false. + if (present(indep)) indep_ = indep + buffer_(1) = buffer - ! Create dataspace and dataset - call h5screate_f(H5S_SCALAR_F, dspace, hdf5_err) - call h5dcreate_f(group_id, trim(name), hdf5_integer8_t, & - dspace, dset, hdf5_err) - f_ptr = c_loc(buffer) - - if (using_mpio_device(group_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dwrite_f(dset, hdf5_integer8_t, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dwrite_f(dset, hdf5_integer8_t, f_ptr, hdf5_err) - end if - - call h5dclose_f(dset, hdf5_err) - call h5sclose_f(dspace, hdf5_err) + call write_llong_c(group_id, 0, dims, to_c_string(name), buffer_, indep_) end subroutine write_long !=============================================================================== @@ -874,42 +860,22 @@ contains character(*), optional, intent(in) :: name logical, optional, intent(in) :: indep ! independent I/O - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - integer(HID_T) :: dset_id - type(c_ptr) :: f_ptr + integer(C_LONG_LONG) :: buffer_(1) + logical(C_BOOL) :: indep_ + character(kind=C_CHAR), target, allocatable :: name_(:) + + indep_ = .false. + if (present(indep)) indep_ = indep ! If 'name' argument is passed, obj_id is interpreted to be a group and ! 'name' is the name of the dataset we should read from if (present(name)) then - call h5dopen_f(obj_id, trim(name), dset_id, hdf5_err) + name_ = to_c_string(name) + call read_llong_c(obj_id, c_loc(name_), buffer_, indep_) else - dset_id = obj_id + call read_llong_c(obj_id, C_NULL_PTR, buffer_, indep_) end if - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - f_ptr = c_loc(buffer) - - if (using_mpio_device(dset_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dread_f(dset_id, hdf5_integer8_t, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dread_f(dset_id, hdf5_integer8_t, f_ptr, hdf5_err) - end if - - if (present(name)) call h5dclose_f(dset_id, hdf5_err) + buffer = buffer_(1) end subroutine read_long !=============================================================================== diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index 76b3d6feae..78fcad349e 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -201,6 +201,13 @@ read_int(hid_t obj_id, const char* name, int* buffer, bool indep) } +void +read_llong(hid_t obj_id, const char* name, long long* buffer, bool indep) +{ + read_array(obj_id, name, H5T_NATIVE_LLONG, buffer, indep); +} + + void write_array(hid_t group_id, int ndim, const hsize_t* dims, const char* name, hid_t mem_type_id, const void* buffer, bool indep) @@ -256,6 +263,14 @@ write_int(hid_t group_id, int ndim, const hsize_t* dims, const char* name, } +void +write_llong(hid_t group_id, int ndim, const hsize_t* dims, const char* name, + const long long* buffer, bool indep) +{ + write_array(group_id, ndim, dims, name, H5T_NATIVE_LLONG, buffer, indep); +} + + void write_string(hid_t group_id, char const *name, char const *buffer) { diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index b3efda48c2..8e47b528f7 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -47,6 +47,8 @@ extern "C" void read_double(hid_t obj_id, const char* name, double* buffer, bool indep); extern "C" void read_int(hid_t obj_id, const char* name, int* buffer, bool indep); +extern "C" void read_llong(hid_t obj_id, const char* name, long long* buffer, + bool indep); void write_array(hid_t group_id, int ndim, const hsize_t* dims, const char* name, hid_t mem_type_id, const void* buffer, bool indep); @@ -54,6 +56,8 @@ extern "C" void write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, const double* buffer, bool indep); extern "C" void write_int(hid_t group_id, int ndim, const hsize_t* dims, const char* name, const int* buffer, bool indep); +extern "C" void write_llong(hid_t group_id, int ndim, const hsize_t* dims, + const char* name, const long long* buffer, bool indep); void write_string(hid_t group_id, char const *name, char const *buffer); void write_string(hid_t group_id, char const *name, const std::string &buffer); From 2760bce6796c2c120e30bfe48271c2627941896e Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 18 Apr 2018 09:46:28 -0500 Subject: [PATCH 183/231] Convert HDF5 write_string to C++ --- src/hdf5_interface.F90 | 63 +++++++++--------------------------------- src/hdf5_interface.cpp | 42 ++++++++++++++-------------- src/hdf5_interface.h | 12 ++++---- src/surface.cpp | 34 +++++++++++------------ 4 files changed, 56 insertions(+), 95 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 7514c5ba03..1a3413820e 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -164,6 +164,15 @@ module hdf5_interface integer(C_LONG_LONG), intent(in) :: buffer(*) logical(C_BOOL), intent(in) :: indep end subroutine write_llong_c + + subroutine write_string_c(group_id, name, buffer, indep) & + bind(C, name='write_string') + import HID_T, HSIZE_T, C_CHAR, C_BOOL + integer(HID_T), value :: group_id + character(kind=C_CHAR), intent(in) :: name(*) + character(kind=C_CHAR), intent(in) :: buffer(*) + logical(C_BOOL), intent(in) :: indep + end subroutine write_string_c end interface contains @@ -888,58 +897,12 @@ contains character(*), intent(in), target :: buffer ! read data to here logical, intent(in), optional :: indep ! independent I/O - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - integer(HID_T) :: dset ! data set handle - integer(HID_T) :: dspace ! data or file space handle - integer(HID_T) :: filetype - integer(SIZE_T) :: i, n - character(kind=C_CHAR), allocatable, target :: temp_buffer(:) - type(c_ptr) :: f_ptr + logical(C_BOOL) :: indep_ - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if + indep_ = .false. + if (present(indep)) indep_ = indep - ! Create datatype for HDF5 file based on C char - n = len_trim(buffer) - if (n > 0) then - call h5tcopy_f(H5T_C_S1, filetype, hdf5_err) - call h5tset_size_f(filetype, n, hdf5_err) - - ! Create dataspace/dataset - call h5screate_f(H5S_SCALAR_F, dspace, hdf5_err) - call h5dcreate_f(group_id, trim(name), filetype, dspace, dset, hdf5_err) - - ! Copy string to temporary buffer - allocate(temp_buffer(n)) - do i = 1, n - temp_buffer(i) = buffer(i:i) - end do - - ! Get pointer to start of string - f_ptr = c_loc(temp_buffer(1)) - - if (using_mpio_device(group_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dwrite_f(dset, filetype, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dwrite_f(dset, filetype, f_ptr, hdf5_err) - end if - - call h5dclose_f(dset, hdf5_err) - call h5sclose_f(dspace, hdf5_err) - call h5tclose_f(filetype, hdf5_err) - end if + call write_string_c(group_id, to_c_string(name), to_c_string(buffer), indep_) end subroutine write_string !=============================================================================== diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index 78fcad349e..d78bf83d86 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -5,6 +5,7 @@ #include "hdf5_hl.h" #include +#include #include #include @@ -160,7 +161,7 @@ open_group(hid_t group_id, const char* name) void -read_array(hid_t obj_id, const char* name, hid_t mem_type_id, +read_data(hid_t obj_id, const char* name, hid_t mem_type_id, void* buffer, bool indep) { hid_t dset = obj_id; @@ -190,26 +191,26 @@ read_array(hid_t obj_id, const char* name, hid_t mem_type_id, void read_double(hid_t obj_id, const char* name, double* buffer, bool indep) { - read_array(obj_id, name, H5T_NATIVE_DOUBLE, buffer, indep); + read_data(obj_id, name, H5T_NATIVE_DOUBLE, buffer, indep); } void read_int(hid_t obj_id, const char* name, int* buffer, bool indep) { - read_array(obj_id, name, H5T_NATIVE_INT, buffer, indep); + read_data(obj_id, name, H5T_NATIVE_INT, buffer, indep); } void read_llong(hid_t obj_id, const char* name, long long* buffer, bool indep) { - read_array(obj_id, name, H5T_NATIVE_LLONG, buffer, indep); + read_data(obj_id, name, H5T_NATIVE_LLONG, buffer, indep); } void -write_array(hid_t group_id, int ndim, const hsize_t* dims, const char* name, +write_data(hid_t group_id, int ndim, const hsize_t* dims, const char* name, hid_t mem_type_id, const void* buffer, bool indep) { // If array is given, create a simple dataspace. Otherwise, create a scalar @@ -251,7 +252,7 @@ void write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, const double* buffer, bool indep) { - write_array(group_id, ndim, dims, name, H5T_NATIVE_DOUBLE, buffer, indep); + write_data(group_id, ndim, dims, name, H5T_NATIVE_DOUBLE, buffer, indep); } @@ -259,7 +260,7 @@ void write_int(hid_t group_id, int ndim, const hsize_t* dims, const char* name, const int* buffer, bool indep) { - write_array(group_id, ndim, dims, name, H5T_NATIVE_INT, buffer, indep); + write_data(group_id, ndim, dims, name, H5T_NATIVE_INT, buffer, indep); } @@ -267,34 +268,31 @@ void write_llong(hid_t group_id, int ndim, const hsize_t* dims, const char* name, const long long* buffer, bool indep) { - write_array(group_id, ndim, dims, name, H5T_NATIVE_LLONG, buffer, indep); + write_data(group_id, ndim, dims, name, H5T_NATIVE_LLONG, buffer, indep); } void -write_string(hid_t group_id, char const *name, char const *buffer) +write_string(hid_t group_id, char const* name, const char* buffer, bool indep) { size_t buffer_len = strlen(buffer); - hid_t datatype = H5Tcopy(H5T_C_S1); - H5Tset_size(datatype, buffer_len); + if (buffer_len > 0) { + // Set up appropriate datatype for a fixed-length string + hid_t datatype = H5Tcopy(H5T_C_S1); + H5Tset_size(datatype, buffer_len); - hid_t dataspace = H5Screate(H5S_SCALAR); + write_data(group_id, 0, nullptr, name, datatype, buffer, indep); - hid_t dataset = H5Dcreate(group_id, name, datatype, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - H5Dwrite(dataset, datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer); - - H5Tclose(datatype); - H5Sclose(dataspace); - H5Dclose(dataset); + // Free resources + H5Tclose(datatype); + } } void -write_string(hid_t group_id, char const *name, const std::string &buffer) +write_string(hid_t group_id, char const* name, const std::string& buffer, bool indep) { - write_string(group_id, name, buffer.c_str()); + write_string(group_id, name, buffer.c_str(), indep); } } diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index 8e47b528f7..41883d9267 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -41,8 +41,8 @@ write_double_1D(hid_t group_id, char const *name, H5Dclose(dataset); } -void read_array(hid_t obj_id, const char* name, double* buffer, - hid_t mem_type_id, bool indep); +void read_data(hid_t obj_id, const char* name, double* buffer, + hid_t mem_type_id, bool indep); extern "C" void read_double(hid_t obj_id, const char* name, double* buffer, bool indep); extern "C" void read_int(hid_t obj_id, const char* name, int* buffer, @@ -50,8 +50,8 @@ extern "C" void read_int(hid_t obj_id, const char* name, int* buffer, extern "C" void read_llong(hid_t obj_id, const char* name, long long* buffer, bool indep); -void write_array(hid_t group_id, int ndim, const hsize_t* dims, const char* name, - hid_t mem_type_id, const void* buffer, bool indep); +void write_data(hid_t group_id, int ndim, const hsize_t* dims, const char* name, + hid_t mem_type_id, const void* buffer, bool indep); extern "C" void write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, const double* buffer, bool indep); extern "C" void write_int(hid_t group_id, int ndim, const hsize_t* dims, @@ -59,8 +59,8 @@ extern "C" void write_int(hid_t group_id, int ndim, const hsize_t* dims, extern "C" void write_llong(hid_t group_id, int ndim, const hsize_t* dims, const char* name, const long long* buffer, bool indep); -void write_string(hid_t group_id, char const *name, char const *buffer); -void write_string(hid_t group_id, char const *name, const std::string &buffer); +extern "C" void write_string(hid_t group_id, char const *name, char const *buffer, bool indep); +void write_string(hid_t group_id, char const *name, const std::string &buffer, bool indep); } // namespace openmc #endif //HDF5_INTERFACE_H diff --git a/src/surface.cpp b/src/surface.cpp index 9abfd23d2e..9db9db3fa5 100644 --- a/src/surface.cpp +++ b/src/surface.cpp @@ -202,21 +202,21 @@ Surface::to_hdf5(hid_t group_id) const switch(bc) { case BC_TRANSMIT : - write_string(surf_group, "boundary_type", "transmission"); + write_string(surf_group, "boundary_type", "transmission", false); break; case BC_VACUUM : - write_string(surf_group, "boundary_type", "vacuum"); + write_string(surf_group, "boundary_type", "vacuum", false); break; case BC_REFLECT : - write_string(surf_group, "boundary_type", "reflective"); + write_string(surf_group, "boundary_type", "reflective", false); break; case BC_PERIODIC : - write_string(surf_group, "boundary_type", "periodic"); + write_string(surf_group, "boundary_type", "periodic", false); break; } if (!name.empty()) { - write_string(surf_group, "name", name); + write_string(surf_group, "name", name, false); } to_hdf5_inner(surf_group); @@ -297,7 +297,7 @@ inline void SurfaceXPlane::normal(const double xyz[3], double uvw[3]) const void SurfaceXPlane::to_hdf5_inner(hid_t group_id) const { - write_string(group_id, "type", "x-plane"); + write_string(group_id, "type", "x-plane", false); std::array coeffs {{x0}}; write_double_1D(group_id, "coefficients", coeffs); } @@ -362,7 +362,7 @@ inline void SurfaceYPlane::normal(const double xyz[3], double uvw[3]) const void SurfaceYPlane::to_hdf5_inner(hid_t group_id) const { - write_string(group_id, "type", "y-plane"); + write_string(group_id, "type", "y-plane", false); std::array coeffs {{y0}}; write_double_1D(group_id, "coefficients", coeffs); } @@ -428,7 +428,7 @@ inline void SurfaceZPlane::normal(const double xyz[3], double uvw[3]) const void SurfaceZPlane::to_hdf5_inner(hid_t group_id) const { - write_string(group_id, "type", "z-plane"); + write_string(group_id, "type", "z-plane", false); std::array coeffs {{z0}}; write_double_1D(group_id, "coefficients", coeffs); } @@ -489,7 +489,7 @@ SurfacePlane::normal(const double xyz[3], double uvw[3]) const void SurfacePlane::to_hdf5_inner(hid_t group_id) const { - write_string(group_id, "type", "plane"); + write_string(group_id, "type", "plane", false); std::array coeffs {{A, B, C, D}}; write_double_1D(group_id, "coefficients", coeffs); } @@ -621,7 +621,7 @@ inline void SurfaceXCylinder::normal(const double xyz[3], double uvw[3]) const void SurfaceXCylinder::to_hdf5_inner(hid_t group_id) const { - write_string(group_id, "type", "x-cylinder"); + write_string(group_id, "type", "x-cylinder", false); std::array coeffs {{y0, z0, r}}; write_double_1D(group_id, "coefficients", coeffs); } @@ -655,7 +655,7 @@ inline void SurfaceYCylinder::normal(const double xyz[3], double uvw[3]) const void SurfaceYCylinder::to_hdf5_inner(hid_t group_id) const { - write_string(group_id, "type", "y-cylinder"); + write_string(group_id, "type", "y-cylinder", false); std::array coeffs {{x0, z0, r}}; write_double_1D(group_id, "coefficients", coeffs); } @@ -689,7 +689,7 @@ inline void SurfaceZCylinder::normal(const double xyz[3], double uvw[3]) const void SurfaceZCylinder::to_hdf5_inner(hid_t group_id) const { - write_string(group_id, "type", "z-cylinder"); + write_string(group_id, "type", "z-cylinder", false); std::array coeffs {{x0, y0, r}}; write_double_1D(group_id, "coefficients", coeffs); } @@ -760,7 +760,7 @@ inline void SurfaceSphere::normal(const double xyz[3], double uvw[3]) const void SurfaceSphere::to_hdf5_inner(hid_t group_id) const { - write_string(group_id, "type", "sphere"); + write_string(group_id, "type", "sphere", false); std::array coeffs {{x0, y0, z0, r}}; write_double_1D(group_id, "coefficients", coeffs); } @@ -877,7 +877,7 @@ inline void SurfaceXCone::normal(const double xyz[3], double uvw[3]) const void SurfaceXCone::to_hdf5_inner(hid_t group_id) const { - write_string(group_id, "type", "x-cone"); + write_string(group_id, "type", "x-cone", false); std::array coeffs {{x0, y0, z0, r_sq}}; write_double_1D(group_id, "coefficients", coeffs); } @@ -911,7 +911,7 @@ inline void SurfaceYCone::normal(const double xyz[3], double uvw[3]) const void SurfaceYCone::to_hdf5_inner(hid_t group_id) const { - write_string(group_id, "type", "y-cone"); + write_string(group_id, "type", "y-cone", false); std::array coeffs {{x0, y0, z0, r_sq}}; write_double_1D(group_id, "coefficients", coeffs); } @@ -945,7 +945,7 @@ inline void SurfaceZCone::normal(const double xyz[3], double uvw[3]) const void SurfaceZCone::to_hdf5_inner(hid_t group_id) const { - write_string(group_id, "type", "z-cone"); + write_string(group_id, "type", "z-cone", false); std::array coeffs {{x0, y0, z0, r_sq}}; write_double_1D(group_id, "coefficients", coeffs); } @@ -1039,7 +1039,7 @@ SurfaceQuadric::normal(const double xyz[3], double uvw[3]) const void SurfaceQuadric::to_hdf5_inner(hid_t group_id) const { - write_string(group_id, "type", "quadric"); + write_string(group_id, "type", "quadric", false); std::array coeffs {{A, B, C, D, E, F, G, H, J, K}}; write_double_1D(group_id, "coefficients", coeffs); } From f8e7d52d39c8933e96c174fbec91b9c14b6fea13 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 18 Apr 2018 13:03:10 -0500 Subject: [PATCH 184/231] Bugfix for writing 4D array --- src/hdf5_interface.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 1a3413820e..be6bce775e 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -518,7 +518,7 @@ contains indep_ = .false. if (present(indep)) indep_ = indep - call write_double_c(group_id, 1, dims, to_c_string(name), buffer, indep_) + call write_double_c(group_id, 4, dims, to_c_string(name), buffer, indep_) end subroutine write_double_4D !=============================================================================== From cc5e99eac4c8f7644d86d1367d221e4f1b504e37 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 18 Apr 2018 13:38:34 -0500 Subject: [PATCH 185/231] Fix dimension bug and implement write_string_1D using write_string_c --- src/hdf5_interface.F90 | 135 ++++++++++++++++++----------------------- src/hdf5_interface.cpp | 12 ++-- src/hdf5_interface.h | 5 +- 3 files changed, 69 insertions(+), 83 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index be6bce775e..b9787ba1ec 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -165,10 +165,13 @@ module hdf5_interface logical(C_BOOL), intent(in) :: indep end subroutine write_llong_c - subroutine write_string_c(group_id, name, buffer, indep) & + subroutine write_string_c(group_id, ndim, dims, slen, name, buffer, indep) & bind(C, name='write_string') - import HID_T, HSIZE_T, C_CHAR, C_BOOL + import HID_T, HSIZE_T, C_INT, C_CHAR, C_BOOL, C_SIZE_T integer(HID_T), value :: group_id + integer(C_INT), value :: ndim + integer(HSIZE_T), intent(in) :: dims(*) + integer(C_SIZE_T), value :: slen character(kind=C_CHAR), intent(in) :: name(*) character(kind=C_CHAR), intent(in) :: buffer(*) logical(C_BOOL), intent(in) :: indep @@ -466,7 +469,7 @@ contains integer(HSIZE_T) :: dims(1) logical(C_BOOL) :: indep_ - dims(:) = shape(buffer) + dims(1) = size(buffer) indep_ = .false. if (present(indep)) indep_ = indep @@ -482,7 +485,10 @@ contains integer(HSIZE_T) :: dims(2) logical(C_BOOL) :: indep_ - dims(:) = shape(buffer) + ! Reverse shape of array since it will be written from C + dims(1) = size(buffer, 2) + dims(2) = size(buffer, 1) + indep_ = .false. if (present(indep)) indep_ = indep @@ -498,7 +504,11 @@ contains integer(HSIZE_T) :: dims(3) logical(C_BOOL) :: indep_ - dims(:) = shape(buffer) + ! Reverse shape of array since it will be written from C + dims(1) = size(buffer, 3) + dims(2) = size(buffer, 2) + dims(3) = size(buffer, 1) + indep_ = .false. if (present(indep)) indep_ = indep @@ -514,7 +524,12 @@ contains integer(HSIZE_T) :: dims(4) logical(C_BOOL) :: indep_ - dims(:) = shape(buffer) + ! Reverse shape of array since it will be written from C + dims(1) = size(buffer, 4) + dims(2) = size(buffer, 3) + dims(3) = size(buffer, 2) + dims(4) = size(buffer, 1) + indep_ = .false. if (present(indep)) indep_ = indep @@ -667,7 +682,7 @@ contains integer(HSIZE_T) :: dims(1) logical(C_BOOL) :: indep_ - dims(:) = shape(buffer) + dims(1) = size(buffer) indep_ = .false. if (present(indep)) indep_ = indep @@ -683,7 +698,10 @@ contains integer(HSIZE_T) :: dims(2) logical(C_BOOL) :: indep_ - dims(:) = shape(buffer) + ! Reverse shape of array since it will be written from C + dims(1) = size(buffer, 2) + dims(2) = size(buffer, 1) + indep_ = .false. if (present(indep)) indep_ = indep @@ -699,7 +717,11 @@ contains integer(HSIZE_T) :: dims(3) logical(C_BOOL) :: indep_ - dims(:) = shape(buffer) + ! Reverse shape of array since it will be written from C + dims(1) = size(buffer, 3) + dims(2) = size(buffer, 2) + dims(3) = size(buffer, 1) + indep_ = .false. if (present(indep)) indep_ = indep @@ -715,7 +737,12 @@ contains integer(HSIZE_T) :: dims(4) logical(C_BOOL) :: indep_ - dims(:) = shape(buffer) + ! Reverse shape of array since it will be written from C + dims(1) = size(buffer, 4) + dims(2) = size(buffer, 3) + dims(3) = size(buffer, 2) + dims(4) = size(buffer, 1) + indep_ = .false. if (present(indep)) indep_ = indep @@ -897,12 +924,16 @@ contains character(*), intent(in), target :: buffer ! read data to here logical, intent(in), optional :: indep ! independent I/O + integer(HSIZE_T) :: dims(0) + integer(C_SIZE_T) :: slen logical(C_BOOL) :: indep_ indep_ = .false. if (present(indep)) indep_ = indep + slen = len_trim(buffer) - call write_string_c(group_id, to_c_string(name), to_c_string(buffer), indep_) + call write_string_c(group_id, 0, dims, slen, to_c_string(name), & + to_c_string(buffer), indep_) end subroutine write_string !=============================================================================== @@ -988,74 +1019,28 @@ contains character(*), intent(in), target :: buffer(:) ! read data to here logical, intent(in), optional :: indep ! independent I/O + integer :: i integer(HSIZE_T) :: dims(1) + integer(C_SIZE_T) :: m + logical(C_BOOL) :: indep_ + character(kind=C_CHAR), allocatable :: buffer_(:) - dims(:) = shape(buffer) - if (present(indep)) then - call write_string_1D_explicit(group_id, dims, name, buffer, indep) - else - call write_string_1D_explicit(group_id, dims, name, buffer) - end if + indep_ = .false. + if (present(indep)) indep_ = indep + + ! Copy array of characters into an array of C chars with the right memory + ! layout + dims(1) = size(buffer) + m = maxval(len_trim(buffer)) + 1 + allocate(buffer_(dims(1)*m)) + do i = 0, dims(1) - 1 + buffer_(i*m+1 : (i+1)*m) = to_c_string(buffer(i+1)) + end do + + call write_string_c(group_id, 1, dims, m, to_c_string(name), & + buffer_, indep_) end subroutine write_string_1D - subroutine write_string_1D_explicit(group_id, dims, name, buffer, indep) - integer(HID_T), intent(in) :: group_id - integer(HSIZE_T), intent(in) :: dims(1) - character(*), intent(in) :: name - character(*), intent(in), target :: buffer(dims(1)) - logical, intent(in), optional :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - integer(HID_T) :: dset ! data set handle - integer(HID_T) :: dspace ! data or file space handle - integer(HID_T) :: filetype - integer(HID_T) :: memtype - integer(SIZE_T) :: n - type(c_ptr) :: f_ptr - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - ! Create datatype for HDF5 file based on C char - n = maxval(len_trim(buffer)) - call h5tcopy_f(H5T_C_S1, filetype, hdf5_err) - call h5tset_size_f(filetype, n + 1, hdf5_err) - - ! Create datatype in memory based on Fortran character - call h5tcopy_f(H5T_FORTRAN_S1, memtype, hdf5_err) - call h5tset_size_f(memtype, int(len(buffer(1)), SIZE_T), hdf5_err) - - ! Create dataspace/dataset - call h5screate_simple_f(1, dims, dspace, hdf5_err) - call h5dcreate_f(group_id, trim(name), filetype, dspace, dset, hdf5_err) - - ! Get pointer to start of string - f_ptr = c_loc(buffer(1)(1:1)) - - if (using_mpio_device(group_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - if (n > 0) call h5dwrite_f(dset, memtype, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - if (n > 0) call h5dwrite_f(dset, memtype, f_ptr, hdf5_err) - end if - - call h5dclose_f(dset, hdf5_err) - call h5sclose_f(dspace, hdf5_err) - call h5tclose_f(memtype, hdf5_err) - call h5tclose_f(filetype, hdf5_err) - end subroutine write_string_1D_explicit - !=============================================================================== ! READ_STRING_1D reads string 1-D array data !=============================================================================== diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index d78bf83d86..0b8000f706 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -273,15 +273,15 @@ write_llong(hid_t group_id, int ndim, const hsize_t* dims, const char* name, void -write_string(hid_t group_id, char const* name, const char* buffer, bool indep) +write_string(hid_t group_id, int ndim, const hsize_t* dims, size_t slen, + const char* name, const char* buffer, bool indep) { - size_t buffer_len = strlen(buffer); - if (buffer_len > 0) { + if (slen > 0) { // Set up appropriate datatype for a fixed-length string hid_t datatype = H5Tcopy(H5T_C_S1); - H5Tset_size(datatype, buffer_len); + H5Tset_size(datatype, slen); - write_data(group_id, 0, nullptr, name, datatype, buffer, indep); + write_data(group_id, ndim, dims, name, datatype, buffer, indep); // Free resources H5Tclose(datatype); @@ -292,7 +292,7 @@ write_string(hid_t group_id, char const* name, const char* buffer, bool indep) void write_string(hid_t group_id, char const* name, const std::string& buffer, bool indep) { - write_string(group_id, name, buffer.c_str(), indep); + write_string(group_id, 0, nullptr, buffer.length(), name, buffer.c_str(), indep); } } diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index 41883d9267..11f26a5f1b 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -59,8 +59,9 @@ extern "C" void write_int(hid_t group_id, int ndim, const hsize_t* dims, extern "C" void write_llong(hid_t group_id, int ndim, const hsize_t* dims, const char* name, const long long* buffer, bool indep); -extern "C" void write_string(hid_t group_id, char const *name, char const *buffer, bool indep); -void write_string(hid_t group_id, char const *name, const std::string &buffer, bool indep); +extern "C" void write_string(hid_t group_id, int ndim, const hsize_t* dims, size_t slen, + const char* name, char const* buffer, bool indep); +void write_string(hid_t group_id, const char* name, const std::string& buffer, bool indep); } // namespace openmc #endif //HDF5_INTERFACE_H From 342d207fc4eaffe1158c4fb7a85fa1c43740e622 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 18 Apr 2018 21:57:57 -0500 Subject: [PATCH 186/231] Convert HDF5 write_attribute to C++ --- src/hdf5_interface.F90 | 141 ++++++++++++----------------------------- src/hdf5_interface.cpp | 77 +++++++++++++++++++--- src/hdf5_interface.h | 17 +++-- 3 files changed, 121 insertions(+), 114 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index b9787ba1ec..1d056e1dcd 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -132,6 +132,34 @@ module hdf5_interface logical(C_BOOL), intent(in) :: indep end subroutine read_llong_c + subroutine write_attr_double_c(obj_id, ndim, dims, name, buffer) & + bind(C, name='write_attr_double') + import HID_T, HSIZE_T, C_INT, C_DOUBLE, C_CHAR + integer(HID_T), value :: obj_id + integer(C_INT), value :: ndim + integer(HSIZE_T), intent(in) :: dims(*) + character(kind=C_CHAR), intent(in) :: name(*) + real(C_DOUBLE), intent(in) :: buffer(*) + end subroutine write_attr_double_c + + subroutine write_attr_int_c(obj_id, ndim, dims, name, buffer) & + bind(C, name='write_attr_int') + import HID_T, HSIZE_T, C_INT, C_CHAR + integer(HID_T), value :: obj_id + integer(C_INT), value :: ndim + integer(HSIZE_T), intent(in) :: dims(*) + character(kind=C_CHAR), intent(in) :: name(*) + integer(C_INT), intent(in) :: buffer(*) + end subroutine write_attr_int_c + + subroutine write_attr_string_c(obj_id, name, buffer) & + bind(C, name='write_attr_string') + import HID_T, C_CHAR + integer(HID_T), value :: obj_id + character(kind=C_CHAR), intent(in) :: name(*) + character(kind=C_CHAR), intent(in) :: buffer(*) + end subroutine write_attr_string_c + subroutine write_double_c(group_id, ndim, dims, name, buffer, indep) & bind(C, name='write_double') import HID_T, HSIZE_T, C_INT, C_DOUBLE, C_CHAR, C_BOOL @@ -1141,41 +1169,8 @@ contains character(*), intent(in) :: name ! name of attribute character(*), intent(in), target :: buffer ! string to write - integer :: hdf5_err - integer(HID_T) :: dspace_id - integer(HID_T) :: attr_id - integer(HID_T) :: filetype - integer(SIZE_T) :: i - integer(SIZE_T) :: n - character(kind=C_CHAR), allocatable, target :: temp_buffer(:) - type(c_ptr) :: f_ptr - ! Create datatype for HDF5 file based on C char - n = len_trim(buffer) - if (n > 0) then - call h5tcopy_f(H5T_C_S1, filetype, hdf5_err) - call h5tset_size_f(filetype, n, hdf5_err) - - ! 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) - - ! Copy string to temporary buffer - allocate(temp_buffer(n)) - do i = 1, n - temp_buffer(i) = buffer(i:i) - end do - - ! Write attribute - f_ptr = c_loc(buffer(1:1)) - call h5awrite_f(attr_id, filetype, f_ptr, hdf5_err) - - ! Close attribute - call h5aclose_f(attr_id, hdf5_err) - call h5sclose_f(dspace_id, hdf5_err) - call h5tclose_f(filetype, hdf5_err) - end if + call write_attr_string_c(obj_id, to_c_string(name), to_c_string(buffer)) end subroutine write_attribute_string subroutine read_attribute_double(buffer, obj_id, name) @@ -1198,18 +1193,11 @@ contains character(*), intent(in) :: name real(8), intent(in), target :: buffer - integer :: hdf5_err - integer(HID_T) :: dspace_id - integer(HID_T) :: attr_id - type(C_PTR) :: f_ptr + integer(HSIZE_T) :: dims(0) + real(C_DOUBLE) :: buffer_(1) - call h5screate_f(H5S_SCALAR_F, dspace_id, hdf5_err) - call h5acreate_f(obj_id, trim(name), H5T_NATIVE_DOUBLE, dspace_id, & - attr_id, hdf5_err) - f_ptr = c_loc(buffer) - call h5awrite_f(attr_id, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err) - call h5aclose_f(attr_id, hdf5_err) - call h5sclose_f(dspace_id, hdf5_err) + buffer_(1) = buffer + call write_attr_double_c(obj_id, 0, dims, to_c_string(name), buffer_) end subroutine write_attribute_double subroutine read_attribute_double_1D(buffer, obj_id, name) @@ -1257,30 +1245,10 @@ contains integer(HSIZE_T) :: dims(1) - dims(:) = shape(buffer) - call write_attribute_double_1D_explicit(obj_id, dims, name, buffer) + dims(1) = size(buffer) + call write_attr_double_c(obj_id, 1, dims, to_c_string(name), buffer) end subroutine write_attribute_double_1D - subroutine write_attribute_double_1D_explicit(obj_id, dims, name, buffer) - integer(HID_T), intent(in) :: obj_id - integer(HSIZE_T), intent(in) :: dims(1) - character(*), intent(in) :: name - real(8), target, intent(in) :: buffer(dims(1)) - - integer :: hdf5_err - integer(HID_T) :: dspace_id - integer(HID_T) :: attr_id - type(C_PTR) :: f_ptr - - call h5screate_simple_f(1, dims, dspace_id, hdf5_err) - call h5acreate_f(obj_id, trim(name), H5T_NATIVE_DOUBLE, dspace_id, & - attr_id, hdf5_err) - f_ptr = c_loc(buffer) - call h5awrite_f(attr_id, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err) - call h5aclose_f(attr_id, hdf5_err) - call h5sclose_f(dspace_id, hdf5_err) - end subroutine write_attribute_double_1D_explicit - subroutine read_attribute_double_2D(buffer, obj_id, name) real(8), target, allocatable, intent(inout) :: buffer(:,:) integer(HID_T), intent(in) :: obj_id @@ -1339,18 +1307,11 @@ contains character(*), intent(in) :: name integer, intent(in), target :: buffer - integer :: hdf5_err - integer(HID_T) :: dspace_id - integer(HID_T) :: attr_id - type(C_PTR) :: f_ptr + integer(HSIZE_T) :: dims(0) + integer(C_INT) :: buffer_(1) - call h5screate_f(H5S_SCALAR_F, dspace_id, hdf5_err) - call h5acreate_f(obj_id, trim(name), H5T_NATIVE_INTEGER, dspace_id, & - attr_id, hdf5_err) - f_ptr = c_loc(buffer) - call h5awrite_f(attr_id, H5T_NATIVE_INTEGER, f_ptr, hdf5_err) - call h5aclose_f(attr_id, hdf5_err) - call h5sclose_f(dspace_id, hdf5_err) + buffer_(1) = buffer + call write_attr_int_c(obj_id, 0, dims, to_c_string(name), buffer_) end subroutine write_attribute_integer subroutine read_attribute_integer_1D(buffer, obj_id, name) @@ -1398,30 +1359,10 @@ contains integer(HSIZE_T) :: dims(1) - dims(:) = shape(buffer) - call write_attribute_integer_1D_explicit(obj_id, dims, name, buffer) + dims(1) = size(buffer) + call write_attr_int_c(obj_id, 1, dims, to_c_string(name), buffer) end subroutine write_attribute_integer_1D - subroutine write_attribute_integer_1D_explicit(obj_id, dims, name, buffer) - integer(HID_T), intent(in) :: obj_id - integer(HSIZE_T), intent(in) :: dims(1) - character(*), intent(in) :: name - integer, target, intent(in) :: buffer(dims(1)) - - integer :: hdf5_err - integer(HID_T) :: dspace_id - integer(HID_T) :: attr_id - type(C_PTR) :: f_ptr - - call h5screate_simple_f(1, dims, dspace_id, hdf5_err) - call h5acreate_f(obj_id, trim(name), H5T_NATIVE_INTEGER, dspace_id, & - attr_id, hdf5_err) - f_ptr = c_loc(buffer) - call h5awrite_f(attr_id, H5T_NATIVE_INTEGER, f_ptr, hdf5_err) - call h5aclose_f(attr_id, hdf5_err) - call h5sclose_f(dspace_id, hdf5_err) - end subroutine write_attribute_integer_1D_explicit - subroutine read_attribute_integer_2D(buffer, obj_id, name) integer, target, allocatable, intent(inout) :: buffer(:,:) integer(HID_T), intent(in) :: obj_id diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index 0b8000f706..f482285f26 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -161,7 +161,7 @@ open_group(hid_t group_id, const char* name) void -read_data(hid_t obj_id, const char* name, hid_t mem_type_id, +read_dataset(hid_t obj_id, const char* name, hid_t mem_type_id, void* buffer, bool indep) { hid_t dset = obj_id; @@ -191,27 +191,84 @@ read_data(hid_t obj_id, const char* name, hid_t mem_type_id, void read_double(hid_t obj_id, const char* name, double* buffer, bool indep) { - read_data(obj_id, name, H5T_NATIVE_DOUBLE, buffer, indep); + read_dataset(obj_id, name, H5T_NATIVE_DOUBLE, buffer, indep); } void read_int(hid_t obj_id, const char* name, int* buffer, bool indep) { - read_data(obj_id, name, H5T_NATIVE_INT, buffer, indep); + read_dataset(obj_id, name, H5T_NATIVE_INT, buffer, indep); } void read_llong(hid_t obj_id, const char* name, long long* buffer, bool indep) { - read_data(obj_id, name, H5T_NATIVE_LLONG, buffer, indep); + read_dataset(obj_id, name, H5T_NATIVE_LLONG, buffer, indep); } void -write_data(hid_t group_id, int ndim, const hsize_t* dims, const char* name, - hid_t mem_type_id, const void* buffer, bool indep) +write_attr(hid_t obj_id, int ndim, const hsize_t* dims, const char* name, + hid_t mem_type_id, const void* buffer) +{ + // If array is given, create a simple dataspace. Otherwise, create a scalar + // datascape. + hid_t dspace; + if (ndim > 0) { + dspace = H5Screate_simple(ndim, dims, nullptr); + } else { + dspace = H5Screate(H5S_SCALAR); + } + + // Create attribute and Write data + hid_t attr = H5Acreate(obj_id, name, mem_type_id, dspace, + H5P_DEFAULT, H5P_DEFAULT); + H5Awrite(attr, mem_type_id, buffer); + + // Free resources + H5Aclose(attr); + H5Sclose(dspace); +} + + +void +write_attr_double(hid_t obj_id, int ndim, const hsize_t* dims, const char* name, + const double* buffer) +{ + write_attr(obj_id, ndim, dims, name, H5T_NATIVE_DOUBLE, buffer); +} + + +void +write_attr_int(hid_t obj_id, int ndim, const hsize_t* dims, const char* name, + const int* buffer) +{ + write_attr(obj_id, ndim, dims, name, H5T_NATIVE_INT, buffer); +} + + +void +write_attr_string(hid_t obj_id, const char* name, const char* buffer) +{ + size_t n = strlen(buffer); + if (n > 0) { + // Set up appropriate datatype for a fixed-length string + hid_t datatype = H5Tcopy(H5T_C_S1); + H5Tset_size(datatype, n); + + write_attr(obj_id, 0, nullptr, name, datatype, buffer); + + // Free resources + H5Tclose(datatype); + } +} + + +void +write_dataset(hid_t group_id, int ndim, const hsize_t* dims, const char* name, + hid_t mem_type_id, const void* buffer, bool indep) { // If array is given, create a simple dataspace. Otherwise, create a scalar // datascape. @@ -252,7 +309,7 @@ void write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, const double* buffer, bool indep) { - write_data(group_id, ndim, dims, name, H5T_NATIVE_DOUBLE, buffer, indep); + write_dataset(group_id, ndim, dims, name, H5T_NATIVE_DOUBLE, buffer, indep); } @@ -260,7 +317,7 @@ void write_int(hid_t group_id, int ndim, const hsize_t* dims, const char* name, const int* buffer, bool indep) { - write_data(group_id, ndim, dims, name, H5T_NATIVE_INT, buffer, indep); + write_dataset(group_id, ndim, dims, name, H5T_NATIVE_INT, buffer, indep); } @@ -268,7 +325,7 @@ void write_llong(hid_t group_id, int ndim, const hsize_t* dims, const char* name, const long long* buffer, bool indep) { - write_data(group_id, ndim, dims, name, H5T_NATIVE_LLONG, buffer, indep); + write_dataset(group_id, ndim, dims, name, H5T_NATIVE_LLONG, buffer, indep); } @@ -281,7 +338,7 @@ write_string(hid_t group_id, int ndim, const hsize_t* dims, size_t slen, hid_t datatype = H5Tcopy(H5T_C_S1); H5Tset_size(datatype, slen); - write_data(group_id, ndim, dims, name, datatype, buffer, indep); + write_dataset(group_id, ndim, dims, name, datatype, buffer, indep); // Free resources H5Tclose(datatype); diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index 11f26a5f1b..615bed24c7 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -41,8 +41,8 @@ write_double_1D(hid_t group_id, char const *name, H5Dclose(dataset); } -void read_data(hid_t obj_id, const char* name, double* buffer, - hid_t mem_type_id, bool indep); +void read_dataset(hid_t obj_id, const char* name, double* buffer, + hid_t mem_type_id, bool indep); extern "C" void read_double(hid_t obj_id, const char* name, double* buffer, bool indep); extern "C" void read_int(hid_t obj_id, const char* name, int* buffer, @@ -50,8 +50,17 @@ extern "C" void read_int(hid_t obj_id, const char* name, int* buffer, extern "C" void read_llong(hid_t obj_id, const char* name, long long* buffer, bool indep); -void write_data(hid_t group_id, int ndim, const hsize_t* dims, const char* name, - hid_t mem_type_id, const void* buffer, bool indep); +void write_attr(hid_t obj_id, int ndim, const hsize_t* dims, const char* name, + hid_t mem_type_id, const void* buffer); +extern "C" void write_attr_double(hid_t obj_id, int ndim, const hsize_t* dims, + const char* name, const double* buffer); +extern "C" void write_attr_int(hid_t obj_id, int ndim, const hsize_t* dims, + const char* name, const int* buffer); +extern "C" void write_attr_string(hid_t obj_id, const char* name, const char* buffer); + + +void write_dataset(hid_t group_id, int ndim, const hsize_t* dims, const char* name, + hid_t mem_type_id, const void* buffer, bool indep); extern "C" void write_double(hid_t group_id, int ndim, const hsize_t* dims, const char* name, const double* buffer, bool indep); extern "C" void write_int(hid_t group_id, int ndim, const hsize_t* dims, From ad3bb0b43acc4ec0ac8b338041205d9f37737904 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 18 Apr 2018 22:54:51 -0500 Subject: [PATCH 187/231] Handle most writing of attributes in C++ --- src/hdf5_interface.F90 | 189 ++++++++++++----------------------------- src/hdf5_interface.cpp | 52 +++++++++++- src/hdf5_interface.h | 13 ++- 3 files changed, 115 insertions(+), 139 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 1d056e1dcd..bd14245526 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -105,6 +105,19 @@ module hdf5_interface integer(HID_T), value :: file_id end subroutine file_close + subroutine get_shape_c(obj_id, dims) bind(C, name='get_shape') + import HID_T, HSIZE_T + integer(HID_T), value :: obj_id + integer(HSIZE_T), intent(out) :: dims(*) + end subroutine get_shape_c + + subroutine get_shape_attr(obj_id, name, dims) bind(C) + import HID_T, HSIZE_T, C_CHAR + integer(HID_T), value :: obj_id + character(kind=C_CHAR), intent(in) :: name(*) + integer(HSIZE_T), intent(out) :: dims(*) + end subroutine get_shape_attr + subroutine read_double_c(obj_id, name, buffer, indep) & bind(C, name='read_double') import HID_T, C_DOUBLE, C_BOOL, C_PTR @@ -114,6 +127,22 @@ module hdf5_interface logical(C_BOOL), intent(in) :: indep end subroutine read_double_c + subroutine read_attr_int_c(obj_id, name, buffer) & + bind(C, name='read_attr_int') + import HID_T, C_CHAR, C_INT + integer(HID_T), value :: obj_id + character(kind=C_CHAR), intent(in) :: name(*) + integer(C_INT), intent(in) :: buffer(*) + end subroutine read_attr_int_c + + subroutine read_attr_double_c(obj_id, name, buffer) & + bind(C, name='read_attr_double') + import HID_T, C_CHAR, C_DOUBLE + integer(HID_T), value :: obj_id + character(kind=C_CHAR), intent(in) :: name(*) + real(C_DOUBLE), intent(in) :: buffer(*) + end subroutine read_attr_double_c + subroutine read_int_c(obj_id, name, buffer, indep) & bind(C, name='read_int') import HID_T, C_INT, C_BOOL, C_PTR @@ -1178,14 +1207,10 @@ contains integer(HID_T), intent(in) :: obj_id character(*), intent(in) :: name - integer :: hdf5_err - integer(HID_T) :: attr_id - type(c_ptr) :: f_ptr + real(C_DOUBLE) :: buffer_(1) - call h5aopen_f(obj_id, trim(name), attr_id, hdf5_err) - f_ptr = c_loc(buffer) - call h5aread_f(attr_id, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err) - call h5aclose_f(attr_id, hdf5_err) + call read_attr_double_c(obj_id, to_c_string(name), buffer_) + buffer = buffer_(1) end subroutine read_attribute_double subroutine write_attribute_double(obj_id, name, buffer) @@ -1205,39 +1230,16 @@ contains integer(HID_T), intent(in) :: obj_id character(*), intent(in) :: name - integer :: hdf5_err - integer(HID_T) :: space_id - integer(HID_T) :: attr_id integer(HSIZE_T) :: dims(1) - integer(HSIZE_T) :: maxdims(1) - call h5aopen_f(obj_id, trim(name), attr_id, hdf5_err) - - if (allocated(buffer)) then - dims(:) = shape(buffer) - else - call h5aget_space_f(attr_id, space_id, hdf5_err) - call h5sget_simple_extent_dims_f(space_id, dims, maxdims, hdf5_err) + if (.not. allocated(buffer)) then + call get_shape_attr(obj_id, to_c_string(name), dims) allocate(buffer(dims(1))) - call h5sclose_f(space_id, hdf5_err) end if - call read_attribute_double_1D_explicit(attr_id, dims, buffer) - call h5aclose_f(attr_id, hdf5_err) + call read_attr_double_c(obj_id, to_c_string(name), buffer) end subroutine read_attribute_double_1D - subroutine read_attribute_double_1D_explicit(attr_id, dims, buffer) - integer(HID_T), intent(in) :: attr_id - integer(HSIZE_T), intent(in) :: dims(1) - real(8), target, intent(inout) :: buffer(dims(1)) - - integer :: hdf5_err - type(c_ptr) :: f_ptr - - f_ptr = c_loc(buffer) - call h5aread_f(attr_id, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err) - end subroutine read_attribute_double_1D_explicit - subroutine write_attribute_double_1D(obj_id, name, buffer) integer(HID_T), intent(in) :: obj_id character(*), intent(in) :: name @@ -1254,52 +1256,25 @@ contains integer(HID_T), intent(in) :: obj_id character(*), intent(in) :: name - integer :: hdf5_err - integer(HID_T) :: space_id - integer(HID_T) :: attr_id integer(HSIZE_T) :: dims(2) - integer(HSIZE_T) :: maxdims(2) - call h5aopen_f(obj_id, trim(name), attr_id, hdf5_err) - - if (allocated(buffer)) then - dims(:) = shape(buffer) - else - call h5aget_space_f(attr_id, space_id, hdf5_err) - call h5sget_simple_extent_dims_f(space_id, dims, maxdims, hdf5_err) - allocate(buffer(dims(1), dims(2))) - call h5sclose_f(space_id, hdf5_err) + if (.not. allocated(buffer)) then + call get_shape_attr(obj_id, to_c_string(name), dims) + allocate(buffer(dims(2), dims(1))) end if - call read_attribute_double_2D_explicit(attr_id, dims, buffer) - call h5aclose_f(attr_id, hdf5_err) + call read_attr_double_c(obj_id, to_c_string(name), buffer) end subroutine read_attribute_double_2D - subroutine read_attribute_double_2D_explicit(attr_id, dims, buffer) - integer(HID_T), intent(in) :: attr_id - integer(HSIZE_T), intent(in) :: dims(2) - real(8), target, intent(inout) :: buffer(dims(1),dims(2)) - - integer :: hdf5_err - type(c_ptr) :: f_ptr - - f_ptr = c_loc(buffer) - call h5aread_f(attr_id, H5T_NATIVE_DOUBLE, f_ptr, hdf5_err) - end subroutine read_attribute_double_2D_explicit - subroutine read_attribute_integer(buffer, obj_id, name) integer, intent(inout), target :: buffer integer(HID_T), intent(in) :: obj_id character(*), intent(in) :: name - integer :: hdf5_err - integer(HID_T) :: attr_id - type(c_ptr) :: f_ptr + integer(C_INT) :: buffer_(1) - call h5aopen_f(obj_id, trim(name), attr_id, hdf5_err) - f_ptr = c_loc(buffer) - call h5aread_f(attr_id, H5T_NATIVE_INTEGER, f_ptr, hdf5_err) - call h5aclose_f(attr_id, hdf5_err) + call read_attr_int_c(obj_id, to_c_string(name), buffer_) + buffer = buffer_(1) end subroutine read_attribute_integer subroutine write_attribute_integer(obj_id, name, buffer) @@ -1319,39 +1294,16 @@ contains integer(HID_T), intent(in) :: obj_id character(*), intent(in) :: name - integer :: hdf5_err - integer(HID_T) :: space_id - integer(HID_T) :: attr_id integer(HSIZE_T) :: dims(1) - integer(HSIZE_T) :: maxdims(1) - call h5aopen_f(obj_id, trim(name), attr_id, hdf5_err) - - if (allocated(buffer)) then - dims(:) = shape(buffer) - else - call h5aget_space_f(attr_id, space_id, hdf5_err) - call h5sget_simple_extent_dims_f(space_id, dims, maxdims, hdf5_err) + if (.not. allocated(buffer)) then + call get_shape_attr(obj_id, to_c_string(name), dims) allocate(buffer(dims(1))) - call h5sclose_f(space_id, hdf5_err) end if - call read_attribute_integer_1D_explicit(attr_id, dims, buffer) - call h5aclose_f(attr_id, hdf5_err) + call read_attr_int_c(obj_id, to_c_string(name), buffer) end subroutine read_attribute_integer_1D - subroutine read_attribute_integer_1D_explicit(attr_id, dims, buffer) - integer(HID_T), intent(in) :: attr_id - integer(HSIZE_T), intent(in) :: dims(1) - integer, target, intent(inout) :: buffer(dims(1)) - - integer :: hdf5_err - type(c_ptr) :: f_ptr - - f_ptr = c_loc(buffer) - call h5aread_f(attr_id, H5T_NATIVE_INTEGER, f_ptr, hdf5_err) - end subroutine read_attribute_integer_1D_explicit - subroutine write_attribute_integer_1D(obj_id, name, buffer) integer(HID_T), intent(in) :: obj_id character(*), intent(in) :: name @@ -1368,39 +1320,16 @@ contains integer(HID_T), intent(in) :: obj_id character(*), intent(in) :: name - integer :: hdf5_err - integer(HID_T) :: space_id - integer(HID_T) :: attr_id integer(HSIZE_T) :: dims(2) - integer(HSIZE_T) :: maxdims(2) - call h5aopen_f(obj_id, trim(name), attr_id, hdf5_err) - - if (allocated(buffer)) then - dims(:) = shape(buffer) - else - call h5aget_space_f(attr_id, space_id, hdf5_err) - call h5sget_simple_extent_dims_f(space_id, dims, maxdims, hdf5_err) - allocate(buffer(dims(1), dims(2))) - call h5sclose_f(space_id, hdf5_err) + if (.not. allocated(buffer)) then + call get_shape_attr(obj_id, to_c_string(name), dims) + allocate(buffer(dims(2), dims(1))) end if - call read_attribute_integer_2D_explicit(attr_id, dims, buffer) - call h5aclose_f(attr_id, hdf5_err) + call read_attr_int_C(obj_id, to_c_string(name), buffer) end subroutine read_attribute_integer_2D - subroutine read_attribute_integer_2D_explicit(attr_id, dims, buffer) - integer(HID_T), intent(in) :: attr_id - integer(HSIZE_T), intent(in) :: dims(2) - integer, target, intent(inout) :: buffer(dims(1),dims(2)) - - integer :: hdf5_err - type(c_ptr) :: f_ptr - - f_ptr = c_loc(buffer) - call h5aread_f(attr_id, H5T_NATIVE_INTEGER, f_ptr, hdf5_err) - end subroutine read_attribute_integer_2D_explicit - subroutine read_attribute_string(buffer, obj_id, name) character(*), intent(inout) :: buffer ! read data to here integer(HID_T), intent(in) :: obj_id @@ -1533,21 +1462,13 @@ contains integer(HID_T), intent(in) :: obj_id integer(HSIZE_T), intent(out) :: dims(:) - integer :: hdf5_err - integer :: type - integer(HID_T) :: space_id - integer(HSIZE_T) :: maxdims(size(dims)) + integer :: i + integer(HSIZE_T) :: dims_c(size(dims)) - call h5iget_type_f(obj_id, type, hdf5_err) - if (type == H5I_DATASET_F) then - call h5dget_space_f(obj_id, space_id, hdf5_err) - call h5sget_simple_extent_dims_f(space_id, dims, maxdims, hdf5_err) - call h5sclose_f(space_id, hdf5_err) - elseif (type == H5I_ATTR_F) then - call h5aget_space_f(obj_id, space_id, hdf5_err) - call h5sget_simple_extent_dims_f(space_id, dims, maxdims, hdf5_err) - call h5sclose_f(space_id, hdf5_err) - end if + call get_shape_c(obj_id, dims_c) + do i = 1, size(dims) + dims(i) = dims_c(size(dims) - i + 1) + end do end subroutine get_shape subroutine get_ndims(obj_id, ndims) diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index f482285f26..3e906a94ab 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -31,6 +31,32 @@ using_mpio_device(hid_t obj_id) } +void +get_shape(hid_t obj_id, hsize_t* dims) +{ + auto type = H5Iget_type(obj_id); + hid_t dspace; + if (type == H5I_DATASET) { + dspace = H5Dget_space(obj_id); + } else if (type == H5I_ATTR) { + dspace = H5Aget_space(obj_id); + } + H5Sget_simple_extent_dims(dspace, dims, nullptr); + H5Sclose(dspace); +} + + +void +get_shape_attr(hid_t obj_id, const char* name, hsize_t* dims) +{ + hid_t attr = H5Aopen(obj_id, name, H5P_DEFAULT); + hid_t dspace = H5Aget_space(attr); + H5Sget_simple_extent_dims(dspace, dims, nullptr); + H5Sclose(dspace); + H5Aclose(attr); +} + + hid_t create_group(hid_t parent_id, char const *name) { @@ -159,10 +185,32 @@ open_group(hid_t group_id, const char* name) } } +void +read_attr(hid_t obj_id, const char* name, hid_t mem_type_id, void* buffer) +{ + hid_t attr = H5Aopen(obj_id, name, H5P_DEFAULT); + H5Aread(attr, mem_type_id, buffer); + H5Aclose(attr); +} + + +void +read_attr_double(hid_t obj_id, const char* name, double* buffer) +{ + read_attr(obj_id, name, H5T_NATIVE_DOUBLE, buffer); +} + + +void +read_attr_int(hid_t obj_id, const char* name, int* buffer) +{ + read_attr(obj_id, name, H5T_NATIVE_INT, buffer); +} + void read_dataset(hid_t obj_id, const char* name, hid_t mem_type_id, - void* buffer, bool indep) + void* buffer, bool indep) { hid_t dset = obj_id; if (name) dset = H5Dopen(obj_id, name, H5P_DEFAULT); @@ -176,7 +224,7 @@ read_dataset(hid_t obj_id, const char* name, hid_t mem_type_id, hid_t plist = H5Pcreate(H5P_DATASET_XFER); H5Pset_dxpl_mpio(plist, data_xfer_mode); - // Write data + // Read data H5Dread(dset, mem_type_id, H5S_ALL, H5S_ALL, plist, buffer); H5Pclose(plist); #endif diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index 615bed24c7..ca5e27e7e8 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -11,7 +11,6 @@ namespace openmc { -bool using_mpio_device(hid_t obj_id); hid_t create_group(hid_t parent_id, const char* name); hid_t create_group(hid_t parent_id, const std::string& name); void close_dataset(hid_t dataset_id); @@ -19,9 +18,12 @@ void close_group(hid_t group_id); extern "C" hid_t file_open(const char* filename, char mode, bool parallel); hid_t file_open(const std::string& filename, char mode, bool parallel); extern "C" void file_close(hid_t file_id); +extern "C" void get_shape(hid_t obj_if, hsize_t* dims); +extern "C" void get_shape_attr(hid_t obj_if, const char* name, hsize_t* dims); bool object_exists(hid_t object_id, const char* name); hid_t open_dataset(hid_t group_id, const char* name); hid_t open_group(hid_t group_id, const char* name); +bool using_mpio_device(hid_t obj_id); template void @@ -41,8 +43,13 @@ write_double_1D(hid_t group_id, char const *name, H5Dclose(dataset); } -void read_dataset(hid_t obj_id, const char* name, double* buffer, - hid_t mem_type_id, bool indep); +void read_attr(hid_t obj_id, const char* name, hid_t mem_type_id, + const void* buffer); +extern "C" void read_attr_double(hid_t obj_id, const char* name, double* buffer); +extern "C" void read_attr_int(hid_t obj_id, const char* name, int* buffer); + +void read_dataset(hid_t obj_id, const char* name, hid_t mem_type_id, + void* buffer, bool indep); extern "C" void read_double(hid_t obj_id, const char* name, double* buffer, bool indep); extern "C" void read_int(hid_t obj_id, const char* name, int* buffer, From 422edace492afbe6b9c0a282aa43ad198dcc326d Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 18 Apr 2018 23:08:43 -0500 Subject: [PATCH 188/231] Use dataset_ndims and object_exists from C++ --- src/hdf5_interface.F90 | 34 ++++++++++++++++++---------------- src/hdf5_interface.cpp | 12 ++++++++++++ src/hdf5_interface.h | 3 ++- 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index bd14245526..56da0def1f 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -331,11 +331,18 @@ contains character(*), intent(in) :: name ! name of group logical :: exists - integer :: hdf5_err ! HDF5 error code + interface + function object_exists_c(obj_id, name) result(exists) & + bind(C, name='object_exists') + import HID_T, C_CHAR, C_BOOL + integer(HID_T), value :: obj_id + character(kind=C_CHAR), intent(in) :: name(*) + logical(C_BOOL) :: exists + end function object_exists_c + end interface ! Check if group exists - call h5ltpath_valid_f(object_id, trim(name), .true., exists, hdf5_err) - + exists = object_exists_c(object_id, to_c_string(name)) end function object_exists !=============================================================================== @@ -1475,20 +1482,15 @@ contains integer(HID_T), intent(in) :: obj_id integer, intent(out) :: ndims - integer :: hdf5_err - integer :: type - integer(HID_T) :: space_id + interface + function dataset_ndims(dset) result(ndims) bind(C) + import HID_T, C_INT + integer(HID_T), value :: dset + integer(C_INT) :: ndims + end function dataset_ndims + end interface - call h5iget_type_f(obj_id, type, hdf5_err) - if (type == H5I_DATASET_F) then - call h5dget_space_f(obj_id, space_id, hdf5_err) - call h5sget_simple_extent_ndims_f(space_id, ndims, hdf5_err) - call h5sclose_f(space_id, hdf5_err) - elseif (type == H5I_ATTR_F) then - call h5aget_space_f(obj_id, space_id, hdf5_err) - call h5sget_simple_extent_ndims_f(space_id, ndims, hdf5_err) - call h5sclose_f(space_id, hdf5_err) - end if + ndims = dataset_ndims(obj_id) end subroutine get_ndims function using_mpio_device(obj_id) result(mpio) diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index 3e906a94ab..8fef1bd951 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -69,12 +69,14 @@ create_group(hid_t parent_id, char const *name) return out; } + hid_t create_group(hid_t parent_id, const std::string &name) { return create_group(parent_id, name.c_str()); } + void close_dataset(hid_t dataset_id) { @@ -89,6 +91,16 @@ close_group(hid_t group_id) } +int +dataset_ndims(hid_t dset) +{ + hid_t dspace = H5Dget_space(dset); + int ndims = H5Sget_simple_extent_ndims(dspace); + H5Sclose(dspace); + return ndims; +} + + hid_t file_open(const char* filename, char mode, bool parallel) { diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index ca5e27e7e8..6759ffc64a 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -15,12 +15,13 @@ hid_t create_group(hid_t parent_id, const char* name); hid_t create_group(hid_t parent_id, const std::string& name); void close_dataset(hid_t dataset_id); void close_group(hid_t group_id); +extern "C" int dataset_ndims(hid_t dset); extern "C" hid_t file_open(const char* filename, char mode, bool parallel); hid_t file_open(const std::string& filename, char mode, bool parallel); extern "C" void file_close(hid_t file_id); extern "C" void get_shape(hid_t obj_if, hsize_t* dims); extern "C" void get_shape_attr(hid_t obj_if, const char* name, hsize_t* dims); -bool object_exists(hid_t object_id, const char* name); +extern "C" bool object_exists(hid_t object_id, const char* name); hid_t open_dataset(hid_t group_id, const char* name); hid_t open_group(hid_t group_id, const char* name); bool using_mpio_device(hid_t obj_id); From 05fcd993c27137e182479ab754e0a025e610086e Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 19 Apr 2018 07:47:23 -0500 Subject: [PATCH 189/231] Convert HDF5 read_complex to C++ --- src/hdf5_interface.F90 | 96 ++++++++---------------------------------- src/hdf5_interface.cpp | 23 +++++++++- src/hdf5_interface.h | 3 ++ 3 files changed, 43 insertions(+), 79 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 56da0def1f..b0b3d1006a 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -161,6 +161,15 @@ module hdf5_interface logical(C_BOOL), intent(in) :: indep end subroutine read_llong_c + subroutine read_complex_c(obj_id, name, buffer, indep) & + bind(C, name='read_complex') + import HID_T, C_PTR, C_DOUBLE_COMPLEX, C_BOOL + integer(HID_T), value :: obj_id + type(C_PTR), value :: name + complex(C_DOUBLE_COMPLEX), intent(in) :: buffer(*) + logical(C_BOOL), intent(in) :: indep + end subroutine read_complex_c + subroutine write_attr_double_c(obj_id, ndim, dims, name, buffer) & bind(C, name='write_attr_double') import HID_T, HSIZE_T, C_INT, C_DOUBLE, C_CHAR @@ -1527,94 +1536,25 @@ contains !=============================================================================== subroutine read_complex_2D(buffer, obj_id, name, indep) - complex(8), target, intent(inout) :: buffer(:,:) + complex(C_DOUBLE_COMPLEX), target, intent(inout) :: buffer(:,:) integer(HID_T), intent(in) :: obj_id character(*), optional, intent(in) :: name logical, optional, intent(in) :: indep ! independent I/O - integer :: hdf5_err - integer(HID_T) :: dset_id - integer(HSIZE_T) :: dims(2) + logical(C_BOOL) :: indep_ + character(kind=C_CHAR), target, allocatable :: name_(:) + + indep_ = .false. + if (present(indep)) indep_ = indep ! If 'name' argument is passed, obj_id is interpreted to be a group and ! 'name' is the name of the dataset we should read from if (present(name)) then - call h5dopen_f(obj_id, trim(name), dset_id, hdf5_err) + name_ = to_c_string(name) + call read_complex_c(obj_id, c_loc(name_), buffer, indep_) else - dset_id = obj_id + call read_complex_c(obj_id, C_NULL_PTR, buffer, indep_) end if - - dims(:) = shape(buffer) - - if (present(indep)) then - call read_complex_2D_explicit(dset_id, dims, buffer, indep) - else - call read_complex_2D_explicit(dset_id, dims, buffer) - end if - - if (present(name)) call h5dclose_f(dset_id, hdf5_err) end subroutine read_complex_2D - subroutine read_complex_2D_explicit(dset_id, dims, buffer, indep) - integer(HID_T), intent(in) :: dset_id - integer(HSIZE_T), intent(in) :: dims(2) - complex(8), target, intent(inout) :: buffer(dims(1), dims(2)) - logical, optional, intent(in) :: indep ! independent I/O - - real(8), target :: buffer_r(dims(1), dims(2)) - real(8), target :: buffer_i(dims(1), dims(2)) - - integer(HSIZE_T) :: i, j - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - type(c_ptr) :: f_ptr_r, f_ptr_i - - ! Components needed for complex type support - integer(HID_T) :: dtype_real - integer(HID_T) :: dtype_imag - integer(SIZE_T) :: size_double - - ! Create the complex type - call h5tget_size_f(H5T_NATIVE_DOUBLE, size_double, hdf5_err) - - ! Insert the 'r' and 'i' identifiers - call h5tcreate_f(H5T_COMPOUND_F, size_double, dtype_real, hdf5_err) - call h5tcreate_f(H5T_COMPOUND_F, size_double, dtype_imag, hdf5_err) - call h5tinsert_f(dtype_real, "r", 0_SIZE_T, H5T_NATIVE_DOUBLE, hdf5_err) - call h5tinsert_f(dtype_imag, "i", 0_SIZE_T, H5T_NATIVE_DOUBLE, hdf5_err) - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - f_ptr_r = c_loc(buffer_r) - f_ptr_i = c_loc(buffer_i) - - if (using_mpio_device(dset_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dread_f(dset_id, dtype_real, f_ptr_r, hdf5_err, xfer_prp=plist) - call h5dread_f(dset_id, dtype_imag, f_ptr_i, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dread_f(dset_id, dtype_real, f_ptr_r, hdf5_err) - call h5dread_f(dset_id, dtype_imag, f_ptr_i, hdf5_err) - end if - - ! Reconstitute the complex numbers - do i = 1, dims(1) - do j = 1, dims(2) - buffer(i, j) = cmplx(buffer_r(i,j), buffer_i(i,j), kind=8) - end do - end do - end subroutine read_complex_2D_explicit - end module hdf5_interface diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index 8fef1bd951..c75ec31aa2 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -269,6 +269,27 @@ read_llong(hid_t obj_id, const char* name, long long* buffer, bool indep) } +void +read_complex(hid_t obj_id, const char* name, double _Complex* buffer, bool indep) +{ + // Create compound datatype for complex numbers + struct complex_t { + double re; + double im; + }; + complex_t tmp; + hid_t complex_id = H5Tcreate(H5T_COMPOUND, sizeof tmp); + H5Tinsert(complex_id, "r", HOFFSET(complex_t, re), H5T_NATIVE_DOUBLE); + H5Tinsert(complex_id, "i", HOFFSET(complex_t, im), H5T_NATIVE_DOUBLE); + + // Read data + read_dataset(obj_id, name, complex_id, buffer, indep); + + // Free resources + H5Tclose(complex_id); +} + + void write_attr(hid_t obj_id, int ndim, const hsize_t* dims, const char* name, hid_t mem_type_id, const void* buffer) @@ -412,4 +433,4 @@ write_string(hid_t group_id, char const* name, const std::string& buffer, bool i write_string(group_id, 0, nullptr, buffer.length(), name, buffer.c_str(), indep); } -} +} // namespace openmc diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index 6759ffc64a..785548e89c 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -7,6 +7,7 @@ #include #include #include +#include namespace openmc { @@ -57,6 +58,8 @@ extern "C" void read_int(hid_t obj_id, const char* name, int* buffer, bool indep); extern "C" void read_llong(hid_t obj_id, const char* name, long long* buffer, bool indep); +extern "C" void read_complex(hid_t obj_id, const char* name, + double _Complex* buffer, bool indep); void write_attr(hid_t obj_id, int ndim, const hsize_t* dims, const char* name, hid_t mem_type_id, const void* buffer); From 66bc225fa3b83bb0aa8ff60067cc9461d549fa52 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 19 Apr 2018 10:17:48 -0500 Subject: [PATCH 190/231] Convert open/close_dataset/group --- src/hdf5_interface.F90 | 90 +++++++++++++++++++++--------------------- src/hdf5_interface.h | 10 ++--- 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index b0b3d1006a..73b052e747 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -422,18 +422,17 @@ contains character(*), intent(in) :: name ! name of group integer(HID_T) :: newgroup_id - logical :: exists ! does the group exist - integer :: hdf5_err ! HDF5 error code + interface + function open_group_c(group_id, name) result(newgroup_id) & + bind(C, name='open_group') + import HID_T, C_CHAR + integer(HID_T), value :: group_id + character(kind=C_CHAR), intent(in) :: name(*) + integer(HID_T) :: newgroup_id + end function open_group_c + end interface - ! Check if group exists - exists = object_exists(group_id, name) - - ! open group if it exists - if (exists) then - call h5gopen_f(group_id, trim(name), newgroup_id, hdf5_err) - else - call fatal_error("The group '" // trim(name) // "' does not exist.") - end if + newgroup_id = open_group_c(group_id, to_c_string(name)) end function open_group !=============================================================================== @@ -445,18 +444,17 @@ contains character(*), intent(in) :: name ! name of group integer(HID_T) :: newgroup_id - integer :: hdf5_err ! HDF5 error code - logical :: exists ! does the group exist + interface + function create_group_c(group_id, name) result(newgroup_id) & + bind(C, name='create_group') + import HID_T, C_CHAR + integer(HID_T), value :: group_id + character(kind=C_CHAR), intent(in) :: name(*) + integer(HID_T) :: newgroup_id + end function create_group_c + end interface - ! Check if group exists - exists = object_exists(group_id, name) - - ! create group - if (exists) then - call fatal_error("The group '" // trim(name) // "' already exists.") - else - call h5gcreate_f(group_id, trim(name), newgroup_id, hdf5_err) - end if + newgroup_id = create_group_c(group_id, to_c_string(name)) end function create_group !=============================================================================== @@ -465,13 +463,14 @@ contains subroutine close_group(group_id) integer(HID_T), intent(inout) :: group_id + interface + subroutine close_group_c(group_id) bind(C, name='close_group') + import HID_T + integer(HID_T), value :: group_id + end subroutine close_group_c + end interface - integer :: hdf5_err ! HDF5 error code - - call h5gclose_f(group_id, hdf5_err) - if (hdf5_err < 0) then - call fatal_error("Unable to close HDF5 group.") - end if + call close_group_c(group_id) end subroutine close_group !=============================================================================== @@ -483,33 +482,34 @@ contains character(*), intent(in) :: name ! name of dataset integer(HID_T) :: dataset_id - logical :: exists ! does the dataset exist - integer :: hdf5_err ! HDF5 error code + interface + function open_dataset_c(group_id, name) result(dset_id) & + bind(C, name='open_dataset') + import HID_T, C_CHAR + integer(HID_T), value :: group_id + character(kind=C_CHAR), intent(in) :: name(*) + integer(HID_T) :: dset_id + end function open_dataset_c + end interface - ! Check if group exists - exists = object_exists(group_id, name) - - ! open group if it exists - if (exists) then - call h5dopen_f(group_id, trim(name), dataset_id, hdf5_err) - else - call fatal_error("The dataset '" // trim(name) // "' does not exist.") - end if + dataset_id = open_dataset_c(group_id, to_c_string(name)) end function open_dataset !=============================================================================== -! CLOSE_GROUP closes HDF5 temp_group +! CLOSE_DATASET closes an HDF5 dataset !=============================================================================== subroutine close_dataset(dataset_id) integer(HID_T), intent(inout) :: dataset_id - integer :: hdf5_err ! HDF5 error code + interface + subroutine close_dataset_c(dset_id) bind(C, name='close_dataset') + import HID_T + integer(HID_T), value :: dset_id + end subroutine close_dataset_c + end interface - call h5dclose_f(dataset_id, hdf5_err) - if (hdf5_err < 0) then - call fatal_error("Unable to close HDF5 dataset.") - end if + call close_dataset_c(dataset_id) end subroutine close_dataset !=============================================================================== diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index 785548e89c..69cd7adaac 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -12,10 +12,10 @@ namespace openmc { -hid_t create_group(hid_t parent_id, const char* name); +extern "C" hid_t create_group(hid_t parent_id, const char* name); hid_t create_group(hid_t parent_id, const std::string& name); -void close_dataset(hid_t dataset_id); -void close_group(hid_t group_id); +extern "C" void close_dataset(hid_t dataset_id); +extern "C" void close_group(hid_t group_id); extern "C" int dataset_ndims(hid_t dset); extern "C" hid_t file_open(const char* filename, char mode, bool parallel); hid_t file_open(const std::string& filename, char mode, bool parallel); @@ -23,8 +23,8 @@ extern "C" void file_close(hid_t file_id); extern "C" void get_shape(hid_t obj_if, hsize_t* dims); extern "C" void get_shape_attr(hid_t obj_if, const char* name, hsize_t* dims); extern "C" bool object_exists(hid_t object_id, const char* name); -hid_t open_dataset(hid_t group_id, const char* name); -hid_t open_group(hid_t group_id, const char* name); +extern "C" hid_t open_dataset(hid_t group_id, const char* name); +extern "C" hid_t open_group(hid_t group_id, const char* name); bool using_mpio_device(hid_t obj_id); From b8635f1c2ba4157d4a323845802b7bb8793f54a1 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 19 Apr 2018 10:59:33 -0500 Subject: [PATCH 191/231] Convert HDF5 read_string to C++ --- src/hdf5_interface.F90 | 89 +++++++++++++++++------------------------- src/hdf5_interface.cpp | 27 ++++++++++++- src/hdf5_interface.h | 3 ++ 3 files changed, 64 insertions(+), 55 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 73b052e747..a0148cfd2d 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -100,6 +100,12 @@ module hdf5_interface public :: get_name interface + function dataset_typesize(dset) result(sz) bind(C) + import HID_T, SIZE_T + integer(HID_T), value :: dset + integer(SIZE_T) :: sz + end function dataset_typesize + subroutine file_close(file_id) bind(C) import HID_T integer(HID_T), value :: file_id @@ -123,7 +129,7 @@ module hdf5_interface import HID_T, C_DOUBLE, C_BOOL, C_PTR integer(HID_T), value :: obj_id type(C_PTR), value :: name - real(C_DOUBLE), intent(in) :: buffer(*) + real(C_DOUBLE), intent(out) :: buffer(*) logical(C_BOOL), intent(in) :: indep end subroutine read_double_c @@ -132,7 +138,7 @@ module hdf5_interface import HID_T, C_CHAR, C_INT integer(HID_T), value :: obj_id character(kind=C_CHAR), intent(in) :: name(*) - integer(C_INT), intent(in) :: buffer(*) + integer(C_INT), intent(out) :: buffer(*) end subroutine read_attr_int_c subroutine read_attr_double_c(obj_id, name, buffer) & @@ -140,7 +146,7 @@ module hdf5_interface import HID_T, C_CHAR, C_DOUBLE integer(HID_T), value :: obj_id character(kind=C_CHAR), intent(in) :: name(*) - real(C_DOUBLE), intent(in) :: buffer(*) + real(C_DOUBLE), intent(out) :: buffer(*) end subroutine read_attr_double_c subroutine read_int_c(obj_id, name, buffer, indep) & @@ -148,7 +154,7 @@ module hdf5_interface import HID_T, C_INT, C_BOOL, C_PTR integer(HID_T), value :: obj_id type(C_PTR), value :: name - integer(C_INT), intent(in) :: buffer(*) + integer(C_INT), intent(out) :: buffer(*) logical(C_BOOL), intent(in) :: indep end subroutine read_int_c @@ -157,16 +163,26 @@ module hdf5_interface import HID_T, C_INT, C_BOOL, C_PTR, C_LONG_LONG integer(HID_T), value :: obj_id type(C_PTR), value :: name - integer(C_LONG_LONG), intent(in) :: buffer(*) + integer(C_LONG_LONG), intent(out) :: buffer(*) logical(C_BOOL), intent(in) :: indep end subroutine read_llong_c + subroutine read_string_c(obj_id, name, slen, buffer, indep) & + bind(C, name='read_string') + import HID_T, C_PTR, C_SIZE_T, C_CHAR, C_BOOL + integer(HID_T), value :: obj_id + type(C_PTR), value :: name + integer(C_SIZE_T), value :: slen + character(kind=C_CHAR), intent(out) :: buffer(*) + logical(C_BOOL), intent(in) :: indep + end subroutine read_string_c + subroutine read_complex_c(obj_id, name, buffer, indep) & bind(C, name='read_complex') import HID_T, C_PTR, C_DOUBLE_COMPLEX, C_BOOL integer(HID_T), value :: obj_id type(C_PTR), value :: name - complex(C_DOUBLE_COMPLEX), intent(in) :: buffer(*) + complex(C_DOUBLE_COMPLEX), intent(out) :: buffer(*) logical(C_BOOL), intent(in) :: indep end subroutine read_complex_c @@ -1019,67 +1035,32 @@ contains character(*), optional, intent(in) :: name logical, optional, intent(in) :: indep ! independent I/O - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif integer(HID_T) :: dset_id - integer(HID_T) :: filetype - integer(HID_T) :: memtype integer(SIZE_T) :: i, n - character(kind=C_CHAR), allocatable, target :: temp_buffer(:) - type(c_ptr) :: f_ptr + logical(C_BOOL) :: indep_ + character(kind=C_CHAR), allocatable, target :: buffer_(:) if (present(name)) then - call h5dopen_f(obj_id, trim(name), dset_id, hdf5_err) + dset_id = open_dataset(obj_id, name) else dset_id = obj_id end if - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if + ! Allocate a C char array to get string + n = dataset_typesize(dset_id) + allocate(buffer_(n)) - ! Make sure buffer is large enough - call h5dget_type_f(dset_id, filetype, hdf5_err) - call h5tget_size_f(filetype, n, hdf5_err) - if (n > len(buffer)) then - call fatal_error("Character buffer is not long enough to & - &read HDF5 string.") - end if - - ! Get datatype in memory based on Fortran character - call h5tcopy_f(H5T_C_S1, memtype, hdf5_err) - call h5tset_size_f(memtype, n + 1, hdf5_err) - - ! Get pointer to start of string - allocate(temp_buffer(n)) - f_ptr = c_loc(temp_buffer(1)) - - if (using_mpio_device(dset_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dread_f(dset_id, memtype, f_ptr, hdf5_err, xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dread_f(dset_id, memtype, f_ptr, hdf5_err) - end if + indep_ = .false. + if (present(indep)) indep_ = indep + call read_string_c(dset_id, C_NULL_PTR, n, buffer_, indep_) buffer = '' do i = 1, n - if (temp_buffer(i) == C_NULL_CHAR) cycle - buffer(i:i) = temp_buffer(i) + if (buffer_(i) == C_NULL_CHAR) cycle + buffer(i:i) = buffer_(i) end do - if (present(name)) call h5dclose_f(dset_id, hdf5_err) - - call h5tclose_f(filetype, hdf5_err) - call h5tclose_f(memtype, hdf5_err) + call close_dataset(dset_id) end subroutine read_string !=============================================================================== @@ -1343,7 +1324,7 @@ contains allocate(buffer(dims(2), dims(1))) end if - call read_attr_int_C(obj_id, to_c_string(name), buffer) + call read_attr_int_c(obj_id, to_c_string(name), buffer) end subroutine read_attribute_integer_2D subroutine read_attribute_string(buffer, obj_id, name) diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index c75ec31aa2..bf410923b6 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -101,6 +101,16 @@ dataset_ndims(hid_t dset) } +size_t +dataset_typesize(hid_t dset) +{ + hid_t filetype = H5Dget_type(dset); + size_t n = H5Tget_size(filetype); + H5Tclose(filetype); + return n; +} + + hid_t file_open(const char* filename, char mode, bool parallel) { @@ -225,7 +235,7 @@ read_dataset(hid_t obj_id, const char* name, hid_t mem_type_id, void* buffer, bool indep) { hid_t dset = obj_id; - if (name) dset = H5Dopen(obj_id, name, H5P_DEFAULT); + if (name) dset = open_dataset(obj_id, name); if (using_mpio_device(dset)) { #ifdef PHDF5 @@ -269,6 +279,21 @@ read_llong(hid_t obj_id, const char* name, long long* buffer, bool indep) } +void +read_string(hid_t obj_id, const char* name, size_t slen, char* buffer, bool indep) +{ + // Create datatype for a string + hid_t datatype = H5Tcopy(H5T_C_S1); + H5Tset_size(datatype, slen + 1); + + // Read data into buffer + read_dataset(obj_id, name, datatype, buffer, indep); + + // Free resources + H5Tclose(datatype); +} + + void read_complex(hid_t obj_id, const char* name, double _Complex* buffer, bool indep) { diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index 69cd7adaac..fdaf9ac8fc 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -17,6 +17,7 @@ hid_t create_group(hid_t parent_id, const std::string& name); extern "C" void close_dataset(hid_t dataset_id); extern "C" void close_group(hid_t group_id); extern "C" int dataset_ndims(hid_t dset); +extern "C" size_t dataset_typesize(hid_t dset); extern "C" hid_t file_open(const char* filename, char mode, bool parallel); hid_t file_open(const std::string& filename, char mode, bool parallel); extern "C" void file_close(hid_t file_id); @@ -58,6 +59,8 @@ extern "C" void read_int(hid_t obj_id, const char* name, int* buffer, bool indep); extern "C" void read_llong(hid_t obj_id, const char* name, long long* buffer, bool indep); +extern "C" void read_string(hid_t obj_id, const char* name, size_t slen, + char* buffer, bool indep); extern "C" void read_complex(hid_t obj_id, const char* name, double _Complex* buffer, bool indep); From 1cb46effda75c250c58da506b3b58582e7c8e540 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 19 Apr 2018 11:07:27 -0500 Subject: [PATCH 192/231] Convert HDF5 attribute_exists to C++ --- src/hdf5_interface.F90 | 16 +++++++++++----- src/hdf5_interface.cpp | 8 ++++++++ src/hdf5_interface.h | 1 + 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index a0148cfd2d..eee5397671 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -332,7 +332,7 @@ contains end subroutine get_groups !=============================================================================== -! CHECK_ATTRIBUTE Checks to see if an attribute exists in the object +! ATTRIBUTE_EXISTS checks to see if an attribute exists in the object !=============================================================================== function attribute_exists(object_id, name) result(exists) @@ -340,11 +340,17 @@ contains character(*), intent(in) :: name ! name of group logical :: exists - integer :: hdf5_err ! HDF5 error code - - ! Check if attribute exists - call h5aexists_by_name_f(object_id, '.', trim(name), exists, hdf5_err) + interface + function attribute_exists_c(obj_id, name) result(exists) & + bind(C, name='attribute_exists') + import HID_T, C_CHAR, C_BOOL + integer(HID_T), value :: obj_id + character(kind=C_CHAR), intent(in) :: name(*) + logical(C_BOOL) :: exists + end function attribute_exists_c + end interface + exists = attribute_exists_c(object_id, to_c_string(name)) end function attribute_exists !=============================================================================== diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index bf410923b6..aa44e7c972 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -11,6 +11,14 @@ namespace openmc { +bool +attribute_exists(hid_t obj_id, const char* name) +{ + htri_t out = H5Aexists_by_name(obj_id, ".", name, H5P_DEFAULT); + return out > 0; +} + + bool using_mpio_device(hid_t obj_id) { diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index fdaf9ac8fc..2e470dbc7d 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -12,6 +12,7 @@ namespace openmc { +extern "C" bool attribute_exists(hid_t obj_id, const char* name); extern "C" hid_t create_group(hid_t parent_id, const char* name); hid_t create_group(hid_t parent_id, const std::string& name); extern "C" void close_dataset(hid_t dataset_id); From 95b05ef02de570432101daa48a884ec70346c358 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 19 Apr 2018 11:33:24 -0500 Subject: [PATCH 193/231] Convert HDF5 read_string_1D to C++ --- src/hdf5_interface.F90 | 96 +++++++++++------------------------------- 1 file changed, 24 insertions(+), 72 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index eee5397671..1cf2522598 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -1111,87 +1111,39 @@ contains character(*), optional, intent(in) :: name logical, optional, intent(in) :: indep ! independent I/O - integer :: hdf5_err - integer(HID_T) :: dset_id - integer(HSIZE_T) :: dims(1) + integer(HID_T) :: dset_id + integer(SIZE_T) :: i, j, k, n, m + logical(C_BOOL) :: indep_ + character(kind=C_CHAR), allocatable, target :: buffer_(:) - ! If 'name' argument is passed, obj_id is interpreted to be a group and - ! 'name' is the name of the dataset we should read from if (present(name)) then - call h5dopen_f(obj_id, trim(name), dset_id, hdf5_err) + dset_id = open_dataset(obj_id, name) else dset_id = obj_id end if - dims(:) = shape(buffer) + ! Allocate a C char array to get strings + n = dataset_typesize(dset_id) + m = size(buffer) + allocate(buffer_(n*m)) - if (present(indep)) then - call read_string_1D_explicit(dset_id, dims, buffer, indep) - else - call read_string_1D_explicit(dset_id, dims, buffer) - end if + indep_ = .false. + if (present(indep)) indep_ = indep + call read_string_c(dset_id, C_NULL_PTR, n, buffer_, indep_) + + ! Convert null-terminated C strings into Fortran strings + do i = 1, m + buffer(i) = '' + do j = 1, n + k = (i-1)*n + j + if (buffer_(k) == C_NULL_CHAR) exit + buffer(i)(j:j) = buffer_(k) + end do + end do + + call close_dataset(dset_id) end subroutine read_string_1D - subroutine read_string_1D_explicit(dset_id, dims, buffer, indep) - integer(HID_T), intent(in) :: dset_id - integer(HSIZE_T), intent(in) :: dims(1) - character(*), target, intent(inout) :: buffer(dims(1)) - logical, optional, intent(in) :: indep ! independent I/O - - integer :: hdf5_err - integer :: data_xfer_mode -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - integer(HID_T) :: space_id - integer(HID_T) :: filetype - integer(HID_T) :: memtype - integer(SIZE_T) :: size - integer(SIZE_T) :: n - type(c_ptr) :: f_ptr - - ! Set up collective vs. independent I/O - data_xfer_mode = H5FD_MPIO_COLLECTIVE_F - if (present(indep)) then - if (indep) data_xfer_mode = H5FD_MPIO_INDEPENDENT_F - end if - - ! Get dataset and dataspace - call h5dget_space_f(dset_id, space_id, hdf5_err) - - ! Make sure buffer is large enough - call h5dget_type_f(dset_id, filetype, hdf5_err) - call h5tget_size_f(filetype, size, hdf5_err) - if (size > len(buffer(1)) + 1) then - call fatal_error("Character buffer is not long enough to & - &read HDF5 string array.") - end if - - ! Get datatype in memory based on Fortran character - n = len(buffer(1)) - call h5tcopy_f(H5T_FORTRAN_S1, memtype, hdf5_err) - call h5tset_size_f(memtype, n, hdf5_err) - - ! Get pointer to start of string - f_ptr = c_loc(buffer(1)(1:1)) - - if (using_mpio_device(dset_id)) then -#ifdef PHDF5 - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, data_xfer_mode, hdf5_err) - call h5dread_f(dset_id, memtype, f_ptr, hdf5_err, mem_space_id=space_id, & - xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#endif - else - call h5dread_f(dset_id, memtype, f_ptr, hdf5_err, mem_space_id=space_id) - end if - - call h5sclose_f(space_id, hdf5_err) - call h5tclose_f(filetype, hdf5_err) - call h5tclose_f(memtype, hdf5_err) - end subroutine read_string_1D_explicit - !=============================================================================== ! WRITE_ATTRIBUTE_STRING !=============================================================================== From c50c6f070007f0a6cbdcd3a7d76e0d1f5d950add Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 19 Apr 2018 12:21:46 -0500 Subject: [PATCH 194/231] Convert HDF5 read_attribute_string/logical to C++ --- src/hdf5_interface.F90 | 147 ++++++++++++++--------------------------- src/hdf5_interface.cpp | 27 ++++++++ src/hdf5_interface.h | 3 + 3 files changed, 81 insertions(+), 96 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 1cf2522598..6f4eabad88 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -100,6 +100,13 @@ module hdf5_interface public :: get_name interface + function attribute_typesize(obj_id, name) result(sz) bind(C) + import HID_T, C_CHAR, SIZE_T + integer(HID_T), value :: obj_id + character(kind=C_CHAR), intent(in) :: name(*) + integer(SIZE_T) :: sz + end function attribute_typesize + function dataset_typesize(dset) result(sz) bind(C) import HID_T, SIZE_T integer(HID_T), value :: dset @@ -149,6 +156,15 @@ module hdf5_interface real(C_DOUBLE), intent(out) :: buffer(*) end subroutine read_attr_double_c + subroutine read_attr_string_c(obj_id, name, slen, buffer) & + bind(C, name='read_attr_string') + import HID_T, C_CHAR, C_SIZE_T + integer(HID_T), value :: obj_id + character(kind=C_CHAR), intent(in) :: name(*) + integer(C_SIZE_T), value :: slen + character(kind=C_CHAR), intent(out) :: buffer(*) + end subroutine read_attr_string_c + subroutine read_int_c(obj_id, name, buffer, indep) & bind(C, name='read_int') import HID_T, C_INT, C_BOOL, C_PTR @@ -1290,44 +1306,22 @@ contains integer(HID_T), intent(in) :: obj_id character(*), intent(in) :: name ! name for data - integer :: hdf5_err - integer(HID_T) :: attr_id ! data set handle - integer(HID_T) :: filetype - integer(HID_T) :: memtype - integer(SIZE_T) :: i - integer(SIZE_T) :: size - character(kind=C_CHAR), allocatable, target :: temp_buffer(:) - type(c_ptr) :: f_ptr + integer(C_SIZE_T) :: i, n + character(kind=C_CHAR), allocatable, target :: buffer_(:) - ! Get dataset and dataspace - call h5aopen_f(obj_id, trim(name), attr_id, hdf5_err) + ! Allocate a C char array to get string + n = attribute_typesize(obj_id, to_c_string(name)) + allocate(buffer_(n)) - ! Make sure buffer is large enough - call h5aget_type_f(attr_id, filetype, hdf5_err) - call h5tget_size_f(filetype, size, hdf5_err) - allocate(temp_buffer(size)) - if (size > len(buffer)) then - call fatal_error("Character buffer is not long enough to & - &read HDF5 string.") - end if + ! Read attribute + call read_attr_string_c(obj_id, to_c_string(name), n, buffer_) - ! Get datatype in memory based on Fortran character - call h5tcopy_f(H5T_C_S1, memtype, hdf5_err) - call h5tset_size_f(memtype, size + 1, hdf5_err) - - ! Get pointer to start of string - f_ptr = c_loc(temp_buffer(1)) - - call h5aread_f(attr_id, memtype, f_ptr, hdf5_err) + ! Copy back to Fortran string buffer = '' - do i = 1, size - if (temp_buffer(i) == C_NULL_CHAR) cycle - buffer(i:i) = temp_buffer(i) + do i = 1, n + if (buffer_(i) == C_NULL_CHAR) cycle + buffer(i:i) = buffer_(i) end do - - call h5aclose_f(attr_id, hdf5_err) - call h5tclose_f(filetype, hdf5_err) - call h5tclose_f(memtype, hdf5_err) end subroutine read_attribute_string subroutine read_attribute_string_1D(buffer, obj_id, name) @@ -1335,82 +1329,43 @@ contains integer(HID_T), intent(in) :: obj_id character(*), intent(in) :: name - integer :: hdf5_err - integer(HID_T) :: space_id - integer(HID_T) :: attr_id + integer(C_SIZE_T) :: i, j, k, n, m integer(HSIZE_T) :: dims(1) - integer(HSIZE_T) :: maxdims(1) + character(kind=C_CHAR), allocatable, target :: buffer_(:) - call h5aopen_f(obj_id, trim(name), attr_id, hdf5_err) - - if (allocated(buffer)) then - dims(:) = shape(buffer) - else - call h5aget_space_f(attr_id, space_id, hdf5_err) - call h5sget_simple_extent_dims_f(space_id, dims, maxdims, hdf5_err) + if (.not. allocated(buffer)) then + call get_shape_attr(obj_id, to_c_string(name), dims) allocate(buffer(dims(1))) - call h5sclose_f(space_id, hdf5_err) end if - call read_attribute_string_1D_explicit(attr_id, dims, buffer) - call h5aclose_f(attr_id, hdf5_err) + ! Allocate a C char array to get strings + n = attribute_typesize(obj_id, to_c_string(name)) + m = size(buffer) + allocate(buffer_(n*m)) + + ! Read attribute + call read_attr_string_c(obj_id, to_c_string(name), n, buffer_) + + ! Convert null-terminated C strings into Fortran strings + do i = 1, m + buffer(i) = '' + do j = 1, n + k = (i-1)*n + j + if (buffer_(k) == C_NULL_CHAR) exit + buffer(i)(j:j) = buffer_(k) + end do + end do end subroutine read_attribute_string_1D - subroutine read_attribute_string_1D_explicit(attr_id, dims, buffer) - integer(HID_T), intent(in) :: attr_id - integer(HSIZE_T), intent(in) :: dims(1) - character(*), target, intent(inout) :: buffer(dims(1)) - - integer :: hdf5_err - integer(HID_T) :: filetype - integer(HID_T) :: memtype - integer(SIZE_T) :: size - integer(SIZE_T) :: n - type(c_ptr) :: f_ptr - - ! Make sure buffer is large enough - call h5aget_type_f(attr_id, filetype, hdf5_err) - call h5tget_size_f(filetype, size, hdf5_err) - if (size > len(buffer(1)) + 1) then - call fatal_error("Character buffer is not long enough to & - &read HDF5 string array.") - end if - - ! Get datatype in memory based on Fortran character - n = len(buffer(1)) - call h5tcopy_f(H5T_FORTRAN_S1, memtype, hdf5_err) - call h5tset_size_f(memtype, n, hdf5_err) - - ! Get pointer to start of string - f_ptr = c_loc(buffer(1)(1:1)) - - call h5aread_f(attr_id, memtype, f_ptr, hdf5_err) - - call h5tclose_f(filetype, hdf5_err) - call h5tclose_f(memtype, hdf5_err) - end subroutine read_attribute_string_1D_explicit - subroutine read_attribute_logical(buffer, obj_id, name) logical, intent(inout), target :: buffer integer(HID_T), intent(in) :: obj_id character(*), intent(in) :: name - integer, target :: int_buffer - integer :: hdf5_err - integer(HID_T) :: attr_id - type(c_ptr) :: f_ptr + integer :: tmp - call h5aopen_f(obj_id, trim(name), attr_id, hdf5_err) - f_ptr = c_loc(int_buffer) - call h5aread_f(attr_id, H5T_NATIVE_INTEGER, f_ptr, hdf5_err) - call h5aclose_f(attr_id, hdf5_err) - - ! Convert to Fortran logical - if (int_buffer == 0) then - buffer = .false. - else - buffer = .true. - end if + call read_attribute_integer(tmp, obj_id, name) + buffer = (tmp /= 0) end subroutine read_attribute_logical subroutine get_shape(obj_id, dims) diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index aa44e7c972..935ef084ad 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -19,6 +19,18 @@ attribute_exists(hid_t obj_id, const char* name) } +size_t +attribute_typesize(hid_t obj_id, const char* name) +{ + hid_t attr = H5Aopen(obj_id, name, H5P_DEFAULT); + hid_t filetype = H5Aget_type(attr); + size_t n = H5Tget_size(filetype); + H5Tclose(filetype); + H5Aclose(attr); + return n; +} + + bool using_mpio_device(hid_t obj_id) { @@ -238,6 +250,21 @@ read_attr_int(hid_t obj_id, const char* name, int* buffer) } +void +read_attr_string(hid_t obj_id, const char* name, size_t slen, char* buffer) +{ + // Create datatype for a string + hid_t datatype = H5Tcopy(H5T_C_S1); + H5Tset_size(datatype, slen + 1); + + // Read data into buffer + read_attr(obj_id, name, datatype, buffer); + + // Free resources + H5Tclose(datatype); +} + + void read_dataset(hid_t obj_id, const char* name, hid_t mem_type_id, void* buffer, bool indep) diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index 2e470dbc7d..9ea170c6cc 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -13,6 +13,7 @@ namespace openmc { extern "C" bool attribute_exists(hid_t obj_id, const char* name); +extern "C" size_t attribute_typesize(hid_t obj_id, const char* name); extern "C" hid_t create_group(hid_t parent_id, const char* name); hid_t create_group(hid_t parent_id, const std::string& name); extern "C" void close_dataset(hid_t dataset_id); @@ -51,6 +52,8 @@ void read_attr(hid_t obj_id, const char* name, hid_t mem_type_id, const void* buffer); extern "C" void read_attr_double(hid_t obj_id, const char* name, double* buffer); extern "C" void read_attr_int(hid_t obj_id, const char* name, int* buffer); +extern "C" void read_attr_string(hid_t obj_id, const char* name, size_t slen, + char* buffer); void read_dataset(hid_t obj_id, const char* name, hid_t mem_type_id, void* buffer, bool indep); From cfea8aa32471c00ca629d35fa65cbd7c6a38fce5 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 19 Apr 2018 12:26:32 -0500 Subject: [PATCH 195/231] Remove using_mpio_device on Fortran side --- src/hdf5_interface.F90 | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 6f4eabad88..77628d742b 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -1396,34 +1396,6 @@ contains ndims = dataset_ndims(obj_id) end subroutine get_ndims - function using_mpio_device(obj_id) result(mpio) - integer(HID_T), intent(in) :: obj_id - logical :: mpio - - integer :: hdf5_err - integer(HID_T) :: driver - integer(HID_T) :: file_id - integer(HID_T) :: fapl_id - - ! Determine file that this object is part of - call h5iget_file_id_f(obj_id, file_id, hdf5_err) - - ! Get file access property list - call h5fget_access_plist_f(file_id, fapl_id, hdf5_err) - - ! Get low-level driver identifier - call h5pget_driver_f(fapl_id, driver, hdf5_err) - - ! Close file access property list access - call h5pclose_f(fapl_id, hdf5_err) - - ! Close file access -- note that this only decreases the reference count so - ! that the file is not actually closed - call h5fclose_f(file_id, hdf5_err) - - mpio = (driver == H5FD_MPIO_F) - end function using_mpio_device - !=============================================================================== ! READ_COMPLEX_2D reads double precision complex 2-D array data as output by ! the h5py HDF5 python module. From 012c8c9232fe3a53588aee0c0f3f9591f314a726 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 19 Apr 2018 12:35:14 -0500 Subject: [PATCH 196/231] Use C_SIZE_T consistently --- src/hdf5_interface.F90 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 77628d742b..da6ebd09d3 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -101,16 +101,16 @@ module hdf5_interface interface function attribute_typesize(obj_id, name) result(sz) bind(C) - import HID_T, C_CHAR, SIZE_T + import HID_T, C_CHAR, C_SIZE_T integer(HID_T), value :: obj_id character(kind=C_CHAR), intent(in) :: name(*) - integer(SIZE_T) :: sz + integer(C_SIZE_T) :: sz end function attribute_typesize function dataset_typesize(dset) result(sz) bind(C) - import HID_T, SIZE_T + import HID_T, C_SIZE_T integer(HID_T), value :: dset - integer(SIZE_T) :: sz + integer(C_SIZE_T) :: sz end function dataset_typesize subroutine file_close(file_id) bind(C) @@ -1058,7 +1058,7 @@ contains logical, optional, intent(in) :: indep ! independent I/O integer(HID_T) :: dset_id - integer(SIZE_T) :: i, n + integer(C_SIZE_T) :: i, n logical(C_BOOL) :: indep_ character(kind=C_CHAR), allocatable, target :: buffer_(:) @@ -1128,7 +1128,7 @@ contains logical, optional, intent(in) :: indep ! independent I/O integer(HID_T) :: dset_id - integer(SIZE_T) :: i, j, k, n, m + integer(C_SIZE_T) :: i, j, k, n, m logical(C_BOOL) :: indep_ character(kind=C_CHAR), allocatable, target :: buffer_(:) From f78e6e0fc3bd4e4c61f4b0a8b9b4d28220357c7c Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 19 Apr 2018 13:00:02 -0500 Subject: [PATCH 197/231] Make HDF5 kind type parameters available from hdf5_interface --- src/angle_distribution.F90 | 4 +--- src/angleenergy_header.F90 | 2 +- src/endf_header.F90 | 2 -- src/energy_distribution.F90 | 2 -- src/hdf5_interface.F90 | 1 + src/mesh_header.F90 | 2 -- src/mgxs_header.F90 | 2 -- src/multipole_header.F90 | 2 -- src/nuclide_header.F90 | 2 -- src/particle_header.F90 | 2 -- src/particle_restart.F90 | 4 +--- src/product_header.F90 | 4 +--- src/reaction_header.F90 | 6 +----- src/sab_header.F90 | 5 +---- src/secondary_correlated.F90 | 5 +---- src/secondary_kalbach.F90 | 5 +---- src/secondary_nbody.F90 | 4 +--- src/secondary_uncorrelated.F90 | 4 +--- src/source.F90 | 3 +-- src/summary.F90 | 2 -- src/surface_header.F90 | 5 ++--- src/tallies/tally_filter.F90 | 2 -- src/tallies/tally_filter_azimuthal.F90 | 2 -- src/tallies/tally_filter_cell.F90 | 2 -- src/tallies/tally_filter_cellborn.F90 | 2 -- src/tallies/tally_filter_cellfrom.F90 | 2 -- src/tallies/tally_filter_delayedgroup.F90 | 2 -- src/tallies/tally_filter_distribcell.F90 | 2 -- src/tallies/tally_filter_energy.F90 | 2 -- src/tallies/tally_filter_energyfunc.F90 | 2 -- src/tallies/tally_filter_header.F90 | 3 +-- src/tallies/tally_filter_legendre.F90 | 2 -- src/tallies/tally_filter_material.F90 | 2 -- src/tallies/tally_filter_mesh.F90 | 2 -- src/tallies/tally_filter_meshsurface.F90 | 2 -- src/tallies/tally_filter_mu.F90 | 2 -- src/tallies/tally_filter_polar.F90 | 2 -- src/tallies/tally_filter_sph_harm.F90 | 2 -- src/tallies/tally_filter_sptl_legendre.F90 | 2 -- src/tallies/tally_filter_surface.F90 | 2 -- src/tallies/tally_filter_universe.F90 | 2 -- src/tallies/tally_filter_zernike.F90 | 2 -- src/track_output.F90 | 2 -- src/urr_header.F90 | 3 +-- src/volume_calc.F90 | 3 +-- 45 files changed, 17 insertions(+), 102 deletions(-) diff --git a/src/angle_distribution.F90 b/src/angle_distribution.F90 index 5d16f74242..a1f20e7799 100644 --- a/src/angle_distribution.F90 +++ b/src/angle_distribution.F90 @@ -1,12 +1,10 @@ module angle_distribution - use hdf5, only: HID_T, HSIZE_T - use algorithm, only: binary_search use constants, only: ZERO, ONE, HISTOGRAM, LINEAR_LINEAR use distribution_univariate, only: DistributionContainer, Tabular use hdf5_interface, only: read_attribute, get_shape, read_dataset, & - open_dataset, close_dataset + open_dataset, close_dataset, HID_T, HSIZE_T use random_lcg, only: prn implicit none diff --git a/src/angleenergy_header.F90 b/src/angleenergy_header.F90 index 60d5443c46..9fda5109ec 100644 --- a/src/angleenergy_header.F90 +++ b/src/angleenergy_header.F90 @@ -1,6 +1,6 @@ module angleenergy_header - use hdf5, only: HID_T + use hdf5_interface, only: HID_T !=============================================================================== ! ANGLEENERGY (abstract) defines a correlated or uncorrelated angle-energy diff --git a/src/endf_header.F90 b/src/endf_header.F90 index e9e45ab751..9443efe2be 100644 --- a/src/endf_header.F90 +++ b/src/endf_header.F90 @@ -1,7 +1,5 @@ module endf_header - use hdf5, only: HID_T, HSIZE_T - use algorithm, only: binary_search use constants, only: ZERO, HISTOGRAM, LINEAR_LINEAR, LINEAR_LOG, & LOG_LINEAR, LOG_LOG diff --git a/src/energy_distribution.F90 b/src/energy_distribution.F90 index 770da617cc..a9578e5d88 100644 --- a/src/energy_distribution.F90 +++ b/src/energy_distribution.F90 @@ -1,7 +1,5 @@ module energy_distribution - use hdf5 - use algorithm, only: binary_search use constants, only: ZERO, ONE, HALF, TWO, PI, HISTOGRAM, LINEAR_LINEAR use endf_header, only: Tabulated1D diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index da6ebd09d3..5320ec9f53 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -98,6 +98,7 @@ module hdf5_interface public :: get_groups public :: get_datasets public :: get_name + public :: HID_T, HSIZE_T, SIZE_T interface function attribute_typesize(obj_id, name) result(sz) bind(C) diff --git a/src/mesh_header.F90 b/src/mesh_header.F90 index fc13a868e5..fb22d2ad31 100644 --- a/src/mesh_header.F90 +++ b/src/mesh_header.F90 @@ -2,8 +2,6 @@ module mesh_header use, intrinsic :: ISO_C_BINDING - use hdf5 - use constants use dict_header, only: DictIntInt use error diff --git a/src/mgxs_header.F90 b/src/mgxs_header.F90 index 6eabefae3c..e599a89ff3 100644 --- a/src/mgxs_header.F90 +++ b/src/mgxs_header.F90 @@ -3,8 +3,6 @@ module mgxs_header use, intrinsic :: ISO_FORTRAN_ENV use, intrinsic :: ISO_C_BINDING - use hdf5, only: HID_T, HSIZE_T, SIZE_T - use algorithm, only: find, sort use constants, only: MAX_WORD_LEN, ZERO, ONE, TWO, PI use error, only: fatal_error diff --git a/src/multipole_header.F90 b/src/multipole_header.F90 index 7fb438bce1..f2d0c91062 100644 --- a/src/multipole_header.F90 +++ b/src/multipole_header.F90 @@ -1,7 +1,5 @@ module multipole_header - use hdf5 - use constants use dict_header, only: DictIntInt use error, only: fatal_error diff --git a/src/nuclide_header.F90 b/src/nuclide_header.F90 index 76fc26a748..a063bb90b4 100644 --- a/src/nuclide_header.F90 +++ b/src/nuclide_header.F90 @@ -3,8 +3,6 @@ module nuclide_header use, intrinsic :: ISO_FORTRAN_ENV use, intrinsic :: ISO_C_BINDING - use hdf5, only: HID_T, HSIZE_T, SIZE_T - use algorithm, only: sort, find, binary_search use constants use dict_header, only: DictIntInt, DictCharInt diff --git a/src/particle_header.F90 b/src/particle_header.F90 index 02fb55405a..cdb97dec8d 100644 --- a/src/particle_header.F90 +++ b/src/particle_header.F90 @@ -1,7 +1,5 @@ module particle_header - use hdf5, only: HID_T - use bank_header, only: Bank, source_bank use constants use error, only: fatal_error, warning diff --git a/src/particle_restart.F90 b/src/particle_restart.F90 index fc8a05277c..c3d25151b6 100644 --- a/src/particle_restart.F90 +++ b/src/particle_restart.F90 @@ -5,7 +5,7 @@ module particle_restart use bank_header, only: Bank use constants use error, only: write_message - use hdf5_interface, only: file_open, file_close, read_dataset + use hdf5_interface, only: file_open, file_close, read_dataset, HID_T use mgxs_header, only: energy_bin_avg use nuclide_header, only: micro_xs, n_nuclides use output, only: print_particle @@ -16,8 +16,6 @@ module particle_restart use tally_header, only: n_tallies use tracking, only: transport - use hdf5, only: HID_T - implicit none private public :: openmc_particle_restart diff --git a/src/product_header.F90 b/src/product_header.F90 index a69929473d..a5e23f4b6c 100644 --- a/src/product_header.F90 +++ b/src/product_header.F90 @@ -1,13 +1,11 @@ module product_header - use hdf5, only: HID_T - use angleenergy_header, only: AngleEnergyContainer use constants, only: ZERO, MAX_WORD_LEN, EMISSION_PROMPT, EMISSION_DELAYED, & EMISSION_TOTAL, NEUTRON, PHOTON use endf_header, only: Tabulated1D, Function1D, Polynomial use hdf5_interface, only: read_attribute, open_group, close_group, & - open_dataset, close_dataset, read_dataset + open_dataset, close_dataset, read_dataset, HID_T use random_lcg, only: prn use secondary_correlated, only: CorrelatedAngleEnergy use secondary_kalbach, only: KalbachMann diff --git a/src/reaction_header.F90 b/src/reaction_header.F90 index 12b3888c4b..48973336bf 100644 --- a/src/reaction_header.F90 +++ b/src/reaction_header.F90 @@ -1,11 +1,7 @@ module reaction_header - use hdf5, only: HID_T, HSIZE_T, SIZE_T, h5gget_info_f, h5lget_name_by_idx_f, & - H5_INDEX_NAME_F, H5_ITER_INC_F - use constants, only: MAX_WORD_LEN - use hdf5_interface, only: read_attribute, open_group, close_group, & - open_dataset, read_dataset, close_dataset, get_shape, get_groups + use hdf5_interface use product_header, only: ReactionProduct use stl_vector, only: VectorInt use string, only: to_str, starts_with diff --git a/src/sab_header.F90 b/src/sab_header.F90 index eca8e555a1..7ac14ef00e 100644 --- a/src/sab_header.F90 +++ b/src/sab_header.F90 @@ -8,10 +8,7 @@ module sab_header use dict_header, only: DictIntInt, DictCharInt use distribution_univariate, only: Tabular use error, only: warning, fatal_error - use hdf5, only: HID_T, HSIZE_T, SIZE_T - use hdf5_interface, only: read_attribute, get_shape, open_group, close_group, & - open_dataset, read_dataset, close_dataset, get_datasets, object_exists, & - get_name + use hdf5_interface use random_lcg, only: prn use secondary_correlated, only: CorrelatedAngleEnergy use settings diff --git a/src/secondary_correlated.F90 b/src/secondary_correlated.F90 index a0e203f33d..6f5e6cabf7 100644 --- a/src/secondary_correlated.F90 +++ b/src/secondary_correlated.F90 @@ -1,13 +1,10 @@ module secondary_correlated - use hdf5, only: HID_T, HSIZE_T - use algorithm, only: binary_search use angleenergy_header, only: AngleEnergy use constants, only: ZERO, ONE, HALF, TWO, HISTOGRAM, LINEAR_LINEAR use distribution_univariate, only: DistributionContainer, Tabular - use hdf5_interface, only: get_shape, read_attribute, open_dataset, & - read_dataset, close_dataset + use hdf5_interface use random_lcg, only: prn !=============================================================================== diff --git a/src/secondary_kalbach.F90 b/src/secondary_kalbach.F90 index f963cff3ff..3315174e1d 100644 --- a/src/secondary_kalbach.F90 +++ b/src/secondary_kalbach.F90 @@ -1,12 +1,9 @@ module secondary_kalbach - use hdf5, only: HID_T, HSIZE_T - use algorithm, only: binary_search use angleenergy_header, only: AngleEnergy use constants, only: ZERO, HALF, ONE, TWO, HISTOGRAM, LINEAR_LINEAR - use hdf5_interface, only: read_attribute, read_dataset, open_dataset, & - close_dataset, get_shape + use hdf5_interface use random_lcg, only: prn !=============================================================================== diff --git a/src/secondary_nbody.F90 b/src/secondary_nbody.F90 index 14ae949a9e..aee4b1ff78 100644 --- a/src/secondary_nbody.F90 +++ b/src/secondary_nbody.F90 @@ -1,10 +1,8 @@ module secondary_nbody - use hdf5, only: HID_T - use angleenergy_header, only: AngleEnergy use constants, only: ONE, TWO, PI - use hdf5_interface, only: read_attribute + use hdf5_interface, only: read_attribute, HID_T use math, only: maxwell_spectrum use random_lcg, only: prn diff --git a/src/secondary_uncorrelated.F90 b/src/secondary_uncorrelated.F90 index 40aa827da6..e559c1e5ae 100644 --- a/src/secondary_uncorrelated.F90 +++ b/src/secondary_uncorrelated.F90 @@ -1,7 +1,5 @@ module secondary_uncorrelated - use hdf5, only: HID_T - use angle_distribution, only: AngleDistribution use angleenergy_header, only: AngleEnergy use constants, only: ONE, TWO, MAX_WORD_LEN @@ -9,7 +7,7 @@ module secondary_uncorrelated ContinuousTabular, MaxwellEnergy, Evaporation, WattEnergy, DiscretePhoton use error, only: warning use hdf5_interface, only: read_attribute, open_group, close_group, & - object_exists + object_exists, HID_T use random_lcg, only: prn !=============================================================================== diff --git a/src/source.F90 b/src/source.F90 index 9e3a0831de..8e142fcfaa 100644 --- a/src/source.F90 +++ b/src/source.F90 @@ -1,6 +1,5 @@ module source - use hdf5, only: HID_T #ifdef OPENMC_MPI use message_passing #endif @@ -12,7 +11,7 @@ module source use distribution_multivariate, only: SpatialBox use error, only: fatal_error use geometry, only: find_cell - use hdf5_interface, only: file_open, file_close, read_dataset + use hdf5_interface, only: file_open, file_close, read_dataset, HID_T use math use message_passing, only: rank use mgxs_header, only: rev_energy_bins, num_energy_groups diff --git a/src/summary.F90 b/src/summary.F90 index 9f27694d1b..6f8333b2cf 100644 --- a/src/summary.F90 +++ b/src/summary.F90 @@ -1,7 +1,5 @@ module summary - use hdf5 - use constants use endf, only: reaction_name use error, only: write_message diff --git a/src/surface_header.F90 b/src/surface_header.F90 index 9ed89a14e9..ab6babb5cb 100644 --- a/src/surface_header.F90 +++ b/src/surface_header.F90 @@ -1,9 +1,9 @@ module surface_header use, intrinsic :: ISO_C_BINDING - use hdf5 use dict_header, only: DictIntInt + use hdf5_interface implicit none @@ -71,8 +71,7 @@ module surface_header subroutine surface_to_hdf5_c(surf_ptr, group) & bind(C, name='surface_to_hdf5') - use ISO_C_BINDING - use hdf5 + import C_PTR, HID_T implicit none type(C_PTR), intent(in), value :: surf_ptr integer(HID_T), intent(in), value :: group diff --git a/src/tallies/tally_filter.F90 b/src/tallies/tally_filter.F90 index e484ac2315..4b589cedbf 100644 --- a/src/tallies/tally_filter.F90 +++ b/src/tallies/tally_filter.F90 @@ -2,8 +2,6 @@ module tally_filter use, intrinsic :: ISO_C_BINDING - use hdf5, only: HID_T - use error use string, only: to_f_string use tally_filter_header diff --git a/src/tallies/tally_filter_azimuthal.F90 b/src/tallies/tally_filter_azimuthal.F90 index 272d111d14..fc7f15a17a 100644 --- a/src/tallies/tally_filter_azimuthal.F90 +++ b/src/tallies/tally_filter_azimuthal.F90 @@ -2,8 +2,6 @@ module tally_filter_azimuthal use, intrinsic :: ISO_C_BINDING - use hdf5 - use algorithm, only: binary_search use constants use error, only: fatal_error diff --git a/src/tallies/tally_filter_cell.F90 b/src/tallies/tally_filter_cell.F90 index 8d2b93d282..00ab8fa15b 100644 --- a/src/tallies/tally_filter_cell.F90 +++ b/src/tallies/tally_filter_cell.F90 @@ -2,8 +2,6 @@ module tally_filter_cell use, intrinsic :: ISO_C_BINDING - use hdf5 - use constants, only: ONE, MAX_LINE_LEN use dict_header, only: EMPTY use error, only: fatal_error diff --git a/src/tallies/tally_filter_cellborn.F90 b/src/tallies/tally_filter_cellborn.F90 index 450858b6b8..0d7461ef82 100644 --- a/src/tallies/tally_filter_cellborn.F90 +++ b/src/tallies/tally_filter_cellborn.F90 @@ -2,8 +2,6 @@ module tally_filter_cellborn use, intrinsic :: ISO_C_BINDING - use hdf5 - use constants, only: ONE, MAX_LINE_LEN use dict_header, only: EMPTY use error, only: fatal_error diff --git a/src/tallies/tally_filter_cellfrom.F90 b/src/tallies/tally_filter_cellfrom.F90 index 16cb294d56..2c54021226 100644 --- a/src/tallies/tally_filter_cellfrom.F90 +++ b/src/tallies/tally_filter_cellfrom.F90 @@ -2,8 +2,6 @@ module tally_filter_cellfrom use, intrinsic :: ISO_C_BINDING - use hdf5 - use constants, only: ONE, MAX_LINE_LEN use dict_header, only: EMPTY use error, only: fatal_error diff --git a/src/tallies/tally_filter_delayedgroup.F90 b/src/tallies/tally_filter_delayedgroup.F90 index 32010e8157..1a662005bc 100644 --- a/src/tallies/tally_filter_delayedgroup.F90 +++ b/src/tallies/tally_filter_delayedgroup.F90 @@ -2,8 +2,6 @@ module tally_filter_delayedgroup use, intrinsic :: ISO_C_BINDING - use hdf5 - use constants, only: ONE, MAX_LINE_LEN, MAX_DELAYED_GROUPS use error, only: fatal_error use hdf5_interface diff --git a/src/tallies/tally_filter_distribcell.F90 b/src/tallies/tally_filter_distribcell.F90 index 3cb34efe4c..6c42161ca7 100644 --- a/src/tallies/tally_filter_distribcell.F90 +++ b/src/tallies/tally_filter_distribcell.F90 @@ -2,8 +2,6 @@ module tally_filter_distribcell use, intrinsic :: ISO_C_BINDING - use hdf5, only: HID_T - use constants use dict_header, only: EMPTY use error diff --git a/src/tallies/tally_filter_energy.F90 b/src/tallies/tally_filter_energy.F90 index d186fa62a8..93da69edda 100644 --- a/src/tallies/tally_filter_energy.F90 +++ b/src/tallies/tally_filter_energy.F90 @@ -2,8 +2,6 @@ module tally_filter_energy use, intrinsic :: ISO_C_BINDING - use hdf5, only: HID_T - use algorithm, only: binary_search use constants use error diff --git a/src/tallies/tally_filter_energyfunc.F90 b/src/tallies/tally_filter_energyfunc.F90 index efaabae2ee..1402707b4d 100644 --- a/src/tallies/tally_filter_energyfunc.F90 +++ b/src/tallies/tally_filter_energyfunc.F90 @@ -2,8 +2,6 @@ module tally_filter_energyfunc use, intrinsic :: ISO_C_BINDING - use hdf5 - use algorithm, only: binary_search use constants use error, only: fatal_error diff --git a/src/tallies/tally_filter_header.F90 b/src/tallies/tally_filter_header.F90 index 93d050b1af..e57423ddfa 100644 --- a/src/tallies/tally_filter_header.F90 +++ b/src/tallies/tally_filter_header.F90 @@ -5,13 +5,12 @@ module tally_filter_header use constants, only: MAX_LINE_LEN use dict_header, only: DictIntInt use error + use hdf5_interface, only: HID_T use particle_header, only: Particle use stl_vector, only: VectorInt, VectorReal use string, only: to_str use xml_interface, only: XMLNode - use hdf5 - implicit none private public :: free_memory_tally_filter diff --git a/src/tallies/tally_filter_legendre.F90 b/src/tallies/tally_filter_legendre.F90 index 9545b86926..b4ee7b06b1 100644 --- a/src/tallies/tally_filter_legendre.F90 +++ b/src/tallies/tally_filter_legendre.F90 @@ -2,8 +2,6 @@ module tally_filter_legendre use, intrinsic :: ISO_C_BINDING - use hdf5, only: HID_T - use constants use error use hdf5_interface diff --git a/src/tallies/tally_filter_material.F90 b/src/tallies/tally_filter_material.F90 index 3b9f843f84..443dc62855 100644 --- a/src/tallies/tally_filter_material.F90 +++ b/src/tallies/tally_filter_material.F90 @@ -2,8 +2,6 @@ module tally_filter_material use, intrinsic :: ISO_C_BINDING - use hdf5, only: HID_T - use constants use dict_header, only: DictIntInt, EMPTY use error diff --git a/src/tallies/tally_filter_mesh.F90 b/src/tallies/tally_filter_mesh.F90 index d2acdc4c8a..486569da63 100644 --- a/src/tallies/tally_filter_mesh.F90 +++ b/src/tallies/tally_filter_mesh.F90 @@ -2,8 +2,6 @@ module tally_filter_mesh use, intrinsic :: ISO_C_BINDING - use hdf5 - use constants use dict_header, only: EMPTY use error diff --git a/src/tallies/tally_filter_meshsurface.F90 b/src/tallies/tally_filter_meshsurface.F90 index d90b63664e..801d4252ca 100644 --- a/src/tallies/tally_filter_meshsurface.F90 +++ b/src/tallies/tally_filter_meshsurface.F90 @@ -2,8 +2,6 @@ module tally_filter_meshsurface use, intrinsic :: ISO_C_BINDING - use hdf5 - use constants use dict_header, only: EMPTY use error diff --git a/src/tallies/tally_filter_mu.F90 b/src/tallies/tally_filter_mu.F90 index c949289b66..7f8bde9238 100644 --- a/src/tallies/tally_filter_mu.F90 +++ b/src/tallies/tally_filter_mu.F90 @@ -2,8 +2,6 @@ module tally_filter_mu use, intrinsic :: ISO_C_BINDING - use hdf5 - use algorithm, only: binary_search use constants, only: ONE, TWO, MAX_LINE_LEN, NO_BIN_FOUND use error, only: fatal_error diff --git a/src/tallies/tally_filter_polar.F90 b/src/tallies/tally_filter_polar.F90 index 89815c1028..7cbb55f8b4 100644 --- a/src/tallies/tally_filter_polar.F90 +++ b/src/tallies/tally_filter_polar.F90 @@ -2,8 +2,6 @@ module tally_filter_polar use, intrinsic :: ISO_C_BINDING - use hdf5 - use algorithm, only: binary_search use constants use error, only: fatal_error diff --git a/src/tallies/tally_filter_sph_harm.F90 b/src/tallies/tally_filter_sph_harm.F90 index 5c47c2c71f..bc95baaa3c 100644 --- a/src/tallies/tally_filter_sph_harm.F90 +++ b/src/tallies/tally_filter_sph_harm.F90 @@ -2,8 +2,6 @@ module tally_filter_sph_harm use, intrinsic :: ISO_C_BINDING - use hdf5, only: HID_T - use constants use error use hdf5_interface diff --git a/src/tallies/tally_filter_sptl_legendre.F90 b/src/tallies/tally_filter_sptl_legendre.F90 index d6594d05a9..83db9a864e 100644 --- a/src/tallies/tally_filter_sptl_legendre.F90 +++ b/src/tallies/tally_filter_sptl_legendre.F90 @@ -2,8 +2,6 @@ module tally_filter_sptl_legendre use, intrinsic :: ISO_C_BINDING - use hdf5, only: HID_T - use constants use error use hdf5_interface diff --git a/src/tallies/tally_filter_surface.F90 b/src/tallies/tally_filter_surface.F90 index df3bf36031..ec642bc8de 100644 --- a/src/tallies/tally_filter_surface.F90 +++ b/src/tallies/tally_filter_surface.F90 @@ -2,8 +2,6 @@ module tally_filter_surface use, intrinsic :: ISO_C_BINDING - use hdf5 - use constants, only: ONE, MAX_LINE_LEN use dict_header, only: EMPTY use error, only: fatal_error diff --git a/src/tallies/tally_filter_universe.F90 b/src/tallies/tally_filter_universe.F90 index 742152232d..0dc5aefe14 100644 --- a/src/tallies/tally_filter_universe.F90 +++ b/src/tallies/tally_filter_universe.F90 @@ -2,8 +2,6 @@ module tally_filter_universe use, intrinsic :: ISO_C_BINDING - use hdf5 - use constants, only: ONE, MAX_LINE_LEN use dict_header, only: EMPTY use error, only: fatal_error diff --git a/src/tallies/tally_filter_zernike.F90 b/src/tallies/tally_filter_zernike.F90 index e96a53a7f9..fa205b1808 100644 --- a/src/tallies/tally_filter_zernike.F90 +++ b/src/tallies/tally_filter_zernike.F90 @@ -2,8 +2,6 @@ module tally_filter_zernike use, intrinsic :: ISO_C_BINDING - use hdf5, only: HID_T - use constants use error use hdf5_interface diff --git a/src/track_output.F90 b/src/track_output.F90 index 350e687b1c..95af9e6b0f 100644 --- a/src/track_output.F90 +++ b/src/track_output.F90 @@ -5,8 +5,6 @@ module track_output - use hdf5 - use constants use hdf5_interface use particle_header, only: Particle diff --git a/src/urr_header.F90 b/src/urr_header.F90 index cc41d43ccc..0ec9e89deb 100644 --- a/src/urr_header.F90 +++ b/src/urr_header.F90 @@ -1,8 +1,7 @@ module urr_header - use hdf5, only: HID_T, HSIZE_T use hdf5_interface, only: read_attribute, open_dataset, read_dataset, & - close_dataset, get_shape + close_dataset, get_shape, HID_T, HSIZE_T implicit none diff --git a/src/volume_calc.F90 b/src/volume_calc.F90 index ac813a94af..fa770c1f37 100644 --- a/src/volume_calc.F90 +++ b/src/volume_calc.F90 @@ -2,7 +2,6 @@ module volume_calc use, intrinsic :: ISO_C_BINDING - use hdf5, only: HID_T #ifdef _OPENMP use omp_lib #endif @@ -12,7 +11,7 @@ module volume_calc use geometry, only: find_cell use geometry_header, only: universes, cells use hdf5_interface, only: file_open, file_close, write_attribute, & - create_group, close_group, write_dataset + create_group, close_group, write_dataset, HID_T use output, only: header, time_stamp use material_header, only: materials use message_passing From 4fdfd51ab9bb6ad79aadf64d9f3f5e9f4da70cdb Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 19 Apr 2018 14:44:10 -0500 Subject: [PATCH 198/231] Convert HDF5 read/write_tally_results (and fix attribute bug) --- src/hdf5_interface.F90 | 4 +- src/hdf5_interface.cpp | 47 +++++++++++++++++++- src/hdf5_interface.h | 7 +++ src/tallies/tally_header.F90 | 84 +++++++++++++----------------------- 4 files changed, 84 insertions(+), 58 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 5320ec9f53..752ce062dc 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -1342,7 +1342,7 @@ contains ! Allocate a C char array to get strings n = attribute_typesize(obj_id, to_c_string(name)) m = size(buffer) - allocate(buffer_(n*m)) + allocate(buffer_((n+1)*m)) ! Read attribute call read_attr_string_c(obj_id, to_c_string(name), n, buffer_) @@ -1351,7 +1351,7 @@ contains do i = 1, m buffer(i) = '' do j = 1, n - k = (i-1)*n + j + k = (i-1)*(n+1) + j if (buffer_(k) == C_NULL_CHAR) exit buffer(i)(j:j) = buffer_(k) end do diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index 935ef084ad..ddc2dcdfc1 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -350,6 +350,26 @@ read_complex(hid_t obj_id, const char* name, double _Complex* buffer, bool indep } +void +read_tally_results(hid_t group_id, hsize_t n_filter, hsize_t n_score, double* results) +{ + // Create dataspace for hyperslab in memory + hsize_t dims[] {n_filter, n_score, 3}; + hsize_t start[] {0, 0, 1}; + hsize_t count[] {n_filter, n_score, 2}; + hid_t memspace = H5Screate_simple(3, dims, nullptr); + H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, nullptr, count, nullptr); + + // Create and write dataset + hid_t dset = H5Dopen(group_id, "results", H5P_DEFAULT); + H5Dread(dset, H5T_NATIVE_DOUBLE, memspace, H5S_ALL, H5P_DEFAULT, results); + + // Free resources + H5Dclose(dset); + H5Sclose(memspace); +} + + void write_attr(hid_t obj_id, int ndim, const hsize_t* dims, const char* name, hid_t mem_type_id, const void* buffer) @@ -488,9 +508,34 @@ write_string(hid_t group_id, int ndim, const hsize_t* dims, size_t slen, void -write_string(hid_t group_id, char const* name, const std::string& buffer, bool indep) +write_string(hid_t group_id, const char* name, const std::string& buffer, bool indep) { write_string(group_id, 0, nullptr, buffer.length(), name, buffer.c_str(), indep); } + +void +write_tally_results(hid_t group_id, hsize_t n_filter, hsize_t n_score, const double* results) +{ + // Set dimensions of sum/sum_sq hyperslab to store + hsize_t count[] {n_filter, n_score, 2}; + hid_t dspace = H5Screate_simple(3, count, nullptr); + + // Set dimensions of results array + hsize_t dims[] {n_filter, n_score, 3}; + hsize_t start[] {0, 0, 1}; + hid_t memspace = H5Screate_simple(3, dims, nullptr); + H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, nullptr, count, nullptr); + + // Create and write dataset + hid_t dset = H5Dcreate(group_id, "results", H5T_NATIVE_DOUBLE, dspace, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite(dset, H5T_NATIVE_DOUBLE, memspace, H5S_ALL, H5P_DEFAULT, results); + + // Free resources + H5Dclose(dset); + H5Sclose(memspace); + H5Sclose(dspace); +} + } // namespace openmc diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index 9ea170c6cc..57f56f5c20 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -68,6 +68,9 @@ extern "C" void read_string(hid_t obj_id, const char* name, size_t slen, extern "C" void read_complex(hid_t obj_id, const char* name, double _Complex* buffer, bool indep); +extern "C" void read_tally_results(hid_t group_id, hsize_t n_filter, + hsize_t n_score, double* results); + void write_attr(hid_t obj_id, int ndim, const hsize_t* dims, const char* name, hid_t mem_type_id, const void* buffer); extern "C" void write_attr_double(hid_t obj_id, int ndim, const hsize_t* dims, @@ -90,5 +93,9 @@ extern "C" void write_string(hid_t group_id, int ndim, const hsize_t* dims, size const char* name, char const* buffer, bool indep); void write_string(hid_t group_id, const char* name, const std::string& buffer, bool indep); + +extern "C" void write_tally_results(hid_t group_id, hsize_t n_filter, hsize_t n_score, + const double* results); + } // namespace openmc #endif //HDF5_INTERFACE_H diff --git a/src/tallies/tally_header.F90 b/src/tallies/tally_header.F90 index 413464b7b5..cbfa4f048d 100644 --- a/src/tallies/tally_header.F90 +++ b/src/tallies/tally_header.F90 @@ -2,11 +2,10 @@ module tally_header use, intrinsic :: ISO_C_BINDING - use hdf5 - use constants use error use dict_header, only: DictIntInt + use hdf5_interface, only: HID_T, HSIZE_T use message_passing, only: n_procs use nuclide_header, only: nuclide_dict use settings, only: reduce_tallies, run_mode @@ -200,67 +199,42 @@ contains class(TallyObject), intent(in) :: this integer(HID_T), intent(in) :: group_id - integer :: hdf5_err - integer(HID_T) :: dset, dspace - integer(HID_T) :: memspace - integer(HSIZE_T) :: dims(3) - integer(HSIZE_T) :: dims_slab(3) - integer(HSIZE_T) :: offset(3) = [1,0,0] + integer(HSIZE_T) :: n_filter, n_score + interface + subroutine write_tally_results(group_id, n_filter, n_score, results) & + bind(C) + import HID_T, HSIZE_T, C_DOUBLE + integer(HID_T), value :: group_id + integer(HSIZE_T), value :: n_filter + integer(HSIZE_T), value :: n_score + real(C_DOUBLE), intent(in) :: results(*) + end subroutine write_tally_results + end interface - ! Create file dataspace - dims_slab(:) = shape(this % results) - dims_slab(1) = 2 - call h5screate_simple_f(3, dims_slab, dspace, hdf5_err) - - ! Create memory dataspace that contains only SUM and SUM_SQ values - dims(:) = shape(this % results) - call h5screate_simple_f(3, dims, memspace, hdf5_err) - call h5sselect_hyperslab_f(memspace, H5S_SELECT_SET_F, offset, dims_slab, & - hdf5_err) - - ! Create and write to dataset - call h5dcreate_f(group_id, "results", H5T_NATIVE_DOUBLE, dspace, dset, & - hdf5_err) - call h5dwrite_f(dset, H5T_NATIVE_DOUBLE, this % results, dims_slab, & - hdf5_err, mem_space_id=memspace) - - ! Close identifiers - call h5dclose_f(dset, hdf5_err) - call h5sclose_f(memspace, hdf5_err) - call h5sclose_f(dspace, hdf5_err) + n_filter = size(this % results, 3) + n_score = size(this % results, 2) + call write_tally_results(group_id, n_filter, n_score, this % results) end subroutine tally_write_results_hdf5 subroutine tally_read_results_hdf5(this, group_id) class(TallyObject), intent(inout) :: this integer(HID_T), intent(in) :: group_id - integer :: hdf5_err - integer(HID_T) :: dset, dspace - integer(HID_T) :: memspace - integer(HSIZE_T) :: dims(3) - integer(HSIZE_T) :: dims_slab(3) - integer(HSIZE_T) :: offset(3) = [1,0,0] + integer(HSIZE_T) :: n_filter, n_score + interface + subroutine read_tally_results(group_id, n_filter, n_score, results) & + bind(C) + import HID_T, HSIZE_T, C_DOUBLE + integer(HID_T), value :: group_id + integer(HSIZE_T), value :: n_filter + integer(HSIZE_T), value :: n_score + real(C_DOUBLE), intent(out) :: results(*) + end subroutine read_tally_results + end interface - ! Create file dataspace - dims_slab(:) = shape(this % results) - dims_slab(1) = 2 - call h5screate_simple_f(3, dims_slab, dspace, hdf5_err) - - ! Create memory dataspace that contains only SUM and SUM_SQ values - dims(:) = shape(this % results) - call h5screate_simple_f(3, dims, memspace, hdf5_err) - call h5sselect_hyperslab_f(memspace, H5S_SELECT_SET_F, offset, dims_slab, & - hdf5_err) - - ! Create and write to dataset - call h5dopen_f(group_id, "results", dset, hdf5_err) - call h5dread_f(dset, H5T_NATIVE_DOUBLE, this % results, dims_slab, & - hdf5_err, mem_space_id=memspace) - - ! Close identifiers - call h5dclose_f(dset, hdf5_err) - call h5sclose_f(memspace, hdf5_err) - call h5sclose_f(dspace, hdf5_err) + n_filter = size(this % results, 3) + n_score = size(this % results, 2) + call read_tally_results(group_id, n_filter, n_score, this % results) end subroutine tally_read_results_hdf5 !=============================================================================== From 64fa01f5375eb464e06ad8a548b3eeeeef94f8c3 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 19 Apr 2018 15:51:40 -0500 Subject: [PATCH 199/231] Fix use of auto for transfer list --- src/hdf5_interface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index ddc2dcdfc1..5549ac7d81 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -275,7 +275,7 @@ read_dataset(hid_t obj_id, const char* name, hid_t mem_type_id, if (using_mpio_device(dset)) { #ifdef PHDF5 // Set up collective vs independent I/O - auto data_xfer_mode {indep ? H5FD_MPIO_INDEPENDENT : H5FD_MPIO_COLLECTIVE}; + auto data_xfer_mode = indep ? H5FD_MPIO_INDEPENDENT : H5FD_MPIO_COLLECTIVE; // Create dataset transfer property list hid_t plist = H5Pcreate(H5P_DATASET_XFER); From 9b8cb2e0f132d63e1f557e3ad1ff7fa537d4f9c7 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 20 Apr 2018 06:38:16 -0500 Subject: [PATCH 200/231] Have openmc_init take a MPI_Comm* --- CMakeLists.txt | 1 + include/openmc.h | 12 +++++++++++- openmc/capi/core.py | 16 +++++++--------- src/api.F90 | 4 ++-- src/hdf5_interface.cpp | 15 ++++++++++----- src/initialize.F90 | 6 ++++-- src/initialize.cpp | 20 ++++++++++++++++++++ src/main.cpp | 14 ++++++-------- 8 files changed, 61 insertions(+), 27 deletions(-) create mode 100644 src/initialize.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index ff7a3334be..ab52510499 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -434,6 +434,7 @@ set(LIBOPENMC_FORTRAN_SRC ) set(LIBOPENMC_CXX_SRC src/error.h + src/initialize.cpp src/hdf5_interface.h src/hdf5_interface.cpp src/random_lcg.cpp diff --git a/include/openmc.h b/include/openmc.h index 1945453452..85cb09a918 100644 --- a/include/openmc.h +++ b/include/openmc.h @@ -4,6 +4,10 @@ #include #include +#ifdef OPENMC_MPI +#include "mpi.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -46,7 +50,8 @@ extern "C" { int64_t openmc_get_seed(); int openmc_get_tally_index(int32_t id, int32_t* index); void openmc_hard_reset(); - void openmc_init(const int* intracomm); + int openmc_init(const void* intracomm); + int openmc_init_f(const int* intracomm); int openmc_legendre_filter_get_order(int32_t index, int* order); int openmc_legendre_filter_set_order(int32_t index, int order); int openmc_load_nuclide(char name[]); @@ -145,6 +150,11 @@ extern "C" { extern bool openmc_simulation_initialized; extern int openmc_verbosity; +#ifdef OPENMC_MPI + // MPI variables + extern MPI_Comm openmc_intracomm; +#endif + // Run modes constexpr int RUN_MODE_FIXEDSOURCE {1}; constexpr int RUN_MODE_EIGENVALUE {2}; diff --git a/openmc/capi/core.py b/openmc/capi/core.py index d356905036..a278e69d5b 100644 --- a/openmc/capi/core.py +++ b/openmc/capi/core.py @@ -1,6 +1,6 @@ from contextlib import contextmanager from ctypes import (CDLL, c_int, c_int32, c_int64, c_double, c_char_p, - POINTER, Structure) + POINTER, Structure, c_void_p) from warnings import warn import numpy as np @@ -27,7 +27,7 @@ _dll.openmc_find.argtypes = [POINTER(c_double*3), c_int, POINTER(c_int32), _dll.openmc_find.restype = c_int _dll.openmc_find.errcheck = _error_handler _dll.openmc_hard_reset.restype = None -_dll.openmc_init.argtypes = [POINTER(c_int)] +_dll.openmc_init.argtypes = [c_void_p] _dll.openmc_init.restype = None _dll.openmc_get_keff.argtypes = [POINTER(c_double*2)] _dll.openmc_get_keff.restype = c_int @@ -116,13 +116,11 @@ def init(intracomm=None): """ if intracomm is not None: - # If an mpi4py communicator was passed, convert it to an integer to - # be passed to openmc_init - try: - intracomm = intracomm.py2f() - except AttributeError: - pass - _dll.openmc_init(c_int(intracomm)) + # If an mpi4py communicator was passed, convert it to void* to be passed + # to openmc_init + from mpi4py import MPI + address = MPI._addressof(intracomm) + _dll.openmc_init(c_void_p(address)) else: _dll.openmc_init(None) diff --git a/src/api.F90 b/src/api.F90 index d7f3ed0235..03ea9bff06 100644 --- a/src/api.F90 +++ b/src/api.F90 @@ -15,7 +15,7 @@ module openmc_api use mesh_header use message_passing use nuclide_header - use initialize, only: openmc_init + use initialize, only: openmc_init_f use particle_header, only: Particle use plot, only: openmc_plot_geometry use random_lcg, only: openmc_get_seed, openmc_set_seed @@ -64,7 +64,7 @@ module openmc_api public :: openmc_get_tally_index public :: openmc_global_tallies public :: openmc_hard_reset - public :: openmc_init + public :: openmc_init_f public :: openmc_load_nuclide public :: openmc_material_add_nuclide public :: openmc_material_get_id diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index 5549ac7d81..b31bf8c1ac 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -1,14 +1,19 @@ #include "hdf5_interface.h" -#include "error.h" - -#include "hdf5.h" -#include "hdf5_hl.h" #include #include #include #include +#include "hdf5.h" +#include "hdf5_hl.h" +#ifdef OPENMC_MPI +#include "mpi.h" +#include "openmc.h" +#endif +#include "error.h" + + namespace openmc { bool @@ -158,7 +163,7 @@ file_open(const char* filename, char mode, bool parallel) if (parallel) { // Setup file access property list with parallel I/O access plist = H5Pcreate(H5P_FILE_ACCESS); - H5Pset_fapl_mpio(plist, mpi_intracomm, MPI_INFO_NULL); + H5Pset_fapl_mpio(plist, openmc_intracomm, MPI_INFO_NULL); } #endif diff --git a/src/initialize.F90 b/src/initialize.F90 index 7b699b9cb7..773c6dbf0e 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -41,8 +41,9 @@ contains ! setting up timers, etc. !=============================================================================== - subroutine openmc_init(intracomm) bind(C) + function openmc_init_f(intracomm) result(err) bind(C) integer, intent(in), optional :: intracomm ! MPI intracommunicator + integer(C_INT) :: err #ifdef _OPENMP character(MAX_WORD_LEN) :: envvar @@ -105,7 +106,8 @@ contains ! Stop initialization timer call time_initialize%stop() - end subroutine openmc_init + err = 0 + end function openmc_init_f #ifdef OPENMC_MPI !=============================================================================== diff --git a/src/initialize.cpp b/src/initialize.cpp new file mode 100644 index 0000000000..029a4155d8 --- /dev/null +++ b/src/initialize.cpp @@ -0,0 +1,20 @@ +#include "openmc.h" + +#ifdef OPENMC_MPI +MPI_Comm openmc_intracomm; +#endif + + +int +openmc_init(const void* intracomm) +{ +#ifdef OPENMC_MPI + openmc_intracomm = *static_cast(intracomm); + + MPI_Fint fcomm = MPI_Comm_c2f(openmc_intracomm); + openmc_init_f(&fcomm); +#else + openmc_init_f(nullptr); +#endif + return 0; +} diff --git a/src/main.cpp b/src/main.cpp index 7b2ccb5c3e..2814b538f7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,17 +1,15 @@ #include "openmc.h" -#ifdef MPI -#include -#else -#define MPI_COMM_WORLD nullptr -#endif - - int main(int argc, char** argv) { int err; // Initialize run -- when run with MPI, pass communicator - openmc_init(MPI_COMM_WORLD); +#ifdef OPENMC_MPI + MPI_Comm world {MPI_COMM_WORLD}; + openmc_init(&world); +#else + openmc_init(nullptr); +#endif // start problem based on mode switch (openmc_run_mode) { From 25b1001558092e487a17e67fcaaacec214022127 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 20 Apr 2018 07:02:59 -0500 Subject: [PATCH 201/231] Move mpi-related definitions into message_passing.h --- CMakeLists.txt | 1 + include/openmc.h | 8 -------- src/hdf5_interface.cpp | 4 ++-- src/initialize.cpp | 8 +++----- src/message_passing.cpp | 15 +++++++++++++++ src/message_passing.h | 18 ++++++++++++++++++ 6 files changed, 39 insertions(+), 15 deletions(-) create mode 100644 src/message_passing.cpp create mode 100644 src/message_passing.h diff --git a/CMakeLists.txt b/CMakeLists.txt index ab52510499..8c67728340 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -437,6 +437,7 @@ set(LIBOPENMC_CXX_SRC src/initialize.cpp src/hdf5_interface.h src/hdf5_interface.cpp + src/message_passing.cpp src/random_lcg.cpp src/random_lcg.h src/simulation.cpp diff --git a/include/openmc.h b/include/openmc.h index 85cb09a918..1788fb8cca 100644 --- a/include/openmc.h +++ b/include/openmc.h @@ -4,9 +4,6 @@ #include #include -#ifdef OPENMC_MPI -#include "mpi.h" -#endif #ifdef __cplusplus extern "C" { @@ -150,11 +147,6 @@ extern "C" { extern bool openmc_simulation_initialized; extern int openmc_verbosity; -#ifdef OPENMC_MPI - // MPI variables - extern MPI_Comm openmc_intracomm; -#endif - // Run modes constexpr int RUN_MODE_FIXEDSOURCE {1}; constexpr int RUN_MODE_EIGENVALUE {2}; diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index b31bf8c1ac..cbbd7d7c3e 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -9,7 +9,7 @@ #include "hdf5_hl.h" #ifdef OPENMC_MPI #include "mpi.h" -#include "openmc.h" +#include "message_passing.h" #endif #include "error.h" @@ -163,7 +163,7 @@ file_open(const char* filename, char mode, bool parallel) if (parallel) { // Setup file access property list with parallel I/O access plist = H5Pcreate(H5P_FILE_ACCESS); - H5Pset_fapl_mpio(plist, openmc_intracomm, MPI_INFO_NULL); + H5Pset_fapl_mpio(plist, openmc::mpi::intracomm, MPI_INFO_NULL); } #endif diff --git a/src/initialize.cpp b/src/initialize.cpp index 029a4155d8..4f3261dad7 100644 --- a/src/initialize.cpp +++ b/src/initialize.cpp @@ -1,17 +1,15 @@ #include "openmc.h" -#ifdef OPENMC_MPI -MPI_Comm openmc_intracomm; -#endif +#include "message_passing.h" int openmc_init(const void* intracomm) { #ifdef OPENMC_MPI - openmc_intracomm = *static_cast(intracomm); + openmc::mpi::intracomm = *static_cast(intracomm); - MPI_Fint fcomm = MPI_Comm_c2f(openmc_intracomm); + MPI_Fint fcomm = MPI_Comm_c2f(openmc::mpi::intracomm); openmc_init_f(&fcomm); #else openmc_init_f(nullptr); diff --git a/src/message_passing.cpp b/src/message_passing.cpp new file mode 100644 index 0000000000..3ab96ffd87 --- /dev/null +++ b/src/message_passing.cpp @@ -0,0 +1,15 @@ +#include "message_passing.h" + +namespace openmc { +namespace mpi { + +int rank; +int n_procs; + +#ifdef OPENMC_MPI +MPI_Comm intracomm; +MPI_Datatype bank; +#endif + +} // namespace mpi +} // namespace openmc diff --git a/src/message_passing.h b/src/message_passing.h new file mode 100644 index 0000000000..fea092c618 --- /dev/null +++ b/src/message_passing.h @@ -0,0 +1,18 @@ +#ifndef MESSAGE_PASSING_H +#define MESSAGE_PASSING_H + +namespace openmc { +namespace mpi { + + extern int rank; + extern int n_procs; + +#ifdef OPENMC_MPI + extern MPI_Datatype bank; + extern MPI_Comm intracomm; +#endif + +} // namespace mpi +} // namespace openmc + +#endif // MESSAGE_PASSING_H From 0ee5ec4ecbb634f08c008a08cdcd60617f584c9f Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 20 Apr 2018 07:25:35 -0500 Subject: [PATCH 202/231] Make sure headers only contain declarations and inline funcs --- CMakeLists.txt | 9 ++----- src/hdf5_interface.cpp | 2 +- src/surface.cpp | 49 ++++++++++++++++++++++++++++++++++++ src/surface.h | 56 +++++++++++------------------------------- src/xml_interface.cpp | 40 ++++++++++++++++++++++++++++++ src/xml_interface.h | 32 ++---------------------- 6 files changed, 109 insertions(+), 79 deletions(-) create mode 100644 src/xml_interface.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c67728340..455556f015 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -433,19 +433,14 @@ set(LIBOPENMC_FORTRAN_SRC src/tallies/trigger_header.F90 ) set(LIBOPENMC_CXX_SRC - src/error.h src/initialize.cpp - src/hdf5_interface.h src/hdf5_interface.cpp src/message_passing.cpp src/random_lcg.cpp - src/random_lcg.h src/simulation.cpp src/surface.cpp - src/surface.h - src/xml_interface.h - src/pugixml/pugixml.cpp - src/pugixml/pugixml.hpp) + src/xml_interface.cpp + src/pugixml/pugixml.cpp) add_library(libopenmc SHARED ${LIBOPENMC_FORTRAN_SRC} ${LIBOPENMC_CXX_SRC}) set_target_properties(libopenmc PROPERTIES OUTPUT_NAME openmc) add_executable(${program} src/main.cpp) diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index cbbd7d7c3e..1502ec2e12 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -2,8 +2,8 @@ #include #include -#include #include +#include #include "hdf5.h" #include "hdf5_hl.h" diff --git a/src/surface.cpp b/src/surface.cpp index 9db9db3fa5..2c3279604a 100644 --- a/src/surface.cpp +++ b/src/surface.cpp @@ -11,6 +11,12 @@ namespace openmc { +//============================================================================== +// Global variables +//============================================================================== + +int32_t n_surfaces; + //============================================================================== // Helper functions for reading the "coeffs" node of an XML surface element //============================================================================== @@ -1232,4 +1238,47 @@ read_surfaces(pugi::xml_node *node) } } +//============================================================================== +// Fortran compatibility functions +//============================================================================== + +extern "C" Surface* surface_pointer(int surf_ind) {return surfaces_c[surf_ind];} + +extern "C" int surface_id(Surface *surf) {return surf->id;} + +extern "C" int surface_bc(Surface *surf) {return surf->bc;} + +extern "C" bool surface_sense(Surface *surf, double xyz[3], double uvw[3]) +{return surf->sense(xyz, uvw);} + +extern "C" void surface_reflect(Surface *surf, double xyz[3], double uvw[3]) +{surf->reflect(xyz, uvw);} + +extern "C" double +surface_distance(Surface *surf, double xyz[3], double uvw[3], bool coincident) +{return surf->distance(xyz, uvw, coincident);} + +extern "C" void surface_normal(Surface *surf, double xyz[3], double uvw[3]) +{return surf->normal(xyz, uvw);} + +extern "C" void surface_to_hdf5(Surface *surf, hid_t group) +{surf->to_hdf5(group);} + +extern "C" int surface_i_periodic(PeriodicSurface *surf) +{return surf->i_periodic;} + +extern "C" bool +surface_periodic(PeriodicSurface *surf, PeriodicSurface *other, double xyz[3], + double uvw[3]) +{return surf->periodic_translate(other, xyz, uvw);} + +extern "C" void free_memory_surfaces_c() +{ + for (int i = 0; i < n_surfaces; i++) {delete surfaces_c[i];} + delete surfaces_c; + surfaces_c = nullptr; + n_surfaces = 0; + surface_dict.clear(); +} + } // namespace openmc diff --git a/src/surface.h b/src/surface.h index 627a8fbae2..15ac0d5bdd 100644 --- a/src/surface.h +++ b/src/surface.h @@ -25,15 +25,14 @@ extern "C" const int BC_PERIODIC {3}; //============================================================================== extern "C" double FP_COINCIDENT; -constexpr double INFTY{std::numeric_limits::max()}; +constexpr double INFTY {std::numeric_limits::max()}; constexpr int C_NONE {-1}; //============================================================================== // Global variables //============================================================================== -// Braces force n_surfaces to be defined here, not just declared. -extern "C" {int32_t n_surfaces {0};} +extern "C" int32_t n_surfaces; class Surface; Surface **surfaces_c; @@ -384,44 +383,19 @@ public: // Fortran compatibility functions //============================================================================== -extern "C" Surface* surface_pointer(int surf_ind) {return surfaces_c[surf_ind];} - -extern "C" int surface_id(Surface *surf) {return surf->id;} - -extern "C" int surface_bc(Surface *surf) {return surf->bc;} - -extern "C" bool surface_sense(Surface *surf, double xyz[3], double uvw[3]) -{return surf->sense(xyz, uvw);} - -extern "C" void surface_reflect(Surface *surf, double xyz[3], double uvw[3]) -{surf->reflect(xyz, uvw);} - -extern "C" double -surface_distance(Surface *surf, double xyz[3], double uvw[3], bool coincident) -{return surf->distance(xyz, uvw, coincident);} - -extern "C" void surface_normal(Surface *surf, double xyz[3], double uvw[3]) -{return surf->normal(xyz, uvw);} - -extern "C" void surface_to_hdf5(Surface *surf, hid_t group) -{surf->to_hdf5(group);} - -extern "C" int surface_i_periodic(PeriodicSurface *surf) -{return surf->i_periodic;} - -extern "C" bool -surface_periodic(PeriodicSurface *surf, PeriodicSurface *other, double xyz[3], - double uvw[3]) -{return surf->periodic_translate(other, xyz, uvw);} - -extern "C" void free_memory_surfaces_c() -{ - for (int i = 0; i < n_surfaces; i++) {delete surfaces_c[i];} - delete surfaces_c; - surfaces_c = nullptr; - n_surfaces = 0; - surface_dict.clear(); -} +extern "C" Surface* surface_pointer(int surf_ind); +extern "C" int surface_id(Surface *surf); +extern "C" int surface_bc(Surface *surf); +extern "C" bool surface_sense(Surface *surf, double xyz[3], double uvw[3]); +extern "C" void surface_reflect(Surface *surf, double xyz[3], double uvw[3]); +extern "C" double surface_distance(Surface *surf, double xyz[3], double uvw[3], + bool coincident); +extern "C" void surface_normal(Surface *surf, double xyz[3], double uvw[3]); +extern "C" void surface_to_hdf5(Surface *surf, hid_t group); +extern "C" int surface_i_periodic(PeriodicSurface *surf); +extern "C" bool surface_periodic(PeriodicSurface *surf, PeriodicSurface *other, + double xyz[3], double uvw[3]); +extern "C" void free_memory_surfaces_c(); } // namespace openmc #endif // SURFACE_H diff --git a/src/xml_interface.cpp b/src/xml_interface.cpp new file mode 100644 index 0000000000..aea1c2c17b --- /dev/null +++ b/src/xml_interface.cpp @@ -0,0 +1,40 @@ +#include "xml_interface.h" + +#include // for std::transform +#include +#include + +#include "pugixml/pugixml.hpp" +#include "error.h" + + +namespace openmc { + +std::string +get_node_value(pugi::xml_node node, const char *name) +{ + // Search for either an attribute or child tag and get the data as a char*. + const pugi::char_t *value_char; + if (node.attribute(name)) { + value_char = node.attribute(name).value(); + } else if (node.child(name)) { + value_char = node.child_value(name); + } else { + std::stringstream err_msg; + err_msg << "Node \"" << name << "\" is not a member of the \"" + << node.name() << "\" XML node"; + fatal_error(err_msg); + } + + // Convert to lowercase string. + std::string value(value_char); + std::transform(value.begin(), value.end(), value.begin(), ::tolower); + + // Remove whitespace. + value.erase(0, value.find_first_not_of(" \t\r\n")); + value.erase(value.find_last_not_of(" \t\r\n") + 1); + + return value; +} + +} // namespace openmc diff --git a/src/xml_interface.h b/src/xml_interface.h index 778497562b..52aa6003f4 100644 --- a/src/xml_interface.h +++ b/src/xml_interface.h @@ -1,8 +1,6 @@ #ifndef XML_INTERFACE_H #define XML_INTERFACE_H -#include // for std::transform -#include #include #include "pugixml/pugixml.hpp" @@ -10,39 +8,13 @@ namespace openmc { -bool +inline bool check_for_node(pugi::xml_node node, const char *name) { return node.attribute(name) || node.child(name); } - -std::string -get_node_value(pugi::xml_node node, const char *name) -{ - // Search for either an attribute or child tag and get the data as a char*. - const pugi::char_t *value_char; - if (node.attribute(name)) { - value_char = node.attribute(name).value(); - } else if (node.child(name)) { - value_char = node.child_value(name); - } else { - std::stringstream err_msg; - err_msg << "Node \"" << name << "\" is not a member of the \"" - << node.name() << "\" XML node"; - fatal_error(err_msg); - } - - // Convert to lowercase string. - std::string value(value_char); - std::transform(value.begin(), value.end(), value.begin(), ::tolower); - - // Remove whitespace. - value.erase(0, value.find_first_not_of(" \t\r\n")); - value.erase(value.find_last_not_of(" \t\r\n") + 1); - - return value; -} +std::string get_node_value(pugi::xml_node node, const char *name); } // namespace openmc #endif // XML_INTERFACE_H From 44ff22dc148ecf64e8e61cf589f9abcb89e84bd9 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 20 Apr 2018 11:03:40 -0500 Subject: [PATCH 203/231] Convert write_source_bank to C++, move some MPI initialization over too --- CMakeLists.txt | 1 + include/openmc.h | 7 +- openmc/capi/core.py | 14 ++-- src/initialize.F90 | 16 ----- src/initialize.cpp | 42 +++++++++++- src/message_passing.F90 | 6 +- src/simulation_header.F90 | 4 +- src/source.F90 | 2 +- src/state_point.F90 | 135 ++++---------------------------------- src/state_point.cpp | 112 +++++++++++++++++++++++++++++++ src/state_point.h | 15 +++++ 11 files changed, 200 insertions(+), 154 deletions(-) create mode 100644 src/state_point.cpp create mode 100644 src/state_point.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 455556f015..9b750a6dd3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -438,6 +438,7 @@ set(LIBOPENMC_CXX_SRC src/message_passing.cpp src/random_lcg.cpp src/simulation.cpp + src/state_point.cpp src/surface.cpp src/xml_interface.cpp src/pugixml/pugixml.cpp) diff --git a/include/openmc.h b/include/openmc.h index 1788fb8cca..7f2bbf46c7 100644 --- a/include/openmc.h +++ b/include/openmc.h @@ -127,7 +127,6 @@ extern "C" { extern char openmc_err_msg[256]; extern double openmc_keff; extern double openmc_keff_std; - extern bool openmc_master; extern int32_t n_batches; extern int32_t n_cells; extern int32_t n_filters; @@ -147,6 +146,12 @@ extern "C" { extern bool openmc_simulation_initialized; extern int openmc_verbosity; + // Variables that are shared by necessity (can be removed later) + extern bool openmc_master; + extern int openmc_n_procs; + extern int openmc_rank; + extern int64_t openmc_work; + // Run modes constexpr int RUN_MODE_FIXEDSOURCE {1}; constexpr int RUN_MODE_EIGENVALUE {2}; diff --git a/openmc/capi/core.py b/openmc/capi/core.py index a278e69d5b..57e2e88ebd 100644 --- a/openmc/capi/core.py +++ b/openmc/capi/core.py @@ -118,11 +118,15 @@ def init(intracomm=None): if intracomm is not None: # If an mpi4py communicator was passed, convert it to void* to be passed # to openmc_init - from mpi4py import MPI - address = MPI._addressof(intracomm) - _dll.openmc_init(c_void_p(address)) - else: - _dll.openmc_init(None) + try: + from mpi4py import MPI + except ImportError: + intracomm = None + else: + address = MPI._addressof(intracomm) + intracomm = c_void_p(address) + + _dll.openmc_init(intracomm) def iter_batches(): diff --git a/src/initialize.F90 b/src/initialize.F90 index 773c6dbf0e..7b8f37dee6 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -131,27 +131,11 @@ contains integer :: bank_types(5) ! Datatypes #endif integer(MPI_ADDRESS_KIND) :: bank_disp(5) ! Displacements - logical :: init_called type(Bank) :: b ! Indicate that MPI is turned on mpi_enabled = .true. - - ! Initialize MPI - call MPI_INITIALIZED(init_called, mpi_err) - if (.not. init_called) call MPI_INIT(mpi_err) - - ! Determine number of processors and rank of each processor mpi_intracomm = intracomm - call MPI_COMM_SIZE(mpi_intracomm, n_procs, mpi_err) - call MPI_COMM_RANK(mpi_intracomm, rank, mpi_err) - - ! Determine master - if (rank == 0) then - master = .true. - else - master = .false. - end if ! ========================================================================== ! CREATE MPI_BANK TYPE diff --git a/src/initialize.cpp b/src/initialize.cpp index 4f3261dad7..d32a6c97f3 100644 --- a/src/initialize.cpp +++ b/src/initialize.cpp @@ -3,12 +3,14 @@ #include "message_passing.h" -int -openmc_init(const void* intracomm) +int openmc_init(const void* intracomm) { #ifdef OPENMC_MPI - openmc::mpi::intracomm = *static_cast(intracomm); + // Initialize MPI for C++ + MPI_Comm intracomm = *static_cast(intracomm); + initialize_mpi(intracomm); + // Continue with rest of initialization MPI_Fint fcomm = MPI_Comm_c2f(openmc::mpi::intracomm); openmc_init_f(&fcomm); #else @@ -16,3 +18,37 @@ openmc_init(const void* intracomm) #endif return 0; } + + +#ifdef OPENMC_MPI +void initialize_mpi(MPI_Comm intracomm) +{ + openmc::mpi::intracomm = intracomm; + + // Initialize MPI + int flag; + if (!MPI_Initialized(&flag)) MPI_Init(nullptr, nullptr); + + // Determine number of processes and rank for each + MPI_Comm_size(intracomm, openmc::mpi::n_procs); + MPI_Comm_rank(intracomm, openmc::mpi::rank); + + // Set variable for Fortran side + openmc_n_procs = openmc::mpi::n_procs; + openmc_rank = openmc::mpi::rank; + openmc_master = (openmc::mpi::rank == 0); + + // Create bank datatype + Bank b; + MPI_Aint disp[5]; + disp[0] = &b.wgt - &b; + disp[1] = &b.xyz - &b; + disp[2] = &b.uvw - &b; + disp[3] = &b.E - &b; + disp[4] = &b.delayed_group - &b; + int blocks[] {1, 3, 3, 1, 1}; + MPI_Datatype types[] {MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_INT}; + MPI_Type_create_struct(5, blocks, disp, types, &openmc::mpi::bank); + MPI_Type_commit(&openmc::mpi::bank); +} +#endif diff --git a/src/message_passing.F90 b/src/message_passing.F90 index f9a16ee759..6ade0895a9 100644 --- a/src/message_passing.F90 +++ b/src/message_passing.F90 @@ -14,9 +14,9 @@ module message_passing ! mpi_enabled flag are for when MPI is not being used at all, i.e. a serial ! run. In this case, these variables are still used at times. - integer :: n_procs = 1 ! number of processes - integer :: rank = 0 ! rank of process - logical(C_BOOL), bind(C, name='openmc_master') :: master = .true. ! master process? + integer(C_INT), bind(C, name='openmc_n_procs') :: n_procs = 1 ! number of processes + integer(C_INT), bind(C, name='openmc_rank') :: rank = 0 ! rank of process + logical(C_BOOL), bind(C, name='openmc_master') :: master = .true. ! master process? logical :: mpi_enabled = .false. ! is MPI in use and initialized? #ifdef OPENMC_MPIF08 type(MPI_Datatype) :: MPI_BANK ! MPI datatype for fission bank diff --git a/src/simulation_header.F90 b/src/simulation_header.F90 index 67bf3062bd..a214f4410b 100644 --- a/src/simulation_header.F90 +++ b/src/simulation_header.F90 @@ -32,8 +32,8 @@ module simulation_header logical :: satisfy_triggers = .false. ! whether triggers are satisfied - integer(8) :: work ! number of particles per processor - integer(8), allocatable :: work_index(:) ! starting index in source bank for each process + integer(C_INT64_T), bind(C, name='openmc_work') :: work ! number of particles per processor + integer(C_INT64_T), allocatable :: work_index(:) ! starting index in source bank for each process integer(8) :: current_work ! index in source bank of current history simulated ! ============================================================================ diff --git a/src/source.F90 b/src/source.F90 index 8e142fcfaa..59a117465c 100644 --- a/src/source.F90 +++ b/src/source.F90 @@ -88,7 +88,7 @@ contains call write_message('Writing out initial source...', 5) filename = trim(path_output) // 'initial_source.h5' file_id = file_open(filename, 'w', parallel=.true.) - call write_source_bank(file_id) + call write_source_bank(file_id, work_index, source_bank) call file_close(file_id) end if diff --git a/src/state_point.F90 b/src/state_point.F90 index 62240f110a..181ab968b9 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -15,6 +15,7 @@ module state_point use hdf5 + use bank_header, only: Bank use cmfd_header use constants use eigenvalue, only: openmc_get_keff @@ -37,6 +38,15 @@ module state_point implicit none + interface + subroutine write_source_bank(group_id, work_index, bank_) bind(C) + import HID_T, C_INT64_T, Bank + integer(HID_T), value :: group_id + integer(C_INT64_T), intent(in) :: work_index(*) + type(Bank), intent(in) :: bank_(*) + end subroutine write_source_bank + end interface + contains !=============================================================================== @@ -489,7 +499,7 @@ contains end if end if - call write_source_bank(file_id) + call write_source_bank(file_id, work_index, source_bank) if (master .or. parallel) call file_close(file_id) end if @@ -502,7 +512,7 @@ contains call write_dataset(file_id, "filetype", 'source') end if - call write_source_bank(file_id) + call write_source_bank(file_id, work_index, source_bank) if (master .or. parallel) call file_close(file_id) end if @@ -831,132 +841,11 @@ contains end subroutine load_state_point -!=============================================================================== -! WRITE_SOURCE_BANK writes OpenMC source_bank data -!=============================================================================== - - subroutine write_source_bank(group_id) - use bank_header, only: Bank - - integer(HID_T), intent(in) :: group_id - - integer :: hdf5_err - integer(HID_T) :: dset ! data set handle - integer(HID_T) :: dspace ! data or file space handle - integer(HID_T) :: memspace ! memory space handle - integer(HSIZE_T) :: offset(1) ! source data offset - integer(HSIZE_T) :: dims(1) - type(c_ptr) :: f_ptr -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#else - integer :: i -#ifdef OPENMC_MPI - integer :: mpi_err ! MPI error code - type(Bank), allocatable, target :: temp_source(:) -#endif -#endif - -#ifdef PHDF5 - ! Set size of total dataspace for all procs and rank - dims(1) = n_particles - call h5screate_simple_f(1, dims, dspace, hdf5_err) - call h5dcreate_f(group_id, "source_bank", hdf5_bank_t, dspace, dset, hdf5_err) - - ! Create another data space but for each proc individually - dims(1) = work - call h5screate_simple_f(1, dims, memspace, hdf5_err) - - ! Select hyperslab for this dataspace - offset(1) = work_index(rank) - call h5sselect_hyperslab_f(dspace, H5S_SELECT_SET_F, offset, dims, hdf5_err) - - ! Set up the property list for parallel writing - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, H5FD_MPIO_COLLECTIVE_F, hdf5_err) - - ! Set up pointer to data - f_ptr = c_loc(source_bank) - - ! Write data to file in parallel - call h5dwrite_f(dset, hdf5_bank_t, f_ptr, hdf5_err, & - file_space_id=dspace, mem_space_id=memspace, & - xfer_prp=plist) - - ! Close all ids - call h5sclose_f(dspace, hdf5_err) - call h5sclose_f(memspace, hdf5_err) - call h5dclose_f(dset, hdf5_err) - call h5pclose_f(plist, hdf5_err) - -#else - - if (master) then - ! Create dataset big enough to hold all source sites - dims(1) = n_particles - call h5screate_simple_f(1, dims, dspace, hdf5_err) - call h5dcreate_f(group_id, "source_bank", hdf5_bank_t, & - dspace, dset, hdf5_err) - - ! Save source bank sites since the souce_bank array is overwritten below -#ifdef OPENMC_MPI - allocate(temp_source(work)) - temp_source(:) = source_bank(:) -#endif - - do i = 0, n_procs - 1 - ! Create memory space - dims(1) = work_index(i+1) - work_index(i) - call h5screate_simple_f(1, dims, memspace, hdf5_err) - -#ifdef OPENMC_MPI - ! Receive source sites from other processes - if (i > 0) then - call MPI_RECV(source_bank, int(dims(1)), MPI_BANK, i, i, & - mpi_intracomm, MPI_STATUS_IGNORE, mpi_err) - end if -#endif - - ! Select hyperslab for this dataspace - call h5dget_space_f(dset, dspace, hdf5_err) - offset(1) = work_index(i) - call h5sselect_hyperslab_f(dspace, H5S_SELECT_SET_F, offset, dims, hdf5_err) - - ! Set up pointer to data and write data to hyperslab - f_ptr = c_loc(source_bank) - call h5dwrite_f(dset, hdf5_bank_t, f_ptr, hdf5_err, & - file_space_id=dspace, mem_space_id=memspace) - - call h5sclose_f(memspace, hdf5_err) - call h5sclose_f(dspace, hdf5_err) - end do - - ! Close all ids - call h5dclose_f(dset, hdf5_err) - - ! Restore state of source bank -#ifdef OPENMC_MPI - source_bank(:) = temp_source(:) - deallocate(temp_source) -#endif - else -#ifdef OPENMC_MPI - call MPI_SEND(source_bank, int(work), MPI_BANK, 0, rank, & - mpi_intracomm, mpi_err) -#endif - end if - -#endif - - end subroutine write_source_bank - !=============================================================================== ! READ_SOURCE_BANK reads OpenMC source_bank data !=============================================================================== subroutine read_source_bank(group_id) - use bank_header, only: Bank - integer(HID_T), intent(in) :: group_id integer :: hdf5_err diff --git a/src/state_point.cpp b/src/state_point.cpp new file mode 100644 index 0000000000..20338c4be5 --- /dev/null +++ b/src/state_point.cpp @@ -0,0 +1,112 @@ +#include "state_point.h" + +#include +#include + +#include "mpi.h" +#include "message_passing.h" +#include "openmc.h" + +namespace openmc { + +void +write_source_bank(hid_t group_id, int64_t* work_index, const Bank* source_bank) +{ + // Create type for array of 3 reals + hsize_t dims[] {3}; + hid_t triplet = H5Tarray_create(H5T_NATIVE_DOUBLE, 1, dims); + + // Create bank datatype + hid_t banktype = H5Tcreate(H5T_COMPOUND, sizeof(struct Bank)); + H5Tinsert(banktype, "wgt", HOFFSET(Bank, wgt), H5T_NATIVE_DOUBLE); + H5Tinsert(banktype, "xyz", HOFFSET(Bank, xyz), triplet); + H5Tinsert(banktype, "uvw", HOFFSET(Bank, uvw), triplet); + H5Tinsert(banktype, "E", HOFFSET(Bank, E), H5T_NATIVE_DOUBLE); + H5Tinsert(banktype, "delayed_group", HOFFSET(Bank, delayed_group), H5T_NATIVE_INT); + +#ifdef PHDF5 + // Set size of total dataspace for all procs and rank + dims[0] = n_particles; + hid_t dspace = H5Screate_simple(1, dims, H5P_DEFAULT); + hid_t dset = H5Dcreate(group_id, "source_bank", banktype, dspace, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + // Create another data space but for each proc individually + hsize_t count[] {openmc_work}; + hid_t memspace = H5Screate_simple(1, count, H5P_DEFAULT); + + // Select hyperslab for this dataspace + hsize_t start[] {work_index[openmc::mpi::rank]}; + H5Sselect_hyperslab(dspace, H5S_SELECT_SET, start, nullptr, count, nullptr); + + // Set up the property list for parallel writing + hid_t plist = H5Pcreate(H5P_DATASET_XFER); + H5Pset_dxpl_mpio_f(plist, H5FD_MPIO_COLLECTIVE); + + // Write data to file in parallel + H5Dwrite(dset, banktype, memspace, dspace, memspace, plist, source_bank); + + // Free resources + H5Sclose(dspace); + h5sclose(memspace); + H5Dclose(dset); + H5Pclose(plist); + +#else + + if (openmc_master) { + // Create dataset big enough to hold all source sites + hsize_t dims[] {static_cast(n_particles)}; + hid_t dspace = H5Screate_simple(1, dims, H5P_DEFAULT); + hid_t dset = H5Dcreate(group_id, "source_bank", banktype, dspace, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + + // Save source bank sites since the souce_bank array is overwritten below +#ifdef OPENMC_MPI + std::vector temp_source {source_bank, source_bank + openmc_work}; +#endif + + for (int i = 0; i < openmc::mpi::n_procs; ++i) { + // Create memory space + hsize_t count[] {static_cast(work_index[i+1] - work_index[i])}; + hid_t memspace = H5Screate_simple(1, count, H5P_DEFAULT); + +#ifdef OPENMC_MPI + // Receive source sites from other processes + if (i > 0) + MPI_Recv(source_bank, count[0], openmc::mpi::bank, i, i, + openmc::mpi::intracomm, MPI_STATUS_IGNORE); +#endif + + // Select hyperslab for this dataspace + dspace = H5Dget_space(dset); + hsize_t start[] {static_cast(work_index[i])}; + H5Sselect_hyperslab(dspace, H5S_SELECT_SET, start, nullptr, count, nullptr); + + // Write data to hyperslab + H5Dwrite(dset, banktype, memspace, dspace, H5P_DEFAULT, source_bank); + + H5Sclose(memspace); + H5Sclose(dspace); + } + + // Close all ids + H5Dclose(dset); + +#ifdef OPENMC_MPI + // Restore state of source bank + std::copy(temp_source.begin(), temp_source.end(), source_bank); +#endif + } else { +#ifdef OPENMC_MPI + MPI_Send(source_bank, openmc_work, openmc::mpi::bank, 0, openmc::mpi::rank, + openmc::mpi::mpi_intracomm); +#endif + } +#endif + + H5Tclose(banktype); + H5Tclose(triplet); +} + +} // namespace openmc diff --git a/src/state_point.h b/src/state_point.h new file mode 100644 index 0000000000..f0dafdb809 --- /dev/null +++ b/src/state_point.h @@ -0,0 +1,15 @@ +#ifndef STATE_POINT_H +#define STATE_POINT_H + +#include + +#include "hdf5.h" +#include "openmc.h" + +namespace openmc { + +extern "C" void write_source_bank(hid_t group_id, int64_t* work_index, + const struct Bank* bank); + +} // namespace openmc +#endif // STATE_POINT_H From 65095096f9ad72981f1be9c6ad9d89e55e77ea12 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 20 Apr 2018 13:53:53 -0500 Subject: [PATCH 204/231] Convert read_source_bank to C++ and fix a bunch of bugs --- src/hdf5_interface.F90 | 18 +++++------ src/hdf5_interface.cpp | 7 +++- src/initialize.cpp | 40 +++++++++++++++-------- src/initialize.h | 14 ++++++++ src/main.cpp | 4 +++ src/message_passing.h | 2 ++ src/mgxs_data.F90 | 4 +++ src/mgxs_header.F90 | 20 ++++++++++++ src/source.F90 | 2 +- src/state_point.F90 | 73 +++++------------------------------------- src/state_point.cpp | 71 ++++++++++++++++++++++++++++++++++------ src/state_point.h | 4 ++- 12 files changed, 159 insertions(+), 100 deletions(-) create mode 100644 src/initialize.h diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 752ce062dc..d76f7b6b71 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -138,7 +138,7 @@ module hdf5_interface integer(HID_T), value :: obj_id type(C_PTR), value :: name real(C_DOUBLE), intent(out) :: buffer(*) - logical(C_BOOL), intent(in) :: indep + logical(C_BOOL), value :: indep end subroutine read_double_c subroutine read_attr_int_c(obj_id, name, buffer) & @@ -172,7 +172,7 @@ module hdf5_interface integer(HID_T), value :: obj_id type(C_PTR), value :: name integer(C_INT), intent(out) :: buffer(*) - logical(C_BOOL), intent(in) :: indep + logical(C_BOOL), value :: indep end subroutine read_int_c subroutine read_llong_c(obj_id, name, buffer, indep) & @@ -181,7 +181,7 @@ module hdf5_interface integer(HID_T), value :: obj_id type(C_PTR), value :: name integer(C_LONG_LONG), intent(out) :: buffer(*) - logical(C_BOOL), intent(in) :: indep + logical(C_BOOL), value :: indep end subroutine read_llong_c subroutine read_string_c(obj_id, name, slen, buffer, indep) & @@ -191,7 +191,7 @@ module hdf5_interface type(C_PTR), value :: name integer(C_SIZE_T), value :: slen character(kind=C_CHAR), intent(out) :: buffer(*) - logical(C_BOOL), intent(in) :: indep + logical(C_BOOL), value :: indep end subroutine read_string_c subroutine read_complex_c(obj_id, name, buffer, indep) & @@ -200,7 +200,7 @@ module hdf5_interface integer(HID_T), value :: obj_id type(C_PTR), value :: name complex(C_DOUBLE_COMPLEX), intent(out) :: buffer(*) - logical(C_BOOL), intent(in) :: indep + logical(C_BOOL), value :: indep end subroutine read_complex_c subroutine write_attr_double_c(obj_id, ndim, dims, name, buffer) & @@ -239,7 +239,7 @@ module hdf5_interface integer(HSIZE_T), intent(in) :: dims(*) character(kind=C_CHAR), intent(in) :: name(*) real(C_DOUBLE), intent(in) :: buffer(*) - logical(C_BOOL), intent(in) :: indep + logical(C_BOOL), value :: indep end subroutine write_double_c subroutine write_int_c(group_id, ndim, dims, name, buffer, indep) & @@ -250,7 +250,7 @@ module hdf5_interface integer(HSIZE_T), intent(in) :: dims(*) character(kind=C_CHAR), intent(in) :: name(*) integer(C_INT), intent(in) :: buffer(*) - logical(C_BOOL), intent(in) :: indep + logical(C_BOOL), value :: indep end subroutine write_int_c subroutine write_llong_c(group_id, ndim, dims, name, buffer, indep) & @@ -261,7 +261,7 @@ module hdf5_interface integer(HSIZE_T), intent(in) :: dims(*) character(kind=C_CHAR), intent(in) :: name(*) integer(C_LONG_LONG), intent(in) :: buffer(*) - logical(C_BOOL), intent(in) :: indep + logical(C_BOOL), value :: indep end subroutine write_llong_c subroutine write_string_c(group_id, ndim, dims, slen, name, buffer, indep) & @@ -273,7 +273,7 @@ module hdf5_interface integer(C_SIZE_T), value :: slen character(kind=C_CHAR), intent(in) :: name(*) character(kind=C_CHAR), intent(in) :: buffer(*) - logical(C_BOOL), intent(in) :: indep + logical(C_BOOL), value :: indep end subroutine write_string_c end interface diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index 1502ec2e12..d81c5b34a8 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -174,6 +174,11 @@ file_open(const char* filename, char mode, bool parallel) } else { file_id = H5Fopen(filename, flags, plist); } + if (file_id < 0) { + std::stringstream msg; + msg << "Failed to open HDF5 file with mode '" << mode << "': " << filename; + fatal_error(msg); + } #ifdef PHDF5 // Close the property list @@ -451,7 +456,7 @@ write_dataset(hid_t group_id, int ndim, const hsize_t* dims, const char* name, if (using_mpio_device(group_id)) { #ifdef PHDF5 // Set up collective vs independent I/O - auto data_xfer_mode {indep ? H5FD_MPIO_INDEPENDENT : H5FD_MPIO_COLLECTIVE}; + auto data_xfer_mode = indep ? H5FD_MPIO_INDEPENDENT : H5FD_MPIO_COLLECTIVE; // Create dataset transfer property list hid_t plist = H5Pcreate(H5P_DATASET_XFER); diff --git a/src/initialize.cpp b/src/initialize.cpp index d32a6c97f3..23025feb23 100644 --- a/src/initialize.cpp +++ b/src/initialize.cpp @@ -1,17 +1,27 @@ -#include "openmc.h" +#include "initialize.h" + +#include #include "message_passing.h" +#include "openmc.h" int openmc_init(const void* intracomm) { #ifdef OPENMC_MPI + // Check if intracomm was passed + MPI_Comm comm; + if (intracomm) { + comm = *static_cast(intracomm); + } else { + comm = MPI_COMM_WORLD; + } + // Initialize MPI for C++ - MPI_Comm intracomm = *static_cast(intracomm); - initialize_mpi(intracomm); + openmc::initialize_mpi(comm); // Continue with rest of initialization - MPI_Fint fcomm = MPI_Comm_c2f(openmc::mpi::intracomm); + MPI_Fint fcomm = MPI_Comm_c2f(comm); openmc_init_f(&fcomm); #else openmc_init_f(nullptr); @@ -19,6 +29,7 @@ int openmc_init(const void* intracomm) return 0; } +namespace openmc { #ifdef OPENMC_MPI void initialize_mpi(MPI_Comm intracomm) @@ -30,8 +41,8 @@ void initialize_mpi(MPI_Comm intracomm) if (!MPI_Initialized(&flag)) MPI_Init(nullptr, nullptr); // Determine number of processes and rank for each - MPI_Comm_size(intracomm, openmc::mpi::n_procs); - MPI_Comm_rank(intracomm, openmc::mpi::rank); + MPI_Comm_size(intracomm, &openmc::mpi::n_procs); + MPI_Comm_rank(intracomm, &openmc::mpi::rank); // Set variable for Fortran side openmc_n_procs = openmc::mpi::n_procs; @@ -40,15 +51,18 @@ void initialize_mpi(MPI_Comm intracomm) // Create bank datatype Bank b; - MPI_Aint disp[5]; - disp[0] = &b.wgt - &b; - disp[1] = &b.xyz - &b; - disp[2] = &b.uvw - &b; - disp[3] = &b.E - &b; - disp[4] = &b.delayed_group - &b; + MPI_Aint disp[] { + offsetof(Bank, wgt), + offsetof(Bank, xyz), + offsetof(Bank, uvw), + offsetof(Bank, E), + offsetof(Bank, delayed_group) + }; int blocks[] {1, 3, 3, 1, 1}; MPI_Datatype types[] {MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_DOUBLE, MPI_INT}; MPI_Type_create_struct(5, blocks, disp, types, &openmc::mpi::bank); MPI_Type_commit(&openmc::mpi::bank); } -#endif + +#endif // OPENMC_MPI +} // namespace openmc diff --git a/src/initialize.h b/src/initialize.h new file mode 100644 index 0000000000..430987038d --- /dev/null +++ b/src/initialize.h @@ -0,0 +1,14 @@ +#ifndef INITIALIZE_H +#define INITIALIZE_H + +#include "mpi.h" + +namespace openmc { + +#ifdef OPENMC_MPI + void initialize_mpi(MPI_Comm intracomm); +#endif + +} + +#endif // INITIALIZE_H diff --git a/src/main.cpp b/src/main.cpp index 2814b538f7..1dd20ebe04 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,9 @@ +#ifdef OPENMC_MPI +#include "mpi.h" +#endif #include "openmc.h" + int main(int argc, char** argv) { int err; diff --git a/src/message_passing.h b/src/message_passing.h index fea092c618..67353e23a1 100644 --- a/src/message_passing.h +++ b/src/message_passing.h @@ -1,6 +1,8 @@ #ifndef MESSAGE_PASSING_H #define MESSAGE_PASSING_H +#include "mpi.h" + namespace openmc { namespace mpi { diff --git a/src/mgxs_data.F90 b/src/mgxs_data.F90 index 1b14e6e9f0..e0631d16c5 100644 --- a/src/mgxs_data.F90 +++ b/src/mgxs_data.F90 @@ -132,6 +132,8 @@ contains ! Add name to dictionary call already_read % add(name) + call close_group(xsdata_group) + end if end do NUCLIDE_LOOP end do MATERIAL_LOOP @@ -159,6 +161,8 @@ contains end do NUCLIDE_LOOP2 end do MATERIAL_LOOP3 + call file_close(file_id) + end subroutine read_mgxs !=============================================================================== diff --git a/src/mgxs_header.F90 b/src/mgxs_header.F90 index e599a89ff3..76042703af 100644 --- a/src/mgxs_header.F90 +++ b/src/mgxs_header.F90 @@ -549,6 +549,8 @@ contains else call fatal_error("beta must be provided as a 1D or 2D array") end if + + call close_dataset(xsdata) else temp_beta = ZERO end if @@ -679,6 +681,8 @@ contains call fatal_error("nu-fission must be provided as a 1D or 2D & &array") end if + + call close_dataset(xsdata) end if ! If chi-prompt provided, set chi-prompt @@ -782,6 +786,8 @@ contains call fatal_error("chi-delayed must be provided as a 1D or 2D & &array") end if + + call close_dataset(xsdata) end if ! If prompt-nu-fission present, set prompt-nu-fission @@ -838,6 +844,8 @@ contains call fatal_error("prompt-nu-fission must be provided as a 1D & &or 2D array") end if + + call close_dataset(xsdata) end if ! If delayed-nu-fission provided, set delayed-nu-fission. If @@ -963,6 +971,8 @@ contains call fatal_error("delayed-nu-fission must be provided as a & &1D, 2D, or 3D array") end if + + call close_dataset(xsdata) end if ! Deallocate temporary beta array @@ -1346,6 +1356,8 @@ contains else call fatal_error("beta must be provided as a 3D or 4D array") end if + + call close_dataset(xsdata) else temp_beta = ZERO end if @@ -1517,6 +1529,8 @@ contains call fatal_error("nu-fission must be provided as a 3D or & &4D array") end if + + call close_dataset(xsdata) end if ! If chi-prompt provided, set chi-prompt @@ -1651,6 +1665,8 @@ contains call fatal_error("chi-delayed must be provided as a 3D or 4D & &array") end if + + call close_dataset(xsdata) end if ! If prompt-nu-fission present, set prompt-nu-fission @@ -1720,6 +1736,8 @@ contains call fatal_error("prompt-nu-fission must be provided as a 3D & &or 4D array") end if + + call close_dataset(xsdata) end if ! If delayed-nu-fission provided, set delayed-nu-fission. If @@ -1868,6 +1886,8 @@ contains call fatal_error("delayed-nu-fission must be provided as a & &3D, 4D, or 5D array") end if + + call close_dataset(xsdata) end if ! Deallocate temporary beta array diff --git a/src/source.F90 b/src/source.F90 index 59a117465c..b02430823b 100644 --- a/src/source.F90 +++ b/src/source.F90 @@ -63,7 +63,7 @@ contains end if ! Read in the source bank - call read_source_bank(file_id) + call read_source_bank(file_id, work_index, source_bank) ! Close file call file_close(file_id) diff --git a/src/state_point.F90 b/src/state_point.F90 index 181ab968b9..5b1c4d462a 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -13,8 +13,6 @@ module state_point use, intrinsic :: ISO_C_BINDING - use hdf5 - use bank_header, only: Bank use cmfd_header use constants @@ -45,6 +43,13 @@ module state_point integer(C_INT64_T), intent(in) :: work_index(*) type(Bank), intent(in) :: bank_(*) end subroutine write_source_bank + + subroutine read_source_bank(group_id, work_index, bank_) bind(C) + import HID_T, C_INT64_T, Bank + integer(HID_T), value :: group_id + integer(C_INT64_T), intent(in) :: work_index(*) + type(Bank), intent(out) :: bank_(*) + end subroutine read_source_bank end interface contains @@ -832,7 +837,7 @@ contains end if ! Write out source - call read_source_bank(file_id) + call read_source_bank(file_id, work_index, source_bank) end if @@ -841,66 +846,4 @@ contains end subroutine load_state_point -!=============================================================================== -! READ_SOURCE_BANK reads OpenMC source_bank data -!=============================================================================== - - subroutine read_source_bank(group_id) - integer(HID_T), intent(in) :: group_id - - integer :: hdf5_err - integer(HID_T) :: dset ! data set handle - integer(HID_T) :: dspace ! data space handle - integer(HID_T) :: memspace ! memory space handle - integer(HSIZE_T) :: dims(1) ! dimensions on one processor - integer(HSIZE_T) :: dims_all(1) ! overall dimensions - integer(HSIZE_T) :: maxdims(1) ! maximum dimensions - integer(HSIZE_T) :: offset(1) ! offset of data - type(c_ptr) :: f_ptr -#ifdef PHDF5 - integer(HID_T) :: plist ! property list -#endif - - ! Open the dataset - call h5dopen_f(group_id, "source_bank", dset, hdf5_err) - - ! Create another data space but for each proc individually - dims(1) = work - call h5screate_simple_f(1, dims, memspace, hdf5_err) - - ! Make sure source bank is big enough - call h5dget_space_f(dset, dspace, hdf5_err) - call h5sget_simple_extent_dims_f(dspace, dims_all, maxdims, hdf5_err) - if (size(source_bank, KIND=HSIZE_T) > dims_all(1)) then - call fatal_error("Number of source sites in source file is less than & - &number of source particles per generation.") - end if - - ! Select hyperslab for each process - offset(1) = work_index(rank) - call h5sselect_hyperslab_f(dspace, H5S_SELECT_SET_F, offset, dims, hdf5_err) - - ! Set up pointer to data - f_ptr = c_loc(source_bank) - -#ifdef PHDF5 - ! Read data in parallel - call h5pcreate_f(H5P_DATASET_XFER_F, plist, hdf5_err) - call h5pset_dxpl_mpio_f(plist, H5FD_MPIO_COLLECTIVE_F, hdf5_err) - call h5dread_f(dset, hdf5_bank_t, f_ptr, hdf5_err, & - file_space_id=dspace, mem_space_id=memspace, & - xfer_prp=plist) - call h5pclose_f(plist, hdf5_err) -#else - call h5dread_f(dset, hdf5_bank_t, f_ptr, hdf5_err, & - file_space_id=dspace, mem_space_id=memspace) -#endif - - ! Close all ids - call h5sclose_f(dspace, hdf5_err) - call h5sclose_f(memspace, hdf5_err) - call h5dclose_f(dset, hdf5_err) - - end subroutine read_source_bank - end module state_point diff --git a/src/state_point.cpp b/src/state_point.cpp index 20338c4be5..cc6aa2a41d 100644 --- a/src/state_point.cpp +++ b/src/state_point.cpp @@ -4,14 +4,14 @@ #include #include "mpi.h" +#include "error.h" #include "message_passing.h" #include "openmc.h" namespace openmc { -void -write_source_bank(hid_t group_id, int64_t* work_index, const Bank* source_bank) -{ + +hid_t h5banktype() { // Create type for array of 3 reals hsize_t dims[] {3}; hid_t triplet = H5Tarray_create(H5T_NATIVE_DOUBLE, 1, dims); @@ -24,31 +24,41 @@ write_source_bank(hid_t group_id, int64_t* work_index, const Bank* source_bank) H5Tinsert(banktype, "E", HOFFSET(Bank, E), H5T_NATIVE_DOUBLE); H5Tinsert(banktype, "delayed_group", HOFFSET(Bank, delayed_group), H5T_NATIVE_INT); + H5Tclose(triplet); + return banktype; +} + + +void +write_source_bank(hid_t group_id, int64_t* work_index, const Bank* source_bank) +{ + hid_t banktype = h5banktype(); + #ifdef PHDF5 // Set size of total dataspace for all procs and rank - dims[0] = n_particles; + hsize_t dims[] {static_cast(n_particles)}; hid_t dspace = H5Screate_simple(1, dims, H5P_DEFAULT); hid_t dset = H5Dcreate(group_id, "source_bank", banktype, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); // Create another data space but for each proc individually - hsize_t count[] {openmc_work}; + hsize_t count[] {static_cast(openmc_work)}; hid_t memspace = H5Screate_simple(1, count, H5P_DEFAULT); // Select hyperslab for this dataspace - hsize_t start[] {work_index[openmc::mpi::rank]}; + hsize_t start[] {static_cast(work_index[openmc::mpi::rank])}; H5Sselect_hyperslab(dspace, H5S_SELECT_SET, start, nullptr, count, nullptr); // Set up the property list for parallel writing hid_t plist = H5Pcreate(H5P_DATASET_XFER); - H5Pset_dxpl_mpio_f(plist, H5FD_MPIO_COLLECTIVE); + H5Pset_dxpl_mpio(plist, H5FD_MPIO_COLLECTIVE); // Write data to file in parallel - H5Dwrite(dset, banktype, memspace, dspace, memspace, plist, source_bank); + H5Dwrite(dset, banktype, memspace, dspace, plist, source_bank); // Free resources H5Sclose(dspace); - h5sclose(memspace); + H5Sclose(memspace); H5Dclose(dset); H5Pclose(plist); @@ -106,7 +116,48 @@ write_source_bank(hid_t group_id, int64_t* work_index, const Bank* source_bank) #endif H5Tclose(banktype); - H5Tclose(triplet); +} + + +void read_source_bank(hid_t group_id, int64_t* work_index, struct Bank* source_bank) +{ + hid_t banktype = h5banktype(); + + // Open the dataset + hid_t dset = H5Dopen(group_id, "source_bank", H5P_DEFAULT); + + // Create another data space but for each proc individually + hsize_t dims[] {static_cast(openmc_work)}; + hid_t memspace = H5Screate_simple(1, dims, H5P_DEFAULT); + + // Make sure source bank is big enough + hid_t dspace = H5Dget_space(dset); + hsize_t dims_all[1]; + H5Sget_simple_extent_dims(dspace, dims_all, nullptr); + if (work_index[openmc::mpi::n_procs] > dims_all[0]) { + fatal_error("Number of source sites in source file is less " + "than number of source particles per generation."); + } + + // Select hyperslab for each process + hsize_t start[] {static_cast(work_index[openmc::mpi::rank])}; + H5Sselect_hyperslab(dspace, H5S_SELECT_SET, start, nullptr, dims, nullptr); + +#ifdef PHDF5 + // Read data in parallel + hid_t plist = H5Pcreate(H5P_DATASET_XFER); + H5Pset_dxpl_mpio(plist, H5FD_MPIO_COLLECTIVE); + H5Dread(dset, banktype, memspace, dspace, plist, source_bank); + H5Pclose(plist); +#else + H5Dread(dset, banktype, memspace, dspace, H5P_DEFAULT, source_bank); +#endif + + // Close all ids + H5Sclose(dspace); + H5Sclose(memspace); + H5Dclose(dset); + H5Tclose(banktype); } } // namespace openmc diff --git a/src/state_point.h b/src/state_point.h index f0dafdb809..34186d0d97 100644 --- a/src/state_point.h +++ b/src/state_point.h @@ -9,7 +9,9 @@ namespace openmc { extern "C" void write_source_bank(hid_t group_id, int64_t* work_index, - const struct Bank* bank); + const struct Bank* source_bank); +extern "C" void read_source_bank(hid_t group_id, int64_t* work_index, + struct Bank* source_bank); } // namespace openmc #endif // STATE_POINT_H From 73b50e1e173ffca3a528774923627052149e7d5f Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 20 Apr 2018 14:02:48 -0500 Subject: [PATCH 205/231] Make sure statepoint context manager closes linked summary --- openmc/statepoint.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openmc/statepoint.py b/openmc/statepoint.py index eb011d8742..3b878e9a37 100644 --- a/openmc/statepoint.py +++ b/openmc/statepoint.py @@ -150,6 +150,8 @@ class StatePoint(object): def __exit__(self, *exc): self._f.close() + if self._summary is not None: + self._summary._f.close() @property def cmfd_on(self): From d8c30b7f6211bf613bf81eb98052e0b78d06de6f Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 20 Apr 2018 14:07:14 -0500 Subject: [PATCH 206/231] Get rid of most of hdf5_initialize (no longer needed) --- src/api.F90 | 5 +---- src/hdf5_interface.F90 | 3 --- src/initialize.F90 | 44 ++++-------------------------------------- 3 files changed, 5 insertions(+), 47 deletions(-) diff --git a/src/api.F90 b/src/api.F90 index 03ea9bff06..32077c5657 100644 --- a/src/api.F90 +++ b/src/api.F90 @@ -2,7 +2,7 @@ module openmc_api use, intrinsic :: ISO_C_BINDING - use hdf5, only: HID_T, h5tclose_f, h5close_f + use hdf5, only: h5close_f use bank_header, only: openmc_source_bank use constants, only: K_BOLTZMANN @@ -169,9 +169,6 @@ contains ! Deallocate arrays call free_memory() - ! Release compound datatypes - call h5tclose_f(hdf5_bank_t, err) - ! Close FORTRAN interface. call h5close_f(err) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index d76f7b6b71..70b624b4fe 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -24,9 +24,6 @@ module hdf5_interface implicit none private - integer(HID_T), public :: hdf5_bank_t ! Compound type for Bank - integer(HID_T), public :: hdf5_integer8_t ! type for integer(8) - interface write_dataset module procedure write_double_0D module procedure write_double_1D diff --git a/src/initialize.F90 b/src/initialize.F90 index 7b8f37dee6..7a43c9381d 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -13,8 +13,7 @@ module initialize use error, only: fatal_error, warning, write_message use geometry_header, only: Cell, Universe, Lattice, RectLattice, HexLattice,& root_universe - use hdf5_interface, only: file_open, read_attribute, file_close, & - hdf5_bank_t, hdf5_integer8_t + use hdf5_interface, only: file_open, read_attribute, file_close use input_xml, only: read_input_xml use material_header, only: Material use message_passing @@ -45,6 +44,7 @@ contains integer, intent(in), optional :: intracomm ! MPI intracommunicator integer(C_INT) :: err + integer :: hdf5_err #ifdef _OPENMP character(MAX_WORD_LEN) :: envvar #endif @@ -87,8 +87,8 @@ contains end if #endif - ! Initialize HDF5 interface - call hdf5_initialize() + ! Initialize HDF5 Fortran interface. + call h5open_f(hdf5_err) ! Read command line arguments call read_command_line() @@ -160,42 +160,6 @@ contains end subroutine initialize_mpi #endif -!=============================================================================== -! HDF5_INITIALIZE -!=============================================================================== - - subroutine hdf5_initialize() - - type(Bank), target :: tmpb(2) ! temporary Bank - integer :: hdf5_err - integer(HID_T) :: coordinates_t ! HDF5 type for 3 reals - integer(HSIZE_T) :: dims(1) = (/3/) ! size of coordinates - - ! Initialize FORTRAN interface. - call h5open_f(hdf5_err) - - ! Create compound type for xyz and uvw - call h5tarray_create_f(H5T_NATIVE_DOUBLE, 1, dims, coordinates_t, hdf5_err) - - ! Create the compound datatype for Bank - call h5tcreate_f(H5T_COMPOUND_F, h5offsetof(c_loc(tmpb(1)), & - c_loc(tmpb(2))), hdf5_bank_t, hdf5_err) - call h5tinsert_f(hdf5_bank_t, "wgt", h5offsetof(c_loc(tmpb(1)), & - c_loc(tmpb(1)%wgt)), H5T_NATIVE_DOUBLE, hdf5_err) - call h5tinsert_f(hdf5_bank_t, "xyz", h5offsetof(c_loc(tmpb(1)), & - c_loc(tmpb(1)%xyz)), coordinates_t, hdf5_err) - call h5tinsert_f(hdf5_bank_t, "uvw", h5offsetof(c_loc(tmpb(1)), & - c_loc(tmpb(1)%uvw)), coordinates_t, hdf5_err) - call h5tinsert_f(hdf5_bank_t, "E", h5offsetof(c_loc(tmpb(1)), & - c_loc(tmpb(1)%E)), H5T_NATIVE_DOUBLE, hdf5_err) - call h5tinsert_f(hdf5_bank_t, "delayed_group", h5offsetof(c_loc(tmpb(1)), & - c_loc(tmpb(1)%delayed_group)), H5T_NATIVE_INTEGER, hdf5_err) - - ! Determine type for integer(8) - hdf5_integer8_t = h5kind_to_type(8, H5_INTEGER_KIND) - - end subroutine hdf5_initialize - !=============================================================================== ! READ_COMMAND_LINE reads all parameters from the command line !=============================================================================== From 3290c410a8df12e76c7852644dda4e73be7907f6 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 20 Apr 2018 14:55:06 -0500 Subject: [PATCH 207/231] Fix bugs for MPI/non-PHDF5 runs --- src/initialize.h | 2 ++ src/message_passing.h | 2 ++ src/state_point.cpp | 10 ++++++---- src/state_point.h | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/initialize.h b/src/initialize.h index 430987038d..d2c4df5d79 100644 --- a/src/initialize.h +++ b/src/initialize.h @@ -1,7 +1,9 @@ #ifndef INITIALIZE_H #define INITIALIZE_H +#ifdef OPENMC_MPI #include "mpi.h" +#endif namespace openmc { diff --git a/src/message_passing.h b/src/message_passing.h index 67353e23a1..14cf3a7cb0 100644 --- a/src/message_passing.h +++ b/src/message_passing.h @@ -1,7 +1,9 @@ #ifndef MESSAGE_PASSING_H #define MESSAGE_PASSING_H +#ifdef OPENMC_MPI #include "mpi.h" +#endif namespace openmc { namespace mpi { diff --git a/src/state_point.cpp b/src/state_point.cpp index cc6aa2a41d..2ea9d1c43c 100644 --- a/src/state_point.cpp +++ b/src/state_point.cpp @@ -3,7 +3,9 @@ #include #include +#ifdef OPENMC_MPI #include "mpi.h" +#endif #include "error.h" #include "message_passing.h" #include "openmc.h" @@ -30,7 +32,7 @@ hid_t h5banktype() { void -write_source_bank(hid_t group_id, int64_t* work_index, const Bank* source_bank) +write_source_bank(hid_t group_id, int64_t* work_index, Bank* source_bank) { hid_t banktype = h5banktype(); @@ -73,7 +75,7 @@ write_source_bank(hid_t group_id, int64_t* work_index, const Bank* source_bank) // Save source bank sites since the souce_bank array is overwritten below #ifdef OPENMC_MPI - std::vector temp_source {source_bank, source_bank + openmc_work}; + std::vector temp_source {source_bank, source_bank + openmc_work}; #endif for (int i = 0; i < openmc::mpi::n_procs; ++i) { @@ -110,7 +112,7 @@ write_source_bank(hid_t group_id, int64_t* work_index, const Bank* source_bank) } else { #ifdef OPENMC_MPI MPI_Send(source_bank, openmc_work, openmc::mpi::bank, 0, openmc::mpi::rank, - openmc::mpi::mpi_intracomm); + openmc::mpi::intracomm); #endif } #endif @@ -119,7 +121,7 @@ write_source_bank(hid_t group_id, int64_t* work_index, const Bank* source_bank) } -void read_source_bank(hid_t group_id, int64_t* work_index, struct Bank* source_bank) +void read_source_bank(hid_t group_id, int64_t* work_index, Bank* source_bank) { hid_t banktype = h5banktype(); diff --git a/src/state_point.h b/src/state_point.h index 34186d0d97..459df1a675 100644 --- a/src/state_point.h +++ b/src/state_point.h @@ -9,9 +9,9 @@ namespace openmc { extern "C" void write_source_bank(hid_t group_id, int64_t* work_index, - const struct Bank* source_bank); + Bank* source_bank); extern "C" void read_source_bank(hid_t group_id, int64_t* work_index, - struct Bank* source_bank); + Bank* source_bank); } // namespace openmc #endif // STATE_POINT_H From 70173aa25c1de99b8e5127003a1e1fcb7007099d Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 24 Apr 2018 06:42:43 -0500 Subject: [PATCH 208/231] Install openmc.h header properly --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b750a6dd3..ed9021cf48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -443,7 +443,9 @@ set(LIBOPENMC_CXX_SRC src/xml_interface.cpp src/pugixml/pugixml.cpp) add_library(libopenmc SHARED ${LIBOPENMC_FORTRAN_SRC} ${LIBOPENMC_CXX_SRC}) -set_target_properties(libopenmc PROPERTIES OUTPUT_NAME openmc) +set_target_properties(libopenmc PROPERTIES + OUTPUT_NAME openmc + PUBLIC_HEADER include/openmc.h) add_executable(${program} src/main.cpp) #=============================================================================== @@ -501,7 +503,9 @@ add_custom_command(TARGET libopenmc POST_BUILD install(TARGETS ${program} libopenmc RUNTIME DESTINATION bin LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) + ARCHIVE DESTINATION lib + PUBLIC_HEADER DESTINATION include + ) install(DIRECTORY src/relaxng DESTINATION share/openmc) install(FILES man/man1/openmc.1 DESTINATION share/man/man1) install(FILES LICENSE DESTINATION "share/doc/${program}" RENAME copyright) From 1a77f8afee8f671cf51a4b6f81681f2c66845ba5 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 24 Apr 2018 15:25:58 -0500 Subject: [PATCH 209/231] Add C++ routines for HDF5 get_groups, get_datasets, get_name --- src/hdf5_interface.F90 | 123 ++++++++++++++++++---------------- src/hdf5_interface.cpp | 147 +++++++++++++++++++++++++++++++++++------ src/hdf5_interface.h | 9 ++- 3 files changed, 201 insertions(+), 78 deletions(-) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 70b624b4fe..077807c04f 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -13,13 +13,12 @@ module hdf5_interface use, intrinsic :: ISO_C_BINDING use hdf5 - use h5lt use error, only: fatal_error #ifdef PHDF5 use message_passing, only: mpi_intracomm, MPI_INFO_NULL #endif - use string, only: to_c_string + use string, only: to_c_string, to_f_string implicit none private @@ -316,31 +315,37 @@ contains integer(HID_T), intent(in) :: object_id character(len=150), allocatable, intent(out) :: names(:) - integer :: n_members, i, group_count, type - integer :: hdf5_err - character(len=150) :: name + integer :: i + integer(C_INT) :: n + character(len=150,kind=C_CHAR), target, allocatable :: names_(:) + type(C_PTR), allocatable :: name_ptrs(:) - ! Get number of members in this location - call h5gn_members_f(object_id, './', n_members, hdf5_err) + interface + function get_num_groups(group_id) result(n) bind(C) + import HID_T, C_INT + integer(HID_T), value :: group_id + integer(C_INT) :: n + end function get_num_groups + subroutine get_groups_c(group_id, name) bind(C, name='get_groups') + import HID_T, C_PTR + integer(HID_T), value :: group_id + type(C_PTR) :: name(*) + end subroutine get_groups_c + end interface - ! Get the number of groups - group_count = 0 - do i = 0, n_members - 1 - call h5gget_obj_info_idx_f(object_id, "./", i, name, type, hdf5_err) - if (type == H5G_GROUP_F) then - group_count = group_count + 1 - end if + ! Determine number of groups and allocate + n = get_num_groups(object_id) + allocate(names(n), names_(n), name_ptrs(n)) + + ! Set C pointers to beginning of each string + do i = 1, size(names) + name_ptrs(i) = c_loc(names_(i)) end do - ! Now we can allocate the storage for the ids - allocate(names(group_count)) - group_count = 0 - do i = 0, n_members - 1 - call h5gget_obj_info_idx_f(object_id, "./", i, name, type, hdf5_err) - if (type == H5G_GROUP_F) then - group_count = group_count + 1 - names(group_count) = trim(name) - end if + ! Get names of groups and copy to Fortran strings + call get_groups_c(object_id, name_ptrs) + do i = 1, size(names) + names(i) = to_f_string(names_(i)) end do end subroutine get_groups @@ -398,32 +403,37 @@ contains integer(HID_T), intent(in) :: object_id character(len=150), allocatable, intent(out) :: names(:) - integer :: n_members, i, dset_count, type - integer :: hdf5_err - character(len=150) :: name + integer :: i + integer(C_INT) :: n + character(len=150,kind=C_CHAR), target, allocatable :: names_(:) + type(C_PTR), allocatable :: name_ptrs(:) + interface + function get_num_datasets(group_id) result(n) bind(C) + import HID_T, C_INT + integer(HID_T), value :: group_id + integer(C_INT) :: n + end function get_num_datasets + subroutine get_datasets_c(group_id, name) bind(C, name='get_datasets') + import HID_T, C_PTR + integer(HID_T), value :: group_id + type(C_PTR) :: name(*) + end subroutine get_datasets_c + end interface - ! Get number of members in this location - call h5gn_members_f(object_id, './', n_members, hdf5_err) + ! Determine number of datasets and allocate + n = get_num_datasets(object_id) + allocate(names(n), names_(n), name_ptrs(n)) - ! Get the number of datasets - dset_count = 0 - do i = 0, n_members - 1 - call h5gget_obj_info_idx_f(object_id, "./", i, name, type, hdf5_err) - if (type == H5G_DATASET_F ) then - dset_count = dset_count + 1 - end if + ! Set C pointers to beginning of each string + do i = 1, size(names) + name_ptrs(i) = c_loc(names_(i)) end do - ! Now we can allocate the storage for the ids - allocate(names(dset_count)) - dset_count = 0 - do i = 0, n_members - 1 - call h5gget_obj_info_idx_f(object_id, "./", i, name, type, hdf5_err) - if (type == H5G_DATASET_F ) then - dset_count = dset_count + 1 - names(dset_count) = trim(name) - end if + ! Get names of datasets and copy to Fortran strings + call get_datasets_c(object_id, name_ptrs) + do i = 1, size(names) + names(i) = to_f_string(names_(i)) end do end subroutine get_datasets @@ -432,21 +442,22 @@ contains ! GET_NAME Obtains the name of the current group in group_id !=============================================================================== - function get_name(group_id, name_len_) result(name) - integer(HID_T), intent(in) :: group_id + function get_name(object_id, name_len_) result(name) + integer(HID_T), intent(in) :: object_id integer(SIZE_T), optional, intent(in) :: name_len_ - character(len=150) :: name ! name of group - integer(SIZE_T) :: name_len, name_file_len - integer :: hdf5_err ! HDF5 error code + character(150) :: name ! name of object + character(kind=C_CHAR) :: name_(150) + interface + subroutine get_name_c(obj_id, name) bind(C, name='get_name') + import HID_T, C_CHAR + integer(HID_T), value :: obj_id + character(kind=C_CHAR), intent(out) :: name(*) + end subroutine get_name_c + end interface - if (present(name_len_)) then - name_len = name_len_ - else - name_len = 150 - end if - - call h5iget_name_f(group_id, name, name_len, name_file_len, hdf5_err) + call get_name_c(object_id, name_) + name = to_f_string(name_) end function get_name !=============================================================================== diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index d81c5b34a8..e4db2ee58a 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -36,26 +36,6 @@ attribute_typesize(hid_t obj_id, const char* name) } -bool -using_mpio_device(hid_t obj_id) -{ - // Determine file that this object is part of - hid_t file_id = H5Iget_file_id(obj_id); - - // Get file access property list - hid_t fapl_id = H5Fget_access_plist(file_id); - - // Get low-level driver identifier - hid_t driver = H5Pget_driver(fapl_id); - - // Free resources - H5Pclose(fapl_id); - H5Fclose(file_id); - - return driver == H5FD_MPIO; -} - - void get_shape(hid_t obj_id, hsize_t* dims) { @@ -199,6 +179,113 @@ void file_close(hid_t file_id) H5Fclose(file_id); } + +void +get_name(hid_t obj_id, char* name) +{ + size_t size = 1 + H5Iget_name(obj_id, nullptr, 0); + H5Iget_name(obj_id, name, size); +} + + +int get_num_datasets(hid_t group_id) +{ + // Determine number of links in the group + H5G_info_t info; + H5Gget_info(group_id, &info); + + // Iterate over links to get number of groups + H5O_info_t oinfo; + int ndatasets = 0; + for (hsize_t i = 0; i < info.nlinks; ++i) { + // Determine type of object (and skip non-group) + H5Oget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, i, &oinfo, + H5P_DEFAULT); + if (oinfo.type == H5O_TYPE_DATASET) ndatasets += 1; + } + + return ndatasets; +} + + +int get_num_groups(hid_t group_id) +{ + // Determine number of links in the group + H5G_info_t info; + H5Gget_info(group_id, &info); + + // Iterate over links to get number of groups + H5O_info_t oinfo; + int ngroups = 0; + for (hsize_t i = 0; i < info.nlinks; ++i) { + // Determine type of object (and skip non-group) + H5Oget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, i, &oinfo, + H5P_DEFAULT); + if (oinfo.type == H5O_TYPE_GROUP) ngroups += 1; + } + + return ngroups; +} + + +void +get_datasets(hid_t group_id, char* name[]) +{ + // Determine number of links in the group + H5G_info_t info; + H5Gget_info(group_id, &info); + + // Iterate over links to get names + H5O_info_t oinfo; + hsize_t count = 0; + size_t size; + for (hsize_t i = 0; i < info.nlinks; ++i) { + // Determine type of object (and skip non-group) + H5Oget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, i, &oinfo, + H5P_DEFAULT); + if (oinfo.type != H5O_TYPE_DATASET) continue; + + // Get size of name + size = 1 + H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, + i, nullptr, 0, H5P_DEFAULT); + + // Read name + H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, i, + name[count], size, H5P_DEFAULT); + count += 1; + } +} + + +void +get_groups(hid_t group_id, char* name[]) +{ + // Determine number of links in the group + H5G_info_t info; + H5Gget_info(group_id, &info); + + // Iterate over links to get names + H5O_info_t oinfo; + hsize_t count = 0; + size_t size; + for (hsize_t i = 0; i < info.nlinks; ++i) { + // Determine type of object (and skip non-group) + H5Oget_info_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, i, &oinfo, + H5P_DEFAULT); + if (oinfo.type != H5O_TYPE_GROUP) continue; + + // Get size of name + size = 1 + H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, + i, nullptr, 0, H5P_DEFAULT); + + // Read name + H5Lget_name_by_idx(group_id, ".", H5_INDEX_NAME, H5_ITER_INC, i, + name[count], size, H5P_DEFAULT); + count += 1; + } +} + + bool object_exists(hid_t object_id, const char* name) { @@ -548,4 +635,24 @@ write_tally_results(hid_t group_id, hsize_t n_filter, hsize_t n_score, const dou H5Sclose(dspace); } + +bool +using_mpio_device(hid_t obj_id) +{ + // Determine file that this object is part of + hid_t file_id = H5Iget_file_id(obj_id); + + // Get file access property list + hid_t fapl_id = H5Fget_access_plist(file_id); + + // Get low-level driver identifier + hid_t driver = H5Pget_driver(fapl_id); + + // Free resources + H5Pclose(fapl_id); + H5Fclose(file_id); + + return driver == H5FD_MPIO; +} + } // namespace openmc diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index 57f56f5c20..9a8b3c569d 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -23,8 +23,13 @@ extern "C" size_t dataset_typesize(hid_t dset); extern "C" hid_t file_open(const char* filename, char mode, bool parallel); hid_t file_open(const std::string& filename, char mode, bool parallel); extern "C" void file_close(hid_t file_id); -extern "C" void get_shape(hid_t obj_if, hsize_t* dims); -extern "C" void get_shape_attr(hid_t obj_if, const char* name, hsize_t* dims); +extern "C" void get_name(hid_t obj_id, char* name); +extern "C" int get_num_datasets(hid_t group_id); +extern "C" int get_num_groups(hid_t group_id); +extern "C" void get_datasets(hid_t group_id, char* name[]); +extern "C" void get_groups(hid_t group_id, char* name[]); +extern "C" void get_shape(hid_t obj_id, hsize_t* dims); +extern "C" void get_shape_attr(hid_t obj_id, const char* name, hsize_t* dims); extern "C" bool object_exists(hid_t object_id, const char* name); extern "C" hid_t open_dataset(hid_t group_id, const char* name); extern "C" hid_t open_group(hid_t group_id, const char* name); From 279562c32afed79f4b45eefdd69b3d67a8dc372d Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 24 Apr 2018 15:45:21 -0500 Subject: [PATCH 210/231] Make sure rank/nprocs is set for serial runs --- src/message_passing.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/message_passing.cpp b/src/message_passing.cpp index 3ab96ffd87..2ff3952d73 100644 --- a/src/message_passing.cpp +++ b/src/message_passing.cpp @@ -3,8 +3,8 @@ namespace openmc { namespace mpi { -int rank; -int n_procs; +int rank {0}; +int n_procs {1}; #ifdef OPENMC_MPI MPI_Comm intracomm; From 3acec3c093bf0bb4c90b6de1963ad4e4d1d61d46 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 24 Apr 2018 22:42:04 -0500 Subject: [PATCH 211/231] Call HDF5 routines from C++ side for voxel plots --- CMakeLists.txt | 1 + src/plot.F90 | 62 +++++++++++++++++++++++++++----------------------- src/plot.cpp | 42 ++++++++++++++++++++++++++++++++++ src/plot.h | 15 ++++++++++++ 4 files changed, 91 insertions(+), 29 deletions(-) create mode 100644 src/plot.cpp create mode 100644 src/plot.h diff --git a/CMakeLists.txt b/CMakeLists.txt index ed9021cf48..5c6636cbce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -436,6 +436,7 @@ set(LIBOPENMC_CXX_SRC src/initialize.cpp src/hdf5_interface.cpp src/message_passing.cpp + src/plot.cpp src/random_lcg.cpp src/simulation.cpp src/state_point.cpp diff --git a/src/plot.F90 b/src/plot.F90 index 92b8f350df..c2ffa2d39c 100644 --- a/src/plot.F90 +++ b/src/plot.F90 @@ -2,8 +2,6 @@ module plot use, intrinsic :: ISO_C_BINDING - use hdf5 - use constants use error, only: fatal_error, write_message use geometry, only: find_cell, check_cell_overlap @@ -340,23 +338,46 @@ contains subroutine create_voxel(pl) type(ObjectPlot), intent(in) :: pl - integer :: x, y, z ! voxel location indices + integer(C_INT) :: x, y, z ! voxel location indices integer :: rgb(3) ! colors (red, green, blue) from 0-255 integer :: id ! id of cell or material - integer :: hdf5_err - integer, target :: data(pl%pixels(3),pl%pixels(2)) + integer(C_INT), target :: data(pl%pixels(3),pl%pixels(2)) integer(HID_T) :: file_id integer(HID_T) :: dspace integer(HID_T) :: memspace integer(HID_T) :: dset integer(HSIZE_T) :: dims(3) - integer(HSIZE_T) :: dims_slab(3) - integer(HSIZE_T) :: offset(3) real(8) :: vox(3) ! x, y, and z voxel widths real(8) :: ll(3) ! lower left starting point for each sweep direction type(Particle) :: p type(ProgressBar) :: progress - type(c_ptr) :: f_ptr + + interface + subroutine voxel_init(file_id, dims, dspace, dset, memspace) bind(C) + import HID_T, HSIZE_T + integer(HID_T), value :: file_id + integer(HSIZE_T), intent(in) :: dims(*) + integer(HID_T), intent(out) :: dspace + integer(HID_T), intent(out) :: dset + integer(HID_T), intent(out) :: memspace + end subroutine voxel_init + + subroutine voxel_write_slice(x, dspace, dset, memspace, buf) bind(C) + import C_INT, HID_T, C_PTR + integer(C_INT), value :: x + integer(HID_T), value :: dspace + integer(HID_T), value :: dset + integer(HID_T), value :: memspace + type(C_PTR), value :: buf + end subroutine voxel_write_slice + + subroutine voxel_finalize(dspace, dset, memspace) bind(C) + import HID_T + integer(HID_T), value :: dspace + integer(HID_T), value :: dset + integer(HID_T), value :: memspace + end subroutine voxel_finalize + end interface ! compute voxel widths in each direction vox = pl % width/dble(pl % pixels) @@ -390,20 +411,8 @@ contains ! Create dataset for voxel data -- note that the dimensions are reversed ! since we want the order in the file to be z, y, x - dims(:) = [pl%pixels(3), pl%pixels(2), pl%pixels(1)] - call h5screate_simple_f(3, dims, dspace, hdf5_err) - call h5dcreate_f(file_id, "data", H5T_NATIVE_INTEGER, dspace, dset, hdf5_err) - - ! Create another dataspace for 2D array in memory - dims_slab(1) = pl%pixels(3) - dims_slab(2) = pl%pixels(2) - dims_slab(3) = 1 - call h5screate_simple_f(2, dims_slab(1:2), memspace, hdf5_err) - - ! Initialize offset and get pointer to data - offset(:) = 0 - call h5sselect_hyperslab_f(dspace, H5S_SELECT_SET_F, offset, dims_slab, hdf5_err) - f_ptr = c_loc(data) + dims(:) = pl % pixels + call voxel_init(file_id, dims, dspace, dset, memspace) ! move to center of voxels ll = ll + vox / TWO @@ -433,15 +442,10 @@ contains p % coord(1) % xyz(3) = ll(3) ! Write to HDF5 dataset - offset(3) = x - 1 - call h5soffset_simple_f(dspace, offset, hdf5_err) - call h5dwrite_f(dset, H5T_NATIVE_INTEGER, f_ptr, hdf5_err, & - mem_space_id=memspace, file_space_id=dspace) + call voxel_write_slice(x, dspace, dset, memspace, c_loc(data)) end do - call h5dclose_f(dset, hdf5_err) - call h5sclose_f(dspace, hdf5_err) - call h5sclose_f(memspace, hdf5_err) + call voxel_finalize(dspace, dset, memspace) call file_close(file_id) end subroutine create_voxel diff --git a/src/plot.cpp b/src/plot.cpp new file mode 100644 index 0000000000..0dca6d08cd --- /dev/null +++ b/src/plot.cpp @@ -0,0 +1,42 @@ +#include "plot.h" + +namespace openmc { + +void +voxel_init(hid_t file_id, const hsize_t* dims, hid_t* dspace, hid_t* dset, + hid_t* memspace) +{ + // Create dataspace/dataset for voxel data + *dspace = H5Screate_simple(3, dims, nullptr); + *dset = H5Dcreate(file_id, "data", H5T_NATIVE_INT, *dspace, H5P_DEFAULT, + H5P_DEFAULT, H5P_DEFAULT); + + // Create dataspace for a slice of the voxel + hsize_t dims_slice[2] {dims[1], dims[2]}; + *memspace = H5Screate_simple(2, dims_slice, nullptr); + + // Select hyperslab in dataspace + hsize_t start[3] {0, 0, 0}; + hsize_t count[3] {1, dims[1], dims[2]}; + H5Sselect_hyperslab(*dspace, H5S_SELECT_SET, start, nullptr, count, nullptr); +} + + +void +voxel_write_slice(int x, hid_t dspace, hid_t dset, hid_t memspace, void* buf) +{ + hssize_t offset[3] {x - 1, 0, 0}; + H5Soffset_simple(dspace, offset); + H5Dwrite(dset, H5T_NATIVE_INT, memspace, dspace, H5P_DEFAULT, buf); +} + + +void +voxel_finalize(hid_t dspace, hid_t dset, hid_t memspace) +{ + H5Dclose(dset); + H5Sclose(dspace); + H5Sclose(memspace); +} + +} // namespace openmc diff --git a/src/plot.h b/src/plot.h new file mode 100644 index 0000000000..75406b9ace --- /dev/null +++ b/src/plot.h @@ -0,0 +1,15 @@ +#ifndef PLOT_H +#define PLOT_H + +#include "hdf5.h" + +namespace openmc { + +extern "C" void voxel_init(hid_t file_id, const hsize_t* dims, hid_t* dspace, + hid_t* dset, hid_t* memspace); +extern "C" void voxel_write_slice(int x, hid_t dspace, hid_t dset, + hid_t memspace, void* buf); +extern "C" void voxel_finalize(hid_t dspace, hid_t dset, hid_t memspace); + +} // namespace openmc +#endif // PLOT_H From 36dc4a59b14d6d3b0450d53d434b73d5adf64ea2 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 24 Apr 2018 23:03:21 -0500 Subject: [PATCH 212/231] Remove remaining dependencies on Fortran HDF5 interface --- CMakeLists.txt | 2 +- src/api.F90 | 5 ----- src/hdf5_interface.F90 | 11 +++++------ src/initialize.F90 | 6 +----- src/mgxs_header.F90 | 4 +--- src/nuclide_header.F90 | 4 +--- src/sab_header.F90 | 4 +--- 7 files changed, 10 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c6636cbce..ed72434d80 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,7 @@ if(NOT DEFINED HDF5_PREFER_PARALLEL) endif() endif() -find_package(HDF5 COMPONENTS Fortran_HL) +find_package(HDF5 COMPONENTS HL) if(NOT HDF5_FOUND) message(FATAL_ERROR "Could not find HDF5") endif() diff --git a/src/api.F90 b/src/api.F90 index 32077c5657..d00d166c42 100644 --- a/src/api.F90 +++ b/src/api.F90 @@ -2,8 +2,6 @@ module openmc_api use, intrinsic :: ISO_C_BINDING - use hdf5, only: h5close_f - use bank_header, only: openmc_source_bank use constants, only: K_BOLTZMANN use eigenvalue, only: k_sum, openmc_get_keff @@ -169,9 +167,6 @@ contains ! Deallocate arrays call free_memory() - ! Close FORTRAN interface. - call h5close_f(err) - #ifdef OPENMC_MPI ! Free all MPI types call MPI_TYPE_FREE(MPI_BANK, err) diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 077807c04f..57138c377a 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -12,8 +12,6 @@ module hdf5_interface use, intrinsic :: ISO_C_BINDING - use hdf5 - use error, only: fatal_error #ifdef PHDF5 use message_passing, only: mpi_intracomm, MPI_INFO_NULL @@ -94,7 +92,9 @@ module hdf5_interface public :: get_groups public :: get_datasets public :: get_name - public :: HID_T, HSIZE_T, SIZE_T + + integer, public, parameter :: HID_T = C_INT64_T + integer, public, parameter :: HSIZE_T = C_LONG_LONG interface function attribute_typesize(obj_id, name) result(sz) bind(C) @@ -442,9 +442,8 @@ contains ! GET_NAME Obtains the name of the current group in group_id !=============================================================================== - function get_name(object_id, name_len_) result(name) - integer(HID_T), intent(in) :: object_id - integer(SIZE_T), optional, intent(in) :: name_len_ + function get_name(object_id) result(name) + integer(HID_T), intent(in) :: object_id character(150) :: name ! name of object character(kind=C_CHAR) :: name_(150) diff --git a/src/initialize.F90 b/src/initialize.F90 index 7a43c9381d..8d136cf242 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -2,7 +2,6 @@ module initialize use, intrinsic :: ISO_C_BINDING, only: c_loc - use hdf5 #ifdef _OPENMP use omp_lib #endif @@ -13,7 +12,7 @@ module initialize use error, only: fatal_error, warning, write_message use geometry_header, only: Cell, Universe, Lattice, RectLattice, HexLattice,& root_universe - use hdf5_interface, only: file_open, read_attribute, file_close + use hdf5_interface, only: file_open, read_attribute, file_close, HID_T use input_xml, only: read_input_xml use material_header, only: Material use message_passing @@ -87,9 +86,6 @@ contains end if #endif - ! Initialize HDF5 Fortran interface. - call h5open_f(hdf5_err) - ! Read command line arguments call read_command_line() diff --git a/src/mgxs_header.F90 b/src/mgxs_header.F90 index 76042703af..3bb74d5f79 100644 --- a/src/mgxs_header.F90 +++ b/src/mgxs_header.F90 @@ -246,7 +246,6 @@ contains type(VectorInt), intent(out) :: temps_to_read ! Temperatures to read integer, intent(out) :: order_dim ! Scattering data order size - integer(SIZE_T) :: name_len integer(HID_T) :: kT_group character(MAX_WORD_LEN), allocatable :: dset_names(:) real(8), allocatable :: temps_available(:) ! temperatures available @@ -257,8 +256,7 @@ contains integer :: ipol, iazi ! Get name of dataset from group - name_len = len(this % name) - this % name = get_name(xs_id, name_len) + this % name = get_name(xs_id) ! Get rid of leading '/' this % name = trim(this % name(2:)) diff --git a/src/nuclide_header.F90 b/src/nuclide_header.F90 index a063bb90b4..ebabe5cdbc 100644 --- a/src/nuclide_header.F90 +++ b/src/nuclide_header.F90 @@ -290,7 +290,6 @@ contains integer(HID_T) :: total_nu integer(HID_T) :: fer_group ! fission_energy_release group integer(HID_T) :: fer_dset - integer(SIZE_T) :: name_len integer(HSIZE_T) :: j integer(HSIZE_T) :: dims(1) character(MAX_WORD_LEN) :: temp_str @@ -304,8 +303,7 @@ contains type(VectorInt) :: index_inelastic_scatter ! Get name of nuclide from group - name_len = len(this % name) - this % name = get_name(group_id, name_len) + this % name = get_name(group_id) ! Get rid of leading '/' this % name = trim(this % name(2:)) diff --git a/src/sab_header.F90 b/src/sab_header.F90 index 7ac14ef00e..615e7b281d 100644 --- a/src/sab_header.F90 +++ b/src/sab_header.F90 @@ -100,7 +100,6 @@ contains integer :: n_energy, n_energy_out, n_mu integer :: i_closest integer :: n_temperature - integer(SIZE_T) :: name_len integer(HID_T) :: T_group integer(HID_T) :: elastic_group integer(HID_T) :: inelastic_group @@ -120,8 +119,7 @@ contains type(VectorInt) :: temps_to_read ! Get name of table from group - name_len = len(this % name) - this % name = get_name(group_id, name_len) + this % name = get_name(group_id) ! Get rid of leading '/' this % name = trim(this % name(2:)) From da4999f1163b8b030dd08dc57d9ef2f9cb1133df Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 25 Apr 2018 12:51:45 -0500 Subject: [PATCH 213/231] Move reading command-line arguments to C++ side --- include/openmc.h | 6 +- openmc/capi/core.py | 4 +- src/api.F90 | 2 + src/hdf5_interface.F90 | 5 +- src/initialize.F90 | 200 +++++++------------------------------- src/initialize.cpp | 161 +++++++++++++++++++++++++++++- src/initialize.h | 6 +- src/main.cpp | 13 ++- src/output.F90 | 4 +- src/settings.F90 | 10 +- src/simulation_header.F90 | 2 +- 11 files changed, 229 insertions(+), 184 deletions(-) diff --git a/include/openmc.h b/include/openmc.h index 7f2bbf46c7..0556187419 100644 --- a/include/openmc.h +++ b/include/openmc.h @@ -47,7 +47,7 @@ extern "C" { int64_t openmc_get_seed(); int openmc_get_tally_index(int32_t id, int32_t* index); void openmc_hard_reset(); - int openmc_init(const void* intracomm); + int openmc_init(int argc, char* argv[], const void* intracomm); int openmc_init_f(const int* intracomm); int openmc_legendre_filter_get_order(int32_t index, int* order); int openmc_legendre_filter_set_order(int32_t index, int order); @@ -146,9 +146,11 @@ extern "C" { extern bool openmc_simulation_initialized; extern int openmc_verbosity; - // Variables that are shared by necessity (can be removed later) + // Variables that are shared by necessity (can be removed from public header + // later) extern bool openmc_master; extern int openmc_n_procs; + extern int openmc_n_threads; extern int openmc_rank; extern int64_t openmc_work; diff --git a/openmc/capi/core.py b/openmc/capi/core.py index 57e2e88ebd..1c2725382f 100644 --- a/openmc/capi/core.py +++ b/openmc/capi/core.py @@ -27,7 +27,7 @@ _dll.openmc_find.argtypes = [POINTER(c_double*3), c_int, POINTER(c_int32), _dll.openmc_find.restype = c_int _dll.openmc_find.errcheck = _error_handler _dll.openmc_hard_reset.restype = None -_dll.openmc_init.argtypes = [c_void_p] +_dll.openmc_init.argtypes = [c_int, POINTER(c_char_p), c_void_p] _dll.openmc_init.restype = None _dll.openmc_get_keff.argtypes = [POINTER(c_double*2)] _dll.openmc_get_keff.restype = c_int @@ -126,7 +126,7 @@ def init(intracomm=None): address = MPI._addressof(intracomm) intracomm = c_void_p(address) - _dll.openmc_init(intracomm) + _dll.openmc_init(0, None, intracomm) def iter_batches(): diff --git a/src/api.F90 b/src/api.F90 index d00d166c42..bf760770b5 100644 --- a/src/api.F90 +++ b/src/api.F90 @@ -104,7 +104,9 @@ contains subroutine openmc_finalize() bind(C) +#ifdef OPENMC_MPI integer :: err +#endif ! Clear results call openmc_reset() diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 57138c377a..3fd5e860fd 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -1105,7 +1105,7 @@ contains integer :: i integer(HSIZE_T) :: dims(1) - integer(C_SIZE_T) :: m + integer(C_SIZE_T) :: m, n logical(C_BOOL) :: indep_ character(kind=C_CHAR), allocatable :: buffer_(:) @@ -1118,7 +1118,8 @@ contains m = maxval(len_trim(buffer)) + 1 allocate(buffer_(dims(1)*m)) do i = 0, dims(1) - 1 - buffer_(i*m+1 : (i+1)*m) = to_c_string(buffer(i+1)) + n = len_trim(buffer(i+1)) + 1 + buffer_(i*m+1 : i*m+n) = to_c_string(buffer(i+1)) end do call write_string_c(group_id, 1, dims, m, to_c_string(name), & diff --git a/src/initialize.F90 b/src/initialize.F90 index 8d136cf242..d5ce32b312 100644 --- a/src/initialize.F90 +++ b/src/initialize.F90 @@ -1,6 +1,6 @@ module initialize - use, intrinsic :: ISO_C_BINDING, only: c_loc + use, intrinsic :: ISO_C_BINDING #ifdef _OPENMP use omp_lib @@ -8,28 +8,20 @@ module initialize use bank_header, only: Bank use constants - use set_header, only: SetInt - use error, only: fatal_error, warning, write_message - use geometry_header, only: Cell, Universe, Lattice, RectLattice, HexLattice,& - root_universe - use hdf5_interface, only: file_open, read_attribute, file_close, HID_T use input_xml, only: read_input_xml - use material_header, only: Material use message_passing - use mgxs_data, only: read_mgxs, create_macro_xs - use output, only: print_version, print_usage use random_lcg, only: openmc_set_seed use settings -#ifdef _OPENMP - use simulation_header, only: n_threads -#endif - use string, only: to_str, starts_with, ends_with, str_to_int - use tally_header, only: TallyObject - use tally_filter + use string, only: ends_with, to_f_string use timer_header implicit none + type(C_PTR), bind(C) :: openmc_path_input + type(C_PTR), bind(C) :: openmc_path_statepoint + type(C_PTR), bind(C) :: openmc_path_sourcepoint + type(C_PTR), bind(C) :: openmc_path_particle_restart + contains !=============================================================================== @@ -43,7 +35,6 @@ contains integer, intent(in), optional :: intracomm ! MPI intracommunicator integer(C_INT) :: err - integer :: hdf5_err #ifdef _OPENMP character(MAX_WORD_LEN) :: envvar #endif @@ -161,162 +152,41 @@ contains !=============================================================================== subroutine read_command_line() + ! Arguments were already read on C++ side (initialize.cpp). Here we just + ! convert the C-style strings to Fortran style - integer :: i ! loop index - integer :: argc ! number of command line arguments - integer :: last_flag ! index of last flag - character(MAX_WORD_LEN) :: filetype - integer(HID_T) :: file_id - character(MAX_WORD_LEN), allocatable :: argv(:) ! command line arguments + character(kind=C_CHAR), pointer :: string(:) + interface + function is_null(ptr) result(x) bind(C) + import C_PTR, C_BOOL + type(C_PTR), value :: ptr + logical(C_BOOL) :: x + end function is_null + end interface - ! Check number of command line arguments and allocate argv - argc = COMMAND_ARGUMENT_COUNT() - - ! Allocate and retrieve command arguments - allocate(argv(argc)) - do i = 1, argc - call GET_COMMAND_ARGUMENT(i, argv(i)) - end do - - ! Process command arguments - last_flag = 0 - i = 1 - do while (i <= argc) - ! Check for flags - if (starts_with(argv(i), "-")) then - select case (argv(i)) - case ('-p', '-plot', '--plot') - run_mode = MODE_PLOTTING - check_overlaps = .true. - - case ('-n', '-particles', '--particles') - ! Read number of particles per cycle - i = i + 1 - n_particles = str_to_int(argv(i)) - - ! Check that number specified was valid - if (n_particles == ERROR_INT) then - call fatal_error("Must specify integer after " // trim(argv(i-1)) & - &// " command-line flag.") - end if - case ('-r', '-restart', '--restart') - ! Read path for state point/particle restart - i = i + 1 - - ! Check what type of file this is - file_id = file_open(argv(i), 'r', parallel=.true.) - call read_attribute(filetype, file_id, 'filetype') - call file_close(file_id) - - ! Set path and flag for type of run - select case (trim(filetype)) - case ('statepoint') - path_state_point = argv(i) - restart_run = .true. - case ('particle restart') - path_particle_restart = argv(i) - particle_restart_run = .true. - case default - call fatal_error("Unrecognized file after restart flag: " // filetype // ".") - end select - - ! If its a restart run check for additional source file - if (restart_run .and. i + 1 <= argc) then - - ! Increment arg - i = i + 1 - - ! Check if it has extension we can read - if (ends_with(argv(i), '.h5')) then - - ! Check file type is a source file - file_id = file_open(argv(i), 'r', parallel=.true.) - call read_attribute(filetype, file_id, 'filetype') - call file_close(file_id) - if (filetype /= 'source') then - call fatal_error("Second file after restart flag must be a & - &source file") - end if - - ! It is a source file - path_source_point = argv(i) - - else ! Different option is specified not a source file - - ! Source is in statepoint file - path_source_point = path_state_point - - ! Set argument back - i = i - 1 - - end if - - else ! No command line arg after statepoint - - ! Source is assumed to be in statepoint file - path_source_point = path_state_point - - end if - - case ('-g', '-geometry-debug', '--geometry-debug') - check_overlaps = .true. - - case ('-c', '--volume') - run_mode = MODE_VOLUME - - case ('-s', '--threads') - ! Read number of threads - i = i + 1 - -#ifdef _OPENMP - ! Read and set number of OpenMP threads - n_threads = int(str_to_int(argv(i)), 4) - if (n_threads < 1) then - call fatal_error("Invalid number of threads specified on command & - &line.") - end if - call omp_set_num_threads(n_threads) -#else - if (master) call warning("Ignoring number of threads specified on & - &command line.") -#endif - - case ('-?', '-h', '-help', '--help') - call print_usage() - stop - case ('-v', '-version', '--version') - call print_version() - stop - case ('-t', '-track', '--track') - write_all_tracks = .true. - case default - call fatal_error("Unknown command line option: " // argv(i)) - end select - - last_flag = i - end if - - ! Increment counter - i = i + 1 - end do - - ! Determine directory where XML input files are - if (argc > 0 .and. last_flag < argc) then - path_input = argv(last_flag + 1) + if (.not. is_null(openmc_path_input)) then + call c_f_pointer(openmc_path_input, string, [255]) + path_input = to_f_string(string) else path_input = '' end if - - ! Add slash at end of directory if it isn't there - if (.not. ends_with(path_input, "/") .and. len_trim(path_input) > 0) then - path_input = trim(path_input) // "/" + if (.not. is_null(openmc_path_statepoint)) then + call c_f_pointer(openmc_path_statepoint, string, [255]) + path_state_point = to_f_string(string) + end if + if (.not. is_null(openmc_path_sourcepoint)) then + call c_f_pointer(openmc_path_sourcepoint, string, [255]) + path_source_point = to_f_string(string) + end if + if (.not. is_null(openmc_path_particle_restart)) then + call c_f_pointer(openmc_path_particle_restart, string, [255]) + path_particle_restart = to_f_string(string) end if - ! Free memory from argv - deallocate(argv) - - ! TODO: Check that directory exists - + ! Add slash at end of directory if it isn't there + if (len_trim(path_input) > 0 .and. .not. ends_with(path_input, "/")) then + path_input = trim(path_input) // "/" + end if end subroutine read_command_line end module initialize diff --git a/src/initialize.cpp b/src/initialize.cpp index 23025feb23..d8045e4337 100644 --- a/src/initialize.cpp +++ b/src/initialize.cpp @@ -1,12 +1,38 @@ #include "initialize.h" #include +#include +#include +#include +#include +#include "error.h" +#include "hdf5_interface.h" #include "message_passing.h" #include "openmc.h" +#ifdef _OPENMP +#include "omp.h" +#endif + +// data/functions from Fortran side +extern "C" bool openmc_check_overlaps; +extern "C" bool openmc_write_all_tracks; +extern "C" bool openmc_particle_restart_run; +extern "C" bool openmc_restart_run; +extern "C" void print_usage(); +extern "C" void print_version(); -int openmc_init(const void* intracomm) +// Paths to various files +extern "C" { + char* openmc_path_input; + char* openmc_path_statepoint; + char* openmc_path_sourcepoint; + char* openmc_path_particle_restart; + bool is_null(void* ptr) {return !ptr;} +} + +int openmc_init(int argc, char* argv[], const void* intracomm) { #ifdef OPENMC_MPI // Check if intracomm was passed @@ -19,13 +45,20 @@ int openmc_init(const void* intracomm) // Initialize MPI for C++ openmc::initialize_mpi(comm); +#endif + + // Parse command-line arguments + int err = openmc::parse_command_line(argc, argv); + if (err) return err; // Continue with rest of initialization +#ifdef OPENMC_MPI MPI_Fint fcomm = MPI_Comm_c2f(comm); openmc_init_f(&fcomm); #else openmc_init_f(nullptr); #endif + return 0; } @@ -63,6 +96,130 @@ void initialize_mpi(MPI_Comm intracomm) MPI_Type_create_struct(5, blocks, disp, types, &openmc::mpi::bank); MPI_Type_commit(&openmc::mpi::bank); } - #endif // OPENMC_MPI + + +inline bool ends_with(std::string const& value, std::string const& ending) +{ + if (ending.size() > value.size()) return false; + return std::equal(ending.rbegin(), ending.rend(), value.rbegin()); +} + + +int +parse_command_line(int argc, char* argv[]) +{ + char buffer[256]; // buffer for reading attribute + int last_flag = 0; + for (int i=1; i < argc; ++i) { + std::string arg {argv[i]}; + if (arg[0] == '-') { + if (arg == "-p" || arg == "--plot") { + openmc_run_mode = RUN_MODE_PLOTTING; + openmc_check_overlaps = true; + + } else if (arg == "-n" || arg == "--particles") { + i += 1; + n_particles = std::stoll(argv[i]); + + } else if (arg == "-r" || arg == "--restart") { + i += 1; + + // Check what type of file this is + hid_t file_id = file_open(argv[i], 'r', true); + size_t len = attribute_typesize(file_id, "filetype"); + read_attr_string(file_id, "filetype", len, buffer); + file_close(file_id); + std::string filetype {buffer}; + + // Set path and flag for type of run + if (filetype == "statepoint") { + openmc_path_statepoint = argv[i]; + openmc_restart_run = true; + } else if (filetype == "particle restart") { + openmc_path_particle_restart = argv[i]; + openmc_particle_restart_run = true; + } else { + std::stringstream msg; + msg << "Unrecognized file after restart flag: " << filetype << "."; + strcpy(openmc_err_msg, msg.str().c_str()); + return OPENMC_E_INVALID_ARGUMENT; + } + + // If its a restart run check for additional source file + if (openmc_restart_run && i + 1 < argc) { + // Check if it has extension we can read + if (ends_with(argv[i+1], ".h5")) { + + // Check file type is a source file + file_id = file_open(argv[i+1], 'r', true); + len = attribute_typesize(file_id, "filetype"); + read_attr_string(file_id, "filetype", len, buffer); + file_close(file_id); + if (filetype != "source") { + std::string msg {"Second file after restart flag must be a source file"}; + strcpy(openmc_err_msg, msg.c_str()); + return OPENMC_E_INVALID_ARGUMENT; + } + + // It is a source file + openmc_path_sourcepoint = argv[i+1]; + i += 1; + + } else { + // Source is in statepoint file + openmc_path_sourcepoint = openmc_path_statepoint; + } + + } else { + // Source is assumed to be in statepoint file + openmc_path_sourcepoint = openmc_path_statepoint; + } + + } else if (arg == "-g" || arg == "--geometry-debug") { + openmc_check_overlaps = true; + } else if (arg == "-c" || arg == "--volume") { + openmc_run_mode = RUN_MODE_VOLUME; + } else if (arg == "-s" || arg == "--threads") { + // Read number of threads + i += 1; + +#ifdef _OPENMP + // Read and set number of OpenMP threads + openmc_n_threads = std::stoi(argv[i]); + if (openmc_n_threads < 1) { + std::string msg {"Number of threads must be positive."}; + strcpy(openmc_err_msg, msg.c_str()); + return OPENMC_E_INVALID_ARGUMENT; + } + omp_set_num_threads(openmc_n_threads); +#endif + + } else if (arg == "-?" || arg == "-h" || arg == "--help") { + print_usage(); + return OPENMC_E_UNASSIGNED; + + } else if (arg == "-v" || arg == "--version") { + print_version(); + return OPENMC_E_UNASSIGNED; + + } else if (arg == "-t" || arg == "--track") { + openmc_write_all_tracks = true; + + } else { + std::cerr << "Unknown option: " << argv[i] << '\n'; + print_usage(); + return OPENMC_E_UNASSIGNED; + } + + last_flag = i; + } + } + + // Determine directory where XML input files are + if (argc > 1 && last_flag < argc) openmc_path_input = argv[last_flag + 1]; + + return 0; +} + } // namespace openmc diff --git a/src/initialize.h b/src/initialize.h index d2c4df5d79..14283fb5fc 100644 --- a/src/initialize.h +++ b/src/initialize.h @@ -5,10 +5,14 @@ #include "mpi.h" #endif +extern "C" void print_usage(); +extern "C" void print_version(); + namespace openmc { +int parse_command_line(int argc, char* argv[]); #ifdef OPENMC_MPI - void initialize_mpi(MPI_Comm intracomm); +void initialize_mpi(MPI_Comm intracomm); #endif } diff --git a/src/main.cpp b/src/main.cpp index 1dd20ebe04..5bf305093b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,19 +1,26 @@ +#include "error.h" #ifdef OPENMC_MPI #include "mpi.h" #endif #include "openmc.h" -int main(int argc, char** argv) { +int main(int argc, char* argv[]) { int err; // Initialize run -- when run with MPI, pass communicator #ifdef OPENMC_MPI MPI_Comm world {MPI_COMM_WORLD}; - openmc_init(&world); + err = openmc_init(argc, argv, &world); #else - openmc_init(nullptr); + err = openmc_init(argc, argv, nullptr); #endif + if (err == -1) { + // This happens for the -h and -v flags + return 0; + } else if (err) { + openmc::fatal_error(openmc_err_msg); + } // start problem based on mode switch (openmc_run_mode) { diff --git a/src/output.F90 b/src/output.F90 index b6809ca82f..174292fb3b 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -162,7 +162,7 @@ contains ! information !=============================================================================== - subroutine print_version() + subroutine print_version() bind(C) if (master) then write(UNIT=OUTPUT_UNIT, FMT='(1X,A,1X,I1,".",I2,".",I1)') & @@ -182,7 +182,7 @@ contains ! PRINT_USAGE displays information about command line usage of OpenMC !=============================================================================== - subroutine print_usage() + subroutine print_usage() bind(C) if (master) then write(OUTPUT_UNIT,*) 'Usage: openmc [options] [directory]' diff --git a/src/settings.F90 b/src/settings.F90 index 4de72e8c4d..aef1c011be 100644 --- a/src/settings.F90 +++ b/src/settings.F90 @@ -78,13 +78,13 @@ module settings integer(C_INT), bind(C, name='openmc_run_mode') :: run_mode = NONE ! Restart run - logical :: restart_run = .false. + logical(C_BOOL), bind(C, name='openmc_restart_run') :: restart_run = .false. ! The verbosity controls how much information will be printed to the screen ! and in logs integer(C_INT), bind(C, name='openmc_verbosity') :: verbosity = 7 - logical :: check_overlaps = .false. + logical(C_BOOL), bind(C, name='openmc_check_overlaps') :: check_overlaps = .false. ! Trace for single particle integer :: trace_batch @@ -92,11 +92,13 @@ module settings integer(8) :: trace_particle ! Particle tracks - logical :: write_all_tracks = .false. + logical(C_BOOL), bind(C, name='openmc_write_all_tracks') :: & + write_all_tracks = .false. integer, allocatable :: track_identifiers(:,:) ! Particle restart run - logical :: particle_restart_run = .false. + logical(C_BOOL), bind(C, name='openmc_particle_restart_run') :: & + particle_restart_run = .false. ! Write out initial source logical :: write_initial_source = .false. diff --git a/src/simulation_header.F90 b/src/simulation_header.F90 index a214f4410b..8fe5e2da1f 100644 --- a/src/simulation_header.F90 +++ b/src/simulation_header.F90 @@ -58,7 +58,7 @@ module simulation_header ! PARALLEL PROCESSING VARIABLES #ifdef _OPENMP - integer :: n_threads = NONE ! number of OpenMP threads + integer(C_INT), bind(C, name='openmc_n_threads') :: n_threads = NONE ! number of OpenMP threads integer :: thread_id ! ID of a given thread #endif From 30944b554a5ecda6d7ec20fb221419a76c5bc618 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 25 Apr 2018 14:46:27 -0500 Subject: [PATCH 214/231] Update docs, don't modify when .mod files are created --- CMakeLists.txt | 6 +----- docs/source/capi/index.rst | 6 ++++-- docs/source/usersguide/install.rst | 8 +------- src/math.F90 | 1 - 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ed72434d80..3cfea2227f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,6 @@ project(openmc Fortran C CXX) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) -set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/include) # Set module path set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules) @@ -456,10 +455,7 @@ add_executable(${program} src/main.cpp) set_property(TARGET ${program} libopenmc pugixml_fortran PROPERTY LINKER_LANGUAGE Fortran) -target_include_directories(libopenmc - PUBLIC include ${HDF5_INCLUDE_DIRS} - PRIVATE ${CMAKE_BINARY_DIR}/include - ) +target_include_directories(libopenmc PUBLIC include ${HDF5_INCLUDE_DIRS}) # The executable and the faddeeva package use only one language. They can be # set via target_compile_options which accepts a list. diff --git a/docs/source/capi/index.rst b/docs/source/capi/index.rst index 0e6a2536c6..fbc2830b56 100644 --- a/docs/source/capi/index.rst +++ b/docs/source/capi/index.rst @@ -270,13 +270,15 @@ Functions Reset tallies, timers, and pseudo-random number generator state -.. c:function:: void openmc_init(const int* intracomm) +.. c:function:: void openmc_init(int argc, char** argv, const void* intracomm) Initialize OpenMC + :param int argc: Number of command-line arguments (including command) + :param char** argv: Command-line arguments :param intracomm: MPI intracommunicator. If MPI is not being used, a null pointer should be passed. - :type intracomm: const int* + :type intracomm: const void* .. c:function:: int openmc_load_nuclide(char name[]) diff --git a/docs/source/usersguide/install.rst b/docs/source/usersguide/install.rst index b0618818e3..f5b277a840 100644 --- a/docs/source/usersguide/install.rst +++ b/docs/source/usersguide/install.rst @@ -141,16 +141,10 @@ Prerequisites 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 + FC=mpifort ./configure --enable-parallel You may omit ``--enable-parallel`` if you want to compile HDF5_ in serial. - .. important:: - - If you are building HDF5 version 1.8.x or earlier, you must include - ``--enable-fortran2003`` as well when configuring HDF5 or else OpenMC - will not be able to compile. - .. admonition:: Optional :class: note diff --git a/src/math.F90 b/src/math.F90 index ee8cd0530b..20bacf88cf 100644 --- a/src/math.F90 +++ b/src/math.F90 @@ -598,7 +598,6 @@ contains real(8) :: zn_mat(n+1, n+1) ! Matrix form of the coefficients which is ! easier to work with real(8) :: k1, k2, k3, k4 ! Variables for R_m_n calculation - real(8) :: sqrt_norm ! normalization for radial moments integer :: i,p,q ! Loop counters real(8), parameter :: SQRT_N_1(0:10) = [& From 0a8f5977edd4dcf5506e86731867f3226d32e500 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 25 Apr 2018 15:07:40 -0500 Subject: [PATCH 215/231] Be more consistent with C API function return values --- docs/source/capi/index.rst | 52 ++++++++++++++++++++++++++++++-------- include/openmc.h | 17 ++++++------- openmc/capi/core.py | 27 +++++++++++++------- src/api.F90 | 27 +++++++++++--------- src/main.cpp | 4 +-- src/plot.F90 | 6 +++-- src/simulation.F90 | 18 +++++++++---- src/state_point.F90 | 7 ++--- src/volume_calc.F90 | 6 +++-- 9 files changed, 109 insertions(+), 55 deletions(-) diff --git a/docs/source/capi/index.rst b/docs/source/capi/index.rst index fbc2830b56..85509f6f43 100644 --- a/docs/source/capi/index.rst +++ b/docs/source/capi/index.rst @@ -46,10 +46,13 @@ Type Definitions Functions --------- -.. c:function:: void openmc_calculate_volumes() +.. c:function:: int openmc_calculate_volumes() Run a stochastic volume calculation + :return: Return status (negative if an error occurred) + :rtype: int + .. c:function:: int openmc_cell_get_fill(int32_t index, int* type, int32_t** indices, int32_t* n) Get the fill for a cell @@ -192,11 +195,14 @@ Functions :return: Return status (negative if an error occurred) :rtype: int -.. c:function:: void openmc_finalize() +.. c:function:: int openmc_finalize() Finalize a simulation -.. c:function:: void openmc_find(double* xyz, int rtype, int32_t* id, int32_t* instance) + :return: Return status (negative if an error occurs) + :rtype: int + +.. c:function:: int openmc_find(double* xyz, int rtype, int32_t* id, int32_t* instance) Determine the ID of the cell/material containing a given point @@ -207,6 +213,8 @@ Functions 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. + :return: Return status (negative if an error occurs) + :rtype: int .. c:function:: int openmc_get_cell_index(int32_t id, int32_t* index) @@ -266,11 +274,14 @@ Functions :return: Return status (negative if an error occurs) :rtype: int -.. c:function:: void openmc_hard_reset() +.. c:function:: int openmc_hard_reset() Reset tallies, timers, and pseudo-random number generator state -.. c:function:: void openmc_init(int argc, char** argv, const void* intracomm) + :return: Return status (negative if an error occurs) + :rtype: int + +.. c:function:: int openmc_init(int argc, char** argv, const void* intracomm) Initialize OpenMC @@ -279,6 +290,8 @@ Functions :param intracomm: MPI intracommunicator. If MPI is not being used, a null pointer should be passed. :type intracomm: const void* + :return: Return status (negative if an error occurs) + :rtype: int .. c:function:: int openmc_load_nuclide(char name[]) @@ -396,26 +409,41 @@ Functions :return: Return status (negative if an error occurs) :rtype: int -.. c:function:: void openmc_plot_geometry() +.. c:function:: int openmc_plot_geometry() Run plotting mode. -.. c:function:: void openmc_reset() + :return: Return status (negative if an error occurs) + :rtype: int + +.. c:function:: int openmc_reset() Resets all tally scores -.. c:function:: void openmc_run() + :return: Return status (negative if an error occurs) + :rtype: int + +.. c:function:: int openmc_run() Run a simulation -.. c:function:: void openmc_simulation_finalize() + :return: Return status (negative if an error occurs) + :rtype: int + +.. c:function:: int openmc_simulation_finalize() Finalize a simulation. -.. c:function:: void openmc_simulation_init() + :return: Return status (negative if an error occurs) + :rtype: int + +.. c:function:: int openmc_simulation_init() Initialize a simulation. Must be called after openmc_init(). + :return: Return status (negative if an error occurs) + :rtype: int + .. c:function:: int openmc_source_bank(struct Bank** ptr, int64_t* n) Return a pointer to the source bank array. @@ -435,13 +463,15 @@ Functions :return: Return status (negative if an error occurred) :rtype: int -.. c:function:: void openmc_statepoint_write(const char filename[]) +.. c:function:: int 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[] + :return: Return status (negative if an error occurs) + :rtype: int .. c:function:: int openmc_tally_get_id(int32_t index, int32_t* id) diff --git a/include/openmc.h b/include/openmc.h index 0556187419..38b7f21670 100644 --- a/include/openmc.h +++ b/include/openmc.h @@ -4,7 +4,6 @@ #include #include - #ifdef __cplusplus extern "C" { #endif @@ -17,7 +16,7 @@ extern "C" { int delayed_group; }; - void openmc_calculate_volumes(); + int openmc_calculate_volumes(); int openmc_cell_get_fill(int32_t index, int* type, int32_t** indices, int32_t* n); int openmc_cell_get_id(int32_t index, int32_t* id); int openmc_cell_set_fill(int32_t index, int type, int32_t n, const int32_t* indices); @@ -35,7 +34,7 @@ extern "C" { int openmc_filter_get_type(int32_t index, const char** type); int openmc_filter_set_id(int32_t index, int32_t id); int openmc_filter_set_type(int32_t index, const char* type); - void openmc_finalize(); + int openmc_finalize(); int openmc_find(double* xyz, int rtype, int32_t* id, int32_t* instance); int openmc_get_cell_index(int32_t id, int32_t* index); int openmc_get_filter_index(int32_t id, int32_t* index); @@ -46,7 +45,7 @@ extern "C" { int openmc_get_nuclide_index(const char name[], int* index); int64_t openmc_get_seed(); int openmc_get_tally_index(int32_t id, int32_t* index); - void openmc_hard_reset(); + int openmc_hard_reset(); int openmc_init(int argc, char* argv[], const void* intracomm); int openmc_init_f(const int* intracomm); int openmc_legendre_filter_get_order(int32_t index, int* order); @@ -73,12 +72,12 @@ extern "C" { int openmc_next_batch(int* status); int openmc_nuclide_name(int index, char** name); int openmc_particle_restart(); - void openmc_plot_geometry(); - void openmc_reset(); + int openmc_plot_geometry(); + int openmc_reset(); int openmc_run(); void openmc_set_seed(int64_t new_seed); - void openmc_simulation_finalize(); - void openmc_simulation_init(); + int openmc_simulation_finalize(); + int openmc_simulation_init(); int openmc_source_bank(struct Bank** ptr, int64_t* n); int openmc_source_set_strength(int32_t index, double strength); int openmc_spatial_legendre_filter_get_order(int32_t index, int* order); @@ -90,7 +89,7 @@ extern "C" { int openmc_sphharm_filter_get_cosine(int32_t index, char cosine[]); int openmc_sphharm_filter_set_order(int32_t index, int order); int openmc_sphharm_filter_set_cosine(int32_t index, const char cosine[]); - void openmc_statepoint_write(const char filename[]); + int openmc_statepoint_write(const char filename[]); int openmc_tally_get_active(int32_t index, bool* active); int openmc_tally_get_id(int32_t index, int32_t* id); int openmc_tally_get_filters(int32_t index, int32_t** indices, int* n); diff --git a/openmc/capi/core.py b/openmc/capi/core.py index 1c2725382f..273f0c0c7f 100644 --- a/openmc/capi/core.py +++ b/openmc/capi/core.py @@ -20,32 +20,41 @@ class _Bank(Structure): ('delayed_group', c_int)] -_dll.openmc_calculate_volumes.restype = None -_dll.openmc_finalize.restype = None +_dll.openmc_calculate_volumes.restype = c_int +_dll.openmc_calculate_volumes.errcheck = _error_handler +_dll.openmc_finalize.restype = c_int +_dll.openmc_finalize.errcheck = _error_handler _dll.openmc_find.argtypes = [POINTER(c_double*3), c_int, POINTER(c_int32), POINTER(c_int32)] _dll.openmc_find.restype = c_int _dll.openmc_find.errcheck = _error_handler -_dll.openmc_hard_reset.restype = None +_dll.openmc_hard_reset.restype = c_int +_dll.openmc_hard_reset.errcheck = _error_handler _dll.openmc_init.argtypes = [c_int, POINTER(c_char_p), c_void_p] -_dll.openmc_init.restype = None +_dll.openmc_init.restype = c_int +_dll.openmc_init.errcheck = _error_handler _dll.openmc_get_keff.argtypes = [POINTER(c_double*2)] _dll.openmc_get_keff.restype = c_int _dll.openmc_get_keff.errcheck = _error_handler _dll.openmc_next_batch.argtypes = [POINTER(c_int)] _dll.openmc_next_batch.restype = c_int _dll.openmc_next_batch.errcheck = _error_handler -_dll.openmc_plot_geometry.restype = None +_dll.openmc_plot_geometry.restype = c_int +_dll.openmc_plot_geometry.restype = _error_handler _dll.openmc_run.restype = c_int _dll.openmc_run.errcheck = _error_handler -_dll.openmc_reset.restype = None +_dll.openmc_reset.restype = c_int +_dll.openmc_reset.errcheck = _error_handler _dll.openmc_source_bank.argtypes = [POINTER(POINTER(_Bank)), POINTER(c_int64)] _dll.openmc_source_bank.restype = c_int _dll.openmc_source_bank.errcheck = _error_handler -_dll.openmc_simulation_init.restype = None -_dll.openmc_simulation_finalize.restype = None +_dll.openmc_simulation_init.restype = c_int +_dll.openmc_simulation_init.errcheck = _error_handler +_dll.openmc_simulation_finalize.restype = c_int +_dll.openmc_simulation_finalize.errcheck = _error_handler _dll.openmc_statepoint_write.argtypes = [POINTER(c_char_p)] -_dll.openmc_statepoint_write.restype = None +_dll.openmc_statepoint_write.restype = c_int +_dll.openmc_statepoint_write.errcheck = _error_handler def calculate_volumes(): diff --git a/src/api.F90 b/src/api.F90 index bf760770b5..49d86edb67 100644 --- a/src/api.F90 +++ b/src/api.F90 @@ -102,14 +102,11 @@ contains ! variables !=============================================================================== - subroutine openmc_finalize() bind(C) - -#ifdef OPENMC_MPI - integer :: err -#endif + function openmc_finalize() result(err) bind(C) + integer(C_INT) :: err ! Clear results - call openmc_reset() + err = openmc_reset() ! Reset global variables assume_separate = .false. @@ -169,12 +166,13 @@ contains ! Deallocate arrays call free_memory() + err = 0 #ifdef OPENMC_MPI ! Free all MPI types call MPI_TYPE_FREE(MPI_BANK, err) #endif - end subroutine openmc_finalize + end function openmc_finalize !=============================================================================== ! OPENMC_FIND determines the ID or a cell or material at a given point in space @@ -225,9 +223,11 @@ contains ! generator state !=============================================================================== - subroutine openmc_hard_reset() bind(C) + function openmc_hard_reset() result(err) bind(C) + integer(C_INT) :: err + ! Reset all tallies and timers - call openmc_reset() + err = openmc_reset() ! Reset total generations and keff guess keff = ONE @@ -235,13 +235,15 @@ contains ! Reset the random number generator state call openmc_set_seed(DEFAULT_SEED) - end subroutine openmc_hard_reset + end function openmc_hard_reset !=============================================================================== ! OPENMC_RESET resets tallies and timers !=============================================================================== - subroutine openmc_reset() bind(C) + function openmc_reset() result(err) bind(C) + integer(C_INT) :: err + integer :: i if (allocated(tallies)) then @@ -289,7 +291,8 @@ contains call time_transport % reset() call time_finalize % reset() - end subroutine openmc_reset + err = 0 + end function openmc_reset !=============================================================================== ! FREE_MEMORY deallocates and clears all global allocatable arrays in the diff --git a/src/main.cpp b/src/main.cpp index 5bf305093b..b9e475cd71 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -29,13 +29,13 @@ int main(int argc, char* argv[]) { err = openmc_run(); break; case RUN_MODE_PLOTTING: - openmc_plot_geometry(); + err = openmc_plot_geometry(); break; case RUN_MODE_PARTICLE: if (openmc_master) err = openmc_particle_restart(); break; case RUN_MODE_VOLUME: - openmc_calculate_volumes(); + err = openmc_calculate_volumes(); break; } diff --git a/src/plot.F90 b/src/plot.F90 index c2ffa2d39c..f17ac33511 100644 --- a/src/plot.F90 +++ b/src/plot.F90 @@ -30,7 +30,8 @@ contains ! RUN_PLOT controls the logic for making one or many plots !=============================================================================== - subroutine openmc_plot_geometry() bind(C) + function openmc_plot_geometry() result(err) bind(C) + integer(C_INT) :: err integer :: i ! loop index for plots @@ -50,7 +51,8 @@ contains end associate end do - end subroutine openmc_plot_geometry + err = 0 + end function openmc_plot_geometry !=============================================================================== ! POSITION_RGB computes the red/green/blue values for a given plot with the diff --git a/src/simulation.F90 b/src/simulation.F90 index e9729df038..4f6163429e 100644 --- a/src/simulation.F90 +++ b/src/simulation.F90 @@ -312,6 +312,7 @@ contains subroutine finalize_batch() + integer(C_INT) :: err #ifdef OPENMC_MPI integer :: mpi_err ! MPI error code #endif @@ -347,7 +348,7 @@ contains ! Write out state point if it's been specified for this batch if (statepoint_batch % contains(current_batch)) then - call openmc_statepoint_write() + err = openmc_statepoint_write() end if ! Write out source point if it's been specified for this batch @@ -396,9 +397,13 @@ contains ! INITIALIZE_SIMULATION !=============================================================================== - subroutine openmc_simulation_init() bind(C) + function openmc_simulation_init() result(err) bind(C) + integer(C_INT) :: err + integer :: i + err = 0 + ! Skip if simulation has already been initialized if (simulation_initialized) return @@ -456,14 +461,15 @@ contains ! Set flag indicating initialization is done simulation_initialized = .true. - end subroutine openmc_simulation_init + end function openmc_simulation_init !=============================================================================== ! FINALIZE_SIMULATION calculates tally statistics, writes tallies, and displays ! execution time and results !=============================================================================== - subroutine openmc_simulation_finalize() bind(C) + function openmc_simulation_finalize() result(err) bind(C) + integer(C_INT) :: err integer :: i ! loop index #ifdef OPENMC_MPI @@ -479,6 +485,8 @@ contains #endif #endif + err = 0 + ! Skip if simulation was never run if (.not. simulation_initialized) return @@ -553,7 +561,7 @@ contains need_depletion_rx = .false. simulation_initialized = .false. - end subroutine openmc_simulation_finalize + end function openmc_simulation_finalize !=============================================================================== ! CALCULATE_WORK determines how many particles each processor should simulate diff --git a/src/state_point.F90 b/src/state_point.F90 index 5b1c4d462a..005b549c30 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -58,8 +58,9 @@ contains ! OPENMC_STATEPOINT_WRITE writes an HDF5 statepoint file to disk !=============================================================================== - subroutine openmc_statepoint_write(filename) bind(C) + function openmc_statepoint_write(filename) result(err) bind(C) type(C_PTR), intent(in), optional :: filename + integer(C_INT) :: err integer :: i, j, k integer :: i_xs @@ -70,12 +71,12 @@ contains integer(HID_T) :: cmfd_group, tallies_group, tally_group, meshes_group, & filters_group, filter_group, derivs_group, & deriv_group, runtime_group - integer(C_INT) :: err real(C_DOUBLE) :: k_combined(2) character(MAX_WORD_LEN), allocatable :: str_array(:) character(C_CHAR), pointer :: string(:) character(len=:, kind=C_CHAR), allocatable :: filename_ + err = 0 if (present(filename)) then call c_f_pointer(filename, string, [MAX_FILE_LEN]) filename_ = to_f_string(string) @@ -458,7 +459,7 @@ contains call file_close(file_id) end if - end subroutine openmc_statepoint_write + end function openmc_statepoint_write !=============================================================================== ! WRITE_SOURCE_POINT diff --git a/src/volume_calc.F90 b/src/volume_calc.F90 index fa770c1f37..8264797a7a 100644 --- a/src/volume_calc.F90 +++ b/src/volume_calc.F90 @@ -36,9 +36,10 @@ contains ! the user has specified and writes results to HDF5 files !=============================================================================== - subroutine openmc_calculate_volumes() bind(C) + function openmc_calculate_volumes() result(err) bind(C) integer :: i, j integer :: n + integer(C_INT) :: err real(8), allocatable :: volume(:,:) ! volume mean/stdev in each domain character(10) :: domain_type character(MAX_FILE_LEN) :: filename ! filename for HDF5 file @@ -99,7 +100,8 @@ contains call write_message("Elapsed time: " // trim(to_str(time_volume % & get_value())) // " s", 6) end if - end subroutine openmc_calculate_volumes + err = 0 + end function openmc_calculate_volumes !=============================================================================== ! GET_VOLUME stochastically determines the volume of a set of domains along with From 9e29b8e202348bc24f20e1ae3f98ad584c6db0ab Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 25 Apr 2018 15:18:12 -0500 Subject: [PATCH 216/231] Support using statepoint as a source file --- docs/source/io_formats/source.rst | 16 ++++++++-------- src/source.F90 | 6 +++--- src/state_point.F90 | 6 +----- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/docs/source/io_formats/source.rst b/docs/source/io_formats/source.rst index a0a62afca0..cff77d2fa5 100644 --- a/docs/source/io_formats/source.rst +++ b/docs/source/io_formats/source.rst @@ -8,13 +8,13 @@ Normally, source data is stored in a state point file. However, it is possible to request that the source be written separately, in which case the format used is that documented here. -**/filetype** (*char[]*) +**/** - String indicating the type of file. +:Attributes: - **filetype** (*char[]*) -- String indicating the type of file. -**/source_bank** (Compound type) - - Source bank information for each particle. The compound type has fields - ``wgt``, ``xyz``, ``uvw``, ``E``, and ``delayed_group``, which - represent the weight, position, direction, energy, energy group, and - delayed_group of the source particle, respectively. +:Datasets: + - **source_bank** (Compound type) -- Source bank information for each + particle. The compound type has fields ``wgt``, ``xyz``, ``uvw``, + ``E``, and ``delayed_group``, which represent the weight, position, + direction, energy, energy group, and delayed_group of the source + particle, respectively. diff --git a/src/source.F90 b/src/source.F90 index b02430823b..3683611315 100644 --- a/src/source.F90 +++ b/src/source.F90 @@ -11,7 +11,7 @@ module source use distribution_multivariate, only: SpatialBox use error, only: fatal_error use geometry, only: find_cell - use hdf5_interface, only: file_open, file_close, read_dataset, HID_T + use hdf5_interface use math use message_passing, only: rank use mgxs_header, only: rev_energy_bins, num_energy_groups @@ -54,10 +54,10 @@ contains file_id = file_open(path_source, 'r', parallel=.true.) ! Read the file type - call read_dataset(filetype, file_id, "filetype") + call read_attribute(filetype, file_id, "filetype") ! Check to make sure this is a source file - if (filetype /= 'source') then + if (filetype /= 'source' .and. filetype /= 'statepoint') then call fatal_error("Specified starting source file not a source file & &type.") end if diff --git a/src/state_point.F90 b/src/state_point.F90 index 005b549c30..cc7511dd61 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -515,7 +515,7 @@ contains call write_message("Creating source file " // trim(filename) // "...", 5) if (master .or. parallel) then file_id = file_open(filename, 'w', parallel=.true.) - call write_dataset(file_id, "filetype", 'source') + call write_attribute(file_id, "filetype", 'source') end if call write_source_bank(file_id, work_index, source_bank) @@ -831,10 +831,6 @@ contains ! Open source file file_id = file_open(path_source_point, 'r', parallel=.true.) - - ! Read file type - call read_dataset(int_array(1), file_id, "filetype") - end if ! Write out source From f528cbca97fc4450bce58cbb0f33a96accb98b41 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 25 Apr 2018 16:12:23 -0500 Subject: [PATCH 217/231] Fix for source_file test, oops --- src/state_point.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/state_point.F90 b/src/state_point.F90 index cc7511dd61..a6e44dfa17 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -493,7 +493,7 @@ contains ! Create separate source file if (master .or. parallel) then file_id = file_open(filename, 'w', parallel=.true.) - call write_dataset(file_id, "filetype", 'source') + call write_attribute(file_id, "filetype", 'source') end if else filename = trim(path_output) // 'statepoint.' // & From 8f77f7ba06a8ab93355178d4c38b9615ce0da7f3 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 25 Apr 2018 22:26:15 -0500 Subject: [PATCH 218/231] Try not propagating error status from MPI_Finalize --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index b9e475cd71..42593dc658 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -44,6 +44,6 @@ int main(int argc, char* argv[]) { // If MPI is in use and enabled, terminate it #ifdef MPI - err = MPI_Finalize(); + MPI_Finalize(); #endif } From ebe53476360a93f94a2afa6096829003e290c9b5 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 26 Apr 2018 07:03:40 -0500 Subject: [PATCH 219/231] Fix MPI-related bugs --- CMakeLists.txt | 1 + src/api.F90 | 6 ++++++ src/finalize.cpp | 10 ++++++++++ src/finalize.h | 6 ++++++ src/hdf5_interface.F90 | 2 +- src/initialize.cpp | 3 ++- src/main.cpp | 6 ++++-- 7 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 src/finalize.cpp create mode 100644 src/finalize.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 3cfea2227f..7ecd6e3211 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -433,6 +433,7 @@ set(LIBOPENMC_FORTRAN_SRC ) set(LIBOPENMC_CXX_SRC src/initialize.cpp + src/finalize.cpp src/hdf5_interface.cpp src/message_passing.cpp src/plot.cpp diff --git a/src/api.F90 b/src/api.F90 index 49d86edb67..bc0757be57 100644 --- a/src/api.F90 +++ b/src/api.F90 @@ -105,6 +105,11 @@ contains function openmc_finalize() result(err) bind(C) integer(C_INT) :: err + interface + subroutine openmc_free_bank() bind(C) + end subroutine openmc_free_bank + end interface + ! Clear results err = openmc_reset() @@ -170,6 +175,7 @@ contains #ifdef OPENMC_MPI ! Free all MPI types call MPI_TYPE_FREE(MPI_BANK, err) + call openmc_free_bank() #endif end function openmc_finalize diff --git a/src/finalize.cpp b/src/finalize.cpp new file mode 100644 index 0000000000..696a1e80e5 --- /dev/null +++ b/src/finalize.cpp @@ -0,0 +1,10 @@ +#include "finalize.h" + +#include "message_passing.h" + +void openmc_free_bank() +{ +#ifdef OPENMC_MPI + MPI_Type_free(&openmc::mpi::bank); +#endif +} diff --git a/src/finalize.h b/src/finalize.h new file mode 100644 index 0000000000..e606493ca1 --- /dev/null +++ b/src/finalize.h @@ -0,0 +1,6 @@ +#ifndef FINALIZE_H +#define FINALIZE_H + +extern "C" void openmc_free_bank(); + +#endif // FINALIZE_H diff --git a/src/hdf5_interface.F90 b/src/hdf5_interface.F90 index 3fd5e860fd..40f56d88ef 100644 --- a/src/hdf5_interface.F90 +++ b/src/hdf5_interface.F90 @@ -1103,7 +1103,7 @@ contains character(*), intent(in), target :: buffer(:) ! read data to here logical, intent(in), optional :: indep ! independent I/O - integer :: i + integer(HSIZE_T) :: i integer(HSIZE_T) :: dims(1) integer(C_SIZE_T) :: m, n logical(C_BOOL) :: indep_ diff --git a/src/initialize.cpp b/src/initialize.cpp index d8045e4337..c7c37e31db 100644 --- a/src/initialize.cpp +++ b/src/initialize.cpp @@ -71,7 +71,8 @@ void initialize_mpi(MPI_Comm intracomm) // Initialize MPI int flag; - if (!MPI_Initialized(&flag)) MPI_Init(nullptr, nullptr); + MPI_Initialized(&flag); + if (!flag) MPI_Init(nullptr, nullptr); // Determine number of processes and rank for each MPI_Comm_size(intracomm, &openmc::mpi::n_procs); diff --git a/src/main.cpp b/src/main.cpp index 42593dc658..6d0cf1f268 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -38,12 +38,14 @@ int main(int argc, char* argv[]) { err = openmc_calculate_volumes(); break; } + if (err) openmc::fatal_error(openmc_err_msg); // Finalize and free up memory - openmc_finalize(); + err = openmc_finalize(); + if (err) openmc::fatal_error(openmc_err_msg); // If MPI is in use and enabled, terminate it -#ifdef MPI +#ifdef OPENMC_MPI MPI_Finalize(); #endif } From 1d2ebb71f8789410052c10773d0011232aeaa706 Mon Sep 17 00:00:00 2001 From: Adam G Nelson Date: Fri, 27 Apr 2018 19:45:38 -0400 Subject: [PATCH 220/231] Implemented Expansion filters in to the MGXS classes and removed the old score-based expansions --- .gitignore | 5 +- docs/source/io_formats/statepoint.rst | 9 +- docs/source/io_formats/summary.rst | 16 +- docs/source/usersguide/tallies.rst | 63 +- examples/jupyter/mg-mode-part-ii.ipynb | 411 ++--- examples/jupyter/mg-mode-part-iii.ipynb | 309 ++-- examples/jupyter/mgxs-part-iii.ipynb | 919 +++++------ openmc/capi/tally.py | 8 +- openmc/filter.py | 4 +- openmc/filter_expansion.py | 7 + openmc/material.py | 20 +- openmc/mesh.py | 68 +- openmc/mgxs/library.py | 88 +- openmc/mgxs/mgxs.py | 379 ++--- openmc/plotter.py | 23 +- openmc/statepoint.py | 7 - openmc/summary.py | 27 +- openmc/tallies.py | 76 +- src/cmfd_data.F90 | 53 +- src/cmfd_input.F90 | 66 +- src/constants.F90 | 54 +- src/endf.F90 | 16 - src/input_xml.F90 | 240 +-- src/math.F90 | 1 - src/mgxs_header.F90 | 10 +- src/output.F90 | 71 +- src/state_point.F90 | 35 - src/summary.F90 | 156 +- src/tallies/tally.F90 | 205 +-- src/tallies/tally_header.F90 | 6 - src/tallies/trigger.F90 | 76 +- .../cmfd_feed/results_true.dat | 61 +- .../cmfd_nofeed/results_true.dat | 61 +- .../mgxs_library_ce_to_mg/inputs_true.dat | 55 +- .../mgxs_library_condense/inputs_true.dat | 814 +++++----- .../mgxs_library_condense/results_true.dat | 120 +- .../mgxs_library_distribcell/inputs_true.dat | 112 +- .../mgxs_library_distribcell/results_true.dat | 40 +- .../mgxs_library_hdf5/inputs_true.dat | 814 +++++----- .../mgxs_library_mesh/inputs_true.dat | 112 +- .../mgxs_library_mesh/results_true.dat | 144 +- .../mgxs_library_no_nuclides/inputs_true.dat | 814 +++++----- .../mgxs_library_no_nuclides/results_true.dat | 408 ++--- .../mgxs_library_nuclides/inputs_true.dat | 648 ++++---- .../mgxs_library_nuclides/results_true.dat | 2 +- .../sourcepoint_restart/results_true.dat | 1440 ----------------- .../sourcepoint_restart/tallies.xml | 2 +- .../statepoint_restart/results_true.dat | 1328 +++------------ .../statepoint_restart/tallies.xml | 2 +- .../regression_tests/tallies/inputs_true.dat | 68 +- .../regression_tests/tallies/results_true.dat | 2 +- tests/regression_tests/tallies/test.py | 105 +- tests/regression_tests/track_output/test.py | 2 +- 53 files changed, 3695 insertions(+), 6887 deletions(-) diff --git a/.gitignore b/.gitignore index 65c7285af1..0fc2c63bc0 100644 --- a/.gitignore +++ b/.gitignore @@ -99,4 +99,7 @@ examples/jupyter/plots .tox/ .python-version .coverage -htmlcov \ No newline at end of file +htmlcov + +# Test data +tests/xsdir diff --git a/docs/source/io_formats/statepoint.rst b/docs/source/io_formats/statepoint.rst index f0f2af59b2..38dae7dd7a 100644 --- a/docs/source/io_formats/statepoint.rst +++ b/docs/source/io_formats/statepoint.rst @@ -133,15 +133,8 @@ The current version of the statepoint file format is 17.0. - **derivative** (*int*) -- ID of the derivative applied to the tally. - **n_score_bins** (*int*) -- Number of scoring bins for a single - nuclide. In general, this can be greater than the number of - user-specified scores since each score might have multiple scoring - bins, e.g., scatter-PN. + nuclide. - **score_bins** (*char[][]*) -- Values of specified scores. - - **n_user_scores** (*int*) -- Number of scores without accounting - for those added by expansions, e.g. scatter-PN. - - **moment_orders** (*char[][]*) -- Tallying moment orders for - Legendre and spherical harmonic tally expansions (e.g., 'P2', - 'Y1,2', etc.). - **results** (*double[][][2]*) -- Accumulated sum and sum-of-squares for each bin of the i-th tally. The first dimension represents combinations of filter bins, the second dimensions represents diff --git a/docs/source/io_formats/summary.rst b/docs/source/io_formats/summary.rst index 049749b599..76c412b860 100644 --- a/docs/source/io_formats/summary.rst +++ b/docs/source/io_formats/summary.rst @@ -4,7 +4,7 @@ Summary File Format =================== -The current version of the summary file format is 5.0. +The current version of the summary file format is 6.0. **/** @@ -104,8 +104,13 @@ The current version of the summary file format is 5.0. - **atom_density** (*double[]*) -- Total atom density of the material in atom/b-cm. - **nuclides** (*char[][]*) -- Array of nuclides present in the - material, e.g., 'U235'. + material, e.g., 'U235'. This data set is only present if nuclides + are used. - **nuclide_densities** (*double[]*) -- Atom density of each nuclide. + This data set is only present if 'nuclides' data set is present. + - **macroscopics** (*char[][]*) -- Array of macroscopic data sets + present in the material. This dataset is only present if + macroscopic data sets are used in multi-group mode. - **sab_names** (*char[][]*) -- Names of S(:math:`\alpha,\beta`) tables assigned to the material. @@ -116,6 +121,13 @@ The current version of the summary file format is 5.0. :Datasets: - **names** (*char[][]*) -- Names of nuclides. - **awrs** (*float[]*) -- Atomic weight ratio of each nuclide. +**/macroscopics/** + +:Attributes: - **n_macroscopics** (*int*) -- Number of macroscopic data sets + in the problem. + +:Datasets: - **names** (*char[][]*) -- Names of the macroscopic data sets. + **/tallies/tally /** :Datasets: - **name** (*char[]*) -- Name of the tally. diff --git a/docs/source/usersguide/tallies.rst b/docs/source/usersguide/tallies.rst index e0f8ab1797..19691e32bf 100644 --- a/docs/source/usersguide/tallies.rst +++ b/docs/source/usersguide/tallies.rst @@ -21,7 +21,12 @@ region of phase space, as in: Thus, to specify a tally, we need to specify what regions of phase space should be included when deciding whether to score an event as well as what the scoring function (:math:`f` in the above equation) should be used. The regions of phase -space are called *filters* and the scoring functions are simply called *scores*. +space are generally called *filters* and the scoring functions are simply +called *scores*. + +The only cases when *filters* do not correspond directly with the regions of +phase space are when expansion functions are applied in the integrand, such as +for Legendre expansions of the scattering kernel. ------- Filters @@ -69,10 +74,9 @@ Scores ------ To specify the scoring functions, a list of strings needs to be given to the -:attr:`Tally.scores` attribute. You can score the flux ('flux'), a reaction rate -('total', 'fission', etc.), or even scattering moments (e.g., 'scatter-P3'). For -example, to tally the elastic scattering rate and the fission neutron -production, you'd assign:: +:attr:`Tally.scores` attribute. You can score the flux ('flux'), or a reaction +rate ('total', 'fission', etc.). For example, to tally the elastic scattering +rate and the fission neutron production, you'd assign:: tally.scores = ['elastic', 'nu-fission'] @@ -98,12 +102,6 @@ The following tables show all valid scores: +======================+===================================================+ |flux |Total flux. | +----------------------+---------------------------------------------------+ - |flux-YN |Spherical harmonic expansion of the direction of | - | |motion :math:`\left(\Omega\right)` of the total | - | |flux. This score will tally all of the harmonic | - | |moments of order 0 to N. N must be between 0 and | - | |10. | - +----------------------+---------------------------------------------------+ .. table:: **Reaction scores: units are reactions per source particle.** @@ -118,43 +116,10 @@ The following tables show all valid scores: +----------------------+---------------------------------------------------+ |fission |Total fission reaction rate. | +----------------------+---------------------------------------------------+ - |scatter |Total scattering rate. Can also be identified with | - | |the "scatter-0" response type. | - +----------------------+---------------------------------------------------+ - |scatter-N |Tally the N\ :sup:`th` \ scattering moment, where N| - | |is the Legendre expansion order of the change in | - | |particle angle :math:`\left(\mu\right)`. N must be | - | |between 0 and 10. As an example, tallying the 2\ | - | |:sup:`nd` \ scattering moment would be specified as| - | |``scatter-2``. | - +----------------------+---------------------------------------------------+ - |scatter-PN |Tally all of the scattering moments from order 0 to| - | |N, where N is the Legendre expansion order of the | - | |change in particle angle | - | |:math:`\left(\mu\right)`. That is, "scatter-P1" is | - | |equivalent to requesting tallies of "scatter-0" and| - | |"scatter-1". Like for "scatter-N", N must be | - | |between 0 and 10. As an example, tallying up to the| - | |2\ :sup:`nd` \ scattering moment would be specified| - | |as `` scatter-P2 ``. | - +----------------------+---------------------------------------------------+ - |scatter-YN |"scatter-YN" is similar to "scatter-PN" except an | - | |additional expansion is performed for the incoming | - | |particle direction :math:`\left(\Omega\right)` | - | |using the real spherical harmonics. This is useful| - | |for performing angular flux moment weighting of the| - | |scattering moments. Like "scatter-PN", "scatter-YN"| - | |will tally all of the moments from order 0 to N; N | - | |again must be between 0 and 10. | + |scatter |Total scattering rate. | +----------------------+---------------------------------------------------+ |total |Total reaction rate. | +----------------------+---------------------------------------------------+ - |total-YN |The total reaction rate expanded via spherical | - | |harmonics about the direction of motion of the | - | |neutron, :math:`\Omega`. This score will tally all | - | |of the harmonic moments of order 0 to N. N must be| - | |between 0 and 10. | - +----------------------+---------------------------------------------------+ |(n,2nd) |(n,2nd) reaction rate. | +----------------------+---------------------------------------------------+ |(n,2n) |(n,2n) reaction rate. | @@ -248,10 +213,10 @@ The following tables show all valid scores: +----------------------+---------------------------------------------------+ |nu-fission |Total production of neutrons due to fission. | +----------------------+---------------------------------------------------+ - |nu-scatter, |These scores are similar in functionality to their | - |nu-scatter-N, |``scatter*`` equivalents except the total | - |nu-scatter-PN, |production of neutrons due to scattering is scored | - |nu-scatter-YN |vice simply the scattering rate. This accounts for | + |nu-scatter, |This score is similar in functionality to the | + | |``scatter`` score except the total production of | + | |neutrons due to scattering is scored vice simply | + | |the scattering rate. This accounts for | | |multiplicity from (n,2n), (n,3n), and (n,4n) | | |reactions. | +----------------------+---------------------------------------------------+ diff --git a/examples/jupyter/mg-mode-part-ii.ipynb b/examples/jupyter/mg-mode-part-ii.ipynb index 7a2b029de0..6380c32b08 100644 --- a/examples/jupyter/mg-mode-part-ii.ipynb +++ b/examples/jupyter/mg-mode-part-ii.ipynb @@ -26,9 +26,7 @@ { "cell_type": "code", "execution_count": 1, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", @@ -50,9 +48,7 @@ { "cell_type": "code", "execution_count": 2, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# 1.6% enriched fuel\n", @@ -84,9 +80,7 @@ { "cell_type": "code", "execution_count": 3, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Instantiate a Materials object\n", @@ -106,9 +100,7 @@ { "cell_type": "code", "execution_count": 4, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Create cylinders for the fuel and clad\n", @@ -136,9 +128,7 @@ { "cell_type": "code", "execution_count": 5, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Create a Universe to encapsulate a fuel pin\n", @@ -173,9 +163,7 @@ { "cell_type": "code", "execution_count": 6, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Create a Universe to encapsulate a control rod guide tube\n", @@ -210,9 +198,7 @@ { "cell_type": "code", "execution_count": 7, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Create fuel assembly Lattice\n", @@ -231,9 +217,7 @@ { "cell_type": "code", "execution_count": 8, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Create array indices for guide tube locations in lattice\n", @@ -263,9 +247,7 @@ { "cell_type": "code", "execution_count": 9, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Create root Cell\n", @@ -290,15 +272,23 @@ { "cell_type": "code", "execution_count": 10, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAARAAAAD8CAYAAAC/+/tYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnX3sZkV1x78HEJtSdEXkHRVbulk1usXNiqE1UHwB2roi\nUiFNQ3QtaCGtsaaiJGowJKRqq9UWRJeKRkEqokQRWbYmaMxWXgIKrFtWirJdylopL0ZTsuzpH899\nyOXuvNw5z5m5c+9zPslmf8+9c+6ZM3ee8zzPzHzvEDPDMAxDwl5DV8AwjPFiCcQwDDGWQAzDEGMJ\nxDAMMZZADMMQYwnEMAwxlkAMwxBjCcQwDDGWQAzDELPP0BWQ8Cx6Nh9EhwxdDcOYLDv5v/EYP0qx\ncqNMIAfRIfjoPp8euhqGMVnes+ucXuVGmUC6bFi1eY9j67ccm90mVl5iM1QspWxqrVcpmzH3GRc0\nRjHd7+y1kuffQK5ZeZGzzCN7nehskA2rNmPF7k2jszlt6wXO4z6bmmOp1cZXHli+fvaeXedg2+6t\n0Z8wKoOoRHQ5Ee0kortaxw4goo1EdG/z/3M8tmc1Ze4lorNS/Lqy6JwVuzcFz6fY+Bo7dC5kk3ot\nwB1rqCMMHb+EVD+h+H1I2izWz1KR9JkS8c/Pp6A1C/M5ACd1jp0PYBMzHw1gU/P6aRDRAQA+COCV\nANYC+KAv0WghafDUMjEbX2fQxuVH8w0/RyPpLFP8LhtJP4uRI9YuKgmEmW8G8HDn8DoAVzR/XwHg\njQ7T1wPYyMwPM/P/AtiIPRORGjk6qZQaO4MWOd4MQ5LjQ6cUueuScx3Iwcz8IAA0/x/kKHM4gAda\nr7c3x7IgGSTK5Se1Lo/sdWJyPSQ2GuSIX4sS7VhT/Ln9DL2QzDVI4xzVJaKziehWIrr1MX6018Vd\njSfpDCGb0MBbyMblpwTabyBf/DGbLn3aOZUSCVQSv4ux9rOcCeQhIjoUAJr/dz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UtDRDcBOMRx6oLAA46SnnxWmlBMAC4B8GHM\n6vthAB8D8LZytVuYqttewHHMvIOIDgKwkYh+3HyyLy2jSiDM/BqBWZ+now1G35iI6DMAvpG5OtpU\n3fapMPOO5v+dRHQtZj/RxpxAHiKiQ5n5QSI6FMDO1Assw0+Y6NPRaqW5qXNOxWygeEzcAuBoIjqK\niPbFbDD7uoHrJIKI9iOi/ed/A3gdxnc/ulyH2ZMAAeETAUf1DSQEEZ0K4JMAnofZ09HuYObXM/Pd\nzf4z9wDYhdbT0UbA3xHRasy+9t8P4Jxhq5MGM+8iovMAfBvA3gAub55WN0YOBnDtbDcS7APgS8x8\nw7BV6g8RXQngeAAHNk8R/CCAiwFcTUTrAfwMwOnJ17WVqIZhSFmGnzCGYWTCEohhGGIsgRiGIcYS\niGEYYiyBGIYhxhKIYRhiLIEYhiHGEohhGGL+H428RVYJwc06AAAAAElFTkSuQmCC\n", "text/plain": [ - "" + "" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAARAAAAD8CAYAAAC/+/tYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAIABJREFUeJztnXvsZVV1x7+rIJJMSQFRHgPjo6FWNDiDk7GTUAP1BZQ6YnxAmoaKFnUgrbGNRUnUYCYhtbY+B4o6FY2CVEUJIjJQEzRi5Y2AWJAizATBgjxELRlY/eOeSw5n9uPsddfeZ59z1yeZzO+es9dZe+2z77r37r2/ZxMzwzAMQ8LvDV0BwzDGiyUQwzDEWAIxDEOMJRDDMMRYAjEMQ4wlEMMwxFgCMQxDjCUQwzDEWAIxDEPMrkNXQMKeK1bwfnvuNXQ1DGOy/OKhX+Ghxx6jWLlRJpD99twLWzaeMnQ1DGOynLT5073KjTKBdFm1ZuNOx+6+fnN2m1h5ic1QsZSyqbVepWzG3Gdc0BjFdH+88kCefwM5dv0mZ5mbfrfd2SCr1mzEobuvHJ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Mq5t/lwxdmRSadv40gKMBHALghOZ+jJkjm3sxtqncz2PW/9ucBuAKZj4YwBXN6yQmk0AWeTqakY11AO5g5jubZ92ej9n9MArDzFcCeLBzeANmTwIEBE8EBCaUQAL0eTpazZxKRDc1X0GTv2IOzNjbvgsDuIyIriWik4eujAL7MvO9zd+/ALBv6gUWeip7aYjocgD7OU6dHnnAUbWEYgJwFoAPY9ZxPwzgowBOKlc7o8PhzLydiJ4DYCsR3dZ8so8eZmYiSp6SHVUCYeZXCcz6PB1tMPrGRESfAXBx5upoU3Xbp8LM25v/7yeiCzH7iTbmBHIfEe3PzPcS0f4A7k+9wDL8hIk+Ha1Wmps65zjMBorHxNUADiai5xPRbpgNZl80cJ1EENEKItpj/jeA12B896PLRZg9CRAQPhFwVN9AQhDRcQA+CeDZmD0d7QZmfi0z39LsP3MrgB1oPR1tBPwTEa3G7CfMXQDeMWx10mDmHUR0KoDvANgFwJbmaXVjZF8AF852I8GuAL7MzJcOW6X+ENF5AI4AsE/zFMEPAjgTwAVE9DbM1O1vTr6urUQ1DEPKMvyEMQwjE5ZADMMQYwnEMAwxlkAMwxBjCcQwDDGWQAzDEGMJxDAMMZZADMMQ8/8GSJnKGGQDkwAAAABJRU5ErkJggg==\n", + "text/plain": [ + "" ] }, "metadata": {}, @@ -321,9 +311,7 @@ { "cell_type": "code", "execution_count": 11, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Create Geometry and set root universe\n", @@ -343,15 +331,13 @@ { "cell_type": "code", "execution_count": 12, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# OpenMC simulation parameters\n", "batches = 600\n", "inactive = 50\n", - "particles = 2000\n", + "particles = 3000\n", "\n", "# Instantiate a Settings object\n", "settings_file = openmc.Settings()\n", @@ -383,9 +369,7 @@ { "cell_type": "code", "execution_count": 13, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Instantiate a 2-group EnergyGroups object\n", @@ -402,9 +386,7 @@ { "cell_type": "code", "execution_count": 14, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Initialize a 2-group MGXS Library for OpenMC\n", @@ -424,9 +406,7 @@ { "cell_type": "code", "execution_count": 15, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Specify multi-group cross section types to compute\n", @@ -446,9 +426,7 @@ { "cell_type": "code", "execution_count": 16, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Specify a \"cell\" domain type for the cross section tally filters\n", @@ -470,9 +448,7 @@ { "cell_type": "code", "execution_count": 17, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Do not compute cross sections on a nuclide-by-nuclide basis\n", @@ -489,9 +465,7 @@ { "cell_type": "code", "execution_count": 18, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stderr", @@ -519,9 +493,7 @@ { "cell_type": "code", "execution_count": 19, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Check the library - if no errors are raised, then the library is satisfactory.\n", @@ -538,9 +510,7 @@ { "cell_type": "code", "execution_count": 20, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Construct all tallies needed for the multi-group cross section library\n", @@ -559,9 +529,7 @@ { "cell_type": "code", "execution_count": 21, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Create a \"tallies.xml\" file for the MGXS Library\n", @@ -579,10 +547,21 @@ { "cell_type": "code", "execution_count": 22, - "metadata": { - "collapsed": true - }, - "outputs": [], + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=66.\n", + " warn(msg, IDWarning)\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=2.\n", + " warn(msg, IDWarning)\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=11.\n", + " warn(msg, IDWarning)\n" + ] + } + ], "source": [ "# Instantiate a tally Mesh\n", "mesh = openmc.Mesh()\n", @@ -618,9 +597,7 @@ { "cell_type": "code", "execution_count": 23, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -652,11 +629,11 @@ " %%%%%%%%%%%\n", "\n", " | The OpenMC Monte Carlo Code\n", - " Copyright | 2011-2017 Massachusetts Institute of Technology\n", + " Copyright | 2011-2018 Massachusetts Institute of Technology\n", " License | http://openmc.readthedocs.io/en/latest/license.html\n", - " Version | 0.8.0\n", - " Git SHA1 | 4b01fd311461f1350989cb84ec18fe2cbaa8fa9f\n", - " Date/Time | 2017-03-10 17:30:51\n", + " Version | 0.10.0\n", + " Git SHA1 | 6c2d82a4d7dfe10312329d5969568fc03a698416\n", + " Date/Time | 2018-04-22 15:02:43\n", " OpenMP Threads | 8\n", "\n", "\n", @@ -665,23 +642,13 @@ "\n", " ============================> RESULTS <============================\n", "\n", - " k-effective (Collision) = 1.16584 +/- 0.00111\n", - " k-effective (Track-length) = 1.16532 +/- 0.00131\n", - " k-effective (Absorption) = 1.16513 +/- 0.00100\n", - " Combined k-effective = 1.16538 +/- 0.00086\n", + " k-effective (Collision) = 1.16513 +/- 0.00090\n", + " k-effective (Track-length) = 1.16337 +/- 0.00104\n", + " k-effective (Absorption) = 1.16479 +/- 0.00080\n", + " Combined k-effective = 1.16460 +/- 0.00068\n", " Leakage Fraction = 0.00000 +/- 0.00000\n", "\n" ] - }, - { - "data": { - "text/plain": [ - "0" - ] - }, - "execution_count": 23, - "metadata": {}, - "output_type": "execute_result" } ], "source": [ @@ -699,9 +666,7 @@ { "cell_type": "code", "execution_count": 24, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Move the statepoint File\n", @@ -724,9 +689,7 @@ { "cell_type": "code", "execution_count": 25, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Load the statepoint file\n", @@ -747,9 +710,7 @@ { "cell_type": "code", "execution_count": 26, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Initialize MGXS Library with OpenMC statepoint data\n", @@ -781,23 +742,8 @@ { "cell_type": "code", "execution_count": 27, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/home/nelsonag/git/openmc/openmc/tallies.py:1834: RuntimeWarning: invalid value encountered in true_divide\n", - " self_rel_err = data['self']['std. dev.'] / data['self']['mean']\n", - "/home/nelsonag/git/openmc/openmc/tallies.py:1835: RuntimeWarning: invalid value encountered in true_divide\n", - " other_rel_err = data['other']['std. dev.'] / data['other']['mean']\n", - "/home/nelsonag/git/openmc/openmc/tallies.py:1836: RuntimeWarning: invalid value encountered in true_divide\n", - " new_tally._mean = data['self']['mean'] / data['other']['mean']\n" - ] - } - ], + "metadata": {}, + "outputs": [], "source": [ "# Create a MGXS File which can then be written to disk\n", "mgxs_file = mgxs_lib.create_mg_library(xs_type='macro', xsdata_names=['fuel', 'zircaloy', 'water'])\n", @@ -820,24 +766,35 @@ { "cell_type": "code", "execution_count": 28, - "metadata": { - "collapsed": false - }, - "outputs": [], + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Material instance already exists with id=1.\n", + " warn(msg, IDWarning)\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Material instance already exists with id=2.\n", + " warn(msg, IDWarning)\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Material instance already exists with id=3.\n", + " warn(msg, IDWarning)\n" + ] + } + ], "source": [ "# Re-define our materials to use the multi-group macroscopic data\n", "# instead of the continuous-energy data.\n", "\n", "# 1.6% enriched fuel UO2\n", - "fuel_mg = openmc.Material(name='UO2')\n", + "fuel_mg = openmc.Material(name='UO2', material_id=1)\n", "fuel_mg.add_macroscopic('fuel')\n", "\n", "# cladding\n", - "zircaloy_mg = openmc.Material(name='Clad')\n", + "zircaloy_mg = openmc.Material(name='Clad', material_id=2)\n", "zircaloy_mg.add_macroscopic('zircaloy')\n", "\n", "# moderator\n", - "water_mg = openmc.Material(name='Water')\n", + "water_mg = openmc.Material(name='Water', material_id=3)\n", "water_mg.add_macroscopic('water')\n", "\n", "# Finally, instantiate our Materials object\n", @@ -868,9 +825,7 @@ { "cell_type": "code", "execution_count": 29, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Set the energy mode\n", @@ -890,9 +845,7 @@ { "cell_type": "code", "execution_count": 30, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Create a \"tallies.xml\" file for the MGXS Library\n", @@ -902,7 +855,7 @@ "mesh_tally = openmc.Tally(name='mesh tally')\n", "mesh_tally.filters = [openmc.MeshFilter(mesh)]\n", "mesh_tally.scores = ['fission']\n", - "tallies_file.add_tally(mesh_tally)\n", + "tallies_file.append(mesh_tally)\n", "\n", "# Export to \"tallies.xml\"\n", "tallies_file.export_to_xml()" @@ -919,15 +872,13 @@ { "cell_type": "code", "execution_count": 31, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEaCAYAAAAG87ApAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd4VHXWwPHvSS9AaAHpRYoCImpEsfe2KPa1d9G1rLuu\nrm57Xde6u669rQVx1UXXLoq9gdgAEUSagCC9CQmEhLTz/nHvhMlkZnJnMi2T83meecjce+fec5Nh\nzvy6qCrGGGOMVxnJDsAYY0zLYonDGGNMRCxxGGOMiYglDmOMMRGxxGGMMSYiljiMMcZExBKHMQkg\nIn8UkSfidO5bRWSDiKyJx/mNCWSJwySUiJwlItNFZKuIrBaRt0XkgCTG01NE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bhCti8g/xPBPnhg/wM+AsEfEnjLpAB/f1BFXd4r4+HnhTVcuBdSIyGUBVVUReAS4VkZdwEsflEWLsARwKTBARcGYIW+t+9iHwjIg0xJnu821VLYt00cbUhCUIY6DY/VnG/v8TApynqosDNxSRo4DdHo/7EjAGKMJJIpHqKwSYr6rHVP1AVfeKyHjgFzhPEjd7jMGYarMiJmOC+xgYLu5XeRE5IsR2U4Hz3LqIlsAA/weq+hPwE3An3mbzWgw0F5Fj3HPmiMghAZ+PxkkMLYFp0V2OMdGzBGFqi6p1EI9E2P5+IAf4TkTmu++DeRtnuOUFwKvALGB7wOevAatUdWGkAFV1H07rpL+IyBxgNnBswCYTgDbAf9WGYTYJYMN9G1NDIlJfVXe581B/DRynquvcz54CvlXVF0LsuwIojNDM1UsMI4GxqvpWTY5jTCB7gjCm5saKyGzgc+D+gOQwE+iN82QRykac5rIhO8pFIiKvASfh1HUYEzP2BGGMMSYoe4IwxhgTlCUIY4wxQVmCMMYYE5QlCGOMMUFZgjDGGBOUJQhjjDFB/T81XClqEFu3dAAAAABJRU5ErkJggg==\n", "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -945,9 +896,9 @@ }, { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEaCAYAAAAG87ApAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8VNX9//HXJ3uAEJB9R42guCASEdQqdakraututS4U\nXGqtP21r7betbe23te23m7ZWccEdRdtawV3rWgEFUVwQQVxA9j0sCST5/P64NziJyWQmmckseT8f\n3kfmnrnL54RxPrn3nHuOuTsiIiKxykl1ACIiklmUOEREJC5KHCIiEhclDhERiYsSh4iIxEWJQ0RE\n4qLEIZJgZvZjM7s9Scf+lZmtMbMVyTi+SCyUOCRpzOwcM5ttZpvNbLmZPWlmh6Ywnv5m9o/wi3ej\nmb1jZhe08phjzWxpZJm7/9rdv92qYBs/1wDgamCYu/dOwPFuNbObI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dXD3zWHZycCT7l4FfNfM7k5AHCL16IpDpBHhX/y/MbN3wr/8dw3LO4aT5bxlZrPM7ISw/Fwze8LM/gO8ZGY5ZnaTmX1sZi+a2TNmdrKZHWpmj0ec5wgz+1cM8Ywws1fNbKaZPW9mfdx9A/AqMDZi09MJnh4WSRolDmnvihvcqjot4r1V7r4vcDPwk7Dsf4D/uPtI4JvAn82sY/jevsDJ7n4IwRDjgwgmAjobGB1u8zKwq5n1CNfPA+6MFqCZ5QM3hsceEW7/+/DtSQTJAjPrCwwB/hPn70AkLrpVJe1dtFtVdUNpzyRIBADfAo43s7pEUgQMCF+/6O5rwtcHAY+4ey2wzMxeBnB3N7P7gLPM7C6ChPK9ZmIcCuwBvGhmEMzotjR872ngJjPrTDBt62PuXtNcpUVaQ4lDpGlV4c8avvp/xYCT3H1u5IZmtj+wKcbj3gU8CVQSJJfm2kMM+NDdRzd8w923mNlzwLcJrjwuizEGkRbTrSqR+DwP/MjCP/3NbHgT2/0XOCls6+gFjKl7w92XAEuAXxDb7GtzgR5mNjo8Z76Z7R7x/iSChNELmBpfdUTip8Qh7V3DNo7rmtn+GiAfmG1mH4brjXmMYFjrj4D7gXeA9RHvPwAsdPc5zQXo7lsJekv90czeA94FDojY5EWgL/Cwa7hraQMaVl0kScysk7tvDOcZfws40N2Xhe/9HZjl7nc0se/nQHkz3XFjieFu4Cl3f7Q1xxGJpCsOkeR5yszeBV4HrolIGjOBvQiuRJqykqBbb5MPADbHzB4ADiFoSxFJGF1xiIhIXHTFISIicVHiEBGRuChxiIhIXJQ4REQkLkocIiISFyUOERGJy/8HiPDbF0kJR7wAAAAASUVORK5CYII=\n", "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -991,7 +942,6 @@ "cell_type": "code", "execution_count": 32, "metadata": { - "collapsed": false, "scrolled": true }, "outputs": [ @@ -1025,11 +975,11 @@ " %%%%%%%%%%%\n", "\n", " | The OpenMC Monte Carlo Code\n", - " Copyright | 2011-2017 Massachusetts Institute of Technology\n", + " Copyright | 2011-2018 Massachusetts Institute of Technology\n", " License | http://openmc.readthedocs.io/en/latest/license.html\n", - " Version | 0.8.0\n", - " Git SHA1 | 4b01fd311461f1350989cb84ec18fe2cbaa8fa9f\n", - " Date/Time | 2017-03-10 17:31:49\n", + " Version | 0.10.0\n", + " Git SHA1 | 6c2d82a4d7dfe10312329d5969568fc03a698416\n", + " Date/Time | 2018-04-22 15:04:03\n", " OpenMP Threads | 8\n", "\n", "\n", @@ -1038,23 +988,13 @@ "\n", " ============================> RESULTS <============================\n", "\n", - " k-effective (Collision) = 1.16235 +/- 0.00111\n", - " k-effective (Track-length) = 1.16345 +/- 0.00134\n", - " k-effective (Absorption) = 1.16397 +/- 0.00058\n", - " Combined k-effective = 1.16388 +/- 0.00058\n", + " k-effective (Collision) = 1.16541 +/- 0.00086\n", + " k-effective (Track-length) = 1.16590 +/- 0.00096\n", + " k-effective (Absorption) = 1.16469 +/- 0.00046\n", + " Combined k-effective = 1.16480 +/- 0.00045\n", " Leakage Fraction = 0.00000 +/- 0.00000\n", "\n" ] - }, - { - "data": { - "text/plain": [ - "0" - ] - }, - "execution_count": 32, - "metadata": {}, - "output_type": "execute_result" } ], "source": [ @@ -1075,9 +1015,7 @@ { "cell_type": "code", "execution_count": 33, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Move the StatePoint File\n", @@ -1108,9 +1046,7 @@ { "cell_type": "code", "execution_count": 34, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "ce_keff = sp.k_combined" @@ -1126,26 +1062,24 @@ { "cell_type": "code", "execution_count": 35, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "Continuous-Energy keff = 1.165379\n", - "Multi-Group keff = 1.163885\n", - "bias [pcm]: 149.4\n" + "Continuous-Energy keff = 1.164600+/-0.000677\n", + "Multi-Group keff = 1.164805+/-0.000448\n", + "bias [pcm]: -20.4\n" ] } ], "source": [ - "bias = 1.0E5 * (ce_keff[0] - mg_keff[0])\n", + "bias = 1.0E5 * (ce_keff - mg_keff)\n", "\n", - "print('Continuous-Energy keff = {0:1.6f}'.format(ce_keff[0]))\n", - "print('Multi-Group keff = {0:1.6f}'.format(mg_keff[0]))\n", - "print('bias [pcm]: {0:1.1f}'.format(bias))" + "print('Continuous-Energy keff = {0:1.6f}'.format(ce_keff))\n", + "print('Multi-Group keff = {0:1.6f}'.format(mg_keff))\n", + "print('bias [pcm]: {0:1.1f}'.format(bias.nominal_value))" ] }, { @@ -1174,9 +1108,7 @@ { "cell_type": "code", "execution_count": 36, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Get the OpenMC fission rate mesh tally data\n", @@ -1200,9 +1132,7 @@ { "cell_type": "code", "execution_count": 37, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Get the OpenMC fission rate mesh tally data\n", @@ -1226,14 +1156,12 @@ { "cell_type": "code", "execution_count": 38, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, "execution_count": 38, @@ -1242,9 +1170,9 @@ }, { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAADHCAYAAAAeaDj1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnX28XdO1979DJEISCXmViPcUiVbK8Xa5V0q9hdK6qBQN\nRVBanra32qaXVG891VK0aBopURStFqmmIg9FtaXCjfeXaCQViYSQhESQGM8fax322dlnj5mzz/v6\nfT+f8zl7r/Vbc4611lhjz7XWHHOauyOEEKI4rNfWBgghhGhdFPiFEKJgKPALIUTBUOAXQoiCocAv\nhBAFQ4FfCCEKRocK/Gb2tJmNams7ioyZ/cnMxtaw/UQz++/mtKlomJmb2XZV1nfa60T+10y4e01/\nwBeAmcDbwELgT8A+zVDuFOB/ai2nLf/yfXgvPzb1f4+3tV0Jdk8A3i+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SSSX9U2BZWa2G0D6f3kj+xPE3Ze5+xZ3fx/4JU1nWze5uAbFdkNS37Fd7Yn/WaC/me1lZq2As4DJjexTUcysvZl1rP0MDAXmlF6qapgMnJd+Pg94oBF9iaL2YE45laazrZtUXINiu6Gp79jeuZKNVRp332xmo4FHgBbAre7+QiO7VYqewCQzg2Tb3uXuf25cl7bHzO4GhgDdzGwRcA3wA+B3ZnYhSQ+SZzaeh9tTxOchZjaI5NJ9PnBxozm4AzTBuAbFdr3RGLGtyl0hhMgY1X6rRwghRIVR4hdCiIyhxC+EEBlDiV8IITKGEr8QQmQMJX4hhMgYSvxCCJExlPiFECJj/H9ylB0qVZDZzAAAAABJRU5ErkJggg==\n", "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -1304,9 +1232,7 @@ { "cell_type": "code", "execution_count": 39, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Set the maximum scattering order to 0 (i.e., isotropic scattering)\n", @@ -1326,9 +1252,7 @@ { "cell_type": "code", "execution_count": 40, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -1360,11 +1284,11 @@ " %%%%%%%%%%%\n", "\n", " | The OpenMC Monte Carlo Code\n", - " Copyright | 2011-2017 Massachusetts Institute of Technology\n", + " Copyright | 2011-2018 Massachusetts Institute of Technology\n", " License | http://openmc.readthedocs.io/en/latest/license.html\n", - " Version | 0.8.0\n", - " Git SHA1 | 4b01fd311461f1350989cb84ec18fe2cbaa8fa9f\n", - " Date/Time | 2017-03-10 17:32:18\n", + " Version | 0.10.0\n", + " Git SHA1 | 6c2d82a4d7dfe10312329d5969568fc03a698416\n", + " Date/Time | 2018-04-22 15:04:39\n", " OpenMP Threads | 8\n", "\n", "\n", @@ -1373,23 +1297,13 @@ "\n", " ============================> RESULTS <============================\n", "\n", - " k-effective (Collision) = 1.16104 +/- 0.00109\n", - " k-effective (Track-length) = 1.16004 +/- 0.00125\n", - " k-effective (Absorption) = 1.16297 +/- 0.00061\n", - " Combined k-effective = 1.16273 +/- 0.00061\n", + " k-effective (Collision) = 1.16379 +/- 0.00090\n", + " k-effective (Track-length) = 1.16469 +/- 0.00101\n", + " k-effective (Absorption) = 1.16315 +/- 0.00052\n", + " Combined k-effective = 1.16335 +/- 0.00050\n", " Leakage Fraction = 0.00000 +/- 0.00000\n", "\n" ] - }, - { - "data": { - "text/plain": [ - "0" - ] - }, - "execution_count": 40, - "metadata": {}, - "output_type": "execute_result" } ], "source": [ @@ -1407,16 +1321,14 @@ { "cell_type": "code", "execution_count": 41, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "P3 bias [pcm]: 149.4\n", - "P0 bias [pcm]: 265.3\n" + "P3 bias [pcm]: -20.4\n", + "P0 bias [pcm]: 125.1\n" ] } ], @@ -1434,10 +1346,10 @@ "# Get keff\n", "mg_p0_keff = mgsp_p0.k_combined\n", "\n", - "bias_p0 = 1.0E5 * (ce_keff[0] - mg_p0_keff[0])\n", + "bias_p0 = 1.0E5 * (ce_keff - mg_p0_keff)\n", "\n", - "print('P3 bias [pcm]: {0:1.1f}'.format(bias))\n", - "print('P0 bias [pcm]: {0:1.1f}'.format(bias_p0))" + "print('P3 bias [pcm]: {0:1.1f}'.format(bias.nominal_value))\n", + "print('P0 bias [pcm]: {0:1.1f}'.format(bias_p0.nominal_value))" ] }, { @@ -1453,9 +1365,7 @@ { "cell_type": "code", "execution_count": 42, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Convert the zircaloy and fuel data to P0 scattering\n", @@ -1474,9 +1384,7 @@ { "cell_type": "code", "execution_count": 43, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Convert the formats as discussed\n", @@ -1501,9 +1409,7 @@ { "cell_type": "code", "execution_count": 44, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -1535,11 +1441,11 @@ " %%%%%%%%%%%\n", "\n", " | The OpenMC Monte Carlo Code\n", - " Copyright | 2011-2017 Massachusetts Institute of Technology\n", + " Copyright | 2011-2018 Massachusetts Institute of Technology\n", " License | http://openmc.readthedocs.io/en/latest/license.html\n", - " Version | 0.8.0\n", - " Git SHA1 | 4b01fd311461f1350989cb84ec18fe2cbaa8fa9f\n", - " Date/Time | 2017-03-10 17:32:48\n", + " Version | 0.10.0\n", + " Git SHA1 | 6c2d82a4d7dfe10312329d5969568fc03a698416\n", + " Date/Time | 2018-04-22 15:05:16\n", " OpenMP Threads | 8\n", "\n", "\n", @@ -1548,23 +1454,13 @@ "\n", " ============================> RESULTS <============================\n", "\n", - " k-effective (Collision) = 1.16348 +/- 0.00117\n", - " k-effective (Track-length) = 1.16263 +/- 0.00133\n", - " k-effective (Absorption) = 1.16485 +/- 0.00063\n", - " Combined k-effective = 1.16459 +/- 0.00061\n", + " k-effective (Collision) = 1.16471 +/- 0.00093\n", + " k-effective (Track-length) = 1.16412 +/- 0.00106\n", + " k-effective (Absorption) = 1.16449 +/- 0.00050\n", + " Combined k-effective = 1.16441 +/- 0.00049\n", " Leakage Fraction = 0.00000 +/- 0.00000\n", "\n" ] - }, - { - "data": { - "text/plain": [ - "0" - ] - }, - "execution_count": 44, - "metadata": {}, - "output_type": "execute_result" } ], "source": [ @@ -1587,16 +1483,14 @@ { "cell_type": "code", "execution_count": 45, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "P3 bias [pcm]: 149.4\n", - "Mixed Scattering bias [pcm]: 79.0\n" + "P3 bias [pcm]: -20.4\n", + "Mixed Scattering bias [pcm]: 19.5\n" ] } ], @@ -1605,16 +1499,17 @@ "mgsp_mixed = openmc.StatePoint('./statepoint.' + str(batches) + '.h5')\n", "\n", "mg_mixed_keff = mgsp_mixed.k_combined\n", - "bias_mixed = 1.0E5 * (ce_keff[0] - mg_mixed_keff[0])\n", + "bias_mixed = 1.0E5 * (ce_keff - mg_mixed_keff)\n", "\n", - "print('P3 bias [pcm]: {0:1.1f}'.format(bias))\n", - "print('Mixed Scattering bias [pcm]: {0:1.1f}'.format(bias_mixed))" + "print('P3 bias [pcm]: {0:1.1f}'.format(bias.nominal_value))\n", + "print('Mixed Scattering bias [pcm]: {0:1.1f}'.format(bias_mixed.nominal_value))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ + "\n", "Our tests in this section showed the flexibility of data formatting within OpenMC's multi-group mode: every material can be represented with its own format with the approximations that make the most sense. Now, as you'll see above, the runtimes from our P3, P0, and mixed cases are not significantly different and therefore this might not be a useful strategy for multi-group Monte Carlo. However, this capability provides a useful benchmark for the accuracy hit one may expect due to these scattering approximations before implementing this generality in a deterministic solver where the runtime savings are more significant.\n", "\n", "**NOTE**: The biases obtained above with P3, P0, and mixed representations do not necessarily reflect the inherent accuracies of the options. These cases were *not* run with a sufficient number of histories to truly differentiate methods improvement from statistical noise." @@ -1623,9 +1518,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "openmc", "language": "python", - "name": "python3" + "name": "openmc" }, "language_info": { "codemirror_mode": { @@ -1637,9 +1532,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.0" + "version": "3.6.5" } }, "nbformat": 4, - "nbformat_minor": 0 + "nbformat_minor": 1 } diff --git a/examples/jupyter/mg-mode-part-iii.ipynb b/examples/jupyter/mg-mode-part-iii.ipynb index c36ecd54af..2f37070c14 100644 --- a/examples/jupyter/mg-mode-part-iii.ipynb +++ b/examples/jupyter/mg-mode-part-iii.ipynb @@ -23,9 +23,7 @@ { "cell_type": "code", "execution_count": 1, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "import os\n", @@ -48,9 +46,7 @@ { "cell_type": "code", "execution_count": 2, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Instantiate some elements\n", @@ -74,9 +70,7 @@ { "cell_type": "code", "execution_count": 3, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "materials = {}\n", @@ -127,9 +121,7 @@ { "cell_type": "code", "execution_count": 4, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Instantiate a Materials object\n", @@ -156,9 +148,7 @@ { "cell_type": "code", "execution_count": 5, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Set constants for the problem and assembly dimensions\n", @@ -207,9 +197,7 @@ { "cell_type": "code", "execution_count": 6, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Set regions for geometry building\n", @@ -253,9 +241,7 @@ { "cell_type": "code", "execution_count": 7, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "universes = {}\n", @@ -295,9 +281,7 @@ { "cell_type": "code", "execution_count": 8, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Create fuel assembly Lattice\n", @@ -336,9 +320,7 @@ { "cell_type": "code", "execution_count": 9, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# The top portion of the blade, poisoned with B4C\n", @@ -372,9 +354,7 @@ { "cell_type": "code", "execution_count": 10, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Create root Universe\n", @@ -396,15 +376,23 @@ { "cell_type": "code", "execution_count": 11, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFhZJREFUeJztnXvsZVdVxz/LPqy0E9o6BQZamGKgSW14tAM2iKTII1Ab\nqo1/0EAsQjLBAILBkAIJvzvxHxAl4iPqTxgLQiCKFJoK8gqKJrQ61L6hlEKFqaVDKYJGAxaWf9zz\nK3fu3Mc+Z+997j77fD/Jzu8+9l1nnbXOOnv/zl5nHXN3hBDj4yc2r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AL\nMVIU/EKMFAW/ECNFwS/ESFHwCzFSFPxCjJT/BxyE408xjk5NAAAAAElFTkSuQmCC\n", "text/plain": [ - "" + "" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAFodJREFUeJztnX/MJldVxz/H/qDSbujWLbDQyrYEmtRGpF2wIpJioZbaUG34ow3EQkk2KCAYDCmQ8D6r/4AoEX9EfS0rIARQpNBUkFZE0YQWl9rfUNpCha2lSykWjQYsHP945i3PPvv8uDNz78ydO99PcvM+P+5z5sw5c+bed+6ZM+buCCHGx4/0rYAQoh8U/EKMFAW/ECNFwS/ESFHwCzFSFPxCjBQFvxAjRcEvxEhR8AsxUo5c18HM9gEXAgfd/YyZz18LvBr4PvC37v7GdbKOOeYY37ZtWwt1F/Pggw9GlymGyll9K9Az9+L+oIX0XBv8wHuAPwLet/WBmT0fuAh4hrt/18weH7Kxbdu2cfHFF4d0rcXm5mZ0mWKo7O9bgZ7ZHdxz7bTf3T8LPDT38a8Cb3P371Z9DtZRTwjRP03/53868HNmdoOZ/ZOZPSumUkKI9IRM+5f97gTgbOBZwF+Z2am+4BZBM9sD7AE47rjjmuophIhM0+A/AHy0CvbPm9kPgB3AN+c7uvsmsAlw4oknHnZy2Nz8s4YqzBJDhhDjoum0/2PA8wHM7OnA0YAuuQsxIEKW+j4InAPsMLMDwAawD9hnZrcB3wMuWzTlF0Lky9rgd/dLl3z1ssi6CCE6RBl+QowUBb8QI0XBL8RIUfALMVIU/EKMFAW/ECNFwS/ESFHwCzFSFPxCjBQFvxAjRcEvxEhR8AsxUhT8QowU6/JOXDNbsDHdCSxEPHbjvj+oeq9GfiFGStMyXoNjY2Py6Ou9eydL+5Usd1bm0OTmbtuUclNR/LR//sCcp6mTVslNIVNy08rNTdfmhE/7cffOGtNI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db3lwEfX9DnU8B5Zra9mgqfV30WBTM7H3gj8GJ3/58lfUJ811aP2Ws7v7xEfro0+hhXDRdcobyA6RX2e4C3VJ/9FlNjAxzDdPp5N/B54NTI238u0+nkLcBNVbsAeBXwqqrPa4DbmV49vR54TgI7nFrJv7na1pYtZvUwpkVR7gFuBXYn0ONYpsH8uJnPktuC6cnmfuD/mP6v+kqm13Y+DdwF/D1wQtV3N3DlzG8vr46Pu4FXRNbhbqb/R28dG1srT08CPrHKd5H1+MvK57cwDeid83osi6cYTRl+QoyUoi/4CSGWo+AXYqQo+IUYKQp+IUaKgl+IkaLgF2KkKPiFGCkKfiFGyv8DmzfjTMCUIOAAAAAASUVORK5CYII=\n", + "text/plain": [ + "" ] }, "metadata": {}, @@ -435,9 +423,7 @@ { "cell_type": "code", "execution_count": 12, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Create Geometry and set root universe\n", @@ -459,9 +445,7 @@ { "cell_type": "code", "execution_count": 13, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# OpenMC simulation parameters\n", @@ -498,9 +482,7 @@ { "cell_type": "code", "execution_count": 14, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Instantiate a 2-group EnergyGroups object\n", @@ -518,9 +500,7 @@ { "cell_type": "code", "execution_count": 15, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Initialize a 2-group Isotropic MGXS Library for OpenMC\n", @@ -541,9 +521,7 @@ { "cell_type": "code", "execution_count": 16, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Specify multi-group cross section types to compute\n", @@ -563,9 +541,7 @@ { "cell_type": "code", "execution_count": 17, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Instantiate a tally Mesh\n", @@ -598,9 +574,7 @@ { "cell_type": "code", "execution_count": 18, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Set the scattering format to histogram and then define the number of bins\n", @@ -630,9 +604,7 @@ { "cell_type": "code", "execution_count": 19, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Let's repeat all of the above for an angular MGXS library so we can gather\n", @@ -662,9 +634,7 @@ { "cell_type": "code", "execution_count": 20, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Check the libraries - if no errors are raised, then the library is satisfactory.\n", @@ -684,15 +654,13 @@ { "cell_type": "code", "execution_count": 21, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "/home/romano/openmc/openmc/mgxs/mgxs.py:4106: UserWarning: The legendre order will be ignored since the scatter format is set to histogram\n", + "/home/nelsonag/git/openmc/openmc/mgxs/mgxs.py:4116: UserWarning: The legendre order will be ignored since the scatter format is set to histogram\n", " warnings.warn(msg)\n" ] } @@ -713,9 +681,7 @@ { "cell_type": "code", "execution_count": 22, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Create a \"tallies.xml\" file for the MGXS Library\n", @@ -734,27 +700,25 @@ { "cell_type": "code", "execution_count": 23, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "/home/romano/openmc/openmc/mixin.py:61: IDWarning: Another MeshFilter instance already exists with id=1.\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=1.\n", " warn(msg, IDWarning)\n", - "/home/romano/openmc/openmc/mixin.py:61: IDWarning: Another EnergyFilter instance already exists with id=2.\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=2.\n", " warn(msg, IDWarning)\n", - "/home/romano/openmc/openmc/mixin.py:61: IDWarning: Another EnergyoutFilter instance already exists with id=11.\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=11.\n", " warn(msg, IDWarning)\n", - "/home/romano/openmc/openmc/mixin.py:61: IDWarning: Another PolarFilter instance already exists with id=21.\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=21.\n", " warn(msg, IDWarning)\n", - "/home/romano/openmc/openmc/mixin.py:61: IDWarning: Another AzimuthalFilter instance already exists with id=22.\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=22.\n", " warn(msg, IDWarning)\n", - "/home/romano/openmc/openmc/mixin.py:61: IDWarning: Another MuFilter instance already exists with id=12.\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=12.\n", " warn(msg, IDWarning)\n", - "/home/romano/openmc/openmc/mixin.py:61: IDWarning: Another EnergyFilter instance already exists with id=18.\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=18.\n", " warn(msg, IDWarning)\n" ] } @@ -787,9 +751,7 @@ { "cell_type": "code", "execution_count": 24, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -821,12 +783,12 @@ " %%%%%%%%%%%\n", "\n", " | The OpenMC Monte Carlo Code\n", - " Copyright | 2011-2017 Massachusetts Institute of Technology\n", + " Copyright | 2011-2018 Massachusetts Institute of Technology\n", " License | http://openmc.readthedocs.io/en/latest/license.html\n", - " Version | 0.9.0\n", - " Git SHA1 | da61fb4a55e1feaa127799ad9293a766161fbb3e\n", - " Date/Time | 2017-12-11 16:57:27\n", - " OpenMP Threads | 4\n", + " Version | 0.10.0\n", + " Git SHA1 | 6c2d82a4d7dfe10312329d5969568fc03a698416\n", + " Date/Time | 2018-04-24 19:15:17\n", + " OpenMP Threads | 8\n", "\n", "\n", " ====================> K EIGENVALUE SIMULATION <====================\n", @@ -841,16 +803,6 @@ " Leakage Fraction = 0.00000 +/- 0.00000\n", "\n" ] - }, - { - "data": { - "text/plain": [ - "0" - ] - }, - "execution_count": 24, - "metadata": {}, - "output_type": "execute_result" } ], "source": [ @@ -868,9 +820,7 @@ { "cell_type": "code", "execution_count": 25, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Move the StatePoint File\n", @@ -893,9 +843,7 @@ { "cell_type": "code", "execution_count": 26, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Load the statepoint file, but not the summary file, as it is a different filename than expected.\n", @@ -912,9 +860,7 @@ { "cell_type": "code", "execution_count": 27, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "su = openmc.Summary(ce_sumfile)\n", @@ -931,9 +877,7 @@ { "cell_type": "code", "execution_count": 28, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Initialize MGXS Library with OpenMC statepoint data\n", @@ -970,21 +914,13 @@ { "cell_type": "code", "execution_count": 29, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "/home/romano/openmc/openmc/tallies.py:1798: RuntimeWarning: invalid value encountered in true_divide\n", - " self_rel_err = data['self']['std. dev.'] / data['self']['mean']\n", - "/home/romano/openmc/openmc/tallies.py:1799: RuntimeWarning: invalid value encountered in true_divide\n", - " other_rel_err = data['other']['std. dev.'] / data['other']['mean']\n", - "/home/romano/openmc/openmc/tallies.py:1800: RuntimeWarning: invalid value encountered in true_divide\n", - " new_tally._mean = data['self']['mean'] / data['other']['mean']\n", - "/home/romano/openmc/openmc/mixin.py:61: IDWarning: Another Universe instance already exists with id=0.\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Universe instance already exists with id=0.\n", " warn(msg, IDWarning)\n" ] } @@ -1013,9 +949,7 @@ { "cell_type": "code", "execution_count": 30, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Set the energy mode\n", @@ -1035,16 +969,14 @@ { "cell_type": "code", "execution_count": 31, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Create a \"tallies.xml\" file for the MGXS Library\n", "tallies_file = openmc.Tallies()\n", "\n", "# Add our fission rate mesh tally\n", - "tallies_file.add_tally(tally)\n", + "tallies_file.append(tally)\n", "\n", "# Export to \"tallies.xml\"\n", "tallies_file.export_to_xml()" @@ -1060,15 +992,23 @@ { "cell_type": "code", "execution_count": 32, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEGVJREFUeJzt3XuwVeV9xvHvA0JQVC6iqKCijdhQx6iDisYLKdagdSS2\npsVWxRhjTZRgx4xDYkZtppncNU1zUaKoSRiNGiTWS8RrndpIghTlpiLGCwgcExUiGbn++sdeZLaH\nfWCz17u2h7zPZ+bMWWfv9/zWj7XPw1p7nXXWq4jAzPLT4/1uwMzeHw6/WaYcfrNMOfxmmXL4zTLl\n8JtlyuE3y5TDb5Yph98sUztta4CkqcDpQEdEHFr3+ETgEmAjcF9EXLGtWj0G9IidhvQs0W5je0Xv\n5DUBdn1l3+Q1Nx3wSvKaANFnSCV1X/vt65XUHTF4WCV1n1/6WvKaww5+N3lNgIWLhqcvun4FseFt\nNTN0m+EHbgG+B/x48wOSPgqMAz4cEWsl7dXUyob0ZK/pezQzdLtMXDs0eU2AY//l6uQ1111/cfKa\nAOs+9OVK6k4676pK6j552fWV1D1x8uXJa9587/zkNQE+fMzU5DU3Lbmg6bHbPOyPiCeANzs9/Bng\naxGxthjTsT0Nmtn7r9X3/MOBEyTNkvTfko5K2ZSZVa+Zw/6uvm8gMAo4CrhD0kHR4E8EJV0EXATQ\nc1+fXzTrLlpN41JgetT8GtgEDGo0MCKmRMTIiBjZY4DDb9ZdtJrGGcBHASQNB3oDv0vVlJlVr5lf\n9d0GjAYGSVoKXA1MBaZKmg+sAyY0OuQ3s+5rm+GPiLO7eOqcx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BmHZukwuo\nHXk1sq3XLoWJxXaf2sVboMq2xZ/1CT9JuwI/By6LiNWdnp4D7B8RhwH/CcyoqI3jI+Jwan/9eImk\nEytaz1YVF2KdAdzZ4Ol2bYv3iNpx7fv26yZJVwIbgGldDKn6tfshtcP5w4HlwLcT19+qKsLfzGW/\nTV0aXIakXtSCPy0ipnd+PiJWR8Q7xfL9QC9Jg1L2UNReVnzuAO6mdhhXr/JtUTgVmBMRKxv02JZt\nUVi5+W1N8bmjwZh2/HycD5wO/HPxn9AWmnjtSomIlRGxMSI2AT/qon5l26KK8Ddz2e89wHnFme5R\nwKq6Q8HSJAm4CVgUEdd2MWbvYhySjqa2LX6fqoeibl9Ju21epnaiqfMfNlW6LeqcTReH/O3YFnXu\nASYUyxOAXzQYU+ml45LGAlcAZ0TEH7sY08xrV7aP+nM7Z3ZRv7ptkeKsYYMzlKdRO8O+BLiyeOxi\n4OJiWdRuBLIEmAeMTLz+46kdTj4LzC0+TuvUw6XAAmpnT58CjqtgOxxU1H+mWFfbt0Wxjr7Uwtyv\n7rHKtwW1/2yWA+upvVf9FLAH8AiwGHgYGFiM3Re4f2s/Qwl7eJHa++jNPxvXd+6hq9cucR8/KV7z\nZ6kFep8qt0XnD1/hZ5apP+sTfmbWNYffLFMOv1mmHH6zTDn8Zply+M0y5fCbZcrhN8vU/wMMx8oY\niEeI+AAAAABJRU5ErkJggg==\n", "text/plain": [ - "" + "" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP8AAAD8CAYAAAC4nHJkAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAEK5JREFUeJzt3XuwVeV9xvHvI3eBKIgiUeptEozSWAimaozRkCHEWtCJrdiqEJOhSdRqa2q0dqrTdiYxaWyMWi1VGmOoGhWv9UaM1qYjoCIIgomgIFAuXgHxwsVf/9gLZ3s8h7PZ613bQ97nM3Pm7LP3u3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M7DwPPAL4GBxdhRwHV1zz2z+P+xGPha4h4WU/scve3/xrbfPH0cuG97r13iPm4sXvNnqAV6SNs+OspTii+f4WeWqd/pA35m1jGH3yxTDr9Zphx+s0w5/GaZcvjNMuXwm2XK4TfL1P8Dtoy80uUwig4AAAAASUVORK5CYII=\n", + "text/plain": [ + "" ] }, "metadata": {}, @@ -1093,9 +1033,7 @@ { "cell_type": "code", "execution_count": 33, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -1127,12 +1065,12 @@ " %%%%%%%%%%%\n", "\n", " | The OpenMC Monte Carlo Code\n", - " Copyright | 2011-2017 Massachusetts Institute of Technology\n", + " Copyright | 2011-2018 Massachusetts Institute of Technology\n", " License | http://openmc.readthedocs.io/en/latest/license.html\n", - " Version | 0.9.0\n", - " Git SHA1 | da61fb4a55e1feaa127799ad9293a766161fbb3e\n", - " Date/Time | 2017-12-11 17:00:35\n", - " OpenMP Threads | 4\n", + " Version | 0.10.0\n", + " Git SHA1 | 6c2d82a4d7dfe10312329d5969568fc03a698416\n", + " Date/Time | 2018-04-24 19:16:03\n", + " OpenMP Threads | 8\n", "\n", "\n", " ====================> K EIGENVALUE SIMULATION <====================\n", @@ -1147,16 +1085,6 @@ " Leakage Fraction = 0.00000 +/- 0.00000\n", "\n" ] - }, - { - "data": { - "text/plain": [ - "0" - ] - }, - "execution_count": 33, - "metadata": {}, - "output_type": "execute_result" } ], "source": [ @@ -1174,9 +1102,7 @@ { "cell_type": "code", "execution_count": 34, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "# Move the StatePoint File\n", @@ -1201,21 +1127,13 @@ { "cell_type": "code", "execution_count": 35, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "/home/romano/openmc/openmc/tallies.py:1798: RuntimeWarning: invalid value encountered in true_divide\n", - " self_rel_err = data['self']['std. dev.'] / data['self']['mean']\n", - "/home/romano/openmc/openmc/tallies.py:1799: RuntimeWarning: invalid value encountered in true_divide\n", - " other_rel_err = data['other']['std. dev.'] / data['other']['mean']\n", - "/home/romano/openmc/openmc/tallies.py:1800: RuntimeWarning: invalid value encountered in true_divide\n", - " new_tally._mean = data['self']['mean'] / data['other']['mean']\n", - "/home/romano/openmc/openmc/mixin.py:61: IDWarning: Another Universe instance already exists with id=0.\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Universe instance already exists with id=0.\n", " warn(msg, IDWarning)\n" ] } @@ -1237,9 +1155,7 @@ { "cell_type": "code", "execution_count": 36, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -1271,12 +1187,12 @@ " %%%%%%%%%%%\n", "\n", " | The OpenMC Monte Carlo Code\n", - " Copyright | 2011-2017 Massachusetts Institute of Technology\n", + " Copyright | 2011-2018 Massachusetts Institute of Technology\n", " License | http://openmc.readthedocs.io/en/latest/license.html\n", - " Version | 0.9.0\n", - " Git SHA1 | da61fb4a55e1feaa127799ad9293a766161fbb3e\n", - " Date/Time | 2017-12-11 17:00:59\n", - " OpenMP Threads | 4\n", + " Version | 0.10.0\n", + " Git SHA1 | 6c2d82a4d7dfe10312329d5969568fc03a698416\n", + " Date/Time | 2018-04-24 19:16:12\n", + " OpenMP Threads | 8\n", "\n", "\n", " ====================> K EIGENVALUE SIMULATION <====================\n", @@ -1291,16 +1207,6 @@ " Leakage Fraction = 0.00000 +/- 0.00000\n", "\n" ] - }, - { - "data": { - "text/plain": [ - "0" - ] - }, - "execution_count": 36, - "metadata": {}, - "output_type": "execute_result" } ], "source": [ @@ -1321,9 +1227,7 @@ { "cell_type": "code", "execution_count": 37, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "# Load the isotropic statepoint file\n", @@ -1346,9 +1250,7 @@ { "cell_type": "code", "execution_count": 38, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [], "source": [ "ce_keff = sp.k_combined\n", @@ -1356,8 +1258,8 @@ "angle_mg_keff = angle_mgsp.k_combined\n", "\n", "# Find eigenvalue bias\n", - "iso_bias = 1.0E5 * (ce_keff[0] - iso_mg_keff[0])\n", - "angle_bias = 1.0E5 * (ce_keff[0] - angle_mg_keff[0])" + "iso_bias = 1.0E5 * (ce_keff - iso_mg_keff)\n", + "angle_bias = 1.0E5 * (ce_keff - angle_mg_keff)" ] }, { @@ -1370,9 +1272,7 @@ { "cell_type": "code", "execution_count": 39, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -1384,8 +1284,8 @@ } ], "source": [ - "print('Isotropic to CE Bias [pcm]: {0:1.1f}'.format(iso_bias))\n", - "print('Angle to CE Bias [pcm]: {0:1.1f}'.format(angle_bias))" + "print('Isotropic to CE Bias [pcm]: {0:1.1f}'.format(iso_bias.nominal_value))\n", + "print('Angle to CE Bias [pcm]: {0:1.1f}'.format(angle_bias.nominal_value))" ] }, { @@ -1408,15 +1308,14 @@ "cell_type": "code", "execution_count": 40, "metadata": { - "collapsed": false, "scrolled": false }, "outputs": [ { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAArwAAAEDCAYAAADXztd+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xm8JGV56PHfw8ywwwwwyDbIcMUlmLgOKq5Eg0tc4Hqj\nQRFFo8REvHr1ynW7OknEJMbrbuLluuCCokFRg7tBQFzQATERAUNwdIZFQBhgBhGQ5/7x1hl6mnNO\nd59z3l5qft/Ppz8z3VX9vk/1qafq6aq3qyIzkSRJktpqm1EHIEmSJNVkwStJkqRWs+CVJElSq1nw\nSpIkqdUseCVJktRqFrySJElqNQveIYmIiyLisFHHIWn+IuKeEbExIhaNqP/VEfGJWaYfHRFfH2ZM\n2npExLERce6o4xiGiDgrIl486jgGERFrI+KPZpn+lYh4wTBjGgdbfcEbEc+NiDXNzuuqZkV49Dzb\nPDki3tL5WmbePzPPmlew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Pjjakga0D1mXm1N7/qZTk1MJpRc6ar2PBfK3PfB0PbchXaEHOjrLg/SFw74g4oBn8fCTwpRHGMycREZQxLRdn5jtGHc9cZObrMnN5Zq6g/B3OzMznjTisgWTm1cDaiLhv89ITgIn7YcOYm/icNV/Hg/k6FObrGGhDvkI7cnbxqDrOzDsi4jjg68Ai4COZedGo4pmHRwFHA/8eERc2r70+M78ywpi2VC8HTm5W7pcDLxxxPK3Skpw1X8eH+VqR+aoKJjpnvdOaJEmSWs0frUmSJKnVLHglSZLUaha8kiRJajULXkmSJLWaBa8kSZJazYJXkiRJrWbBK0mSpFaz4JUkSVKr/Rd/Zm/mz9XSWgAAAABJRU5ErkJggg==\n", "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -1466,14 +1365,12 @@ { "cell_type": "code", "execution_count": 41, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, "execution_count": 41, @@ -1482,9 +1379,9 @@ }, { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAt0AAAFfCAYAAACSp3C8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmYZWV57/3vj2aSQRpsxGZsBxzQKGoLGj0J0WjACfUk\nCFFAHNATcTp5Y5SYaAYN8XUIRiNBRSAqSlQiUdTggKhxYBAVBBWxkW4amnkUEbjPH2tV9d5FddUu\n2LtWDd/Pde2r9l7jvVdXP+uuZ93rWakqJEmSJI3ORl0HIEmSJC10Jt2SJEnSiJl0S5IkSSNm0i1J\nkiSNmEm3JEmSNGIm3ZIkSdKImXSrT5Jdk9ycZElH+39bko9NMf9FSf57NmOSNLgkL0nyra7jmA1J\nzkjy8q7jmIkkq5L84RTzv5jk0NmMSVosTLpn0XSN3YDbGGkjX1W/qqqtqurOGcb1kiSV5L0Tpu/f\nTj9+prEkWdGuu3FPfB+vqmdMs97KJJ9Pcl2S65P8JMnbk2w70xikhaxtT65Lsln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IkSRoxk25JkiRpxEy6JUmSpBEz6ZYkSZJGzKRbkiRJGjGTbkmSJGnETLolSZKkEfv/AaNFf9tV0ZDyAAAAAElFTkSuQmCC\n", "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -1520,9 +1417,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "openmc", "language": "python", - "name": "python3" + "name": "openmc" }, "language_info": { "codemirror_mode": { @@ -1534,9 +1431,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.0" + "version": "3.6.5" } }, "nbformat": 4, - "nbformat_minor": 0 + "nbformat_minor": 1 } diff --git a/examples/jupyter/mgxs-part-iii.ipynb b/examples/jupyter/mgxs-part-iii.ipynb index 450276c89f..4171486a81 100644 --- a/examples/jupyter/mgxs-part-iii.ipynb +++ b/examples/jupyter/mgxs-part-iii.ipynb @@ -24,17 +24,15 @@ { "cell_type": "code", "execution_count": 1, - "metadata": { - "collapsed": false - }, + "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "/home/wbinventor/miniconda3/lib/python3.5/site-packages/matplotlib/__init__.py:1350: UserWarning: This call to matplotlib.use() has no effect\n", - "because the backend has already been chosen;\n", - "matplotlib.use() must be called *before* pylab, matplotlib.pyplot,\n", + "/home/nelsonag/python/openmc/lib/python3.6/site-packages/matplotlib/__init__.py:1405: UserWarning: \n", + "This call to matplotlib.use() has no effect because the backend has already\n", + "been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot,\n", "or matplotlib.backends is imported for the first time.\n", "\n", " warnings.warn(_use_error_msg)\n" @@ -68,10 +66,8 @@ }, { "cell_type": "code", - "execution_count": 3, - "metadata": { - "collapsed": true - }, + "execution_count": 2, + "metadata": {}, "outputs": [], "source": [ "# 1.6 enriched fuel\n", @@ -103,10 +99,8 @@ }, { "cell_type": "code", - "execution_count": 4, - "metadata": { - "collapsed": true - }, + "execution_count": 3, + "metadata": {}, "outputs": [], "source": [ "# Instantiate a Materials object\n", @@ -125,10 +119,8 @@ }, { "cell_type": "code", - "execution_count": 5, - "metadata": { - "collapsed": true - }, + "execution_count": 4, + "metadata": {}, "outputs": [], "source": [ "# Create cylinders for the fuel and clad\n", @@ -153,10 +145,8 @@ }, { "cell_type": "code", - "execution_count": 6, - "metadata": { - "collapsed": true - }, + "execution_count": 5, + "metadata": {}, "outputs": [], "source": [ "# Create a Universe to encapsulate a fuel pin\n", @@ -190,10 +180,8 @@ }, { "cell_type": "code", - "execution_count": 7, - "metadata": { - "collapsed": true - }, + "execution_count": 6, + "metadata": {}, "outputs": [], "source": [ "# Create a Universe to encapsulate a control rod guide tube\n", @@ -227,10 +215,8 @@ }, { "cell_type": "code", - "execution_count": 8, - "metadata": { - "collapsed": true - }, + "execution_count": 7, + "metadata": {}, "outputs": [], "source": [ "# Create fuel assembly Lattice\n", @@ -248,10 +234,8 @@ }, { "cell_type": "code", - "execution_count": 9, - "metadata": { - "collapsed": true - }, + "execution_count": 8, + "metadata": {}, "outputs": [], "source": [ "# Create array indices for guide tube locations in lattice\n", @@ -280,10 +264,8 @@ }, { "cell_type": "code", - "execution_count": 10, - "metadata": { - "collapsed": true - }, + "execution_count": 9, + "metadata": {}, "outputs": [], "source": [ "# Create root Cell\n", @@ -307,10 +289,8 @@ }, { "cell_type": "code", - "execution_count": 11, - "metadata": { - "collapsed": true - }, + "execution_count": 10, + "metadata": {}, "outputs": [], "source": [ "# Create Geometry and set root Universe\n", @@ -319,10 +299,8 @@ }, { "cell_type": "code", - "execution_count": 12, - "metadata": { - "collapsed": true - }, + "execution_count": 11, + "metadata": {}, "outputs": [], "source": [ "# Export to \"geometry.xml\"\n", @@ -338,16 +316,14 @@ }, { "cell_type": "code", - "execution_count": 13, - "metadata": { - "collapsed": false - }, + "execution_count": 12, + "metadata": {}, "outputs": [], "source": [ "# OpenMC simulation parameters\n", "batches = 50\n", "inactive = 10\n", - "particles = 2500\n", + "particles = 10000\n", "\n", "# Instantiate a Settings object\n", "settings_file = openmc.Settings()\n", @@ -374,10 +350,8 @@ }, { "cell_type": "code", - "execution_count": 14, - "metadata": { - "collapsed": true - }, + "execution_count": 13, + "metadata": {}, "outputs": [], "source": [ "# Instantiate a Plot\n", @@ -402,22 +376,9 @@ }, { "cell_type": "code", - "execution_count": 15, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "text/plain": [ - "0" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], + "execution_count": 14, + "metadata": {}, + "outputs": [], "source": [ "# Run openmc in plotting mode\n", "openmc.plot_geometry(output=False)" @@ -425,19 +386,17 @@ }, { "cell_type": "code", - "execution_count": 16, - "metadata": { - "collapsed": false - }, + "execution_count": 15, + "metadata": {}, "outputs": [ { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6AgMAAAD1grKuAAAABGdBTUEAALGPC/xhBQAAACBjSFJN\nAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEX///9yEhLpgJFNv8Tq\nQYT7AAAAAWJLR0QAiAUdSAAAAAd0SU1FB+ECGxMVJhfMn7kAAAWFSURBVGje7Zs7cttADIZ9CSvX\ncrP0iCxUqbBc8Ag6xR6BhV2EvYvwFD4CCx1ABT1jMdgndpegRQnOrCbjpPlGESISC4A/gd27e8H5\n83CX3b4+iKJrRHkS4vkghMPBonRYWGwtfgD2YN+dRDUOoh6lACw0Noi9w2fESuEoAR/uVuMolX03\n9oXGT7F3eFL2iEfhUX1f4cPdL/ishs+68ai+udE4xPhexbjX2FfjGNoPj/DPNX4Tsd+EODr8FvsV\ndf1Hd9P2VvCi4+s/aXvrf+upAD+1/9GV1mkOH5X9vV6THtfvACslcaUCbESL61drBPtdI8SrFMWr\nELsXCkuFDYW75gbiP7d9Cf7bAYI/aCwUShrBvh30+lWQkzVgZ/HD4OixNCgcQpJ3BxU/Ln91elKo\nM5VEE38QtJ+Yv6cQ9xjKNYayyl8TypP8DfJnQ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2lfxfOb87qXzr+b1j/Xlp/nP6dn98McdH7cn7zjPObKsYWS3Eb9w8n85smHtqQuPuZ30T2dlIT6F9xFl+n8xslegL9a4c2KRr9W4rp/GYqumiM9Nec/j2v/yj9u1h//hv9e93vc++f63/u+rPjL3f+5Lbn1j9m/eXWf+7zh/v8+2b9e/Hzn6s/uPqHrb8g71n6L3f+5Lbnvn8w33+4718/+5d47//c/gO7/5E7/nPbc/tv3P4fs//I7X9y+6/fqH+v6j9z+9/c/ju3/8+eP+TOn9z23PkXc/7Gnf9x5483q38Xzn+582fu/Js9fy8kb/6fO39y23P3n3S8/S/c/Tfc/T83uX/pgv1XE/9duP+Lu/+Mvf8td/znti8kb/8ld/9nx9t/Sjw/Ltr/yt1/+337f6/bf0zoB3nJ/ucVc/81d/83e/957vzJbc89/8A8f8E9/5HE78XnT/4H/cs5f8Q9/8Q9f8U+/5U7f3Lbc88fdrzzjyvm+cuf/Uu887/c88fs88954/8vO4SjPC+2QRIAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTgtMDQtMjRUMTk6MjA6NDgtMDQ6MDCGN87lAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE4LTA0LTI0VDE5OjIwOjQ4LTA0OjAw92p2WQAAAABJRU5ErkJggg==\n", "text/plain": [ "" ] }, - "execution_count": 16, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -473,10 +432,8 @@ }, { "cell_type": "code", - "execution_count": 17, - "metadata": { - "collapsed": false - }, + "execution_count": 16, + "metadata": {}, "outputs": [], "source": [ "# Instantiate a 2-group EnergyGroups object\n", @@ -493,10 +450,8 @@ }, { "cell_type": "code", - "execution_count": 18, - "metadata": { - "collapsed": false - }, + "execution_count": 17, + "metadata": {}, "outputs": [], "source": [ "# Initialize a 2-group MGXS Library for OpenMOC\n", @@ -526,21 +481,19 @@ "* `ChiDelayed` (`\"chi-delayed\"`)\n", "* `Beta` (`\"beta\"`)\n", "\n", - "In this case, let's create the multi-group cross sections needed to run an OpenMOC simulation to verify the accuracy of our cross sections. In particular, we will define `\"transport\"`, `\"nu-fission\"`, `'\"fission\"`, `\"nu-scatter matrix\"` and `\"chi\"` cross sections for our `Library`.\n", + "In this case, let's create the multi-group cross sections needed to run an OpenMOC simulation to verify the accuracy of our cross sections. In particular, we will define `\"nu-transport\"`, `\"nu-fission\"`, `'\"fission\"`, `\"nu-scatter matrix\"` and `\"chi\"` cross sections for our `Library`.\n", "\n", "**Note**: A variety of different approximate transport-corrected total multi-group cross sections (and corresponding scattering matrices) can be found in the literature. At the present time, the `openmc.mgxs` module only supports the `\"P0\"` transport correction. This correction can be turned on and off through the boolean `Library.correction` property which may take values of `\"P0\"` (default) or `None`." ] }, { "cell_type": "code", - "execution_count": 19, - "metadata": { - "collapsed": false - }, + "execution_count": 18, + "metadata": {}, "outputs": [], "source": [ "# Specify multi-group cross section types to compute\n", - "mgxs_lib.mgxs_types = ['transport', 'nu-fission', 'fission', 'nu-scatter matrix', 'chi']" + "mgxs_lib.mgxs_types = ['nu-transport', 'nu-fission', 'fission', 'nu-scatter matrix', 'chi']" ] }, { @@ -554,10 +507,8 @@ }, { "cell_type": "code", - "execution_count": 20, - "metadata": { - "collapsed": true - }, + "execution_count": 19, + "metadata": {}, "outputs": [], "source": [ "# Specify a \"cell\" domain type for the cross section tally filters\n", @@ -576,10 +527,8 @@ }, { "cell_type": "code", - "execution_count": 21, - "metadata": { - "collapsed": true - }, + "execution_count": 20, + "metadata": {}, "outputs": [], "source": [ "# Compute cross sections on a nuclide-by-nuclide basis\n", @@ -595,10 +544,8 @@ }, { "cell_type": "code", - "execution_count": 22, - "metadata": { - "collapsed": true - }, + "execution_count": 21, + "metadata": {}, "outputs": [], "source": [ "# Construct all tallies needed for the multi-group cross section library\n", @@ -616,10 +563,8 @@ }, { "cell_type": "code", - "execution_count": 23, - "metadata": { - "collapsed": true - }, + "execution_count": 22, + "metadata": {}, "outputs": [], "source": [ "# Create a \"tallies.xml\" file for the MGXS Library\n", @@ -636,10 +581,8 @@ }, { "cell_type": "code", - "execution_count": 24, - "metadata": { - "collapsed": false - }, + "execution_count": 23, + "metadata": {}, "outputs": [], "source": [ "# Instantiate a tally Mesh\n", @@ -663,11 +606,32 @@ }, { "cell_type": "code", - "execution_count": 25, - "metadata": { - "collapsed": true - }, - "outputs": [], + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=126.\n", + " warn(msg, IDWarning)\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=21.\n", + " warn(msg, IDWarning)\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=2.\n", + " warn(msg, IDWarning)\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=3.\n", + " warn(msg, IDWarning)\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=4.\n", + " warn(msg, IDWarning)\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=96.\n", + " warn(msg, IDWarning)\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=15.\n", + " warn(msg, IDWarning)\n", + "/home/nelsonag/git/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=114.\n", + " warn(msg, IDWarning)\n" + ] + } + ], "source": [ "# Export all tallies to a \"tallies.xml\" file\n", "tallies_file.export_to_xml()" @@ -675,10 +639,8 @@ }, { "cell_type": "code", - "execution_count": 26, - "metadata": { - "collapsed": false - }, + "execution_count": 25, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -710,137 +672,111 @@ " %%%%%%%%%%%\n", "\n", " | The OpenMC Monte Carlo Code\n", - " Copyright | 2011-2017 Massachusetts Institute of Technology\n", + " Copyright | 2011-2018 Massachusetts Institute of Technology\n", " License | http://openmc.readthedocs.io/en/latest/license.html\n", - " Version | 0.8.0\n", - " Git SHA1 | 647bf77a57a3cc5cce24b39cb192e1b99f52e499\n", - " Date/Time | 2017-02-27 14:21:38\n", - " OpenMP Threads | 4\n", - "\n", - " ===========================================================================\n", - " ========================> INITIALIZATION <=========================\n", - " ===========================================================================\n", + " Version | 0.10.0\n", + " Git SHA1 | 6c2d82a4d7dfe10312329d5969568fc03a698416\n", + " Date/Time | 2018-04-24 19:20:48\n", + " OpenMP Threads | 8\n", "\n", " Reading settings XML file...\n", - " Reading geometry XML file...\n", - " Reading materials XML file...\n", " Reading cross sections XML file...\n", - " Reading U235 from\n", - " /home/wbinventor/Documents/NSE-CRPG-Codes/openmc/data/nndc_hdf5/U235.h5\n", - " Reading U238 from\n", - " /home/wbinventor/Documents/NSE-CRPG-Codes/openmc/data/nndc_hdf5/U238.h5\n", - " Reading O16 from\n", - " /home/wbinventor/Documents/NSE-CRPG-Codes/openmc/data/nndc_hdf5/O16.h5\n", - " Reading H1 from\n", - " /home/wbinventor/Documents/NSE-CRPG-Codes/openmc/data/nndc_hdf5/H1.h5\n", - " Reading B10 from\n", - " /home/wbinventor/Documents/NSE-CRPG-Codes/openmc/data/nndc_hdf5/B10.h5\n", - " Reading Zr90 from\n", - " /home/wbinventor/Documents/NSE-CRPG-Codes/openmc/data/nndc_hdf5/Zr90.h5\n", + " Reading materials XML file...\n", + " Reading geometry XML file...\n", + " Building neighboring cells lists for each surface...\n", + " Reading U235 from /opt/xsdata/nndc/U235.h5\n", + " Reading U238 from /opt/xsdata/nndc/U238.h5\n", + " Reading O16 from /opt/xsdata/nndc/O16.h5\n", + " Reading H1 from /opt/xsdata/nndc/H1.h5\n", + " Reading B10 from /opt/xsdata/nndc/B10.h5\n", + " Reading Zr90 from /opt/xsdata/nndc/Zr90.h5\n", " Maximum neutron transport energy: 2.00000E+07 eV for U235\n", " Reading tallies XML file...\n", - " Building neighboring cells lists for each surface...\n", + " Writing summary.h5 file...\n", " Initializing source particles...\n", "\n", - " ===========================================================================\n", " ====================> K EIGENVALUE SIMULATION <====================\n", - " ===========================================================================\n", "\n", " Bat./Gen. k Average k \n", " ========= ======== ==================== \n", - " 1/1 1.03852 \n", - " 2/1 0.99743 \n", - " 3/1 1.02987 \n", - " 4/1 1.04397 \n", - " 5/1 1.06262 \n", - " 6/1 1.06657 \n", - " 7/1 0.98574 \n", - " 8/1 1.04364 \n", - " 9/1 1.01253 \n", - " 10/1 1.02094 \n", - " 11/1 0.99586 \n", - " 12/1 1.00508 1.00047 +/- 0.00461\n", - " 13/1 1.05292 1.01795 +/- 0.01769\n", - " 14/1 1.04732 1.02530 +/- 0.01450\n", - " 15/1 1.04886 1.03001 +/- 0.01218\n", - " 16/1 1.00948 1.02659 +/- 0.01052\n", - " 17/1 1.02684 1.02662 +/- 0.00889\n", - " 18/1 0.97234 1.01984 +/- 0.01026\n", - " 19/1 0.99754 1.01736 +/- 0.00938\n", - " 20/1 0.98964 1.01459 +/- 0.00884\n", - " 21/1 1.04140 1.01703 +/- 0.00836\n", - " 22/1 1.03854 1.01882 +/- 0.00784\n", - " 23/1 1.05917 1.02192 +/- 0.00785\n", - " 24/1 1.02413 1.02208 +/- 0.00727\n", - " 25/1 1.03113 1.02268 +/- 0.00679\n", - " 26/1 1.05113 1.02446 +/- 0.00660\n", - " 27/1 1.03252 1.02494 +/- 0.00622\n", - " 28/1 1.05196 1.02644 +/- 0.00605\n", - " 29/1 0.99663 1.02487 +/- 0.00593\n", - " 30/1 1.01820 1.02454 +/- 0.00564\n", - " 31/1 1.02753 1.02468 +/- 0.00537\n", - " 32/1 1.02162 1.02454 +/- 0.00512\n", - " 33/1 1.04083 1.02525 +/- 0.00494\n", - " 34/1 1.03335 1.02558 +/- 0.00474\n", - " 35/1 1.01304 1.02508 +/- 0.00458\n", - " 36/1 0.99299 1.02385 +/- 0.00457\n", - " 37/1 1.04936 1.02479 +/- 0.00450\n", - " 38/1 1.02856 1.02493 +/- 0.00433\n", - " 39/1 1.03706 1.02535 +/- 0.00420\n", - " 40/1 1.08118 1.02721 +/- 0.00447\n", - " 41/1 1.00149 1.02638 +/- 0.00440\n", - " 42/1 1.00233 1.02563 +/- 0.00433\n", - " 43/1 1.03023 1.02577 +/- 0.00419\n", - " 44/1 1.03230 1.02596 +/- 0.00407\n", - " 45/1 0.98123 1.02468 +/- 0.00416\n", - " 46/1 1.02126 1.02458 +/- 0.00404\n", - " 47/1 0.99772 1.02386 +/- 0.00400\n", - " 48/1 1.02773 1.02396 +/- 0.00389\n", - " 49/1 1.01690 1.02378 +/- 0.00379\n", - " 50/1 1.02890 1.02391 +/- 0.00370\n", + " 1/1 1.03784 \n", + " 2/1 1.02297 \n", + " 3/1 1.02244 \n", + " 4/1 1.02344 \n", + " 5/1 1.02057 \n", + " 6/1 1.04077 \n", + " 7/1 1.00795 \n", + " 8/1 1.02418 \n", + " 9/1 1.02241 \n", + " 10/1 1.03731 \n", + " 11/1 1.01477 \n", + " 12/1 1.05315 1.03396 +/- 0.01919\n", + " 13/1 1.02824 1.03205 +/- 0.01124\n", + " 14/1 1.02858 1.03118 +/- 0.00800\n", + " 15/1 1.02176 1.02930 +/- 0.00647\n", + " 16/1 1.06046 1.03449 +/- 0.00741\n", + " 17/1 1.02066 1.03252 +/- 0.00657\n", + " 18/1 1.03088 1.03231 +/- 0.00569\n", + " 19/1 1.02021 1.03097 +/- 0.00520\n", + " 20/1 1.02717 1.03059 +/- 0.00466\n", + " 21/1 1.03455 1.03095 +/- 0.00423\n", + " 22/1 1.02917 1.03080 +/- 0.00387\n", + " 23/1 1.02800 1.03058 +/- 0.00356\n", + " 24/1 1.02935 1.03050 +/- 0.00330\n", + " 25/1 1.01612 1.02954 +/- 0.00322\n", + " 26/1 1.00549 1.02803 +/- 0.00336\n", + " 27/1 1.02824 1.02805 +/- 0.00316\n", + " 28/1 1.01487 1.02731 +/- 0.00307\n", + " 29/1 1.05544 1.02879 +/- 0.00326\n", + " 30/1 1.00467 1.02759 +/- 0.00332\n", + " 31/1 1.03942 1.02815 +/- 0.00321\n", + " 32/1 1.02587 1.02805 +/- 0.00306\n", + " 33/1 1.02938 1.02811 +/- 0.00292\n", + " 34/1 1.02838 1.02812 +/- 0.00280\n", + " 35/1 1.00052 1.02701 +/- 0.00290\n", + " 36/1 1.01722 1.02664 +/- 0.00281\n", + " 37/1 1.01881 1.02635 +/- 0.00272\n", + " 38/1 1.03928 1.02681 +/- 0.00266\n", + " 39/1 1.03802 1.02720 +/- 0.00260\n", + " 40/1 1.00710 1.02653 +/- 0.00260\n", + " 41/1 1.02558 1.02650 +/- 0.00251\n", + " 42/1 1.03499 1.02676 +/- 0.00245\n", + " 43/1 1.01128 1.02629 +/- 0.00242\n", + " 44/1 1.00442 1.02565 +/- 0.00243\n", + " 45/1 1.03444 1.02590 +/- 0.00238\n", + " 46/1 1.01799 1.02568 +/- 0.00232\n", + " 47/1 1.00814 1.02521 +/- 0.00231\n", + " 48/1 1.00500 1.02467 +/- 0.00231\n", + " 49/1 1.01960 1.02454 +/- 0.00225\n", + " 50/1 1.02431 1.02454 +/- 0.00219\n", " Creating state point statepoint.50.h5...\n", "\n", - " ===========================================================================\n", - " ======================> SIMULATION FINISHED <======================\n", - " ===========================================================================\n", - "\n", - "\n", " =======================> TIMING STATISTICS <=======================\n", "\n", - " Total time for initialization = 3.4887E-01 seconds\n", - " Reading cross sections = 2.1990E-01 seconds\n", - " Total time in simulation = 3.2195E+01 seconds\n", - " Time in transport only = 3.1778E+01 seconds\n", - " Time in inactive batches = 1.9903E+00 seconds\n", - " Time in active batches = 3.0205E+01 seconds\n", - " Time synchronizing fission bank = 5.9614E-03 seconds\n", - " Sampling source sites = 4.8344E-03 seconds\n", - " SEND/RECV source sites = 1.0392E-03 seconds\n", - " Time accumulating tallies = 1.5849E-03 seconds\n", - " Total time for finalization = 3.9664E-05 seconds\n", - " Total time elapsed = 3.2560E+01 seconds\n", - " Calculation Rate (inactive) = 12561.1 neutrons/second\n", - " Calculation Rate (active) = 3310.69 neutrons/second\n", + " Total time for initialization = 2.8179E-01 seconds\n", + " Reading cross sections = 2.5741E-01 seconds\n", + " Total time in simulation = 2.5787E+01 seconds\n", + " Time in transport only = 2.5724E+01 seconds\n", + " Time in inactive batches = 1.7591E+00 seconds\n", + " Time in active batches = 2.4028E+01 seconds\n", + " Time synchronizing fission bank = 1.3217E-02 seconds\n", + " Sampling source sites = 1.0464E-02 seconds\n", + " SEND/RECV source sites = 2.6486E-03 seconds\n", + " Time accumulating tallies = 2.7351E-04 seconds\n", + " Total time for finalization = 5.5454E-05 seconds\n", + " Total time elapsed = 2.6109E+01 seconds\n", + " Calculation Rate (inactive) = 56847.1 neutrons/second\n", + " Calculation Rate (active) = 16647.3 neutrons/second\n", "\n", " ============================> RESULTS <============================\n", "\n", - " k-effective (Collision) = 1.02621 +/- 0.00393\n", - " k-effective (Track-length) = 1.02391 +/- 0.00370\n", - " k-effective (Absorption) = 1.02077 +/- 0.00423\n", - " Combined k-effective = 1.02331 +/- 0.00353\n", + " k-effective (Collision) = 1.02204 +/- 0.00176\n", + " k-effective (Track-length) = 1.02454 +/- 0.00219\n", + " k-effective (Absorption) = 1.02370 +/- 0.00186\n", + " Combined k-effective = 1.02329 +/- 0.00157\n", " Leakage Fraction = 0.00000 +/- 0.00000\n", "\n" ] - }, - { - "data": { - "text/plain": [ - "0" - ] - }, - "execution_count": 26, - "metadata": {}, - "output_type": "execute_result" } ], "source": [ @@ -864,10 +800,8 @@ }, { "cell_type": "code", - "execution_count": 27, - "metadata": { - "collapsed": false - }, + "execution_count": 26, + "metadata": {}, "outputs": [], "source": [ "# Load the last statepoint file\n", @@ -883,10 +817,8 @@ }, { "cell_type": "code", - "execution_count": 28, - "metadata": { - "collapsed": false - }, + "execution_count": 27, + "metadata": {}, "outputs": [], "source": [ "# Initialize MGXS Library with OpenMC statepoint data\n", @@ -918,10 +850,8 @@ }, { "cell_type": "code", - "execution_count": 29, - "metadata": { - "collapsed": false - }, + "execution_count": 28, + "metadata": {}, "outputs": [], "source": [ "# Retrieve the NuFissionXS object for the fuel cell from the library\n", @@ -938,23 +868,26 @@ }, { "cell_type": "code", - "execution_count": 30, - "metadata": { - "collapsed": false - }, + "execution_count": 29, + "metadata": {}, "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/home/wbinventor/Documents/NSE-CRPG-Codes/openmc/openmc/tallies.py:1835: RuntimeWarning: invalid value encountered in true_divide\n", - " self_rel_err = data['self']['std. dev.'] / data['self']['mean']\n" - ] - }, { "data": { "text/html": [ "
\n", + "\n", "\n", " \n", " \n", @@ -969,23 +902,23 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -993,23 +926,23 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1020,16 +953,16 @@ "" ], "text/plain": [ - " cell group in nuclide mean std. dev.\n", - "3 10000 1 U235 8.096764e-03 3.130177e-05\n", - "4 10000 1 U238 7.364515e-03 4.510564e-05\n", - "5 10000 1 O16 0.000000e+00 0.000000e+00\n", - "0 10000 2 U235 3.611153e-01 2.048312e-03\n", - "1 10000 2 U238 6.735070e-07 3.780177e-09\n", - "2 10000 2 O16 0.000000e+00 0.000000e+00" + " cell group in nuclide mean std. dev.\n", + "3 1 1 U235 8.093482e-03 1.597406e-05\n", + "4 1 1 U238 7.347745e-03 2.082526e-05\n", + "5 1 1 O16 0.000000e+00 0.000000e+00\n", + "0 1 2 U235 3.615911e-01 1.206052e-03\n", + "1 1 2 U238 6.743056e-07 2.229534e-09\n", + "2 1 2 O16 0.000000e+00 0.000000e+00" ] }, - "execution_count": 30, + "execution_count": 29, "metadata": {}, "output_type": "execute_result" } @@ -1048,10 +981,8 @@ }, { "cell_type": "code", - "execution_count": 31, - "metadata": { - "collapsed": false - }, + "execution_count": 30, + "metadata": {}, "outputs": [ { "name": "stdout", @@ -1060,16 +991,16 @@ "Multi-Group XS\n", "\tReaction Type =\tnu-fission\n", "\tDomain Type =\tcell\n", - "\tDomain ID =\t10000\n", + "\tDomain ID =\t1\n", "\tNuclide =\tU235\n", "\tCross Sections [cm^-1]:\n", - " Group 1 [0.625 - 20000000.0eV]:\t8.10e-03 +/- 3.87e-01%\n", - " Group 2 [0.0 - 0.625 eV]:\t3.61e-01 +/- 5.67e-01%\n", + " Group 1 [0.625 - 20000000.0eV]:\t8.09e-03 +/- 1.97e-01%\n", + " Group 2 [0.0 - 0.625 eV]:\t3.62e-01 +/- 3.34e-01%\n", "\n", "\tNuclide =\tU238\n", "\tCross Sections [cm^-1]:\n", - " Group 1 [0.625 - 20000000.0eV]:\t7.36e-03 +/- 6.12e-01%\n", - " Group 2 [0.0 - 0.625 eV]:\t6.74e-07 +/- 5.61e-01%\n", + " Group 1 [0.625 - 20000000.0eV]:\t7.35e-03 +/- 2.83e-01%\n", + " Group 2 [0.0 - 0.625 eV]:\t6.74e-07 +/- 3.31e-01%\n", "\n", "\tNuclide =\tO16\n", "\tCross Sections [cm^-1]:\n", @@ -1084,7 +1015,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "/home/wbinventor/Documents/NSE-CRPG-Codes/openmc/openmc/tallies.py:1506: RuntimeWarning: invalid value encountered in true_divide\n", + "/home/nelsonag/git/openmc/openmc/tallies.py:1269: RuntimeWarning: invalid value encountered in true_divide\n", " data = self.std_dev[indices] / self.mean[indices]\n" ] } @@ -1102,24 +1033,9 @@ }, { "cell_type": "code", - "execution_count": 32, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/home/wbinventor/Documents/NSE-CRPG-Codes/openmc/openmc/tallies.py:1835: RuntimeWarning: invalid value encountered in true_divide\n", - " self_rel_err = data['self']['std. dev.'] / data['self']['mean']\n", - "/home/wbinventor/Documents/NSE-CRPG-Codes/openmc/openmc/tallies.py:1836: RuntimeWarning: invalid value encountered in true_divide\n", - " other_rel_err = data['other']['std. dev.'] / data['other']['mean']\n", - "/home/wbinventor/Documents/NSE-CRPG-Codes/openmc/openmc/tallies.py:1837: RuntimeWarning: invalid value encountered in true_divide\n", - " new_tally._mean = data['self']['mean'] / data['other']['mean']\n" - ] - } - ], + "execution_count": 31, + "metadata": {}, + "outputs": [], "source": [ "# Store the cross section data in an \"mgxs/mgxs.h5\" HDF5 binary file\n", "mgxs_lib.build_hdf5_store(filename='mgxs.h5', directory='mgxs')" @@ -1134,10 +1050,8 @@ }, { "cell_type": "code", - "execution_count": 33, - "metadata": { - "collapsed": true - }, + "execution_count": 32, + "metadata": {}, "outputs": [], "source": [ "# Store a Library and its MGXS objects in a pickled binary file \"mgxs/mgxs.pkl\"\n", @@ -1146,10 +1060,8 @@ }, { "cell_type": "code", - "execution_count": 34, - "metadata": { - "collapsed": true - }, + "execution_count": 33, + "metadata": {}, "outputs": [], "source": [ "# Instantiate a new MGXS Library from the pickled binary file \"mgxs/mgxs.pkl\"\n", @@ -1165,10 +1077,8 @@ }, { "cell_type": "code", - "execution_count": 35, - "metadata": { - "collapsed": false - }, + "execution_count": 34, + "metadata": {}, "outputs": [], "source": [ "# Create a 1-group structure\n", @@ -1180,23 +1090,26 @@ }, { "cell_type": "code", - "execution_count": 36, - "metadata": { - "collapsed": false - }, + "execution_count": 35, + "metadata": {}, "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/home/wbinventor/Documents/NSE-CRPG-Codes/openmc/openmc/tallies.py:1835: RuntimeWarning: invalid value encountered in true_divide\n", - " self_rel_err = data['self']['std. dev.'] / data['self']['mean']\n" - ] - }, { "data": { "text/html": [ "
\n", + "\n", "
31000011U2358.096764e-033.130177e-058.093482e-031.597406e-05
41000011U2387.364515e-034.510564e-057.347745e-032.082526e-05
51000011O160.000000e+00
01000012U2353.611153e-012.048312e-033.615911e-011.206052e-03
11000012U2386.735070e-073.780177e-096.743056e-072.229534e-09
21000012O160.000000e+00
\n", " \n", " \n", @@ -1211,23 +1124,23 @@ " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", - " \n", + " \n", " \n", " \n", " \n", @@ -1238,13 +1151,13 @@ "" ], "text/plain": [ - " cell group in nuclide mean std. dev.\n", - "0 10000 1 U235 0.074393 0.000308\n", - "1 10000 1 U238 0.005982 0.000036\n", - "2 10000 1 O16 0.000000 0.000000" + " cell group in nuclide mean std. dev.\n", + "0 1 1 U235 0.074672 0.000179\n", + "1 1 1 U238 0.005964 0.000017\n", + "2 1 1 O16 0.000000 0.000000" ] }, - "execution_count": 36, + "execution_count": 35, "metadata": {}, "output_type": "execute_result" } @@ -1273,10 +1186,8 @@ }, { "cell_type": "code", - "execution_count": 37, - "metadata": { - "collapsed": false - }, + "execution_count": 36, + "metadata": {}, "outputs": [], "source": [ "# Create an OpenMOC Geometry from the OpenMC Geometry\n", @@ -1292,24 +1203,9 @@ }, { "cell_type": "code", - "execution_count": 38, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/home/wbinventor/Documents/NSE-CRPG-Codes/openmc/openmc/tallies.py:1835: RuntimeWarning: invalid value encountered in true_divide\n", - " self_rel_err = data['self']['std. dev.'] / data['self']['mean']\n", - "/home/wbinventor/Documents/NSE-CRPG-Codes/openmc/openmc/tallies.py:1836: RuntimeWarning: invalid value encountered in true_divide\n", - " other_rel_err = data['other']['std. dev.'] / data['other']['mean']\n", - "/home/wbinventor/Documents/NSE-CRPG-Codes/openmc/openmc/tallies.py:1837: RuntimeWarning: invalid value encountered in true_divide\n", - " new_tally._mean = data['self']['mean'] / data['other']['mean']\n" - ] - } - ], + "execution_count": 37, + "metadata": {}, + "outputs": [], "source": [ "# Load the library into the OpenMOC geometry\n", "materials = load_openmc_mgxs_lib(mgxs_lib, openmoc_geometry)" @@ -1324,9 +1220,8 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 38, "metadata": { - "collapsed": false, "scrolled": true }, "outputs": [ @@ -1336,131 +1231,131 @@ "text": [ "[ NORMAL ] Importing ray tracing data from file...\n", "[ NORMAL ] Computing the eigenvalue...\n", - "[ NORMAL ] Iteration 0:\tk_eff = 0.823793\tres = 0.000E+00\n", - "[ NORMAL ] Iteration 1:\tk_eff = 0.780554\tres = 1.938E-01\n", - "[ NORMAL ] Iteration 2:\tk_eff = 0.739678\tres = 6.539E-02\n", - "[ NORMAL ] Iteration 3:\tk_eff = 0.711003\tres = 5.285E-02\n", - "[ NORMAL ] Iteration 4:\tk_eff = 0.689738\tres = 3.931E-02\n", - "[ NORMAL ] Iteration 5:\tk_eff = 0.675038\tres = 3.014E-02\n", - "[ NORMAL ] Iteration 6:\tk_eff = 0.665753\tres = 2.147E-02\n", - "[ NORMAL ] Iteration 7:\tk_eff = 0.661013\tres = 1.389E-02\n", - "[ NORMAL ] Iteration 8:\tk_eff = 0.660052\tres = 7.293E-03\n", - "[ NORMAL ] Iteration 9:\tk_eff = 0.662216\tres = 2.057E-03\n", - "[ NORMAL ] Iteration 10:\tk_eff = 0.666942\tres = 3.576E-03\n", - "[ NORMAL ] Iteration 11:\tk_eff = 0.673743\tres = 7.278E-03\n", - "[ NORMAL ] Iteration 12:\tk_eff = 0.682202\tres = 1.030E-02\n", - "[ NORMAL ] Iteration 13:\tk_eff = 0.691961\tres = 1.264E-02\n", - "[ NORMAL ] Iteration 14:\tk_eff = 0.702715\tres = 1.438E-02\n", - "[ NORMAL ] Iteration 15:\tk_eff = 0.714203\tres = 1.561E-02\n", - "[ NORMAL ] Iteration 16:\tk_eff = 0.726205\tres = 1.641E-02\n", - "[ NORMAL ] Iteration 17:\tk_eff = 0.738532\tres = 1.686E-02\n", - "[ NORMAL ] Iteration 18:\tk_eff = 0.751030\tres = 1.703E-02\n", - "[ NORMAL ] Iteration 19:\tk_eff = 0.763567\tres = 1.697E-02\n", - "[ NORMAL ] Iteration 20:\tk_eff = 0.776034\tres = 1.674E-02\n", - "[ NORMAL ] Iteration 21:\tk_eff = 0.788344\tres = 1.637E-02\n", - "[ NORMAL ] Iteration 22:\tk_eff = 0.800423\tres = 1.591E-02\n", - "[ NORMAL ] Iteration 23:\tk_eff = 0.812215\tres = 1.536E-02\n", - "[ NORMAL ] Iteration 24:\tk_eff = 0.823673\tres = 1.477E-02\n", - "[ NORMAL ] Iteration 25:\tk_eff = 0.834764\tres = 1.415E-02\n", - "[ NORMAL ] Iteration 26:\tk_eff = 0.845462\tres = 1.350E-02\n", - "[ NORMAL ] Iteration 27:\tk_eff = 0.855748\tres = 1.285E-02\n", - "[ NORMAL ] Iteration 28:\tk_eff = 0.865611\tres = 1.220E-02\n", - "[ NORMAL ] Iteration 29:\tk_eff = 0.875045\tres = 1.156E-02\n", - "[ NORMAL ] Iteration 30:\tk_eff = 0.884048\tres = 1.093E-02\n", - "[ NORMAL ] Iteration 31:\tk_eff = 0.892623\tres = 1.032E-02\n", - "[ NORMAL ] Iteration 32:\tk_eff = 0.900775\tres = 9.727E-03\n", - "[ NORMAL ] Iteration 33:\tk_eff = 0.908511\tres = 9.158E-03\n", - "[ NORMAL ] Iteration 34:\tk_eff = 0.915841\tres = 8.613E-03\n", - "[ NORMAL ] Iteration 35:\tk_eff = 0.922778\tres = 8.092E-03\n", - "[ NORMAL ] Iteration 36:\tk_eff = 0.929332\tres = 7.596E-03\n", - "[ NORMAL ] Iteration 37:\tk_eff = 0.935519\tres = 7.124E-03\n", - "[ NORMAL ] Iteration 38:\tk_eff = 0.941351\tres = 6.676E-03\n", - "[ NORMAL ] Iteration 39:\tk_eff = 0.946843\tres = 6.253E-03\n", - "[ NORMAL ] Iteration 40:\tk_eff = 0.952011\tres = 5.852E-03\n", - "[ NORMAL ] Iteration 41:\tk_eff = 0.956869\tres = 5.474E-03\n", - "[ NORMAL ] Iteration 42:\tk_eff = 0.961431\tres = 5.118E-03\n", - "[ NORMAL ] Iteration 43:\tk_eff = 0.965712\tres = 4.783E-03\n", - "[ NORMAL ] Iteration 44:\tk_eff = 0.969727\tres = 4.467E-03\n", - "[ NORMAL ] Iteration 45:\tk_eff = 0.973489\tres = 4.170E-03\n", - "[ NORMAL ] Iteration 46:\tk_eff = 0.977013\tres = 3.892E-03\n", - "[ NORMAL ] Iteration 47:\tk_eff = 0.980310\tres = 3.631E-03\n", - "[ NORMAL ] Iteration 48:\tk_eff = 0.983394\tres = 3.386E-03\n", - "[ NORMAL ] Iteration 49:\tk_eff = 0.986277\tres = 3.156E-03\n", - "[ NORMAL ] Iteration 50:\tk_eff = 0.988971\tres = 2.942E-03\n", - "[ NORMAL ] Iteration 51:\tk_eff = 0.991487\tres = 2.740E-03\n", - "[ NORMAL ] Iteration 52:\tk_eff = 0.993835\tres = 2.552E-03\n", - "[ NORMAL ] Iteration 53:\tk_eff = 0.996026\tres = 2.376E-03\n", - "[ NORMAL ] Iteration 54:\tk_eff = 0.998069\tres = 2.212E-03\n", - "[ NORMAL ] Iteration 55:\tk_eff = 0.999974\tres = 2.059E-03\n", - "[ NORMAL ] Iteration 56:\tk_eff = 1.001749\tres = 1.915E-03\n", - "[ NORMAL ] Iteration 57:\tk_eff = 1.003403\tres = 1.782E-03\n", - "[ NORMAL ] Iteration 58:\tk_eff = 1.004943\tres = 1.657E-03\n", - "[ NORMAL ] Iteration 59:\tk_eff = 1.006377\tres = 1.540E-03\n", - "[ NORMAL ] Iteration 60:\tk_eff = 1.007711\tres = 1.432E-03\n", - "[ NORMAL ] Iteration 61:\tk_eff = 1.008952\tres = 1.331E-03\n", - "[ NORMAL ] Iteration 62:\tk_eff = 1.010107\tres = 1.237E-03\n", - "[ NORMAL ] Iteration 63:\tk_eff = 1.011181\tres = 1.149E-03\n", - "[ NORMAL ] Iteration 64:\tk_eff = 1.012179\tres = 1.067E-03\n", - "[ NORMAL ] Iteration 65:\tk_eff = 1.013107\tres = 9.909E-04\n", - "[ NORMAL ] Iteration 66:\tk_eff = 1.013969\tres = 9.201E-04\n", - "[ NORMAL ] Iteration 67:\tk_eff = 1.014769\tres = 8.542E-04\n", - "[ NORMAL ] Iteration 68:\tk_eff = 1.015513\tres = 7.929E-04\n", - "[ NORMAL ] Iteration 69:\tk_eff = 1.016204\tres = 7.358E-04\n", - "[ NORMAL ] Iteration 70:\tk_eff = 1.016845\tres = 6.828E-04\n", - "[ NORMAL ] Iteration 71:\tk_eff = 1.017440\tres = 6.335E-04\n", - "[ NORMAL ] Iteration 72:\tk_eff = 1.017993\tres = 5.877E-04\n", - "[ NORMAL ] Iteration 73:\tk_eff = 1.018505\tres = 5.451E-04\n", - "[ NORMAL ] Iteration 74:\tk_eff = 1.018980\tres = 5.056E-04\n", - "[ NORMAL ] Iteration 75:\tk_eff = 1.019422\tres = 4.688E-04\n", - "[ NORMAL ] Iteration 76:\tk_eff = 1.019831\tres = 4.347E-04\n", - "[ NORMAL ] Iteration 77:\tk_eff = 1.020210\tres = 4.030E-04\n", - "[ NORMAL ] Iteration 78:\tk_eff = 1.020562\tres = 3.736E-04\n", - "[ NORMAL ] Iteration 79:\tk_eff = 1.020888\tres = 3.463E-04\n", - "[ NORMAL ] Iteration 80:\tk_eff = 1.021190\tres = 3.209E-04\n", - "[ NORMAL ] Iteration 81:\tk_eff = 1.021471\tres = 2.974E-04\n", - "[ NORMAL ] Iteration 82:\tk_eff = 1.021730\tres = 2.756E-04\n", - "[ NORMAL ] Iteration 83:\tk_eff = 1.021971\tres = 2.553E-04\n", - "[ NORMAL ] Iteration 84:\tk_eff = 1.022194\tres = 2.365E-04\n", - "[ NORMAL ] Iteration 85:\tk_eff = 1.022400\tres = 2.191E-04\n", - "[ NORMAL ] Iteration 86:\tk_eff = 1.022592\tres = 2.030E-04\n", - "[ NORMAL ] Iteration 87:\tk_eff = 1.022769\tres = 1.880E-04\n", - "[ NORMAL ] Iteration 88:\tk_eff = 1.022933\tres = 1.741E-04\n", - "[ NORMAL ] Iteration 89:\tk_eff = 1.023085\tres = 1.612E-04\n", - "[ NORMAL ] Iteration 90:\tk_eff = 1.023226\tres = 1.493E-04\n", - "[ NORMAL ] Iteration 91:\tk_eff = 1.023356\tres = 1.382E-04\n", - "[ NORMAL ] Iteration 92:\tk_eff = 1.023477\tres = 1.279E-04\n", - "[ NORMAL ] Iteration 93:\tk_eff = 1.023588\tres = 1.184E-04\n", - "[ NORMAL ] Iteration 94:\tk_eff = 1.023692\tres = 1.097E-04\n", - "[ NORMAL ] Iteration 95:\tk_eff = 1.023788\tres = 1.015E-04\n", - "[ NORMAL ] Iteration 96:\tk_eff = 1.023876\tres = 9.392E-05\n", - "[ NORMAL ] Iteration 97:\tk_eff = 1.023958\tres = 8.694E-05\n", - "[ NORMAL ] Iteration 98:\tk_eff = 1.024034\tres = 8.045E-05\n", - "[ NORMAL ] Iteration 99:\tk_eff = 1.024104\tres = 7.446E-05\n", - "[ NORMAL ] Iteration 100:\tk_eff = 1.024169\tres = 6.890E-05\n", - "[ NORMAL ] Iteration 101:\tk_eff = 1.024229\tres = 6.374E-05\n", - "[ NORMAL ] Iteration 102:\tk_eff = 1.024285\tres = 5.897E-05\n", - "[ NORMAL ] Iteration 103:\tk_eff = 1.024336\tres = 5.457E-05\n", - "[ NORMAL ] Iteration 104:\tk_eff = 1.024384\tres = 5.049E-05\n", - "[ NORMAL ] Iteration 105:\tk_eff = 1.024428\tres = 4.672E-05\n", - "[ NORMAL ] Iteration 106:\tk_eff = 1.024469\tres = 4.321E-05\n", - "[ NORMAL ] Iteration 107:\tk_eff = 1.024506\tres = 3.994E-05\n", - "[ NORMAL ] Iteration 108:\tk_eff = 1.024541\tres = 3.696E-05\n", - "[ NORMAL ] Iteration 109:\tk_eff = 1.024574\tres = 3.418E-05\n", - "[ NORMAL ] Iteration 110:\tk_eff = 1.024603\tres = 3.164E-05\n", - "[ NORMAL ] Iteration 111:\tk_eff = 1.024631\tres = 2.925E-05\n", - "[ NORMAL ] Iteration 112:\tk_eff = 1.024657\tres = 2.705E-05\n", - "[ NORMAL ] Iteration 113:\tk_eff = 1.024680\tres = 2.501E-05\n", - "[ NORMAL ] Iteration 114:\tk_eff = 1.024702\tres = 2.313E-05\n", - "[ NORMAL ] Iteration 115:\tk_eff = 1.024722\tres = 2.140E-05\n", - "[ NORMAL ] Iteration 116:\tk_eff = 1.024741\tres = 1.981E-05\n", - "[ NORMAL ] Iteration 117:\tk_eff = 1.024758\tres = 1.827E-05\n", - "[ NORMAL ] Iteration 118:\tk_eff = 1.024774\tres = 1.690E-05\n", - "[ NORMAL ] Iteration 119:\tk_eff = 1.024789\tres = 1.564E-05\n", - "[ NORMAL ] Iteration 120:\tk_eff = 1.024802\tres = 1.445E-05\n", - "[ NORMAL ] Iteration 121:\tk_eff = 1.024815\tres = 1.338E-05\n", - "[ NORMAL ] Iteration 122:\tk_eff = 1.024827\tres = 1.236E-05\n", - "[ NORMAL ] Iteration 123:\tk_eff = 1.024837\tres = 1.142E-05\n", - "[ NORMAL ] Iteration 124:\tk_eff = 1.024847\tres = 1.057E-05\n" + "[ NORMAL ] Iteration 0:\tk_eff = 0.823436\tres = 0.000E+00\n", + "[ NORMAL ] Iteration 1:\tk_eff = 0.780042\tres = 1.941E-01\n", + "[ NORMAL ] Iteration 2:\tk_eff = 0.739063\tres = 6.559E-02\n", + "[ NORMAL ] Iteration 3:\tk_eff = 0.710328\tres = 5.301E-02\n", + "[ NORMAL ] Iteration 4:\tk_eff = 0.689038\tres = 3.942E-02\n", + "[ NORMAL ] Iteration 5:\tk_eff = 0.674339\tres = 3.021E-02\n", + "[ NORMAL ] Iteration 6:\tk_eff = 0.665075\tres = 2.149E-02\n", + "[ NORMAL ] Iteration 7:\tk_eff = 0.660373\tres = 1.387E-02\n", + "[ NORMAL ] Iteration 8:\tk_eff = 0.659460\tres = 7.242E-03\n", + "[ NORMAL ] Iteration 9:\tk_eff = 0.661679\tres = 1.995E-03\n", + "[ NORMAL ] Iteration 10:\tk_eff = 0.666463\tres = 3.649E-03\n", + "[ NORMAL ] Iteration 11:\tk_eff = 0.673324\tres = 7.367E-03\n", + "[ NORMAL ] Iteration 12:\tk_eff = 0.681842\tres = 1.039E-02\n", + "[ NORMAL ] Iteration 13:\tk_eff = 0.691660\tres = 1.273E-02\n", + "[ NORMAL ] Iteration 14:\tk_eff = 0.702469\tres = 1.447E-02\n", + "[ NORMAL ] Iteration 15:\tk_eff = 0.714008\tres = 1.569E-02\n", + "[ NORMAL ] Iteration 16:\tk_eff = 0.726057\tres = 1.649E-02\n", + "[ NORMAL ] Iteration 17:\tk_eff = 0.738428\tres = 1.693E-02\n", + "[ NORMAL ] Iteration 18:\tk_eff = 0.750965\tres = 1.709E-02\n", + "[ NORMAL ] Iteration 19:\tk_eff = 0.763536\tres = 1.703E-02\n", + "[ NORMAL ] Iteration 20:\tk_eff = 0.776034\tres = 1.679E-02\n", + "[ NORMAL ] Iteration 21:\tk_eff = 0.788369\tres = 1.641E-02\n", + "[ NORMAL ] Iteration 22:\tk_eff = 0.800470\tres = 1.594E-02\n", + "[ NORMAL ] Iteration 23:\tk_eff = 0.812280\tres = 1.539E-02\n", + "[ NORMAL ] Iteration 24:\tk_eff = 0.823753\tres = 1.479E-02\n", + "[ NORMAL ] Iteration 25:\tk_eff = 0.834854\tres = 1.416E-02\n", + "[ NORMAL ] Iteration 26:\tk_eff = 0.845560\tres = 1.351E-02\n", + "[ NORMAL ] Iteration 27:\tk_eff = 0.855851\tres = 1.286E-02\n", + "[ NORMAL ] Iteration 28:\tk_eff = 0.865717\tres = 1.220E-02\n", + "[ NORMAL ] Iteration 29:\tk_eff = 0.875152\tres = 1.156E-02\n", + "[ NORMAL ] Iteration 30:\tk_eff = 0.884153\tres = 1.093E-02\n", + "[ NORMAL ] Iteration 31:\tk_eff = 0.892725\tres = 1.031E-02\n", + "[ NORMAL ] Iteration 32:\tk_eff = 0.900872\tres = 9.722E-03\n", + "[ NORMAL ] Iteration 33:\tk_eff = 0.908602\tres = 9.152E-03\n", + "[ NORMAL ] Iteration 34:\tk_eff = 0.915926\tres = 8.605E-03\n", + "[ NORMAL ] Iteration 35:\tk_eff = 0.922853\tres = 8.083E-03\n", + "[ NORMAL ] Iteration 36:\tk_eff = 0.929399\tres = 7.586E-03\n", + "[ NORMAL ] Iteration 37:\tk_eff = 0.935576\tres = 7.114E-03\n", + "[ NORMAL ] Iteration 38:\tk_eff = 0.941398\tres = 6.666E-03\n", + "[ NORMAL ] Iteration 39:\tk_eff = 0.946880\tres = 6.242E-03\n", + "[ NORMAL ] Iteration 40:\tk_eff = 0.952037\tres = 5.841E-03\n", + "[ NORMAL ] Iteration 41:\tk_eff = 0.956883\tres = 5.463E-03\n", + "[ NORMAL ] Iteration 42:\tk_eff = 0.961434\tres = 5.107E-03\n", + "[ NORMAL ] Iteration 43:\tk_eff = 0.965705\tres = 4.771E-03\n", + "[ NORMAL ] Iteration 44:\tk_eff = 0.969708\tres = 4.456E-03\n", + "[ NORMAL ] Iteration 45:\tk_eff = 0.973460\tres = 4.159E-03\n", + "[ NORMAL ] Iteration 46:\tk_eff = 0.976972\tres = 3.881E-03\n", + "[ NORMAL ] Iteration 47:\tk_eff = 0.980259\tres = 3.620E-03\n", + "[ NORMAL ] Iteration 48:\tk_eff = 0.983333\tres = 3.375E-03\n", + "[ NORMAL ] Iteration 49:\tk_eff = 0.986206\tres = 3.146E-03\n", + "[ NORMAL ] Iteration 50:\tk_eff = 0.988890\tres = 2.932E-03\n", + "[ NORMAL ] Iteration 51:\tk_eff = 0.991396\tres = 2.731E-03\n", + "[ NORMAL ] Iteration 52:\tk_eff = 0.993735\tres = 2.543E-03\n", + "[ NORMAL ] Iteration 53:\tk_eff = 0.995917\tres = 2.368E-03\n", + "[ NORMAL ] Iteration 54:\tk_eff = 0.997952\tres = 2.204E-03\n", + "[ NORMAL ] Iteration 55:\tk_eff = 0.999848\tres = 2.050E-03\n", + "[ NORMAL ] Iteration 56:\tk_eff = 1.001616\tres = 1.907E-03\n", + "[ NORMAL ] Iteration 57:\tk_eff = 1.003262\tres = 1.774E-03\n", + "[ NORMAL ] Iteration 58:\tk_eff = 1.004795\tres = 1.650E-03\n", + "[ NORMAL ] Iteration 59:\tk_eff = 1.006222\tres = 1.534E-03\n", + "[ NORMAL ] Iteration 60:\tk_eff = 1.007550\tres = 1.425E-03\n", + "[ NORMAL ] Iteration 61:\tk_eff = 1.008785\tres = 1.325E-03\n", + "[ NORMAL ] Iteration 62:\tk_eff = 1.009934\tres = 1.231E-03\n", + "[ NORMAL ] Iteration 63:\tk_eff = 1.011002\tres = 1.143E-03\n", + "[ NORMAL ] Iteration 64:\tk_eff = 1.011995\tres = 1.062E-03\n", + "[ NORMAL ] Iteration 65:\tk_eff = 1.012918\tres = 9.859E-04\n", + "[ NORMAL ] Iteration 66:\tk_eff = 1.013775\tres = 9.153E-04\n", + "[ NORMAL ] Iteration 67:\tk_eff = 1.014571\tres = 8.497E-04\n", + "[ NORMAL ] Iteration 68:\tk_eff = 1.015311\tres = 7.886E-04\n", + "[ NORMAL ] Iteration 69:\tk_eff = 1.015997\tres = 7.318E-04\n", + "[ NORMAL ] Iteration 70:\tk_eff = 1.016635\tres = 6.790E-04\n", + "[ NORMAL ] Iteration 71:\tk_eff = 1.017226\tres = 6.300E-04\n", + "[ NORMAL ] Iteration 72:\tk_eff = 1.017775\tres = 5.844E-04\n", + "[ NORMAL ] Iteration 73:\tk_eff = 1.018285\tres = 5.420E-04\n", + "[ NORMAL ] Iteration 74:\tk_eff = 1.018757\tres = 5.026E-04\n", + "[ NORMAL ] Iteration 75:\tk_eff = 1.019195\tres = 4.660E-04\n", + "[ NORMAL ] Iteration 76:\tk_eff = 1.019602\tres = 4.321E-04\n", + "[ NORMAL ] Iteration 77:\tk_eff = 1.019979\tres = 4.005E-04\n", + "[ NORMAL ] Iteration 78:\tk_eff = 1.020328\tres = 3.713E-04\n", + "[ NORMAL ] Iteration 79:\tk_eff = 1.020652\tres = 3.441E-04\n", + "[ NORMAL ] Iteration 80:\tk_eff = 1.020952\tres = 3.189E-04\n", + "[ NORMAL ] Iteration 81:\tk_eff = 1.021230\tres = 2.955E-04\n", + "[ NORMAL ] Iteration 82:\tk_eff = 1.021488\tres = 2.738E-04\n", + "[ NORMAL ] Iteration 83:\tk_eff = 1.021727\tres = 2.536E-04\n", + "[ NORMAL ] Iteration 84:\tk_eff = 1.021948\tres = 2.350E-04\n", + "[ NORMAL ] Iteration 85:\tk_eff = 1.022153\tres = 2.177E-04\n", + "[ NORMAL ] Iteration 86:\tk_eff = 1.022344\tres = 2.016E-04\n", + "[ NORMAL ] Iteration 87:\tk_eff = 1.022520\tres = 1.867E-04\n", + "[ NORMAL ] Iteration 88:\tk_eff = 1.022683\tres = 1.729E-04\n", + "[ NORMAL ] Iteration 89:\tk_eff = 1.022833\tres = 1.601E-04\n", + "[ NORMAL ] Iteration 90:\tk_eff = 1.022973\tres = 1.482E-04\n", + "[ NORMAL ] Iteration 91:\tk_eff = 1.023102\tres = 1.372E-04\n", + "[ NORMAL ] Iteration 92:\tk_eff = 1.023222\tres = 1.271E-04\n", + "[ NORMAL ] Iteration 93:\tk_eff = 1.023333\tres = 1.176E-04\n", + "[ NORMAL ] Iteration 94:\tk_eff = 1.023436\tres = 1.089E-04\n", + "[ NORMAL ] Iteration 95:\tk_eff = 1.023531\tres = 1.008E-04\n", + "[ NORMAL ] Iteration 96:\tk_eff = 1.023619\tres = 9.327E-05\n", + "[ NORMAL ] Iteration 97:\tk_eff = 1.023700\tres = 8.632E-05\n", + "[ NORMAL ] Iteration 98:\tk_eff = 1.023775\tres = 7.988E-05\n", + "[ NORMAL ] Iteration 99:\tk_eff = 1.023845\tres = 7.391E-05\n", + "[ NORMAL ] Iteration 100:\tk_eff = 1.023910\tres = 6.838E-05\n", + "[ NORMAL ] Iteration 101:\tk_eff = 1.023969\tres = 6.329E-05\n", + "[ NORMAL ] Iteration 102:\tk_eff = 1.024024\tres = 5.855E-05\n", + "[ NORMAL ] Iteration 103:\tk_eff = 1.024076\tres = 5.415E-05\n", + "[ NORMAL ] Iteration 104:\tk_eff = 1.024123\tres = 5.011E-05\n", + "[ NORMAL ] Iteration 105:\tk_eff = 1.024166\tres = 4.634E-05\n", + "[ NORMAL ] Iteration 106:\tk_eff = 1.024207\tres = 4.290E-05\n", + "[ NORMAL ] Iteration 107:\tk_eff = 1.024244\tres = 3.966E-05\n", + "[ NORMAL ] Iteration 108:\tk_eff = 1.024279\tres = 3.669E-05\n", + "[ NORMAL ] Iteration 109:\tk_eff = 1.024311\tres = 3.392E-05\n", + "[ NORMAL ] Iteration 110:\tk_eff = 1.024341\tres = 3.137E-05\n", + "[ NORMAL ] Iteration 111:\tk_eff = 1.024368\tres = 2.904E-05\n", + "[ NORMAL ] Iteration 112:\tk_eff = 1.024393\tres = 2.686E-05\n", + "[ NORMAL ] Iteration 113:\tk_eff = 1.024417\tres = 2.481E-05\n", + "[ NORMAL ] Iteration 114:\tk_eff = 1.024438\tres = 2.296E-05\n", + "[ NORMAL ] Iteration 115:\tk_eff = 1.024458\tres = 2.121E-05\n", + "[ NORMAL ] Iteration 116:\tk_eff = 1.024477\tres = 1.961E-05\n", + "[ NORMAL ] Iteration 117:\tk_eff = 1.024494\tres = 1.815E-05\n", + "[ NORMAL ] Iteration 118:\tk_eff = 1.024510\tres = 1.679E-05\n", + "[ NORMAL ] Iteration 119:\tk_eff = 1.024524\tres = 1.551E-05\n", + "[ NORMAL ] Iteration 120:\tk_eff = 1.024538\tres = 1.435E-05\n", + "[ NORMAL ] Iteration 121:\tk_eff = 1.024550\tres = 1.326E-05\n", + "[ NORMAL ] Iteration 122:\tk_eff = 1.024561\tres = 1.226E-05\n", + "[ NORMAL ] Iteration 123:\tk_eff = 1.024572\tres = 1.133E-05\n", + "[ NORMAL ] Iteration 124:\tk_eff = 1.024582\tres = 1.047E-05\n" ] } ], @@ -1483,25 +1378,23 @@ }, { "cell_type": "code", - "execution_count": 40, - "metadata": { - "collapsed": false - }, + "execution_count": 39, + "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "openmc keff = 1.023307\n", - "openmoc keff = 1.024847\n", - "bias [pcm]: 154.0\n" + "openmc keff = 1.023293\n", + "openmoc keff = 1.024582\n", + "bias [pcm]: 128.8\n" ] } ], "source": [ "# Print report of keff and bias with OpenMC\n", "openmoc_keff = solver.getKeff()\n", - "openmc_keff = sp.k_combined[0]\n", + "openmc_keff = sp.k_combined.nominal_value\n", "bias = (openmoc_keff - openmc_keff) * 1e5\n", "\n", "print('openmc keff = {0:1.6f}'.format(openmc_keff))\n", @@ -1536,10 +1429,8 @@ }, { "cell_type": "code", - "execution_count": 41, - "metadata": { - "collapsed": false - }, + "execution_count": 40, + "metadata": {}, "outputs": [], "source": [ "# Get the OpenMC fission rate mesh tally data\n", @@ -1562,10 +1453,8 @@ }, { "cell_type": "code", - "execution_count": 42, - "metadata": { - "collapsed": false - }, + "execution_count": 41, + "metadata": {}, "outputs": [], "source": [ "# Create OpenMOC Mesh on which to tally fission rates\n", @@ -1594,26 +1483,24 @@ }, { "cell_type": "code", - "execution_count": 43, - "metadata": { - "collapsed": false - }, + "execution_count": 42, + "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 43, + "execution_count": 42, "metadata": {}, "output_type": "execute_result" }, { "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAW0AAADDCAYAAABJYEAIAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8FFW2B/DfSQJhC8giq0AARRw07LgAQ8CVUcRtHERH\nUUcdt6fvuTvvDYFRwWV8jM64zIiK4MJzQXTmOaJiYEAMAUEGnygiCWgggCLLsCfn/VEV6ITuOpV0\n0t1Xft/PJ590V52ue6vq9unq6rp1RVVBRERuSEt2BYiIKDwm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JkkZ2bauSvMfMRjfwV8imAOPKpl0A3Gtm+wD3kjSUR6eawqZtBvh+vq9Hm9ndndymdunGeQ2R2x1hCp2c2w1d+MkGup5rZvPM7FXgVmB8F7ep2zOzPwLlQxCNB27MH98IfLBTG+Voo83dVeR1B4ncTtPohX8XYEHJ3wvzaY3MgHskPSrptK5uzGYYYmZL8sdLgSFd2ZjNcKakv+RvlxvqLXwV3TGvIXK7s3VYbjd64e+ODjWzt5O9jT9D0n90dYM2l2Vf9eoOX/e6BtgbGA0sAf63a5vT40Vud54Oze1GL/yLgN1K/t41n9awzGxR/ns5MJXsbX13sEzSzgD57+Vd3B6XmS0zs41m9gZwHd1nX3e7vIbI7c7U0bnd6IV/JrCPpD0l9QZOBu7q4ja1SVI/Sf1bHgNHAXOqP6th3AVMzB9PBO7swrYkaXkx546n++zrbpXXELnd2To6t7es58Lqzcxel3Qm8DugF3CDmT3Zxc2qZggwVRJk+/anZvbbrm3SpiTdAowFdpS0ELgIuBi4TdKnye4geVLXtXBTbbR5rKTRZG/d5wOnd1kDN0M3zGuI3O4wXZHb0XM3hBAKptEv9YQQQqizKPwhhFAwUfhDCKFgovCHEELBROEPIYSCicIfQggFE4U/hBAKJgp/CCEUzP8H1wj1HqNkQuMAAAAASUVORK5CYII=\n", "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -1640,9 +1527,9 @@ "metadata": { "anaconda-cloud": {}, "kernelspec": { - "display_name": "Python 3", + "display_name": "openmc", "language": "python", - "name": "python3" + "name": "openmc" }, "language_info": { "codemirror_mode": { @@ -1654,9 +1541,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.0" + "version": "3.6.5" } }, "nbformat": 4, - "nbformat_minor": 0 + "nbformat_minor": 1 } diff --git a/openmc/capi/tally.py b/openmc/capi/tally.py index a10fae47a3..d4d70af718 100644 --- a/openmc/capi/tally.py +++ b/openmc/capi/tally.py @@ -73,10 +73,10 @@ _dll.openmc_tally_set_type.errcheck = _error_handler _SCORES = { -1: 'flux', -2: 'total', -3: 'scatter', -4: 'nu-scatter', - -9: 'absorption', -10: 'fission', -11: 'nu-fission', -12: 'kappa-fission', - -13: 'current', -18: 'events', -19: 'delayed-nu-fission', - -20: 'prompt-nu-fission', -21: 'inverse-velocity', -22: 'fission-q-prompt', - -23: 'fission-q-recoverable', -24: 'decay-rate' + -5: 'absorption', -6: 'fission', -7: 'nu-fission', -8: 'kappa-fission', + -9: 'current', -10: 'events', -11: 'delayed-nu-fission', + -12: 'prompt-nu-fission', -13: 'inverse-velocity', -14: 'fission-q-prompt', + -15: 'fission-q-recoverable', -16: 'decay-rate' } diff --git a/openmc/filter.py b/openmc/filter.py index 2bab17dbb6..3180989eb7 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -104,10 +104,8 @@ class Filter(IDManagerMixin, metaclass=FilterMeta): return False elif len(self.bins) != len(other.bins): return False - elif not np.allclose(self.bins, other.bins): - return False else: - return True + return np.allclose(self.bins, other.bins) def __ne__(self, other): return not self == other diff --git a/openmc/filter_expansion.py b/openmc/filter_expansion.py index 872eaac9f5..ffac647c96 100644 --- a/openmc/filter_expansion.py +++ b/openmc/filter_expansion.py @@ -10,10 +10,17 @@ from . import Filter class ExpansionFilter(Filter): """Abstract filter class for functional expansions.""" + def __init__(self, order, filter_id=None): self.order = order self.id = filter_id + def __eq__(self, other): + if type(self) is not type(other): + return False + else: + return self.bins == other.bins + @property def order(self): return self._order diff --git a/openmc/material.py b/openmc/material.py index 6bfe58f4ac..cfa3eba3c3 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -278,8 +278,8 @@ class Material(IDManagerMixin): name = group['name'].value.decode() if 'name' in group else '' density = group['atom_density'].value - nuc_densities = group['nuclide_densities'][...] - nuclides = group['nuclides'].value + if 'nuclide_densities' in group: + nuc_densities = group['nuclide_densities'][...] # Create the Material material = cls(mat_id, name) @@ -295,10 +295,18 @@ class Material(IDManagerMixin): # Set the Material's density to atom/b-cm as used by OpenMC material.set_density(density=density, units='atom/b-cm') - # Add all nuclides to the Material - for fullname, density in zip(nuclides, nuc_densities): - name = fullname.decode().strip() - material.add_nuclide(name, percent=density, percent_type='ao') + if 'nuclides' in group: + nuclides = group['nuclides'].value + # Add all nuclides to the Material + for fullname, density in zip(nuclides, nuc_densities): + name = fullname.decode().strip() + material.add_nuclide(name, percent=density, percent_type='ao') + if 'macroscopics' in group: + macroscopics = group['macroscopics'].value + # Add all macroscopics to the Material + for fullname in macroscopics: + name = fullname.decode().strip() + material.add_macroscopic(name) return material diff --git a/openmc/mesh.py b/openmc/mesh.py index aed7a46d8c..c9c76552bc 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -182,41 +182,6 @@ class Mesh(IDManagerMixin): return mesh - def cell_generator(self): - """Generator function to traverse through every [i,j,k] index of the - mesh - - For example the following code: - - .. code-block:: python - - for mesh_index in mymesh.cell_generator(): - print(mesh_index) - - will produce the following output for a 3-D 2x2x2 mesh in mymesh:: - - [1, 1, 1] - [2, 1, 1] - [1, 2, 1] - [2, 2, 1] - ... - - - """ - - if len(self.dimension) == 1: - for x in range(self.dimension[0]): - yield [x + 1, 1, 1] - elif len(self.dimension) == 2: - for y in range(self.dimension[1]): - for x in range(self.dimension[0]): - yield [x + 1, y + 1, 1] - else: - for z in range(self.dimension[2]): - for y in range(self.dimension[1]): - for x in range(self.dimension[0]): - yield [x + 1, y + 1, z + 1] - def to_xml_element(self): """Return XML representation of the mesh @@ -280,12 +245,14 @@ class Mesh(IDManagerMixin): cv.check_value('bc', entry, ['transmission', 'vacuum', 'reflective', 'periodic']) + n_dim = len(self.dimension) + # Build the cell which will contain the lattice xplanes = [openmc.XPlane(x0=self.lower_left[0], boundary_type=bc[0]), openmc.XPlane(x0=self.upper_right[0], boundary_type=bc[1])] - if len(self.dimension) == 1: + if n_dim == 1: yplanes = [openmc.YPlane(y0=-1e10, boundary_type='reflective'), openmc.YPlane(y0=1e10, boundary_type='reflective')] else: @@ -294,7 +261,7 @@ class Mesh(IDManagerMixin): openmc.YPlane(y0=self.upper_right[1], boundary_type=bc[3])] - if len(self.dimension) <= 2: + if n_dim <= 2: # Would prefer to have the z ranges be the max supported float, but # these values are apparently different between python and Fortran. # Choosing a safe and sane default. @@ -314,12 +281,12 @@ class Mesh(IDManagerMixin): (+yplanes[0] & -yplanes[1]) & (+zplanes[0] & -zplanes[1])) - # Build the universes which will be used for each of the [i,j,k] + # Build the universes which will be used for each of the (i,j,k) # locations within the mesh. # We will concurrently build cells to assign to these universes cells = [] universes = [] - for [i, j, k] in self.cell_generator(): + for index in self.indices: cells.append(openmc.Cell()) universes.append(openmc.Universe()) universes[-1].add_cell(cells[-1]) @@ -329,7 +296,24 @@ class Mesh(IDManagerMixin): # Assign the universe and rotate to match the indexing expected for # the lattice - lattice.universes = np.rot90(np.reshape(universes, self.dimension)) + if n_dim == 1: + universe_array = np.array([universes]) + elif n_dim == 2: + universe_array = np.empty(self.dimension, dtype=openmc.Universe) + i = 0 + for y in range(self.dimension[1] - 1, -1, -1): + for x in range(self.dimension[0]): + universe_array[y][x] = universes[i] + i += 1 + else: + universe_array = np.empty(self.dimension, dtype=openmc.Universe) + i = 0 + for z in range(self.dimension[2]): + for y in range(self.dimension[1] - 1, -1, -1): + for x in range(self.dimension[0]): + universe_array[z][y][x] = universes[i] + i += 1 + lattice.universes = universe_array if self.width is not None: lattice.pitch = self.width @@ -337,9 +321,9 @@ class Mesh(IDManagerMixin): dx = ((self.upper_right[0] - self.lower_left[0]) / self.dimension[0]) - if len(self.dimension) == 1: + if n_dim == 1: lattice.pitch = [dx] - elif len(self.dimension) == 2: + elif n_dim == 2: dy = ((self.upper_right[1] - self.lower_left[1]) / self.dimension[1]) lattice.pitch = [dx, dy] diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index ed8e3f076c..7b75d90fff 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -1220,9 +1220,8 @@ class Library(object): xs_type = 'macro' # Initialize file - mgxs_file = openmc.MGXSLibrary(self.energy_groups, - num_delayed_groups=\ - self.num_delayed_groups) + mgxs_file = openmc.MGXSLibrary( + self.energy_groups, num_delayed_groups=self.num_delayed_groups) if self.domain_type == 'mesh': # Create the xsdata objects and add to the mgxs_file @@ -1231,7 +1230,7 @@ class Library(object): if self.by_nuclide: raise NotImplementedError("Mesh domains do not currently " "support nuclidic tallies") - for subdomain in domain.cell_generator(): + for subdomain in domain.indices: # Build & add metadata to XSdata object if xsdata_names is None: xsdata_name = 'set' + str(i + 1) @@ -1346,7 +1345,7 @@ class Library(object): geometry.root_universe = root materials = openmc.Materials() - for i, subdomain in enumerate(self.domains[0].cell_generator()): + for i, subdomain in enumerate(self.domains[0].indices): xsdata = mgxs_file.xsdatas[i] # Build the macroscopic and assign it to the cell of @@ -1401,24 +1400,16 @@ class Library(object): The rules to check include: - - Either total or transport should be present. + - Either total or transport must be present. - Both can be available if one wants, but we should use whatever corresponds to Library.correction (if P0: transport) - - Absorption and total (or transport) are required. + - Absorption is required. - A nu-fission cross section and chi values are not required as a fixed source problem could be the target. - Fission and kappa-fission are not required as they are only needed to support tallies the user may wish to request. - - A nu-scatter matrix is required. - - - Having a multiplicity matrix is preferred. - - Having both nu-scatter (of any order) and scatter - (at least isotropic) matrices is the second choice. - - If only nu-scatter, need total (not transport), to - be used in adjusting absorption - (i.e., reduced_abs = tot - nuscatt) See also -------- @@ -1428,36 +1419,51 @@ class Library(object): """ error_flag = False + + # if correction is 'P0', then transport must be provided + # otherwise total must be provided + if self.correction == 'P0': + if ('transport' not in self.mgxs_types and + 'nu-transport' not in self.mgxs_types): + error_flag = True + warn('If the "correction" parameter is "P0", then a ' + '"transport" or "nu-transport" MGXS type is required.') + else: + if 'total' not in self.mgxs_types: + error_flag = True + warn('If the "correction" parameter is None, then a ' + '"total" MGXS type is required.') + + # Check consistency of "nu-transport" and "nu-scatter" + if 'nu-transport' in self.mgxs_types: + if not ('nu-scatter matrix' in self.mgxs_types or + 'consistent nu-scatter matrix' in self.mgxs_types): + error_flag = True + warn('If a "nu-transport" MGXS type is used then a ' + '"nu-scatter matrix" or "consistent nu-scatter matrix" ' + 'must also be used.') + elif 'transport' in self.mgxs_types: + if not ('scatter matrix' in self.mgxs_types or + 'consistent scatter matrix' in self.mgxs_types): + error_flag = True + warn('If a "transport" MGXS type is used then a ' + '"scatter matrix" or "consistent scatter matrix" ' + 'must also be used.') + + # Make sure there is some kind of a scattering matrix data + if 'nu-scatter matrix' not in self.mgxs_types and \ + 'consistent nu-scatter matrix' not in self.mgxs_types and \ + 'scatter matrix' not in self.mgxs_types and \ + 'consistent scatter matrix' not in self.mgxs_types: + error_flag = True + warn('A "nu-scatter matrix", "consistent nu-scatter matrix", ' + '"scatter matrix", or "consistent scatter matrix" MGXS ' + 'type is required.') + # Ensure absorption is present if 'absorption' not in self.mgxs_types: error_flag = True warn('An "absorption" MGXS type is required but not provided.') - # Ensure nu-scattering matrix is required - if 'nu-scatter matrix' not in self.mgxs_types and \ - 'consistent nu-scatter matrix' not in self.mgxs_types: - error_flag = True - warn('A "nu-scatter matrix" MGXS type is required but not provided.') - else: - # Ok, now see the status of scatter and/or multiplicity - if 'scatter matrix' not in self.mgxs_types or \ - 'consistent scatter matrix' not in self.mgxs_types and \ - 'multiplicity matrix' not in self.mgxs_types: - # We dont have data needed for multiplicity matrix, therefore - # we need total, and not transport. - if 'total' not in self.mgxs_types: - error_flag = True - warn('A "total" MGXS type is required if a ' - 'scattering matrix is not provided.') - # Total or transport can be present, but if using - # self.correction=="P0", then we should use transport. - if self.correction == "P0" and 'nu-transport' not in self.mgxs_types: - error_flag = True - warn('A "nu-transport" MGXS type is required since a "P0" ' - 'correction is applied, but a "nu-transport" MGXS is ' - 'not provided.') - elif self.correction is None and 'total' not in self.mgxs_types: - error_flag = True - warn('A "total" MGXS type is required, but not provided.') if error_flag: raise ValueError('Invalid MGXS configuration encountered.') diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index 5bc00cbc95..81b4420d9c 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -1923,6 +1923,10 @@ class MGXS(metaclass=ABCMeta): if 'group out' in df: df = df[df['group out'].isin(groups)] + # Add the Legendre bin to the column if it exists + if 'legendre' in df: + columns += ['legendre'] + # If user requested micro cross sections, divide out the atom densities if xs_type == 'micro': if self.by_nuclide: @@ -2717,9 +2721,9 @@ class TransportXS(MGXS): @property def scores(self): if not self.nu: - return ['flux', 'total', 'flux', 'scatter-1'] + return ['flux', 'total', 'flux', 'scatter'] else: - return ['flux', 'total', 'flux', 'nu-scatter-1'] + return ['flux', 'total', 'flux', 'nu-scatter'] @property def tally_keys(self): @@ -2730,8 +2734,9 @@ class TransportXS(MGXS): group_edges = self.energy_groups.group_edges energy_filter = openmc.EnergyFilter(group_edges) energyout_filter = openmc.EnergyoutFilter(group_edges) + p1_filter = openmc.LegendreFilter(1) filters = [[energy_filter], [energy_filter], - [energy_filter], [energyout_filter]] + [energy_filter], [energyout_filter, p1_filter]] return self._add_angle_filters(filters) @@ -2739,12 +2744,18 @@ class TransportXS(MGXS): def rxn_rate_tally(self): if self._rxn_rate_tally is None: # Switch EnergyoutFilter to EnergyFilter. - old_filt = self.tallies['scatter-1'].filters[-1] + p1_tally = self.tallies['scatter-1'] + old_filt = p1_tally.filters[-2] new_filt = openmc.EnergyFilter(old_filt.values) - self.tallies['scatter-1'].filters[-1] = new_filt + p1_tally.filters[-2] = new_filt - self._rxn_rate_tally = \ - self.tallies['total'] - self.tallies['scatter-1'] + # Slice Legendre expansion filter and change name of score + p1_tally = p1_tally.get_slice(filters=[openmc.LegendreFilter], + filter_bins=[('P1',)], + squeeze=True) + p1_tally.scores = ['scatter-1'] + + self._rxn_rate_tally = self.tallies['total'] - p1_tally self._rxn_rate_tally.sparse = self.sparse return self._rxn_rate_tally @@ -2758,15 +2769,22 @@ class TransportXS(MGXS): raise ValueError(msg) # Switch EnergyoutFilter to EnergyFilter. - old_filt = self.tallies['scatter-1'].filters[-1] + p1_tally = self.tallies['scatter-1'] + old_filt = p1_tally.filters[-2] new_filt = openmc.EnergyFilter(old_filt.values) - self.tallies['scatter-1'].filters[-1] = new_filt + p1_tally.filters[-2] = new_filt + + # Slice Legendre expansion filter and change name of score + p1_tally = p1_tally.get_slice(filters=[openmc.LegendreFilter], + filter_bins=[('P1',)], + squeeze=True) + p1_tally.scores = ['scatter-1'] # Compute total cross section total_xs = self.tallies['total'] / self.tallies['flux (tracklength)'] # Compute transport correction term - trans_corr = self.tallies['scatter-1'] / self.tallies['flux (analog)'] + trans_corr = p1_tally / self.tallies['flux (analog)'] # Compute the transport-corrected total cross section self._xs_tally = total_xs - trans_corr @@ -3510,6 +3528,7 @@ class ScatterXS(MGXS): self._estimator = 'analog' self._valid_estimators = ['analog'] + class ScatterMatrixXS(MatrixMGXS): r"""A scattering matrix multi-group cross section with the cosine of the change-in-angle represented as one or more Legendre moments or a histogram. @@ -3598,10 +3617,10 @@ class ScatterMatrixXS(MatrixMGXS): name : str, optional Name of the multi-group cross section. Used as a label to identify tallies in OpenMC 'tallies.xml' file. - num_polar : Integral, optional + num_polar : int, optional Number of equi-width polar angle bins for angle discretization; defaults to one bin - num_azimuthal : Integral, optional + num_azimuthal : int, optional Number of equi-width azimuthal angle bins for angle discretization; defaults to one bin nu : bool @@ -3647,9 +3666,9 @@ class ScatterMatrixXS(MatrixMGXS): Domain type for spatial homogenization energy_groups : openmc.mgxs.EnergyGroups Energy group structure for energy condensation - num_polar : Integral + num_polar : int Number of equi-width polar angle bins for angle discretization - num_azimuthal : Integral + num_azimuthal : int Number of equi-width azimuthal angle bins for angle discretization tally_trigger : openmc.Trigger An (optional) tally precision trigger given to each tally used to @@ -3767,38 +3786,25 @@ class ScatterMatrixXS(MatrixMGXS): def scores(self): if self.formulation == 'simple': - scores = ['flux'] - - if self.scatter_format == 'legendre': - if self.legendre_order == 0: - scores.append('{}-0'.format(self.rxn_type)) - if self.correction: - scores.append('{}-1'.format(self.rxn_type)) - else: - scores.append('{}-P{}'.format(self.rxn_type, self.legendre_order)) - elif self.scatter_format == 'histogram': - scores += [self.rxn_type] + scores = ['flux', self.rxn_type] else: # Add scores for groupwise scattering cross section scores = ['flux', 'scatter'] # Add scores for group-to-group scattering probability matrix - if self.scatter_format == 'legendre': - if self.legendre_order == 0: - scores.append('scatter-0') - else: - scores.append('scatter-P{}'.format(self.legendre_order)) - elif self.scatter_format == 'histogram': - scores.append('scatter-0') + # these scores also contain the angular information, whether it be + # Legendre expansion or histogram bins + scores.append('scatter') - # Add scores for multiplicity matrix + # Add scores for multiplicity matrix; scatter info for the + # denominator will come from the previous score if self.nu: - scores.extend(['nu-scatter-0', 'scatter-0']) + scores.append('nu-scatter') # Add scores for transport correction if self.correction == 'P0' and self.legendre_order == 0: - scores.extend(['{}-1'.format(self.rxn_type), 'flux']) + scores.extend([self.rxn_type, 'flux']) return scores @@ -3811,15 +3817,15 @@ class ScatterMatrixXS(MatrixMGXS): tally_keys = ['flux (tracklength)', 'scatter'] # Add keys for group-to-group scattering probability matrix - tally_keys.append('scatter-P{}'.format(self.legendre_order)) + tally_keys.append('scatter matrix') # Add keys for multiplicity matrix if self.nu: - tally_keys.extend(['nu-scatter-0', 'scatter-0']) + tally_keys.extend(['nu-scatter']) # Add keys for transport correction if self.correction == 'P0' and self.legendre_order == 0: - tally_keys.extend(['{}-1'.format(self.rxn_type), 'flux (analog)']) + tally_keys.extend(['correction', 'flux (analog)']) return tally_keys @@ -3836,7 +3842,7 @@ class ScatterMatrixXS(MatrixMGXS): # Add estimators for multiplicity matrix if self.nu: - estimators.extend(['analog', 'analog']) + estimators.extend(['analog']) # Add estimators for transport correction if self.correction == 'P0' and self.legendre_order == 0: @@ -3853,13 +3859,15 @@ class ScatterMatrixXS(MatrixMGXS): if self.scatter_format == 'legendre': if self.correction == 'P0' and self.legendre_order == 0: - filters = [[energy], [energy, energyout], [energyout]] + angle_filter = openmc.LegendreFilter(order=1) else: - filters = [[energy], [energy, energyout]] + angle_filter = \ + openmc.LegendreFilter(order=self.legendre_order) elif self.scatter_format == 'histogram': bins = np.linspace(-1., 1., num=self.histogram_bins + 1, endpoint=True) - filters = [[energy], [energy, energyout, openmc.MuFilter(bins)]] + angle_filter = openmc.MuFilter(bins) + filters = [[energy], [energy, energyout, angle_filter]] else: group_edges = self.energy_groups.group_edges @@ -3871,19 +3879,21 @@ class ScatterMatrixXS(MatrixMGXS): # Group-to-group scattering probability matrix if self.scatter_format == 'legendre': - filters.append([energy, energyout]) + angle_filter = openmc.LegendreFilter(order=self.legendre_order) elif self.scatter_format == 'histogram': bins = np.linspace(-1., 1., num=self.histogram_bins + 1, endpoint=True) - filters.append([energy, energyout, openmc.MuFilter(bins)]) + angle_filter = openmc.MuFilter(bins) + filters.append([energy, energyout, angle_filter]) # Multiplicity matrix if self.nu: - filters.extend([[energy, energyout], [energy, energyout]]) + filters.extend([[energy, energyout]]) # Add filters for transport correction if self.correction == 'P0' and self.legendre_order == 0: - filters.extend([[energyout], [energy]]) + filters.extend([[energyout, openmc.LegendreFilter(1)], + [energy]]) return self._add_angle_filters(filters) @@ -3894,27 +3904,39 @@ class ScatterMatrixXS(MatrixMGXS): if self.formulation == 'simple': if self.scatter_format == 'legendre': - # If using P0 correction subtract scatter-1 from the diagonal + # If using P0 correction subtract P2 scatter from the diag. if self.correction == 'P0' and self.legendre_order == 0: - scatter_p0 = self.tallies['{}-0'.format(self.rxn_type)] - scatter_p1 = self.tallies['{}-1'.format(self.rxn_type)] - energy_filter = scatter_p0.find_filter(openmc.EnergyFilter) + scatter_p0 = self.tallies[self.rxn_type].get_slice( + filters=[openmc.LegendreFilter], + filter_bins=[('P0',)]) + scatter_p1 = self.tallies[self.rxn_type].get_slice( + filters=[openmc.LegendreFilter], + filter_bins=[('P1',)]) - # Transform scatter-p1 tally into an energyin/out matrix + # Set the Legendre order of these tallies to be 0 + # so they can be subtracted + legendre = openmc.LegendreFilter(order=0) + scatter_p0.filters[-1] = legendre + scatter_p1.filters[-1] = legendre + + scatter_p1 = scatter_p1.summation( + filter_type=openmc.EnergyFilter, + remove_filter=True) + + energy_filter = \ + scatter_p0.find_filter(openmc.EnergyFilter) + + # Transform scatter-p1 into an energyin/out matrix # to match scattering matrix shape for tally arithmetic energy_filter = copy.deepcopy(energy_filter) - scatter_p1 = scatter_p1.diagonalize_filter(energy_filter) + scatter_p1 = \ + scatter_p1.diagonalize_filter(energy_filter) + self._rxn_rate_tally = scatter_p0 - scatter_p1 - # Extract scattering moment reaction rate Tally - elif self.legendre_order == 0: - tally_key = '{}-{}'.format(self.rxn_type, - self.legendre_order) - self._rxn_rate_tally = self.tallies[tally_key] + # Otherwise, extract scattering moment reaction rate Tally else: - tally_key = '{}-P{}'.format(self.rxn_type, - self.legendre_order) - self._rxn_rate_tally = self.tallies[tally_key] + self._rxn_rate_tally = self.tallies[self.rxn_type] elif self.scatter_format == 'histogram': # Extract scattering rate distribution tally self._rxn_rate_tally = self.tallies[self.rxn_type] @@ -3941,35 +3963,24 @@ class ScatterMatrixXS(MatrixMGXS): self._xs_tally = MGXS.xs_tally.fget(self) else: - # Compute scattering probability matrix - energyout_bins = [self.energy_groups.get_group_bounds(i) - for i in range(self.num_groups, 0, -1)] - tally_key = 'scatter-P{}'.format(self.legendre_order) + # Compute scattering probability matrixS + tally_key = 'scatter matrix' # Compute normalization factor summed across outgoing energies - norm = self.tallies[tally_key].get_slice(scores=['scatter-0']) - norm = norm.summation( - filter_type=openmc.EnergyoutFilter, filter_bins=energyout_bins) - - # Remove the AggregateFilter summed across energyout bins - norm._filters = norm._filters[:2] + if self.scatter_format == 'legendre': + norm = self.tallies[tally_key].get_slice( + scores=['scatter'], + filters=[openmc.LegendreFilter], + filter_bins=[('P0',)], squeeze=True) # Compute normalization factor summed across outgoing mu bins - if self.scatter_format == 'histogram': - - # (Re-)append the MuFilter which was removed above - mu_bins = np.linspace( - -1., 1., num=self.histogram_bins + 1, endpoint=True) - norm._filters.append(openmc.MuFilter(mu_bins)) - - # Sum across all mu bins - mu_bins = [(mu_bins[i], mu_bins[i+1]) for - i in range(self.histogram_bins)] + elif self.scatter_format == 'histogram': + norm = self.tallies[tally_key].get_slice( + scores=['scatter']) norm = norm.summation( - filter_type=openmc.MuFilter, filter_bins=mu_bins) - - # Remove the AggregateFilter summed across mu bins - norm._filters = norm._filters[:2] + filter_type=openmc.MuFilter, remove_filter=True) + norm = norm.summation(filter_type=openmc.EnergyoutFilter, + remove_filter=True) # Compute groupwise scattering cross section self._xs_tally = self.tallies['scatter'] * \ @@ -3981,15 +3992,36 @@ class ScatterMatrixXS(MatrixMGXS): # Multiply by the multiplicity matrix if self.nu: - numer = self.tallies['nu-scatter-0'] - denom = self.tallies['scatter-0'] + numer = self.tallies['nu-scatter'] + # Get the denominator + if self.scatter_format == 'legendre': + denom = self.tallies[tally_key].get_slice( + scores=['scatter'], + filters=[openmc.LegendreFilter], + filter_bins=[('P0',)], squeeze=True) + + # Compute normalization factor summed across mu bins + elif self.scatter_format == 'histogram': + denom = self.tallies[tally_key].get_slice( + scores=['scatter']) + + # Sum across all mu bins + denom = denom.summation( + filter_type=openmc.MuFilter, remove_filter=True) + self._xs_tally *= (numer / denom) # If using P0 correction subtract scatter-1 from the diagonal if self.correction == 'P0' and self.legendre_order == 0: - scatter_p1 = self.tallies['{}-1'.format(self.rxn_type)] + scatter_p1 = self.tallies['correction'].get_slice( + filters=[openmc.LegendreFilter], filter_bins=[('P1',)]) flux = self.tallies['flux (analog)'] + # Set the Legendre order of the P1 tally to be 0 + # so it can be subtracted + legendre = openmc.LegendreFilter(order=0) + scatter_p1.filters[-1] = legendre + # Transform scatter-p1 tally into an energyin/out matrix # to match scattering matrix shape for tally arithmetic energy_filter = flux.find_filter(openmc.EnergyFilter) @@ -4005,6 +4037,20 @@ class ScatterMatrixXS(MatrixMGXS): self._compute_xs() + # Force the angle filter to be the last filter + if self.scatter_format == 'histogram': + angle_filter = self._xs_tally.find_filter(openmc.MuFilter) + else: + angle_filter = \ + self._xs_tally.find_filter(openmc.LegendreFilter) + angle_filter_index = self._xs_tally.filters.index(angle_filter) + # If the angle filter index is not last, then make it last + if angle_filter_index != len(self._xs_tally.filters) - 1: + energyout_filter = \ + self._xs_tally.find_filter(openmc.EnergyoutFilter) + self._xs_tally._swap_filters(energyout_filter, + angle_filter) + return self._xs_tally @nu.setter @@ -4125,16 +4171,6 @@ class ScatterMatrixXS(MatrixMGXS): self._rxn_rate_tally = None self._loaded_sp = False - if self.scatter_format == 'legendre': - # Expand scores to match the format in the statepoint - # e.g., "scatter-P2" -> "scatter-0", "scatter-1", "scatter-2" - for tally_key, tally in self.tallies.items(): - if 'scatter-P' in tally.scores[0]: - score_prefix = tally.scores[0].split('P')[0] - self.tallies[tally_key].scores = \ - [score_prefix + '{}'.format(i) - for i in range(self.legendre_order + 1)] - super().load_from_statepoint(statepoint) def get_slice(self, nuclides=[], in_groups=[], out_groups=[], @@ -4187,12 +4223,11 @@ class ScatterMatrixXS(MatrixMGXS): slice_xs.legendre_order = legendre_order # Slice the scattering tally - tally_key = '{}-P{}'.format(self.rxn_type, self.legendre_order) - expand_scores = \ - [self.rxn_type + '-{}'.format(i) - for i in range(self.legendre_order + 1)] - slice_xs.tallies[tally_key] = \ - slice_xs.tallies[tally_key].get_slice(scores=expand_scores) + filter_bins = [tuple(['P{}'.format(i) + for i in range(self.legendre_order + 1)])] + slice_xs.tallies[self.rxn_type] = \ + slice_xs.tallies[self.rxn_type].get_slice( + filters=[openmc.LegendreFilter], filter_bins=filter_bins) # Slice outgoing energy groups if needed if len(out_groups) != 0: @@ -4206,7 +4241,8 @@ class ScatterMatrixXS(MatrixMGXS): for tally_type, tally in slice_xs.tallies.items(): if tally.contains_filter(openmc.EnergyoutFilter): tally_slice = tally.get_slice( - filters=[openmc.EnergyoutFilter], filter_bins=filter_bins) + filters=[openmc.EnergyoutFilter], + filter_bins=filter_bins) slice_xs.tallies[tally_type] = tally_slice slice_xs.sparse = self.sparse @@ -4317,14 +4353,19 @@ class ScatterMatrixXS(MatrixMGXS): filter_bins.append((self.energy_groups.get_group_bounds(group),)) # Construct CrossScore for requested scattering moment - if moment != 'all' and self.scatter_format == 'legendre': - cv.check_type('moment', moment, Integral) - cv.check_greater_than('moment', moment, 0, equality=True) - cv.check_less_than( - 'moment', moment, self.legendre_order, equality=True) - scores = [self.xs_tally.scores[moment]] + if self.scatter_format == 'legendre': + if moment != 'all': + cv.check_type('moment', moment, Integral) + cv.check_greater_than('moment', moment, 0, equality=True) + cv.check_less_than( + 'moment', moment, self.legendre_order, equality=True) + filters.append(openmc.LegendreFilter) + filter_bins.append(('P{}'.format(moment),)) + num_angle_bins = 1 + else: + num_angle_bins = self.legendre_order + 1 else: - scores = [] + num_angle_bins = self.histogram_bins # Construct a collection of the nuclides to retrieve from the xs tally if self.by_nuclide: @@ -4336,6 +4377,7 @@ class ScatterMatrixXS(MatrixMGXS): query_nuclides = ['total'] # Use tally summation if user requested the sum for all nuclides + scores = self.xs_tally.scores if nuclides == 'sum' or nuclides == ['sum']: xs_tally = self.xs_tally.summation(nuclides=query_nuclides) xs = xs_tally.get_values(scores=scores, filters=filters, @@ -4367,24 +4409,15 @@ class ScatterMatrixXS(MatrixMGXS): else: num_out_groups = len(out_groups) - if self.scatter_format == 'histogram': - num_mu_bins = self.histogram_bins - else: - num_mu_bins = 1 - # Reshape tally data array with separate axes for domain and energy # Accomodate the polar and azimuthal bins if needed - num_subdomains = int(xs.shape[0] / (num_mu_bins * num_in_groups * + num_subdomains = int(xs.shape[0] / (num_angle_bins * num_in_groups * num_out_groups * self.num_polar * self.num_azimuthal)) if self.num_polar > 1 or self.num_azimuthal > 1: - if self.scatter_format == 'histogram': - new_shape = (self.num_polar, self.num_azimuthal, - num_subdomains, num_in_groups, num_out_groups, - num_mu_bins) - else: - new_shape = (self.num_polar, self.num_azimuthal, - num_subdomains, num_in_groups, num_out_groups) + new_shape = (self.num_polar, self.num_azimuthal, + num_subdomains, num_in_groups, num_out_groups, + num_angle_bins) new_shape += xs.shape[1:] xs = np.reshape(xs, new_shape) @@ -4397,11 +4430,9 @@ class ScatterMatrixXS(MatrixMGXS): if order_groups == 'increasing': xs = xs[:, :, :, ::-1, ::-1, ...] else: - if self.scatter_format == 'histogram': - new_shape = (num_subdomains, num_in_groups, num_out_groups, - num_mu_bins) - else: - new_shape = (num_subdomains, num_in_groups, num_out_groups) + new_shape = (num_subdomains, num_in_groups, num_out_groups, + num_angle_bins) + new_shape += xs.shape[1:] xs = np.reshape(xs, new_shape) @@ -4416,88 +4447,12 @@ class ScatterMatrixXS(MatrixMGXS): if squeeze: # We want to squeeze out everything but the angles, in_groups, - # out_groups, and, if needed, num_mu_bins dimension. These must + # out_groups, and, if needed, num_angle_bins dimension. These must # not be squeezed so 1-group, 1-angle problems have the correct # shape. xs = self._squeeze_xs(xs) return xs - def get_pandas_dataframe(self, groups='all', nuclides='all', moment='all', - xs_type='macro', paths=True): - """Build a Pandas DataFrame for the MGXS data. - - This method leverages :meth:`openmc.Tally.get_pandas_dataframe`, but - renames the columns with terminology appropriate for cross section data. - - Parameters - ---------- - groups : Iterable of Integral or 'all' - Energy groups of interest. Defaults to 'all'. - nuclides : Iterable of str or 'all' or 'sum' - The nuclides of the cross-sections to include in the dataframe. This - may be a list of nuclide name strings (e.g., ['U235', 'U238']). - The special string 'all' will include the cross sections for all - nuclides in the spatial domain. The special string 'sum' will - include the cross sections summed over all nuclides. Defaults - to 'all'. - moment : int or 'all' - The scattering matrix moment to return. All moments will be - returned if the moment is 'all' (default); otherwise, a specific - moment will be returned. - xs_type: {'macro', 'micro'} - Return macro or micro cross section in units of cm^-1 or barns. - Defaults to 'macro'. - paths : bool, optional - Construct columns for distribcell tally filters (default is True). - The geometric information in the Summary object is embedded into a - Multi-index column with a geometric "path" to each distribcell - instance. - - Returns - ------- - pandas.DataFrame - A Pandas DataFrame for the cross section data. - - Raises - ------ - ValueError - When this method is called before the multi-group cross section is - computed from tally data. - - """ - - df = super().get_pandas_dataframe(groups, nuclides, xs_type, paths) - - if self.scatter_format == 'legendre': - # Add a moment column to dataframe - if self.legendre_order > 0: - # Insert a column corresponding to the Legendre moments - moments = ['P{}'.format(i) - for i in range(self.legendre_order + 1)] - moments = np.tile(moments, int(df.shape[0] / len(moments))) - df['moment'] = moments - - # Place the moment column before the mean column - columns = df.columns.tolist() - mean_index \ - = [i for i, s in enumerate(columns) if 'mean' in s][0] - if self.domain_type == 'mesh': - df = df[columns[:mean_index] + [('moment', '')] + - columns[mean_index:-1]] - else: - df = df[columns[:mean_index] + ['moment'] + - columns[mean_index:-1]] - - # Select rows corresponding to requested scattering moment - if moment != 'all': - cv.check_type('moment', moment, Integral) - cv.check_greater_than('moment', moment, 0, equality=True) - cv.check_less_than( - 'moment', moment, self.legendre_order, equality=True) - df = df[df['moment'] == 'P{}'.format(moment)] - - return df - def print_xs(self, subdomains='all', nuclides='all', xs_type='macro', moment=0): """Prints a string representation for the multi-group cross section. @@ -4511,8 +4466,9 @@ class ScatterMatrixXS(MatrixMGXS): The nuclides of the cross-sections to include in the report. This may be a list of nuclide name strings (e.g., ['U235', 'U238']). The special string 'all' will report the cross sections for all - nuclides in the spatial domain. The special string 'sum' will report - the cross sections summed over all nuclides. Defaults to 'all'. + nuclides in the spatial domain. The special string 'sum' will + report the cross sections summed over all nuclides. Defaults to + 'all'. xs_type: {'macro', 'micro'} Return the macro or micro cross section in units of cm^-1 or barns. Defaults to 'macro'. @@ -4986,14 +4942,9 @@ class ScatterProbabilityMatrix(MatrixMGXS): def xs_tally(self): if self._xs_tally is None: - energyout_bins = [self.energy_groups.get_group_bounds(i) - for i in range(self.num_groups, 0, -1)] norm = self.rxn_rate_tally.get_slice(scores=[self.rxn_type]) norm = norm.summation( - filter_type=openmc.EnergyoutFilter, filter_bins=energyout_bins) - - # Remove the AggregateFilter summed across energyout bins - norm._filters = norm._filters[:2] + filter_type=openmc.EnergyoutFilter, remove_filter=True) # Compute the group-to-group probabilities self._xs_tally = self.tallies[self.rxn_type] / norm diff --git a/openmc/plotter.py b/openmc/plotter.py index 191b50c563..597a87750b 100644 --- a/openmc/plotter.py +++ b/openmc/plotter.py @@ -170,13 +170,13 @@ def plot_xs(this, types, divisor_types=None, temperature=294., data_type=None, data = data_new else: # Calculate for MG cross sections - E, data = calculate_mgxs(this, types, orders, temperature, + E, data = calculate_mgxs(this, data_type, types, orders, temperature, mg_cross_sections, ce_cross_sections, enrichment) if divisor_types: cv.check_length('divisor types', divisor_types, len(types)) - Ediv, data_div = calculate_mgxs(this, divisor_types, + Ediv, data_div = calculate_mgxs(this, data_type, divisor_types, divisor_orders, temperature, mg_cross_sections, ce_cross_sections, enrichment) @@ -243,7 +243,7 @@ def calculate_cexs(this, data_type, types, temperature=294., sab_name=None, Parameters ---------- - this : str or openmc.Material + this : {str, openmc.Nuclide, openmc.Element, openmc.Material} Object to source data from data_type : {'nuclide', 'element', material'} Type of object to plot @@ -280,7 +280,11 @@ def calculate_cexs(this, data_type, types, temperature=294., sab_name=None, cv.check_type('enrichment', enrichment, Real) if data_type == 'nuclide': - energy_grid, xs = _calculate_cexs_nuclide(this, types, temperature, + if isinstance(this, str): + nuc = openmc.Nuclide(this) + else: + nuc = this + energy_grid, xs = _calculate_cexs_nuclide(nuc, types, temperature, sab_name, cross_sections) # Convert xs (Iterable of Callable) to a grid of cross section values # calculated on @ the points in energy_grid for consistency with the @@ -289,10 +293,15 @@ def calculate_cexs(this, data_type, types, temperature=294., sab_name=None, for line in range(len(types)): data[line, :] = xs[line](energy_grid) elif data_type == 'element': - energy_grid, data = _calculate_cexs_elem_mat(this, types, temperature, + if isinstance(this, str): + elem = openmc.Element(this) + else: + elem = this + energy_grid, data = _calculate_cexs_elem_mat(elem, types, temperature, cross_sections, sab_name, enrichment) elif data_type == 'material': + cv.check_type('this', this, openmc.Material) energy_grid, data = _calculate_cexs_elem_mat(this, types, temperature, cross_sections) else: @@ -518,10 +527,8 @@ def _calculate_cexs_elem_mat(this, types, temperature=294., T = this.temperature else: T = temperature - data_type = 'material' else: T = temperature - data_type = 'element' # Load the library library = openmc.data.DataLibrary.from_xml(cross_sections) @@ -571,7 +578,7 @@ def _calculate_cexs_elem_mat(this, types, temperature=294., name = nuclide[0] nuc = nuclide[1] sab_tab = sabs[name] - temp_E, temp_xs = calculate_cexs(nuc, data_type, types, T, sab_tab, + temp_E, temp_xs = calculate_cexs(nuc, 'nuclide', types, T, sab_tab, cross_sections) E.append(temp_E) # Since the energy grids are different, store the cross sections as diff --git a/openmc/statepoint.py b/openmc/statepoint.py index eb011d8742..9c8eb709fa 100644 --- a/openmc/statepoint.py +++ b/openmc/statepoint.py @@ -405,17 +405,10 @@ class StatePoint(object): scores = group['score_bins'].value n_score_bins = group['n_score_bins'].value - # Read scattering moment order strings (e.g., P3, Y1,2, etc.) - moments = group['moment_orders'].value - # Add the scores to the Tally for j, score in enumerate(scores): score = score.decode() - # If this is a moment, use generic moment order - pattern = r'-n$|-pn$|-yn$' - score = re.sub(pattern, '-' + moments[j].decode(), score) - tally.scores.append(score) # Add Tally to the global dictionary of all Tallies diff --git a/openmc/summary.py b/openmc/summary.py index aa98025c08..10898290a3 100644 --- a/openmc/summary.py +++ b/openmc/summary.py @@ -9,7 +9,7 @@ import openmc import openmc.checkvalue as cv from openmc.region import Region -_VERSION_SUMMARY = 5 +_VERSION_SUMMARY = 6 class Summary(object): @@ -26,6 +26,8 @@ class Summary(object): nuclides : dict Dictionary whose keys are nuclide names and values are atomic weight ratios. + macroscopics : list + Names of macroscopic data sets version: tuple of int Version of OpenMC @@ -44,13 +46,15 @@ class Summary(object): self._fast_materials = {} self._fast_surfaces = {} self._fast_cells = {} - self._fast_universes = {} + self._fast_universes = {} self._fast_lattices = {} self._materials = openmc.Materials() self._nuclides = {} + self._macroscopics = [] self._read_nuclides() + self._read_macroscopics() with warnings.catch_warnings(): warnings.simplefilter("ignore", openmc.IDWarning) self._read_geometry() @@ -71,15 +75,26 @@ class Summary(object): def nuclides(self): return self._nuclides + @property + def macroscopics(self): + return self._macroscopics + @property def version(self): return tuple(self._f.attrs['openmc_version']) def _read_nuclides(self): - names = self._f['nuclides/names'].value - awrs = self._f['nuclides/awrs'].value - for name, awr in zip(names, awrs): - self._nuclides[name.decode()] = awr + if 'nuclides/names' in self._f: + names = self._f['nuclides/names'].value + awrs = self._f['nuclides/awrs'].value + for name, awr in zip(names, awrs): + self._nuclides[name.decode()] = awr + + def _read_macroscopics(self): + if 'macroscopics/names' in self._f: + names = self._f['macroscopics/names'].value + for name in names: + self._macroscopics = name.decode() def _read_geometry(self): # Read in and initialize the Materials and Geometry diff --git a/openmc/tallies.py b/openmc/tallies.py index 50398b786e..1ac89129a9 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -65,9 +65,7 @@ class Tally(IDManagerMixin): triggers : list of openmc.Trigger List of tally triggers num_scores : int - Total number of scores, accounting for the fact that a single - user-specified score, e.g. scatter-P3 or flux-Y2,2, might have multiple - bins + Total number of scores num_filter_bins : int Total number of filter bins accounting for all filters num_bins : int @@ -388,6 +386,14 @@ class Tally(IDManagerMixin): # If score is a string, strip whitespace if isinstance(score, str): + # Check to see if scores are deprecated before storing + for deprecated in ['scatter-', 'nu-scatter-', 'scatter-p', + 'nu-scatter-p', 'scatter-y', 'nu-scatter-y', + 'flux-y', 'total-y']: + if score.startswith(deprecated): + msg = score.strip() + ' is deprecated and should no ' \ + 'longer be used.' + raise ValueError(msg) scores[i] = score.strip() self._scores = cv.CheckedList(_SCORE_CLASSES, 'tally scores', scores) @@ -827,51 +833,8 @@ class Tally(IDManagerMixin): # Sparsify merged tally if both tallies are sparse merged_tally.sparse = self.sparse and other.sparse - # Consolidate scatter and flux Legendre moment scores - merged_tally._consolidate_moment_scores() - return merged_tally - def _consolidate_moment_scores(self): - """Remove redundant scattering and flux moment scores from a Tally.""" - - # Define regex for scatter, nu-scatter and flux moment scores - regex = [(r'^((?!nu-)scatter-\d)', r'^((?!nu-)scatter-(P|p)\d)'), - (r'nu-scatter-\d', r'nu-scatter-(P|p)\d'), - (r'flux-\d', r'flux-(P|p)\d')] - - # Find all non-scattering and non-flux moment scores - scores = [x for x in self.scores if - re.search(r'^((?!scatter-).)*$', x)] - scores = [x for x in scores if - re.search(r'^((?!flux-).)*$', x)] - - for regex_n, regex_pn in regex: - - # Use regex to find score-(P)n scores - score_n = [x for x in self.scores if re.search(regex_n, x)] - score_pn = [x for x in self.scores if re.search(regex_pn, x)] - - # Consolidate moment scores - if len(score_pn) > 0: - - # Only keep the highest score-PN score - high_pn = sorted([x.lower() for x in score_pn])[-1] - pn = int(high_pn.split('-')[-1].replace('p', '')) - - # Only keep the score-N scores with N > PN - score_n = sorted([x.lower() for x in score_n]) - score_n = [x for x in score_n if (int(x.split('-')[1]) > pn)] - - # Append highest score-PN and any higher score-N scores - scores.extend([high_pn] + score_n) - else: - scores.extend(score_n) - - # Override Tally's scores with consolidated list of scores - self.scores = scores - - def to_xml_element(self): """Return XML representation of the tally @@ -1180,7 +1143,7 @@ class Tally(IDManagerMixin): # Determine the score indices from any of the requested scores if nuclides: - nuclide_indices = np.zeros(len(nuclides), dtype=np.int) + nuclide_indices = np.zeros(len(nuclides), dtype=int) for i, nuclide in enumerate(nuclides): nuclide_indices[i] = self.get_nuclide_index(nuclide) @@ -1219,7 +1182,7 @@ class Tally(IDManagerMixin): # Determine the score indices from any of the requested scores if scores: - score_indices = np.zeros(len(scores), dtype=np.int) + score_indices = np.zeros(len(scores), dtype=int) for i, score in enumerate(scores): score_indices[i] = self.get_score_index(score) @@ -1491,11 +1454,8 @@ class Tally(IDManagerMixin): data = self.get_values(value=value) # Build a new array shape with one dimension per filter - new_shape = () - for self_filter in self.filters: - new_shape += (self_filter.num_bins, ) - new_shape += (self.num_nuclides,) - new_shape += (self.num_scores,) + new_shape = tuple(f.num_bins for f in self.filters) + new_shape += (self.num_nuclides, self.num_scores) # Reshape the data with one dimension for each filter data = np.reshape(data, new_shape) @@ -2772,7 +2732,7 @@ class Tally(IDManagerMixin): # Sum across the bins in the user-specified filter for i, self_filter in enumerate(self.filters): - if isinstance(self_filter, filter_type): + if type(self_filter) == filter_type: shape = mean.shape mean = np.take(mean, indices=bin_indices, axis=i) std_dev = np.take(std_dev, indices=bin_indices, axis=i) @@ -3012,7 +2972,7 @@ class Tally(IDManagerMixin): The data in the derived tally arrays is "diagonalized" along the bins in the new filter. This functionality is used by the openmc.mgxs module; to transport-correct scattering matrices by subtracting a 'scatter-P1' - reaction rate tally with an energy filter from an 'scatter' reaction + reaction rate tally with an energy filter from a 'scatter' reaction rate tally with both energy and energyout filters. Parameters @@ -3031,7 +2991,7 @@ class Tally(IDManagerMixin): if new_filter in self.filters: msg = 'Unable to diagonalize Tally ID="{0}" which already ' \ - 'contains a "{1}" filter'.format(self.id, new_filter.type) + 'contains a "{1}" filter'.format(self.id, type(new_filter)) raise ValueError(msg) # Add the new filter to a copy of this Tally @@ -3042,8 +3002,8 @@ class Tally(IDManagerMixin): # by which the "base" indices should be repeated to account for all # other filter bins in the diagonalized tally indices = np.arange(0, new_filter.num_bins**2, new_filter.num_bins+1) - diag_factor = int(self.num_filter_bins / new_filter.num_bins) - diag_indices = np.zeros(self.num_filter_bins, dtype=np.int) + diag_factor = self.num_filter_bins // new_filter.num_bins + diag_indices = np.zeros(self.num_filter_bins, dtype=int) # Determine the filter indices along the new "diagonal" for i in range(diag_factor): diff --git a/src/cmfd_data.F90 b/src/cmfd_data.F90 index 3152f1eb2b..ce4825426b 100644 --- a/src/cmfd_data.F90 +++ b/src/cmfd_data.F90 @@ -76,6 +76,7 @@ contains integer :: i_filter_mesh ! index for mesh filter integer :: i_filter_ein ! index for incoming energy filter integer :: i_filter_eout ! index for outgoing energy filter + integer :: i_filter_legendre ! index for Legendre filter integer :: i_mesh ! flattend index for mesh logical :: energy_filters! energy filters present real(8) :: flux ! temp variable for flux @@ -116,8 +117,11 @@ contains if (ital < 3) then i_filter_mesh = t % filter(t % find_filter(FILTER_MESH)) - else + else if (ital == 3) then i_filter_mesh = t % filter(t % find_filter(FILTER_MESHSURFACE)) + else if (ital == 4) then + i_filter_mesh = t % filter(t % find_filter(FILTER_MESH)) + i_filter_legendre = t % filter(t % find_filter(FILTER_LEGENDRE)) end if ! Check for energy filters @@ -187,13 +191,6 @@ contains ! Get total rr and convert to total xs cmfd % totalxs(h,i,j,k) = t % results(RESULT_SUM,2,score_index) / flux - ! Get p1 scatter rr and convert to p1 scatter xs - cmfd % p1scattxs(h,i,j,k) = t % results(RESULT_SUM,3,score_index) / flux - - ! Calculate diffusion coefficient - cmfd % diffcof(h,i,j,k) = ONE/(3.0_8*(cmfd % totalxs(h,i,j,k) - & - cmfd % p1scattxs(h,i,j,k))) - else if (ital == 2) then ! Begin loop to get energy out tallies @@ -301,6 +298,46 @@ contains score_index + IN_TOP) cmfd % current(12,h,i,j,k) = t % results(RESULT_SUM, 1, & score_index + OUT_TOP) + + else if (ital == 4) then + + ! Reset all bins to 1 + do l = 1, size(t % filter) + call filter_matches(t % filter(l)) % bins % clear() + call filter_matches(t % filter(l)) % bins % push_back(1) + end do + + ! Set ijk as mesh indices + ijk = (/ i, j, k /) + + ! Get bin number for mesh indices + filter_matches(i_filter_mesh) % bins % data(1) = & + m % get_bin_from_indices(ijk) + + ! Apply energy in filter + if (energy_filters) then + filter_matches(i_filter_ein) % bins % data(1) = ng - h + 1 + end if + + ! Apply Legendre filter + filter_matches(i_filter_legendre) % bins % data(1) = 2 + + ! Calculate score index from bins + score_index = 1 + do l = 1, size(t % filter) + score_index = score_index + (filter_matches(t % filter(l)) & + % bins % data(1) - 1) * t % stride(l) + end do + + ! Get p1 scatter rr and convert to p1 scatter xs + cmfd % p1scattxs(h,i,j,k) = & + t % results(RESULT_SUM,1,score_index) / & + cmfd % flux(h,i,j,k) + + ! Calculate diffusion coefficient + cmfd % diffcof(h,i,j,k) = & + ONE/(3.0_8*(cmfd % totalxs(h,i,j,k) - & + cmfd % p1scattxs(h,i,j,k))) end if TALLY end do OUTGROUP diff --git a/src/cmfd_input.F90 b/src/cmfd_input.F90 index 40b4abf572..549cff4191 100644 --- a/src/cmfd_input.F90 +++ b/src/cmfd_input.F90 @@ -373,7 +373,7 @@ contains ! Determine number of filters energy_filters = check_for_node(node_mesh, "energy") - n = merge(4, 2, energy_filters) + n = merge(5, 3, energy_filters) ! Extend filters array so we can add CMFD filters err = openmc_extend_filters(n, i_filt_start, i_filt_end) @@ -414,6 +414,12 @@ contains err = openmc_filter_set_id(i_filt, filt_id) err = openmc_meshsurface_filter_set_mesh(i_filt, i_start) + ! Add in legendre filter for the P1 tally + i_filt = i_filt + 1 + err = openmc_filter_set_type(i_filt, C_CHAR_'legendre' // C_NULL_CHAR) + call openmc_get_filter_next_id(filt_id) + err = openmc_filter_set_id(i_filt, filt_id) + err = openmc_legendre_filter_set_order(i_filt, 1) ! Initialize filters do i = i_filt_start, i_filt_end @@ -421,7 +427,7 @@ contains end do ! Allocate tallies - err = openmc_extend_tallies(3, i_start, i_end) + err = openmc_extend_tallies(4, i_start, i_end) cmfd_tallies => tallies(i_start:i_end) ! Begin loop around tallies @@ -455,7 +461,7 @@ contains if (i == 1) then ! Set name - t % name = "CMFD flux, total, scatter-1" + t % name = "CMFD flux, total" ! Set tally estimator to analog t % estimator = ESTIMATOR_ANALOG @@ -473,19 +479,12 @@ contains deallocate(filter_indices) ! Allocate scoring bins - allocate(t % score_bins(3)) - t % n_score_bins = 3 - t % n_user_score_bins = 3 - - ! Allocate scattering order data - allocate(t % moment_order(3)) - t % moment_order = 0 + allocate(t % score_bins(2)) + t % n_score_bins = 2 ! Set macro_bins t % score_bins(1) = SCORE_FLUX t % score_bins(2) = SCORE_TOTAL - t % score_bins(3) = SCORE_SCATTER_N - t % moment_order(3) = 1 else if (i == 2) then @@ -517,11 +516,6 @@ contains ! Allocate macro reactions allocate(t % score_bins(2)) t % n_score_bins = 2 - t % n_user_score_bins = 2 - - ! Allocate scattering order data - allocate(t % moment_order(2)) - t % moment_order = 0 ! Set macro_bins t % score_bins(1) = SCORE_NU_SCATTER @@ -537,7 +531,7 @@ contains ! Allocate and set filters allocate(filter_indices(n_filter)) - filter_indices(1) = i_filt_end + filter_indices(1) = i_filt_end - 1 if (energy_filters) then filter_indices(2) = i_filt_start + 1 end if @@ -547,15 +541,41 @@ contains ! Allocate macro reactions allocate(t % score_bins(1)) t % n_score_bins = 1 - t % n_user_score_bins = 1 - - ! Allocate scattering order data - allocate(t % moment_order(1)) - t % moment_order = 0 ! Set macro bins t % score_bins(1) = SCORE_CURRENT t % type = TALLY_MESH_SURFACE + + else if (i == 4) then + ! Set name + t % name = "CMFD P1 scatter" + + ! Set tally estimator to analog + t % estimator = ESTIMATOR_ANALOG + + ! Set tally type to volume + t % type = TALLY_VOLUME + + ! Allocate and set filters + n_filter = 2 + if (energy_filters) then + n_filter = n_filter + 1 + end if + allocate(filter_indices(n_filter)) + filter_indices(1) = i_filt_start + filter_indices(2) = i_filt_end + if (energy_filters) then + filter_indices(3) = i_filt_start + 1 + end if + err = openmc_tally_set_filters(i_start + i - 1, n_filter, filter_indices) + deallocate(filter_indices) + + ! Allocate scoring bins + allocate(t % score_bins(1)) + t % n_score_bins = 1 + + ! Set macro_bins + t % score_bins(1) = SCORE_SCATTER end if ! Make CMFD tallies active from the start diff --git a/src/constants.F90 b/src/constants.F90 index b335b78c86..d1893bf9e1 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -21,7 +21,7 @@ module constants integer, parameter :: VERSION_STATEPOINT(2) = [17, 0] integer, parameter :: VERSION_PARTICLE_RESTART(2) = [2, 0] integer, parameter :: VERSION_TRACK(2) = [2, 0] - integer, parameter :: VERSION_SUMMARY(2) = [5, 0] + integer, parameter :: VERSION_SUMMARY(2) = [6, 0] integer, parameter :: VERSION_VOLUME(2) = [1, 0] integer, parameter :: VERSION_VOXEL(2) = [1, 0] integer, parameter :: VERSION_MGXS_LIBRARY(2) = [1, 0] @@ -232,6 +232,10 @@ module constants MGXS_ISOTROPIC = 1, & ! Isotropically Weighted Data MGXS_ANGLE = 2 ! Data by Angular Bins + ! Flag to denote this was a macroscopic data object + real(8), parameter :: & + MACROSCOPIC_AWR = -TWO + ! Fission neutron emission (nu) type integer, parameter :: & NU_NONE = 0, & ! No nu values (non-fissionable) @@ -310,50 +314,28 @@ module constants ! Tally score type -- if you change these, make sure you also update the ! _SCORES dictionary in openmc/capi/tally.py - integer, parameter :: N_SCORE_TYPES = 24 + integer, parameter :: N_SCORE_TYPES = 16 integer, parameter :: & SCORE_FLUX = -1, & ! flux SCORE_TOTAL = -2, & ! total reaction rate SCORE_SCATTER = -3, & ! scattering rate SCORE_NU_SCATTER = -4, & ! scattering production rate - SCORE_SCATTER_N = -5, & ! arbitrary scattering moment - SCORE_SCATTER_PN = -6, & ! system for scoring 0th through nth moment - SCORE_NU_SCATTER_N = -7, & ! arbitrary nu-scattering moment - SCORE_NU_SCATTER_PN = -8, & ! system for scoring 0th through nth nu-scatter moment - SCORE_ABSORPTION = -9, & ! absorption rate - SCORE_FISSION = -10, & ! fission rate - SCORE_NU_FISSION = -11, & ! neutron production rate - SCORE_KAPPA_FISSION = -12, & ! fission energy production rate - SCORE_CURRENT = -13, & ! current - SCORE_FLUX_YN = -14, & ! angular moment of flux - SCORE_TOTAL_YN = -15, & ! angular moment of total reaction rate - SCORE_SCATTER_YN = -16, & ! angular flux-weighted scattering moment (0:N) - SCORE_NU_SCATTER_YN = -17, & ! angular flux-weighted nu-scattering moment (0:N) - SCORE_EVENTS = -18, & ! number of events - SCORE_DELAYED_NU_FISSION = -19, & ! delayed neutron production rate - SCORE_PROMPT_NU_FISSION = -20, & ! prompt neutron production rate - SCORE_INVERSE_VELOCITY = -21, & ! flux-weighted inverse velocity - SCORE_FISS_Q_PROMPT = -22, & ! prompt fission Q-value - SCORE_FISS_Q_RECOV = -23, & ! recoverable fission Q-value - SCORE_DECAY_RATE = -24 ! delayed neutron precursor decay rate + SCORE_ABSORPTION = -5, & ! absorption rate + SCORE_FISSION = -6, & ! fission rate + SCORE_NU_FISSION = -7, & ! neutron production rate + SCORE_KAPPA_FISSION = -8, & ! fission energy production rate + SCORE_CURRENT = -9, & ! current + SCORE_EVENTS = -10, & ! number of events + SCORE_DELAYED_NU_FISSION = -11, & ! delayed neutron production rate + SCORE_PROMPT_NU_FISSION = -12, & ! prompt neutron production rate + SCORE_INVERSE_VELOCITY = -13, & ! flux-weighted inverse velocity + SCORE_FISS_Q_PROMPT = -14, & ! prompt fission Q-value + SCORE_FISS_Q_RECOV = -15, & ! recoverable fission Q-value + SCORE_DECAY_RATE = -16 ! delayed neutron precursor decay rate ! Maximum scattering order supported integer, parameter :: MAX_ANG_ORDER = 10 - ! Names of *-PN & *-YN scores (MOMENT_STRS) and *-N moment scores - character(*), parameter :: & - MOMENT_STRS(6) = (/ "scatter-p ", & - "nu-scatter-p", & - "flux-y ", & - "total-y ", & - "scatter-y ", & - "nu-scatter-y"/), & - MOMENT_N_STRS(2) = (/ "scatter- ", & - "nu-scatter- "/) - - ! Location in MOMENT_STRS where the YN data begins - integer, parameter :: YN_LOC = 3 - ! Tally map bin finding integer, parameter :: NO_BIN_FOUND = -1 diff --git a/src/endf.F90 b/src/endf.F90 index 0ba2db388b..9934d9a7cf 100644 --- a/src/endf.F90 +++ b/src/endf.F90 @@ -26,14 +26,6 @@ contains string = "scatter" case (SCORE_NU_SCATTER) string = "nu-scatter" - case (SCORE_SCATTER_N) - string = "scatter-n" - case (SCORE_SCATTER_PN) - string = "scatter-pn" - case (SCORE_NU_SCATTER_N) - string = "nu-scatter-n" - case (SCORE_NU_SCATTER_PN) - string = "nu-scatter-pn" case (SCORE_ABSORPTION) string = "absorption" case (SCORE_FISSION) @@ -50,14 +42,6 @@ contains string = "kappa-fission" case (SCORE_CURRENT) string = "current" - case (SCORE_FLUX_YN) - string = "flux-yn" - case (SCORE_TOTAL_YN) - string = "total-yn" - case (SCORE_SCATTER_YN) - string = "scatter-yn" - case (SCORE_NU_SCATTER_YN) - string = "nu-scatter-yn" case (SCORE_EVENTS) string = "events" case (SCORE_INVERSE_VELOCITY) diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 63e5cd7a49..f8cf50dd3c 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -2194,26 +2194,20 @@ contains integer :: i ! loop over user-specified tallies integer :: j ! loop over words integer :: k ! another loop index - integer :: l ! another loop index integer :: filter_id ! user-specified identifier for filter integer :: i_filt ! index in filters array integer :: i_elem ! index of entry in dictionary integer :: n ! size of arrays in mesh specification integer :: n_words ! number of words read integer :: n_filter ! number of filters - integer :: n_new ! number of new scores to add based on Yn/Pn tally - integer :: n_scores ! number of tot scores after adjusting for Yn/Pn tally - integer :: n_bins ! total new bins for this score + integer :: n_scores ! number of scores integer :: n_user_trig ! number of user-specified tally triggers integer :: trig_ind ! index of triggers array for each tally integer :: user_trig_ind ! index of user-specified triggers for each tally integer :: i_start, i_end integer(C_INT) :: err real(8) :: threshold ! trigger convergence threshold - integer :: n_order ! moment order requested - integer :: n_order_pos ! oosition of Scattering order in score name string integer :: MT ! user-specified MT for score - integer :: imomstr ! Index of MOMENT_STRS & MOMENT_N_STRS logical :: file_exists ! does tallies.xml file exist? integer, allocatable :: temp_filter(:) ! temporary filter indices character(MAX_LINE_LEN) :: filename @@ -2541,107 +2535,22 @@ contains allocate(sarray(n_words)) call get_node_array(node_tal, "scores", sarray) - ! Before we can allocate storage for scores, we must determine the - ! number of additional scores required due to the moment scores - ! (i.e., scatter-p#, flux-y#) - n_new = 0 + ! Append the score to the list of possible trigger scores do j = 1, n_words sarray(j) = to_lower(sarray(j)) - ! Find if scores(j) is of the form 'moment-p' or 'moment-y' present in - ! MOMENT_STRS(:) - ! If so, check the order, store if OK, then reset the number to 'n' score_name = trim(sarray(j)) - ! Append the score to the list of possible trigger scores if (trigger_on) call trigger_scores % set(trim(score_name), j) - do imomstr = 1, size(MOMENT_STRS) - if (starts_with(score_name,trim(MOMENT_STRS(imomstr)))) then - n_order_pos = scan(score_name,'0123456789') - n_order = int(str_to_int( & - score_name(n_order_pos:(len_trim(score_name)))),4) - if (n_order > MAX_ANG_ORDER) then - ! User requested too many orders; throw a warning and set to the - ! maximum order. - ! The above scheme will essentially take the absolute value - if (master) call warning("Invalid scattering order of " & - // trim(to_str(n_order)) // " requested. Setting to the & - &maximum permissible value, " & - // trim(to_str(MAX_ANG_ORDER))) - n_order = MAX_ANG_ORDER - sarray(j) = trim(MOMENT_STRS(imomstr)) & - // trim(to_str(MAX_ANG_ORDER)) - end if - ! Find total number of bins for this case - if (imomstr >= YN_LOC) then - n_bins = (n_order + 1)**2 - else - n_bins = n_order + 1 - end if - ! We subtract one since n_words already included - n_new = n_new + n_bins - 1 - exit - end if - end do end do - n_scores = n_words + n_new + n_scores = n_words ! Allocate score storage accordingly allocate(t % score_bins(n_scores)) - allocate(t % moment_order(n_scores)) - t % moment_order = 0 - j = 0 - do l = 1, n_words - j = j + 1 - ! Get the input string in scores(l) but if score is one of the moment - ! scores then strip off the n and store it as an integer to be used - ! later. Then perform the select case on this modified (number - ! removed) string - n_order = -1 - score_name = sarray(l) - do imomstr = 1, size(MOMENT_STRS) - if (starts_with(score_name,trim(MOMENT_STRS(imomstr)))) then - n_order_pos = scan(score_name,'0123456789') - n_order = int(str_to_int( & - score_name(n_order_pos:(len_trim(score_name)))),4) - if (n_order > MAX_ANG_ORDER) then - ! User requested too many orders; throw a warning and set to the - ! maximum order. - ! The above scheme will essentially take the absolute value - n_order = MAX_ANG_ORDER - end if - score_name = trim(MOMENT_STRS(imomstr)) // "n" - ! Find total number of bins for this case - if (imomstr >= YN_LOC) then - n_bins = (n_order + 1)**2 - else - n_bins = n_order + 1 - end if - exit - end if - end do - ! Now check the Moment_N_Strs, but only if we werent successful above - if (imomstr > size(MOMENT_STRS)) then - do imomstr = 1, size(MOMENT_N_STRS) - if (starts_with(score_name,trim(MOMENT_N_STRS(imomstr)))) then - n_order_pos = scan(score_name,'0123456789') - n_order = int(str_to_int( & - score_name(n_order_pos:(len_trim(score_name)))),4) - if (n_order > MAX_ANG_ORDER) then - ! User requested too many orders; throw a warning and set to the - ! maximum order. - ! The above scheme will essentially take the absolute value - if (master) call warning("Invalid scattering order of " & - // trim(to_str(n_order)) // " requested. Setting to & - &the maximum permissible value, " & - // trim(to_str(MAX_ANG_ORDER))) - n_order = MAX_ANG_ORDER - end if - score_name = trim(MOMENT_N_STRS(imomstr)) // "n" - exit - end if - end do - end if + + ! Check the validity of the scores and their filters + do j = 1, n_scores + score_name = sarray(j) ! Check if delayed group filter is used with any score besides ! delayed-nu-fission or decay-rate @@ -2652,23 +2561,6 @@ contains &delayedgroup filter.") end if - ! Check to see if the mu filter is applied and if that makes sense. - if ((.not. starts_with(score_name,'scatter')) .and. & - (.not. starts_with(score_name,'nu-scatter'))) then - if (t % find_filter(FILTER_MU) > 0) then - call fatal_error("Cannot tally " // trim(score_name) //" with a & - &change of angle (mu) filter.") - end if - ! Also check to see if this is a legendre expansion or not. - ! If so, we can accept this score and filter combo for p0, but not - ! elsewhere. - else if (n_order > 0) then - if (t % find_filter(FILTER_MU) > 0) then - call fatal_error("Cannot tally " // trim(score_name) //" with a & - &change of angle (mu) filter unless order is 0.") - end if - end if - select case (trim(score_name)) case ('flux') ! Prohibit user from tallying flux for an individual nuclide @@ -2683,22 +2575,6 @@ contains &filter.") end if - case ('flux-yn') - ! Prohibit user from tallying flux for an individual nuclide - if (.not. (t % n_nuclide_bins == 1 .and. & - t % nuclide_bins(1) == -1)) then - call fatal_error("Cannot tally flux for an individual nuclide.") - end if - - if (t % find_filter(FILTER_ENERGYOUT) > 0) then - call fatal_error("Cannot tally flux with an outgoing energy & - &filter.") - end if - - t % score_bins(j : j + n_bins - 1) = SCORE_FLUX_YN - t % moment_order(j : j + n_bins - 1) = n_order - j = j + n_bins - 1 - case ('total', '(n,total)') t % score_bins(j) = SCORE_TOTAL if (t % find_filter(FILTER_ENERGYOUT) > 0) then @@ -2706,18 +2582,13 @@ contains &outgoing energy filter.") end if - case ('total-yn') - if (t % find_filter(FILTER_ENERGYOUT) > 0) then - call fatal_error("Cannot tally total reaction rate with an & - &outgoing energy filter.") - end if - - t % score_bins(j : j + n_bins - 1) = SCORE_TOTAL_YN - t % moment_order(j : j + n_bins - 1) = n_order - j = j + n_bins - 1 - case ('scatter') t % score_bins(j) = SCORE_SCATTER + if (t % find_filter(FILTER_ENERGYOUT) > 0 .or. & + t % find_filter(FILTER_LEGENDRE) > 0) then + ! Set tally estimator to analog + t % estimator = ESTIMATOR_ANALOG + end if case ('nu-scatter') t % score_bins(j) = SCORE_NU_SCATTER @@ -2727,53 +2598,14 @@ contains ! necessary) if (run_CE) then t % estimator = ESTIMATOR_ANALOG + else + if (t % find_filter(FILTER_ENERGYOUT) > 0 .or. & + t % find_filter(FILTER_LEGENDRE) > 0) then + ! Set tally estimator to analog + t % estimator = ESTIMATOR_ANALOG + end if end if - case ('scatter-n') - t % score_bins(j) = SCORE_SCATTER_N - t % moment_order(j) = n_order - t % estimator = ESTIMATOR_ANALOG - - case ('nu-scatter-n') - t % score_bins(j) = SCORE_NU_SCATTER_N - t % moment_order(j) = n_order - t % estimator = ESTIMATOR_ANALOG - - case ('scatter-pn') - t % estimator = ESTIMATOR_ANALOG - ! Setup P0:Pn - t % score_bins(j : j + n_bins - 1) = SCORE_SCATTER_PN - t % moment_order(j : j + n_bins - 1) = n_order - j = j + n_bins - 1 - - case ('nu-scatter-pn') - t % estimator = ESTIMATOR_ANALOG - ! Setup P0:Pn - t % score_bins(j : j + n_bins - 1) = SCORE_NU_SCATTER_PN - t % moment_order(j : j + n_bins - 1) = n_order - j = j + n_bins - 1 - - case ('scatter-yn') - t % estimator = ESTIMATOR_ANALOG - ! Setup P0:Pn - t % score_bins(j : j + n_bins - 1) = SCORE_SCATTER_YN - t % moment_order(j : j + n_bins - 1) = n_order - j = j + n_bins - 1 - - case ('nu-scatter-yn') - t % estimator = ESTIMATOR_ANALOG - ! Setup P0:Pn - t % score_bins(j : j + n_bins - 1) = SCORE_NU_SCATTER_YN - t % moment_order(j : j + n_bins - 1) = n_order - j = j + n_bins - 1 - - case('transport') - call fatal_error("Transport score no longer supported for tallies, & - &please remove") - - case ('n1n') - call fatal_error("n1n score no longer supported for tallies, & - &please remove") case ('n2n', '(n,2n)') t % score_bins(j) = N_2N t % depletion_rx = .true. @@ -2937,6 +2769,14 @@ contains t % score_bins(j) = N_DA case default + ! First look for deprecated scores + if (starts_with(trim(score_name), 'scatter-') .or. & + starts_with(trim(score_name), 'nu-scatter-') .or. & + starts_with(trim(score_name), 'total-y') .or. & + starts_with(trim(score_name), 'flux-y')) then + call fatal_error(trim(score_name) // " is no longer available.") + end if + ! Assume that user has specified an MT number MT = int(str_to_int(score_name)) @@ -2945,14 +2785,12 @@ contains if (MT > 1) then t % score_bins(j) = MT else - call fatal_error("Invalid MT on : " & - // trim(sarray(l))) + call fatal_error("Invalid MT on : " // trim(score_name)) end if else ! Specified score was not an integer - call fatal_error("Unknown scoring function: " & - // trim(sarray(l))) + call fatal_error("Unknown scoring function: " // trim(score_name)) end if end select @@ -2967,35 +2805,19 @@ contains end do t % n_score_bins = n_scores - t % n_user_score_bins = n_words ! Deallocate temporary string array of scores deallocate(sarray) ! Check that no duplicate scores exist - j = 1 - do while (j < n_scores) - ! Determine number of bins for scores with expansions - n_order = t % moment_order(j) - select case (t % score_bins(j)) - case (SCORE_SCATTER_PN, SCORE_NU_SCATTER_PN) - n_bins = n_order + 1 - case (SCORE_FLUX_YN, SCORE_TOTAL_YN, SCORE_SCATTER_YN, & - SCORE_NU_SCATTER_YN) - n_bins = (n_order + 1)**2 - case default - n_bins = 1 - end select - - do k = j + n_bins, n_scores - if (t % score_bins(j) == t % score_bins(k) .and. & - t % moment_order(j) == t % moment_order(k)) then + do j = 1, n_scores - 1 + do k = j + 1, n_scores + if (t % score_bins(j) == t % score_bins(k)) then call fatal_error("Duplicate score of type '" // trim(& reaction_name(t % score_bins(j))) // "' found in tally " & // trim(to_str(t % id))) end if end do - j = j + n_bins end do else call fatal_error("No specified on tally " & diff --git a/src/math.F90 b/src/math.F90 index ee8cd0530b..20bacf88cf 100644 --- a/src/math.F90 +++ b/src/math.F90 @@ -598,7 +598,6 @@ contains real(8) :: zn_mat(n+1, n+1) ! Matrix form of the coefficients which is ! easier to work with real(8) :: k1, k2, k3, k4 ! Variables for R_m_n calculation - real(8) :: sqrt_norm ! normalization for radial moments integer :: i,p,q ! Loop counters real(8), parameter :: SQRT_N_1(0:10) = [& diff --git a/src/mgxs_header.F90 b/src/mgxs_header.F90 index 6eabefae3c..fd6074c428 100644 --- a/src/mgxs_header.F90 +++ b/src/mgxs_header.F90 @@ -6,7 +6,7 @@ module mgxs_header use hdf5, only: HID_T, HSIZE_T, SIZE_T use algorithm, only: find, sort - use constants, only: MAX_WORD_LEN, ZERO, ONE, TWO, PI + use constants, only: MAX_WORD_LEN, ZERO, ONE, TWO, PI, MACROSCOPIC_AWR use error, only: fatal_error use hdf5_interface use material_header, only: material @@ -268,7 +268,7 @@ contains if (attribute_exists(xs_id, "atomic_weight_ratio")) then call read_attribute(this % awr, xs_id, "atomic_weight_ratio") else - this % awr = -ONE + this % awr = MACROSCOPIC_AWR end if ! Determine temperatures available @@ -396,9 +396,9 @@ contains ! Store the dimensionality of the data in order_dim. ! For Legendre data, we usually refer to it as Pn where n is the order. - ! However Pn has n+1 sets of points (since you need to - ! the count the P0 moment). Adjust for that. Histogram and Tabular - ! formats dont need this adjustment. + ! However Pn has n+1 sets of points (since you need to count the P0 + ! moment). Adjust for that. Histogram and Tabular formats dont need this + ! adjustment. if (this % scatter_format == ANGLE_LEGENDRE) then order_dim = order_dim + 1 else diff --git a/src/output.F90 b/src/output.F90 index b6809ca82f..f9e770f514 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -665,14 +665,11 @@ contains integer :: j ! level in tally hierarchy integer :: k ! loop index for scoring bins integer :: n ! loop index for nuclides - integer :: l ! loop index for user scores integer :: h ! loop index for tally filters integer :: indent ! number of spaces to preceed output integer :: filter_index ! index in results array for filters integer :: score_index ! scoring bin index integer :: i_nuclide ! index in nuclides array - integer :: n_order ! loop index for moment orders - integer :: nm_order ! loop index for Ynm moment orders integer :: unit_tally ! tallies.out file unit integer :: nr ! number of realizations real(8) :: t_value ! t-values for confidence intervals @@ -699,14 +696,6 @@ contains score_names(abs(SCORE_NU_FISSION)) = "Nu-Fission Rate" score_names(abs(SCORE_KAPPA_FISSION)) = "Kappa-Fission Rate" score_names(abs(SCORE_EVENTS)) = "Events" - score_names(abs(SCORE_FLUX_YN)) = "Flux Moment" - score_names(abs(SCORE_TOTAL_YN)) = "Total Reaction Rate Moment" - score_names(abs(SCORE_SCATTER_N)) = "Scattering Rate Moment" - score_names(abs(SCORE_SCATTER_PN)) = "Scattering Rate Moment" - score_names(abs(SCORE_SCATTER_YN)) = "Scattering Rate Moment" - score_names(abs(SCORE_NU_SCATTER_N)) = "Scattering Prod. Rate Moment" - score_names(abs(SCORE_NU_SCATTER_PN)) = "Scattering Prod. Rate Moment" - score_names(abs(SCORE_NU_SCATTER_YN)) = "Scattering Prod. Rate Moment" score_names(abs(SCORE_DECAY_RATE)) = "Decay Rate" score_names(abs(SCORE_DELAYED_NU_FISSION)) = "Delayed-Nu-Fission Rate" score_names(abs(SCORE_PROMPT_NU_FISSION)) = "Prompt-Nu-Fission Rate" @@ -860,60 +849,20 @@ contains end if indent = indent + 2 - k = 0 - do l = 1, t % n_user_score_bins - k = k + 1 + do k = 1, t % n_score_bins score_index = score_index + 1 associate(r => t % results(RESULT_SUM:RESULT_SUM_SQ, :, :)) - select case(t % score_bins(k)) - case (SCORE_SCATTER_N, SCORE_NU_SCATTER_N) - score_name = 'P' // trim(to_str(t % moment_order(k))) // " " // & - score_names(abs(t % score_bins(k))) - x(:) = mean_stdev(r(:, score_index, filter_index), nr) - write(UNIT=unit_tally, FMT='(1X,2A,1X,A,"+/- ",A)') & - repeat(" ", indent), score_name, to_str(x(1)), & - trim(to_str(t_value * x(2))) - case (SCORE_SCATTER_PN, SCORE_NU_SCATTER_PN) - score_index = score_index - 1 - do n_order = 0, t % moment_order(k) - score_index = score_index + 1 - score_name = 'P' // trim(to_str(n_order)) // " " //& - score_names(abs(t % score_bins(k))) - x(:) = mean_stdev(r(:, score_index, filter_index), nr) - write(UNIT=unit_tally, FMT='(1X,2A,1X,A,"+/- ",A)') & - repeat(" ", indent), score_name, & - to_str(x(1)), trim(to_str(t_value * x(2))) - end do - k = k + t % moment_order(k) - case (SCORE_SCATTER_YN, SCORE_NU_SCATTER_YN, SCORE_FLUX_YN, & - SCORE_TOTAL_YN) - score_index = score_index - 1 - do n_order = 0, t % moment_order(k) - do nm_order = -n_order, n_order - score_index = score_index + 1 - score_name = 'Y' // trim(to_str(n_order)) // ',' // & - trim(to_str(nm_order)) // " " & - // score_names(abs(t % score_bins(k))) - x(:) = mean_stdev(r(:, score_index, filter_index), nr) - write(UNIT=unit_tally, FMT='(1X,2A,1X,A,"+/- ",A)') & - repeat(" ", indent), score_name, & - to_str(x(1)), trim(to_str(t_value * x(2))) - end do - end do - k = k + (t % moment_order(k) + 1)**2 - 1 - case default - if (t % score_bins(k) > 0) then - score_name = reaction_name(t % score_bins(k)) - else - score_name = score_names(abs(t % score_bins(k))) - end if - x(:) = mean_stdev(r(:, score_index, filter_index), nr) - write(UNIT=unit_tally, FMT='(1X,2A,1X,A,"+/- ",A)') & - repeat(" ", indent), score_name, & - to_str(x(1)), trim(to_str(t_value * x(2))) - end select + if (t % score_bins(k) > 0) then + score_name = reaction_name(t % score_bins(k)) + else + score_name = score_names(abs(t % score_bins(k))) + end if + x(:) = mean_stdev(r(:, score_index, filter_index), nr) + write(UNIT=unit_tally, FMT='(1X,2A,1X,A,"+/- ",A)') & + repeat(" ", indent), score_name, & + to_str(x(1)), trim(to_str(t_value * x(2))) end associate end do indent = indent - 2 diff --git a/src/state_point.F90 b/src/state_point.F90 index 980a7333cd..a7ae24ddab 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -48,8 +48,6 @@ contains integer :: i, j, k integer :: i_xs - integer :: n_order ! loop index for moment orders - integer :: nm_order ! loop index for Ynm moment orders integer, allocatable :: id_array(:) integer(HID_T) :: file_id integer(HID_T) :: cmfd_group, tallies_group, tally_group, meshes_group, & @@ -320,42 +318,9 @@ contains str_array(j) = reaction_name(tally % score_bins(j)) end do call write_dataset(tally_group, "score_bins", str_array) - call write_dataset(tally_group, "n_user_score_bins", & - tally % n_user_score_bins) deallocate(str_array) - ! Write explicit moment order strings for each score bin - k = 1 - allocate(str_array(tally % n_score_bins)) - MOMENT_LOOP: do j = 1, tally % n_user_score_bins - select case(tally % score_bins(k)) - case (SCORE_SCATTER_N, SCORE_NU_SCATTER_N) - str_array(k) = trim(to_str(tally % moment_order(k))) - k = k + 1 - case (SCORE_SCATTER_PN, SCORE_NU_SCATTER_PN) - do n_order = 0, tally % moment_order(k) - str_array(k) = trim(to_str(n_order)) - k = k + 1 - end do - case (SCORE_SCATTER_YN, SCORE_NU_SCATTER_YN, SCORE_FLUX_YN, & - SCORE_TOTAL_YN) - do n_order = 0, tally % moment_order(k) - do nm_order = -n_order, n_order - str_array(k) = 'Y' // trim(to_str(n_order)) // ',' // & - trim(to_str(nm_order)) - k = k + 1 - end do - end do - case default - str_array(k) = '' - k = k + 1 - end select - end do MOMENT_LOOP - - call write_dataset(tally_group, "moment_orders", str_array) - deallocate(str_array) - call close_group(tally_group) end associate end do TALLY_METADATA diff --git a/src/summary.F90 b/src/summary.F90 index 3aeb42178b..409c4de1f5 100644 --- a/src/summary.F90 +++ b/src/summary.F90 @@ -77,34 +77,81 @@ contains subroutine write_nuclides(file_id) integer(HID_T), intent(in) :: file_id integer(HID_T) :: nuclide_group + integer(HID_T) :: macro_group integer :: i - character(12), allocatable :: nucnames(:) + character(12), allocatable :: nuc_names(:) + character(12), allocatable :: macro_names(:) real(8), allocatable :: awrs(:) + integer :: num_nuclides + integer :: num_macros + integer :: j + integer :: k - ! Write useful data from nuclide objects - nuclide_group = create_group(file_id, "nuclides") - call write_attribute(nuclide_group, "n_nuclides", n_nuclides) + ! Find how many of these nuclides are macroscopic objects + if (run_CE) then + ! Then none are macroscopic + num_nuclides = n_nuclides + num_macros = 0 + else + num_nuclides = 0 + num_macros = 0 + do i = 1, n_nuclides + if (nuclides_MG(i) % obj % awr /= MACROSCOPIC_AWR) then + num_nuclides = num_nuclides + 1 + else + num_macros = num_macros + 1 + end if + end do + end if - ! Build array of nuclide names and awrs - allocate(nucnames(n_nuclides)) - allocate(awrs(n_nuclides)) + ! Build array of nuclide names and awrs while only sorting nuclides from + ! macroscopics + if (num_nuclides > 0) then + allocate(nuc_names(num_nuclides)) + allocate(awrs(num_nuclides)) + end if + if (num_macros > 0) then + allocate(macro_names(num_macros)) + end if + + j = 1 + k = 1 do i = 1, n_nuclides if (run_CE) then - nucnames(i) = nuclides(i) % name + nuc_names(i) = nuclides(i) % name awrs(i) = nuclides(i) % awr else - nucnames(i) = nuclides_MG(i) % obj % name - awrs(i) = nuclides_MG(i) % obj % awr + if (nuclides_MG(i) % obj % awr /= MACROSCOPIC_AWR) then + nuc_names(j) = nuclides_MG(i) % obj % name + awrs(j) = nuclides_MG(i) % obj % awr + j = j + 1 + else + macro_names(k) = nuclides_MG(i) % obj % name + k = k + 1 + end if end if end do + nuclide_group = create_group(file_id, "nuclides") + call write_attribute(nuclide_group, "n_nuclides", num_nuclides) + macro_group = create_group(file_id, "macroscopics") + call write_attribute(macro_group, "n_macroscopics", num_macros) ! Write nuclide names and awrs - call write_dataset(nuclide_group, "names", nucnames) - call write_dataset(nuclide_group, "awrs", awrs) - + if (num_nuclides > 0) then + ! Write useful data from nuclide objects + call write_dataset(nuclide_group, "names", nuc_names) + call write_dataset(nuclide_group, "awrs", awrs) + end if + if (num_macros > 0) then + ! Write useful data from macroscopic objects + call write_dataset(macro_group, "names", macro_names) + end if call close_group(nuclide_group) + call close_group(macro_group) - deallocate(nucnames, awrs) + + if (allocated(nuc_names)) deallocate(nuc_names, awrs) + if (allocated(macro_names)) deallocate(macro_names) end subroutine write_nuclides @@ -371,7 +418,13 @@ contains integer :: i integer :: j - character(20), allocatable :: nucnames(:) + integer :: k + integer :: n + character(20), allocatable :: nuc_names(:) + character(20), allocatable :: macro_names(:) + real(8), allocatable :: nuc_densities(:) + integer :: num_nuclides + integer :: num_macros integer(HID_T) :: materials_group integer(HID_T) :: material_group type(Material), pointer :: m @@ -399,24 +452,69 @@ contains ! Write atom density with units call write_dataset(material_group, "atom_density", m % density) - ! Copy ZAID for each nuclide to temporary array - allocate(nucnames(m%n_nuclides)) - do j = 1, m%n_nuclides - if (run_CE) then - nucnames(j) = nuclides(m%nuclide(j))%name - else - nucnames(j) = nuclides_MG(m%nuclide(j))%obj%name + if (run_CE) then + num_nuclides = m % n_nuclides + num_macros = 0 + else + ! Find the number of macroscopic and nuclide data in this material + num_nuclides = 0 + num_macros = 0 + k = 1 + n = 1 + do j = 1, m % n_nuclides + if (nuclides_MG(m % nuclide(j)) % obj % awr /= MACROSCOPIC_AWR) then + num_nuclides = num_nuclides + 1 + else + num_macros = num_macros + 1 + end if + end do + end if + + ! Copy ZAID or macro name for each nuclide to temporary array + if (num_nuclides > 0) then + allocate(nuc_names(num_nuclides)) + allocate(nuc_densities(num_nuclides)) + end if + if (run_CE) then + do j = 1, m % n_nuclides + nuc_names(j) = nuclides(m%nuclide(j))%name + nuc_densities(j) = m % atom_density(j) + end do + else + if (num_macros > 0) then + allocate(macro_names(num_macros)) end if - end do + + k = 1 + n = 1 + do j = 1, m % n_nuclides + if (nuclides_MG(m % nuclide(j)) % obj % awr /= MACROSCOPIC_AWR) then + nuc_names(k) = nuclides_MG(m % nuclide(j)) % obj % name + nuc_densities(k) = m % atom_density(j) + k = k + 1 + else + macro_names(n) = nuclides_MG(m % nuclide(j)) % obj % name + n = n + 1 + end if + end do + end if ! Write temporary array to 'nuclides' - call write_dataset(material_group, "nuclides", nucnames) + if (num_nuclides > 0) then + call write_dataset(material_group, "nuclides", nuc_names) + ! Deallocate temporary array + deallocate(nuc_names) + ! Write atom densities + call write_dataset(material_group, "nuclide_densities", nuc_densities) + deallocate(nuc_densities) + end if - ! Deallocate temporary array - deallocate(nucnames) - - ! Write atom densities - call write_dataset(material_group, "nuclide_densities", m%atom_density) + ! Write temporary array to 'macroscopics' + if (num_macros > 0) then + call write_dataset(material_group, "macroscopics", macro_names) + ! Deallocate temporary array + deallocate(macro_names) + end if if (m%n_sab > 0) then call write_dataset(material_group, "sab_names", m%sab_names) diff --git a/src/tallies/tally.F90 b/src/tallies/tally.F90 index f4d12be7e1..483246b362 100644 --- a/src/tallies/tally.F90 +++ b/src/tallies/tally.F90 @@ -84,7 +84,6 @@ contains integer :: i ! loop index for scoring bins integer :: l ! loop index for nuclides in material integer :: m ! loop index for reactions - integer :: q ! loop index for scoring bins integer :: i_temp ! temperature index integer :: i_nuc ! index in nuclides array (from material) integer :: i_energy ! index in nuclide energy grid @@ -104,9 +103,7 @@ contains ! Pre-collision energy of particle E = p % last_E - i = 0 - SCORE_LOOP: do q = 1, t % n_user_score_bins - i = i + 1 + SCORE_LOOP: do i = 1, t % n_score_bins ! determine what type of score bin score_bin = t % score_bins(i) @@ -120,7 +117,7 @@ contains select case(score_bin) - case (SCORE_FLUX, SCORE_FLUX_YN) + case (SCORE_FLUX) if (t % estimator == ESTIMATOR_ANALOG) then ! All events score to a flux bin. We actually use a collision ! estimator in place of an analog one since there is no way to count @@ -140,7 +137,7 @@ contains end if - case (SCORE_TOTAL, SCORE_TOTAL_YN) + case (SCORE_TOTAL) if (t % estimator == ESTIMATOR_ANALOG) then ! All events will score to the total reaction rate. We can just ! use the weight of the particle entering the collision as the @@ -187,7 +184,7 @@ contains end if - case (SCORE_SCATTER, SCORE_SCATTER_N) + case (SCORE_SCATTER) if (t % estimator == ESTIMATOR_ANALOG) then ! Skip any event where the particle didn't scatter if (p % event /= EVENT_SCATTER) cycle SCORE_LOOP @@ -197,7 +194,6 @@ contains score = p % last_wgt * flux else - ! Note SCORE_SCATTER_N not available for tracklength/collision. if (i_nuclide > 0) then score = (micro_xs(i_nuclide) % total & - micro_xs(i_nuclide) % absorption) * atom_density * flux @@ -207,33 +203,7 @@ contains end if - case (SCORE_SCATTER_PN) - ! Only analog estimators are available. - ! Skip any event where the particle didn't scatter - if (p % event /= EVENT_SCATTER) then - i = i + t % moment_order(i) - cycle SCORE_LOOP - end if - ! Since only scattering events make it here, again we can use - ! the weight entering the collision as the estimator for the - ! reaction rate - score = p % last_wgt * flux - - - case (SCORE_SCATTER_YN) - ! Only analog estimators are available. - ! Skip any event where the particle didn't scatter - if (p % event /= EVENT_SCATTER) then - i = i + (t % moment_order(i) + 1)**2 - 1 - cycle SCORE_LOOP - end if - ! Since only scattering events make it here, again we can use - ! the weight entering the collision as the estimator for the - ! reaction rate - score = p % last_wgt * flux - - - case (SCORE_NU_SCATTER, SCORE_NU_SCATTER_N) + case (SCORE_NU_SCATTER) ! Only analog estimators are available. ! Skip any event where the particle didn't scatter if (p % event /= EVENT_SCATTER) cycle SCORE_LOOP @@ -256,58 +226,6 @@ contains end if - case (SCORE_NU_SCATTER_PN) - ! Only analog estimators are available. - ! Skip any event where the particle didn't scatter - if (p % event /= EVENT_SCATTER) then - i = i + t % moment_order(i) - cycle SCORE_LOOP - end if - ! For scattering production, we need to use the pre-collision - ! weight times the yield as the estimate for the number of - ! neutrons exiting a reaction with neutrons in the exit channel - if (p % event_MT == ELASTIC .or. p % event_MT == N_LEVEL .or. & - (p % event_MT >= N_N1 .and. p % event_MT <= N_NC)) then - ! Don't waste time on very common reactions we know have - ! multiplicities of one. - score = p % last_wgt * flux - else - m = nuclides(p % event_nuclide) % reaction_index(p % event_MT) - - ! Get yield and apply to score - associate (rxn => nuclides(p % event_nuclide) % reactions(m)) - score = p % last_wgt * flux & - * rxn % products(1) % yield % evaluate(E) - end associate - end if - - - case (SCORE_NU_SCATTER_YN) - ! Only analog estimators are available. - ! Skip any event where the particle didn't scatter - if (p % event /= EVENT_SCATTER) then - i = i + (t % moment_order(i) + 1)**2 - 1 - cycle SCORE_LOOP - end if - ! For scattering production, we need to use the pre-collision - ! weight times the yield as the estimate for the number of - ! neutrons exiting a reaction with neutrons in the exit channel - if (p % event_MT == ELASTIC .or. p % event_MT == N_LEVEL .or. & - (p % event_MT >= N_N1 .and. p % event_MT <= N_NC)) then - ! Don't waste time on very common reactions we know have - ! multiplicities of one. - score = p % last_wgt * flux - else - m = nuclides(p % event_nuclide) % reaction_index(p % event_MT) - - ! Get yield and apply to score - associate (rxn => nuclides(p%event_nuclide)%reactions(m)) - score = p % last_wgt * flux & - * rxn % products(1) % yield % evaluate(E) - end associate - end if - - case (SCORE_ABSORPTION) if (t % estimator == ESTIMATOR_ANALOG) then if (survival_biasing) then @@ -1359,7 +1277,7 @@ contains end if i = 0 - SCORE_LOOP: do q = 1, t % n_user_score_bins + SCORE_LOOP: do q = 1, t % n_score_bins i = i + 1 ! determine what type of score bin @@ -1374,7 +1292,7 @@ contains select case(score_bin) - case (SCORE_FLUX, SCORE_FLUX_YN) + case (SCORE_FLUX) if (t % estimator == ESTIMATOR_ANALOG) then ! All events score to a flux bin. We actually use a collision ! estimator in place of an analog one since there is no way to count @@ -1395,7 +1313,7 @@ contains end if - case (SCORE_TOTAL, SCORE_TOTAL_YN) + case (SCORE_TOTAL) if (t % estimator == ESTIMATOR_ANALOG) then ! All events will score to the total reaction rate. We can just ! use the weight of the particle entering the collision as the @@ -1456,15 +1374,10 @@ contains end if - case (SCORE_SCATTER, SCORE_SCATTER_N, SCORE_SCATTER_PN, SCORE_SCATTER_YN) + case (SCORE_SCATTER) if (t % estimator == ESTIMATOR_ANALOG) then ! Skip any event where the particle didn't scatter if (p % event /= EVENT_SCATTER) then - if (score_bin == SCORE_SCATTER_PN) then - i = i + t % moment_order(i) - else if (score_bin == SCORE_SCATTER_YN) then - i = i + (t % moment_order(i) + 1)**2 - 1 - end if cycle SCORE_LOOP end if @@ -1485,7 +1398,6 @@ contains end if else - ! Note SCORE_SCATTER_*N not available for tracklength/collision. if (i_nuclide > 0) then score = atom_density * flux * & nucxs % get_xs('scatter/mult', p_g, UVW=p_uvw) @@ -1498,16 +1410,10 @@ contains end if - case (SCORE_NU_SCATTER, SCORE_NU_SCATTER_N, SCORE_NU_SCATTER_PN, & - SCORE_NU_SCATTER_YN) + case (SCORE_NU_SCATTER) if (t % estimator == ESTIMATOR_ANALOG) then ! Skip any event where the particle didn't scatter if (p % event /= EVENT_SCATTER) then - if (score_bin == SCORE_NU_SCATTER_PN) then - i = i + t % moment_order(i) - else if (score_bin == SCORE_NU_SCATTER_YN) then - i = i + (t % moment_order(i) + 1)**2 - 1 - end if cycle SCORE_LOOP end if @@ -1528,7 +1434,6 @@ contains end if else - ! Note SCORE_NU_SCATTER_*N not available for tracklength/collision. if (i_nuclide > 0) then score = nucxs % get_xs('scatter', p_g, UVW=p_uvw) * & atom_density * flux @@ -2101,98 +2006,10 @@ contains real(8), intent(inout) :: score ! data to score integer, intent(inout) :: i ! Working index - integer :: num_nm ! Number of N,M orders in harmonic - integer :: n ! Moment loop index - real(8) :: uvw(3) - - select case(score_bin) - case (SCORE_SCATTER_N, SCORE_NU_SCATTER_N) - ! Find the scattering order for a singly requested moment, and - ! store its moment contribution. - if (t % moment_order(i) == 1) then - score = score * p % mu ! avoid function call overhead - else - score = score * calc_pn(t % moment_order(i), p % mu) - endif !$omp atomic t % results(RESULT_VALUE, score_index, filter_index) = & t % results(RESULT_VALUE, score_index, filter_index) + score - - case(SCORE_SCATTER_YN, SCORE_NU_SCATTER_YN) - score_index = score_index - 1 - num_nm = 1 - ! Find the order for a collection of requested moments - ! and store the moment contribution of each - do n = 0, t % moment_order(i) - ! determine scoring bin index - score_index = score_index + num_nm - ! Update number of total n,m bins for this n (m = [-n: n]) - num_nm = 2 * n + 1 - - ! multiply score by the angular flux moments and store -!$omp critical (score_general_scatt_yn) - t % results(RESULT_VALUE, score_index: score_index + num_nm - 1, & - filter_index) = t % results(RESULT_VALUE, & - score_index: score_index + num_nm - 1, filter_index) & - + score * calc_pn(n, p % mu) * calc_rn(n, p % last_uvw) -!$omp end critical (score_general_scatt_yn) - end do - i = i + (t % moment_order(i) + 1)**2 - 1 - - - case(SCORE_FLUX_YN, SCORE_TOTAL_YN) - score_index = score_index - 1 - num_nm = 1 - if (t % estimator == ESTIMATOR_ANALOG .or. & - t % estimator == ESTIMATOR_COLLISION) then - uvw = p % last_uvw - else if (t % estimator == ESTIMATOR_TRACKLENGTH) then - uvw = p % coord(1) % uvw - end if - ! Find the order for a collection of requested moments - ! and store the moment contribution of each - do n = 0, t % moment_order(i) - ! determine scoring bin index - score_index = score_index + num_nm - ! Update number of total n,m bins for this n (m = [-n: n]) - num_nm = 2 * n + 1 - - ! multiply score by the angular flux moments and store -!$omp critical (score_general_flux_tot_yn) - t % results(RESULT_VALUE, score_index: score_index + num_nm - 1, & - filter_index) = t % results(RESULT_VALUE, & - score_index: score_index + num_nm - 1, filter_index) & - + score * calc_rn(n, uvw) -!$omp end critical (score_general_flux_tot_yn) - end do - i = i + (t % moment_order(i) + 1)**2 - 1 - - - case (SCORE_SCATTER_PN, SCORE_NU_SCATTER_PN) - score_index = score_index - 1 - ! Find the scattering order for a collection of requested moments - ! and store the moment contribution of each - do n = 0, t % moment_order(i) - ! determine scoring bin index - score_index = score_index + 1 - - ! get the score and tally it -!$omp atomic - t % results(RESULT_VALUE, score_index, filter_index) = & - t % results(RESULT_VALUE, score_index, filter_index) & - + score * calc_pn(n, p % mu) - end do - i = i + t % moment_order(i) - - - case default -!$omp atomic - t % results(RESULT_VALUE, score_index, filter_index) = & - t % results(RESULT_VALUE, score_index, filter_index) + score - - end select - end subroutine expand_and_score !=============================================================================== @@ -3134,7 +2951,7 @@ contains ! Currently only one score type k = 0 - SCORE_LOOP: do q = 1, t % n_user_score_bins + SCORE_LOOP: do q = 1, t % n_score_bins k = k + 1 ! determine what type of score bin diff --git a/src/tallies/tally_header.F90 b/src/tallies/tally_header.F90 index 413464b7b5..2d285706f8 100644 --- a/src/tallies/tally_header.F90 +++ b/src/tallies/tally_header.F90 @@ -74,13 +74,8 @@ module tally_header logical :: all_nuclides = .false. ! Values to score, e.g. flux, absorption, etc. - ! scat_order is the scattering order for each score. - ! It is to be 0 if the scattering order is 0, or if the score is not a - ! scattering response. integer :: n_score_bins = 0 integer, allocatable :: score_bins(:) - integer, allocatable :: moment_order(:) - integer :: n_user_score_bins = 0 ! Results for each bin -- the first dimension of the array is for scores ! (e.g. flux, total reaction rate, fission reaction rate, etc.) and the @@ -795,7 +790,6 @@ contains associate (t => tallies(index) % obj) if (allocated(t % score_bins)) deallocate(t % score_bins) allocate(t % score_bins(n)) - t % n_user_score_bins = n t % n_score_bins = n do i = 1, n diff --git a/src/tallies/trigger.F90 b/src/tallies/trigger.F90 index 7dcb3d71eb..2cb3bf8194 100644 --- a/src/tallies/trigger.F90 +++ b/src/tallies/trigger.F90 @@ -104,8 +104,6 @@ contains integer :: s ! loop index for triggers integer :: filter_index ! index in results array for filters integer :: score_index ! scoring bin index - integer :: n_order ! loop index for moment orders - integer :: nm_order ! loop index for Ynm moment orders integer(C_INT) :: err real(8) :: uncertainty ! trigger uncertainty real(8) :: std_dev = ZERO ! trigger standard deviation @@ -187,70 +185,18 @@ contains ! Initialize score bin index NUCLIDE_LOOP: do n = 1, t % n_nuclide_bins - select case(t % score_bins(trigger % score_index)) + call get_trigger_uncertainty(std_dev, rel_err, & + score_index, filter_index, t) - case (SCORE_SCATTER_PN, SCORE_NU_SCATTER_PN) - - score_index = score_index - 1 - - do n_order = 0, t % moment_order(trigger % score_index) - score_index = score_index + 1 - - call get_trigger_uncertainty(std_dev, rel_err, & - score_index, filter_index, t) - - if (trigger % variance < variance) then - trigger % variance = std_dev ** 2 - end if - if (trigger % std_dev < std_dev) then - trigger % std_dev = std_dev - end if - if (trigger % rel_err < rel_err) then - trigger % rel_err = rel_err - end if - - end do - - case (SCORE_SCATTER_YN, SCORE_NU_SCATTER_YN, SCORE_FLUX_YN, & - SCORE_TOTAL_YN) - - score_index = score_index - 1 - - do n_order = 0, t % moment_order(trigger % score_index) - do nm_order = -n_order, n_order - score_index = score_index + 1 - - call get_trigger_uncertainty(std_dev, rel_err, & - score_index, filter_index, t) - - if (trigger % variance < variance) then - trigger % variance = std_dev ** 2 - end if - if (trigger % std_dev < std_dev) then - trigger % std_dev = std_dev - end if - if (trigger % rel_err < rel_err) then - trigger % rel_err = rel_err - end if - - end do - end do - - case default - call get_trigger_uncertainty(std_dev, rel_err, & - score_index, filter_index, t) - - if (trigger % variance < variance) then - trigger % variance = std_dev ** 2 - end if - if (trigger % std_dev < std_dev) then - trigger % std_dev = std_dev - end if - if (trigger % rel_err < rel_err) then - trigger % rel_err = rel_err - end if - - end select + if (trigger % variance < variance) then + trigger % variance = std_dev ** 2 + end if + if (trigger % std_dev < std_dev) then + trigger % std_dev = std_dev + end if + if (trigger % rel_err < rel_err) then + trigger % rel_err = rel_err + end if select case (t % triggers(s) % type) case(VARIANCE) diff --git a/tests/regression_tests/cmfd_feed/results_true.dat b/tests/regression_tests/cmfd_feed/results_true.dat index 5e6750fe6b..aba219ba83 100644 --- a/tests/regression_tests/cmfd_feed/results_true.dat +++ b/tests/regression_tests/cmfd_feed/results_true.dat @@ -26,62 +26,42 @@ tally 2: 2.667071E+01 1.600292E+01 1.293670E+01 -2.252427E+00 -2.605738E-01 4.268506E+01 9.161216E+01 3.022909E+01 4.598915E+01 -3.873926E+00 -7.615035E-01 5.680399E+01 1.623879E+02 4.033805E+01 8.196263E+01 -5.280610E+00 -1.414008E+00 6.814742E+01 2.331778E+02 4.851618E+01 1.182330E+02 -6.261805E+00 -1.983205E+00 7.392923E+01 2.740255E+02 5.253586E+01 1.384152E+02 -6.733810E+00 -2.278242E+00 7.332860E+01 2.698608E+02 5.227405E+01 1.371810E+02 -6.714658E+00 -2.273652E+00 6.830172E+01 2.340687E+02 4.867159E+01 1.188724E+02 -6.215002E+00 -1.956978E+00 5.885634E+01 1.736180E+02 4.170434E+01 8.719622E+01 -5.253064E+00 -1.396224E+00 4.371848E+01 9.592893E+01 3.106403E+01 4.844308E+01 -3.818076E+00 -7.509442E-01 2.338413E+01 2.752467E+01 1.636713E+01 1.347770E+01 -2.219928E+00 -2.515492E-01 tally 3: 1.538752E+01 1.196478E+01 @@ -364,6 +344,47 @@ tally 4: 0.000000E+00 0.000000E+00 0.000000E+00 +tally 5: +1.538652E+01 +1.196332E+01 +2.252427E+00 +2.605738E-01 +2.911344E+01 +4.267319E+01 +3.873926E+00 +7.615035E-01 +3.884516E+01 +7.604619E+01 +5.280610E+00 +1.414008E+00 +4.672391E+01 +1.096625E+02 +6.261805E+00 +1.983205E+00 +5.058447E+01 +1.283588E+02 +6.733810E+00 +2.278242E+00 +5.033589E+01 +1.271898E+02 +6.714658E+00 +2.273652E+00 +4.687563E+01 +1.102719E+02 +6.215002E+00 +1.956978E+00 +4.013134E+01 +8.075062E+01 +5.253064E+00 +1.396224E+00 +2.996497E+01 +4.508840E+01 +3.818076E+00 +7.509442E-01 +1.574994E+01 +1.248291E+01 +2.219928E+00 +2.515492E-01 cmfd indices 1.000000E+01 1.000000E+00 diff --git a/tests/regression_tests/cmfd_nofeed/results_true.dat b/tests/regression_tests/cmfd_nofeed/results_true.dat index f00966cf8f..1636af364e 100644 --- a/tests/regression_tests/cmfd_nofeed/results_true.dat +++ b/tests/regression_tests/cmfd_nofeed/results_true.dat @@ -26,62 +26,42 @@ tally 2: 2.726751E+01 1.624000E+01 1.334217E+01 -2.239367E+00 -2.607315E-01 4.184801E+01 8.813954E+01 2.955600E+01 4.401685E+01 -3.937924E+00 -7.877545E-01 5.620224E+01 1.589242E+02 3.981400E+01 7.983679E+01 -5.183337E+00 -1.367303E+00 6.834724E+01 2.342245E+02 4.869600E+01 1.189597E+02 -6.288549E+00 -1.997858E+00 7.481522E+01 2.802998E+02 5.346500E+01 1.431835E+02 -6.691123E+00 -2.252645E+00 7.381412E+01 2.733775E+02 5.269700E+01 1.393729E+02 -6.846095E+00 -2.360683E+00 6.907776E+01 2.396752E+02 4.918500E+01 1.215909E+02 -6.400076E+00 -2.073871E+00 5.783261E+01 1.680814E+02 4.107800E+01 8.480751E+01 -5.269220E+00 -1.404986E+00 4.120212E+01 8.516647E+01 2.930300E+01 4.310295E+01 -3.730803E+00 -7.015777E-01 2.228419E+01 2.504034E+01 1.554100E+01 1.217931E+01 -2.126451E+00 -2.315275E-01 tally 3: 1.561100E+01 1.233967E+01 @@ -364,6 +344,47 @@ tally 4: 0.000000E+00 0.000000E+00 0.000000E+00 +tally 5: +1.560800E+01 +1.233482E+01 +2.239367E+00 +2.607315E-01 +2.847600E+01 +4.087518E+01 +3.937924E+00 +7.877545E-01 +3.833600E+01 +7.405661E+01 +5.183337E+00 +1.367303E+00 +4.686600E+01 +1.101919E+02 +6.288549E+00 +1.997858E+00 +5.154500E+01 +1.331141E+02 +6.691123E+00 +2.252645E+00 +5.067000E+01 +1.288871E+02 +6.846095E+00 +2.360683E+00 +4.737700E+01 +1.128379E+02 +6.400076E+00 +2.073871E+00 +3.952800E+01 +7.854943E+01 +5.269220E+00 +1.404986E+00 +2.818600E+01 +3.989536E+01 +3.730803E+00 +7.015777E-01 +1.497300E+01 +1.131008E+01 +2.126451E+00 +2.315275E-01 cmfd indices 1.000000E+01 1.000000E+00 diff --git a/tests/regression_tests/mgxs_library_ce_to_mg/inputs_true.dat b/tests/regression_tests/mgxs_library_ce_to_mg/inputs_true.dat index 70996fe378..bc5c4b2d46 100644 --- a/tests/regression_tests/mgxs_library_ce_to_mg/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_ce_to_mg/inputs_true.dat @@ -59,10 +59,13 @@ 0.0 0.625 20000000.0 - + + 3 + + 2 - + 3 @@ -108,9 +111,9 @@ analog - 1 2 7 + 1 2 7 11 total - nu-scatter-P3 + nu-scatter analog @@ -126,121 +129,121 @@ analog - 14 2 + 15 2 total flux tracklength - 14 2 + 15 2 total total tracklength - 14 2 + 15 2 total flux tracklength - 14 2 + 15 2 total absorption tracklength - 14 2 + 15 2 total flux analog - 14 2 7 + 15 2 7 total nu-fission analog - 14 2 + 15 2 total flux analog - 14 2 7 + 15 2 7 11 total - nu-scatter-P3 + nu-scatter analog - 14 2 7 + 15 2 7 total nu-scatter analog - 14 2 7 + 15 2 7 total scatter analog - 27 2 + 29 2 total flux tracklength - 27 2 + 29 2 total total tracklength - 27 2 + 29 2 total flux tracklength - 27 2 + 29 2 total absorption tracklength - 27 2 + 29 2 total flux analog - 27 2 7 + 29 2 7 total nu-fission analog - 27 2 + 29 2 total flux analog - 27 2 7 + 29 2 7 11 total - nu-scatter-P3 + nu-scatter analog - 27 2 7 + 29 2 7 total nu-scatter analog - 27 2 7 + 29 2 7 total scatter analog diff --git a/tests/regression_tests/mgxs_library_condense/inputs_true.dat b/tests/regression_tests/mgxs_library_condense/inputs_true.dat index ef6c4c5206..5aedd383d0 100644 --- a/tests/regression_tests/mgxs_library_condense/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_condense/inputs_true.dat @@ -59,16 +59,22 @@ 0.0 0.625 20000000.0 - + + 1 + + + 3 + + 0.0 20000000.0 - + 1 2 3 4 5 6 - + 2 - + 3 @@ -102,9 +108,9 @@ analog - 1 5 + 1 5 6 total - scatter-1 + scatter analog @@ -126,9 +132,9 @@ analog - 1 5 + 1 5 6 total - nu-scatter-1 + nu-scatter analog @@ -228,9 +234,9 @@ analog - 1 2 5 + 1 2 5 28 total - scatter-P3 + scatter analog @@ -240,9 +246,9 @@ analog - 1 2 5 + 1 2 5 28 total - nu-scatter-P3 + nu-scatter analog @@ -288,9 +294,9 @@ tracklength - 1 2 5 + 1 2 5 28 total - scatter-P3 + scatter analog @@ -306,883 +312,865 @@ tracklength - 1 2 5 + 1 2 5 28 total - scatter-P3 + scatter analog 1 2 5 total - nu-scatter-0 + nu-scatter analog - 1 2 5 + 1 52 total - scatter-0 + nu-fission analog - 1 46 + 1 5 total nu-fission analog - 1 5 + 1 52 total - nu-fission + prompt-nu-fission analog - 1 46 + 1 5 total prompt-nu-fission analog - 1 5 + 1 2 total - prompt-nu-fission - analog + flux + tracklength 1 2 total - flux + inverse-velocity tracklength 1 2 total - inverse-velocity + flux tracklength 1 2 total - flux + prompt-nu-fission tracklength - 1 2 - total - prompt-nu-fission - tracklength - - 1 2 total flux analog - + 1 2 5 total prompt-nu-fission analog - + 1 2 total flux tracklength - - 1 59 2 + + 1 65 2 total delayed-nu-fission tracklength + + 1 65 52 + total + delayed-nu-fission + analog + - 1 59 46 + 1 65 5 total delayed-nu-fission analog - 1 59 5 - total - delayed-nu-fission - analog - - 1 2 total nu-fission tracklength + + 1 65 2 + total + delayed-nu-fission + tracklength + - 1 59 2 + 1 65 2 total delayed-nu-fission tracklength - 1 59 2 - total - delayed-nu-fission - tracklength - - - 1 59 2 + 1 65 2 total decay-rate tracklength - + 1 2 total flux analog - - 1 59 2 5 + + 1 65 2 5 total delayed-nu-fission analog - - 74 2 + + 80 2 total flux tracklength + + 80 2 + total + total + tracklength + - 74 2 + 80 2 total - total + flux tracklength - 74 2 + 80 2 total - flux + total tracklength - 74 2 - total - total - tracklength - - - 74 2 + 80 2 total flux analog + + 80 5 6 + total + scatter + analog + - 74 5 - total - scatter-1 - analog - - - 74 2 + 80 2 total flux tracklength - - 74 2 + + 80 2 total total tracklength - - 74 2 + + 80 2 total flux analog + + 80 5 6 + total + nu-scatter + analog + - 74 5 - total - nu-scatter-1 - analog - - - 74 2 + 80 2 total flux tracklength + + 80 2 + total + absorption + tracklength + - 74 2 + 80 2 total - absorption + flux tracklength - 74 2 - total - flux - tracklength - - - 74 2 + 80 2 total absorption tracklength - - 74 2 + + 80 2 total fission tracklength + + 80 2 + total + flux + tracklength + - 74 2 - total - flux - tracklength - - - 74 2 + 80 2 total fission tracklength - - 74 2 + + 80 2 total flux tracklength - - 74 2 + + 80 2 total nu-fission tracklength - - 74 2 + + 80 2 total flux tracklength - - 74 2 + + 80 2 total kappa-fission tracklength - - 74 2 + + 80 2 total flux tracklength + + 80 2 + total + scatter + tracklength + - 74 2 - total - scatter - tracklength - - - 74 2 + 80 2 total flux analog + + 80 2 + total + nu-scatter + analog + - 74 2 + 80 2 total - nu-scatter + flux analog - 74 2 + 80 2 5 28 total - flux + scatter analog - 74 2 5 - total - scatter-P3 - analog - - - 74 2 + 80 2 total flux analog - - 74 2 5 - total - nu-scatter-P3 - analog - - - 74 2 5 + + 80 2 5 28 total nu-scatter analog - - 74 2 5 + + 80 2 5 + total + nu-scatter + analog + + + 80 2 5 total scatter analog + + 80 2 + total + flux + analog + - 74 2 + 80 2 5 total - flux + nu-fission analog - 74 2 5 + 80 2 5 total - nu-fission + scatter analog - 74 2 5 - total - scatter - analog - - - 74 2 + 80 2 total flux tracklength + + 80 2 + total + scatter + tracklength + - 74 2 + 80 2 5 28 total scatter - tracklength - - - 74 2 5 - total - scatter-P3 analog - - 74 2 + + 80 2 total flux tracklength - - 74 2 + + 80 2 total scatter tracklength - - 74 2 5 + + 80 2 5 28 total - scatter-P3 + scatter + analog + + + 80 2 5 + total + nu-scatter analog - 74 2 5 + 80 52 total - nu-scatter-0 + nu-fission analog - 74 2 5 + 80 5 total - scatter-0 + nu-fission analog - 74 46 + 80 52 total - nu-fission + prompt-nu-fission analog - 74 5 + 80 5 total - nu-fission + prompt-nu-fission analog - 74 46 + 80 2 total - prompt-nu-fission - analog + flux + tracklength - 74 5 + 80 2 total - prompt-nu-fission - analog + inverse-velocity + tracklength - 74 2 + 80 2 total flux tracklength - 74 2 + 80 2 total - inverse-velocity + prompt-nu-fission tracklength - 74 2 + 80 2 total flux - tracklength + analog - 74 2 + 80 2 5 total prompt-nu-fission - tracklength + analog - 74 2 + 80 2 total flux - analog + tracklength - 74 2 5 + 80 65 2 total - prompt-nu-fission - analog + delayed-nu-fission + tracklength - 74 2 + 80 65 52 total - flux - tracklength + delayed-nu-fission + analog - 74 59 2 + 80 65 5 total delayed-nu-fission - tracklength + analog - 74 59 46 - total - delayed-nu-fission - analog - - - 74 59 5 - total - delayed-nu-fission - analog - - - 74 2 + 80 2 total nu-fission tracklength + + 80 65 2 + total + delayed-nu-fission + tracklength + + + 80 65 2 + total + delayed-nu-fission + tracklength + - 74 59 2 - total - delayed-nu-fission - tracklength - - - 74 59 2 - total - delayed-nu-fission - tracklength - - - 74 59 2 + 80 65 2 total decay-rate tracklength - - 74 2 + + 80 2 total flux analog - - 74 59 2 5 + + 80 65 2 5 total delayed-nu-fission analog + + 159 2 + total + flux + tracklength + + + 159 2 + total + total + tracklength + - 147 2 + 159 2 total flux tracklength - 147 2 + 159 2 total total tracklength - 147 2 + 159 2 total flux - tracklength + analog - 147 2 + 159 5 6 total - total - tracklength + scatter + analog - 147 2 - total - flux - analog - - - 147 5 - total - scatter-1 - analog - - - 147 2 + 159 2 total flux tracklength - - 147 2 + + 159 2 total total tracklength - - 147 2 + + 159 2 total flux analog - - 147 5 + + 159 5 6 total - nu-scatter-1 + nu-scatter analog + + 159 2 + total + flux + tracklength + + + 159 2 + total + absorption + tracklength + - 147 2 + 159 2 total flux tracklength - 147 2 + 159 2 total absorption tracklength - 147 2 + 159 2 + total + fission + tracklength + + + 159 2 total flux tracklength - - 147 2 - total - absorption - tracklength - - 147 2 + 159 2 total fission tracklength - 147 2 + 159 2 total flux tracklength - 147 2 + 159 2 total - fission + nu-fission tracklength - 147 2 + 159 2 total flux tracklength - 147 2 + 159 2 total - nu-fission + kappa-fission tracklength - 147 2 + 159 2 total flux tracklength - 147 2 - total - kappa-fission - tracklength - - - 147 2 - total - flux - tracklength - - - 147 2 + 159 2 total scatter tracklength + + 159 2 + total + flux + analog + + + 159 2 + total + nu-scatter + analog + - 147 2 + 159 2 total flux analog - 147 2 + 159 2 5 28 total - nu-scatter + scatter analog - 147 2 + 159 2 total flux analog - 147 2 5 - total - scatter-P3 - analog - - - 147 2 - total - flux - analog - - - 147 2 5 - total - nu-scatter-P3 - analog - - - 147 2 5 + 159 2 5 28 total nu-scatter analog - - 147 2 5 + + 159 2 5 + total + nu-scatter + analog + + + 159 2 5 total scatter analog + + 159 2 + total + flux + analog + + + 159 2 5 + total + nu-fission + analog + - 147 2 + 159 2 5 total - flux + scatter analog - 147 2 5 - total - nu-fission - analog - - - 147 2 5 - total - scatter - analog - - - 147 2 + 159 2 total flux tracklength - - 147 2 + + 159 2 total scatter tracklength + + 159 2 5 28 + total + scatter + analog + + + 159 2 + total + flux + tracklength + - 147 2 5 - total - scatter-P3 - analog - - - 147 2 - total - flux - tracklength - - - 147 2 + 159 2 total scatter tracklength - - 147 2 5 + + 159 2 5 28 total - scatter-P3 + scatter + analog + + + 159 2 5 + total + nu-scatter + analog + + + 159 52 + total + nu-fission analog - 147 2 5 + 159 5 total - nu-scatter-0 + nu-fission analog - 147 2 5 + 159 52 total - scatter-0 + prompt-nu-fission analog - 147 46 + 159 5 total - nu-fission + prompt-nu-fission analog - 147 5 - total - nu-fission - analog - - - 147 46 - total - prompt-nu-fission - analog - - - 147 5 - total - prompt-nu-fission - analog - - - 147 2 + 159 2 total flux tracklength - - 147 2 + + 159 2 total inverse-velocity tracklength - - 147 2 + + 159 2 total flux tracklength - - 147 2 + + 159 2 total prompt-nu-fission tracklength + + 159 2 + total + flux + analog + + + 159 2 5 + total + prompt-nu-fission + analog + + + 159 2 + total + flux + tracklength + - 147 2 + 159 65 2 total - flux - analog + delayed-nu-fission + tracklength - 147 2 5 + 159 65 52 total - prompt-nu-fission + delayed-nu-fission analog - 147 2 + 159 65 5 total - flux - tracklength + delayed-nu-fission + analog - 147 59 2 - total - delayed-nu-fission - tracklength - - - 147 59 46 - total - delayed-nu-fission - analog - - - 147 59 5 - total - delayed-nu-fission - analog - - - 147 2 + 159 2 total nu-fission tracklength - - 147 59 2 + + 159 65 2 total delayed-nu-fission tracklength - - 147 59 2 + + 159 65 2 total delayed-nu-fission tracklength - - 147 59 2 + + 159 65 2 total decay-rate tracklength - - 147 2 + + 159 2 total flux analog - - 147 59 2 5 + + 159 65 2 5 total delayed-nu-fission analog diff --git a/tests/regression_tests/mgxs_library_condense/results_true.dat b/tests/regression_tests/mgxs_library_condense/results_true.dat index 0c9adedb1f..32d3d2e1a5 100644 --- a/tests/regression_tests/mgxs_library_condense/results_true.dat +++ b/tests/regression_tests/mgxs_library_condense/results_true.dat @@ -18,32 +18,32 @@ 0 1 1 total 0.388721 0.01783 material group in nuclide mean std. dev. 0 1 1 total 0.389304 0.023076 - material group in group out nuclide moment mean std. dev. -0 1 1 1 total P0 0.389304 0.023146 -1 1 1 1 total P1 0.046224 0.005907 -2 1 1 1 total P2 0.017984 0.002883 -3 1 1 1 total P3 0.006628 0.002457 - material group in group out nuclide moment mean std. dev. -0 1 1 1 total P0 0.389304 0.023146 -1 1 1 1 total P1 0.046224 0.005907 -2 1 1 1 total P2 0.017984 0.002883 -3 1 1 1 total P3 0.006628 0.002457 + material group in group out legendre nuclide mean std. dev. +0 1 1 1 P0 total 0.389304 0.023146 +1 1 1 1 P1 total 0.046224 0.005907 +2 1 1 1 P2 total 0.017984 0.002883 +3 1 1 1 P3 total 0.006628 0.002457 + material group in group out legendre nuclide mean std. dev. +0 1 1 1 P0 total 0.389304 0.023146 +1 1 1 1 P1 total 0.046224 0.005907 +2 1 1 1 P2 total 0.017984 0.002883 +3 1 1 1 P3 total 0.006628 0.002457 material group in group out nuclide mean std. dev. 0 1 1 1 total 1.0 0.066111 material group in group out nuclide mean std. dev. 0 1 1 1 total 0.085835 0.005592 material group in group out nuclide mean std. dev. 0 1 1 1 total 1.0 0.066111 - material group in group out nuclide moment mean std. dev. -0 1 1 1 total P0 0.388721 0.031279 -1 1 1 1 total P1 0.046155 0.006407 -2 1 1 1 total P2 0.017957 0.003039 -3 1 1 1 total P3 0.006618 0.002480 - material group in group out nuclide moment mean std. dev. -0 1 1 1 total P0 0.388721 0.040482 -1 1 1 1 total P1 0.046155 0.007097 -2 1 1 1 total P2 0.017957 0.003262 -3 1 1 1 total P3 0.006618 0.002518 + material group in group out legendre nuclide mean std. dev. +0 1 1 1 P0 total 0.388721 0.031279 +1 1 1 1 P1 total 0.046155 0.006407 +2 1 1 1 P2 total 0.017957 0.003039 +3 1 1 1 P3 total 0.006618 0.002480 + material group in group out legendre nuclide mean std. dev. +0 1 1 1 P0 total 0.388721 0.040482 +1 1 1 1 P1 total 0.046155 0.007097 +2 1 1 1 P2 total 0.017957 0.003262 +3 1 1 1 P3 total 0.006618 0.002518 material group out nuclide mean std. dev. 0 1 1 total 1.0 0.046071 material group out nuclide mean std. dev. @@ -109,32 +109,32 @@ 0 2 1 total 0.309384 0.013551 material group in nuclide mean std. dev. 0 2 1 total 0.307987 0.029308 - material group in group out nuclide moment mean std. dev. -0 2 1 1 total P0 0.307987 0.029308 -1 2 1 1 total P1 0.030617 0.007464 -2 2 1 1 total P2 0.018911 0.004323 -3 2 1 1 total P3 0.006235 0.003338 - material group in group out nuclide moment mean std. dev. -0 2 1 1 total P0 0.307987 0.029308 -1 2 1 1 total P1 0.030617 0.007464 -2 2 1 1 total P2 0.018911 0.004323 -3 2 1 1 total P3 0.006235 0.003338 + material group in group out legendre nuclide mean std. dev. +0 2 1 1 P0 total 0.307987 0.029308 +1 2 1 1 P1 total 0.030617 0.007464 +2 2 1 1 P2 total 0.018911 0.004323 +3 2 1 1 P3 total 0.006235 0.003338 + material group in group out legendre nuclide mean std. dev. +0 2 1 1 P0 total 0.307987 0.029308 +1 2 1 1 P1 total 0.030617 0.007464 +2 2 1 1 P2 total 0.018911 0.004323 +3 2 1 1 P3 total 0.006235 0.003338 material group in group out nuclide mean std. dev. 0 2 1 1 total 1.0 0.095039 material group in group out nuclide mean std. dev. 0 2 1 1 total 0.0 0.0 material group in group out nuclide mean std. dev. 0 2 1 1 total 1.0 0.095039 - material group in group out nuclide moment mean std. dev. -0 2 1 1 total P0 0.309384 0.032376 -1 2 1 1 total P1 0.030756 0.007617 -2 2 1 1 total P2 0.018997 0.004420 -3 2 1 1 total P3 0.006263 0.003364 - material group in group out nuclide moment mean std. dev. -0 2 1 1 total P0 0.309384 0.043735 -1 2 1 1 total P1 0.030756 0.008159 -2 2 1 1 total P2 0.018997 0.004775 -3 2 1 1 total P3 0.006263 0.003417 + material group in group out legendre nuclide mean std. dev. +0 2 1 1 P0 total 0.309384 0.032376 +1 2 1 1 P1 total 0.030756 0.007617 +2 2 1 1 P2 total 0.018997 0.004420 +3 2 1 1 P3 total 0.006263 0.003364 + material group in group out legendre nuclide mean std. dev. +0 2 1 1 P0 total 0.309384 0.043735 +1 2 1 1 P1 total 0.030756 0.008159 +2 2 1 1 P2 total 0.018997 0.004775 +3 2 1 1 P3 total 0.006263 0.003417 material group out nuclide mean std. dev. 0 2 1 total 0.0 0.0 material group out nuclide mean std. dev. @@ -200,32 +200,32 @@ 0 3 1 total 0.898938 0.043493 material group in nuclide mean std. dev. 0 3 1 total 0.903415 0.043959 - material group in group out nuclide moment mean std. dev. -0 3 1 1 total P0 0.903415 0.043586 -1 3 1 1 total P1 0.410417 0.015877 -2 3 1 1 total P2 0.143301 0.007187 -3 3 1 1 total P3 0.008739 0.003571 - material group in group out nuclide moment mean std. dev. -0 3 1 1 total P0 0.903415 0.043586 -1 3 1 1 total P1 0.410417 0.015877 -2 3 1 1 total P2 0.143301 0.007187 -3 3 1 1 total P3 0.008739 0.003571 + material group in group out legendre nuclide mean std. dev. +0 3 1 1 P0 total 0.903415 0.043586 +1 3 1 1 P1 total 0.410417 0.015877 +2 3 1 1 P2 total 0.143301 0.007187 +3 3 1 1 P3 total 0.008739 0.003571 + material group in group out legendre nuclide mean std. dev. +0 3 1 1 P0 total 0.903415 0.043586 +1 3 1 1 P1 total 0.410417 0.015877 +2 3 1 1 P2 total 0.143301 0.007187 +3 3 1 1 P3 total 0.008739 0.003571 material group in group out nuclide mean std. dev. 0 3 1 1 total 1.0 0.056867 material group in group out nuclide mean std. dev. 0 3 1 1 total 0.0 0.0 material group in group out nuclide mean std. dev. 0 3 1 1 total 1.0 0.056867 - material group in group out nuclide moment mean std. dev. -0 3 1 1 total P0 0.898938 0.067118 -1 3 1 1 total P1 0.408384 0.028127 -2 3 1 1 total P2 0.142591 0.010824 -3 3 1 1 total P3 0.008696 0.003588 - material group in group out nuclide moment mean std. dev. -0 3 1 1 total P0 0.898938 0.084369 -1 3 1 1 total P1 0.408384 0.036475 -2 3 1 1 total P2 0.142591 0.013525 -3 3 1 1 total P3 0.008696 0.003622 + material group in group out legendre nuclide mean std. dev. +0 3 1 1 P0 total 0.898938 0.067118 +1 3 1 1 P1 total 0.408384 0.028127 +2 3 1 1 P2 total 0.142591 0.010824 +3 3 1 1 P3 total 0.008696 0.003588 + material group in group out legendre nuclide mean std. dev. +0 3 1 1 P0 total 0.898938 0.084369 +1 3 1 1 P1 total 0.408384 0.036475 +2 3 1 1 P2 total 0.142591 0.013525 +3 3 1 1 P3 total 0.008696 0.003622 material group out nuclide mean std. dev. 0 3 1 total 0.0 0.0 material group out nuclide mean std. dev. diff --git a/tests/regression_tests/mgxs_library_distribcell/inputs_true.dat b/tests/regression_tests/mgxs_library_distribcell/inputs_true.dat index ba7dc05ff7..f6748d1508 100644 --- a/tests/regression_tests/mgxs_library_distribcell/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_distribcell/inputs_true.dat @@ -86,7 +86,13 @@ 0.0 20000000.0 - + + 1 + + + 3 + + 1 2 3 4 5 6 @@ -120,9 +126,9 @@ analog - 1 5 + 1 5 6 total - scatter-1 + scatter analog @@ -144,9 +150,9 @@ analog - 1 5 + 1 5 6 total - nu-scatter-1 + nu-scatter analog @@ -246,9 +252,9 @@ analog - 1 2 5 + 1 2 5 28 total - scatter-P3 + scatter analog @@ -258,9 +264,9 @@ analog - 1 2 5 + 1 2 5 28 total - nu-scatter-P3 + nu-scatter analog @@ -306,9 +312,9 @@ tracklength - 1 2 5 + 1 2 5 28 total - scatter-P3 + scatter analog @@ -324,139 +330,133 @@ tracklength - 1 2 5 + 1 2 5 28 total - scatter-P3 + scatter analog 1 2 5 total - nu-scatter-0 + nu-scatter analog - 1 2 5 + 1 2 total - scatter-0 + nu-fission analog - 1 2 + 1 5 total nu-fission analog - 1 5 + 1 2 total - nu-fission + prompt-nu-fission analog - 1 2 + 1 5 total prompt-nu-fission analog - 1 5 - total - prompt-nu-fission - analog - - 1 2 total flux tracklength - + 1 2 total inverse-velocity tracklength - + 1 2 total flux tracklength + + 1 2 + total + prompt-nu-fission + tracklength + - 1 2 - total - prompt-nu-fission - tracklength - - 1 2 total flux analog - + 1 2 5 total prompt-nu-fission analog - + 1 2 total flux tracklength - - 1 59 2 + + 1 65 2 total delayed-nu-fission tracklength + + 1 65 2 + total + delayed-nu-fission + analog + - 1 59 2 + 1 65 5 total delayed-nu-fission analog - 1 59 5 - total - delayed-nu-fission - analog - - 1 2 total nu-fission tracklength + + 1 65 2 + total + delayed-nu-fission + tracklength + - 1 59 2 + 1 65 2 total delayed-nu-fission tracklength - 1 59 2 - total - delayed-nu-fission - tracklength - - - 1 59 2 + 1 65 2 total decay-rate tracklength - + 1 2 total flux analog - - 1 59 2 5 + + 1 65 2 5 total delayed-nu-fission analog diff --git a/tests/regression_tests/mgxs_library_distribcell/results_true.dat b/tests/regression_tests/mgxs_library_distribcell/results_true.dat index e9277c9758..d5496362c9 100644 --- a/tests/regression_tests/mgxs_library_distribcell/results_true.dat +++ b/tests/regression_tests/mgxs_library_distribcell/results_true.dat @@ -18,32 +18,32 @@ 0 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 total 0.390797 0.008717 sum(distribcell) group in nuclide mean std. dev. 0 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 total 0.387332 0.014241 - sum(distribcell) group in group out nuclide moment mean std. dev. -0 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 total P0 0.387009 0.014230 -1 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 total P1 0.047179 0.004923 -2 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 total P2 0.015713 0.003654 -3 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 total P3 0.005378 0.003137 - sum(distribcell) group in group out nuclide moment mean std. dev. -0 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 total P0 0.387332 0.014241 -1 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 total P1 0.047187 0.004933 -2 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 total P2 0.015727 0.003654 -3 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 total P3 0.005387 0.003141 + sum(distribcell) group in group out legendre nuclide mean std. dev. +0 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 P0 total 0.387009 0.014230 +1 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 P1 total 0.047179 0.004923 +2 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 P2 total 0.015713 0.003654 +3 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 P3 total 0.005378 0.003137 + sum(distribcell) group in group out legendre nuclide mean std. dev. +0 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 P0 total 0.387332 0.014241 +1 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 P1 total 0.047187 0.004933 +2 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 P2 total 0.015727 0.003654 +3 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 P3 total 0.005387 0.003141 sum(distribcell) group in group out nuclide mean std. dev. 0 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 total 1.000834 0.037242 sum(distribcell) group in group out nuclide mean std. dev. 0 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 total 0.094516 0.0059 sum(distribcell) group in group out nuclide mean std. dev. 0 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 total 1.0 0.037213 - sum(distribcell) group in group out nuclide moment mean std. dev. -0 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 total P0 0.390797 0.016955 -1 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 total P1 0.047641 0.005091 -2 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 total P2 0.015866 0.003708 -3 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 total P3 0.005430 0.003170 - sum(distribcell) group in group out nuclide moment mean std. dev. -0 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 total P0 0.391123 0.022356 -1 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 total P1 0.047680 0.005395 -2 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 total P2 0.015880 0.003758 -3 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 total P3 0.005435 0.003179 + sum(distribcell) group in group out legendre nuclide mean std. dev. +0 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 P0 total 0.390797 0.016955 +1 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 P1 total 0.047641 0.005091 +2 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 P2 total 0.015866 0.003708 +3 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 P3 total 0.005430 0.003170 + sum(distribcell) group in group out legendre nuclide mean std. dev. +0 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 P0 total 0.391123 0.022356 +1 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 P1 total 0.047680 0.005395 +2 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 P2 total 0.015880 0.003758 +3 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 1 P3 total 0.005435 0.003179 sum(distribcell) group out nuclide mean std. dev. 0 ((0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13... 1 total 1.0 0.080455 sum(distribcell) group out nuclide mean std. dev. diff --git a/tests/regression_tests/mgxs_library_hdf5/inputs_true.dat b/tests/regression_tests/mgxs_library_hdf5/inputs_true.dat index ef6c4c5206..5aedd383d0 100644 --- a/tests/regression_tests/mgxs_library_hdf5/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_hdf5/inputs_true.dat @@ -59,16 +59,22 @@ 0.0 0.625 20000000.0 - + + 1 + + + 3 + + 0.0 20000000.0 - + 1 2 3 4 5 6 - + 2 - + 3 @@ -102,9 +108,9 @@ analog - 1 5 + 1 5 6 total - scatter-1 + scatter analog @@ -126,9 +132,9 @@ analog - 1 5 + 1 5 6 total - nu-scatter-1 + nu-scatter analog @@ -228,9 +234,9 @@ analog - 1 2 5 + 1 2 5 28 total - scatter-P3 + scatter analog @@ -240,9 +246,9 @@ analog - 1 2 5 + 1 2 5 28 total - nu-scatter-P3 + nu-scatter analog @@ -288,9 +294,9 @@ tracklength - 1 2 5 + 1 2 5 28 total - scatter-P3 + scatter analog @@ -306,883 +312,865 @@ tracklength - 1 2 5 + 1 2 5 28 total - scatter-P3 + scatter analog 1 2 5 total - nu-scatter-0 + nu-scatter analog - 1 2 5 + 1 52 total - scatter-0 + nu-fission analog - 1 46 + 1 5 total nu-fission analog - 1 5 + 1 52 total - nu-fission + prompt-nu-fission analog - 1 46 + 1 5 total prompt-nu-fission analog - 1 5 + 1 2 total - prompt-nu-fission - analog + flux + tracklength 1 2 total - flux + inverse-velocity tracklength 1 2 total - inverse-velocity + flux tracklength 1 2 total - flux + prompt-nu-fission tracklength - 1 2 - total - prompt-nu-fission - tracklength - - 1 2 total flux analog - + 1 2 5 total prompt-nu-fission analog - + 1 2 total flux tracklength - - 1 59 2 + + 1 65 2 total delayed-nu-fission tracklength + + 1 65 52 + total + delayed-nu-fission + analog + - 1 59 46 + 1 65 5 total delayed-nu-fission analog - 1 59 5 - total - delayed-nu-fission - analog - - 1 2 total nu-fission tracklength + + 1 65 2 + total + delayed-nu-fission + tracklength + - 1 59 2 + 1 65 2 total delayed-nu-fission tracklength - 1 59 2 - total - delayed-nu-fission - tracklength - - - 1 59 2 + 1 65 2 total decay-rate tracklength - + 1 2 total flux analog - - 1 59 2 5 + + 1 65 2 5 total delayed-nu-fission analog - - 74 2 + + 80 2 total flux tracklength + + 80 2 + total + total + tracklength + - 74 2 + 80 2 total - total + flux tracklength - 74 2 + 80 2 total - flux + total tracklength - 74 2 - total - total - tracklength - - - 74 2 + 80 2 total flux analog + + 80 5 6 + total + scatter + analog + - 74 5 - total - scatter-1 - analog - - - 74 2 + 80 2 total flux tracklength - - 74 2 + + 80 2 total total tracklength - - 74 2 + + 80 2 total flux analog + + 80 5 6 + total + nu-scatter + analog + - 74 5 - total - nu-scatter-1 - analog - - - 74 2 + 80 2 total flux tracklength + + 80 2 + total + absorption + tracklength + - 74 2 + 80 2 total - absorption + flux tracklength - 74 2 - total - flux - tracklength - - - 74 2 + 80 2 total absorption tracklength - - 74 2 + + 80 2 total fission tracklength + + 80 2 + total + flux + tracklength + - 74 2 - total - flux - tracklength - - - 74 2 + 80 2 total fission tracklength - - 74 2 + + 80 2 total flux tracklength - - 74 2 + + 80 2 total nu-fission tracklength - - 74 2 + + 80 2 total flux tracklength - - 74 2 + + 80 2 total kappa-fission tracklength - - 74 2 + + 80 2 total flux tracklength + + 80 2 + total + scatter + tracklength + - 74 2 - total - scatter - tracklength - - - 74 2 + 80 2 total flux analog + + 80 2 + total + nu-scatter + analog + - 74 2 + 80 2 total - nu-scatter + flux analog - 74 2 + 80 2 5 28 total - flux + scatter analog - 74 2 5 - total - scatter-P3 - analog - - - 74 2 + 80 2 total flux analog - - 74 2 5 - total - nu-scatter-P3 - analog - - - 74 2 5 + + 80 2 5 28 total nu-scatter analog - - 74 2 5 + + 80 2 5 + total + nu-scatter + analog + + + 80 2 5 total scatter analog + + 80 2 + total + flux + analog + - 74 2 + 80 2 5 total - flux + nu-fission analog - 74 2 5 + 80 2 5 total - nu-fission + scatter analog - 74 2 5 - total - scatter - analog - - - 74 2 + 80 2 total flux tracklength + + 80 2 + total + scatter + tracklength + - 74 2 + 80 2 5 28 total scatter - tracklength - - - 74 2 5 - total - scatter-P3 analog - - 74 2 + + 80 2 total flux tracklength - - 74 2 + + 80 2 total scatter tracklength - - 74 2 5 + + 80 2 5 28 total - scatter-P3 + scatter + analog + + + 80 2 5 + total + nu-scatter analog - 74 2 5 + 80 52 total - nu-scatter-0 + nu-fission analog - 74 2 5 + 80 5 total - scatter-0 + nu-fission analog - 74 46 + 80 52 total - nu-fission + prompt-nu-fission analog - 74 5 + 80 5 total - nu-fission + prompt-nu-fission analog - 74 46 + 80 2 total - prompt-nu-fission - analog + flux + tracklength - 74 5 + 80 2 total - prompt-nu-fission - analog + inverse-velocity + tracklength - 74 2 + 80 2 total flux tracklength - 74 2 + 80 2 total - inverse-velocity + prompt-nu-fission tracklength - 74 2 + 80 2 total flux - tracklength + analog - 74 2 + 80 2 5 total prompt-nu-fission - tracklength + analog - 74 2 + 80 2 total flux - analog + tracklength - 74 2 5 + 80 65 2 total - prompt-nu-fission - analog + delayed-nu-fission + tracklength - 74 2 + 80 65 52 total - flux - tracklength + delayed-nu-fission + analog - 74 59 2 + 80 65 5 total delayed-nu-fission - tracklength + analog - 74 59 46 - total - delayed-nu-fission - analog - - - 74 59 5 - total - delayed-nu-fission - analog - - - 74 2 + 80 2 total nu-fission tracklength + + 80 65 2 + total + delayed-nu-fission + tracklength + + + 80 65 2 + total + delayed-nu-fission + tracklength + - 74 59 2 - total - delayed-nu-fission - tracklength - - - 74 59 2 - total - delayed-nu-fission - tracklength - - - 74 59 2 + 80 65 2 total decay-rate tracklength - - 74 2 + + 80 2 total flux analog - - 74 59 2 5 + + 80 65 2 5 total delayed-nu-fission analog + + 159 2 + total + flux + tracklength + + + 159 2 + total + total + tracklength + - 147 2 + 159 2 total flux tracklength - 147 2 + 159 2 total total tracklength - 147 2 + 159 2 total flux - tracklength + analog - 147 2 + 159 5 6 total - total - tracklength + scatter + analog - 147 2 - total - flux - analog - - - 147 5 - total - scatter-1 - analog - - - 147 2 + 159 2 total flux tracklength - - 147 2 + + 159 2 total total tracklength - - 147 2 + + 159 2 total flux analog - - 147 5 + + 159 5 6 total - nu-scatter-1 + nu-scatter analog + + 159 2 + total + flux + tracklength + + + 159 2 + total + absorption + tracklength + - 147 2 + 159 2 total flux tracklength - 147 2 + 159 2 total absorption tracklength - 147 2 + 159 2 + total + fission + tracklength + + + 159 2 total flux tracklength - - 147 2 - total - absorption - tracklength - - 147 2 + 159 2 total fission tracklength - 147 2 + 159 2 total flux tracklength - 147 2 + 159 2 total - fission + nu-fission tracklength - 147 2 + 159 2 total flux tracklength - 147 2 + 159 2 total - nu-fission + kappa-fission tracklength - 147 2 + 159 2 total flux tracklength - 147 2 - total - kappa-fission - tracklength - - - 147 2 - total - flux - tracklength - - - 147 2 + 159 2 total scatter tracklength + + 159 2 + total + flux + analog + + + 159 2 + total + nu-scatter + analog + - 147 2 + 159 2 total flux analog - 147 2 + 159 2 5 28 total - nu-scatter + scatter analog - 147 2 + 159 2 total flux analog - 147 2 5 - total - scatter-P3 - analog - - - 147 2 - total - flux - analog - - - 147 2 5 - total - nu-scatter-P3 - analog - - - 147 2 5 + 159 2 5 28 total nu-scatter analog - - 147 2 5 + + 159 2 5 + total + nu-scatter + analog + + + 159 2 5 total scatter analog + + 159 2 + total + flux + analog + + + 159 2 5 + total + nu-fission + analog + - 147 2 + 159 2 5 total - flux + scatter analog - 147 2 5 - total - nu-fission - analog - - - 147 2 5 - total - scatter - analog - - - 147 2 + 159 2 total flux tracklength - - 147 2 + + 159 2 total scatter tracklength + + 159 2 5 28 + total + scatter + analog + + + 159 2 + total + flux + tracklength + - 147 2 5 - total - scatter-P3 - analog - - - 147 2 - total - flux - tracklength - - - 147 2 + 159 2 total scatter tracklength - - 147 2 5 + + 159 2 5 28 total - scatter-P3 + scatter + analog + + + 159 2 5 + total + nu-scatter + analog + + + 159 52 + total + nu-fission analog - 147 2 5 + 159 5 total - nu-scatter-0 + nu-fission analog - 147 2 5 + 159 52 total - scatter-0 + prompt-nu-fission analog - 147 46 + 159 5 total - nu-fission + prompt-nu-fission analog - 147 5 - total - nu-fission - analog - - - 147 46 - total - prompt-nu-fission - analog - - - 147 5 - total - prompt-nu-fission - analog - - - 147 2 + 159 2 total flux tracklength - - 147 2 + + 159 2 total inverse-velocity tracklength - - 147 2 + + 159 2 total flux tracklength - - 147 2 + + 159 2 total prompt-nu-fission tracklength + + 159 2 + total + flux + analog + + + 159 2 5 + total + prompt-nu-fission + analog + + + 159 2 + total + flux + tracklength + - 147 2 + 159 65 2 total - flux - analog + delayed-nu-fission + tracklength - 147 2 5 + 159 65 52 total - prompt-nu-fission + delayed-nu-fission analog - 147 2 + 159 65 5 total - flux - tracklength + delayed-nu-fission + analog - 147 59 2 - total - delayed-nu-fission - tracklength - - - 147 59 46 - total - delayed-nu-fission - analog - - - 147 59 5 - total - delayed-nu-fission - analog - - - 147 2 + 159 2 total nu-fission tracklength - - 147 59 2 + + 159 65 2 total delayed-nu-fission tracklength - - 147 59 2 + + 159 65 2 total delayed-nu-fission tracklength - - 147 59 2 + + 159 65 2 total decay-rate tracklength - - 147 2 + + 159 2 total flux analog - - 147 59 2 5 + + 159 65 2 5 total delayed-nu-fission analog diff --git a/tests/regression_tests/mgxs_library_mesh/inputs_true.dat b/tests/regression_tests/mgxs_library_mesh/inputs_true.dat index aa2c904b19..299da0713c 100644 --- a/tests/regression_tests/mgxs_library_mesh/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_mesh/inputs_true.dat @@ -323,7 +323,13 @@ 0.0 20000000.0 - + + 1 + + + 3 + + 1 2 3 4 5 6 @@ -357,9 +363,9 @@ analog - 1 5 + 1 5 6 total - scatter-1 + scatter analog @@ -381,9 +387,9 @@ analog - 1 5 + 1 5 6 total - nu-scatter-1 + nu-scatter analog @@ -483,9 +489,9 @@ analog - 1 2 5 + 1 2 5 28 total - scatter-P3 + scatter analog @@ -495,9 +501,9 @@ analog - 1 2 5 + 1 2 5 28 total - nu-scatter-P3 + nu-scatter analog @@ -543,9 +549,9 @@ tracklength - 1 2 5 + 1 2 5 28 total - scatter-P3 + scatter analog @@ -561,139 +567,133 @@ tracklength - 1 2 5 + 1 2 5 28 total - scatter-P3 + scatter analog 1 2 5 total - nu-scatter-0 + nu-scatter analog - 1 2 5 + 1 2 total - scatter-0 + nu-fission analog - 1 2 + 1 5 total nu-fission analog - 1 5 + 1 2 total - nu-fission + prompt-nu-fission analog - 1 2 + 1 5 total prompt-nu-fission analog - 1 5 - total - prompt-nu-fission - analog - - 1 2 total flux tracklength - + 1 2 total inverse-velocity tracklength - + 1 2 total flux tracklength + + 1 2 + total + prompt-nu-fission + tracklength + - 1 2 - total - prompt-nu-fission - tracklength - - 1 2 total flux analog - + 1 2 5 total prompt-nu-fission analog - + 1 2 total flux tracklength - - 1 59 2 + + 1 65 2 total delayed-nu-fission tracklength + + 1 65 2 + total + delayed-nu-fission + analog + - 1 59 2 + 1 65 5 total delayed-nu-fission analog - 1 59 5 - total - delayed-nu-fission - analog - - 1 2 total nu-fission tracklength + + 1 65 2 + total + delayed-nu-fission + tracklength + - 1 59 2 + 1 65 2 total delayed-nu-fission tracklength - 1 59 2 - total - delayed-nu-fission - tracklength - - - 1 59 2 + 1 65 2 total decay-rate tracklength - + 1 2 total flux analog - - 1 59 2 5 + + 1 65 2 5 total delayed-nu-fission analog diff --git a/tests/regression_tests/mgxs_library_mesh/results_true.dat b/tests/regression_tests/mgxs_library_mesh/results_true.dat index 4b9303fbf3..27c1ffdc97 100644 --- a/tests/regression_tests/mgxs_library_mesh/results_true.dat +++ b/tests/regression_tests/mgxs_library_mesh/results_true.dat @@ -58,42 +58,42 @@ 2 1 2 1 1 total 0.628158 0.064356 1 2 1 1 1 total 0.640809 0.158369 3 2 2 1 1 total 0.645171 0.080467 - mesh 1 group in group out nuclide moment mean std. dev. - x y z -0 1 1 1 1 1 total P0 0.763779 0.070696 -1 1 1 1 1 1 total P1 0.288556 0.024446 -2 1 1 1 1 1 total P2 0.082441 0.011443 -3 1 1 1 1 1 total P3 -0.005627 0.012638 -8 1 2 1 1 1 total P0 0.628158 0.064356 -9 1 2 1 1 1 total P1 0.245583 0.022676 -10 1 2 1 1 1 total P2 0.086370 0.007833 -11 1 2 1 1 1 total P3 0.019590 0.005345 -4 2 1 1 1 1 total P0 0.640809 0.158369 -5 2 1 1 1 1 total P1 0.273553 0.066437 -6 2 1 1 1 1 total P2 0.108446 0.024435 -7 2 1 1 1 1 total P3 0.012229 0.003785 -12 2 2 1 1 1 total P0 0.645171 0.080467 -13 2 2 1 1 1 total P1 0.252215 0.032154 -14 2 2 1 1 1 total P2 0.089251 0.009734 -15 2 2 1 1 1 total P3 0.004748 0.002987 - mesh 1 group in group out nuclide moment mean std. dev. - x y z -0 1 1 1 1 1 total P0 0.763779 0.070696 -1 1 1 1 1 1 total P1 0.288556 0.024446 -2 1 1 1 1 1 total P2 0.082441 0.011443 -3 1 1 1 1 1 total P3 -0.005627 0.012638 -8 1 2 1 1 1 total P0 0.628158 0.064356 -9 1 2 1 1 1 total P1 0.245583 0.022676 -10 1 2 1 1 1 total P2 0.086370 0.007833 -11 1 2 1 1 1 total P3 0.019590 0.005345 -4 2 1 1 1 1 total P0 0.640809 0.158369 -5 2 1 1 1 1 total P1 0.273553 0.066437 -6 2 1 1 1 1 total P2 0.108446 0.024435 -7 2 1 1 1 1 total P3 0.012229 0.003785 -12 2 2 1 1 1 total P0 0.645171 0.080467 -13 2 2 1 1 1 total P1 0.252215 0.032154 -14 2 2 1 1 1 total P2 0.089251 0.009734 -15 2 2 1 1 1 total P3 0.004748 0.002987 + mesh 1 group in group out legendre nuclide mean std. dev. + x y z +0 1 1 1 1 1 P0 total 0.763779 0.070696 +1 1 1 1 1 1 P1 total 0.288556 0.024446 +2 1 1 1 1 1 P2 total 0.082441 0.011443 +3 1 1 1 1 1 P3 total -0.005627 0.012638 +8 1 2 1 1 1 P0 total 0.628158 0.064356 +9 1 2 1 1 1 P1 total 0.245583 0.022676 +10 1 2 1 1 1 P2 total 0.086370 0.007833 +11 1 2 1 1 1 P3 total 0.019590 0.005345 +4 2 1 1 1 1 P0 total 0.640809 0.158369 +5 2 1 1 1 1 P1 total 0.273553 0.066437 +6 2 1 1 1 1 P2 total 0.108446 0.024435 +7 2 1 1 1 1 P3 total 0.012229 0.003785 +12 2 2 1 1 1 P0 total 0.645171 0.080467 +13 2 2 1 1 1 P1 total 0.252215 0.032154 +14 2 2 1 1 1 P2 total 0.089251 0.009734 +15 2 2 1 1 1 P3 total 0.004748 0.002987 + mesh 1 group in group out legendre nuclide mean std. dev. + x y z +0 1 1 1 1 1 P0 total 0.763779 0.070696 +1 1 1 1 1 1 P1 total 0.288556 0.024446 +2 1 1 1 1 1 P2 total 0.082441 0.011443 +3 1 1 1 1 1 P3 total -0.005627 0.012638 +8 1 2 1 1 1 P0 total 0.628158 0.064356 +9 1 2 1 1 1 P1 total 0.245583 0.022676 +10 1 2 1 1 1 P2 total 0.086370 0.007833 +11 1 2 1 1 1 P3 total 0.019590 0.005345 +4 2 1 1 1 1 P0 total 0.640809 0.158369 +5 2 1 1 1 1 P1 total 0.273553 0.066437 +6 2 1 1 1 1 P2 total 0.108446 0.024435 +7 2 1 1 1 1 P3 total 0.012229 0.003785 +12 2 2 1 1 1 P0 total 0.645171 0.080467 +13 2 2 1 1 1 P1 total 0.252215 0.032154 +14 2 2 1 1 1 P2 total 0.089251 0.009734 +15 2 2 1 1 1 P3 total 0.004748 0.002987 mesh 1 group in group out nuclide mean std. dev. x y z 0 1 1 1 1 1 total 1.0 0.108337 @@ -112,42 +112,42 @@ 2 1 2 1 1 1 total 1.0 0.113128 1 2 1 1 1 1 total 1.0 0.238517 3 2 2 1 1 1 total 1.0 0.132597 - mesh 1 group in group out nuclide moment mean std. dev. - x y z -0 1 1 1 1 1 total P0 0.735256 0.113047 -1 1 1 1 1 1 total P1 0.277780 0.041434 -2 1 1 1 1 1 total P2 0.079362 0.014706 -3 1 1 1 1 1 total P3 -0.005417 0.012184 -8 1 2 1 1 1 total P0 0.624575 0.110512 -9 1 2 1 1 1 total P1 0.244182 0.041824 -10 1 2 1 1 1 total P2 0.085877 0.014634 -11 1 2 1 1 1 total P3 0.019478 0.006012 -4 2 1 1 1 1 total P0 0.633925 0.212349 -5 2 1 1 1 1 total P1 0.270615 0.089799 -6 2 1 1 1 1 total P2 0.107281 0.034246 -7 2 1 1 1 1 total P3 0.012098 0.004637 -12 2 2 1 1 1 total P0 0.655214 0.126119 -13 2 2 1 1 1 total P1 0.256141 0.049765 -14 2 2 1 1 1 total P2 0.090641 0.016563 -15 2 2 1 1 1 total P3 0.004822 0.003115 - mesh 1 group in group out nuclide moment mean std. dev. - x y z -0 1 1 1 1 1 total P0 0.735256 0.138292 -1 1 1 1 1 1 total P1 0.277780 0.051210 -2 1 1 1 1 1 total P2 0.079362 0.017035 -3 1 1 1 1 1 total P3 -0.005417 0.012198 -8 1 2 1 1 1 total P0 0.624575 0.131169 -9 1 2 1 1 1 total P1 0.244182 0.050123 -10 1 2 1 1 1 total P2 0.085877 0.017565 -11 1 2 1 1 1 total P3 0.019478 0.006403 -4 2 1 1 1 1 total P0 0.633925 0.260681 -5 2 1 1 1 1 total P1 0.270615 0.110590 -6 2 1 1 1 1 total P2 0.107281 0.042750 -7 2 1 1 1 1 total P3 0.012098 0.005462 -12 2 2 1 1 1 total P0 0.655214 0.153147 -13 2 2 1 1 1 total P1 0.256141 0.060250 -14 2 2 1 1 1 total P2 0.090641 0.020464 -15 2 2 1 1 1 total P3 0.004822 0.003180 + mesh 1 group in group out legendre nuclide mean std. dev. + x y z +0 1 1 1 1 1 P0 total 0.735256 0.113047 +1 1 1 1 1 1 P1 total 0.277780 0.041434 +2 1 1 1 1 1 P2 total 0.079362 0.014706 +3 1 1 1 1 1 P3 total -0.005417 0.012184 +8 1 2 1 1 1 P0 total 0.624575 0.110512 +9 1 2 1 1 1 P1 total 0.244182 0.041824 +10 1 2 1 1 1 P2 total 0.085877 0.014634 +11 1 2 1 1 1 P3 total 0.019478 0.006012 +4 2 1 1 1 1 P0 total 0.633925 0.212349 +5 2 1 1 1 1 P1 total 0.270615 0.089799 +6 2 1 1 1 1 P2 total 0.107281 0.034246 +7 2 1 1 1 1 P3 total 0.012098 0.004637 +12 2 2 1 1 1 P0 total 0.655214 0.126119 +13 2 2 1 1 1 P1 total 0.256141 0.049765 +14 2 2 1 1 1 P2 total 0.090641 0.016563 +15 2 2 1 1 1 P3 total 0.004822 0.003115 + mesh 1 group in group out legendre nuclide mean std. dev. + x y z +0 1 1 1 1 1 P0 total 0.735256 0.138292 +1 1 1 1 1 1 P1 total 0.277780 0.051210 +2 1 1 1 1 1 P2 total 0.079362 0.017035 +3 1 1 1 1 1 P3 total -0.005417 0.012198 +8 1 2 1 1 1 P0 total 0.624575 0.131169 +9 1 2 1 1 1 P1 total 0.244182 0.050123 +10 1 2 1 1 1 P2 total 0.085877 0.017565 +11 1 2 1 1 1 P3 total 0.019478 0.006403 +4 2 1 1 1 1 P0 total 0.633925 0.260681 +5 2 1 1 1 1 P1 total 0.270615 0.110590 +6 2 1 1 1 1 P2 total 0.107281 0.042750 +7 2 1 1 1 1 P3 total 0.012098 0.005462 +12 2 2 1 1 1 P0 total 0.655214 0.153147 +13 2 2 1 1 1 P1 total 0.256141 0.060250 +14 2 2 1 1 1 P2 total 0.090641 0.020464 +15 2 2 1 1 1 P3 total 0.004822 0.003180 mesh 1 group out nuclide mean std. dev. x y z 0 1 1 1 1 total 1.0 0.300047 diff --git a/tests/regression_tests/mgxs_library_no_nuclides/inputs_true.dat b/tests/regression_tests/mgxs_library_no_nuclides/inputs_true.dat index ef6c4c5206..5aedd383d0 100644 --- a/tests/regression_tests/mgxs_library_no_nuclides/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_no_nuclides/inputs_true.dat @@ -59,16 +59,22 @@ 0.0 0.625 20000000.0 - + + 1 + + + 3 + + 0.0 20000000.0 - + 1 2 3 4 5 6 - + 2 - + 3 @@ -102,9 +108,9 @@ analog - 1 5 + 1 5 6 total - scatter-1 + scatter analog @@ -126,9 +132,9 @@ analog - 1 5 + 1 5 6 total - nu-scatter-1 + nu-scatter analog @@ -228,9 +234,9 @@ analog - 1 2 5 + 1 2 5 28 total - scatter-P3 + scatter analog @@ -240,9 +246,9 @@ analog - 1 2 5 + 1 2 5 28 total - nu-scatter-P3 + nu-scatter analog @@ -288,9 +294,9 @@ tracklength - 1 2 5 + 1 2 5 28 total - scatter-P3 + scatter analog @@ -306,883 +312,865 @@ tracklength - 1 2 5 + 1 2 5 28 total - scatter-P3 + scatter analog 1 2 5 total - nu-scatter-0 + nu-scatter analog - 1 2 5 + 1 52 total - scatter-0 + nu-fission analog - 1 46 + 1 5 total nu-fission analog - 1 5 + 1 52 total - nu-fission + prompt-nu-fission analog - 1 46 + 1 5 total prompt-nu-fission analog - 1 5 + 1 2 total - prompt-nu-fission - analog + flux + tracklength 1 2 total - flux + inverse-velocity tracklength 1 2 total - inverse-velocity + flux tracklength 1 2 total - flux + prompt-nu-fission tracklength - 1 2 - total - prompt-nu-fission - tracklength - - 1 2 total flux analog - + 1 2 5 total prompt-nu-fission analog - + 1 2 total flux tracklength - - 1 59 2 + + 1 65 2 total delayed-nu-fission tracklength + + 1 65 52 + total + delayed-nu-fission + analog + - 1 59 46 + 1 65 5 total delayed-nu-fission analog - 1 59 5 - total - delayed-nu-fission - analog - - 1 2 total nu-fission tracklength + + 1 65 2 + total + delayed-nu-fission + tracklength + - 1 59 2 + 1 65 2 total delayed-nu-fission tracklength - 1 59 2 - total - delayed-nu-fission - tracklength - - - 1 59 2 + 1 65 2 total decay-rate tracklength - + 1 2 total flux analog - - 1 59 2 5 + + 1 65 2 5 total delayed-nu-fission analog - - 74 2 + + 80 2 total flux tracklength + + 80 2 + total + total + tracklength + - 74 2 + 80 2 total - total + flux tracklength - 74 2 + 80 2 total - flux + total tracklength - 74 2 - total - total - tracklength - - - 74 2 + 80 2 total flux analog + + 80 5 6 + total + scatter + analog + - 74 5 - total - scatter-1 - analog - - - 74 2 + 80 2 total flux tracklength - - 74 2 + + 80 2 total total tracklength - - 74 2 + + 80 2 total flux analog + + 80 5 6 + total + nu-scatter + analog + - 74 5 - total - nu-scatter-1 - analog - - - 74 2 + 80 2 total flux tracklength + + 80 2 + total + absorption + tracklength + - 74 2 + 80 2 total - absorption + flux tracklength - 74 2 - total - flux - tracklength - - - 74 2 + 80 2 total absorption tracklength - - 74 2 + + 80 2 total fission tracklength + + 80 2 + total + flux + tracklength + - 74 2 - total - flux - tracklength - - - 74 2 + 80 2 total fission tracklength - - 74 2 + + 80 2 total flux tracklength - - 74 2 + + 80 2 total nu-fission tracklength - - 74 2 + + 80 2 total flux tracklength - - 74 2 + + 80 2 total kappa-fission tracklength - - 74 2 + + 80 2 total flux tracklength + + 80 2 + total + scatter + tracklength + - 74 2 - total - scatter - tracklength - - - 74 2 + 80 2 total flux analog + + 80 2 + total + nu-scatter + analog + - 74 2 + 80 2 total - nu-scatter + flux analog - 74 2 + 80 2 5 28 total - flux + scatter analog - 74 2 5 - total - scatter-P3 - analog - - - 74 2 + 80 2 total flux analog - - 74 2 5 - total - nu-scatter-P3 - analog - - - 74 2 5 + + 80 2 5 28 total nu-scatter analog - - 74 2 5 + + 80 2 5 + total + nu-scatter + analog + + + 80 2 5 total scatter analog + + 80 2 + total + flux + analog + - 74 2 + 80 2 5 total - flux + nu-fission analog - 74 2 5 + 80 2 5 total - nu-fission + scatter analog - 74 2 5 - total - scatter - analog - - - 74 2 + 80 2 total flux tracklength + + 80 2 + total + scatter + tracklength + - 74 2 + 80 2 5 28 total scatter - tracklength - - - 74 2 5 - total - scatter-P3 analog - - 74 2 + + 80 2 total flux tracklength - - 74 2 + + 80 2 total scatter tracklength - - 74 2 5 + + 80 2 5 28 total - scatter-P3 + scatter + analog + + + 80 2 5 + total + nu-scatter analog - 74 2 5 + 80 52 total - nu-scatter-0 + nu-fission analog - 74 2 5 + 80 5 total - scatter-0 + nu-fission analog - 74 46 + 80 52 total - nu-fission + prompt-nu-fission analog - 74 5 + 80 5 total - nu-fission + prompt-nu-fission analog - 74 46 + 80 2 total - prompt-nu-fission - analog + flux + tracklength - 74 5 + 80 2 total - prompt-nu-fission - analog + inverse-velocity + tracklength - 74 2 + 80 2 total flux tracklength - 74 2 + 80 2 total - inverse-velocity + prompt-nu-fission tracklength - 74 2 + 80 2 total flux - tracklength + analog - 74 2 + 80 2 5 total prompt-nu-fission - tracklength + analog - 74 2 + 80 2 total flux - analog + tracklength - 74 2 5 + 80 65 2 total - prompt-nu-fission - analog + delayed-nu-fission + tracklength - 74 2 + 80 65 52 total - flux - tracklength + delayed-nu-fission + analog - 74 59 2 + 80 65 5 total delayed-nu-fission - tracklength + analog - 74 59 46 - total - delayed-nu-fission - analog - - - 74 59 5 - total - delayed-nu-fission - analog - - - 74 2 + 80 2 total nu-fission tracklength + + 80 65 2 + total + delayed-nu-fission + tracklength + + + 80 65 2 + total + delayed-nu-fission + tracklength + - 74 59 2 - total - delayed-nu-fission - tracklength - - - 74 59 2 - total - delayed-nu-fission - tracklength - - - 74 59 2 + 80 65 2 total decay-rate tracklength - - 74 2 + + 80 2 total flux analog - - 74 59 2 5 + + 80 65 2 5 total delayed-nu-fission analog + + 159 2 + total + flux + tracklength + + + 159 2 + total + total + tracklength + - 147 2 + 159 2 total flux tracklength - 147 2 + 159 2 total total tracklength - 147 2 + 159 2 total flux - tracklength + analog - 147 2 + 159 5 6 total - total - tracklength + scatter + analog - 147 2 - total - flux - analog - - - 147 5 - total - scatter-1 - analog - - - 147 2 + 159 2 total flux tracklength - - 147 2 + + 159 2 total total tracklength - - 147 2 + + 159 2 total flux analog - - 147 5 + + 159 5 6 total - nu-scatter-1 + nu-scatter analog + + 159 2 + total + flux + tracklength + + + 159 2 + total + absorption + tracklength + - 147 2 + 159 2 total flux tracklength - 147 2 + 159 2 total absorption tracklength - 147 2 + 159 2 + total + fission + tracklength + + + 159 2 total flux tracklength - - 147 2 - total - absorption - tracklength - - 147 2 + 159 2 total fission tracklength - 147 2 + 159 2 total flux tracklength - 147 2 + 159 2 total - fission + nu-fission tracklength - 147 2 + 159 2 total flux tracklength - 147 2 + 159 2 total - nu-fission + kappa-fission tracklength - 147 2 + 159 2 total flux tracklength - 147 2 - total - kappa-fission - tracklength - - - 147 2 - total - flux - tracklength - - - 147 2 + 159 2 total scatter tracklength + + 159 2 + total + flux + analog + + + 159 2 + total + nu-scatter + analog + - 147 2 + 159 2 total flux analog - 147 2 + 159 2 5 28 total - nu-scatter + scatter analog - 147 2 + 159 2 total flux analog - 147 2 5 - total - scatter-P3 - analog - - - 147 2 - total - flux - analog - - - 147 2 5 - total - nu-scatter-P3 - analog - - - 147 2 5 + 159 2 5 28 total nu-scatter analog - - 147 2 5 + + 159 2 5 + total + nu-scatter + analog + + + 159 2 5 total scatter analog + + 159 2 + total + flux + analog + + + 159 2 5 + total + nu-fission + analog + - 147 2 + 159 2 5 total - flux + scatter analog - 147 2 5 - total - nu-fission - analog - - - 147 2 5 - total - scatter - analog - - - 147 2 + 159 2 total flux tracklength - - 147 2 + + 159 2 total scatter tracklength + + 159 2 5 28 + total + scatter + analog + + + 159 2 + total + flux + tracklength + - 147 2 5 - total - scatter-P3 - analog - - - 147 2 - total - flux - tracklength - - - 147 2 + 159 2 total scatter tracklength - - 147 2 5 + + 159 2 5 28 total - scatter-P3 + scatter + analog + + + 159 2 5 + total + nu-scatter + analog + + + 159 52 + total + nu-fission analog - 147 2 5 + 159 5 total - nu-scatter-0 + nu-fission analog - 147 2 5 + 159 52 total - scatter-0 + prompt-nu-fission analog - 147 46 + 159 5 total - nu-fission + prompt-nu-fission analog - 147 5 - total - nu-fission - analog - - - 147 46 - total - prompt-nu-fission - analog - - - 147 5 - total - prompt-nu-fission - analog - - - 147 2 + 159 2 total flux tracklength - - 147 2 + + 159 2 total inverse-velocity tracklength - - 147 2 + + 159 2 total flux tracklength - - 147 2 + + 159 2 total prompt-nu-fission tracklength + + 159 2 + total + flux + analog + + + 159 2 5 + total + prompt-nu-fission + analog + + + 159 2 + total + flux + tracklength + - 147 2 + 159 65 2 total - flux - analog + delayed-nu-fission + tracklength - 147 2 5 + 159 65 52 total - prompt-nu-fission + delayed-nu-fission analog - 147 2 + 159 65 5 total - flux - tracklength + delayed-nu-fission + analog - 147 59 2 - total - delayed-nu-fission - tracklength - - - 147 59 46 - total - delayed-nu-fission - analog - - - 147 59 5 - total - delayed-nu-fission - analog - - - 147 2 + 159 2 total nu-fission tracklength - - 147 59 2 + + 159 65 2 total delayed-nu-fission tracklength - - 147 59 2 + + 159 65 2 total delayed-nu-fission tracklength - - 147 59 2 + + 159 65 2 total decay-rate tracklength - - 147 2 + + 159 2 total flux analog - - 147 59 2 5 + + 159 65 2 5 total delayed-nu-fission analog diff --git a/tests/regression_tests/mgxs_library_no_nuclides/results_true.dat b/tests/regression_tests/mgxs_library_no_nuclides/results_true.dat index 291c87dde9..d4c87378e8 100644 --- a/tests/regression_tests/mgxs_library_no_nuclides/results_true.dat +++ b/tests/regression_tests/mgxs_library_no_nuclides/results_true.dat @@ -28,40 +28,40 @@ material group in nuclide mean std. dev. 1 1 1 total 0.385188 0.026946 0 1 2 total 0.412389 0.015425 - material group in group out nuclide moment mean std. dev. -12 1 1 1 total P0 0.384199 0.027001 -13 1 1 1 total P1 0.051870 0.006983 -14 1 1 1 total P2 0.020069 0.002846 -15 1 1 1 total P3 0.009478 0.002234 -8 1 1 2 total P0 0.000989 0.000482 -9 1 1 2 total P1 -0.000207 0.000149 -10 1 1 2 total P2 -0.000103 0.000184 -11 1 1 2 total P3 0.000234 0.000128 -4 1 2 1 total P0 0.000925 0.000925 -5 1 2 1 total P1 -0.000768 0.000768 -6 1 2 1 total P2 0.000494 0.000494 -7 1 2 1 total P3 -0.000171 0.000172 -0 1 2 2 total P0 0.411465 0.015245 -1 1 2 2 total P1 0.016482 0.004502 -2 1 2 2 total P2 0.006371 0.010551 -3 1 2 2 total P3 -0.010499 0.010438 - material group in group out nuclide moment mean std. dev. -12 1 1 1 total P0 0.384199 0.027001 -13 1 1 1 total P1 0.051870 0.006983 -14 1 1 1 total P2 0.020069 0.002846 -15 1 1 1 total P3 0.009478 0.002234 -8 1 1 2 total P0 0.000989 0.000482 -9 1 1 2 total P1 -0.000207 0.000149 -10 1 1 2 total P2 -0.000103 0.000184 -11 1 1 2 total P3 0.000234 0.000128 -4 1 2 1 total P0 0.000925 0.000925 -5 1 2 1 total P1 -0.000768 0.000768 -6 1 2 1 total P2 0.000494 0.000494 -7 1 2 1 total P3 -0.000171 0.000172 -0 1 2 2 total P0 0.411465 0.015245 -1 1 2 2 total P1 0.016482 0.004502 -2 1 2 2 total P2 0.006371 0.010551 -3 1 2 2 total P3 -0.010499 0.010438 + material group in group out legendre nuclide mean std. dev. +12 1 1 1 P0 total 0.384199 0.027001 +13 1 1 1 P1 total 0.051870 0.006983 +14 1 1 1 P2 total 0.020069 0.002846 +15 1 1 1 P3 total 0.009478 0.002234 +8 1 1 2 P0 total 0.000989 0.000482 +9 1 1 2 P1 total -0.000207 0.000149 +10 1 1 2 P2 total -0.000103 0.000184 +11 1 1 2 P3 total 0.000234 0.000128 +4 1 2 1 P0 total 0.000925 0.000925 +5 1 2 1 P1 total -0.000768 0.000768 +6 1 2 1 P2 total 0.000494 0.000494 +7 1 2 1 P3 total -0.000171 0.000172 +0 1 2 2 P0 total 0.411465 0.015245 +1 1 2 2 P1 total 0.016482 0.004502 +2 1 2 2 P2 total 0.006371 0.010551 +3 1 2 2 P3 total -0.010499 0.010438 + material group in group out legendre nuclide mean std. dev. +12 1 1 1 P0 total 0.384199 0.027001 +13 1 1 1 P1 total 0.051870 0.006983 +14 1 1 1 P2 total 0.020069 0.002846 +15 1 1 1 P3 total 0.009478 0.002234 +8 1 1 2 P0 total 0.000989 0.000482 +9 1 1 2 P1 total -0.000207 0.000149 +10 1 1 2 P2 total -0.000103 0.000184 +11 1 1 2 P3 total 0.000234 0.000128 +4 1 2 1 P0 total 0.000925 0.000925 +5 1 2 1 P1 total -0.000768 0.000768 +6 1 2 1 P2 total 0.000494 0.000494 +7 1 2 1 P3 total -0.000171 0.000172 +0 1 2 2 P0 total 0.411465 0.015245 +1 1 2 2 P1 total 0.016482 0.004502 +2 1 2 2 P2 total 0.006371 0.010551 +3 1 2 2 P3 total -0.010499 0.010438 material group in group out nuclide mean std. dev. 3 1 1 1 total 1.0 0.078516 2 1 1 2 total 1.0 0.687184 @@ -77,40 +77,40 @@ 2 1 1 2 total 0.002567 0.001256 1 1 2 1 total 0.002242 0.002243 0 1 2 2 total 0.997758 0.041053 - material group in group out nuclide moment mean std. dev. -12 1 1 1 total P0 0.386423 0.036629 -13 1 1 1 total P1 0.052170 0.007767 -14 1 1 1 total P2 0.020185 0.003138 -15 1 1 1 total P3 0.009533 0.002327 -8 1 1 2 total P0 0.000995 0.000489 -9 1 1 2 total P1 -0.000208 0.000150 -10 1 1 2 total P2 -0.000104 0.000186 -11 1 1 2 total P3 0.000236 0.000130 -4 1 2 1 total P0 0.000887 0.000889 -5 1 2 1 total P1 -0.000737 0.000738 -6 1 2 1 total P2 0.000474 0.000475 -7 1 2 1 total P3 -0.000165 0.000165 -0 1 2 2 total P0 0.394772 0.029871 -1 1 2 2 total P1 0.015813 0.004443 -2 1 2 2 total P2 0.006113 0.010131 -3 1 2 2 total P3 -0.010073 0.010037 - material group in group out nuclide moment mean std. dev. -12 1 1 1 total P0 0.386423 0.047563 -13 1 1 1 total P1 0.052170 0.008781 -14 1 1 1 total P2 0.020185 0.003515 -15 1 1 1 total P3 0.009533 0.002444 -8 1 1 2 total P0 0.000995 0.000841 -9 1 1 2 total P1 -0.000208 0.000208 -10 1 1 2 total P2 -0.000104 0.000199 -11 1 1 2 total P3 0.000236 0.000208 -4 1 2 1 total P0 0.000887 0.001538 -5 1 2 1 total P1 -0.000737 0.001277 -6 1 2 1 total P2 0.000474 0.000821 -7 1 2 1 total P3 -0.000165 0.000285 -0 1 2 2 total P0 0.394772 0.033999 -1 1 2 2 total P1 0.015813 0.004491 -2 1 2 2 total P2 0.006113 0.010134 -3 1 2 2 total P3 -0.010073 0.010045 + material group in group out legendre nuclide mean std. dev. +12 1 1 1 P0 total 0.386423 0.036629 +13 1 1 1 P1 total 0.052170 0.007767 +14 1 1 1 P2 total 0.020185 0.003138 +15 1 1 1 P3 total 0.009533 0.002327 +8 1 1 2 P0 total 0.000995 0.000489 +9 1 1 2 P1 total -0.000208 0.000150 +10 1 1 2 P2 total -0.000104 0.000186 +11 1 1 2 P3 total 0.000236 0.000130 +4 1 2 1 P0 total 0.000887 0.000889 +5 1 2 1 P1 total -0.000737 0.000738 +6 1 2 1 P2 total 0.000474 0.000475 +7 1 2 1 P3 total -0.000165 0.000165 +0 1 2 2 P0 total 0.394772 0.029871 +1 1 2 2 P1 total 0.015813 0.004443 +2 1 2 2 P2 total 0.006113 0.010131 +3 1 2 2 P3 total -0.010073 0.010037 + material group in group out legendre nuclide mean std. dev. +12 1 1 1 P0 total 0.386423 0.047563 +13 1 1 1 P1 total 0.052170 0.008781 +14 1 1 1 P2 total 0.020185 0.003515 +15 1 1 1 P3 total 0.009533 0.002444 +8 1 1 2 P0 total 0.000995 0.000841 +9 1 1 2 P1 total -0.000208 0.000208 +10 1 1 2 P2 total -0.000104 0.000199 +11 1 1 2 P3 total 0.000236 0.000208 +4 1 2 1 P0 total 0.000887 0.001538 +5 1 2 1 P1 total -0.000737 0.001277 +6 1 2 1 P2 total 0.000474 0.000821 +7 1 2 1 P3 total -0.000165 0.000285 +0 1 2 2 P0 total 0.394772 0.033999 +1 1 2 2 P1 total 0.015813 0.004491 +2 1 2 2 P2 total 0.006113 0.010134 +3 1 2 2 P3 total -0.010073 0.010045 material group out nuclide mean std. dev. 1 1 1 total 1.0 0.046071 0 1 2 total 0.0 0.000000 @@ -235,40 +235,40 @@ material group in nuclide mean std. dev. 1 2 1 total 0.310121 0.033788 0 2 2 total 0.296264 0.043792 - material group in group out nuclide moment mean std. dev. -12 2 1 1 total P0 0.310121 0.033788 -13 2 1 1 total P1 0.038230 0.008484 -14 2 1 1 total P2 0.020745 0.004696 -15 2 1 1 total P3 0.007964 0.003732 -8 2 1 2 total P0 0.000000 0.000000 -9 2 1 2 total P1 0.000000 0.000000 -10 2 1 2 total P2 0.000000 0.000000 -11 2 1 2 total P3 0.000000 0.000000 -4 2 2 1 total P0 0.000000 0.000000 -5 2 2 1 total P1 0.000000 0.000000 -6 2 2 1 total P2 0.000000 0.000000 -7 2 2 1 total P3 0.000000 0.000000 -0 2 2 2 total P0 0.296264 0.043792 -1 2 2 2 total P1 -0.011214 0.016180 -2 2 2 2 total P2 0.008837 0.011504 -3 2 2 2 total P3 -0.003270 0.007329 - material group in group out nuclide moment mean std. dev. -12 2 1 1 total P0 0.310121 0.033788 -13 2 1 1 total P1 0.038230 0.008484 -14 2 1 1 total P2 0.020745 0.004696 -15 2 1 1 total P3 0.007964 0.003732 -8 2 1 2 total P0 0.000000 0.000000 -9 2 1 2 total P1 0.000000 0.000000 -10 2 1 2 total P2 0.000000 0.000000 -11 2 1 2 total P3 0.000000 0.000000 -4 2 2 1 total P0 0.000000 0.000000 -5 2 2 1 total P1 0.000000 0.000000 -6 2 2 1 total P2 0.000000 0.000000 -7 2 2 1 total P3 0.000000 0.000000 -0 2 2 2 total P0 0.296264 0.043792 -1 2 2 2 total P1 -0.011214 0.016180 -2 2 2 2 total P2 0.008837 0.011504 -3 2 2 2 total P3 -0.003270 0.007329 + material group in group out legendre nuclide mean std. dev. +12 2 1 1 P0 total 0.310121 0.033788 +13 2 1 1 P1 total 0.038230 0.008484 +14 2 1 1 P2 total 0.020745 0.004696 +15 2 1 1 P3 total 0.007964 0.003732 +8 2 1 2 P0 total 0.000000 0.000000 +9 2 1 2 P1 total 0.000000 0.000000 +10 2 1 2 P2 total 0.000000 0.000000 +11 2 1 2 P3 total 0.000000 0.000000 +4 2 2 1 P0 total 0.000000 0.000000 +5 2 2 1 P1 total 0.000000 0.000000 +6 2 2 1 P2 total 0.000000 0.000000 +7 2 2 1 P3 total 0.000000 0.000000 +0 2 2 2 P0 total 0.296264 0.043792 +1 2 2 2 P1 total -0.011214 0.016180 +2 2 2 2 P2 total 0.008837 0.011504 +3 2 2 2 P3 total -0.003270 0.007329 + material group in group out legendre nuclide mean std. dev. +12 2 1 1 P0 total 0.310121 0.033788 +13 2 1 1 P1 total 0.038230 0.008484 +14 2 1 1 P2 total 0.020745 0.004696 +15 2 1 1 P3 total 0.007964 0.003732 +8 2 1 2 P0 total 0.000000 0.000000 +9 2 1 2 P1 total 0.000000 0.000000 +10 2 1 2 P2 total 0.000000 0.000000 +11 2 1 2 P3 total 0.000000 0.000000 +4 2 2 1 P0 total 0.000000 0.000000 +5 2 2 1 P1 total 0.000000 0.000000 +6 2 2 1 P2 total 0.000000 0.000000 +7 2 2 1 P3 total 0.000000 0.000000 +0 2 2 2 P0 total 0.296264 0.043792 +1 2 2 2 P1 total -0.011214 0.016180 +2 2 2 2 P2 total 0.008837 0.011504 +3 2 2 2 P3 total -0.003270 0.007329 material group in group out nuclide mean std. dev. 3 2 1 1 total 1.0 0.108779 2 2 1 2 total 0.0 0.000000 @@ -284,40 +284,40 @@ 2 2 1 2 total 0.0 0.000000 1 2 2 1 total 0.0 0.000000 0 2 2 2 total 1.0 0.142427 - material group in group out nuclide moment mean std. dev. -12 2 1 1 total P0 0.312163 0.037253 -13 2 1 1 total P1 0.038481 0.008743 -14 2 1 1 total P2 0.020882 0.004835 -15 2 1 1 total P3 0.008017 0.003776 -8 2 1 2 total P0 0.000000 0.000000 -9 2 1 2 total P1 0.000000 0.000000 -10 2 1 2 total P2 0.000000 0.000000 -11 2 1 2 total P3 0.000000 0.000000 -4 2 2 1 total P0 0.000000 0.000000 -5 2 2 1 total P1 0.000000 0.000000 -6 2 2 1 total P2 0.000000 0.000000 -7 2 2 1 total P3 0.000000 0.000000 -0 2 2 2 total P0 0.295421 0.050236 -1 2 2 2 total P1 -0.011182 0.016162 -2 2 2 2 total P2 0.008811 0.011495 -3 2 2 2 total P3 -0.003261 0.007313 - material group in group out nuclide moment mean std. dev. -12 2 1 1 total P0 0.312163 0.050407 -13 2 1 1 total P1 0.038481 0.009693 -14 2 1 1 total P2 0.020882 0.005342 -15 2 1 1 total P3 0.008017 0.003876 -8 2 1 2 total P0 0.000000 0.000000 -9 2 1 2 total P1 0.000000 0.000000 -10 2 1 2 total P2 0.000000 0.000000 -11 2 1 2 total P3 0.000000 0.000000 -4 2 2 1 total P0 0.000000 0.000000 -5 2 2 1 total P1 0.000000 0.000000 -6 2 2 1 total P2 0.000000 0.000000 -7 2 2 1 total P3 0.000000 0.000000 -0 2 2 2 total P0 0.295421 0.065529 -1 2 2 2 total P1 -0.011182 0.016240 -2 2 2 2 total P2 0.008811 0.011563 -3 2 2 2 total P3 -0.003261 0.007328 + material group in group out legendre nuclide mean std. dev. +12 2 1 1 P0 total 0.312163 0.037253 +13 2 1 1 P1 total 0.038481 0.008743 +14 2 1 1 P2 total 0.020882 0.004835 +15 2 1 1 P3 total 0.008017 0.003776 +8 2 1 2 P0 total 0.000000 0.000000 +9 2 1 2 P1 total 0.000000 0.000000 +10 2 1 2 P2 total 0.000000 0.000000 +11 2 1 2 P3 total 0.000000 0.000000 +4 2 2 1 P0 total 0.000000 0.000000 +5 2 2 1 P1 total 0.000000 0.000000 +6 2 2 1 P2 total 0.000000 0.000000 +7 2 2 1 P3 total 0.000000 0.000000 +0 2 2 2 P0 total 0.295421 0.050236 +1 2 2 2 P1 total -0.011182 0.016162 +2 2 2 2 P2 total 0.008811 0.011495 +3 2 2 2 P3 total -0.003261 0.007313 + material group in group out legendre nuclide mean std. dev. +12 2 1 1 P0 total 0.312163 0.050407 +13 2 1 1 P1 total 0.038481 0.009693 +14 2 1 1 P2 total 0.020882 0.005342 +15 2 1 1 P3 total 0.008017 0.003876 +8 2 1 2 P0 total 0.000000 0.000000 +9 2 1 2 P1 total 0.000000 0.000000 +10 2 1 2 P2 total 0.000000 0.000000 +11 2 1 2 P3 total 0.000000 0.000000 +4 2 2 1 P0 total 0.000000 0.000000 +5 2 2 1 P1 total 0.000000 0.000000 +6 2 2 1 P2 total 0.000000 0.000000 +7 2 2 1 P3 total 0.000000 0.000000 +0 2 2 2 P0 total 0.295421 0.065529 +1 2 2 2 P1 total -0.011182 0.016240 +2 2 2 2 P2 total 0.008811 0.011563 +3 2 2 2 P3 total -0.003261 0.007328 material group out nuclide mean std. dev. 1 2 1 total 0.0 0.0 0 2 2 total 0.0 0.0 @@ -442,40 +442,40 @@ material group in nuclide mean std. dev. 1 3 1 total 0.671269 0.026186 0 3 2 total 2.035388 0.258060 - material group in group out nuclide moment mean std. dev. -12 3 1 1 total P0 0.639901 0.024709 -13 3 1 1 total P1 0.381167 0.016243 -14 3 1 1 total P2 0.152392 0.008156 -15 3 1 1 total P3 0.009148 0.003889 -8 3 1 2 total P0 0.031368 0.001728 -9 3 1 2 total P1 0.008758 0.000926 -10 3 1 2 total P2 -0.002568 0.001014 -11 3 1 2 total P3 -0.003785 0.000817 -4 3 2 1 total P0 0.000443 0.000445 -5 3 2 1 total P1 0.000400 0.000401 -6 3 2 1 total P2 0.000320 0.000321 -7 3 2 1 total P3 0.000214 0.000215 -0 3 2 2 total P0 2.034945 0.257800 -1 3 2 2 total P1 0.509940 0.051236 -2 3 2 2 total P2 0.111175 0.013020 -3 3 2 2 total P3 0.024988 0.008312 - material group in group out nuclide moment mean std. dev. -12 3 1 1 total P0 0.639901 0.024709 -13 3 1 1 total P1 0.381167 0.016243 -14 3 1 1 total P2 0.152392 0.008156 -15 3 1 1 total P3 0.009148 0.003889 -8 3 1 2 total P0 0.031368 0.001728 -9 3 1 2 total P1 0.008758 0.000926 -10 3 1 2 total P2 -0.002568 0.001014 -11 3 1 2 total P3 -0.003785 0.000817 -4 3 2 1 total P0 0.000443 0.000445 -5 3 2 1 total P1 0.000400 0.000401 -6 3 2 1 total P2 0.000320 0.000321 -7 3 2 1 total P3 0.000214 0.000215 -0 3 2 2 total P0 2.034945 0.257800 -1 3 2 2 total P1 0.509940 0.051236 -2 3 2 2 total P2 0.111175 0.013020 -3 3 2 2 total P3 0.024988 0.008312 + material group in group out legendre nuclide mean std. dev. +12 3 1 1 P0 total 0.639901 0.024709 +13 3 1 1 P1 total 0.381167 0.016243 +14 3 1 1 P2 total 0.152392 0.008156 +15 3 1 1 P3 total 0.009148 0.003889 +8 3 1 2 P0 total 0.031368 0.001728 +9 3 1 2 P1 total 0.008758 0.000926 +10 3 1 2 P2 total -0.002568 0.001014 +11 3 1 2 P3 total -0.003785 0.000817 +4 3 2 1 P0 total 0.000443 0.000445 +5 3 2 1 P1 total 0.000400 0.000401 +6 3 2 1 P2 total 0.000320 0.000321 +7 3 2 1 P3 total 0.000214 0.000215 +0 3 2 2 P0 total 2.034945 0.257800 +1 3 2 2 P1 total 0.509940 0.051236 +2 3 2 2 P2 total 0.111175 0.013020 +3 3 2 2 P3 total 0.024988 0.008312 + material group in group out legendre nuclide mean std. dev. +12 3 1 1 P0 total 0.639901 0.024709 +13 3 1 1 P1 total 0.381167 0.016243 +14 3 1 1 P2 total 0.152392 0.008156 +15 3 1 1 P3 total 0.009148 0.003889 +8 3 1 2 P0 total 0.031368 0.001728 +9 3 1 2 P1 total 0.008758 0.000926 +10 3 1 2 P2 total -0.002568 0.001014 +11 3 1 2 P3 total -0.003785 0.000817 +4 3 2 1 P0 total 0.000443 0.000445 +5 3 2 1 P1 total 0.000400 0.000401 +6 3 2 1 P2 total 0.000320 0.000321 +7 3 2 1 P3 total 0.000214 0.000215 +0 3 2 2 P0 total 2.034945 0.257800 +1 3 2 2 P1 total 0.509940 0.051236 +2 3 2 2 P2 total 0.111175 0.013020 +3 3 2 2 P3 total 0.024988 0.008312 material group in group out nuclide mean std. dev. 3 3 1 1 total 1.0 0.038609 2 3 1 2 total 1.0 0.067667 @@ -491,40 +491,40 @@ 2 3 1 2 total 0.046729 0.002547 1 3 2 1 total 0.000218 0.000219 0 3 2 2 total 0.999782 0.135885 - material group in group out nuclide moment mean std. dev. -12 3 1 1 total P0 0.632859 0.038142 -13 3 1 1 total P1 0.376973 0.023715 -14 3 1 1 total P2 0.150715 0.010664 -15 3 1 1 total P3 0.009047 0.003868 -8 3 1 2 total P0 0.031023 0.002232 -9 3 1 2 total P1 0.008661 0.000999 -10 3 1 2 total P2 -0.002540 0.001010 -11 3 1 2 total P3 -0.003743 0.000826 -4 3 2 1 total P0 0.000440 0.000445 -5 3 2 1 total P1 0.000397 0.000401 -6 3 2 1 total P2 0.000317 0.000321 -7 3 2 1 total P3 0.000212 0.000215 -0 3 2 2 total P0 2.020256 0.352194 -1 3 2 2 total P1 0.506260 0.079140 -2 3 2 2 total P2 0.110372 0.018488 -3 3 2 2 total P3 0.024808 0.008771 - material group in group out nuclide moment mean std. dev. -12 3 1 1 total P0 0.632859 0.045297 -13 3 1 1 total P1 0.376973 0.027825 -14 3 1 1 total P2 0.150715 0.012148 -15 3 1 1 total P3 0.009047 0.003884 -8 3 1 2 total P0 0.031023 0.003064 -9 3 1 2 total P1 0.008661 0.001159 -10 3 1 2 total P2 -0.002540 0.001024 -11 3 1 2 total P3 -0.003743 0.000864 -4 3 2 1 total P0 0.000440 0.000765 -5 3 2 1 total P1 0.000397 0.000690 -6 3 2 1 total P2 0.000317 0.000551 -7 3 2 1 total P3 0.000212 0.000369 -0 3 2 2 total P0 2.020256 0.446601 -1 3 2 2 total P1 0.506260 0.104875 -2 3 2 2 total P2 0.110372 0.023809 -3 3 2 2 total P3 0.024808 0.009397 + material group in group out legendre nuclide mean std. dev. +12 3 1 1 P0 total 0.632859 0.038142 +13 3 1 1 P1 total 0.376973 0.023715 +14 3 1 1 P2 total 0.150715 0.010664 +15 3 1 1 P3 total 0.009047 0.003868 +8 3 1 2 P0 total 0.031023 0.002232 +9 3 1 2 P1 total 0.008661 0.000999 +10 3 1 2 P2 total -0.002540 0.001010 +11 3 1 2 P3 total -0.003743 0.000826 +4 3 2 1 P0 total 0.000440 0.000445 +5 3 2 1 P1 total 0.000397 0.000401 +6 3 2 1 P2 total 0.000317 0.000321 +7 3 2 1 P3 total 0.000212 0.000215 +0 3 2 2 P0 total 2.020256 0.352194 +1 3 2 2 P1 total 0.506260 0.079140 +2 3 2 2 P2 total 0.110372 0.018488 +3 3 2 2 P3 total 0.024808 0.008771 + material group in group out legendre nuclide mean std. dev. +12 3 1 1 P0 total 0.632859 0.045297 +13 3 1 1 P1 total 0.376973 0.027825 +14 3 1 1 P2 total 0.150715 0.012148 +15 3 1 1 P3 total 0.009047 0.003884 +8 3 1 2 P0 total 0.031023 0.003064 +9 3 1 2 P1 total 0.008661 0.001159 +10 3 1 2 P2 total -0.002540 0.001024 +11 3 1 2 P3 total -0.003743 0.000864 +4 3 2 1 P0 total 0.000440 0.000765 +5 3 2 1 P1 total 0.000397 0.000690 +6 3 2 1 P2 total 0.000317 0.000551 +7 3 2 1 P3 total 0.000212 0.000369 +0 3 2 2 P0 total 2.020256 0.446601 +1 3 2 2 P1 total 0.506260 0.104875 +2 3 2 2 P2 total 0.110372 0.023809 +3 3 2 2 P3 total 0.024808 0.009397 material group out nuclide mean std. dev. 1 3 1 total 0.0 0.0 0 3 2 total 0.0 0.0 diff --git a/tests/regression_tests/mgxs_library_nuclides/inputs_true.dat b/tests/regression_tests/mgxs_library_nuclides/inputs_true.dat index b720bfcbba..f859d5f3ac 100644 --- a/tests/regression_tests/mgxs_library_nuclides/inputs_true.dat +++ b/tests/regression_tests/mgxs_library_nuclides/inputs_true.dat @@ -59,13 +59,19 @@ 0.0 0.625 20000000.0 - + + 1 + + + 3 + + 0.0 20000000.0 - + 2 - + 3 @@ -99,9 +105,9 @@ analog - 1 5 + 1 5 6 U234 U235 U238 O16 - scatter-1 + scatter analog @@ -123,9 +129,9 @@ analog - 1 5 + 1 5 6 U234 U235 U238 O16 - nu-scatter-1 + nu-scatter analog @@ -225,9 +231,9 @@ analog - 1 2 5 + 1 2 5 28 U234 U235 U238 O16 - scatter-P3 + scatter analog @@ -237,9 +243,9 @@ analog - 1 2 5 + 1 2 5 28 U234 U235 U238 O16 - nu-scatter-P3 + nu-scatter analog @@ -285,9 +291,9 @@ tracklength - 1 2 5 + 1 2 5 28 U234 U235 U238 O16 - scatter-P3 + scatter analog @@ -303,703 +309,685 @@ tracklength - 1 2 5 + 1 2 5 28 U234 U235 U238 O16 - scatter-P3 + scatter analog 1 2 5 U234 U235 U238 O16 - nu-scatter-0 + nu-scatter analog - 1 2 5 + 1 52 U234 U235 U238 O16 - scatter-0 + nu-fission analog - 1 46 + 1 5 U234 U235 U238 O16 nu-fission analog - 1 5 + 1 52 U234 U235 U238 O16 - nu-fission + prompt-nu-fission analog - 1 46 + 1 5 U234 U235 U238 O16 prompt-nu-fission analog - 1 5 - U234 U235 U238 O16 - prompt-nu-fission - analog - - 1 2 total flux tracklength - + 1 2 U234 U235 U238 O16 inverse-velocity tracklength - + 1 2 total flux tracklength - + 1 2 U234 U235 U238 O16 prompt-nu-fission tracklength - + 1 2 total flux analog - + 1 2 5 U234 U235 U238 O16 prompt-nu-fission analog - - 57 2 + + 63 2 total flux tracklength + + 63 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + total + tracklength + - 57 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - total + 63 2 + total + flux tracklength - 57 2 - total - flux + 63 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + total tracklength - 57 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - total - tracklength - - - 57 2 + 63 2 total flux analog + + 63 5 6 + Zr90 Zr91 Zr92 Zr94 Zr96 + scatter + analog + - 57 5 - Zr90 Zr91 Zr92 Zr94 Zr96 - scatter-1 - analog - - - 57 2 + 63 2 total flux tracklength - - 57 2 + + 63 2 Zr90 Zr91 Zr92 Zr94 Zr96 total tracklength - - 57 2 + + 63 2 total flux analog + + 63 5 6 + Zr90 Zr91 Zr92 Zr94 Zr96 + nu-scatter + analog + - 57 5 - Zr90 Zr91 Zr92 Zr94 Zr96 - nu-scatter-1 - analog - - - 57 2 + 63 2 total flux tracklength + + 63 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + absorption + tracklength + - 57 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - absorption + 63 2 + total + flux tracklength - 57 2 - total - flux - tracklength - - - 57 2 + 63 2 Zr90 Zr91 Zr92 Zr94 Zr96 absorption tracklength - - 57 2 + + 63 2 Zr90 Zr91 Zr92 Zr94 Zr96 fission tracklength + + 63 2 + total + flux + tracklength + - 57 2 - total - flux - tracklength - - - 57 2 + 63 2 Zr90 Zr91 Zr92 Zr94 Zr96 fission tracklength - - 57 2 + + 63 2 total flux tracklength - - 57 2 + + 63 2 Zr90 Zr91 Zr92 Zr94 Zr96 nu-fission tracklength - - 57 2 + + 63 2 total flux tracklength - - 57 2 + + 63 2 Zr90 Zr91 Zr92 Zr94 Zr96 kappa-fission tracklength - - 57 2 + + 63 2 total flux tracklength + + 63 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + scatter + tracklength + - 57 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - scatter - tracklength - - - 57 2 + 63 2 total flux analog + + 63 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + nu-scatter + analog + - 57 2 - Zr90 Zr91 Zr92 Zr94 Zr96 - nu-scatter + 63 2 + total + flux analog - 57 2 - total - flux + 63 2 5 28 + Zr90 Zr91 Zr92 Zr94 Zr96 + scatter analog - 57 2 5 - Zr90 Zr91 Zr92 Zr94 Zr96 - scatter-P3 - analog - - - 57 2 + 63 2 total flux analog - - 57 2 5 - Zr90 Zr91 Zr92 Zr94 Zr96 - nu-scatter-P3 - analog - - - 57 2 5 + + 63 2 5 28 Zr90 Zr91 Zr92 Zr94 Zr96 nu-scatter analog - - 57 2 5 + + 63 2 5 + Zr90 Zr91 Zr92 Zr94 Zr96 + nu-scatter + analog + + + 63 2 5 Zr90 Zr91 Zr92 Zr94 Zr96 scatter analog + + 63 2 + total + flux + analog + - 57 2 - total - flux + 63 2 5 + Zr90 Zr91 Zr92 Zr94 Zr96 + nu-fission analog - 57 2 5 + 63 2 5 Zr90 Zr91 Zr92 Zr94 Zr96 - nu-fission + scatter analog - 57 2 5 - Zr90 Zr91 Zr92 Zr94 Zr96 - scatter - analog - - - 57 2 + 63 2 total flux tracklength + + 63 2 + Zr90 Zr91 Zr92 Zr94 Zr96 + scatter + tracklength + - 57 2 + 63 2 5 28 Zr90 Zr91 Zr92 Zr94 Zr96 scatter - tracklength - - - 57 2 5 - Zr90 Zr91 Zr92 Zr94 Zr96 - scatter-P3 analog - - 57 2 + + 63 2 total flux tracklength - - 57 2 + + 63 2 Zr90 Zr91 Zr92 Zr94 Zr96 scatter tracklength - - 57 2 5 + + 63 2 5 28 Zr90 Zr91 Zr92 Zr94 Zr96 - scatter-P3 + scatter + analog + + + 63 2 5 + Zr90 Zr91 Zr92 Zr94 Zr96 + nu-scatter analog - 57 2 5 + 63 52 Zr90 Zr91 Zr92 Zr94 Zr96 - nu-scatter-0 + nu-fission analog - 57 2 5 + 63 5 Zr90 Zr91 Zr92 Zr94 Zr96 - scatter-0 + nu-fission analog - 57 46 + 63 52 Zr90 Zr91 Zr92 Zr94 Zr96 - nu-fission + prompt-nu-fission analog - 57 5 + 63 5 Zr90 Zr91 Zr92 Zr94 Zr96 - nu-fission + prompt-nu-fission analog - 57 46 - Zr90 Zr91 Zr92 Zr94 Zr96 - prompt-nu-fission - analog + 63 2 + total + flux + tracklength - 57 5 + 63 2 Zr90 Zr91 Zr92 Zr94 Zr96 - prompt-nu-fission - analog + inverse-velocity + tracklength - 57 2 + 63 2 total flux tracklength - 57 2 + 63 2 Zr90 Zr91 Zr92 Zr94 Zr96 - inverse-velocity + prompt-nu-fission tracklength - 57 2 + 63 2 total flux - tracklength + analog - 57 2 + 63 2 5 Zr90 Zr91 Zr92 Zr94 Zr96 prompt-nu-fission - tracklength + analog - 57 2 + 125 2 total flux - analog + tracklength - 57 2 5 - Zr90 Zr91 Zr92 Zr94 Zr96 - prompt-nu-fission - analog + 125 2 + H1 O16 B10 B11 + total + tracklength - 113 2 + 125 2 total flux tracklength - 113 2 + 125 2 H1 O16 B10 B11 total tracklength - 113 2 + 125 2 total flux - tracklength + analog - 113 2 + 125 5 6 H1 O16 B10 B11 - total - tracklength + scatter + analog - 113 2 - total - flux - analog - - - 113 5 - H1 O16 B10 B11 - scatter-1 - analog - - - 113 2 + 125 2 total flux tracklength - - 113 2 + + 125 2 H1 O16 B10 B11 total tracklength - - 113 2 + + 125 2 total flux analog - - 113 5 + + 125 5 6 H1 O16 B10 B11 - nu-scatter-1 + nu-scatter analog + + 125 2 + total + flux + tracklength + + + 125 2 + H1 O16 B10 B11 + absorption + tracklength + - 113 2 + 125 2 total flux tracklength - 113 2 + 125 2 H1 O16 B10 B11 absorption tracklength - 113 2 + 125 2 + H1 O16 B10 B11 + fission + tracklength + + + 125 2 total flux tracklength - - 113 2 - H1 O16 B10 B11 - absorption - tracklength - - 113 2 + 125 2 H1 O16 B10 B11 fission tracklength - 113 2 + 125 2 total flux tracklength - 113 2 + 125 2 H1 O16 B10 B11 - fission + nu-fission tracklength - 113 2 + 125 2 total flux tracklength - 113 2 + 125 2 H1 O16 B10 B11 - nu-fission + kappa-fission tracklength - 113 2 + 125 2 total flux tracklength - 113 2 - H1 O16 B10 B11 - kappa-fission - tracklength - - - 113 2 - total - flux - tracklength - - - 113 2 + 125 2 H1 O16 B10 B11 scatter tracklength + + 125 2 + total + flux + analog + + + 125 2 + H1 O16 B10 B11 + nu-scatter + analog + - 113 2 + 125 2 total flux analog - 113 2 + 125 2 5 28 H1 O16 B10 B11 - nu-scatter + scatter analog - 113 2 + 125 2 total flux analog - 113 2 5 - H1 O16 B10 B11 - scatter-P3 - analog - - - 113 2 - total - flux - analog - - - 113 2 5 - H1 O16 B10 B11 - nu-scatter-P3 - analog - - - 113 2 5 + 125 2 5 28 H1 O16 B10 B11 nu-scatter analog - - 113 2 5 + + 125 2 5 + H1 O16 B10 B11 + nu-scatter + analog + + + 125 2 5 H1 O16 B10 B11 scatter analog + + 125 2 + total + flux + analog + + + 125 2 5 + H1 O16 B10 B11 + nu-fission + analog + - 113 2 - total - flux + 125 2 5 + H1 O16 B10 B11 + scatter analog - 113 2 5 - H1 O16 B10 B11 - nu-fission - analog - - - 113 2 5 - H1 O16 B10 B11 - scatter - analog - - - 113 2 + 125 2 total flux tracklength - - 113 2 + + 125 2 H1 O16 B10 B11 scatter tracklength + + 125 2 5 28 + H1 O16 B10 B11 + scatter + analog + + + 125 2 + total + flux + tracklength + - 113 2 5 - H1 O16 B10 B11 - scatter-P3 - analog - - - 113 2 - total - flux - tracklength - - - 113 2 + 125 2 H1 O16 B10 B11 scatter tracklength - - 113 2 5 + + 125 2 5 28 H1 O16 B10 B11 - scatter-P3 + scatter + analog + + + 125 2 5 + H1 O16 B10 B11 + nu-scatter + analog + + + 125 52 + H1 O16 B10 B11 + nu-fission analog - 113 2 5 + 125 5 H1 O16 B10 B11 - nu-scatter-0 + nu-fission analog - 113 2 5 + 125 52 H1 O16 B10 B11 - scatter-0 + prompt-nu-fission analog - 113 46 + 125 5 H1 O16 B10 B11 - nu-fission + prompt-nu-fission analog - 113 5 - H1 O16 B10 B11 - nu-fission - analog - - - 113 46 - H1 O16 B10 B11 - prompt-nu-fission - analog - - - 113 5 - H1 O16 B10 B11 - prompt-nu-fission - analog - - - 113 2 + 125 2 total flux tracklength - - 113 2 + + 125 2 H1 O16 B10 B11 inverse-velocity tracklength - - 113 2 + + 125 2 total flux tracklength - - 113 2 + + 125 2 H1 O16 B10 B11 prompt-nu-fission tracklength - - 113 2 + + 125 2 total flux analog - - 113 2 5 + + 125 2 5 H1 O16 B10 B11 prompt-nu-fission analog diff --git a/tests/regression_tests/mgxs_library_nuclides/results_true.dat b/tests/regression_tests/mgxs_library_nuclides/results_true.dat index a0315ebbc6..577694cfa5 100644 --- a/tests/regression_tests/mgxs_library_nuclides/results_true.dat +++ b/tests/regression_tests/mgxs_library_nuclides/results_true.dat @@ -1 +1 @@ -174d1593a15de41e2aba88cc4c48fc3a400314b400571a0328dfdf7482df111b3ac9701dbd196d06668b49d3acaa67d766702db0942c03140e9e004942f7bdfd \ No newline at end of file +0edd3036c0b5b1eebad90dc8fba25006f14745ceb51dd109e70d0c610d66071f32128facdbc6d4e5077534fe96fff9a8e0ddeefb4a18d6c578f8e805bab7aa22 \ No newline at end of file diff --git a/tests/regression_tests/sourcepoint_restart/results_true.dat b/tests/regression_tests/sourcepoint_restart/results_true.dat index f726da973c..e210748bf6 100644 --- a/tests/regression_tests/sourcepoint_restart/results_true.dat +++ b/tests/regression_tests/sourcepoint_restart/results_true.dat @@ -3,62 +3,26 @@ k-combined: tally 1: 1.100000E-02 3.700000E-05 -1.307570E-03 -2.851451E-06 -1.564980E-03 -2.368303E-06 -3.138136E-03 -5.769887E-06 7.719234E-03 2.632582E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.976389E-04 8.858890E-08 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 8.816168E-04 7.772482E-07 1.000000E-03 1.000000E-06 -8.782909E-04 -7.713950E-07 -6.570925E-04 -4.317705E-07 -3.763366E-04 -1.416293E-07 0.000000E+00 0.000000E+00 2.100000E-02 1.150000E-04 -5.280651E-03 -1.222273E-05 -5.235520E-03 -1.202448E-05 -5.064093E-03 -1.787892E-05 1.071093E-02 2.748612E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 8.954045E-04 2.673851E-07 0.000000E+00 @@ -69,76 +33,28 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.100000E-02 2.130000E-04 -1.472240E-02 -5.500913E-05 -1.077445E-02 -2.987369E-05 -6.729425E-03 -1.249089E-05 1.363637E-02 4.345510E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.182717E-03 5.268980E-07 2.000000E-03 2.000000E-06 --1.367978E-03 -9.381191E-07 -4.071787E-04 -9.316064E-08 -4.394728E-04 -1.064342E-07 2.110880E-03 1.737594E-06 1.000000E-03 1.000000E-06 -9.347357E-04 -8.737309E-07 -8.105963E-04 -6.570664E-07 -6.396651E-04 -4.091714E-07 2.938723E-04 8.636091E-08 2.300000E-02 1.330000E-04 -1.081756E-02 -3.675127E-05 -2.530156E-03 -6.960955E-06 --1.930911E-03 -4.910249E-06 1.162826E-02 3.490280E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 8.957100E-04 4.402864E-07 0.000000E+00 @@ -149,36 +65,12 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.000000E-02 3.400000E-05 -4.086838E-03 -5.900874E-06 -1.812330E-03 -3.716159E-06 -2.138941E-03 -3.006748E-06 5.414128E-03 8.079333E-06 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.079654E-04 9.484271E-08 0.000000E+00 @@ -189,36 +81,12 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.700000E-02 7.100000E-05 -5.492922E-03 -1.013834E-05 -5.773309E-04 -3.561549E-06 -2.550048E-03 -3.841061E-06 8.048522E-03 1.583843E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.915762E-04 1.749885E-07 0.000000E+00 @@ -229,156 +97,60 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.700000E-02 1.670000E-04 -1.789444E-02 -8.260005E-05 -1.049872E-02 -2.774537E-05 -5.665111E-03 -8.560197E-06 1.100708E-02 2.835295E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.079654E-04 9.484271E-08 1.000000E-03 1.000000E-06 --2.856031E-04 -8.156913E-08 --3.776463E-04 -1.426167E-07 -3.701637E-04 -1.370211E-07 1.203064E-03 7.240967E-07 1.000000E-03 1.000000E-06 -9.705482E-04 -9.419638E-07 -9.129457E-04 -8.334699E-07 -8.297310E-04 -6.884535E-07 0.000000E+00 0.000000E+00 4.400000E-02 4.320000E-04 -1.141886E-02 -4.208707E-05 -9.213446E-03 -2.259305E-05 -9.177440E-03 -2.088782E-05 2.116869E-02 9.629046E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.501009E-03 6.405021E-07 1.000000E-03 1.000000E-06 -5.882614E-04 -3.460515E-07 -1.907719E-05 -3.639390E-10 --3.734703E-04 -1.394801E-07 1.472277E-03 9.506217E-07 2.000000E-03 2.000000E-06 -1.830192E-03 -1.679505E-06 -1.519257E-03 -1.189525E-06 -1.118506E-03 -7.332971E-07 2.977039E-04 8.862762E-08 2.000000E-02 1.080000E-04 -8.640372E-03 -1.765553E-05 -5.688468E-03 -1.038555E-05 -2.447898E-03 -4.466055E-06 8.949667E-03 1.935056E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.977039E-04 8.862762E-08 1.000000E-03 1.000000E-06 --3.805163E-04 -1.447926E-07 --2.828111E-04 -7.998210E-08 -4.330345E-04 -1.875189E-07 2.121142E-03 1.958355E-06 1.000000E-03 1.000000E-06 -9.260022E-04 -8.574800E-07 -7.862200E-04 -6.181419E-07 -5.960676E-04 -3.552966E-07 2.938723E-04 8.636091E-08 1.000000E-02 3.400000E-05 -4.840884E-03 -1.080853E-05 -3.402096E-03 -4.113972E-06 -1.374077E-03 -2.333511E-06 4.754696E-03 7.172309E-06 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.079654E-04 9.484271E-08 0.000000E+00 @@ -389,316 +161,124 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.300000E-02 3.700000E-05 -3.121167E-03 -2.465327E-06 -4.474559E-04 -1.522316E-06 -9.193982E-04 -3.247292E-06 5.365659E-03 6.567979E-06 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 6.056043E-04 1.834316E-07 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.977039E-04 8.862762E-08 1.000000E-03 1.000000E-06 -2.390376E-04 -5.713899E-08 --4.142915E-04 -1.716375E-07 --3.244105E-04 -1.052422E-07 0.000000E+00 0.000000E+00 2.900000E-02 2.230000E-04 -6.260565E-03 -1.544092E-05 -7.061757E-03 -2.562385E-05 -3.982541E-03 -7.962565E-06 1.486928E-02 5.763901E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.915762E-04 1.749885E-07 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.954078E-04 3.545105E-07 1.000000E-03 1.000000E-06 -9.938157E-04 -9.876697E-07 -9.815046E-04 -9.633512E-07 -9.631807E-04 -9.277170E-07 0.000000E+00 0.000000E+00 2.900000E-02 1.990000E-04 -1.237546E-02 -3.198261E-05 -8.287792E-03 -2.747313E-05 -3.254969E-03 -8.653294E-06 1.189702E-02 3.303340E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 9.033082E-04 2.720592E-07 3.000000E-03 3.000000E-06 -3.649225E-04 -1.756075E-06 -1.134112E-03 -8.940601E-07 --9.392028E-04 -5.872882E-07 1.484187E-03 9.721092E-07 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.500000E-02 1.390000E-04 -1.511834E-02 -5.459835E-05 -7.753447E-03 -2.291820E-05 -6.142979E-03 -1.359405E-05 1.043467E-02 2.526768E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.912057E-04 1.747704E-07 1.000000E-03 1.000000E-06 --1.098110E-04 -1.205846E-08 --4.819123E-04 -2.322395E-07 -1.614061E-04 -2.605194E-08 8.813114E-04 4.316251E-07 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.935668E-04 8.618147E-08 1.900000E-02 1.030000E-04 -1.035735E-02 -3.119381E-05 -6.483551E-03 -1.164471E-05 -3.924334E-03 -6.047577E-06 9.748672E-03 2.956633E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.079654E-04 9.484271E-08 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.935668E-04 8.618147E-08 1.000000E-03 1.000000E-06 -8.623139E-04 -7.435852E-07 -6.153778E-04 -3.786899E-07 -3.095388E-04 -9.581428E-08 0.000000E+00 0.000000E+00 7.000000E-03 1.500000E-05 -3.445754E-03 -3.819507E-06 -2.124056E-03 -1.976201E-06 -1.542203E-03 -1.531669E-06 4.135720E-03 4.532611E-06 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.874391E-04 1.725424E-07 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.079654E-04 9.484271E-08 1.000000E-03 1.000000E-06 -9.451745E-04 -8.933548E-07 -8.400323E-04 -7.056542E-07 -6.931788E-04 -4.804969E-07 0.000000E+00 0.000000E+00 2.600000E-02 1.560000E-04 -6.314886E-03 -1.168542E-05 -6.676680E-04 -9.930437E-06 --2.103247E-04 -2.815945E-07 1.249410E-02 3.501589E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 6.159309E-04 3.793709E-07 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.976389E-04 8.858890E-08 1.000000E-03 1.000000E-06 -9.514029E-04 -9.051675E-07 -8.577513E-04 -7.357373E-07 -7.258432E-04 -5.268483E-07 0.000000E+00 0.000000E+00 2.900000E-02 1.950000E-04 -8.928267E-03 -2.594547E-05 -4.752762E-03 -1.522378E-05 -5.376579E-03 -1.088620E-05 1.461148E-02 4.367385E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.912057E-04 1.747704E-07 0.000000E+00 @@ -709,66 +289,24 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.900000E-02 9.700000E-05 -1.046968E-02 -3.828445E-05 -6.704767E-03 -2.668260E-05 -2.659611E-03 -1.143518E-05 1.099391E-02 2.847330E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.935668E-04 8.618147E-08 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.655539E-03 2.523801E-06 3.000000E-03 5.000000E-06 -2.960960E-03 -4.866206E-06 -2.884206E-03 -4.608867E-06 -2.772329E-03 -4.247272E-06 2.976389E-04 8.858890E-08 6.000000E-03 8.000000E-06 -2.104495E-03 -2.749678E-06 -8.451272E-04 -9.362821E-07 -5.355137E-04 -3.419837E-07 2.683856E-03 1.512640E-06 0.000000E+00 @@ -777,128 +315,50 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.976389E-04 8.858890E-08 1.000000E-03 1.000000E-06 -9.374310E-04 -8.787769E-07 -8.181653E-04 -6.693944E-07 -6.533352E-04 -4.268468E-07 2.976389E-04 8.858890E-08 1.200000E-02 4.600000E-05 -9.302157E-04 -3.853850E-06 -1.874541E-03 -3.092623E-06 --1.511552E-03 -4.053466E-06 5.941985E-03 9.853870E-06 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.186548E-03 5.291647E-07 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.935668E-04 8.618147E-08 1.000000E-03 1.000000E-06 -9.893707E-04 -9.788543E-07 -9.682814E-04 -9.375689E-07 -9.370683E-04 -8.780970E-07 0.000000E+00 0.000000E+00 2.300000E-02 1.230000E-04 -5.099566E-03 -9.143616E-06 -4.738751E-03 -7.819254E-06 -3.929250E-03 -6.884420E-06 1.015650E-02 2.236950E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.977039E-04 8.862762E-08 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.912707E-04 1.748091E-07 2.000000E-03 2.000000E-06 -1.762035E-03 -1.552542E-06 -1.328812E-03 -8.839688E-07 -7.771806E-04 -3.049398E-07 0.000000E+00 0.000000E+00 3.100000E-02 2.250000E-04 -1.389831E-02 -5.927254E-05 -9.999959E-03 -3.379365E-05 -4.584291E-03 -1.665226E-05 1.729188E-02 6.078653E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.792523E-03 8.900697E-07 0.000000E+00 @@ -909,76 +369,28 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.700000E-02 7.100000E-05 -3.566805E-03 -2.049908E-05 -5.418617E-03 -7.496014E-06 -2.451897E-03 -2.115374E-06 7.760000E-03 1.634547E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.977039E-04 8.862762E-08 1.000000E-03 1.000000E-06 --7.119580E-04 -5.068842E-07 -2.603263E-04 -6.776977E-08 -1.657364E-04 -2.746855E-08 8.807004E-04 7.756332E-07 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.900000E-02 2.030000E-04 -6.527719E-03 -1.422798E-05 -1.560049E-03 -2.934829E-06 -1.548553E-03 -8.929308E-06 1.108618E-02 3.019577E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.174573E-03 8.619941E-07 0.000000E+00 @@ -989,76 +401,28 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.500000E-02 5.500000E-05 -2.209492E-03 -2.545503E-06 -5.991182E-03 -1.290780E-05 -1.772063E-03 -2.006265E-06 5.944486E-03 1.042417E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.079654E-04 9.484271E-08 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.190621E-03 8.859277E-07 2.000000E-03 2.000000E-06 -1.908405E-03 -1.821879E-06 -1.732819E-03 -1.508498E-06 -1.487670E-03 -1.131430E-06 0.000000E+00 0.000000E+00 2.600000E-02 1.460000E-04 -7.818547E-03 -3.176773E-05 -5.200193E-03 -1.419001E-05 -3.947828E-03 -8.417104E-06 9.232713E-03 1.900222E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.186919E-03 5.294603E-07 0.000000E+00 @@ -1069,116 +433,44 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.600000E-02 2.740000E-04 -9.407788E-03 -2.403566E-05 -4.480017E-03 -6.102099E-06 -5.941113E-03 -1.265337E-05 1.462273E-02 4.551798E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 6.056694E-04 1.834703E-07 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 8.807004E-04 7.756332E-07 1.000000E-03 1.000000E-06 -8.905295E-04 -7.930427E-07 -6.895641E-04 -4.754986E-07 -4.297756E-04 -1.847070E-07 0.000000E+00 0.000000E+00 1.200000E-02 3.000000E-05 -4.798420E-03 -7.171924E-06 -1.417651E-03 -4.997963E-06 -2.131704E-03 -3.253030E-06 7.754474E-03 1.333333E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.938723E-04 8.636091E-08 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.484382E-03 1.504223E-06 3.000000E-03 5.000000E-06 -2.760812E-03 -4.139104E-06 -2.336063E-03 -2.844690E-06 -1.817042E-03 -1.656152E-06 0.000000E+00 0.000000E+00 1.900000E-02 9.900000E-05 -7.385212E-03 -2.033270E-05 -6.336514E-03 -2.028060E-05 -3.967026E-03 -1.027239E-05 1.066281E-02 2.937590E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.976389E-04 8.858890E-08 0.000000E+00 @@ -1189,26 +481,8 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.000000E-03 3.000000E-06 -1.134842E-03 -1.040850E-06 -6.127525E-05 -3.988312E-07 -4.938488E-05 -2.738492E-07 1.484493E-03 9.722886E-07 0.000000E+00 @@ -1223,122 +497,44 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.300000E-02 1.650000E-04 -9.507197E-03 -3.773476E-05 -6.295609E-03 -2.127696E-05 -6.339840E-03 -1.601206E-05 1.065253E-02 3.447907E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.000000E-03 1.000000E-06 --1.117213E-04 -1.248165E-08 --4.812775E-04 -2.316281E-07 -1.640958E-04 -2.692743E-08 5.871336E-04 3.447259E-07 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.100000E-02 2.030000E-04 -1.194795E-02 -4.198084E-05 -8.484089E-03 -1.631808E-05 -5.880364E-03 -1.308096E-05 1.342551E-02 3.842917E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.915762E-04 1.749885E-07 1.000000E-03 1.000000E-06 --5.881991E-05 -3.459782E-09 --4.948103E-04 -2.448373E-07 -8.772111E-05 -7.694993E-09 5.871336E-04 3.447259E-07 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.900000E-02 8.700000E-05 -5.469796E-03 -1.029265E-05 -4.923561E-04 -2.403244E-06 -2.579361E-03 -5.814745E-06 8.693502E-03 1.682273E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.976389E-04 8.858890E-08 0.000000E+00 @@ -1349,26 +545,8 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 8.000000E-03 1.600000E-05 -5.411154E-03 -8.076329E-06 -3.145940E-03 -4.212660E-06 -2.637510E-03 -3.210372E-06 3.866943E-03 3.257876E-06 0.000000E+00 @@ -1377,48 +555,18 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.175489E-03 1.381775E-06 1.000000E-03 1.000000E-06 -7.809681E-04 -6.099112E-07 -4.148668E-04 -1.721145E-07 -1.935089E-05 -3.744570E-10 0.000000E+00 0.000000E+00 8.000000E-03 2.000000E-05 -3.721382E-03 -4.736982E-06 --1.037031E-04 -6.648392E-07 --5.996856E-04 -9.642316E-07 3.248622E-03 4.063213E-06 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.938723E-04 8.636091E-08 0.000000E+00 @@ -1429,36 +577,12 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.800000E-02 1.780000E-04 -1.190615E-02 -4.434442E-05 -7.332993E-03 -2.337416E-05 -6.867008E-03 -1.321552E-05 1.283876E-02 3.527487E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.954078E-04 3.545105E-07 0.000000E+00 @@ -1469,66 +593,24 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 4.000000E-02 3.880000E-04 -6.620484E-03 -3.751545E-05 -9.255367E-03 -1.963463E-05 -7.761524E-03 -1.694944E-05 1.659048E-02 7.200873E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.976389E-04 8.858890E-08 1.000000E-03 1.000000E-06 --5.273064E-04 -2.780520E-07 --8.292201E-05 -6.876059E-09 -4.244131E-04 -1.801265E-07 8.891500E-04 4.407165E-07 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.200000E-02 3.400000E-05 -5.905081E-03 -1.535048E-05 -3.856089E-03 -8.589511E-06 -3.244585E-03 -5.882222E-06 5.074320E-03 5.793165E-06 0.000000E+00 @@ -1543,32 +625,8 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 4.000000E-03 8.000000E-06 -1.520286E-03 -4.076900E-06 -2.191143E-03 -3.717004E-06 -1.161623E-03 -3.726099E-06 3.570375E-03 5.251426E-06 0.000000E+00 @@ -1583,42 +641,12 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 4.000000E-03 4.000000E-06 -3.379122E-03 -2.880429E-06 -2.320644E-03 -1.498759E-06 -1.119131E-03 -6.212863E-07 1.494579E-03 6.241235E-07 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.976389E-04 8.858890E-08 0.000000E+00 @@ -1629,76 +657,28 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.100000E-02 1.950000E-04 -1.338410E-02 -5.097757E-05 -6.794436E-03 -1.428226E-05 -3.939298E-03 -9.052046E-06 1.250316E-02 3.147175E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.953428E-04 1.772165E-07 1.000000E-03 1.000000E-06 --5.747626E-05 -3.303520E-09 --4.950447E-04 -2.450693E-07 -8.573970E-05 -7.351297E-09 5.954078E-04 3.545105E-07 1.000000E-03 1.000000E-06 -9.748367E-04 -9.503066E-07 -9.254598E-04 -8.564759E-07 -8.537292E-04 -7.288535E-07 0.000000E+00 0.000000E+00 2.600000E-02 1.800000E-04 -1.225587E-02 -3.757196E-05 -7.670283E-03 -2.316758E-05 -5.282346E-03 -1.407031E-05 1.162837E-02 3.241150E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.874391E-04 1.725424E-07 0.000000E+00 @@ -1709,66 +689,24 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.900000E-02 9.900000E-05 -7.244455E-03 -2.708286E-05 -4.601657E-03 -5.366244E-06 --1.675270E-03 -3.867377E-06 9.216754E-03 2.272207E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.079654E-04 9.484271E-08 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 6.159309E-04 3.793709E-07 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 6.000000E-03 1.000000E-05 -1.316884E-03 -2.894217E-06 -2.095957E-03 -1.439521E-06 -1.013831E-04 -8.405300E-07 2.404012E-03 1.641294E-06 0.000000E+00 @@ -1799,66 +737,12 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.500000E-02 6.300000E-05 -5.790211E-03 -1.210465E-05 -8.591246E-04 -1.950998E-06 -1.987991E-03 -4.703397E-06 6.572185E-03 9.479065E-06 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.954078E-04 3.545105E-07 0.000000E+00 @@ -1869,26 +753,8 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.900000E-02 1.030000E-04 -3.010784E-03 -6.984061E-06 -5.243839E-03 -8.093978E-06 --2.502286E-04 -2.564795E-06 7.760558E-03 1.654841E-05 0.000000E+00 @@ -1897,48 +763,18 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.935668E-04 8.618147E-08 1.000000E-03 1.000000E-06 -9.333938E-04 -8.712239E-07 -8.068359E-04 -6.509841E-07 -6.328968E-04 -4.005583E-07 0.000000E+00 0.000000E+00 1.800000E-02 1.220000E-04 -6.860987E-03 -2.966806E-05 -4.229750E-03 -1.617998E-05 -1.295452E-03 -8.613003E-07 7.815192E-03 2.039362E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.935668E-04 8.618147E-08 0.000000E+00 @@ -1965,50 +801,8 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.000000E-03 2.000000E-06 -1.502634E-03 -1.146555E-06 -7.198331E-04 -3.484978E-07 --3.426513E-05 -1.342349E-07 1.511030E-03 1.198310E-06 0.000000E+00 @@ -2023,32 +817,8 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.900000E-02 1.030000E-04 -3.892013E-03 -8.267134E-06 -3.385502E-03 -6.457947E-06 -4.380506E-03 -1.060881E-05 7.130794E-03 1.485134E-05 0.000000E+00 @@ -2057,78 +827,30 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 8.816168E-04 7.772482E-07 1.000000E-03 1.000000E-06 -9.951010E-04 -9.902260E-07 -9.853389E-04 -9.708928E-07 -9.707856E-04 -9.424246E-07 0.000000E+00 0.000000E+00 2.900000E-02 1.970000E-04 -4.944370E-03 -2.340271E-05 -3.891346E-03 -1.137205E-05 -5.738303E-03 -9.169816E-06 1.046961E-02 2.353870E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 6.056694E-04 1.834703E-07 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.203064E-03 7.240967E-07 2.000000E-03 2.000000E-06 -1.696621E-03 -1.449397E-06 -1.174096E-03 -7.548933E-07 -5.719051E-04 -3.184788E-07 0.000000E+00 0.000000E+00 1.600000E-02 5.400000E-05 -7.937805E-03 -1.353584E-05 -4.065443E-03 -5.658333E-06 -3.432476E-03 -3.530320E-06 6.546902E-03 9.343143E-06 0.000000E+00 @@ -2143,32 +865,8 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.000000E-03 2.000000E-06 -1.447007E-04 -7.721849E-07 -1.582773E-04 -4.841114E-08 -1.981705E-04 -2.166687E-07 9.135698E-04 4.679598E-07 0.000000E+00 @@ -2199,176 +897,56 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.000000E-02 2.600000E-05 -5.875085E-04 -4.563904E-07 --9.207198E-05 -5.154496E-07 -3.674257E-05 -1.178281E-06 5.048984E-03 5.880389E-06 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.079654E-04 9.484271E-08 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.952777E-04 3.543556E-07 1.000000E-03 1.000000E-06 -9.362621E-04 -8.765867E-07 -8.148801E-04 -6.640295E-07 -6.473941E-04 -4.191191E-07 0.000000E+00 0.000000E+00 2.000000E-02 9.000000E-05 -5.358616E-03 -1.697599E-05 -3.060277E-03 -7.132281E-06 -2.485730E-03 -7.247489E-06 9.248312E-03 1.738407E-05 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 8.991711E-04 2.696131E-07 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.954078E-04 3.545105E-07 1.000000E-03 1.000000E-06 -9.816220E-04 -9.635817E-07 -9.453726E-04 -8.937294E-07 -8.922496E-04 -7.961093E-07 0.000000E+00 0.000000E+00 8.000000E-03 1.800000E-05 -4.925975E-03 -6.260377E-06 -3.176938E-03 -2.631319E-06 -2.008278E-03 -1.484516E-06 3.844641E-03 4.075868E-06 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.977039E-04 8.862762E-08 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 9.238963E-04 8.535844E-07 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.000000E-03 1.000000E-06 --3.865739E-04 -1.494394E-07 --2.758409E-04 -7.608820E-08 -4.354374E-04 -1.896058E-07 5.871336E-04 3.447259E-07 0.000000E+00 @@ -2383,24 +961,6 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 tally 2: 5.656886E-01 6.401440E-02 diff --git a/tests/regression_tests/sourcepoint_restart/tallies.xml b/tests/regression_tests/sourcepoint_restart/tallies.xml index db9b2ed75c..60bf6b268b 100644 --- a/tests/regression_tests/sourcepoint_restart/tallies.xml +++ b/tests/regression_tests/sourcepoint_restart/tallies.xml @@ -30,7 +30,7 @@ 1 2 3 - scatter-P3 nu-fission + scatter nu-fission diff --git a/tests/regression_tests/statepoint_restart/results_true.dat b/tests/regression_tests/statepoint_restart/results_true.dat index f726da973c..c35ff46b8d 100644 --- a/tests/regression_tests/statepoint_restart/results_true.dat +++ b/tests/regression_tests/statepoint_restart/results_true.dat @@ -3,62 +3,38 @@ k-combined: tally 1: 1.100000E-02 3.700000E-05 -1.307570E-03 -2.851451E-06 -1.564980E-03 -2.368303E-06 -3.138136E-03 -5.769887E-06 +1.100000E-02 +3.700000E-05 7.719234E-03 2.632582E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.976389E-04 8.858890E-08 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 8.816168E-04 7.772482E-07 1.000000E-03 1.000000E-06 -8.782909E-04 -7.713950E-07 -6.570925E-04 -4.317705E-07 -3.763366E-04 -1.416293E-07 +1.000000E-03 +1.000000E-06 0.000000E+00 0.000000E+00 2.100000E-02 1.150000E-04 -5.280651E-03 -1.222273E-05 -5.235520E-03 -1.202448E-05 -5.064093E-03 -1.787892E-05 +2.100000E-02 +1.150000E-04 1.071093E-02 2.748612E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 8.954045E-04 2.673851E-07 0.000000E+00 @@ -73,72 +49,40 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.100000E-02 2.130000E-04 -1.472240E-02 -5.500913E-05 -1.077445E-02 -2.987369E-05 -6.729425E-03 -1.249089E-05 +3.100000E-02 +2.130000E-04 1.363637E-02 4.345510E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.182717E-03 5.268980E-07 2.000000E-03 2.000000E-06 --1.367978E-03 -9.381191E-07 -4.071787E-04 -9.316064E-08 -4.394728E-04 -1.064342E-07 +3.000000E-03 +5.000000E-06 2.110880E-03 1.737594E-06 1.000000E-03 1.000000E-06 -9.347357E-04 -8.737309E-07 -8.105963E-04 -6.570664E-07 -6.396651E-04 -4.091714E-07 +1.000000E-03 +1.000000E-06 2.938723E-04 8.636091E-08 2.300000E-02 1.330000E-04 -1.081756E-02 -3.675127E-05 -2.530156E-03 -6.960955E-06 --1.930911E-03 -4.910249E-06 +2.300000E-02 +1.330000E-04 1.162826E-02 3.490280E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 8.957100E-04 4.402864E-07 0.000000E+00 @@ -153,32 +97,16 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.000000E-02 3.400000E-05 -4.086838E-03 -5.900874E-06 -1.812330E-03 -3.716159E-06 -2.138941E-03 -3.006748E-06 +1.000000E-02 +3.400000E-05 5.414128E-03 8.079333E-06 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.079654E-04 9.484271E-08 0.000000E+00 @@ -193,32 +121,16 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.700000E-02 7.100000E-05 -5.492922E-03 -1.013834E-05 -5.773309E-04 -3.561549E-06 -2.550048E-03 -3.841061E-06 +1.700000E-02 +7.100000E-05 8.048522E-03 1.583843E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.915762E-04 1.749885E-07 0.000000E+00 @@ -233,152 +145,88 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.700000E-02 1.670000E-04 -1.789444E-02 -8.260005E-05 -1.049872E-02 -2.774537E-05 -5.665111E-03 -8.560197E-06 +2.700000E-02 +1.670000E-04 1.100708E-02 2.835295E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.079654E-04 9.484271E-08 1.000000E-03 1.000000E-06 --2.856031E-04 -8.156913E-08 --3.776463E-04 -1.426167E-07 -3.701637E-04 -1.370211E-07 +1.000000E-03 +1.000000E-06 1.203064E-03 7.240967E-07 1.000000E-03 1.000000E-06 -9.705482E-04 -9.419638E-07 -9.129457E-04 -8.334699E-07 -8.297310E-04 -6.884535E-07 +1.000000E-03 +1.000000E-06 0.000000E+00 0.000000E+00 4.400000E-02 4.320000E-04 -1.141886E-02 -4.208707E-05 -9.213446E-03 -2.259305E-05 -9.177440E-03 -2.088782E-05 +4.400000E-02 +4.320000E-04 2.116869E-02 9.629046E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.501009E-03 6.405021E-07 1.000000E-03 1.000000E-06 -5.882614E-04 -3.460515E-07 -1.907719E-05 -3.639390E-10 --3.734703E-04 -1.394801E-07 +1.000000E-03 +1.000000E-06 1.472277E-03 9.506217E-07 2.000000E-03 2.000000E-06 -1.830192E-03 -1.679505E-06 -1.519257E-03 -1.189525E-06 -1.118506E-03 -7.332971E-07 +2.000000E-03 +2.000000E-06 2.977039E-04 8.862762E-08 2.000000E-02 1.080000E-04 -8.640372E-03 -1.765553E-05 -5.688468E-03 -1.038555E-05 -2.447898E-03 -4.466055E-06 +2.000000E-02 +1.080000E-04 8.949667E-03 1.935056E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.977039E-04 8.862762E-08 1.000000E-03 1.000000E-06 --3.805163E-04 -1.447926E-07 --2.828111E-04 -7.998210E-08 -4.330345E-04 -1.875189E-07 +1.000000E-03 +1.000000E-06 2.121142E-03 1.958355E-06 1.000000E-03 1.000000E-06 -9.260022E-04 -8.574800E-07 -7.862200E-04 -6.181419E-07 -5.960676E-04 -3.552966E-07 +1.000000E-03 +1.000000E-06 2.938723E-04 8.636091E-08 1.000000E-02 3.400000E-05 -4.840884E-03 -1.080853E-05 -3.402096E-03 -4.113972E-06 -1.374077E-03 -2.333511E-06 +1.000000E-02 +3.400000E-05 4.754696E-03 7.172309E-06 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.079654E-04 9.484271E-08 0.000000E+00 @@ -393,122 +241,70 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.300000E-02 3.700000E-05 -3.121167E-03 -2.465327E-06 -4.474559E-04 -1.522316E-06 -9.193982E-04 -3.247292E-06 +1.300000E-02 +3.700000E-05 5.365659E-03 6.567979E-06 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 6.056043E-04 1.834316E-07 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.977039E-04 8.862762E-08 1.000000E-03 1.000000E-06 -2.390376E-04 -5.713899E-08 --4.142915E-04 -1.716375E-07 --3.244105E-04 -1.052422E-07 +1.000000E-03 +1.000000E-06 0.000000E+00 0.000000E+00 2.900000E-02 2.230000E-04 -6.260565E-03 -1.544092E-05 -7.061757E-03 -2.562385E-05 -3.982541E-03 -7.962565E-06 +2.900000E-02 +2.230000E-04 1.486928E-02 5.763901E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.915762E-04 1.749885E-07 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.954078E-04 3.545105E-07 1.000000E-03 1.000000E-06 -9.938157E-04 -9.876697E-07 -9.815046E-04 -9.633512E-07 -9.631807E-04 -9.277170E-07 +1.000000E-03 +1.000000E-06 0.000000E+00 0.000000E+00 2.900000E-02 1.990000E-04 -1.237546E-02 -3.198261E-05 -8.287792E-03 -2.747313E-05 -3.254969E-03 -8.653294E-06 +2.900000E-02 +1.990000E-04 1.189702E-02 3.303340E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 9.033082E-04 2.720592E-07 3.000000E-03 3.000000E-06 -3.649225E-04 -1.756075E-06 -1.134112E-03 -8.940601E-07 --9.392028E-04 -5.872882E-07 +4.000000E-03 +6.000000E-06 1.484187E-03 9.721092E-07 0.000000E+00 @@ -517,188 +313,112 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.500000E-02 1.390000E-04 -1.511834E-02 -5.459835E-05 -7.753447E-03 -2.291820E-05 -6.142979E-03 -1.359405E-05 +2.500000E-02 +1.390000E-04 1.043467E-02 2.526768E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.912057E-04 1.747704E-07 1.000000E-03 1.000000E-06 --1.098110E-04 -1.205846E-08 --4.819123E-04 -2.322395E-07 -1.614061E-04 -2.605194E-08 +1.000000E-03 +1.000000E-06 8.813114E-04 4.316251E-07 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.935668E-04 8.618147E-08 1.900000E-02 1.030000E-04 -1.035735E-02 -3.119381E-05 -6.483551E-03 -1.164471E-05 -3.924334E-03 -6.047577E-06 +1.900000E-02 +1.030000E-04 9.748672E-03 2.956633E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.079654E-04 9.484271E-08 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.935668E-04 8.618147E-08 1.000000E-03 1.000000E-06 -8.623139E-04 -7.435852E-07 -6.153778E-04 -3.786899E-07 -3.095388E-04 -9.581428E-08 +1.000000E-03 +1.000000E-06 0.000000E+00 0.000000E+00 7.000000E-03 1.500000E-05 -3.445754E-03 -3.819507E-06 -2.124056E-03 -1.976201E-06 -1.542203E-03 -1.531669E-06 +7.000000E-03 +1.500000E-05 4.135720E-03 4.532611E-06 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.874391E-04 1.725424E-07 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.079654E-04 9.484271E-08 1.000000E-03 1.000000E-06 -9.451745E-04 -8.933548E-07 -8.400323E-04 -7.056542E-07 -6.931788E-04 -4.804969E-07 +1.000000E-03 +1.000000E-06 0.000000E+00 0.000000E+00 2.600000E-02 1.560000E-04 -6.314886E-03 -1.168542E-05 -6.676680E-04 -9.930437E-06 --2.103247E-04 -2.815945E-07 +2.600000E-02 +1.560000E-04 1.249410E-02 3.501589E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 6.159309E-04 3.793709E-07 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.976389E-04 8.858890E-08 1.000000E-03 1.000000E-06 -9.514029E-04 -9.051675E-07 -8.577513E-04 -7.357373E-07 -7.258432E-04 -5.268483E-07 +1.000000E-03 +1.000000E-06 0.000000E+00 0.000000E+00 2.900000E-02 1.950000E-04 -8.928267E-03 -2.594547E-05 -4.752762E-03 -1.522378E-05 -5.376579E-03 -1.088620E-05 +2.900000E-02 +1.950000E-04 1.461148E-02 4.367385E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.912057E-04 1.747704E-07 0.000000E+00 @@ -713,62 +433,34 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.900000E-02 9.700000E-05 -1.046968E-02 -3.828445E-05 -6.704767E-03 -2.668260E-05 -2.659611E-03 -1.143518E-05 +1.900000E-02 +9.700000E-05 1.099391E-02 2.847330E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.935668E-04 8.618147E-08 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.655539E-03 2.523801E-06 3.000000E-03 5.000000E-06 -2.960960E-03 -4.866206E-06 -2.884206E-03 -4.608867E-06 -2.772329E-03 -4.247272E-06 +3.000000E-03 +5.000000E-06 2.976389E-04 8.858890E-08 6.000000E-03 8.000000E-06 -2.104495E-03 -2.749678E-06 -8.451272E-04 -9.362821E-07 -5.355137E-04 -3.419837E-07 +6.000000E-03 +8.000000E-06 2.683856E-03 1.512640E-06 0.000000E+00 @@ -781,124 +473,72 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.976389E-04 8.858890E-08 1.000000E-03 1.000000E-06 -9.374310E-04 -8.787769E-07 -8.181653E-04 -6.693944E-07 -6.533352E-04 -4.268468E-07 +1.000000E-03 +1.000000E-06 2.976389E-04 8.858890E-08 1.200000E-02 4.600000E-05 -9.302157E-04 -3.853850E-06 -1.874541E-03 -3.092623E-06 --1.511552E-03 -4.053466E-06 +1.200000E-02 +4.600000E-05 5.941985E-03 9.853870E-06 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.186548E-03 5.291647E-07 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.935668E-04 8.618147E-08 1.000000E-03 1.000000E-06 -9.893707E-04 -9.788543E-07 -9.682814E-04 -9.375689E-07 -9.370683E-04 -8.780970E-07 +1.000000E-03 +1.000000E-06 0.000000E+00 0.000000E+00 2.300000E-02 1.230000E-04 -5.099566E-03 -9.143616E-06 -4.738751E-03 -7.819254E-06 -3.929250E-03 -6.884420E-06 +2.300000E-02 +1.230000E-04 1.015650E-02 2.236950E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.977039E-04 8.862762E-08 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.912707E-04 1.748091E-07 2.000000E-03 2.000000E-06 -1.762035E-03 -1.552542E-06 -1.328812E-03 -8.839688E-07 -7.771806E-04 -3.049398E-07 +2.000000E-03 +2.000000E-06 0.000000E+00 0.000000E+00 3.100000E-02 2.250000E-04 -1.389831E-02 -5.927254E-05 -9.999959E-03 -3.379365E-05 -4.584291E-03 -1.665226E-05 +3.100000E-02 +2.250000E-04 1.729188E-02 6.078653E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.792523E-03 8.900697E-07 0.000000E+00 @@ -913,42 +553,22 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.700000E-02 7.100000E-05 -3.566805E-03 -2.049908E-05 -5.418617E-03 -7.496014E-06 -2.451897E-03 -2.115374E-06 +1.700000E-02 +7.100000E-05 7.760000E-03 1.634547E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.977039E-04 8.862762E-08 1.000000E-03 1.000000E-06 --7.119580E-04 -5.068842E-07 -2.603263E-04 -6.776977E-08 -1.657364E-04 -2.746855E-08 +1.000000E-03 +1.000000E-06 8.807004E-04 7.756332E-07 0.000000E+00 @@ -957,28 +577,16 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.900000E-02 2.030000E-04 -6.527719E-03 -1.422798E-05 -1.560049E-03 -2.934829E-06 -1.548553E-03 -8.929308E-06 +2.900000E-02 +2.030000E-04 1.108618E-02 3.019577E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.174573E-03 8.619941E-07 0.000000E+00 @@ -993,72 +601,40 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.500000E-02 5.500000E-05 -2.209492E-03 -2.545503E-06 -5.991182E-03 -1.290780E-05 -1.772063E-03 -2.006265E-06 +1.500000E-02 +5.500000E-05 5.944486E-03 1.042417E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.079654E-04 9.484271E-08 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.190621E-03 8.859277E-07 2.000000E-03 2.000000E-06 -1.908405E-03 -1.821879E-06 -1.732819E-03 -1.508498E-06 -1.487670E-03 -1.131430E-06 +2.000000E-03 +2.000000E-06 0.000000E+00 0.000000E+00 2.600000E-02 1.460000E-04 -7.818547E-03 -3.176773E-05 -5.200193E-03 -1.419001E-05 -3.947828E-03 -8.417104E-06 +2.600000E-02 +1.460000E-04 9.232713E-03 1.900222E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.186919E-03 5.294603E-07 0.000000E+00 @@ -1073,112 +649,64 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.600000E-02 2.740000E-04 -9.407788E-03 -2.403566E-05 -4.480017E-03 -6.102099E-06 -5.941113E-03 -1.265337E-05 +3.600000E-02 +2.740000E-04 1.462273E-02 4.551798E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 6.056694E-04 1.834703E-07 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 8.807004E-04 7.756332E-07 1.000000E-03 1.000000E-06 -8.905295E-04 -7.930427E-07 -6.895641E-04 -4.754986E-07 -4.297756E-04 -1.847070E-07 +1.000000E-03 +1.000000E-06 0.000000E+00 0.000000E+00 1.200000E-02 3.000000E-05 -4.798420E-03 -7.171924E-06 -1.417651E-03 -4.997963E-06 -2.131704E-03 -3.253030E-06 +1.200000E-02 +3.000000E-05 7.754474E-03 1.333333E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.938723E-04 8.636091E-08 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.484382E-03 1.504223E-06 3.000000E-03 5.000000E-06 -2.760812E-03 -4.139104E-06 -2.336063E-03 -2.844690E-06 -1.817042E-03 -1.656152E-06 +3.000000E-03 +5.000000E-06 0.000000E+00 0.000000E+00 1.900000E-02 9.900000E-05 -7.385212E-03 -2.033270E-05 -6.336514E-03 -2.028060E-05 -3.967026E-03 -1.027239E-05 +1.900000E-02 +9.900000E-05 1.066281E-02 2.937590E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.976389E-04 8.858890E-08 0.000000E+00 @@ -1193,22 +721,10 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.000000E-03 3.000000E-06 -1.134842E-03 -1.040850E-06 -6.127525E-05 -3.988312E-07 -4.938488E-05 -2.738492E-07 +3.000000E-03 +3.000000E-06 1.484493E-03 9.722886E-07 0.000000E+00 @@ -1229,26 +745,10 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.300000E-02 1.650000E-04 -9.507197E-03 -3.773476E-05 -6.295609E-03 -2.127696E-05 -6.339840E-03 -1.601206E-05 +2.300000E-02 +1.650000E-04 1.065253E-02 3.447907E-05 0.000000E+00 @@ -1257,18 +757,10 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.000000E-03 1.000000E-06 --1.117213E-04 -1.248165E-08 --4.812775E-04 -2.316281E-07 -1.640958E-04 -2.692743E-08 +1.000000E-03 +1.000000E-06 5.871336E-04 3.447259E-07 0.000000E+00 @@ -1277,38 +769,22 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.100000E-02 2.030000E-04 -1.194795E-02 -4.198084E-05 -8.484089E-03 -1.631808E-05 -5.880364E-03 -1.308096E-05 +3.100000E-02 +2.030000E-04 1.342551E-02 3.842917E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.915762E-04 1.749885E-07 1.000000E-03 1.000000E-06 --5.881991E-05 -3.459782E-09 --4.948103E-04 -2.448373E-07 -8.772111E-05 -7.694993E-09 +1.000000E-03 +1.000000E-06 5.871336E-04 3.447259E-07 0.000000E+00 @@ -1317,28 +793,16 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.900000E-02 8.700000E-05 -5.469796E-03 -1.029265E-05 -4.923561E-04 -2.403244E-06 -2.579361E-03 -5.814745E-06 +1.900000E-02 +8.700000E-05 8.693502E-03 1.682273E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.976389E-04 8.858890E-08 0.000000E+00 @@ -1353,22 +817,10 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 8.000000E-03 1.600000E-05 -5.411154E-03 -8.076329E-06 -3.145940E-03 -4.212660E-06 -2.637510E-03 -3.210372E-06 +8.000000E-03 +1.600000E-05 3.866943E-03 3.257876E-06 0.000000E+00 @@ -1381,44 +833,24 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.175489E-03 1.381775E-06 1.000000E-03 1.000000E-06 -7.809681E-04 -6.099112E-07 -4.148668E-04 -1.721145E-07 -1.935089E-05 -3.744570E-10 +1.000000E-03 +1.000000E-06 0.000000E+00 0.000000E+00 8.000000E-03 2.000000E-05 -3.721382E-03 -4.736982E-06 --1.037031E-04 -6.648392E-07 --5.996856E-04 -9.642316E-07 +8.000000E-03 +2.000000E-05 3.248622E-03 4.063213E-06 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.938723E-04 8.636091E-08 0.000000E+00 @@ -1433,32 +865,16 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.800000E-02 1.780000E-04 -1.190615E-02 -4.434442E-05 -7.332993E-03 -2.337416E-05 -6.867008E-03 -1.321552E-05 +2.800000E-02 +1.780000E-04 1.283876E-02 3.527487E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.954078E-04 3.545105E-07 0.000000E+00 @@ -1473,42 +889,22 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 4.000000E-02 3.880000E-04 -6.620484E-03 -3.751545E-05 -9.255367E-03 -1.963463E-05 -7.761524E-03 -1.694944E-05 +4.000000E-02 +3.880000E-04 1.659048E-02 7.200873E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.976389E-04 8.858890E-08 1.000000E-03 1.000000E-06 --5.273064E-04 -2.780520E-07 --8.292201E-05 -6.876059E-09 -4.244131E-04 -1.801265E-07 +1.000000E-03 +1.000000E-06 8.891500E-04 4.407165E-07 0.000000E+00 @@ -1517,18 +913,10 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.200000E-02 3.400000E-05 -5.905081E-03 -1.535048E-05 -3.856089E-03 -8.589511E-06 -3.244585E-03 -5.882222E-06 +1.200000E-02 +3.400000E-05 5.074320E-03 5.793165E-06 0.000000E+00 @@ -1549,26 +937,10 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 4.000000E-03 8.000000E-06 -1.520286E-03 -4.076900E-06 -2.191143E-03 -3.717004E-06 -1.161623E-03 -3.726099E-06 +4.000000E-03 +8.000000E-06 3.570375E-03 5.251426E-06 0.000000E+00 @@ -1589,36 +961,16 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 4.000000E-03 4.000000E-06 -3.379122E-03 -2.880429E-06 -2.320644E-03 -1.498759E-06 -1.119131E-03 -6.212863E-07 +4.000000E-03 +4.000000E-06 1.494579E-03 6.241235E-07 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.976389E-04 8.858890E-08 0.000000E+00 @@ -1633,72 +985,40 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.100000E-02 1.950000E-04 -1.338410E-02 -5.097757E-05 -6.794436E-03 -1.428226E-05 -3.939298E-03 -9.052046E-06 +3.100000E-02 +1.950000E-04 1.250316E-02 3.147175E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.953428E-04 1.772165E-07 1.000000E-03 1.000000E-06 --5.747626E-05 -3.303520E-09 --4.950447E-04 -2.450693E-07 -8.573970E-05 -7.351297E-09 +1.000000E-03 +1.000000E-06 5.954078E-04 3.545105E-07 1.000000E-03 1.000000E-06 -9.748367E-04 -9.503066E-07 -9.254598E-04 -8.564759E-07 -8.537292E-04 -7.288535E-07 +1.000000E-03 +1.000000E-06 0.000000E+00 0.000000E+00 2.600000E-02 1.800000E-04 -1.225587E-02 -3.757196E-05 -7.670283E-03 -2.316758E-05 -5.282346E-03 -1.407031E-05 +2.600000E-02 +1.800000E-04 1.162837E-02 3.241150E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.874391E-04 1.725424E-07 0.000000E+00 @@ -1713,42 +1033,22 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.900000E-02 9.900000E-05 -7.244455E-03 -2.708286E-05 -4.601657E-03 -5.366244E-06 --1.675270E-03 -3.867377E-06 +1.900000E-02 +9.900000E-05 9.216754E-03 2.272207E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.079654E-04 9.484271E-08 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 6.159309E-04 3.793709E-07 0.000000E+00 @@ -1757,18 +1057,10 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 6.000000E-03 1.000000E-05 -1.316884E-03 -2.894217E-06 -2.095957E-03 -1.439521E-06 -1.013831E-04 -8.405300E-07 +6.000000E-03 +1.000000E-05 2.404012E-03 1.641294E-06 0.000000E+00 @@ -1813,52 +1105,16 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.500000E-02 6.300000E-05 -5.790211E-03 -1.210465E-05 -8.591246E-04 -1.950998E-06 -1.987991E-03 -4.703397E-06 +1.500000E-02 +6.300000E-05 6.572185E-03 9.479065E-06 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.954078E-04 3.545105E-07 0.000000E+00 @@ -1873,22 +1129,10 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.900000E-02 1.030000E-04 -3.010784E-03 -6.984061E-06 -5.243839E-03 -8.093978E-06 --2.502286E-04 -2.564795E-06 +1.900000E-02 +1.030000E-04 7.760558E-03 1.654841E-05 0.000000E+00 @@ -1901,44 +1145,24 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.935668E-04 8.618147E-08 1.000000E-03 1.000000E-06 -9.333938E-04 -8.712239E-07 -8.068359E-04 -6.509841E-07 -6.328968E-04 -4.005583E-07 +1.000000E-03 +1.000000E-06 0.000000E+00 0.000000E+00 1.800000E-02 1.220000E-04 -6.860987E-03 -2.966806E-05 -4.229750E-03 -1.617998E-05 -1.295452E-03 -8.613003E-07 +1.800000E-02 +1.220000E-04 7.815192E-03 2.039362E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.935668E-04 8.618147E-08 0.000000E+00 @@ -1977,38 +1201,10 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.000000E-03 2.000000E-06 -1.502634E-03 -1.146555E-06 -7.198331E-04 -3.484978E-07 --3.426513E-05 -1.342349E-07 +2.000000E-03 +2.000000E-06 1.511030E-03 1.198310E-06 0.000000E+00 @@ -2029,26 +1225,10 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.900000E-02 1.030000E-04 -3.892013E-03 -8.267134E-06 -3.385502E-03 -6.457947E-06 -4.380506E-03 -1.060881E-05 +1.900000E-02 +1.030000E-04 7.130794E-03 1.485134E-05 0.000000E+00 @@ -2061,74 +1241,42 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 8.816168E-04 7.772482E-07 1.000000E-03 1.000000E-06 -9.951010E-04 -9.902260E-07 -9.853389E-04 -9.708928E-07 -9.707856E-04 -9.424246E-07 +1.000000E-03 +1.000000E-06 0.000000E+00 0.000000E+00 2.900000E-02 1.970000E-04 -4.944370E-03 -2.340271E-05 -3.891346E-03 -1.137205E-05 -5.738303E-03 -9.169816E-06 +2.900000E-02 +1.970000E-04 1.046961E-02 2.353870E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 6.056694E-04 1.834703E-07 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.203064E-03 7.240967E-07 2.000000E-03 2.000000E-06 -1.696621E-03 -1.449397E-06 -1.174096E-03 -7.548933E-07 -5.719051E-04 -3.184788E-07 +2.000000E-03 +2.000000E-06 0.000000E+00 0.000000E+00 1.600000E-02 5.400000E-05 -7.937805E-03 -1.353584E-05 -4.065443E-03 -5.658333E-06 -3.432476E-03 -3.530320E-06 +1.600000E-02 +5.400000E-05 6.546902E-03 9.343143E-06 0.000000E+00 @@ -2149,26 +1297,10 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.000000E-03 2.000000E-06 -1.447007E-04 -7.721849E-07 -1.582773E-04 -4.841114E-08 -1.981705E-04 -2.166687E-07 +2.000000E-03 +2.000000E-06 9.135698E-04 4.679598E-07 0.000000E+00 @@ -2213,142 +1345,70 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.000000E-02 2.600000E-05 -5.875085E-04 -4.563904E-07 --9.207198E-05 -5.154496E-07 -3.674257E-05 -1.178281E-06 +1.000000E-02 +2.600000E-05 5.048984E-03 5.880389E-06 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 3.079654E-04 9.484271E-08 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.952777E-04 3.543556E-07 1.000000E-03 1.000000E-06 -9.362621E-04 -8.765867E-07 -8.148801E-04 -6.640295E-07 -6.473941E-04 -4.191191E-07 +1.000000E-03 +1.000000E-06 0.000000E+00 0.000000E+00 2.000000E-02 9.000000E-05 -5.358616E-03 -1.697599E-05 -3.060277E-03 -7.132281E-06 -2.485730E-03 -7.247489E-06 +2.000000E-02 +9.000000E-05 9.248312E-03 1.738407E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 8.991711E-04 2.696131E-07 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 5.954078E-04 3.545105E-07 1.000000E-03 1.000000E-06 -9.816220E-04 -9.635817E-07 -9.453726E-04 -8.937294E-07 -8.922496E-04 -7.961093E-07 +1.000000E-03 +1.000000E-06 0.000000E+00 0.000000E+00 8.000000E-03 1.800000E-05 -4.925975E-03 -6.260377E-06 -3.176938E-03 -2.631319E-06 -2.008278E-03 -1.484516E-06 +8.000000E-03 +1.800000E-05 3.844641E-03 4.075868E-06 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 2.977039E-04 8.862762E-08 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 9.238963E-04 8.535844E-07 0.000000E+00 @@ -2357,18 +1417,10 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 1.000000E-03 1.000000E-06 --3.865739E-04 -1.494394E-07 --2.758409E-04 -7.608820E-08 -4.354374E-04 -1.896058E-07 +1.000000E-03 +1.000000E-06 5.871336E-04 3.447259E-07 0.000000E+00 @@ -2389,18 +1441,6 @@ tally 1: 0.000000E+00 0.000000E+00 0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 -0.000000E+00 tally 2: 5.656886E-01 6.401440E-02 diff --git a/tests/regression_tests/statepoint_restart/tallies.xml b/tests/regression_tests/statepoint_restart/tallies.xml index db9b2ed75c..c7dff36f0d 100644 --- a/tests/regression_tests/statepoint_restart/tallies.xml +++ b/tests/regression_tests/statepoint_restart/tallies.xml @@ -30,7 +30,7 @@ 1 2 3 - scatter-P3 nu-fission + scatter nu-scatter nu-fission diff --git a/tests/regression_tests/tallies/inputs_true.dat b/tests/regression_tests/tallies/inputs_true.dat index 2c33a8fa0d..6e7b5f3f02 100644 --- a/tests/regression_tests/tallies/inputs_true.dat +++ b/tests/regression_tests/tallies/inputs_true.dat @@ -341,13 +341,19 @@ 0.0 0.6283 1.2566 1.885 2.5132 3.14159 - + + 4 + + + 4 + + 1 2 3 4 6 8 - + 10 21 22 23 60 - + 21 22 23 27 28 29 60 @@ -414,80 +420,80 @@ 10 - total + scatter nu-scatter 11 - absorption delayed-nu-fission events fission inverse-velocity kappa-fission (n,2n) (n,n1) (n,gamma) nu-fission scatter elastic total prompt-nu-fission fission-q-prompt fission-q-recoverable - tracklength + scatter nu-scatter flux total 11 - absorption delayed-nu-fission events fission inverse-velocity kappa-fission (n,2n) (n,n1) (n,gamma) nu-fission scatter elastic total prompt-nu-fission fission-q-prompt fission-q-recoverable - analog + flux total 11 - absorption delayed-nu-fission events fission inverse-velocity kappa-fission (n,2n) (n,n1) (n,gamma) nu-fission scatter elastic total prompt-nu-fission fission-q-prompt fission-q-recoverable - collision + flux total 12 - flux + total - 12 - flux-y5 + 13 + absorption delayed-nu-fission events fission inverse-velocity kappa-fission (n,2n) (n,n1) (n,gamma) nu-fission scatter elastic total prompt-nu-fission fission-q-prompt fission-q-recoverable tracklength - 12 - flux-y5 + 13 + absorption delayed-nu-fission events fission inverse-velocity kappa-fission (n,2n) (n,n1) (n,gamma) nu-fission scatter elastic total prompt-nu-fission fission-q-prompt fission-q-recoverable analog - 12 - flux-y5 + 13 + absorption delayed-nu-fission events fission inverse-velocity kappa-fission (n,2n) (n,n1) (n,gamma) nu-fission scatter elastic total prompt-nu-fission fission-q-prompt fission-q-recoverable collision - 11 - scatter scatter-1 scatter-2 scatter-3 scatter-4 nu-scatter nu-scatter-1 nu-scatter-2 nu-scatter-3 nu-scatter-4 + 14 + flux + tracklength - 11 - scatter-p4 scatter-y4 nu-scatter-p4 nu-scatter-y3 + 14 + flux + analog - 11 - total + 14 + flux + collision - 11 + 13 U235 total - total-y4 + total tracklength - 11 + 13 U235 total - total-y4 + total analog - 11 + 13 U235 total - total-y4 + total collision - 11 + 13 all total tracklength - 11 + 13 all total collision diff --git a/tests/regression_tests/tallies/results_true.dat b/tests/regression_tests/tallies/results_true.dat index e9c0865fd5..b1cef30fef 100644 --- a/tests/regression_tests/tallies/results_true.dat +++ b/tests/regression_tests/tallies/results_true.dat @@ -1 +1 @@ -13014f42dea87bf6c1fc0d41361cdba8a7e32a8f809d348567dfce638c849f58a0c0f17065c199946db81a264ef72db850aea93b0e11adf4f70ec969e30529cd \ No newline at end of file +8cf1936c565c6a09bffe2f7a0623ded1405bae37c1de8159551e64b86ca4f6bce82890a630b9428bcf8353f6de8e5cfc1f1a4263fd51a1c6b5cddb0a9c2ff368 \ No newline at end of file diff --git a/tests/regression_tests/tallies/test.py b/tests/regression_tests/tallies/test.py index e3aebfd986..53ce60b628 100644 --- a/tests/regression_tests/tallies/test.py +++ b/tests/regression_tests/tallies/test.py @@ -1,5 +1,6 @@ from openmc.filter import * -from openmc import Mesh, Tally, Tallies +from openmc.filter_expansion import * +from openmc import Mesh, Tally from tests.testing_harness import HashedPyAPITestHarness @@ -17,53 +18,53 @@ def test_tallies(): azimuthal_bins = (-3.14159, -1.8850, -0.6283, 0.6283, 1.8850, 3.14159) azimuthal_filter = AzimuthalFilter(azimuthal_bins) - azimuthal_tally1 = Tally() + azimuthal_tally1 = Tally(tally_id=1) azimuthal_tally1.filters = [azimuthal_filter] azimuthal_tally1.scores = ['flux'] azimuthal_tally1.estimator = 'tracklength' - azimuthal_tally2 = Tally() + azimuthal_tally2 = Tally(tally_id=2) azimuthal_tally2.filters = [azimuthal_filter] azimuthal_tally2.scores = ['flux'] azimuthal_tally2.estimator = 'analog' mesh_2x2 = Mesh(mesh_id=1) - mesh_2x2.lower_left = [-182.07, -182.07] - mesh_2x2.upper_right = [182.07, 182.07] + mesh_2x2.lower_left = [-182.07, -182.07] + mesh_2x2.upper_right = [182.07, 182.07] mesh_2x2.dimension = [2, 2] mesh_filter = MeshFilter(mesh_2x2) - azimuthal_tally3 = Tally() + azimuthal_tally3 = Tally(tally_id=3) azimuthal_tally3.filters = [azimuthal_filter, mesh_filter] azimuthal_tally3.scores = ['flux'] azimuthal_tally3.estimator = 'tracklength' - cellborn_tally = Tally() + cellborn_tally = Tally(tally_id=4) cellborn_tally.filters = [ CellbornFilter((model.geometry.get_all_cells()[10], model.geometry.get_all_cells()[21], 22, 23))] # Test both Cell objects and ids cellborn_tally.scores = ['total'] - dg_tally = Tally() + dg_tally = Tally(tally_id=5) dg_tally.filters = [DelayedGroupFilter((1, 2, 3, 4, 5, 6))] dg_tally.scores = ['delayed-nu-fission'] four_groups = (0.0, 0.253, 1.0e3, 1.0e6, 20.0e6) energy_filter = EnergyFilter(four_groups) - energy_tally = Tally() + energy_tally = Tally(tally_id=6) energy_tally.filters = [energy_filter] energy_tally.scores = ['total'] energyout_filter = EnergyoutFilter(four_groups) - energyout_tally = Tally() + energyout_tally = Tally(tally_id=7) energyout_tally.filters = [energyout_filter] energyout_tally.scores = ['scatter'] - transfer_tally = Tally() + transfer_tally = Tally(tally_id=8) transfer_tally.filters = [energy_filter, energyout_filter] transfer_tally.scores = ['scatter', 'nu-fission'] - material_tally = Tally() + material_tally = Tally(tally_id=9) material_tally.filters = [ MaterialFilter((model.geometry.get_materials_by_name('UOX fuel')[0], model.geometry.get_materials_by_name('Zircaloy')[0], @@ -72,32 +73,56 @@ def test_tallies(): mu_bins = (-1.0, -0.5, 0.0, 0.5, 1.0) mu_filter = MuFilter(mu_bins) - mu_tally1 = Tally() + mu_tally1 = Tally(tally_id=10) mu_tally1.filters = [mu_filter] mu_tally1.scores = ['scatter', 'nu-scatter'] + print('mu_tally1', mu_tally1.id) - mu_tally2 = Tally() + mu_tally2 = Tally(tally_id=11) mu_tally2.filters = [mu_filter, mesh_filter] mu_tally2.scores = ['scatter', 'nu-scatter'] polar_bins = (0.0, 0.6283, 1.2566, 1.8850, 2.5132, 3.14159) polar_filter = PolarFilter(polar_bins) - polar_tally1 = Tally() + polar_tally1 = Tally(tally_id=12) polar_tally1.filters = [polar_filter] polar_tally1.scores = ['flux'] polar_tally1.estimator = 'tracklength' - polar_tally2 = Tally() + polar_tally2 = Tally(tally_id=13) polar_tally2.filters = [polar_filter] polar_tally2.scores = ['flux'] polar_tally2.estimator = 'analog' - polar_tally3 = Tally() + polar_tally3 = Tally(tally_id=14) polar_tally3.filters = [polar_filter, mesh_filter] polar_tally3.scores = ['flux'] polar_tally3.estimator = 'tracklength' - universe_tally = Tally() + legendre_filter = LegendreFilter(order=4) + legendre_tally = Tally(tally_id=15) + legendre_tally.filters = [legendre_filter] + legendre_tally.scores = ['scatter', 'nu-scatter'] + legendre_tally.estimatir = 'analog' + print('legendre_tally', mu_tally1.id) + + harmonics_filter = SphericalHarmonicsFilter(order=4) + harmonics_tally = Tally(tally_id=16) + harmonics_tally.filters = [harmonics_filter] + harmonics_tally.scores = ['scatter', 'nu-scatter', 'flux', 'total'] + harmonics_tally.estimatir = 'analog' + + harmonics_tally2 = Tally(tally_id=17) + harmonics_tally2.filters = [harmonics_filter] + harmonics_tally2.scores = ['flux', 'total'] + harmonics_tally2.estimatir = 'collision' + + harmonics_tally3 = Tally(tally_id=18) + harmonics_tally3.filters = [harmonics_filter] + harmonics_tally3.scores = ['flux', 'total'] + harmonics_tally3.estimatir = 'tracklength' + + universe_tally = Tally(tally_id=19) universe_tally.filters = [ UniverseFilter((model.geometry.get_all_universes()[1], model.geometry.get_all_universes()[2], @@ -107,7 +132,8 @@ def test_tallies(): cell_filter = CellFilter((model.geometry.get_all_cells()[10], model.geometry.get_all_cells()[21], 22, 23, 60)) # Test both Cell objects and ids - score_tallies = [Tally(), Tally(), Tally()] + score_tallies = [Tally(tally_id=20), Tally(tally_id=21), + Tally(tally_id=22)] for t in score_tallies: t.filters = [cell_filter] t.scores = ['absorption', 'delayed-nu-fission', 'events', 'fission', @@ -120,39 +146,24 @@ def test_tallies(): score_tallies[2].estimator = 'collision' cell_filter2 = CellFilter((21, 22, 23, 27, 28, 29, 60)) - flux_tallies = [Tally() for i in range(4)] + flux_tallies = [Tally(tally_id=23 + i) for i in range(3)] for t in flux_tallies: t.filters = [cell_filter2] - flux_tallies[0].scores = ['flux'] - for t in flux_tallies[1:]: - t.scores = ['flux-y5'] - flux_tallies[1].estimator = 'tracklength' - flux_tallies[2].estimator = 'analog' - flux_tallies[3].estimator = 'collision' + t.scores = ['flux'] + flux_tallies[0].estimator = 'tracklength' + flux_tallies[1].estimator = 'analog' + flux_tallies[2].estimator = 'collision' - scatter_tally1 = Tally() - scatter_tally1.filters = [cell_filter] - scatter_tally1.scores = ['scatter', 'scatter-1', 'scatter-2', 'scatter-3', - 'scatter-4', 'nu-scatter', 'nu-scatter-1', - 'nu-scatter-2', 'nu-scatter-3', 'nu-scatter-4'] - - scatter_tally2 = Tally() - scatter_tally2.filters = [cell_filter] - scatter_tally2.scores = ['scatter-p4', 'scatter-y4', 'nu-scatter-p4', - 'nu-scatter-y3'] - - total_tallies = [Tally() for i in range(4)] + total_tallies = [Tally(tally_id=26 + i) for i in range(3)] for t in total_tallies: t.filters = [cell_filter] - total_tallies[0].scores = ['total'] - for t in total_tallies[1:]: - t.scores = ['total-y4'] + t.scores = ['total'] t.nuclides = ['U235', 'total'] - total_tallies[1].estimator = 'tracklength' - total_tallies[2].estimator = 'analog' - total_tallies[3].estimator = 'collision' + total_tallies[0].estimator = 'tracklength' + total_tallies[1].estimator = 'analog' + total_tallies[2].estimator = 'collision' - all_nuclide_tallies = [Tally() for i in range(4)] + all_nuclide_tallies = [Tally(tally_id=29 + i) for i in range(4)] for t in all_nuclide_tallies: t.filters = [cell_filter] t.estimator = 'tracklength' @@ -167,10 +178,10 @@ def test_tallies(): azimuthal_tally1, azimuthal_tally2, azimuthal_tally3, cellborn_tally, dg_tally, energy_tally, energyout_tally, transfer_tally, material_tally, mu_tally1, mu_tally2, - polar_tally1, polar_tally2, polar_tally3, universe_tally] + polar_tally1, polar_tally2, polar_tally3, legendre_tally, + harmonics_tally, harmonics_tally2, harmonics_tally3, universe_tally] model.tallies += score_tallies model.tallies += flux_tallies - model.tallies += (scatter_tally1, scatter_tally2) model.tallies += total_tallies model.tallies += all_nuclide_tallies diff --git a/tests/regression_tests/track_output/test.py b/tests/regression_tests/track_output/test.py index 22eac03bfc..a5300a4aed 100644 --- a/tests/regression_tests/track_output/test.py +++ b/tests/regression_tests/track_output/test.py @@ -19,7 +19,7 @@ class TrackTestHarness(TestHarness): def _get_results(self): """Digest info in the statepoint and return as a string.""" # Run the track-to-vtk conversion script. - call(['../../scripts/openmc-track-to-vtk', '-o', 'poly'] + + call(['../../../scripts/openmc-track-to-vtk', '-o', 'poly'] + glob.glob('track_1_1_*.h5')) # Make sure the vtk file was created then return it's contents. From d4c4e612ea65e6de09ed276f66e990bdfb9a1dd6 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Sun, 29 Apr 2018 19:09:22 -0500 Subject: [PATCH 221/231] Address @smharper comments on #996 --- src/error.F90 | 8 ++++++++ src/error.h | 18 +++++++++++++++--- src/hdf5_interface.cpp | 28 ++++++++++++++-------------- src/hdf5_interface.h | 27 +++++++++------------------ src/initialize.cpp | 7 +++++-- src/main.cpp | 28 ++++++++++++++-------------- 6 files changed, 65 insertions(+), 51 deletions(-) diff --git a/src/error.F90 b/src/error.F90 index f4fb34173c..d041051d29 100644 --- a/src/error.F90 +++ b/src/error.F90 @@ -111,6 +111,14 @@ contains end subroutine warning + subroutine warning_from_c(message, message_len) bind(C) + integer(C_INT), intent(in), value :: message_len + character(kind=C_CHAR), intent(in) :: message(message_len) + character(message_len+1) :: message_out + write(message_out, *) message + call warning(message_out) + end subroutine + !=============================================================================== ! FATAL_ERROR alerts the user that an error has been encountered and displays a ! message about the particular problem. Errors are considered 'fatal' and hence diff --git a/src/error.h b/src/error.h index 91c2727452..45d8bcdede 100644 --- a/src/error.h +++ b/src/error.h @@ -9,7 +9,8 @@ namespace openmc { -extern "C" void fatal_error_from_c(const char *message, int message_len); +extern "C" void fatal_error_from_c(const char* message, int message_len); +extern "C" void warning_from_c(const char* message, int message_len); inline @@ -27,8 +28,19 @@ void fatal_error(const std::string &message) inline void fatal_error(const std::stringstream &message) { - std::string out {message.str()}; - fatal_error_from_c(out.c_str(), out.length()); + fatal_error(message.str()); +} + +inline +void warning(const std::string& message) +{ + warning_from_c(message.c_str(), message.length()); +} + +inline +void warning(const std::stringstream& message) +{ + warning(message.str()); } } // namespace openmc diff --git a/src/hdf5_interface.cpp b/src/hdf5_interface.cpp index e4db2ee58a..8a8391bb54 100644 --- a/src/hdf5_interface.cpp +++ b/src/hdf5_interface.cpp @@ -122,20 +122,20 @@ file_open(const char* filename, char mode, bool parallel) bool create; unsigned int flags; switch (mode) { - case 'r': - case 'a': - create = false; - flags = (mode == 'r' ? H5F_ACC_RDONLY : H5F_ACC_RDWR); - break; - case 'w': - case 'x': - create = true; - flags = (mode == 'x' ? H5F_ACC_EXCL : H5F_ACC_TRUNC); - break; - default: - std::stringstream err_msg; - err_msg << "Invalid file mode: " << mode; - fatal_error(err_msg); + case 'r': + case 'a': + create = false; + flags = (mode == 'r' ? H5F_ACC_RDONLY : H5F_ACC_RDWR); + break; + case 'w': + case 'x': + create = true; + flags = (mode == 'x' ? H5F_ACC_EXCL : H5F_ACC_TRUNC); + break; + default: + std::stringstream err_msg; + err_msg << "Invalid file mode: " << mode; + fatal_error(err_msg); } hid_t plist = H5P_DEFAULT; diff --git a/src/hdf5_interface.h b/src/hdf5_interface.h index 9a8b3c569d..e38a31e997 100644 --- a/src/hdf5_interface.h +++ b/src/hdf5_interface.h @@ -35,24 +35,6 @@ extern "C" hid_t open_dataset(hid_t group_id, const char* name); extern "C" hid_t open_group(hid_t group_id, const char* name); bool using_mpio_device(hid_t obj_id); - -template void -write_double_1D(hid_t group_id, char const *name, - std::array &buffer) -{ - hsize_t dims[1]{array_len}; - hid_t dataspace = H5Screate_simple(1, dims, NULL); - - hid_t dataset = H5Dcreate(group_id, name, H5T_NATIVE_DOUBLE, dataspace, - H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - - H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, - &buffer[0]); - - H5Sclose(dataspace); - H5Dclose(dataset); -} - void read_attr(hid_t obj_id, const char* name, hid_t mem_type_id, const void* buffer); extern "C" void read_attr_double(hid_t obj_id, const char* name, double* buffer); @@ -102,5 +84,14 @@ void write_string(hid_t group_id, const char* name, const std::string& buffer, b extern "C" void write_tally_results(hid_t group_id, hsize_t n_filter, hsize_t n_score, const double* results); +template void +write_double_1D(hid_t group_id, char const *name, + std::array &buffer) +{ + hsize_t dims[1] {array_len}; + write_dataset(group_id, 1, dims, name, H5T_NATIVE_DOUBLE, + buffer.data(), false); +} + } // namespace openmc #endif //HDF5_INTERFACE_H diff --git a/src/initialize.cpp b/src/initialize.cpp index c7c37e31db..728f43695b 100644 --- a/src/initialize.cpp +++ b/src/initialize.cpp @@ -102,8 +102,8 @@ void initialize_mpi(MPI_Comm intracomm) inline bool ends_with(std::string const& value, std::string const& ending) { - if (ending.size() > value.size()) return false; - return std::equal(ending.rbegin(), ending.rend(), value.rbegin()); + if (ending.size() > value.size()) return false; + return std::equal(ending.rbegin(), ending.rend(), value.rbegin()); } @@ -194,6 +194,9 @@ parse_command_line(int argc, char* argv[]) return OPENMC_E_INVALID_ARGUMENT; } omp_set_num_threads(openmc_n_threads); +#else + if (openmc_master) + warning("Ignoring number of threads specified on command line."); #endif } else if (arg == "-?" || arg == "-h" || arg == "--help") { diff --git a/src/main.cpp b/src/main.cpp index 6d0cf1f268..8d8f39e249 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,24 +19,24 @@ int main(int argc, char* argv[]) { // This happens for the -h and -v flags return 0; } else if (err) { - openmc::fatal_error(openmc_err_msg); + openmc::fatal_error(openmc_err_msg); } // start problem based on mode switch (openmc_run_mode) { - case RUN_MODE_FIXEDSOURCE: - case RUN_MODE_EIGENVALUE: - err = openmc_run(); - break; - case RUN_MODE_PLOTTING: - err = openmc_plot_geometry(); - break; - case RUN_MODE_PARTICLE: - if (openmc_master) err = openmc_particle_restart(); - break; - case RUN_MODE_VOLUME: - err = openmc_calculate_volumes(); - break; + case RUN_MODE_FIXEDSOURCE: + case RUN_MODE_EIGENVALUE: + err = openmc_run(); + break; + case RUN_MODE_PLOTTING: + err = openmc_plot_geometry(); + break; + case RUN_MODE_PARTICLE: + if (openmc_master) err = openmc_particle_restart(); + break; + case RUN_MODE_VOLUME: + err = openmc_calculate_volumes(); + break; } if (err) openmc::fatal_error(openmc_err_msg); From b61c67a12cd34f8f9a7c5641c73f98622a413ad4 Mon Sep 17 00:00:00 2001 From: Adam G Nelson Date: Tue, 1 May 2018 19:17:21 -0400 Subject: [PATCH 222/231] fixes per request of @paulromano: fixing test scratch files vice using .gitignore, minor typo in docs, and some otherwise small code cleanups --- .gitignore | 3 -- docs/source/usersguide/tallies.rst | 2 +- openmc/mgxs/mgxs.py | 2 +- openmc/tallies.py | 3 +- src/summary.F90 | 2 -- src/tallies/tally.F90 | 38 ++++++--------------- tests/regression_tests/tallies/test.py | 47 +++++++++++++------------- tests/unit_tests/test_data_neutron.py | 6 ++-- 8 files changed, 39 insertions(+), 64 deletions(-) diff --git a/.gitignore b/.gitignore index 0fc2c63bc0..ffdd58d335 100644 --- a/.gitignore +++ b/.gitignore @@ -100,6 +100,3 @@ examples/jupyter/plots .python-version .coverage htmlcov - -# Test data -tests/xsdir diff --git a/docs/source/usersguide/tallies.rst b/docs/source/usersguide/tallies.rst index 19691e32bf..bbec016423 100644 --- a/docs/source/usersguide/tallies.rst +++ b/docs/source/usersguide/tallies.rst @@ -24,7 +24,7 @@ function (:math:`f` in the above equation) should be used. The regions of phase space are generally called *filters* and the scoring functions are simply called *scores*. -The only cases when *filters* do not correspond directly with the regions of +The only cases when filters do not correspond directly with the regions of phase space are when expansion functions are applied in the integrand, such as for Legendre expansions of the scattering kernel. diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index 81b4420d9c..46f48fdfca 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -1925,7 +1925,7 @@ class MGXS(metaclass=ABCMeta): # Add the Legendre bin to the column if it exists if 'legendre' in df: - columns += ['legendre'] + columns.append('legendre') # If user requested micro cross sections, divide out the atom densities if xs_type == 'micro': diff --git a/openmc/tallies.py b/openmc/tallies.py index 1ac89129a9..a5341cbedd 100644 --- a/openmc/tallies.py +++ b/openmc/tallies.py @@ -391,8 +391,7 @@ class Tally(IDManagerMixin): 'nu-scatter-p', 'scatter-y', 'nu-scatter-y', 'flux-y', 'total-y']: if score.startswith(deprecated): - msg = score.strip() + ' is deprecated and should no ' \ - 'longer be used.' + msg = score.strip() + ' is no longer supported.' raise ValueError(msg) scores[i] = score.strip() diff --git a/src/summary.F90 b/src/summary.F90 index 409c4de1f5..a245648ef1 100644 --- a/src/summary.F90 +++ b/src/summary.F90 @@ -459,8 +459,6 @@ contains ! Find the number of macroscopic and nuclide data in this material num_nuclides = 0 num_macros = 0 - k = 1 - n = 1 do j = 1, m % n_nuclides if (nuclides_MG(m % nuclide(j)) % obj % awr /= MACROSCOPIC_AWR) then num_nuclides = num_nuclides + 1 diff --git a/src/tallies/tally.F90 b/src/tallies/tally.F90 index 483246b362..2e1d6184c3 100644 --- a/src/tallies/tally.F90 +++ b/src/tallies/tally.F90 @@ -1199,8 +1199,9 @@ contains !######################################################################### ! Expand score if necessary and add to tally results. - call expand_and_score(p, t, score_index, filter_index, score_bin, & - score, i) +!$omp atomic + t % results(RESULT_VALUE, score_index, filter_index) = & + t % results(RESULT_VALUE, score_index, filter_index) + score end do SCORE_LOOP end subroutine score_general_ce @@ -1982,36 +1983,15 @@ contains !######################################################################### ! Expand score if necessary and add to tally results. - call expand_and_score(p, t, score_index, filter_index, score_bin, & - score, i) +!$omp atomic + t % results(RESULT_VALUE, score_index, filter_index) = & + t % results(RESULT_VALUE, score_index, filter_index) + score end do SCORE_LOOP nullify(matxs, nucxs) end subroutine score_general_mg -!=============================================================================== -! EXPAND_AND_SCORE takes a previously determined score value and adjusts it -! if necessary (for functional expansion weighting), and then adds the resultant -! value to the tally results array. -!=============================================================================== - - subroutine expand_and_score(p, t, score_index, filter_index, score_bin, & - score, i) - type(Particle), intent(in) :: p - type(TallyObject), intent(inout) :: t - integer, intent(inout) :: score_index - integer, intent(in) :: filter_index ! for % results - integer, intent(in) :: score_bin ! score of concern - real(8), intent(inout) :: score ! data to score - integer, intent(inout) :: i ! Working index - -!$omp atomic - t % results(RESULT_VALUE, score_index, filter_index) = & - t % results(RESULT_VALUE, score_index, filter_index) + score - - end subroutine expand_and_score - !=============================================================================== ! SCORE_ALL_NUCLIDES tallies individual nuclide reaction rates specifically when ! the user requests all. @@ -2961,8 +2941,10 @@ contains score_index = q ! Expand score if necessary and add to tally results. - call expand_and_score(p, t, score_index, filter_index, score_bin, & - score, k) +!$omp atomic + t % results(RESULT_VALUE, score_index, filter_index) = & + t % results(RESULT_VALUE, score_index, filter_index) + score + end do SCORE_LOOP ! ====================================================================== diff --git a/tests/regression_tests/tallies/test.py b/tests/regression_tests/tallies/test.py index 53ce60b628..b86d71d006 100644 --- a/tests/regression_tests/tallies/test.py +++ b/tests/regression_tests/tallies/test.py @@ -18,12 +18,12 @@ def test_tallies(): azimuthal_bins = (-3.14159, -1.8850, -0.6283, 0.6283, 1.8850, 3.14159) azimuthal_filter = AzimuthalFilter(azimuthal_bins) - azimuthal_tally1 = Tally(tally_id=1) + azimuthal_tally1 = Tally() azimuthal_tally1.filters = [azimuthal_filter] azimuthal_tally1.scores = ['flux'] azimuthal_tally1.estimator = 'tracklength' - azimuthal_tally2 = Tally(tally_id=2) + azimuthal_tally2 = Tally() azimuthal_tally2.filters = [azimuthal_filter] azimuthal_tally2.scores = ['flux'] azimuthal_tally2.estimator = 'analog' @@ -33,38 +33,38 @@ def test_tallies(): mesh_2x2.upper_right = [182.07, 182.07] mesh_2x2.dimension = [2, 2] mesh_filter = MeshFilter(mesh_2x2) - azimuthal_tally3 = Tally(tally_id=3) + azimuthal_tally3 = Tally() azimuthal_tally3.filters = [azimuthal_filter, mesh_filter] azimuthal_tally3.scores = ['flux'] azimuthal_tally3.estimator = 'tracklength' - cellborn_tally = Tally(tally_id=4) + cellborn_tally = Tally() cellborn_tally.filters = [ CellbornFilter((model.geometry.get_all_cells()[10], model.geometry.get_all_cells()[21], 22, 23))] # Test both Cell objects and ids cellborn_tally.scores = ['total'] - dg_tally = Tally(tally_id=5) + dg_tally = Tally() dg_tally.filters = [DelayedGroupFilter((1, 2, 3, 4, 5, 6))] dg_tally.scores = ['delayed-nu-fission'] four_groups = (0.0, 0.253, 1.0e3, 1.0e6, 20.0e6) energy_filter = EnergyFilter(four_groups) - energy_tally = Tally(tally_id=6) + energy_tally = Tally() energy_tally.filters = [energy_filter] energy_tally.scores = ['total'] energyout_filter = EnergyoutFilter(four_groups) - energyout_tally = Tally(tally_id=7) + energyout_tally = Tally() energyout_tally.filters = [energyout_filter] energyout_tally.scores = ['scatter'] - transfer_tally = Tally(tally_id=8) + transfer_tally = Tally() transfer_tally.filters = [energy_filter, energyout_filter] transfer_tally.scores = ['scatter', 'nu-fission'] - material_tally = Tally(tally_id=9) + material_tally = Tally() material_tally.filters = [ MaterialFilter((model.geometry.get_materials_by_name('UOX fuel')[0], model.geometry.get_materials_by_name('Zircaloy')[0], @@ -73,56 +73,56 @@ def test_tallies(): mu_bins = (-1.0, -0.5, 0.0, 0.5, 1.0) mu_filter = MuFilter(mu_bins) - mu_tally1 = Tally(tally_id=10) + mu_tally1 = Tally() mu_tally1.filters = [mu_filter] mu_tally1.scores = ['scatter', 'nu-scatter'] print('mu_tally1', mu_tally1.id) - mu_tally2 = Tally(tally_id=11) + mu_tally2 = Tally() mu_tally2.filters = [mu_filter, mesh_filter] mu_tally2.scores = ['scatter', 'nu-scatter'] polar_bins = (0.0, 0.6283, 1.2566, 1.8850, 2.5132, 3.14159) polar_filter = PolarFilter(polar_bins) - polar_tally1 = Tally(tally_id=12) + polar_tally1 = Tally() polar_tally1.filters = [polar_filter] polar_tally1.scores = ['flux'] polar_tally1.estimator = 'tracklength' - polar_tally2 = Tally(tally_id=13) + polar_tally2 = Tally() polar_tally2.filters = [polar_filter] polar_tally2.scores = ['flux'] polar_tally2.estimator = 'analog' - polar_tally3 = Tally(tally_id=14) + polar_tally3 = Tally() polar_tally3.filters = [polar_filter, mesh_filter] polar_tally3.scores = ['flux'] polar_tally3.estimator = 'tracklength' legendre_filter = LegendreFilter(order=4) - legendre_tally = Tally(tally_id=15) + legendre_tally = Tally() legendre_tally.filters = [legendre_filter] legendre_tally.scores = ['scatter', 'nu-scatter'] legendre_tally.estimatir = 'analog' print('legendre_tally', mu_tally1.id) harmonics_filter = SphericalHarmonicsFilter(order=4) - harmonics_tally = Tally(tally_id=16) + harmonics_tally = Tally() harmonics_tally.filters = [harmonics_filter] harmonics_tally.scores = ['scatter', 'nu-scatter', 'flux', 'total'] harmonics_tally.estimatir = 'analog' - harmonics_tally2 = Tally(tally_id=17) + harmonics_tally2 = Tally() harmonics_tally2.filters = [harmonics_filter] harmonics_tally2.scores = ['flux', 'total'] harmonics_tally2.estimatir = 'collision' - harmonics_tally3 = Tally(tally_id=18) + harmonics_tally3 = Tally() harmonics_tally3.filters = [harmonics_filter] harmonics_tally3.scores = ['flux', 'total'] harmonics_tally3.estimatir = 'tracklength' - universe_tally = Tally(tally_id=19) + universe_tally = Tally() universe_tally.filters = [ UniverseFilter((model.geometry.get_all_universes()[1], model.geometry.get_all_universes()[2], @@ -132,8 +132,7 @@ def test_tallies(): cell_filter = CellFilter((model.geometry.get_all_cells()[10], model.geometry.get_all_cells()[21], 22, 23, 60)) # Test both Cell objects and ids - score_tallies = [Tally(tally_id=20), Tally(tally_id=21), - Tally(tally_id=22)] + score_tallies = [Tally(), Tally(), Tally()] for t in score_tallies: t.filters = [cell_filter] t.scores = ['absorption', 'delayed-nu-fission', 'events', 'fission', @@ -146,7 +145,7 @@ def test_tallies(): score_tallies[2].estimator = 'collision' cell_filter2 = CellFilter((21, 22, 23, 27, 28, 29, 60)) - flux_tallies = [Tally(tally_id=23 + i) for i in range(3)] + flux_tallies = [Tally() for i in range(3)] for t in flux_tallies: t.filters = [cell_filter2] t.scores = ['flux'] @@ -154,7 +153,7 @@ def test_tallies(): flux_tallies[1].estimator = 'analog' flux_tallies[2].estimator = 'collision' - total_tallies = [Tally(tally_id=26 + i) for i in range(3)] + total_tallies = [Tally() for i in range(3)] for t in total_tallies: t.filters = [cell_filter] t.scores = ['total'] @@ -163,7 +162,7 @@ def test_tallies(): total_tallies[1].estimator = 'analog' total_tallies[2].estimator = 'collision' - all_nuclide_tallies = [Tally(tally_id=29 + i) for i in range(4)] + all_nuclide_tallies = [Tally() for i in range(4)] for t in all_nuclide_tallies: t.filters = [cell_filter] t.estimator = 'tracklength' diff --git a/tests/unit_tests/test_data_neutron.py b/tests/unit_tests/test_data_neutron.py index 5713bfbc57..03746430d9 100644 --- a/tests/unit_tests/test_data_neutron.py +++ b/tests/unit_tests/test_data_neutron.py @@ -345,10 +345,10 @@ def test_nbody(tmpdir, h2): assert nbody1.q_value == nbody2.q_value -def test_ace_convert(tmpdir): +def test_ace_convert(run_in_tmpdir): filename = os.path.join(_ENDF_DATA, 'neutrons', 'n-001_H_001.endf') - ace_ascii = str(tmpdir.join('ace_ascii')) - ace_binary = str(tmpdir.join('ace_binary')) + ace_ascii = 'ace_ascii' + ace_binary = 'ace_binary' openmc.data.njoy.make_ace(filename, ace=ace_ascii) # Convert to binary From 2de47ec885a9a6946f90c19abc1343d0ef4c46f8 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 1 May 2018 21:02:43 -0500 Subject: [PATCH 223/231] Fix calls to H5Screate_simple --- src/state_point.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/state_point.cpp b/src/state_point.cpp index 2ea9d1c43c..4e6b9a9f9f 100644 --- a/src/state_point.cpp +++ b/src/state_point.cpp @@ -39,13 +39,13 @@ write_source_bank(hid_t group_id, int64_t* work_index, Bank* source_bank) #ifdef PHDF5 // Set size of total dataspace for all procs and rank hsize_t dims[] {static_cast(n_particles)}; - hid_t dspace = H5Screate_simple(1, dims, H5P_DEFAULT); + hid_t dspace = H5Screate_simple(1, dims, nullptr); hid_t dset = H5Dcreate(group_id, "source_bank", banktype, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); // Create another data space but for each proc individually hsize_t count[] {static_cast(openmc_work)}; - hid_t memspace = H5Screate_simple(1, count, H5P_DEFAULT); + hid_t memspace = H5Screate_simple(1, count, nullptr); // Select hyperslab for this dataspace hsize_t start[] {static_cast(work_index[openmc::mpi::rank])}; @@ -69,7 +69,7 @@ write_source_bank(hid_t group_id, int64_t* work_index, Bank* source_bank) if (openmc_master) { // Create dataset big enough to hold all source sites hsize_t dims[] {static_cast(n_particles)}; - hid_t dspace = H5Screate_simple(1, dims, H5P_DEFAULT); + hid_t dspace = H5Screate_simple(1, dims, nullptr); hid_t dset = H5Dcreate(group_id, "source_bank", banktype, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -81,7 +81,7 @@ write_source_bank(hid_t group_id, int64_t* work_index, Bank* source_bank) for (int i = 0; i < openmc::mpi::n_procs; ++i) { // Create memory space hsize_t count[] {static_cast(work_index[i+1] - work_index[i])}; - hid_t memspace = H5Screate_simple(1, count, H5P_DEFAULT); + hid_t memspace = H5Screate_simple(1, count, nullptr); #ifdef OPENMC_MPI // Receive source sites from other processes @@ -130,7 +130,7 @@ void read_source_bank(hid_t group_id, int64_t* work_index, Bank* source_bank) // Create another data space but for each proc individually hsize_t dims[] {static_cast(openmc_work)}; - hid_t memspace = H5Screate_simple(1, dims, H5P_DEFAULT); + hid_t memspace = H5Screate_simple(1, dims, nullptr); // Make sure source bank is big enough hid_t dspace = H5Dget_space(dset); From 9d5275ca263117656290070647aa1b01eb73a297 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Tue, 1 May 2018 22:22:18 -0500 Subject: [PATCH 224/231] Support passing command-line arguments in openmc.capi.init() --- openmc/capi/core.py | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/openmc/capi/core.py b/openmc/capi/core.py index 273f0c0c7f..ad78f06c3d 100644 --- a/openmc/capi/core.py +++ b/openmc/capi/core.py @@ -1,6 +1,6 @@ from contextlib import contextmanager -from ctypes import (CDLL, c_int, c_int32, c_int64, c_double, c_char_p, - POINTER, Structure, c_void_p) +from ctypes import (CDLL, c_int, c_int32, c_int64, c_double, c_char_p, c_char, + POINTER, Structure, c_void_p, create_string_buffer) from warnings import warn import numpy as np @@ -30,7 +30,7 @@ _dll.openmc_find.restype = c_int _dll.openmc_find.errcheck = _error_handler _dll.openmc_hard_reset.restype = c_int _dll.openmc_hard_reset.errcheck = _error_handler -_dll.openmc_init.argtypes = [c_int, POINTER(c_char_p), c_void_p] +_dll.openmc_init.argtypes = [c_int, POINTER(POINTER(c_char)), c_void_p] _dll.openmc_init.restype = c_int _dll.openmc_init.errcheck = _error_handler _dll.openmc_get_keff.argtypes = [POINTER(c_double*2)] @@ -115,15 +115,29 @@ def hard_reset(): _dll.openmc_hard_reset() -def init(intracomm=None): +def init(args=None, intracomm=None): """Initialize OpenMC Parameters ---------- + args : list of str + Command-line arguments intracomm : mpi4py.MPI.Intracomm or None MPI intracommunicator """ + if args is not None: + args = ['openmc'] + list(args) + argc = len(args) + + # Create the argv array. Note that it is actually expected to be of + # length argc + 1 with the final item being a null pointer. + argv = (POINTER(c_char) * (argc + 1))() + for i, arg in enumerate(args): + argv[i] = create_string_buffer(arg.encode()) + else: + argc = 0 + if intracomm is not None: # If an mpi4py communicator was passed, convert it to void* to be passed # to openmc_init @@ -135,7 +149,7 @@ def init(intracomm=None): address = MPI._addressof(intracomm) intracomm = c_void_p(address) - _dll.openmc_init(0, None, intracomm) + _dll.openmc_init(argc, argv, intracomm) def iter_batches(): From 6b1c0f907f991e84b497122448f342392f60b1b0 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 2 May 2018 06:21:09 -0500 Subject: [PATCH 225/231] Fix openmc.capi.init() --- openmc/capi/core.py | 1 + openmc/deplete/operator.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/openmc/capi/core.py b/openmc/capi/core.py index ad78f06c3d..e044f95041 100644 --- a/openmc/capi/core.py +++ b/openmc/capi/core.py @@ -137,6 +137,7 @@ def init(args=None, intracomm=None): argv[i] = create_string_buffer(arg.encode()) else: argc = 0 + argv = None if intracomm is not None: # If an mpi4py communicator was passed, convert it to void* to be passed diff --git a/openmc/deplete/operator.py b/openmc/deplete/operator.py index a1d8ffb0b0..b40ff63447 100644 --- a/openmc/deplete/operator.py +++ b/openmc/deplete/operator.py @@ -268,7 +268,7 @@ class Operator(TransportOperator): # Initialize OpenMC library comm.barrier() - openmc.capi.init(comm) + openmc.capi.init(intracomm=comm) # Generate tallies in memory self._generate_tallies() From 3ab959cc3e9b9c9a3f90b6a96117fb1b032263a3 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Wed, 2 May 2018 15:23:48 -0500 Subject: [PATCH 226/231] Fix bug when no outer lattice universe is defined --- src/geometry.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/geometry.F90 b/src/geometry.F90 index 0bacd7b5d1..e747b619ac 100644 --- a/src/geometry.F90 +++ b/src/geometry.F90 @@ -355,9 +355,10 @@ contains else ! Particle is outside the lattice. if (lat % outer == NO_OUTER_UNIVERSE) then - call p % mark_as_lost("Particle " // trim(to_str(p %id)) & + call warning("Particle " // trim(to_str(p %id)) & // " is outside lattice " // trim(to_str(lat % id)) & // " but the lattice has no defined outer universe.") + found = .false. return else p % coord(j + 1) % universe = lat % outer From 968c12deb515cecdf29aa0fa1de40d6f65dd4a06 Mon Sep 17 00:00:00 2001 From: Adam G Nelson Date: Sat, 5 May 2018 09:24:21 -0400 Subject: [PATCH 227/231] Fixed consistent scatter matrix filter ordering so tests come out consistently and added a mgxs_library_correction and mgxs_library_histogram test --- openmc/mgxs/mgxs.py | 10 + .../mgxs_library_correction/__init__.py | 0 .../mgxs_library_correction/inputs_true.dat | 392 +++++++++++++ .../mgxs_library_correction/results_true.dat | 60 ++ .../mgxs_library_correction/test.py | 63 ++ .../mgxs_library_histogram/__init__.py | 0 .../mgxs_library_histogram/inputs_true.dat | 287 ++++++++++ .../mgxs_library_histogram/results_true.dat | 540 ++++++++++++++++++ .../mgxs_library_histogram/test.py | 64 +++ 9 files changed, 1416 insertions(+) create mode 100644 tests/regression_tests/mgxs_library_correction/__init__.py create mode 100644 tests/regression_tests/mgxs_library_correction/inputs_true.dat create mode 100644 tests/regression_tests/mgxs_library_correction/results_true.dat create mode 100644 tests/regression_tests/mgxs_library_correction/test.py create mode 100644 tests/regression_tests/mgxs_library_histogram/__init__.py create mode 100644 tests/regression_tests/mgxs_library_histogram/inputs_true.dat create mode 100644 tests/regression_tests/mgxs_library_histogram/results_true.dat create mode 100644 tests/regression_tests/mgxs_library_histogram/test.py diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index 5bc00cbc95..1d8ace2824 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -4003,6 +4003,15 @@ class ScatterMatrixXS(MatrixMGXS): correction.nuclides = scatter_p1.nuclides self._xs_tally -= correction + # If the mu filter is before the group out filter swap them + if self.scatter_format == 'histogram': + tally = self._xs_tally + filt = tally.filters + eout_filter = tally.find_filter(openmc.EnergyoutFilter) + angle_filter = tally.find_filter(openmc.MuFilter) + if filt.index(eout_filter) > filt.index(angle_filter): + tally._swap_filters(eout_filter, angle_filter) + self._compute_xs() return self._xs_tally @@ -4466,6 +4475,7 @@ class ScatterMatrixXS(MatrixMGXS): """ + print(self.xs_tally.filters) df = super().get_pandas_dataframe(groups, nuclides, xs_type, paths) if self.scatter_format == 'legendre': diff --git a/tests/regression_tests/mgxs_library_correction/__init__.py b/tests/regression_tests/mgxs_library_correction/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/regression_tests/mgxs_library_correction/inputs_true.dat b/tests/regression_tests/mgxs_library_correction/inputs_true.dat new file mode 100644 index 0000000000..d9793bc3ea --- /dev/null +++ b/tests/regression_tests/mgxs_library_correction/inputs_true.dat @@ -0,0 +1,392 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -0.63 -0.63 -1 0.63 0.63 1 + + + + + + + 1 + + + 0.0 0.625 20000000.0 + + + 0.0 0.625 20000000.0 + + + 2 + + + 3 + + + 1 2 + total + flux + analog + + + 1 2 3 + total + scatter-0 + analog + + + 1 3 + total + scatter-1 + analog + + + 1 2 + total + flux + analog + + + 1 2 3 + total + nu-scatter-0 + analog + + + 1 3 + total + nu-scatter-1 + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 3 + total + scatter-0 + analog + + + 1 3 + total + scatter-1 + analog + + + 1 2 + total + flux + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 3 + total + scatter-0 + analog + + + 1 2 3 + total + nu-scatter-0 + analog + + + 1 2 3 + total + scatter-0 + analog + + + 1 3 + total + nu-scatter-1 + analog + + + 1 2 + total + flux + analog + + + 13 2 + total + flux + analog + + + 13 2 3 + total + scatter-0 + analog + + + 13 3 + total + scatter-1 + analog + + + 13 2 + total + flux + analog + + + 13 2 3 + total + nu-scatter-0 + analog + + + 13 3 + total + nu-scatter-1 + analog + + + 13 2 + total + flux + tracklength + + + 13 2 + total + scatter + tracklength + + + 13 2 3 + total + scatter-0 + analog + + + 13 3 + total + scatter-1 + analog + + + 13 2 + total + flux + analog + + + 13 2 + total + flux + tracklength + + + 13 2 + total + scatter + tracklength + + + 13 2 3 + total + scatter-0 + analog + + + 13 2 3 + total + nu-scatter-0 + analog + + + 13 2 3 + total + scatter-0 + analog + + + 13 3 + total + nu-scatter-1 + analog + + + 13 2 + total + flux + analog + + + 25 2 + total + flux + analog + + + 25 2 3 + total + scatter-0 + analog + + + 25 3 + total + scatter-1 + analog + + + 25 2 + total + flux + analog + + + 25 2 3 + total + nu-scatter-0 + analog + + + 25 3 + total + nu-scatter-1 + analog + + + 25 2 + total + flux + tracklength + + + 25 2 + total + scatter + tracklength + + + 25 2 3 + total + scatter-0 + analog + + + 25 3 + total + scatter-1 + analog + + + 25 2 + total + flux + analog + + + 25 2 + total + flux + tracklength + + + 25 2 + total + scatter + tracklength + + + 25 2 3 + total + scatter-0 + analog + + + 25 2 3 + total + nu-scatter-0 + analog + + + 25 2 3 + total + scatter-0 + analog + + + 25 3 + total + nu-scatter-1 + analog + + + 25 2 + total + flux + analog + + diff --git a/tests/regression_tests/mgxs_library_correction/results_true.dat b/tests/regression_tests/mgxs_library_correction/results_true.dat new file mode 100644 index 0000000000..f7e288802c --- /dev/null +++ b/tests/regression_tests/mgxs_library_correction/results_true.dat @@ -0,0 +1,60 @@ + material group in group out nuclide mean std. dev. +3 1 1 1 total 0.332466 0.026533 +2 1 1 2 total 0.000989 0.000482 +1 1 2 1 total 0.000925 0.000925 +0 1 2 2 total 0.396146 0.015511 + material group in group out nuclide mean std. dev. +3 1 1 1 total 0.332466 0.026533 +2 1 1 2 total 0.000989 0.000482 +1 1 2 1 total 0.000925 0.000925 +0 1 2 2 total 0.396146 0.015511 + material group in group out nuclide mean std. dev. +3 1 1 1 total 0.334690 0.037288 +2 1 1 2 total 0.000995 0.000489 +1 1 2 1 total 0.000887 0.000889 +0 1 2 2 total 0.379453 0.030118 + material group in group out nuclide mean std. dev. +3 1 1 1 total 0.334690 0.048073 +2 1 1 2 total 0.000995 0.000841 +1 1 2 1 total 0.000887 0.001538 +0 1 2 2 total 0.379453 0.034216 + material group in group out nuclide mean std. dev. +3 2 1 1 total 0.271891 0.032748 +2 2 1 2 total 0.000000 0.000000 +1 2 2 1 total 0.000000 0.000000 +0 2 2 2 total 0.307478 0.047512 + material group in group out nuclide mean std. dev. +3 2 1 1 total 0.271891 0.032748 +2 2 1 2 total 0.000000 0.000000 +1 2 2 1 total 0.000000 0.000000 +0 2 2 2 total 0.307478 0.047512 + material group in group out nuclide mean std. dev. +3 2 1 1 total 0.273933 0.038207 +2 2 1 2 total 0.000000 0.000000 +1 2 2 1 total 0.000000 0.000000 +0 2 2 2 total 0.306635 0.052777 + material group in group out nuclide mean std. dev. +3 2 1 1 total 0.273933 0.051116 +2 2 1 2 total 0.000000 0.000000 +1 2 2 1 total 0.000000 0.000000 +0 2 2 2 total 0.306635 0.067497 + material group in group out nuclide mean std. dev. +3 3 1 1 total 0.258652 0.022623 +2 3 1 2 total 0.031368 0.001728 +1 3 2 1 total 0.000443 0.000445 +0 3 2 2 total 1.482300 0.232653 + material group in group out nuclide mean std. dev. +3 3 1 1 total 0.258652 0.022623 +2 3 1 2 total 0.031368 0.001728 +1 3 2 1 total 0.000443 0.000445 +0 3 2 2 total 1.482300 0.232653 + material group in group out nuclide mean std. dev. +3 3 1 1 total 0.251610 0.041472 +2 3 1 2 total 0.031023 0.002232 +1 3 2 1 total 0.000440 0.000445 +0 3 2 2 total 1.467612 0.356408 + material group in group out nuclide mean std. dev. +3 3 1 1 total 0.251610 0.048135 +2 3 1 2 total 0.031023 0.003064 +1 3 2 1 total 0.000440 0.000765 +0 3 2 2 total 1.467612 0.449931 diff --git a/tests/regression_tests/mgxs_library_correction/test.py b/tests/regression_tests/mgxs_library_correction/test.py new file mode 100644 index 0000000000..05eedfef82 --- /dev/null +++ b/tests/regression_tests/mgxs_library_correction/test.py @@ -0,0 +1,63 @@ +import hashlib + +import openmc +import openmc.mgxs +from openmc.examples import pwr_pin_cell + +from tests.testing_harness import PyAPITestHarness + + +class MGXSTestHarness(PyAPITestHarness): + def __init__(self, *args, **kwargs): + # Generate inputs using parent class routine + super().__init__(*args, **kwargs) + + # Initialize a two-group structure + energy_groups = openmc.mgxs.EnergyGroups(group_edges=[0, 0.625, 20.e6]) + + # Initialize MGXS Library for a few cross section types + self.mgxs_lib = openmc.mgxs.Library(self._model.geometry) + self.mgxs_lib.by_nuclide = False + + # Test all MGXS types + self.mgxs_lib.mgxs_types = ['scatter matrix', 'nu-scatter matrix', + 'consistent scatter matrix', + 'consistent nu-scatter matrix'] + self.mgxs_lib.energy_groups = energy_groups + self.mgxs_lib.correction = 'P0' + self.mgxs_lib.domain_type = 'material' + self.mgxs_lib.build_library() + + # Add tallies + self.mgxs_lib.add_to_tallies_file(self._model.tallies, merge=False) + + def _get_results(self, hash_output=False): + """Digest info in the statepoint and return as a string.""" + + # Read the statepoint file. + sp = openmc.StatePoint(self._sp_name) + + # Load the MGXS library from the statepoint + self.mgxs_lib.load_from_statepoint(sp) + + # Build a string from Pandas Dataframe for each MGXS + outstr = '' + for domain in self.mgxs_lib.domains: + for mgxs_type in self.mgxs_lib.mgxs_types: + mgxs = self.mgxs_lib.get_mgxs(domain, mgxs_type) + df = mgxs.get_pandas_dataframe() + outstr += df.to_string() + '\n' + + # Hash the results if necessary + if hash_output: + sha512 = hashlib.sha512() + sha512.update(outstr.encode('utf-8')) + outstr = sha512.hexdigest() + + return outstr + + +def test_mgxs_library_correction(): + model = pwr_pin_cell() + harness = MGXSTestHarness('statepoint.10.h5', model) + harness.main() diff --git a/tests/regression_tests/mgxs_library_histogram/__init__.py b/tests/regression_tests/mgxs_library_histogram/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/regression_tests/mgxs_library_histogram/inputs_true.dat b/tests/regression_tests/mgxs_library_histogram/inputs_true.dat new file mode 100644 index 0000000000..29c46c9374 --- /dev/null +++ b/tests/regression_tests/mgxs_library_histogram/inputs_true.dat @@ -0,0 +1,287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 5 + + + -0.63 -0.63 -1 0.63 0.63 1 + + + + + + + 1 + + + 0.0 0.625 20000000.0 + + + 0.0 0.625 20000000.0 + + + -1.0 -0.818181818182 -0.636363636364 -0.454545454545 -0.272727272727 -0.0909090909091 0.0909090909091 0.272727272727 0.454545454545 0.636363636364 0.818181818182 1.0 + + + 2 + + + 3 + + + 1 2 + total + flux + analog + + + 1 2 3 4 + total + scatter + analog + + + 1 2 + total + flux + analog + + + 1 2 3 4 + total + nu-scatter + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 3 4 + total + scatter-0 + analog + + + 1 2 + total + flux + tracklength + + + 1 2 + total + scatter + tracklength + + + 1 2 3 4 + total + scatter-0 + analog + + + 1 2 3 + total + nu-scatter-0 + analog + + + 1 2 3 + total + scatter-0 + analog + + + 17 2 + total + flux + analog + + + 17 2 3 4 + total + scatter + analog + + + 17 2 + total + flux + analog + + + 17 2 3 4 + total + nu-scatter + analog + + + 17 2 + total + flux + tracklength + + + 17 2 + total + scatter + tracklength + + + 17 2 3 4 + total + scatter-0 + analog + + + 17 2 + total + flux + tracklength + + + 17 2 + total + scatter + tracklength + + + 17 2 3 4 + total + scatter-0 + analog + + + 17 2 3 + total + nu-scatter-0 + analog + + + 17 2 3 + total + scatter-0 + analog + + + 33 2 + total + flux + analog + + + 33 2 3 4 + total + scatter + analog + + + 33 2 + total + flux + analog + + + 33 2 3 4 + total + nu-scatter + analog + + + 33 2 + total + flux + tracklength + + + 33 2 + total + scatter + tracklength + + + 33 2 3 4 + total + scatter-0 + analog + + + 33 2 + total + flux + tracklength + + + 33 2 + total + scatter + tracklength + + + 33 2 3 4 + total + scatter-0 + analog + + + 33 2 3 + total + nu-scatter-0 + analog + + + 33 2 3 + total + scatter-0 + analog + + diff --git a/tests/regression_tests/mgxs_library_histogram/results_true.dat b/tests/regression_tests/mgxs_library_histogram/results_true.dat new file mode 100644 index 0000000000..116a1a9835 --- /dev/null +++ b/tests/regression_tests/mgxs_library_histogram/results_true.dat @@ -0,0 +1,540 @@ + material group in group out mu bin nuclide mean std. dev. +33 1 1 1 1 total 0.025383 0.001933 +34 1 1 1 2 total 0.027855 0.001701 +35 1 1 1 3 total 0.031646 0.002913 +36 1 1 1 4 total 0.028185 0.001430 +37 1 1 1 5 total 0.030162 0.002739 +38 1 1 1 6 total 0.029009 0.002713 +39 1 1 1 7 total 0.030492 0.002907 +40 1 1 1 8 total 0.035272 0.003860 +41 1 1 1 9 total 0.043678 0.006074 +42 1 1 1 10 total 0.044502 0.003030 +43 1 1 1 11 total 0.058017 0.004319 +22 1 1 2 1 total 0.000000 0.000000 +23 1 1 2 2 total 0.000165 0.000165 +24 1 1 2 3 total 0.000330 0.000202 +25 1 1 2 4 total 0.000165 0.000165 +26 1 1 2 5 total 0.000000 0.000000 +27 1 1 2 6 total 0.000165 0.000165 +28 1 1 2 7 total 0.000000 0.000000 +29 1 1 2 8 total 0.000000 0.000000 +30 1 1 2 9 total 0.000000 0.000000 +31 1 1 2 10 total 0.000165 0.000165 +32 1 1 2 11 total 0.000000 0.000000 +11 1 2 1 1 total 0.000925 0.000925 +12 1 2 1 2 total 0.000000 0.000000 +13 1 2 1 3 total 0.000000 0.000000 +14 1 2 1 4 total 0.000000 0.000000 +15 1 2 1 5 total 0.000000 0.000000 +16 1 2 1 6 total 0.000000 0.000000 +17 1 2 1 7 total 0.000000 0.000000 +18 1 2 1 8 total 0.000000 0.000000 +19 1 2 1 9 total 0.000000 0.000000 +20 1 2 1 10 total 0.000000 0.000000 +21 1 2 1 11 total 0.000000 0.000000 +0 1 2 2 1 total 0.037910 0.006498 +1 1 2 2 2 total 0.031438 0.002377 +2 1 2 2 3 total 0.036986 0.006429 +3 1 2 2 4 total 0.029588 0.005627 +4 1 2 2 5 total 0.036986 0.007359 +5 1 2 2 6 total 0.035136 0.004110 +6 1 2 2 7 total 0.037910 0.003188 +7 1 2 2 8 total 0.041609 0.004489 +8 1 2 2 9 total 0.040684 0.007710 +9 1 2 2 10 total 0.043458 0.004638 +10 1 2 2 11 total 0.039760 0.002920 + material group in group out mu bin nuclide mean std. dev. +33 1 1 1 1 total 0.025383 0.001933 +34 1 1 1 2 total 0.027855 0.001701 +35 1 1 1 3 total 0.031646 0.002913 +36 1 1 1 4 total 0.028185 0.001430 +37 1 1 1 5 total 0.030162 0.002739 +38 1 1 1 6 total 0.029009 0.002713 +39 1 1 1 7 total 0.030492 0.002907 +40 1 1 1 8 total 0.035272 0.003860 +41 1 1 1 9 total 0.043678 0.006074 +42 1 1 1 10 total 0.044502 0.003030 +43 1 1 1 11 total 0.058017 0.004319 +22 1 1 2 1 total 0.000000 0.000000 +23 1 1 2 2 total 0.000165 0.000165 +24 1 1 2 3 total 0.000330 0.000202 +25 1 1 2 4 total 0.000165 0.000165 +26 1 1 2 5 total 0.000000 0.000000 +27 1 1 2 6 total 0.000165 0.000165 +28 1 1 2 7 total 0.000000 0.000000 +29 1 1 2 8 total 0.000000 0.000000 +30 1 1 2 9 total 0.000000 0.000000 +31 1 1 2 10 total 0.000165 0.000165 +32 1 1 2 11 total 0.000000 0.000000 +11 1 2 1 1 total 0.000925 0.000925 +12 1 2 1 2 total 0.000000 0.000000 +13 1 2 1 3 total 0.000000 0.000000 +14 1 2 1 4 total 0.000000 0.000000 +15 1 2 1 5 total 0.000000 0.000000 +16 1 2 1 6 total 0.000000 0.000000 +17 1 2 1 7 total 0.000000 0.000000 +18 1 2 1 8 total 0.000000 0.000000 +19 1 2 1 9 total 0.000000 0.000000 +20 1 2 1 10 total 0.000000 0.000000 +21 1 2 1 11 total 0.000000 0.000000 +0 1 2 2 1 total 0.037910 0.006498 +1 1 2 2 2 total 0.031438 0.002377 +2 1 2 2 3 total 0.036986 0.006429 +3 1 2 2 4 total 0.029588 0.005627 +4 1 2 2 5 total 0.036986 0.007359 +5 1 2 2 6 total 0.035136 0.004110 +6 1 2 2 7 total 0.037910 0.003188 +7 1 2 2 8 total 0.041609 0.004489 +8 1 2 2 9 total 0.040684 0.007710 +9 1 2 2 10 total 0.043458 0.004638 +10 1 2 2 11 total 0.039760 0.002920 + material group in group out mu bin nuclide mean std. dev. +33 1 1 1 1 total 0.025529 0.002197 +34 1 1 1 2 total 0.028016 0.002047 +35 1 1 1 3 total 0.031829 0.003196 +36 1 1 1 4 total 0.028348 0.001833 +37 1 1 1 5 total 0.030337 0.003012 +38 1 1 1 6 total 0.029177 0.002969 +39 1 1 1 7 total 0.030668 0.003172 +40 1 1 1 8 total 0.035476 0.004135 +41 1 1 1 9 total 0.043931 0.006358 +42 1 1 1 10 total 0.044759 0.003536 +43 1 1 1 11 total 0.058353 0.004934 +22 1 1 2 1 total 0.000000 0.000000 +23 1 1 2 2 total 0.000166 0.000166 +24 1 1 2 3 total 0.000332 0.000204 +25 1 1 2 4 total 0.000166 0.000166 +26 1 1 2 5 total 0.000000 0.000000 +27 1 1 2 6 total 0.000166 0.000166 +28 1 1 2 7 total 0.000000 0.000000 +29 1 1 2 8 total 0.000000 0.000000 +30 1 1 2 9 total 0.000000 0.000000 +31 1 1 2 10 total 0.000166 0.000166 +32 1 1 2 11 total 0.000000 0.000000 +11 1 2 1 1 total 0.000887 0.000890 +12 1 2 1 2 total 0.000000 0.000000 +13 1 2 1 3 total 0.000000 0.000000 +14 1 2 1 4 total 0.000000 0.000000 +15 1 2 1 5 total 0.000000 0.000000 +16 1 2 1 6 total 0.000000 0.000000 +17 1 2 1 7 total 0.000000 0.000000 +18 1 2 1 8 total 0.000000 0.000000 +19 1 2 1 9 total 0.000000 0.000000 +20 1 2 1 10 total 0.000000 0.000000 +21 1 2 1 11 total 0.000000 0.000000 +0 1 2 2 1 total 0.036372 0.006773 +1 1 2 2 2 total 0.030162 0.003165 +2 1 2 2 3 total 0.035485 0.006687 +3 1 2 2 4 total 0.028388 0.005781 +4 1 2 2 5 total 0.035485 0.007518 +5 1 2 2 6 total 0.033711 0.004644 +6 1 2 2 7 total 0.036372 0.004045 +7 1 2 2 8 total 0.039921 0.005195 +8 1 2 2 9 total 0.039034 0.007923 +9 1 2 2 10 total 0.041695 0.005386 +10 1 2 2 11 total 0.038147 0.003944 + material group in group out mu bin nuclide mean std. dev. +33 1 1 1 1 total 0.025529 0.002974 +34 1 1 1 2 total 0.028016 0.003005 +35 1 1 1 3 total 0.031829 0.004057 +36 1 1 1 4 total 0.028348 0.002884 +37 1 1 1 5 total 0.030337 0.003840 +38 1 1 1 6 total 0.029177 0.003750 +39 1 1 1 7 total 0.030668 0.003982 +40 1 1 1 8 total 0.035476 0.004986 +41 1 1 1 9 total 0.043931 0.007233 +42 1 1 1 10 total 0.044759 0.004986 +43 1 1 1 11 total 0.058353 0.006733 +22 1 1 2 1 total 0.000000 0.000000 +23 1 1 2 2 total 0.000166 0.000201 +24 1 1 2 3 total 0.000332 0.000306 +25 1 1 2 4 total 0.000166 0.000201 +26 1 1 2 5 total 0.000000 0.000000 +27 1 1 2 6 total 0.000166 0.000201 +28 1 1 2 7 total 0.000000 0.000000 +29 1 1 2 8 total 0.000000 0.000000 +30 1 1 2 9 total 0.000000 0.000000 +31 1 1 2 10 total 0.000166 0.000201 +32 1 1 2 11 total 0.000000 0.000000 +11 1 2 1 1 total 0.000887 0.001538 +12 1 2 1 2 total 0.000000 0.000000 +13 1 2 1 3 total 0.000000 0.000000 +14 1 2 1 4 total 0.000000 0.000000 +15 1 2 1 5 total 0.000000 0.000000 +16 1 2 1 6 total 0.000000 0.000000 +17 1 2 1 7 total 0.000000 0.000000 +18 1 2 1 8 total 0.000000 0.000000 +19 1 2 1 9 total 0.000000 0.000000 +20 1 2 1 10 total 0.000000 0.000000 +21 1 2 1 11 total 0.000000 0.000000 +0 1 2 2 1 total 0.036372 0.006936 +1 1 2 2 2 total 0.030162 0.003400 +2 1 2 2 3 total 0.035485 0.006844 +3 1 2 2 4 total 0.028388 0.005898 +4 1 2 2 5 total 0.035485 0.007658 +5 1 2 2 6 total 0.033711 0.004847 +6 1 2 2 7 total 0.036372 0.004312 +7 1 2 2 8 total 0.039921 0.005448 +8 1 2 2 9 total 0.039034 0.008084 +9 1 2 2 10 total 0.041695 0.005652 +10 1 2 2 11 total 0.038147 0.004245 + material group in group out mu bin nuclide mean std. dev. +33 2 1 1 1 total 0.026289 0.004089 +34 2 1 1 2 total 0.018269 0.002939 +35 2 1 1 3 total 0.025398 0.002153 +36 2 1 1 4 total 0.024061 0.005097 +37 2 1 1 5 total 0.022279 0.003375 +38 2 1 1 6 total 0.027626 0.004817 +39 2 1 1 7 total 0.025843 0.003039 +40 2 1 1 8 total 0.026735 0.006742 +41 2 1 1 9 total 0.027626 0.005213 +42 2 1 1 10 total 0.036537 0.005920 +43 2 1 1 11 total 0.049459 0.004153 +22 2 1 2 1 total 0.000000 0.000000 +23 2 1 2 2 total 0.000000 0.000000 +24 2 1 2 3 total 0.000000 0.000000 +25 2 1 2 4 total 0.000000 0.000000 +26 2 1 2 5 total 0.000000 0.000000 +27 2 1 2 6 total 0.000000 0.000000 +28 2 1 2 7 total 0.000000 0.000000 +29 2 1 2 8 total 0.000000 0.000000 +30 2 1 2 9 total 0.000000 0.000000 +31 2 1 2 10 total 0.000000 0.000000 +32 2 1 2 11 total 0.000000 0.000000 +11 2 2 1 1 total 0.000000 0.000000 +12 2 2 1 2 total 0.000000 0.000000 +13 2 2 1 3 total 0.000000 0.000000 +14 2 2 1 4 total 0.000000 0.000000 +15 2 2 1 5 total 0.000000 0.000000 +16 2 2 1 6 total 0.000000 0.000000 +17 2 2 1 7 total 0.000000 0.000000 +18 2 2 1 8 total 0.000000 0.000000 +19 2 2 1 9 total 0.000000 0.000000 +20 2 2 1 10 total 0.000000 0.000000 +21 2 2 1 11 total 0.000000 0.000000 +0 2 2 2 1 total 0.024485 0.007210 +1 2 2 2 2 total 0.036727 0.005548 +2 2 2 2 3 total 0.041624 0.010918 +3 2 2 2 4 total 0.019588 0.008569 +4 2 2 2 5 total 0.022036 0.007526 +5 2 2 2 6 total 0.019588 0.011549 +6 2 2 2 7 total 0.022036 0.006454 +7 2 2 2 8 total 0.036727 0.010282 +8 2 2 2 9 total 0.022036 0.005164 +9 2 2 2 10 total 0.031830 0.011864 +10 2 2 2 11 total 0.019588 0.005336 + material group in group out mu bin nuclide mean std. dev. +33 2 1 1 1 total 0.026289 0.004089 +34 2 1 1 2 total 0.018269 0.002939 +35 2 1 1 3 total 0.025398 0.002153 +36 2 1 1 4 total 0.024061 0.005097 +37 2 1 1 5 total 0.022279 0.003375 +38 2 1 1 6 total 0.027626 0.004817 +39 2 1 1 7 total 0.025843 0.003039 +40 2 1 1 8 total 0.026735 0.006742 +41 2 1 1 9 total 0.027626 0.005213 +42 2 1 1 10 total 0.036537 0.005920 +43 2 1 1 11 total 0.049459 0.004153 +22 2 1 2 1 total 0.000000 0.000000 +23 2 1 2 2 total 0.000000 0.000000 +24 2 1 2 3 total 0.000000 0.000000 +25 2 1 2 4 total 0.000000 0.000000 +26 2 1 2 5 total 0.000000 0.000000 +27 2 1 2 6 total 0.000000 0.000000 +28 2 1 2 7 total 0.000000 0.000000 +29 2 1 2 8 total 0.000000 0.000000 +30 2 1 2 9 total 0.000000 0.000000 +31 2 1 2 10 total 0.000000 0.000000 +32 2 1 2 11 total 0.000000 0.000000 +11 2 2 1 1 total 0.000000 0.000000 +12 2 2 1 2 total 0.000000 0.000000 +13 2 2 1 3 total 0.000000 0.000000 +14 2 2 1 4 total 0.000000 0.000000 +15 2 2 1 5 total 0.000000 0.000000 +16 2 2 1 6 total 0.000000 0.000000 +17 2 2 1 7 total 0.000000 0.000000 +18 2 2 1 8 total 0.000000 0.000000 +19 2 2 1 9 total 0.000000 0.000000 +20 2 2 1 10 total 0.000000 0.000000 +21 2 2 1 11 total 0.000000 0.000000 +0 2 2 2 1 total 0.024485 0.007210 +1 2 2 2 2 total 0.036727 0.005548 +2 2 2 2 3 total 0.041624 0.010918 +3 2 2 2 4 total 0.019588 0.008569 +4 2 2 2 5 total 0.022036 0.007526 +5 2 2 2 6 total 0.019588 0.011549 +6 2 2 2 7 total 0.022036 0.006454 +7 2 2 2 8 total 0.036727 0.010282 +8 2 2 2 9 total 0.022036 0.005164 +9 2 2 2 10 total 0.031830 0.011864 +10 2 2 2 11 total 0.019588 0.005336 + material group in group out mu bin nuclide mean std. dev. +33 2 1 1 1 total 0.026462 0.003961 +34 2 1 1 2 total 0.018389 0.002854 +35 2 1 1 3 total 0.025565 0.001877 +36 2 1 1 4 total 0.024220 0.005027 +37 2 1 1 5 total 0.022425 0.003262 +38 2 1 1 6 total 0.027808 0.004704 +39 2 1 1 7 total 0.026014 0.002854 +40 2 1 1 8 total 0.026911 0.006690 +41 2 1 1 9 total 0.027808 0.005114 +42 2 1 1 10 total 0.036778 0.005752 +43 2 1 1 11 total 0.049785 0.003610 +22 2 1 2 1 total 0.000000 0.000000 +23 2 1 2 2 total 0.000000 0.000000 +24 2 1 2 3 total 0.000000 0.000000 +25 2 1 2 4 total 0.000000 0.000000 +26 2 1 2 5 total 0.000000 0.000000 +27 2 1 2 6 total 0.000000 0.000000 +28 2 1 2 7 total 0.000000 0.000000 +29 2 1 2 8 total 0.000000 0.000000 +30 2 1 2 9 total 0.000000 0.000000 +31 2 1 2 10 total 0.000000 0.000000 +32 2 1 2 11 total 0.000000 0.000000 +11 2 2 1 1 total 0.000000 0.000000 +12 2 2 1 2 total 0.000000 0.000000 +13 2 2 1 3 total 0.000000 0.000000 +14 2 2 1 4 total 0.000000 0.000000 +15 2 2 1 5 total 0.000000 0.000000 +16 2 2 1 6 total 0.000000 0.000000 +17 2 2 1 7 total 0.000000 0.000000 +18 2 2 1 8 total 0.000000 0.000000 +19 2 2 1 9 total 0.000000 0.000000 +20 2 2 1 10 total 0.000000 0.000000 +21 2 2 1 11 total 0.000000 0.000000 +0 2 2 2 1 total 0.024415 0.007393 +1 2 2 2 2 total 0.036622 0.006106 +2 2 2 2 3 total 0.041505 0.011274 +3 2 2 2 4 total 0.019532 0.008656 +4 2 2 2 5 total 0.021973 0.007663 +5 2 2 2 6 total 0.019532 0.011599 +6 2 2 2 7 total 0.021973 0.006620 +7 2 2 2 8 total 0.036622 0.010574 +8 2 2 2 9 total 0.021973 0.005378 +9 2 2 2 10 total 0.031739 0.012040 +10 2 2 2 11 total 0.019532 0.005496 + material group in group out mu bin nuclide mean std. dev. +33 2 1 1 1 total 0.026462 0.004896 +34 2 1 1 2 total 0.018389 0.003485 +35 2 1 1 3 total 0.025565 0.003355 +36 2 1 1 4 total 0.024220 0.005676 +37 2 1 1 5 total 0.022425 0.004073 +38 2 1 1 6 total 0.027808 0.005593 +39 2 1 1 7 total 0.026014 0.004019 +40 2 1 1 8 total 0.026911 0.007302 +41 2 1 1 9 total 0.027808 0.005941 +42 2 1 1 10 total 0.036778 0.007007 +43 2 1 1 11 total 0.049785 0.006508 +22 2 1 2 1 total 0.000000 0.000000 +23 2 1 2 2 total 0.000000 0.000000 +24 2 1 2 3 total 0.000000 0.000000 +25 2 1 2 4 total 0.000000 0.000000 +26 2 1 2 5 total 0.000000 0.000000 +27 2 1 2 6 total 0.000000 0.000000 +28 2 1 2 7 total 0.000000 0.000000 +29 2 1 2 8 total 0.000000 0.000000 +30 2 1 2 9 total 0.000000 0.000000 +31 2 1 2 10 total 0.000000 0.000000 +32 2 1 2 11 total 0.000000 0.000000 +11 2 2 1 1 total 0.000000 0.000000 +12 2 2 1 2 total 0.000000 0.000000 +13 2 2 1 3 total 0.000000 0.000000 +14 2 2 1 4 total 0.000000 0.000000 +15 2 2 1 5 total 0.000000 0.000000 +16 2 2 1 6 total 0.000000 0.000000 +17 2 2 1 7 total 0.000000 0.000000 +18 2 2 1 8 total 0.000000 0.000000 +19 2 2 1 9 total 0.000000 0.000000 +20 2 2 1 10 total 0.000000 0.000000 +21 2 2 1 11 total 0.000000 0.000000 +0 2 2 2 1 total 0.024415 0.008170 +1 2 2 2 2 total 0.036622 0.008031 +2 2 2 2 3 total 0.041505 0.012730 +3 2 2 2 4 total 0.019532 0.009092 +4 2 2 2 5 total 0.021973 0.008278 +5 2 2 2 6 total 0.019532 0.011928 +6 2 2 2 7 total 0.021973 0.007322 +7 2 2 2 8 total 0.036622 0.011790 +8 2 2 2 9 total 0.021973 0.006222 +9 2 2 2 10 total 0.031739 0.012861 +10 2 2 2 11 total 0.019532 0.006160 + material group in group out mu bin nuclide mean std. dev. +33 3 1 1 1 total 0.007001 0.000582 +34 3 1 1 2 total 0.007728 0.001008 +35 3 1 1 3 total 0.006819 0.001120 +36 3 1 1 4 total 0.006092 0.000787 +37 3 1 1 5 total 0.007183 0.000663 +38 3 1 1 6 total 0.011274 0.000704 +39 3 1 1 7 total 0.042642 0.002093 +40 3 1 1 8 total 0.074464 0.002664 +41 3 1 1 9 total 0.119015 0.006892 +42 3 1 1 10 total 0.153293 0.006049 +43 3 1 1 11 total 0.204390 0.010619 +22 3 1 2 1 total 0.000818 0.000302 +23 3 1 2 2 total 0.000818 0.000094 +24 3 1 2 3 total 0.001091 0.000234 +25 3 1 2 4 total 0.001091 0.000310 +26 3 1 2 5 total 0.002546 0.000607 +27 3 1 2 6 total 0.002364 0.000340 +28 3 1 2 7 total 0.004546 0.000835 +29 3 1 2 8 total 0.004819 0.000831 +30 3 1 2 9 total 0.006092 0.001113 +31 3 1 2 10 total 0.004546 0.000757 +32 3 1 2 11 total 0.002637 0.000371 +11 3 2 1 1 total 0.000000 0.000000 +12 3 2 1 2 total 0.000000 0.000000 +13 3 2 1 3 total 0.000000 0.000000 +14 3 2 1 4 total 0.000000 0.000000 +15 3 2 1 5 total 0.000000 0.000000 +16 3 2 1 6 total 0.000000 0.000000 +17 3 2 1 7 total 0.000000 0.000000 +18 3 2 1 8 total 0.000000 0.000000 +19 3 2 1 9 total 0.000000 0.000000 +20 3 2 1 10 total 0.000000 0.000000 +21 3 2 1 11 total 0.000443 0.000445 +0 3 2 2 1 total 0.088669 0.015373 +1 3 2 2 2 total 0.098422 0.016029 +2 3 2 2 3 total 0.126796 0.022922 +3 3 2 2 4 total 0.118373 0.018371 +4 3 2 2 5 total 0.131230 0.014538 +5 3 2 2 6 total 0.167584 0.027220 +6 3 2 2 7 total 0.180441 0.023605 +7 3 2 2 8 total 0.213691 0.028779 +8 3 2 2 9 total 0.236745 0.024777 +9 3 2 2 10 total 0.333394 0.041247 +10 3 2 2 11 total 0.339601 0.037814 + material group in group out mu bin nuclide mean std. dev. +33 3 1 1 1 total 0.007001 0.000582 +34 3 1 1 2 total 0.007728 0.001008 +35 3 1 1 3 total 0.006819 0.001120 +36 3 1 1 4 total 0.006092 0.000787 +37 3 1 1 5 total 0.007183 0.000663 +38 3 1 1 6 total 0.011274 0.000704 +39 3 1 1 7 total 0.042642 0.002093 +40 3 1 1 8 total 0.074464 0.002664 +41 3 1 1 9 total 0.119015 0.006892 +42 3 1 1 10 total 0.153293 0.006049 +43 3 1 1 11 total 0.204390 0.010619 +22 3 1 2 1 total 0.000818 0.000302 +23 3 1 2 2 total 0.000818 0.000094 +24 3 1 2 3 total 0.001091 0.000234 +25 3 1 2 4 total 0.001091 0.000310 +26 3 1 2 5 total 0.002546 0.000607 +27 3 1 2 6 total 0.002364 0.000340 +28 3 1 2 7 total 0.004546 0.000835 +29 3 1 2 8 total 0.004819 0.000831 +30 3 1 2 9 total 0.006092 0.001113 +31 3 1 2 10 total 0.004546 0.000757 +32 3 1 2 11 total 0.002637 0.000371 +11 3 2 1 1 total 0.000000 0.000000 +12 3 2 1 2 total 0.000000 0.000000 +13 3 2 1 3 total 0.000000 0.000000 +14 3 2 1 4 total 0.000000 0.000000 +15 3 2 1 5 total 0.000000 0.000000 +16 3 2 1 6 total 0.000000 0.000000 +17 3 2 1 7 total 0.000000 0.000000 +18 3 2 1 8 total 0.000000 0.000000 +19 3 2 1 9 total 0.000000 0.000000 +20 3 2 1 10 total 0.000000 0.000000 +21 3 2 1 11 total 0.000443 0.000445 +0 3 2 2 1 total 0.088669 0.015373 +1 3 2 2 2 total 0.098422 0.016029 +2 3 2 2 3 total 0.126796 0.022922 +3 3 2 2 4 total 0.118373 0.018371 +4 3 2 2 5 total 0.131230 0.014538 +5 3 2 2 6 total 0.167584 0.027220 +6 3 2 2 7 total 0.180441 0.023605 +7 3 2 2 8 total 0.213691 0.028779 +8 3 2 2 9 total 0.236745 0.024777 +9 3 2 2 10 total 0.333394 0.041247 +10 3 2 2 11 total 0.339601 0.037814 + material group in group out mu bin nuclide mean std. dev. +33 3 1 1 1 total 0.006924 0.000646 +34 3 1 1 2 total 0.007643 0.001048 +35 3 1 1 3 total 0.006744 0.001144 +36 3 1 1 4 total 0.006025 0.000819 +37 3 1 1 5 total 0.007104 0.000721 +38 3 1 1 6 total 0.011150 0.000841 +39 3 1 1 7 total 0.042173 0.002735 +40 3 1 1 8 total 0.073645 0.004084 +41 3 1 1 9 total 0.117706 0.008446 +42 3 1 1 10 total 0.151606 0.008778 +43 3 1 1 11 total 0.202141 0.013551 +22 3 1 2 1 total 0.000809 0.000301 +23 3 1 2 2 total 0.000809 0.000099 +24 3 1 2 3 total 0.001079 0.000236 +25 3 1 2 4 total 0.001079 0.000310 +26 3 1 2 5 total 0.002518 0.000610 +27 3 1 2 6 total 0.002338 0.000351 +28 3 1 2 7 total 0.004496 0.000848 +29 3 1 2 8 total 0.004766 0.000847 +30 3 1 2 9 total 0.006025 0.001130 +31 3 1 2 10 total 0.004496 0.000773 +32 3 1 2 11 total 0.002608 0.000383 +11 3 2 1 1 total 0.000000 0.000000 +12 3 2 1 2 total 0.000000 0.000000 +13 3 2 1 3 total 0.000000 0.000000 +14 3 2 1 4 total 0.000000 0.000000 +15 3 2 1 5 total 0.000000 0.000000 +16 3 2 1 6 total 0.000000 0.000000 +17 3 2 1 7 total 0.000000 0.000000 +18 3 2 1 8 total 0.000000 0.000000 +19 3 2 1 9 total 0.000000 0.000000 +20 3 2 1 10 total 0.000000 0.000000 +21 3 2 1 11 total 0.000440 0.000443 +0 3 2 2 1 total 0.088029 0.016753 +1 3 2 2 2 total 0.097712 0.017664 +2 3 2 2 3 total 0.125881 0.024808 +3 3 2 2 4 total 0.117518 0.020437 +4 3 2 2 5 total 0.130282 0.017687 +5 3 2 2 6 total 0.166374 0.030012 +6 3 2 2 7 total 0.179138 0.027327 +7 3 2 2 8 total 0.212149 0.033068 +8 3 2 2 9 total 0.235036 0.030744 +9 3 2 2 10 total 0.330988 0.048491 +10 3 2 2 11 total 0.337150 0.045927 + material group in group out mu bin nuclide mean std. dev. +33 3 1 1 1 total 0.006924 0.000699 +34 3 1 1 2 total 0.007643 0.001089 +35 3 1 1 3 total 0.006744 0.001173 +36 3 1 1 4 total 0.006025 0.000851 +37 3 1 1 5 total 0.007104 0.000772 +38 3 1 1 6 total 0.011150 0.000945 +39 3 1 1 7 total 0.042173 0.003183 +40 3 1 1 8 total 0.073645 0.004976 +41 3 1 1 9 total 0.117706 0.009591 +42 3 1 1 10 total 0.151606 0.010550 +43 3 1 1 11 total 0.202141 0.015638 +22 3 1 2 1 total 0.000809 0.000306 +23 3 1 2 2 total 0.000809 0.000113 +24 3 1 2 3 total 0.001079 0.000247 +25 3 1 2 4 total 0.001079 0.000318 +26 3 1 2 5 total 0.002518 0.000633 +27 3 1 2 6 total 0.002338 0.000385 +28 3 1 2 7 total 0.004496 0.000901 +29 3 1 2 8 total 0.004766 0.000906 +30 3 1 2 9 total 0.006025 0.001201 +31 3 1 2 10 total 0.004496 0.000830 +32 3 1 2 11 total 0.002608 0.000422 +11 3 2 1 1 total 0.000000 0.000000 +12 3 2 1 2 total 0.000000 0.000000 +13 3 2 1 3 total 0.000000 0.000000 +14 3 2 1 4 total 0.000000 0.000000 +15 3 2 1 5 total 0.000000 0.000000 +16 3 2 1 6 total 0.000000 0.000000 +17 3 2 1 7 total 0.000000 0.000000 +18 3 2 1 8 total 0.000000 0.000000 +19 3 2 1 9 total 0.000000 0.000000 +20 3 2 1 10 total 0.000000 0.000000 +21 3 2 1 11 total 0.000440 0.000764 +0 3 2 2 1 total 0.088029 0.020587 +1 3 2 2 2 total 0.097712 0.022100 +2 3 2 2 3 total 0.125881 0.030136 +3 3 2 2 4 total 0.117518 0.025939 +4 3 2 2 5 total 0.130282 0.025029 +5 3 2 2 6 total 0.166374 0.037579 +6 3 2 2 7 total 0.179138 0.036602 +7 3 2 2 8 total 0.212149 0.043875 +8 3 2 2 9 total 0.235036 0.044338 +9 3 2 2 10 total 0.330988 0.066148 +10 3 2 2 11 total 0.337150 0.064881 diff --git a/tests/regression_tests/mgxs_library_histogram/test.py b/tests/regression_tests/mgxs_library_histogram/test.py new file mode 100644 index 0000000000..b9905910ab --- /dev/null +++ b/tests/regression_tests/mgxs_library_histogram/test.py @@ -0,0 +1,64 @@ +import hashlib + +import openmc +import openmc.mgxs +from openmc.examples import pwr_pin_cell + +from tests.testing_harness import PyAPITestHarness + + +class MGXSTestHarness(PyAPITestHarness): + def __init__(self, *args, **kwargs): + # Generate inputs using parent class routine + super().__init__(*args, **kwargs) + + # Initialize a two-group structure + energy_groups = openmc.mgxs.EnergyGroups(group_edges=[0, 0.625, 20.e6]) + + # Initialize MGXS Library for a few cross section types + self.mgxs_lib = openmc.mgxs.Library(self._model.geometry) + self.mgxs_lib.by_nuclide = False + + # Test all MGXS types + self.mgxs_lib.mgxs_types = ['scatter matrix', 'nu-scatter matrix', + 'consistent scatter matrix', + 'consistent nu-scatter matrix'] + self.mgxs_lib.energy_groups = energy_groups + self.mgxs_lib.scatter_format = 'histogram' + self.mgxs_lib.histogram_bins = 11 + self.mgxs_lib.domain_type = 'material' + self.mgxs_lib.build_library() + + # Add tallies + self.mgxs_lib.add_to_tallies_file(self._model.tallies, merge=False) + + def _get_results(self, hash_output=False): + """Digest info in the statepoint and return as a string.""" + + # Read the statepoint file. + sp = openmc.StatePoint(self._sp_name) + + # Load the MGXS library from the statepoint + self.mgxs_lib.load_from_statepoint(sp) + + # Build a string from Pandas Dataframe for each MGXS + outstr = '' + for domain in self.mgxs_lib.domains: + for mgxs_type in self.mgxs_lib.mgxs_types: + mgxs = self.mgxs_lib.get_mgxs(domain, mgxs_type) + df = mgxs.get_pandas_dataframe() + outstr += df.to_string() + '\n' + + # Hash the results if necessary + if hash_output: + sha512 = hashlib.sha512() + sha512.update(outstr.encode('utf-8')) + outstr = sha512.hexdigest() + + return outstr + + +def test_mgxs_library_histogram(): + model = pwr_pin_cell() + harness = MGXSTestHarness('statepoint.10.h5', model) + harness.main() From 45d9234fdfab74e96f42fed27f7c045d9701e766 Mon Sep 17 00:00:00 2001 From: Adam G Nelson Date: Sat, 5 May 2018 11:15:11 -0400 Subject: [PATCH 228/231] Fixing df.drop call using newer pandas syntax instead of backwards-compatible syntax --- openmc/mgxs/mgxs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openmc/mgxs/mgxs.py b/openmc/mgxs/mgxs.py index 560c6e9862..172d7ddb38 100644 --- a/openmc/mgxs/mgxs.py +++ b/openmc/mgxs/mgxs.py @@ -4505,7 +4505,7 @@ class ScatterMatrixXS(MatrixMGXS): # If the matrix is P0, remove the legendre column if self.scatter_format == 'legendre' and self.legendre_order == 0: - df = df.drop(columns=['legendre']) + df = df.drop(axis=1, labels=['legendre']) return df From 6d84ed8d5346eefb9b78fa358a806a1b1de77b0f Mon Sep 17 00:00:00 2001 From: Adam G Nelson Date: Sat, 5 May 2018 11:20:13 -0400 Subject: [PATCH 229/231] Resetting mgxs_library_histogram test results back to before the MGXS Api changes so I can more easily see progress --- .../mgxs_library_histogram/results_true.dat | 164 +++++++++--------- 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/tests/regression_tests/mgxs_library_histogram/results_true.dat b/tests/regression_tests/mgxs_library_histogram/results_true.dat index 20625efd06..116a1a9835 100644 --- a/tests/regression_tests/mgxs_library_histogram/results_true.dat +++ b/tests/regression_tests/mgxs_library_histogram/results_true.dat @@ -134,27 +134,27 @@ 9 1 2 2 10 total 0.041695 0.005386 10 1 2 2 11 total 0.038147 0.003944 material group in group out mu bin nuclide mean std. dev. -33 1 1 1 1 total 0.025529 0.002692 -34 1 1 1 2 total 0.028016 0.002666 -35 1 1 1 3 total 0.031829 0.003739 -36 1 1 1 4 total 0.028348 0.002519 -37 1 1 1 5 total 0.030337 0.003534 -38 1 1 1 6 total 0.029177 0.003461 -39 1 1 1 7 total 0.030668 0.003682 -40 1 1 1 8 total 0.035476 0.004666 -41 1 1 1 9 total 0.043931 0.006899 -42 1 1 1 10 total 0.044759 0.004466 -43 1 1 1 11 total 0.058353 0.006082 +33 1 1 1 1 total 0.025529 0.002974 +34 1 1 1 2 total 0.028016 0.003005 +35 1 1 1 3 total 0.031829 0.004057 +36 1 1 1 4 total 0.028348 0.002884 +37 1 1 1 5 total 0.030337 0.003840 +38 1 1 1 6 total 0.029177 0.003750 +39 1 1 1 7 total 0.030668 0.003982 +40 1 1 1 8 total 0.035476 0.004986 +41 1 1 1 9 total 0.043931 0.007233 +42 1 1 1 10 total 0.044759 0.004986 +43 1 1 1 11 total 0.058353 0.006733 22 1 1 2 1 total 0.000000 0.000000 -23 1 1 2 2 total 0.000166 0.000196 -24 1 1 2 3 total 0.000332 0.000290 -25 1 1 2 4 total 0.000166 0.000196 +23 1 1 2 2 total 0.000166 0.000201 +24 1 1 2 3 total 0.000332 0.000306 +25 1 1 2 4 total 0.000166 0.000201 26 1 1 2 5 total 0.000000 0.000000 -27 1 1 2 6 total 0.000166 0.000196 +27 1 1 2 6 total 0.000166 0.000201 28 1 1 2 7 total 0.000000 0.000000 29 1 1 2 8 total 0.000000 0.000000 30 1 1 2 9 total 0.000000 0.000000 -31 1 1 2 10 total 0.000166 0.000196 +31 1 1 2 10 total 0.000166 0.000201 32 1 1 2 11 total 0.000000 0.000000 11 1 2 1 1 total 0.000887 0.001538 12 1 2 1 2 total 0.000000 0.000000 @@ -167,17 +167,17 @@ 19 1 2 1 9 total 0.000000 0.000000 20 1 2 1 10 total 0.000000 0.000000 21 1 2 1 11 total 0.000000 0.000000 -0 1 2 2 1 total 0.036372 0.007026 -1 1 2 2 2 total 0.030162 0.003524 -2 1 2 2 3 total 0.035485 0.006931 -3 1 2 2 4 total 0.028388 0.005962 -4 1 2 2 5 total 0.035485 0.007736 -5 1 2 2 6 total 0.033711 0.004957 -6 1 2 2 7 total 0.036372 0.004455 -7 1 2 2 8 total 0.039921 0.005585 -8 1 2 2 9 total 0.039034 0.008173 -9 1 2 2 10 total 0.041695 0.005796 -10 1 2 2 11 total 0.038147 0.004404 +0 1 2 2 1 total 0.036372 0.006936 +1 1 2 2 2 total 0.030162 0.003400 +2 1 2 2 3 total 0.035485 0.006844 +3 1 2 2 4 total 0.028388 0.005898 +4 1 2 2 5 total 0.035485 0.007658 +5 1 2 2 6 total 0.033711 0.004847 +6 1 2 2 7 total 0.036372 0.004312 +7 1 2 2 8 total 0.039921 0.005448 +8 1 2 2 9 total 0.039034 0.008084 +9 1 2 2 10 total 0.041695 0.005652 +10 1 2 2 11 total 0.038147 0.004245 material group in group out mu bin nuclide mean std. dev. 33 2 1 1 1 total 0.026289 0.004089 34 2 1 1 2 total 0.018269 0.002939 @@ -314,17 +314,17 @@ 9 2 2 2 10 total 0.031739 0.012040 10 2 2 2 11 total 0.019532 0.005496 material group in group out mu bin nuclide mean std. dev. -33 2 1 1 1 total 0.026462 0.004589 -34 2 1 1 2 total 0.018389 0.003277 -35 2 1 1 3 total 0.025565 0.002922 -36 2 1 1 4 total 0.024220 0.005456 -37 2 1 1 5 total 0.022425 0.003808 -38 2 1 1 6 total 0.027808 0.005297 -39 2 1 1 7 total 0.026014 0.003652 -40 2 1 1 8 total 0.026911 0.007093 -41 2 1 1 9 total 0.027808 0.005664 -42 2 1 1 10 total 0.036778 0.006592 -43 2 1 1 11 total 0.049785 0.005660 +33 2 1 1 1 total 0.026462 0.004896 +34 2 1 1 2 total 0.018389 0.003485 +35 2 1 1 3 total 0.025565 0.003355 +36 2 1 1 4 total 0.024220 0.005676 +37 2 1 1 5 total 0.022425 0.004073 +38 2 1 1 6 total 0.027808 0.005593 +39 2 1 1 7 total 0.026014 0.004019 +40 2 1 1 8 total 0.026911 0.007302 +41 2 1 1 9 total 0.027808 0.005941 +42 2 1 1 10 total 0.036778 0.007007 +43 2 1 1 11 total 0.049785 0.006508 22 2 1 2 1 total 0.000000 0.000000 23 2 1 2 2 total 0.000000 0.000000 24 2 1 2 3 total 0.000000 0.000000 @@ -347,17 +347,17 @@ 19 2 2 1 9 total 0.000000 0.000000 20 2 2 1 10 total 0.000000 0.000000 21 2 2 1 11 total 0.000000 0.000000 -0 2 2 2 1 total 0.024415 0.008094 -1 2 2 2 2 total 0.036622 0.007855 -2 2 2 2 3 total 0.041505 0.012588 -3 2 2 2 4 total 0.019532 0.009048 -4 2 2 2 5 total 0.021973 0.008217 -5 2 2 2 6 total 0.019532 0.011894 -6 2 2 2 7 total 0.021973 0.007253 -7 2 2 2 8 total 0.036622 0.011671 -8 2 2 2 9 total 0.021973 0.006141 -9 2 2 2 10 total 0.031739 0.012779 -10 2 2 2 11 total 0.019532 0.006096 +0 2 2 2 1 total 0.024415 0.008170 +1 2 2 2 2 total 0.036622 0.008031 +2 2 2 2 3 total 0.041505 0.012730 +3 2 2 2 4 total 0.019532 0.009092 +4 2 2 2 5 total 0.021973 0.008278 +5 2 2 2 6 total 0.019532 0.011928 +6 2 2 2 7 total 0.021973 0.007322 +7 2 2 2 8 total 0.036622 0.011790 +8 2 2 2 9 total 0.021973 0.006222 +9 2 2 2 10 total 0.031739 0.012861 +10 2 2 2 11 total 0.019532 0.006160 material group in group out mu bin nuclide mean std. dev. 33 3 1 1 1 total 0.007001 0.000582 34 3 1 1 2 total 0.007728 0.001008 @@ -494,28 +494,28 @@ 9 3 2 2 10 total 0.330988 0.048491 10 3 2 2 11 total 0.337150 0.045927 material group in group out mu bin nuclide mean std. dev. -33 3 1 1 1 total 0.006924 0.000686 -34 3 1 1 2 total 0.007643 0.001078 -35 3 1 1 3 total 0.006744 0.001166 -36 3 1 1 4 total 0.006025 0.000843 -37 3 1 1 5 total 0.007104 0.000759 -38 3 1 1 6 total 0.011150 0.000920 -39 3 1 1 7 total 0.042173 0.003073 -40 3 1 1 8 total 0.073645 0.004762 -41 3 1 1 9 total 0.117706 0.009309 -42 3 1 1 10 total 0.151606 0.010122 -43 3 1 1 11 total 0.202141 0.015127 -22 3 1 2 1 total 0.000809 0.000308 -23 3 1 2 2 total 0.000809 0.000118 -24 3 1 2 3 total 0.001079 0.000251 -25 3 1 2 4 total 0.001079 0.000321 -26 3 1 2 5 total 0.002518 0.000642 -27 3 1 2 6 total 0.002338 0.000397 -28 3 1 2 7 total 0.004496 0.000920 -29 3 1 2 8 total 0.004766 0.000928 -30 3 1 2 9 total 0.006025 0.001227 -31 3 1 2 10 total 0.004496 0.000852 -32 3 1 2 11 total 0.002608 0.000436 +33 3 1 1 1 total 0.006924 0.000699 +34 3 1 1 2 total 0.007643 0.001089 +35 3 1 1 3 total 0.006744 0.001173 +36 3 1 1 4 total 0.006025 0.000851 +37 3 1 1 5 total 0.007104 0.000772 +38 3 1 1 6 total 0.011150 0.000945 +39 3 1 1 7 total 0.042173 0.003183 +40 3 1 1 8 total 0.073645 0.004976 +41 3 1 1 9 total 0.117706 0.009591 +42 3 1 1 10 total 0.151606 0.010550 +43 3 1 1 11 total 0.202141 0.015638 +22 3 1 2 1 total 0.000809 0.000306 +23 3 1 2 2 total 0.000809 0.000113 +24 3 1 2 3 total 0.001079 0.000247 +25 3 1 2 4 total 0.001079 0.000318 +26 3 1 2 5 total 0.002518 0.000633 +27 3 1 2 6 total 0.002338 0.000385 +28 3 1 2 7 total 0.004496 0.000901 +29 3 1 2 8 total 0.004766 0.000906 +30 3 1 2 9 total 0.006025 0.001201 +31 3 1 2 10 total 0.004496 0.000830 +32 3 1 2 11 total 0.002608 0.000422 11 3 2 1 1 total 0.000000 0.000000 12 3 2 1 2 total 0.000000 0.000000 13 3 2 1 3 total 0.000000 0.000000 @@ -527,14 +527,14 @@ 19 3 2 1 9 total 0.000000 0.000000 20 3 2 1 10 total 0.000000 0.000000 21 3 2 1 11 total 0.000440 0.000764 -0 3 2 2 1 total 0.088029 0.018984 -1 3 2 2 2 total 0.097712 0.020255 -2 3 2 2 3 total 0.125881 0.027901 -3 3 2 2 4 total 0.117518 0.023659 -4 3 2 2 5 total 0.130282 0.022078 -5 3 2 2 6 total 0.166374 0.034431 -6 3 2 2 7 total 0.179138 0.032816 -7 3 2 2 8 total 0.212149 0.039453 -8 3 2 2 9 total 0.235036 0.038904 -9 3 2 2 10 total 0.330988 0.058979 -10 3 2 2 11 total 0.337150 0.057260 +0 3 2 2 1 total 0.088029 0.020587 +1 3 2 2 2 total 0.097712 0.022100 +2 3 2 2 3 total 0.125881 0.030136 +3 3 2 2 4 total 0.117518 0.025939 +4 3 2 2 5 total 0.130282 0.025029 +5 3 2 2 6 total 0.166374 0.037579 +6 3 2 2 7 total 0.179138 0.036602 +7 3 2 2 8 total 0.212149 0.043875 +8 3 2 2 9 total 0.235036 0.044338 +9 3 2 2 10 total 0.330988 0.066148 +10 3 2 2 11 total 0.337150 0.064881 From 758f0b3087f1780387d707c2147a07d3d4aa6b03 Mon Sep 17 00:00:00 2001 From: Adam G Nelson Date: Sat, 5 May 2018 16:55:13 -0400 Subject: [PATCH 230/231] updating tests now that I know the std dev issue --- .../mgxs_library_correction/results_true.dat | 12 +- .../mgxs_library_histogram/results_true.dat | 164 +++++++++--------- 2 files changed, 88 insertions(+), 88 deletions(-) diff --git a/tests/regression_tests/mgxs_library_correction/results_true.dat b/tests/regression_tests/mgxs_library_correction/results_true.dat index f7e288802c..cc28320e25 100644 --- a/tests/regression_tests/mgxs_library_correction/results_true.dat +++ b/tests/regression_tests/mgxs_library_correction/results_true.dat @@ -2,12 +2,12 @@ 3 1 1 1 total 0.332466 0.026533 2 1 1 2 total 0.000989 0.000482 1 1 2 1 total 0.000925 0.000925 -0 1 2 2 total 0.396146 0.015511 +0 1 2 2 total 0.396146 0.015707 material group in group out nuclide mean std. dev. 3 1 1 1 total 0.332466 0.026533 2 1 1 2 total 0.000989 0.000482 1 1 2 1 total 0.000925 0.000925 -0 1 2 2 total 0.396146 0.015511 +0 1 2 2 total 0.396146 0.015707 material group in group out nuclide mean std. dev. 3 1 1 1 total 0.334690 0.037288 2 1 1 2 total 0.000995 0.000489 @@ -39,15 +39,15 @@ 1 2 2 1 total 0.000000 0.000000 0 2 2 2 total 0.306635 0.067497 material group in group out nuclide mean std. dev. -3 3 1 1 total 0.258652 0.022623 +3 3 1 1 total 0.258652 0.022596 2 3 1 2 total 0.031368 0.001728 1 3 2 1 total 0.000443 0.000445 -0 3 2 2 total 1.482300 0.232653 +0 3 2 2 total 1.482300 0.232582 material group in group out nuclide mean std. dev. -3 3 1 1 total 0.258652 0.022623 +3 3 1 1 total 0.258652 0.022596 2 3 1 2 total 0.031368 0.001728 1 3 2 1 total 0.000443 0.000445 -0 3 2 2 total 1.482300 0.232653 +0 3 2 2 total 1.482300 0.232582 material group in group out nuclide mean std. dev. 3 3 1 1 total 0.251610 0.041472 2 3 1 2 total 0.031023 0.002232 diff --git a/tests/regression_tests/mgxs_library_histogram/results_true.dat b/tests/regression_tests/mgxs_library_histogram/results_true.dat index 116a1a9835..20625efd06 100644 --- a/tests/regression_tests/mgxs_library_histogram/results_true.dat +++ b/tests/regression_tests/mgxs_library_histogram/results_true.dat @@ -134,27 +134,27 @@ 9 1 2 2 10 total 0.041695 0.005386 10 1 2 2 11 total 0.038147 0.003944 material group in group out mu bin nuclide mean std. dev. -33 1 1 1 1 total 0.025529 0.002974 -34 1 1 1 2 total 0.028016 0.003005 -35 1 1 1 3 total 0.031829 0.004057 -36 1 1 1 4 total 0.028348 0.002884 -37 1 1 1 5 total 0.030337 0.003840 -38 1 1 1 6 total 0.029177 0.003750 -39 1 1 1 7 total 0.030668 0.003982 -40 1 1 1 8 total 0.035476 0.004986 -41 1 1 1 9 total 0.043931 0.007233 -42 1 1 1 10 total 0.044759 0.004986 -43 1 1 1 11 total 0.058353 0.006733 +33 1 1 1 1 total 0.025529 0.002692 +34 1 1 1 2 total 0.028016 0.002666 +35 1 1 1 3 total 0.031829 0.003739 +36 1 1 1 4 total 0.028348 0.002519 +37 1 1 1 5 total 0.030337 0.003534 +38 1 1 1 6 total 0.029177 0.003461 +39 1 1 1 7 total 0.030668 0.003682 +40 1 1 1 8 total 0.035476 0.004666 +41 1 1 1 9 total 0.043931 0.006899 +42 1 1 1 10 total 0.044759 0.004466 +43 1 1 1 11 total 0.058353 0.006082 22 1 1 2 1 total 0.000000 0.000000 -23 1 1 2 2 total 0.000166 0.000201 -24 1 1 2 3 total 0.000332 0.000306 -25 1 1 2 4 total 0.000166 0.000201 +23 1 1 2 2 total 0.000166 0.000196 +24 1 1 2 3 total 0.000332 0.000290 +25 1 1 2 4 total 0.000166 0.000196 26 1 1 2 5 total 0.000000 0.000000 -27 1 1 2 6 total 0.000166 0.000201 +27 1 1 2 6 total 0.000166 0.000196 28 1 1 2 7 total 0.000000 0.000000 29 1 1 2 8 total 0.000000 0.000000 30 1 1 2 9 total 0.000000 0.000000 -31 1 1 2 10 total 0.000166 0.000201 +31 1 1 2 10 total 0.000166 0.000196 32 1 1 2 11 total 0.000000 0.000000 11 1 2 1 1 total 0.000887 0.001538 12 1 2 1 2 total 0.000000 0.000000 @@ -167,17 +167,17 @@ 19 1 2 1 9 total 0.000000 0.000000 20 1 2 1 10 total 0.000000 0.000000 21 1 2 1 11 total 0.000000 0.000000 -0 1 2 2 1 total 0.036372 0.006936 -1 1 2 2 2 total 0.030162 0.003400 -2 1 2 2 3 total 0.035485 0.006844 -3 1 2 2 4 total 0.028388 0.005898 -4 1 2 2 5 total 0.035485 0.007658 -5 1 2 2 6 total 0.033711 0.004847 -6 1 2 2 7 total 0.036372 0.004312 -7 1 2 2 8 total 0.039921 0.005448 -8 1 2 2 9 total 0.039034 0.008084 -9 1 2 2 10 total 0.041695 0.005652 -10 1 2 2 11 total 0.038147 0.004245 +0 1 2 2 1 total 0.036372 0.007026 +1 1 2 2 2 total 0.030162 0.003524 +2 1 2 2 3 total 0.035485 0.006931 +3 1 2 2 4 total 0.028388 0.005962 +4 1 2 2 5 total 0.035485 0.007736 +5 1 2 2 6 total 0.033711 0.004957 +6 1 2 2 7 total 0.036372 0.004455 +7 1 2 2 8 total 0.039921 0.005585 +8 1 2 2 9 total 0.039034 0.008173 +9 1 2 2 10 total 0.041695 0.005796 +10 1 2 2 11 total 0.038147 0.004404 material group in group out mu bin nuclide mean std. dev. 33 2 1 1 1 total 0.026289 0.004089 34 2 1 1 2 total 0.018269 0.002939 @@ -314,17 +314,17 @@ 9 2 2 2 10 total 0.031739 0.012040 10 2 2 2 11 total 0.019532 0.005496 material group in group out mu bin nuclide mean std. dev. -33 2 1 1 1 total 0.026462 0.004896 -34 2 1 1 2 total 0.018389 0.003485 -35 2 1 1 3 total 0.025565 0.003355 -36 2 1 1 4 total 0.024220 0.005676 -37 2 1 1 5 total 0.022425 0.004073 -38 2 1 1 6 total 0.027808 0.005593 -39 2 1 1 7 total 0.026014 0.004019 -40 2 1 1 8 total 0.026911 0.007302 -41 2 1 1 9 total 0.027808 0.005941 -42 2 1 1 10 total 0.036778 0.007007 -43 2 1 1 11 total 0.049785 0.006508 +33 2 1 1 1 total 0.026462 0.004589 +34 2 1 1 2 total 0.018389 0.003277 +35 2 1 1 3 total 0.025565 0.002922 +36 2 1 1 4 total 0.024220 0.005456 +37 2 1 1 5 total 0.022425 0.003808 +38 2 1 1 6 total 0.027808 0.005297 +39 2 1 1 7 total 0.026014 0.003652 +40 2 1 1 8 total 0.026911 0.007093 +41 2 1 1 9 total 0.027808 0.005664 +42 2 1 1 10 total 0.036778 0.006592 +43 2 1 1 11 total 0.049785 0.005660 22 2 1 2 1 total 0.000000 0.000000 23 2 1 2 2 total 0.000000 0.000000 24 2 1 2 3 total 0.000000 0.000000 @@ -347,17 +347,17 @@ 19 2 2 1 9 total 0.000000 0.000000 20 2 2 1 10 total 0.000000 0.000000 21 2 2 1 11 total 0.000000 0.000000 -0 2 2 2 1 total 0.024415 0.008170 -1 2 2 2 2 total 0.036622 0.008031 -2 2 2 2 3 total 0.041505 0.012730 -3 2 2 2 4 total 0.019532 0.009092 -4 2 2 2 5 total 0.021973 0.008278 -5 2 2 2 6 total 0.019532 0.011928 -6 2 2 2 7 total 0.021973 0.007322 -7 2 2 2 8 total 0.036622 0.011790 -8 2 2 2 9 total 0.021973 0.006222 -9 2 2 2 10 total 0.031739 0.012861 -10 2 2 2 11 total 0.019532 0.006160 +0 2 2 2 1 total 0.024415 0.008094 +1 2 2 2 2 total 0.036622 0.007855 +2 2 2 2 3 total 0.041505 0.012588 +3 2 2 2 4 total 0.019532 0.009048 +4 2 2 2 5 total 0.021973 0.008217 +5 2 2 2 6 total 0.019532 0.011894 +6 2 2 2 7 total 0.021973 0.007253 +7 2 2 2 8 total 0.036622 0.011671 +8 2 2 2 9 total 0.021973 0.006141 +9 2 2 2 10 total 0.031739 0.012779 +10 2 2 2 11 total 0.019532 0.006096 material group in group out mu bin nuclide mean std. dev. 33 3 1 1 1 total 0.007001 0.000582 34 3 1 1 2 total 0.007728 0.001008 @@ -494,28 +494,28 @@ 9 3 2 2 10 total 0.330988 0.048491 10 3 2 2 11 total 0.337150 0.045927 material group in group out mu bin nuclide mean std. dev. -33 3 1 1 1 total 0.006924 0.000699 -34 3 1 1 2 total 0.007643 0.001089 -35 3 1 1 3 total 0.006744 0.001173 -36 3 1 1 4 total 0.006025 0.000851 -37 3 1 1 5 total 0.007104 0.000772 -38 3 1 1 6 total 0.011150 0.000945 -39 3 1 1 7 total 0.042173 0.003183 -40 3 1 1 8 total 0.073645 0.004976 -41 3 1 1 9 total 0.117706 0.009591 -42 3 1 1 10 total 0.151606 0.010550 -43 3 1 1 11 total 0.202141 0.015638 -22 3 1 2 1 total 0.000809 0.000306 -23 3 1 2 2 total 0.000809 0.000113 -24 3 1 2 3 total 0.001079 0.000247 -25 3 1 2 4 total 0.001079 0.000318 -26 3 1 2 5 total 0.002518 0.000633 -27 3 1 2 6 total 0.002338 0.000385 -28 3 1 2 7 total 0.004496 0.000901 -29 3 1 2 8 total 0.004766 0.000906 -30 3 1 2 9 total 0.006025 0.001201 -31 3 1 2 10 total 0.004496 0.000830 -32 3 1 2 11 total 0.002608 0.000422 +33 3 1 1 1 total 0.006924 0.000686 +34 3 1 1 2 total 0.007643 0.001078 +35 3 1 1 3 total 0.006744 0.001166 +36 3 1 1 4 total 0.006025 0.000843 +37 3 1 1 5 total 0.007104 0.000759 +38 3 1 1 6 total 0.011150 0.000920 +39 3 1 1 7 total 0.042173 0.003073 +40 3 1 1 8 total 0.073645 0.004762 +41 3 1 1 9 total 0.117706 0.009309 +42 3 1 1 10 total 0.151606 0.010122 +43 3 1 1 11 total 0.202141 0.015127 +22 3 1 2 1 total 0.000809 0.000308 +23 3 1 2 2 total 0.000809 0.000118 +24 3 1 2 3 total 0.001079 0.000251 +25 3 1 2 4 total 0.001079 0.000321 +26 3 1 2 5 total 0.002518 0.000642 +27 3 1 2 6 total 0.002338 0.000397 +28 3 1 2 7 total 0.004496 0.000920 +29 3 1 2 8 total 0.004766 0.000928 +30 3 1 2 9 total 0.006025 0.001227 +31 3 1 2 10 total 0.004496 0.000852 +32 3 1 2 11 total 0.002608 0.000436 11 3 2 1 1 total 0.000000 0.000000 12 3 2 1 2 total 0.000000 0.000000 13 3 2 1 3 total 0.000000 0.000000 @@ -527,14 +527,14 @@ 19 3 2 1 9 total 0.000000 0.000000 20 3 2 1 10 total 0.000000 0.000000 21 3 2 1 11 total 0.000440 0.000764 -0 3 2 2 1 total 0.088029 0.020587 -1 3 2 2 2 total 0.097712 0.022100 -2 3 2 2 3 total 0.125881 0.030136 -3 3 2 2 4 total 0.117518 0.025939 -4 3 2 2 5 total 0.130282 0.025029 -5 3 2 2 6 total 0.166374 0.037579 -6 3 2 2 7 total 0.179138 0.036602 -7 3 2 2 8 total 0.212149 0.043875 -8 3 2 2 9 total 0.235036 0.044338 -9 3 2 2 10 total 0.330988 0.066148 -10 3 2 2 11 total 0.337150 0.064881 +0 3 2 2 1 total 0.088029 0.018984 +1 3 2 2 2 total 0.097712 0.020255 +2 3 2 2 3 total 0.125881 0.027901 +3 3 2 2 4 total 0.117518 0.023659 +4 3 2 2 5 total 0.130282 0.022078 +5 3 2 2 6 total 0.166374 0.034431 +6 3 2 2 7 total 0.179138 0.032816 +7 3 2 2 8 total 0.212149 0.039453 +8 3 2 2 9 total 0.235036 0.038904 +9 3 2 2 10 total 0.330988 0.058979 +10 3 2 2 11 total 0.337150 0.057260 From 382835960b6614e1f9e282fd900230171d1c6e7d Mon Sep 17 00:00:00 2001 From: Adam G Nelson Date: Tue, 8 May 2018 15:02:23 -0400 Subject: [PATCH 231/231] removed errant print statements in regression_tests/tallies/test.py --- tests/regression_tests/tallies/test.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/regression_tests/tallies/test.py b/tests/regression_tests/tallies/test.py index b86d71d006..601b611f49 100644 --- a/tests/regression_tests/tallies/test.py +++ b/tests/regression_tests/tallies/test.py @@ -76,7 +76,6 @@ def test_tallies(): mu_tally1 = Tally() mu_tally1.filters = [mu_filter] mu_tally1.scores = ['scatter', 'nu-scatter'] - print('mu_tally1', mu_tally1.id) mu_tally2 = Tally() mu_tally2.filters = [mu_filter, mesh_filter] @@ -104,7 +103,6 @@ def test_tallies(): legendre_tally.filters = [legendre_filter] legendre_tally.scores = ['scatter', 'nu-scatter'] legendre_tally.estimatir = 'analog' - print('legendre_tally', mu_tally1.id) harmonics_filter = SphericalHarmonicsFilter(order=4) harmonics_tally = Tally()
01000011U2350.0743930.0003080.0746720.000179
11000011U2380.0059820.0000360.0059640.000017
21000011O160.000000