mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Updated all tests to use new statepoint format
This commit is contained in:
parent
3551112107
commit
75bc67c2e4
89 changed files with 1934 additions and 1114 deletions
|
|
@ -148,8 +148,8 @@ contains
|
|||
case (CELL_FILL)
|
||||
call su % write_data("universe", "fill_type", &
|
||||
group="geometry/cells/cell " // trim(to_str(c % id)))
|
||||
call su % write_data(universes(c % fill) % id, "universe", &
|
||||
group="geometry/cells/cell " // trim(to_str(c % id)))
|
||||
call su % write_data(universes(c % fill) % id, "fill", &
|
||||
group="geometry/cells/cell " // trim(to_str(c % id)))
|
||||
|
||||
if (allocated(c % translation)) then
|
||||
call su % write_data(1, "translated", &
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ module state_point
|
|||
use string, only: to_str, zero_padded, count_digits
|
||||
use output_interface
|
||||
use tally_header, only: TallyObject
|
||||
use mesh_header, only: StructuredMesh
|
||||
use dict_header, only: ElemKeyValueII, ElemKeyValueCI
|
||||
|
||||
#ifdef MPI
|
||||
use mpi
|
||||
|
|
@ -36,12 +38,18 @@ contains
|
|||
|
||||
subroutine write_state_point()
|
||||
|
||||
character(MAX_FILE_LEN) :: filename
|
||||
integer :: i
|
||||
integer :: j
|
||||
integer, allocatable :: temp_array(:)
|
||||
type(TallyObject), pointer :: t => null()
|
||||
|
||||
character(MAX_FILE_LEN) :: filename
|
||||
integer :: i, j, k, m
|
||||
integer :: n_x, n_y, n_z
|
||||
character(11), allocatable :: name_array(:)
|
||||
integer, allocatable :: id_array(:)
|
||||
integer, allocatable :: key_array(:)
|
||||
type(StructuredMesh), pointer :: mesh => null()
|
||||
type(TallyObject), pointer :: tally => null()
|
||||
type(ElemKeyValueII), pointer :: current => null()
|
||||
type(ElemKeyValueII), pointer :: next => null()
|
||||
type(ElemKeyValueCI), pointer :: cur_nuclide => null()
|
||||
type(ElemKeyValueCI), pointer :: next_nuclide => null()
|
||||
! Set filename for state point
|
||||
filename = trim(path_output) // 'statepoint.' // &
|
||||
& zero_padded(current_batch, count_digits(n_batches))
|
||||
|
|
@ -83,17 +91,26 @@ contains
|
|||
! Write run information
|
||||
call sp % write_data(run_mode, "run_mode")
|
||||
call sp % write_data(n_particles, "n_particles")
|
||||
call sp % write_data(n_batches, "n_batches")
|
||||
|
||||
! Write out current batch number
|
||||
call sp % write_data(current_batch, "current_batch")
|
||||
|
||||
! Indicate whether source bank is stored in statepoint
|
||||
if (source_separate) then
|
||||
call sp % write_data(0, "source_present")
|
||||
else
|
||||
call sp % write_data(1, "source_present")
|
||||
end if
|
||||
|
||||
! Write out information for eigenvalue run
|
||||
if (run_mode == MODE_EIGENVALUE) then
|
||||
call sp % write_data(n_inactive, "n_inactive")
|
||||
call sp % write_data(gen_per_batch, "gen_per_batch")
|
||||
call sp % write_data(k_generation, "k_generation", &
|
||||
length=current_batch*gen_per_batch)
|
||||
call sp % write_data(entropy, "entropy", length=current_batch*gen_per_batch)
|
||||
call sp % write_data(entropy, "entropy", &
|
||||
length=current_batch*gen_per_batch)
|
||||
call sp % write_data(k_col_abs, "k_col_abs")
|
||||
call sp % write_data(k_col_tra, "k_col_tra")
|
||||
call sp % write_data(k_abs_tra, "k_abs_tra")
|
||||
|
|
@ -101,6 +118,10 @@ contains
|
|||
|
||||
! Write out CMFD info
|
||||
if (cmfd_on) then
|
||||
#ifdef HDF5
|
||||
call sp % open_group("cmfd")
|
||||
call sp % close_group()
|
||||
#endif
|
||||
call sp % write_data(1, "cmfd_on")
|
||||
call sp % write_data(cmfd % indices, "indices", length=4, group="cmfd")
|
||||
call sp % write_data(cmfd % k_cmfd, "k_cmfd", length=current_batch, &
|
||||
|
|
@ -110,7 +131,7 @@ contains
|
|||
cmfd % indices(2), cmfd % indices(3)/), &
|
||||
group="cmfd")
|
||||
call sp % write_data(cmfd % entropy, "cmfd_entropy", &
|
||||
length=current_batch, group="cmfd")
|
||||
length=current_batch, group="cmfd")
|
||||
call sp % write_data(cmfd % balance, "cmfd_balance", &
|
||||
length=current_batch, group="cmfd")
|
||||
call sp % write_data(cmfd % dom, "cmfd_dominance", &
|
||||
|
|
@ -122,119 +143,162 @@ contains
|
|||
end if
|
||||
end if
|
||||
|
||||
! Write number of meshes
|
||||
call sp % write_data(n_meshes, "n_meshes", group="tallies")
|
||||
#ifdef HDF5
|
||||
call sp % open_group("tallies")
|
||||
call sp % close_group()
|
||||
#endif
|
||||
|
||||
! Write information for meshes
|
||||
MESH_LOOP: do i = 1, n_meshes
|
||||
call sp % write_data(meshes(i) % id, "id", &
|
||||
group="tallies/mesh" // to_str(i))
|
||||
call sp % write_data(meshes(i) % type, "type", &
|
||||
group="tallies/mesh" // to_str(i))
|
||||
call sp % write_data(meshes(i) % n_dimension, "n_dimension", &
|
||||
group="tallies/mesh" // to_str(i))
|
||||
call sp % write_data(meshes(i) % dimension, "dimension", &
|
||||
group="tallies/mesh" // to_str(i), &
|
||||
length=meshes(i) % n_dimension)
|
||||
call sp % write_data(meshes(i) % lower_left, "lower_left", &
|
||||
group="tallies/mesh" // to_str(i), &
|
||||
length=meshes(i) % n_dimension)
|
||||
call sp % write_data(meshes(i) % upper_right, "upper_right", &
|
||||
group="tallies/mesh" // to_str(i), &
|
||||
length=meshes(i) % n_dimension)
|
||||
call sp % write_data(meshes(i) % width, "width", &
|
||||
group="tallies/mesh" // to_str(i), &
|
||||
length=meshes(i) % n_dimension)
|
||||
end do MESH_LOOP
|
||||
! Write number of meshes
|
||||
call sp % write_data(n_meshes, "n_meshes", group="tallies/meshes")
|
||||
|
||||
if (n_meshes > 0) then
|
||||
|
||||
! Print list of mesh IDs
|
||||
current => mesh_dict % keys()
|
||||
|
||||
allocate(id_array(n_meshes))
|
||||
allocate(key_array(n_meshes))
|
||||
i = 1
|
||||
|
||||
do while (associated(current))
|
||||
key_array(i) = current % key
|
||||
id_array(i) = current % value
|
||||
|
||||
! Move to next mesh
|
||||
next => current % next
|
||||
deallocate(current)
|
||||
current => next
|
||||
i = i + 1
|
||||
end do
|
||||
|
||||
call sp % write_data(id_array, "ids", &
|
||||
group="tallies/meshes", length=n_meshes)
|
||||
call sp % write_data(key_array, "keys", &
|
||||
group="tallies/meshes", length=n_meshes)
|
||||
|
||||
deallocate(key_array)
|
||||
|
||||
! Write information for meshes
|
||||
MESH_LOOP: do i = 1, n_meshes
|
||||
|
||||
mesh => meshes(id_array(i))
|
||||
|
||||
call sp % write_data(mesh % id, "id", &
|
||||
group="tallies/meshes/mesh " // trim(to_str(mesh % id)))
|
||||
call sp % write_data(mesh % type, "type", &
|
||||
group="tallies/meshes/mesh " // trim(to_str(mesh % id)))
|
||||
call sp % write_data(mesh % n_dimension, "n_dimension", &
|
||||
group="tallies/meshes/mesh " // trim(to_str(mesh % id)))
|
||||
call sp % write_data(mesh % dimension, "dimension", &
|
||||
group="tallies/meshes/mesh " // trim(to_str(mesh % id)), &
|
||||
length=mesh % n_dimension)
|
||||
call sp % write_data(mesh % lower_left, "lower_left", &
|
||||
group="tallies/meshes/mesh " // trim(to_str(mesh % id)), &
|
||||
length=mesh % n_dimension)
|
||||
call sp % write_data(mesh % upper_right, "upper_right", &
|
||||
group="tallies/meshes/mesh " // trim(to_str(mesh % id)), &
|
||||
length=mesh % n_dimension)
|
||||
call sp % write_data(mesh % width, "width", &
|
||||
group="tallies/meshes/mesh " // trim(to_str(mesh % id)), &
|
||||
length=mesh % n_dimension)
|
||||
end do MESH_LOOP
|
||||
|
||||
deallocate(id_array)
|
||||
|
||||
end if
|
||||
|
||||
! Write number of tallies
|
||||
call sp % write_data(n_tallies, "n_tallies", group="tallies")
|
||||
|
||||
! Write all tally information except results
|
||||
TALLY_METADATA: do i = 1, n_tallies
|
||||
!Get pointer to tally
|
||||
t => tallies(i)
|
||||
if (n_tallies > 0) then
|
||||
|
||||
! Write id
|
||||
call sp % write_data(t % id, "id", group="tallies/tally" // to_str(i))
|
||||
! Print list of tally IDs
|
||||
allocate(id_array(n_tallies))
|
||||
allocate(key_array(n_tallies))
|
||||
|
||||
! Write number of realizations
|
||||
call sp % write_data(t % n_realizations, "n_realizations", &
|
||||
group="tallies/tally" // to_str(i))
|
||||
! Write all tally information except results
|
||||
do i = 1, n_tallies
|
||||
tally => tallies(i)
|
||||
key_array(i) = tally % id
|
||||
id_array(i) = i
|
||||
end do
|
||||
|
||||
! Write size of each tally
|
||||
call sp % write_data(t % total_score_bins, "total_score_bins", &
|
||||
group="tallies/tally" // to_str(i))
|
||||
call sp % write_data(t % total_filter_bins, "total_filter_bins", &
|
||||
group="tallies/tally" // to_str(i))
|
||||
call sp % write_data(id_array, "ids", &
|
||||
group="tallies", length=n_tallies)
|
||||
call sp % write_data(key_array, "keys", &
|
||||
group="tallies", length=n_tallies)
|
||||
|
||||
! Write number of filters
|
||||
call sp % write_data(t % n_filters, "n_filters", &
|
||||
group="tallies/tally" // to_str(i))
|
||||
deallocate(key_array)
|
||||
|
||||
! Write filter information
|
||||
FILTER_LOOP: do j = 1, t % n_filters
|
||||
! Write all tally information except results
|
||||
TALLY_METADATA: do i = 1, n_tallies
|
||||
|
||||
! Write type of filter
|
||||
call sp % write_data(t % filters(j) % type, "type", &
|
||||
group="tallies/tally" // trim(to_str(i)) // "/filter" // to_str(j))
|
||||
! Get pointer to tally
|
||||
tally => tallies(i)
|
||||
|
||||
! Write number of bins for this filter
|
||||
call sp % write_data(t % filters(j) % n_bins, "n_bins", &
|
||||
group="tallies/tally" // trim(to_str(i)) // "/filter" // to_str(j))
|
||||
call sp % write_data(len(tally % label), "label_size", &
|
||||
group="tallies/tally " // trim(to_str(tally % id)))
|
||||
if (len(tally % label) > 0) then
|
||||
call sp % write_data(tally % label, "label", &
|
||||
group="tallies/tally " // trim(to_str(tally % id)))
|
||||
endif
|
||||
|
||||
! Write bins
|
||||
if (t % filters(j) % type == FILTER_ENERGYIN .or. &
|
||||
t % filters(j) % type == FILTER_ENERGYOUT) then
|
||||
call sp % write_data(t % filters(j) % real_bins, "bins", &
|
||||
group="tallies/tally" // trim(to_str(i)) // "/filter" // to_str(j), &
|
||||
length=size(t % filters(j) % real_bins))
|
||||
else
|
||||
call sp % write_data(t % filters(j) % int_bins, "bins", &
|
||||
group="tallies/tally" // trim(to_str(i)) // "/filter" // to_str(j), &
|
||||
length=size(t % filters(j) % int_bins))
|
||||
end if
|
||||
call sp % write_data(tally % estimator, "estimator", &
|
||||
group="tallies/tally " // trim(to_str(tally % id)))
|
||||
call sp % write_data(tally % n_realizations, "n_realizations", &
|
||||
group="tallies/tally " // trim(to_str(tally % id)))
|
||||
call sp % write_data(tally % n_filters, "n_filters", &
|
||||
group="tallies/tally " // trim(to_str(tally % id)))
|
||||
|
||||
end do FILTER_LOOP
|
||||
! Write filter information
|
||||
FILTER_LOOP: do j = 1, tally % n_filters
|
||||
|
||||
! Write number of nuclide bins
|
||||
call sp % write_data(t % n_nuclide_bins, "n_nuclide_bins", &
|
||||
group="tallies/tally" // to_str(i))
|
||||
call sp % write_data(tally % filters(j) % type, "type", &
|
||||
group="tallies/tally " // trim(to_str(tally % id)) // &
|
||||
"/filter " // to_str(j))
|
||||
call sp % write_data(tally % filters(j) % n_bins, "n_bins", &
|
||||
group="tallies/tally " // trim(to_str(tally % id)) // &
|
||||
"/filter " // to_str(j))
|
||||
if (tally % filters(j) % type == FILTER_ENERGYIN .or. &
|
||||
tally % filters(j) % type == FILTER_ENERGYOUT) then
|
||||
call sp % write_data(tally % filters(j) % real_bins, "bins", &
|
||||
group="tallies/tally " // trim(to_str(tally % id)) // &
|
||||
"/filter " // to_str(j), &
|
||||
length=size(tally % filters(j) % real_bins))
|
||||
else
|
||||
call sp % write_data(tally % filters(j) % int_bins, "bins", &
|
||||
group="tallies/tally " // trim(to_str(tally % id)) // &
|
||||
"/filter " // to_str(j), &
|
||||
length=size(tally % filters(j) % int_bins))
|
||||
end if
|
||||
|
||||
! Set up nuclide bin array and then write
|
||||
allocate(temp_array(t % n_nuclide_bins))
|
||||
NUCLIDE_LOOP: do j = 1, t % n_nuclide_bins
|
||||
if (t % nuclide_bins(j) > 0) then
|
||||
temp_array(j) = nuclides(t % nuclide_bins(j)) % zaid
|
||||
else
|
||||
temp_array(j) = t % nuclide_bins(j)
|
||||
end if
|
||||
end do NUCLIDE_LOOP
|
||||
call sp % write_data(temp_array, "nuclide_bins", &
|
||||
group="tallies/tally" // to_str(i), length=t % n_nuclide_bins)
|
||||
deallocate(temp_array)
|
||||
end do FILTER_LOOP
|
||||
|
||||
! Write number of score bins, score bins, and moment order
|
||||
call sp % write_data(t % n_score_bins, "n_score_bins", &
|
||||
group="tallies/tally" // to_str(i))
|
||||
call sp % write_data(t % score_bins, "score_bins", &
|
||||
group="tallies/tally" // to_str(i), length=t % n_score_bins)
|
||||
call sp % write_data(t % moment_order, "moment_order", &
|
||||
group="tallies/tally" // to_str(i), length=t % n_score_bins)
|
||||
call sp % write_data(tally % n_nuclide_bins, "n_nuclides", &
|
||||
group="tallies/tally " // trim(to_str(tally % id)))
|
||||
|
||||
! Write number of user score bins
|
||||
call sp % write_data(t % n_user_score_bins, "n_user_score_bins", &
|
||||
group="tallies/tally" // to_str(i))
|
||||
! Set up nuclide bin array and then write
|
||||
allocate(key_array(tally % n_nuclide_bins))
|
||||
NUCLIDE_LOOP: do j = 1, tally % n_nuclide_bins
|
||||
key_array(j) = tally % nuclide_bins(j)
|
||||
end do NUCLIDE_LOOP
|
||||
call sp % write_data(key_array, "nuclides", &
|
||||
group="tallies/tally " // trim(to_str(tally % id)), &
|
||||
length=tally % n_nuclide_bins)
|
||||
deallocate(key_array)
|
||||
|
||||
end do TALLY_METADATA
|
||||
call sp % write_data(tally % n_score_bins, "n_score_bins", &
|
||||
group="tallies/tally " // trim(to_str(tally % id)))
|
||||
call sp % write_data(tally % score_bins, "score_bins", &
|
||||
group="tallies/tally " // trim(to_str(tally % id)), &
|
||||
length=tally % n_score_bins)
|
||||
call sp % write_data(tally % moment_order, "moment_order", &
|
||||
group="tallies/tally " // trim(to_str(tally % id)), &
|
||||
length=tally % n_score_bins)
|
||||
|
||||
end do TALLY_METADATA
|
||||
|
||||
! Indicate where source bank is stored in statepoint
|
||||
if (source_separate) then
|
||||
call sp % write_data(0, "source_present")
|
||||
else
|
||||
call sp % write_data(1, "source_present")
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
! Check for the no-tally-reduction method
|
||||
|
|
@ -264,12 +328,12 @@ contains
|
|||
TALLY_RESULTS: do i = 1, n_tallies
|
||||
|
||||
! Set point to current tally
|
||||
t => tallies(i)
|
||||
tally => tallies(i)
|
||||
|
||||
! Write sum and sum_sq for each bin
|
||||
call sp % write_tally_result(t % results, "results", &
|
||||
group="tallies/tally" // to_str(i), &
|
||||
n1=size(t % results, 1), n2=size(t % results, 2))
|
||||
call sp % write_tally_result(tally % results, "results", &
|
||||
group="tallies/tally " // trim(to_str(tally % id)), &
|
||||
n1=size(tally % results, 1), n2=size(tally % results, 2))
|
||||
|
||||
end do TALLY_RESULTS
|
||||
|
||||
|
|
@ -285,6 +349,10 @@ contains
|
|||
|
||||
end if
|
||||
|
||||
if (master .and. n_tallies > 0) then
|
||||
deallocate(id_array)
|
||||
end if
|
||||
|
||||
end subroutine write_state_point
|
||||
|
||||
!===============================================================================
|
||||
|
|
@ -391,7 +459,10 @@ contains
|
|||
#ifdef MPI
|
||||
real(8) :: dummy ! temporary receive buffer for non-root reduces
|
||||
#endif
|
||||
type(TallyObject), pointer :: t => null()
|
||||
integer, allocatable :: id_array(:)
|
||||
type(ElemKeyValueII), pointer :: current => null()
|
||||
type(ElemKeyValueII), pointer :: next => null()
|
||||
type(TallyObject), pointer :: tally => null()
|
||||
type(TallyResult), allocatable :: tallyresult_temp(:,:)
|
||||
|
||||
! ==========================================================================
|
||||
|
|
@ -448,22 +519,38 @@ contains
|
|||
! Indicate that tallies are on
|
||||
if (master) then
|
||||
call sp % write_data(1, "tallies_present", group="tallies")
|
||||
|
||||
! Build list of tally IDs
|
||||
current => tally_dict % keys()
|
||||
allocate(id_array(n_tallies))
|
||||
i = 1
|
||||
|
||||
do while (associated(current))
|
||||
id_array(i) = current % value
|
||||
! Move to next tally
|
||||
next => current % next
|
||||
deallocate(current)
|
||||
current => next
|
||||
i = i + 1
|
||||
end do
|
||||
|
||||
end if
|
||||
|
||||
! Write all tally results
|
||||
TALLY_RESULTS: do i = 1, n_tallies
|
||||
t => tallies(i)
|
||||
|
||||
tally => tallies(i)
|
||||
|
||||
! Determine size of tally results array
|
||||
m = size(t % results, 1)
|
||||
n = size(t % results, 2)
|
||||
m = size(tally % results, 1)
|
||||
n = size(tally % results, 2)
|
||||
n_bins = m*n*2
|
||||
|
||||
! Allocate array for storing sums and sums of squares, but
|
||||
! contiguously in memory for each
|
||||
allocate(tally_temp(2,m,n))
|
||||
tally_temp(1,:,:) = t % results(:,:) % sum
|
||||
tally_temp(2,:,:) = t % results(:,:) % sum_sq
|
||||
tally_temp(1,:,:) = tally % results(:,:) % sum
|
||||
tally_temp(2,:,:) = tally % results(:,:) % sum_sq
|
||||
|
||||
if (master) then
|
||||
! The MPI_IN_PLACE specifier allows the master to copy values into
|
||||
|
|
@ -472,11 +559,12 @@ contains
|
|||
call MPI_REDUCE(MPI_IN_PLACE, tally_temp, n_bins, MPI_REAL8, &
|
||||
MPI_SUM, 0, MPI_COMM_WORLD, mpi_err)
|
||||
#endif
|
||||
|
||||
! At the end of the simulation, store the results back in the
|
||||
! regular TallyResults array
|
||||
if (current_batch == n_batches) then
|
||||
t % results(:,:) % sum = tally_temp(1,:,:)
|
||||
t % results(:,:) % sum_sq = tally_temp(2,:,:)
|
||||
tally % results(:,:) % sum = tally_temp(1,:,:)
|
||||
tally % results(:,:) % sum_sq = tally_temp(2,:,:)
|
||||
end if
|
||||
|
||||
! Put in temporary tally result
|
||||
|
|
@ -485,8 +573,8 @@ contains
|
|||
tallyresult_temp(:,:) % sum_sq = tally_temp(2,:,:)
|
||||
|
||||
! Write reduced tally results to file
|
||||
call sp % write_tally_result(t % results, "results", &
|
||||
group="tallies/tally" // to_str(i), n1=m, n2=n)
|
||||
call sp % write_tally_result(tally % results, "results", &
|
||||
group="tallies/tally " // trim(to_str(tally % id)), n1=m, n2=n)
|
||||
|
||||
! Deallocate temporary tally result
|
||||
deallocate(tallyresult_temp)
|
||||
|
|
@ -501,6 +589,9 @@ contains
|
|||
! Deallocate temporary copy of tally results
|
||||
deallocate(tally_temp)
|
||||
end do TALLY_RESULTS
|
||||
|
||||
deallocate(id_array)
|
||||
|
||||
else
|
||||
if (master) then
|
||||
! Indicate that tallies are off
|
||||
|
|
@ -516,16 +607,24 @@ contains
|
|||
|
||||
subroutine load_state_point()
|
||||
|
||||
character(MAX_FILE_LEN) :: path_temp
|
||||
character(19) :: current_time
|
||||
integer :: i
|
||||
integer :: j
|
||||
integer :: length(4)
|
||||
integer :: int_array(3)
|
||||
integer, allocatable :: temp_array(:)
|
||||
logical :: source_present
|
||||
real(8) :: real_array(3)
|
||||
type(TallyObject), pointer :: t => null()
|
||||
character(MAX_FILE_LEN) :: path_temp
|
||||
character(19) :: current_time
|
||||
character(52) :: label
|
||||
integer :: i, j, k
|
||||
integer :: length(4)
|
||||
integer :: int_array(3)
|
||||
integer, allocatable :: id_array(:)
|
||||
integer, allocatable :: key_array(:)
|
||||
integer :: curr_key
|
||||
integer, allocatable :: temp_array(:)
|
||||
integer, allocatable :: temp_array3D(:,:,:)
|
||||
integer, allocatable :: temp_array4D(:,:,:,:)
|
||||
logical :: source_present
|
||||
real(8) :: l
|
||||
real(8) :: real_array(3)
|
||||
real(8), allocatable :: temp_real_array(:)
|
||||
type(StructuredMesh), pointer :: mesh => null()
|
||||
type(TallyObject), pointer :: tally => null()
|
||||
|
||||
! Write message
|
||||
call write_message("Loading state point " // trim(path_state_point) &
|
||||
|
|
@ -567,10 +666,22 @@ contains
|
|||
! Read and overwrite run information except number of batches
|
||||
call sp % read_data(run_mode, "run_mode")
|
||||
call sp % read_data(n_particles, "n_particles")
|
||||
call sp % read_data(int_array(1), "n_batches")
|
||||
|
||||
! Take maximum of statepoint n_batches and input n_batches
|
||||
n_batches = max(n_batches, int_array(1))
|
||||
|
||||
! Read batch number to restart at
|
||||
call sp % read_data(restart_batch, "current_batch")
|
||||
|
||||
! Check for source in statepoint if needed
|
||||
call sp % read_data(int_array(1), "source_present")
|
||||
if (int_array(1) == 1) then
|
||||
source_present = .true.
|
||||
else
|
||||
source_present = .false.
|
||||
end if
|
||||
|
||||
if (restart_batch > n_batches) then
|
||||
call fatal_error("The number batches specified in settings.xml is fewer &
|
||||
& than the number of batches in the given statepoint file.")
|
||||
|
|
@ -594,7 +705,7 @@ contains
|
|||
! Read in to see if CMFD was on
|
||||
call sp % read_data(int_array(1), "cmfd_on")
|
||||
|
||||
! Write out CMFD info
|
||||
! Read in CMFD info
|
||||
if (int_array(1) == 1) then
|
||||
call sp % read_data(cmfd % indices, "indices", length=4, group="cmfd")
|
||||
call sp % read_data(cmfd % k_cmfd, "k_cmfd", length=restart_batch, &
|
||||
|
|
@ -603,7 +714,7 @@ contains
|
|||
call sp % read_data(cmfd % cmfd_src, "cmfd_src", &
|
||||
length=length, group="cmfd")
|
||||
call sp % read_data(cmfd % entropy, "cmfd_entropy", &
|
||||
length=restart_batch, group="cmfd")
|
||||
length=restart_batch, group="cmfd")
|
||||
call sp % read_data(cmfd % balance, "cmfd_balance", &
|
||||
length=restart_batch, group="cmfd")
|
||||
call sp % read_data(cmfd % dom, "cmfd_dominance", &
|
||||
|
|
@ -614,127 +725,134 @@ contains
|
|||
end if
|
||||
|
||||
! Read number of meshes
|
||||
call sp % read_data(n_meshes, "n_meshes", group="tallies")
|
||||
call sp % read_data(n_meshes, "n_meshes", group="tallies/meshes")
|
||||
|
||||
! Read and overwrite mesh information
|
||||
MESH_LOOP: do i = 1, n_meshes
|
||||
call sp % read_data(meshes(i) % id, "id", &
|
||||
group="tallies/mesh" // to_str(i))
|
||||
call sp % read_data(meshes(i) % type, "type", &
|
||||
group="tallies/mesh" // to_str(i))
|
||||
call sp % read_data(meshes(i) % n_dimension, "n_dimension", &
|
||||
group="tallies/mesh" // to_str(i))
|
||||
call sp % read_data(meshes(i) % dimension, "dimension", &
|
||||
group="tallies/mesh" // to_str(i), &
|
||||
length=meshes(i) % n_dimension)
|
||||
call sp % read_data(meshes(i) % lower_left, "lower_left", &
|
||||
group="tallies/mesh" // to_str(i), &
|
||||
length=meshes(i) % n_dimension)
|
||||
call sp % read_data(meshes(i) % upper_right, "upper_right", &
|
||||
group="tallies/mesh" // to_str(i), &
|
||||
length=meshes(i) % n_dimension)
|
||||
call sp % read_data(meshes(i) % width, "width", &
|
||||
group="tallies/mesh" // to_str(i), &
|
||||
length=meshes(i) % n_dimension)
|
||||
end do MESH_LOOP
|
||||
if (n_meshes > 0) then
|
||||
|
||||
! Read list of mesh keys-> IDs
|
||||
allocate(id_array(n_meshes))
|
||||
allocate(key_array(n_meshes))
|
||||
|
||||
call sp % read_data(id_array, "ids", &
|
||||
group="tallies/meshes", length=n_meshes)
|
||||
call sp % read_data(key_array, "keys", &
|
||||
group="tallies/meshes", length=n_meshes)
|
||||
|
||||
! Read and overwrite mesh information
|
||||
MESH_LOOP: do i = 1, n_meshes
|
||||
|
||||
mesh => meshes(id_array(i))
|
||||
curr_key = key_array(id_array(i))
|
||||
|
||||
call sp % read_data(mesh % id, "id", &
|
||||
group="tallies/meshes/mesh " // trim(to_str(curr_key)))
|
||||
call sp % read_data(mesh % type, "type", &
|
||||
group="tallies/meshes/mesh " // trim(to_str(curr_key)))
|
||||
call sp % read_data(mesh % n_dimension, "n_dimension", &
|
||||
group="tallies/meshes/mesh " // trim(to_str(meshes(i) % id)))
|
||||
call sp % read_data(mesh % dimension, "dimension", &
|
||||
group="tallies/meshes/mesh " // trim(to_str(curr_key)), &
|
||||
length=mesh % n_dimension)
|
||||
call sp % read_data(mesh % lower_left, "lower_left", &
|
||||
group="tallies/meshes/mesh " // trim(to_str(curr_key)), &
|
||||
length=mesh % n_dimension)
|
||||
call sp % read_data(mesh % upper_right, "upper_right", &
|
||||
group="tallies/meshes/mesh " // trim(to_str(curr_key)), &
|
||||
length=mesh % n_dimension)
|
||||
call sp % read_data(mesh % width, "width", &
|
||||
group="tallies/meshes/mesh " // trim(to_str(curr_key)), &
|
||||
length=meshes(i) % n_dimension)
|
||||
|
||||
end do MESH_LOOP
|
||||
|
||||
deallocate(id_array)
|
||||
deallocate(key_array)
|
||||
|
||||
end if
|
||||
|
||||
! Read and overwrite number of tallies
|
||||
call sp % read_data(n_tallies, "n_tallies", group="tallies")
|
||||
|
||||
! Read list of tally keys-> IDs
|
||||
allocate(id_array(n_tallies))
|
||||
allocate(key_array(n_tallies))
|
||||
|
||||
call sp % read_data(id_array, "ids", group="tallies", length=n_tallies)
|
||||
call sp % read_data(key_array, "keys", group="tallies", length=n_tallies)
|
||||
|
||||
! Read in tally metadata
|
||||
TALLY_METADATA: do i = 1, n_tallies
|
||||
|
||||
! Get pointer to tally
|
||||
t => tallies(i)
|
||||
tally => tallies(i)
|
||||
curr_key = key_array(id_array(i))
|
||||
|
||||
! Read tally id
|
||||
call sp % read_data(t % id, "id", group="tallies/tally" // to_str(i))
|
||||
|
||||
! Read number of realizations
|
||||
call sp % read_data(t % n_realizations, "n_realizations", &
|
||||
group="tallies/tally" // to_str(i))
|
||||
|
||||
! Read size of tally results
|
||||
call sp % read_data(int_array(1), "total_score_bins", &
|
||||
group="tallies/tally" // to_str(i))
|
||||
call sp % read_data(int_array(2), "total_filter_bins", &
|
||||
group="tallies/tally" // to_str(i))
|
||||
|
||||
! Check size of tally results array
|
||||
if (int_array(1) /= t % total_score_bins .and. &
|
||||
int_array(2) /= t % total_filter_bins) then
|
||||
call fatal_error("Input file tally structure is different from &
|
||||
&restart.")
|
||||
call sp % read_data(j, "label_size", group="tallies/tally " // &
|
||||
trim(to_str(curr_key)))
|
||||
if (j > 0) then
|
||||
call sp % read_data(label, "label", group="tallies/tally " // &
|
||||
trim(to_str(curr_key)))
|
||||
end if
|
||||
|
||||
! Read number of filters
|
||||
call sp % read_data(t % n_filters, "n_filters", &
|
||||
group="tallies/tally" // to_str(i))
|
||||
call sp % read_data(tally % estimator, "estimator", &
|
||||
group="tallies/tally " // trim(to_str(curr_key)))
|
||||
call sp % read_data(tally % n_realizations, "n_realizations", &
|
||||
group="tallies/tally " // trim(to_str(curr_key)))
|
||||
call sp % read_data(tally % n_filters, "n_filters", &
|
||||
group="tallies/tally " // trim(to_str(curr_key)))
|
||||
|
||||
! Read filter information
|
||||
FILTER_LOOP: do j = 1, t % n_filters
|
||||
|
||||
! Read type of filter
|
||||
call sp % read_data(t % filters(j) % type, "type", &
|
||||
group="tallies/tally" // trim(to_str(i)) // "/filter" // to_str(j))
|
||||
|
||||
! Read number of bins for this filter
|
||||
call sp % read_data(t % filters(j) % n_bins, "n_bins", &
|
||||
group="tallies/tally" // trim(to_str(i)) // "/filter" // to_str(j))
|
||||
|
||||
! Read bins
|
||||
if (t % filters(j) % type == FILTER_ENERGYIN .or. &
|
||||
t % filters(j) % type == FILTER_ENERGYOUT) then
|
||||
call sp % read_data(t % filters(j) % real_bins, "bins", &
|
||||
group="tallies/tally" // trim(to_str(i)) // "/filter" // to_str(j), &
|
||||
length=size(t % filters(j) % real_bins))
|
||||
FILTER_LOOP: do j = 1, tally % n_filters
|
||||
call sp % read_data(tally % filters(j) % type, "type", &
|
||||
group="tallies/tally " // trim(to_str(curr_key)) // &
|
||||
"/filter " // to_str(j))
|
||||
call sp % read_data(tally % filters(j) % n_bins, "n_bins", &
|
||||
group="tallies/tally " // trim(to_str(curr_key)) // &
|
||||
"/filter " // to_str(j))
|
||||
if (tally % filters(j) % type == FILTER_ENERGYIN .or. &
|
||||
tally % filters(j) % type == FILTER_ENERGYOUT) then
|
||||
call sp % read_data(tally % filters(j) % real_bins, "bins", &
|
||||
group="tallies/tally " // trim(to_str(curr_key)) // &
|
||||
"/filter " // to_str(j), &
|
||||
length=size(tally % filters(j) % real_bins))
|
||||
else
|
||||
call sp % read_data(t % filters(j) % int_bins, "bins", &
|
||||
group="tallies/tally" // trim(to_str(i)) // "/filter" // to_str(j), &
|
||||
length=size(t % filters(j) % int_bins))
|
||||
call sp % read_data(tally % filters(j) % int_bins, "bins", &
|
||||
group="tallies/tally " // trim(to_str(curr_key)) // &
|
||||
"/filter " // to_str(j), &
|
||||
length=size(tally % filters(j) % int_bins))
|
||||
end if
|
||||
|
||||
end do FILTER_LOOP
|
||||
|
||||
! Read number of nuclide bins
|
||||
call sp % read_data(t % n_nuclide_bins, "n_nuclide_bins", &
|
||||
group="tallies/tally" // to_str(i))
|
||||
call sp % read_data(tally % n_nuclide_bins, "n_nuclides", &
|
||||
group="tallies/tally " // trim(to_str(curr_key)))
|
||||
|
||||
! Set up nuclide bin array and then write
|
||||
allocate(temp_array(t % n_nuclide_bins))
|
||||
call sp % read_data(temp_array, "nuclide_bins", &
|
||||
group="tallies/tally" // to_str(i), length=t % n_nuclide_bins)
|
||||
NUCLIDE_LOOP: do j = 1, t % n_nuclide_bins
|
||||
! Set up nuclide bin array and then read
|
||||
allocate(temp_array(tally % n_nuclide_bins))
|
||||
call sp % read_data(temp_array, "nuclides", &
|
||||
group="tallies/tally " // trim(to_str(curr_key)), &
|
||||
length=tally % n_nuclide_bins)
|
||||
|
||||
NUCLIDE_LOOP: do j = 1, tally % n_nuclide_bins
|
||||
if (temp_array(j) > 0) then
|
||||
nuclides(t % nuclide_bins(j)) % zaid = temp_array(j)
|
||||
tally % nuclide_bins(j) = temp_array(j)
|
||||
else
|
||||
t % nuclide_bins(j) = temp_array(j)
|
||||
tally % nuclide_bins(j) = temp_array(j)
|
||||
end if
|
||||
end do NUCLIDE_LOOP
|
||||
|
||||
deallocate(temp_array)
|
||||
|
||||
! Write number of score bins, score bins, and scatt order
|
||||
call sp % read_data(t % n_score_bins, "n_score_bins", &
|
||||
group="tallies/tally" // to_str(i))
|
||||
call sp % read_data(t % score_bins, "score_bins", &
|
||||
group="tallies/tally" // to_str(i), length=t % n_score_bins)
|
||||
call sp % read_data(t % moment_order, "moment_order", &
|
||||
group="tallies/tally" // to_str(i), length=t % n_score_bins)
|
||||
|
||||
! Write number of user score bins
|
||||
call sp % read_data(t % n_user_score_bins, "n_user_score_bins", &
|
||||
group="tallies/tally" // to_str(i))
|
||||
call sp % read_data(tally % n_score_bins, "n_score_bins", &
|
||||
group="tallies/tally " // trim(to_str(curr_key)))
|
||||
call sp % read_data(tally % score_bins, "score_bins", &
|
||||
group="tallies/tally " // trim(to_str(curr_key)), &
|
||||
length=tally % n_score_bins)
|
||||
call sp % read_data(tally % moment_order, "moment_order", &
|
||||
group="tallies/tally " // trim(to_str(curr_key)), &
|
||||
length=tally % n_score_bins)
|
||||
|
||||
end do TALLY_METADATA
|
||||
|
||||
! Check for source in statepoint if needed
|
||||
call sp % read_data(int_array(1), "source_present")
|
||||
if (int_array(1) == 1) then
|
||||
source_present = .true.
|
||||
else
|
||||
source_present = .false.
|
||||
end if
|
||||
|
||||
! Check to make sure source bank is present
|
||||
if (path_source_point == path_state_point .and. .not. source_present) then
|
||||
call fatal_error("Source bank must be contained in statepoint restart &
|
||||
|
|
@ -759,24 +877,30 @@ contains
|
|||
n1=N_GLOBAL_TALLIES, n2=1)
|
||||
|
||||
! Check if tally results are present
|
||||
call sp % read_data(int_array(1), "tallies_present", group="tallies", collect=.false.)
|
||||
call sp % read_data(int_array(1), "tallies_present", &
|
||||
group="tallies", collect=.false.)
|
||||
|
||||
! Read in sum and sum squared
|
||||
if (int_array(1) == 1) then
|
||||
TALLY_RESULTS: do i = 1, n_tallies
|
||||
|
||||
! Set pointer to tally
|
||||
t => tallies(i)
|
||||
tally => tallies(i)
|
||||
curr_key = key_array(id_array(i))
|
||||
|
||||
! Read sum and sum_sq for each bin
|
||||
call sp % read_tally_result(t % results, "results", &
|
||||
group="tallies/tally" // to_str(i), &
|
||||
n1=size(t % results, 1), n2=size(t % results, 2))
|
||||
call sp % read_tally_result(tally % results, "results", &
|
||||
group="tallies/tally " // trim(to_str(curr_key)), &
|
||||
n1=size(tally % results, 1), n2=size(tally % results, 2))
|
||||
|
||||
end do TALLY_RESULTS
|
||||
|
||||
end if
|
||||
end if
|
||||
|
||||
deallocate(id_array)
|
||||
deallocate(key_array)
|
||||
|
||||
! Read source if in eigenvalue mode
|
||||
if (run_mode == MODE_EIGENVALUE) then
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,6 @@ from openmc.executor import *
|
|||
#from statepoint import *
|
||||
|
||||
try:
|
||||
from openmc.opencg_compatible import *
|
||||
from openmc.opencg_compatible import *
|
||||
except ImportError:
|
||||
pass
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class Nuclide(object):
|
|||
# Initialize class attributes
|
||||
self._name = ''
|
||||
self._xs = None
|
||||
self._zaid = None
|
||||
|
||||
# Set the Material class attributes
|
||||
self.set_name(name)
|
||||
|
|
@ -63,8 +64,20 @@ class Nuclide(object):
|
|||
self._xs = xs
|
||||
|
||||
|
||||
def set_zaid(self, zaid):
|
||||
|
||||
if not is_integer(zaid):
|
||||
msg = 'Unable to set zaid for Nuclide ' \
|
||||
'with a non-integer {0}'.format(zaid)
|
||||
raise ValueError(msg)
|
||||
|
||||
self._zaid = zaid
|
||||
|
||||
|
||||
def __repr__(self):
|
||||
|
||||
string = 'Nuclide - {0}\n'.format(self._name)
|
||||
string += '{0: <16}{1}{2}\n'.format('\tXS', '=\t', self._xs)
|
||||
return string
|
||||
if self._zaid is not None:
|
||||
string += '{0: <16}{1}{2}\n'.format('\tZAID', '=\t', self._zaid)
|
||||
return string
|
||||
|
|
@ -370,10 +370,10 @@ def get_opencg_cell(openmc_cell):
|
|||
else:
|
||||
opencg_cell.setFill(get_opencg_lattice(fill))
|
||||
|
||||
if openmc_cell._rotation:
|
||||
if openmc_cell._rotation is not None:
|
||||
opencg_cell.setRotation(openmc_cell._rotation)
|
||||
|
||||
if openmc_cell._translation:
|
||||
if openmc_cell._translation is not None:
|
||||
opencg_cell.setTranslation(openmc_cell._translation)
|
||||
|
||||
surfaces = openmc_cell._surfaces
|
||||
|
|
@ -573,7 +573,7 @@ def get_openmc_cell(opencg_cell):
|
|||
openmc_cell.set_rotation(rotation)
|
||||
|
||||
if opencg_cell._translation:
|
||||
translation = np.asarray(opencg_cell._translation, dtype=np.int)
|
||||
translation = np.asarray(opencg_cell._translation, dtype=np.float64)
|
||||
openmc_cell.setTranslation(translation)
|
||||
|
||||
surfaces = opencg_cell._surfaces
|
||||
|
|
@ -702,12 +702,6 @@ def get_opencg_lattice(openmc_lattice):
|
|||
universe_id = universes[x][y][z]._id
|
||||
universe_array[z][y][x] = unique_universes[universe_id]
|
||||
|
||||
# Transpose, reverse y-dimension in array for appropriate ordering in OpenCG
|
||||
shape = universe_array.shape
|
||||
universe_array = np.transpose(universe_array)
|
||||
universe_array.shape = shape
|
||||
universe_array = universe_array[:,::-1,:]
|
||||
|
||||
opencg_lattice = opencg.Lattice(lattice_id, name)
|
||||
opencg_lattice.setDimension(dimension)
|
||||
opencg_lattice.setWidth(width)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
495
src/utils/openmc/summary.py
Normal file
495
src/utils/openmc/summary.py
Normal file
|
|
@ -0,0 +1,495 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import openmc
|
||||
from openmc.opencg_compatible import get_opencg_geometry
|
||||
import numpy as np
|
||||
|
||||
try:
|
||||
import h5py
|
||||
except ImportError:
|
||||
msg = 'Unable to import h5py which is necessary for openmc.summary'
|
||||
raise ImportError(msg)
|
||||
|
||||
|
||||
class Summary(object):
|
||||
|
||||
def __init__(self, filename):
|
||||
|
||||
openmc.reset_auto_ids()
|
||||
|
||||
if not filename.endswith(('.h5', '.hdf5')):
|
||||
msg = 'Unable to open "{0}" which is not an HDF5 summary file'
|
||||
raise ValueError(msg)
|
||||
|
||||
self._f = h5py.File(filename, 'r')
|
||||
self.openmc_geometry = None
|
||||
self.opencg_geometry = None
|
||||
|
||||
self._read_metadata()
|
||||
self._read_geometry()
|
||||
|
||||
|
||||
def _read_metadata(self):
|
||||
|
||||
# Read OpenMC version
|
||||
self.version = [self._f['version_major'][0],
|
||||
self._f['version_minor'][0],
|
||||
self._f['version_release'][0]]
|
||||
# Read date and time
|
||||
self.date_and_time = self._f['date_and_time'][...]
|
||||
|
||||
self.n_batches = self._f['n_batches'][0]
|
||||
self.n_particles = self._f['n_particles'][0]
|
||||
self.n_active = self._f['n_active'][0]
|
||||
self.n_inactive = self._f['n_inactive'][0]
|
||||
self.gen_per_batch = self._f['gen_per_batch'][0]
|
||||
self.n_procs = self._f['n_procs'][0]
|
||||
|
||||
|
||||
def _read_geometry(self):
|
||||
|
||||
# Read in and initialize the Materials and Geometry
|
||||
self._read_nuclides()
|
||||
self._read_materials()
|
||||
self._read_surfaces()
|
||||
self._read_cells()
|
||||
self._read_universes()
|
||||
self._read_lattices()
|
||||
self._finalize_geometry()
|
||||
|
||||
|
||||
def _read_nuclides(self):
|
||||
|
||||
self.n_nuclides = self._f['nuclides/n_nuclides'][0]
|
||||
|
||||
# Initialize dictionary for each Nuclide
|
||||
# Keys - Nuclide ZAIDs
|
||||
# Values - Nuclide objects
|
||||
self.nuclides = dict()
|
||||
|
||||
for key in self._f['nuclides'].keys():
|
||||
|
||||
if key == 'n_nuclides':
|
||||
continue
|
||||
|
||||
index = self._f['nuclides'][key]['index'][0]
|
||||
alias = self._f['nuclides'][key]['alias'][0]
|
||||
zaid = self._f['nuclides'][key]['zaid'][0]
|
||||
|
||||
# Read the Nuclide's name (e.g., 'H-1' or 'U-235')
|
||||
name = alias.split('.')[0]
|
||||
|
||||
# Read the Nuclide's cross-section identifier (e.g., '70c')
|
||||
xs = alias.split('.')[1]
|
||||
|
||||
# Initialize this Nuclide and add it to the global dictionary of Nuclides
|
||||
if 'nat' in name:
|
||||
self.nuclides[index] = openmc.Element(name=name, xs=xs)
|
||||
else:
|
||||
self.nuclides[index] = openmc.Nuclide(name=name, xs=xs)
|
||||
self.nuclides[index].set_zaid(zaid)
|
||||
|
||||
|
||||
def _read_materials(self):
|
||||
|
||||
self.n_materials = self._f['materials/n_materials'][0]
|
||||
|
||||
# Initialize dictionary for each Material
|
||||
# Keys - Material keys
|
||||
# Values - Material objects
|
||||
self.materials = dict()
|
||||
|
||||
for key in self._f['materials'].keys():
|
||||
|
||||
if key == 'n_materials':
|
||||
continue
|
||||
|
||||
material_id = int(key.lstrip('material '))
|
||||
index = self._f['materials'][key]['index'][0]
|
||||
density = self._f['materials'][key]['atom_density'][0]
|
||||
nuc_densities = self._f['materials'][key]['nuclide_densities'][...]
|
||||
nuclides = self._f['materials'][key]['nuclides'][...]
|
||||
n_sab = self._f['materials'][key]['n_sab'][0]
|
||||
|
||||
sab_names = list()
|
||||
sab_xs = list()
|
||||
|
||||
# Read the names of the S(a,b) tables for this Material
|
||||
for i in range(1, n_sab+1):
|
||||
|
||||
sab_table = self._f['materials'][key]['sab_tables'][str(i)][0]
|
||||
|
||||
# Read the cross-section identifiers for each S(a,b) table
|
||||
sab_names.append(sab_table.split('.')[0])
|
||||
sab_xs.append(sab_table.split('.')[1])
|
||||
|
||||
# Create the Material
|
||||
material = openmc.Material(material_id=material_id)
|
||||
|
||||
# Set the Material's density to g/cm3 - this is what is used in OpenMC
|
||||
material.set_density(density=density, units='g/cm3')
|
||||
|
||||
# Add all Nuclides to the Material
|
||||
for i, zaid in enumerate(nuclides):
|
||||
nuclide = self.get_nuclide_by_zaid(zaid)
|
||||
density = nuc_densities[i]
|
||||
|
||||
if isinstance(nuclide, openmc.Nuclide):
|
||||
material.add_nuclide(nuclide, percent=density, percent_type='ao')
|
||||
elif isinstance(nuclide, openmc.Element):
|
||||
material.add_element(nuclide, percent=density, percent_type='ao')
|
||||
|
||||
# Add S(a,b) table(s?) to the Material
|
||||
for i in range(n_sab):
|
||||
name = sab_names[i]
|
||||
xs = sab_xs[i]
|
||||
material.add_s_alpha_beta(name, xs)
|
||||
|
||||
# Add the Material to the global dictionary of all Materials
|
||||
self.materials[index] = material
|
||||
|
||||
|
||||
def _read_surfaces(self):
|
||||
|
||||
self.n_surfaces = self._f['geometry/n_surfaces'][0]
|
||||
|
||||
# Initialize dictionary for each Surface
|
||||
# Keys - Surface keys
|
||||
# Values - Surfacee objects
|
||||
self.surfaces = dict()
|
||||
|
||||
for key in self._f['geometry/surfaces'].keys():
|
||||
|
||||
if key == 'n_surfaces':
|
||||
continue
|
||||
|
||||
surface_id = int(key.lstrip('surface '))
|
||||
index = self._f['geometry/surfaces'][key]['index'][0]
|
||||
surf_type = self._f['geometry/surfaces'][key]['type'][...][0]
|
||||
bc = self._f['geometry/surfaces'][key]['boundary_condition'][...][0]
|
||||
coeffs = self._f['geometry/surfaces'][key]['coefficients'][...]
|
||||
|
||||
# Create the Surface based on its type
|
||||
|
||||
if surf_type == 'X Plane':
|
||||
x0 = coeffs[0]
|
||||
surface = openmc.XPlane(surface_id, bc, x0)
|
||||
|
||||
elif surf_type == 'Y Plane':
|
||||
y0 = coeffs[0]
|
||||
surface = openmc.YPlane(surface_id, bc, y0)
|
||||
|
||||
elif surf_type == 'Z Plane':
|
||||
z0 = coeffs[0]
|
||||
surface = openmc.ZPlane(surface_id, bc, z0)
|
||||
|
||||
elif surf_type == 'Plane':
|
||||
A = coeffs[0]
|
||||
B = coeffs[1]
|
||||
C = coeffs[2]
|
||||
D = coeffs[3]
|
||||
surface = openmc.Plane(surface_id, bc, A, B, C, D)
|
||||
|
||||
elif surf_type == 'X Cylinder':
|
||||
y0 = coeffs[0]
|
||||
z0 = coeffs[1]
|
||||
R = coeffs[2]
|
||||
surface = openmc.XCylinder(surface_id, bc, y0, z0, R)
|
||||
|
||||
elif surf_type == 'Y Cylinder':
|
||||
x0 = coeffs[0]
|
||||
z0 = coeffs[1]
|
||||
R = coeffs[2]
|
||||
surface = openmc.YCylinder(surface_id, bc, x0, z0, R)
|
||||
|
||||
elif surf_type == 'Z Cylinder':
|
||||
x0 = coeffs[0]
|
||||
y0 = coeffs[1]
|
||||
R = coeffs[2]
|
||||
surface = openmc.ZCylinder(surface_id, bc, x0, y0, R)
|
||||
|
||||
elif surf_type == 'Sphere':
|
||||
x0 = coeffs[0]
|
||||
y0 = coeffs[1]
|
||||
z0 = coeffs[2]
|
||||
R = coeffs[3]
|
||||
surface = openmc.Sphere(surface_id, bc, x0, y0, z0, R)
|
||||
|
||||
elif surf_type in ['X Cone', 'Y Cone', 'Z Cone']:
|
||||
x0 = coeffs[0]
|
||||
y0 = coeffs[1]
|
||||
z0 = coeffs[2]
|
||||
R2 = coeffs[3]
|
||||
|
||||
if surf_type == 'X Cone':
|
||||
surface = openmc.XCone(surface_id, bc, x0, y0, z0, R2)
|
||||
if surf_type == 'Y Cone':
|
||||
surface = openmc.YCone(surface_id, bc, x0, y0, z0, R2)
|
||||
if surf_type == 'Z Cone':
|
||||
surface = openmc.ZCone(surface_id, bc, x0, y0, z0, R2)
|
||||
|
||||
# Add Surface to global dictionary of all Surfaces
|
||||
self.surfaces[index] = surface
|
||||
|
||||
|
||||
def _read_cells(self):
|
||||
|
||||
self.n_cells = self._f['geometry/n_cells'][0]
|
||||
|
||||
# Initialize dictionary for each Cell
|
||||
# Keys - Cell keys
|
||||
# Values - Cell objects
|
||||
self.cells = dict()
|
||||
|
||||
# Initialize dictionary for each Cell's fill
|
||||
# (e.g., Material, Universe or Lattice ID)
|
||||
# This dictionary is used later to link the fills with
|
||||
# the corresponding objects
|
||||
# Keys - Cell keys
|
||||
# Values - Filling Material, Universe or Lattice ID
|
||||
self._cell_fills = dict()
|
||||
|
||||
for key in self._f['geometry/cells'].keys():
|
||||
|
||||
if key == 'n_cells':
|
||||
continue
|
||||
|
||||
cell_id = int(key.lstrip('cell '))
|
||||
index = self._f['geometry/cells'][key]['index'][0]
|
||||
fill_type = self._f['geometry/cells'][key]['fill_type'][...][0]
|
||||
|
||||
if fill_type == 'normal':
|
||||
fill = self._f['geometry/cells'][key]['material'][0]
|
||||
elif fill_type == 'fill':
|
||||
fill = self._f['geometry/cells'][key]['universe'][0]
|
||||
else:
|
||||
fill = self._f['geometry/cells'][key]['lattice'][0]
|
||||
|
||||
if 'surfaces' in self._f['geometry/cells'][key].keys():
|
||||
surfaces = self._f['geometry/cells'][key]['surfaces'][...]
|
||||
else:
|
||||
surfaces = list()
|
||||
|
||||
# Create this Cell
|
||||
cell = openmc.Cell(cell_id=cell_id)
|
||||
|
||||
if fill_type == 'universe':
|
||||
maps = self._f['geometry/cells'][key]['maps'][0]
|
||||
|
||||
if maps > 0:
|
||||
offset = self._f['geometry/cells'][key]['offset'][...]
|
||||
cell.set_offset(offset)
|
||||
|
||||
translated = self._f['geometry/cells'][key]['translated'][0]
|
||||
if translated:
|
||||
translation = \
|
||||
self._f['geometry/cells'][key]['translation'][...]
|
||||
translation = np.asarray(translation, dtype=np.float64)
|
||||
cell.set_translation(translation)
|
||||
|
||||
rotated = self._f['geometry/cells'][key]['rotated'][0]
|
||||
if rotated:
|
||||
rotation = \
|
||||
self._f['geometry/cells'][key]['rotation'][...]
|
||||
rotation = np.asarray(rotation, dtype=np.int)
|
||||
cell.set_rotation(rotation)
|
||||
|
||||
# Store Cell fill information for after Universe/Lattice creation
|
||||
self._cell_fills[index] = (fill_type, fill)
|
||||
|
||||
# Iterate over all Surfaces and add them to the Cell
|
||||
for surface_halfspace in surfaces:
|
||||
|
||||
halfspace = np.sign(surface_halfspace)
|
||||
surface_id = np.abs(surface_halfspace)
|
||||
surface = self.surfaces[surface_id]
|
||||
cell.add_surface(surface, halfspace)
|
||||
|
||||
# Add the Cell to the global dictionary of all Cells
|
||||
self.cells[index] = cell
|
||||
|
||||
|
||||
def _read_universes(self):
|
||||
|
||||
self.n_universes = self._f['geometry/n_universes'][0]
|
||||
|
||||
# Initialize dictionary for each Universe
|
||||
# Keys - Universe keys
|
||||
# Values - Universe objects
|
||||
self.universes = dict()
|
||||
|
||||
for key in self._f['geometry/universes'].keys():
|
||||
|
||||
if key == 'n_universes':
|
||||
continue
|
||||
|
||||
universe_id = int(key.lstrip('universe '))
|
||||
index = self._f['geometry/universes'][key]['index'][0]
|
||||
cells = self._f['geometry/universes'][key]['cells'][...]
|
||||
|
||||
# Create this Universe
|
||||
universe = openmc.Universe(universe_id=universe_id)
|
||||
|
||||
# Add each Cell to the Universe
|
||||
for cell_id in cells:
|
||||
cell = self.cells[cell_id]
|
||||
universe.add_cell(cell)
|
||||
|
||||
# Add the Universe to the global list of Universes
|
||||
self.universes[index] = universe
|
||||
|
||||
|
||||
def _read_lattices(self):
|
||||
|
||||
self.n_lattices = self._f['geometry/n_lattices'][0]
|
||||
|
||||
# Initialize lattices for each Lattice
|
||||
# Keys - Lattice keys
|
||||
# Values - Lattice objects
|
||||
self.lattices = dict()
|
||||
|
||||
for key in self._f['geometry/lattices'].keys():
|
||||
|
||||
if key == 'n_lattices':
|
||||
continue
|
||||
|
||||
lattice_id = int(key.lstrip('lattice '))
|
||||
index = self._f['geometry/lattices'][key]['index'][0]
|
||||
type = self._f['geometry/lattices'][key]['type'][...][0]
|
||||
width = self._f['geometry/lattices'][key]['width'][...]
|
||||
dimension = self._f['geometry/lattices'][key]['dimension'][...]
|
||||
lower_left = self._f['geometry/lattices'][key]['lower_left'][...]
|
||||
outside = self._f['geometry/lattices'][key]['outside'][0]
|
||||
maps = self._f['geometry/lattices'][key]['maps'][0]
|
||||
offset_size = self._f['geometry/lattices'][key]['offset_size'][0]
|
||||
|
||||
if offset_size > 0:
|
||||
offsets = self._f['geometry/lattices'][key]['offsets'][...]
|
||||
offsets = np.swapaxes(offsets, 0, 1)
|
||||
offsets = np.swapaxes(offsets, 1, 2)
|
||||
|
||||
universe_ids = self._f['geometry/lattices'][key]['universes'][...]
|
||||
universe_ids = np.swapaxes(universe_ids, 0, 1)
|
||||
universe_ids = np.swapaxes(universe_ids, 1, 2)
|
||||
|
||||
# Create the Lattice
|
||||
lattice = openmc.Lattice(lattice_id=lattice_id, type=type)
|
||||
lattice.set_dimension(tuple(dimension))
|
||||
lattice.set_lower_left(lower_left)
|
||||
lattice.set_width(width)
|
||||
|
||||
# Build array of Universe pointers for the Lattice
|
||||
universes = np.ndarray(tuple(universe_ids.shape), dtype=openmc.Universe)
|
||||
|
||||
for x in range(universe_ids.shape[0]):
|
||||
for y in range(universe_ids.shape[1]):
|
||||
for z in range(universe_ids.shape[2]):
|
||||
universes[x,y,z] = \
|
||||
self.get_universe_by_id(universe_ids[x,y,z])
|
||||
|
||||
# Transpose, reverse y-dimension in array for appropriate ordering
|
||||
shape = universes.shape
|
||||
universes = np.transpose(universes, (1,0,2))
|
||||
universes.shape = shape
|
||||
universes = universes[:,::-1,:]
|
||||
lattice.set_universes(universes)
|
||||
|
||||
# If the Material specified outside the Lattice is not void (-1)
|
||||
if outside != -1:
|
||||
lattice.set_outside(self.materials[outside])
|
||||
|
||||
if offset_size > 0:
|
||||
lattice.set_offsets(offsets)
|
||||
|
||||
# Add the Lattice to the global dictionary of all Lattices
|
||||
self.lattices[index] = lattice
|
||||
|
||||
|
||||
def _finalize_geometry(self):
|
||||
|
||||
# Initialize Geometry object
|
||||
self.openmc_geometry = openmc.Geometry()
|
||||
|
||||
# Iterate over all Cells and add fill Materials, Universes and Lattices
|
||||
for cell_key in self._cell_fills.keys():
|
||||
|
||||
# Determine the fill type ('normal', 'universe', or 'lattice') and ID
|
||||
fill_type = self._cell_fills[cell_key][0]
|
||||
fill_id = self._cell_fills[cell_key][1]
|
||||
|
||||
# Retrieve the object corresponding to the fill type and ID
|
||||
if fill_type == 'normal':
|
||||
if fill_id > 0:
|
||||
fill = self.get_material_by_id(fill_id)
|
||||
else:
|
||||
fill = 'void'
|
||||
elif fill_type == 'universe':
|
||||
fill = self.get_universe_by_id(fill_id)
|
||||
else:
|
||||
fill = self.get_lattice_by_id(fill_id)
|
||||
|
||||
# Set the fill for the Cell
|
||||
self.cells[cell_key].set_fill(fill)
|
||||
|
||||
# Set the root universe for the Geometry
|
||||
root_universe = self.get_universe_by_id(0)
|
||||
self.openmc_geometry.set_root_universe(root_universe)
|
||||
|
||||
|
||||
def make_opencg_geometry(self):
|
||||
if self.opencg_geometry is None:
|
||||
self.opencg_geometry = get_opencg_geometry(self.openmc_geometry)
|
||||
|
||||
|
||||
def get_nuclide_by_zaid(self, zaid):
|
||||
|
||||
for index, nuclide in self.nuclides.items():
|
||||
if nuclide._zaid == zaid:
|
||||
return nuclide
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def get_material_by_id(self, material_id):
|
||||
|
||||
for index, material in self.materials.items():
|
||||
if material._id == material_id:
|
||||
return material
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def get_surface_by_id(self, surface_id):
|
||||
|
||||
for index, surface in self.surfaces.items():
|
||||
if surface._id == surface_id:
|
||||
return surface
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def get_cell_by_id(self, cell_id):
|
||||
|
||||
for index, cell in self.cells.items():
|
||||
if cell._id == cell_id:
|
||||
return cell
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def get_universe_by_id(self, universe_id):
|
||||
|
||||
for index, universe in self.universes.items():
|
||||
if universe._id == universe_id:
|
||||
return universe
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def get_lattice_by_id(self, lattice_id):
|
||||
|
||||
for index, lattice in self.lattices.items():
|
||||
if lattice._id == lattice_id:
|
||||
return lattice
|
||||
|
||||
return None
|
||||
|
|
@ -91,7 +91,7 @@ class Surface(object):
|
|||
def __repr__(self):
|
||||
|
||||
string = 'Surface\n'
|
||||
string += '{0: <16}{1}{2}\n'.format('\tID', '=\t{0}', self._id)
|
||||
string += '{0: <16}{1}{2}\n'.format('\tID', '=\t', self._id)
|
||||
string += '{0: <16}{1}{2}\n'.format('\tName', '=\t', self._name)
|
||||
string += '{0: <16}{1}{2}\n'.format('\tType', '=\t', self._type)
|
||||
string += '{0: <16}{1}{2}\n'.format('\tBoundary', '=\t', self._bc_type)
|
||||
|
|
|
|||
|
|
@ -101,8 +101,8 @@ class Cell(object):
|
|||
|
||||
if not isinstance(fill, (openmc.Material, Universe, Lattice)) \
|
||||
and fill != 'void':
|
||||
msg = 'Unable to set Cell ID={0} to use a a non-Material or ' \
|
||||
'Universe fill {1}'.format(self._id, fill)
|
||||
msg = 'Unable to set Cell ID={0} to use a non-Material or ' \
|
||||
'Universe fill {1}'.format(self._id, fill)
|
||||
raise ValueError(msg)
|
||||
|
||||
self._fill = fill
|
||||
|
|
|
|||
|
|
@ -11,32 +11,41 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.20.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results1 = sp.tallies[0].results
|
||||
shape1 = results1.shape
|
||||
size1 = (np.product(shape1))
|
||||
results1 = np.reshape(results1, size1)
|
||||
results2 = sp.tallies[1].results
|
||||
shape2 = results2.shape
|
||||
size2 = (np.product(shape2))
|
||||
results2 = np.reshape(results2, size2)
|
||||
results3 = sp.tallies[2].results
|
||||
shape3 = results3.shape
|
||||
size3 = (np.product(shape3))
|
||||
results3 = np.reshape(results3, size3)
|
||||
results4 = sp.tallies[3].results
|
||||
shape4 = results4.shape
|
||||
size4 = (np.product(shape4))
|
||||
results4 = np.reshape(results4, size4)
|
||||
tally1 = sp._tallies[1]
|
||||
results1 = np.zeros((tally1._sum.size + tally1._sum.size, ))
|
||||
results1[0::2] = tally1._sum.ravel()
|
||||
results1[1::2] = tally1._sum_sq.ravel()
|
||||
|
||||
for tally_id in sp._tallies:
|
||||
if 'CMFD flux, total, scatter-1' in sp._tallies[tally_id]._label:
|
||||
tally2 = sp._tallies[tally_id]
|
||||
elif 'CMFD neutron production' in sp._tallies[tally_id]._label:
|
||||
tally3 = sp._tallies[tally_id]
|
||||
elif 'CMFD surface currents' in sp._tallies[tally_id]._label:
|
||||
tally4 = sp._tallies[tally_id]
|
||||
|
||||
results2 = np.zeros((tally2._sum.size + tally2._sum.size, ))
|
||||
results2[0::2] = tally2._sum.ravel()
|
||||
results2[1::2] = tally2._sum_sq.ravel()
|
||||
|
||||
results3 = np.zeros((tally3._sum.size + tally3._sum.size, ))
|
||||
results3[0::2] = tally3._sum.ravel()
|
||||
results3[1::2] = tally3._sum_sq.ravel()
|
||||
|
||||
results4 = np.zeros((tally4._sum.size + tally4._sum.size, ))
|
||||
results4[0::2] = tally4._sum.ravel()
|
||||
results4[1::2] = tally4._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tally 1:\n'
|
||||
|
|
@ -54,25 +63,25 @@ for item in results4:
|
|||
|
||||
# write out cmfd answers
|
||||
outstr += 'cmfd indices\n'
|
||||
for item in sp.cmfd_indices:
|
||||
for item in sp._cmfd_indices:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
outstr += 'k cmfd\n'
|
||||
for item in sp.k_cmfd:
|
||||
for item in sp._k_cmfd:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
outstr += 'cmfd entropy\n'
|
||||
for item in sp.cmfd_entropy:
|
||||
for item in sp._cmfd_entropy:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
outstr += 'cmfd balance\n'
|
||||
for item in sp.cmfd_balance:
|
||||
for item in sp._cmfd_balance:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
outstr += 'cmfd dominance ratio\n'
|
||||
for item in sp.cmfd_dominance:
|
||||
for item in sp._cmfd_dominance:
|
||||
outstr += "{0:10.3E}\n".format(item)
|
||||
outstr += 'cmfd openmc source comparison\n'
|
||||
for item in sp.cmfd_srccmp:
|
||||
for item in sp._cmfd_srccmp:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
outstr += 'cmfd source\n'
|
||||
cmfdsrc = np.reshape(sp.cmfd_src, np.product(sp.cmfd_indices), order='F')
|
||||
cmfdsrc = np.reshape(sp._cmfd_src, np.product(sp._cmfd_indices), order='F')
|
||||
for item in cmfdsrc:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
|
||||
|
|
|
|||
|
|
@ -11,32 +11,41 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.20.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results1 = sp.tallies[0].results
|
||||
shape1 = results1.shape
|
||||
size1 = (np.product(shape1))
|
||||
results1 = np.reshape(results1, size1)
|
||||
results2 = sp.tallies[1].results
|
||||
shape2 = results2.shape
|
||||
size2 = (np.product(shape2))
|
||||
results2 = np.reshape(results2, size2)
|
||||
results3 = sp.tallies[2].results
|
||||
shape3 = results3.shape
|
||||
size3 = (np.product(shape3))
|
||||
results3 = np.reshape(results3, size3)
|
||||
results4 = sp.tallies[3].results
|
||||
shape4 = results4.shape
|
||||
size4 = (np.product(shape4))
|
||||
results4 = np.reshape(results4, size4)
|
||||
tally1 = sp._tallies[1]
|
||||
results1 = np.zeros((tally1._sum.size + tally1._sum.size, ))
|
||||
results1[0::2] = tally1._sum.ravel()
|
||||
results1[1::2] = tally1._sum_sq.ravel()
|
||||
|
||||
for tally_id in sp._tallies:
|
||||
if 'CMFD flux, total, scatter-1' in sp._tallies[tally_id]._label:
|
||||
tally2 = sp._tallies[tally_id]
|
||||
elif 'CMFD neutron production' in sp._tallies[tally_id]._label:
|
||||
tally3 = sp._tallies[tally_id]
|
||||
elif 'CMFD surface currents' in sp._tallies[tally_id]._label:
|
||||
tally4 = sp._tallies[tally_id]
|
||||
|
||||
results2 = np.zeros((tally2._sum.size + tally2._sum.size, ))
|
||||
results2[0::2] = tally2._sum.ravel()
|
||||
results2[1::2] = tally2._sum_sq.ravel()
|
||||
|
||||
results3 = np.zeros((tally3._sum.size + tally3._sum.size, ))
|
||||
results3[0::2] = tally3._sum.ravel()
|
||||
results3[1::2] = tally3._sum_sq.ravel()
|
||||
|
||||
results4 = np.zeros((tally4._sum.size + tally4._sum.size, ))
|
||||
results4[0::2] = tally4._sum.ravel()
|
||||
results4[1::2] = tally4._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tally 1:\n'
|
||||
|
|
@ -54,25 +63,25 @@ for item in results4:
|
|||
|
||||
# write out cmfd answers
|
||||
outstr += 'cmfd indices\n'
|
||||
for item in sp.cmfd_indices:
|
||||
for item in sp._cmfd_indices:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
outstr += 'k cmfd\n'
|
||||
for item in sp.k_cmfd:
|
||||
for item in sp._k_cmfd:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
outstr += 'cmfd entropy\n'
|
||||
for item in sp.cmfd_entropy:
|
||||
for item in sp._cmfd_entropy:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
outstr += 'cmfd balance\n'
|
||||
for item in sp.cmfd_balance:
|
||||
for item in sp._cmfd_balance:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
outstr += 'cmfd dominance ratio\n'
|
||||
for item in sp.cmfd_dominance:
|
||||
for item in sp._cmfd_dominance:
|
||||
outstr += "{0:10.3E}\n".format(item)
|
||||
outstr += 'cmfd openmc source comparison\n'
|
||||
for item in sp.cmfd_srccmp:
|
||||
for item in sp._cmfd_srccmp:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
outstr += 'cmfd source\n'
|
||||
cmfdsrc = np.reshape(sp.cmfd_src, np.product(sp.cmfd_indices), order='F')
|
||||
cmfdsrc = np.reshape(sp._cmfd_src, np.product(sp._cmfd_indices), order='F')
|
||||
for item in cmfdsrc:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
|
||||
|
|
|
|||
|
|
@ -11,32 +11,41 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.20.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results1 = sp.tallies[0].results
|
||||
shape1 = results1.shape
|
||||
size1 = (np.product(shape1))
|
||||
results1 = np.reshape(results1, size1)
|
||||
results2 = sp.tallies[1].results
|
||||
shape2 = results2.shape
|
||||
size2 = (np.product(shape2))
|
||||
results2 = np.reshape(results2, size2)
|
||||
results3 = sp.tallies[2].results
|
||||
shape3 = results3.shape
|
||||
size3 = (np.product(shape3))
|
||||
results3 = np.reshape(results3, size3)
|
||||
results4 = sp.tallies[3].results
|
||||
shape4 = results4.shape
|
||||
size4 = (np.product(shape4))
|
||||
results4 = np.reshape(results4, size4)
|
||||
tally1 = sp._tallies[1]
|
||||
results1 = np.zeros((tally1._sum.size + tally1._sum.size, ))
|
||||
results1[0::2] = tally1._sum.ravel()
|
||||
results1[1::2] = tally1._sum_sq.ravel()
|
||||
|
||||
for tally_id in sp._tallies:
|
||||
if 'CMFD flux, total, scatter-1' in sp._tallies[tally_id]._label:
|
||||
tally2 = sp._tallies[tally_id]
|
||||
elif 'CMFD neutron production' in sp._tallies[tally_id]._label:
|
||||
tally3 = sp._tallies[tally_id]
|
||||
elif 'CMFD surface currents' in sp._tallies[tally_id]._label:
|
||||
tally4 = sp._tallies[tally_id]
|
||||
|
||||
results2 = np.zeros((tally2._sum.size + tally2._sum.size, ))
|
||||
results2[0::2] = tally2._sum.ravel()
|
||||
results2[1::2] = tally2._sum_sq.ravel()
|
||||
|
||||
results3 = np.zeros((tally3._sum.size + tally3._sum.size, ))
|
||||
results3[0::2] = tally3._sum.ravel()
|
||||
results3[1::2] = tally3._sum_sq.ravel()
|
||||
|
||||
results4 = np.zeros((tally4._sum.size + tally4._sum.size, ))
|
||||
results4[0::2] = tally4._sum.ravel()
|
||||
results4[1::2] = tally4._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tally 1:\n'
|
||||
|
|
@ -54,25 +63,25 @@ for item in results4:
|
|||
|
||||
# write out cmfd answers
|
||||
outstr += 'cmfd indices\n'
|
||||
for item in sp.cmfd_indices:
|
||||
for item in sp._cmfd_indices:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
outstr += 'k cmfd\n'
|
||||
for item in sp.k_cmfd:
|
||||
for item in sp._k_cmfd:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
outstr += 'cmfd entropy\n'
|
||||
for item in sp.cmfd_entropy:
|
||||
for item in sp._cmfd_entropy:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
outstr += 'cmfd balance\n'
|
||||
for item in sp.cmfd_balance:
|
||||
for item in sp._cmfd_balance:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
outstr += 'cmfd dominance ratio\n'
|
||||
for item in sp.cmfd_dominance:
|
||||
for item in sp._cmfd_dominance:
|
||||
outstr += "{0:10.3E}\n".format(item)
|
||||
outstr += 'cmfd openmc source comparison\n'
|
||||
for item in sp.cmfd_srccmp:
|
||||
for item in sp._cmfd_srccmp:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
outstr += 'cmfd source\n'
|
||||
cmfdsrc = np.reshape(sp.cmfd_src, np.product(sp.cmfd_indices), order='F')
|
||||
cmfdsrc = np.reshape(sp._cmfd_src, np.product(sp._cmfd_indices), order='F')
|
||||
for item in cmfdsrc:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
|
||||
|
|
|
|||
|
|
@ -11,20 +11,21 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.zeros((tally._sum.size + tally._sum.size, ))
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.7.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -11,18 +11,19 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'entropy:\n'
|
||||
for item in sp.entropy:
|
||||
for item in sp._entropy:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
|
||||
# write results to file
|
||||
|
|
|
|||
|
|
@ -11,20 +11,21 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.empty((tally._sum.size + tally._sum.size, ), dtype=np.float64)
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -11,20 +11,21 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.empty((tally._sum.size + tally._sum.size, ), dtype=np.float64)
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -11,20 +11,21 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.zeros((tally._sum.size + tally._sum.size, ))
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -14,17 +14,17 @@ else:
|
|||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.zeros((tally._sum.size + tally._sum.size, ))
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -14,17 +14,17 @@ else:
|
|||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.zeros((tally._sum.size + tally._sum.size, ))
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -11,20 +11,21 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.zeros((tally._sum.size + tally._sum.size, ))
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -11,20 +11,21 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.zeros((tally._sum.size + tally._sum.size, ))
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -11,20 +11,21 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.zeros((tally._sum.size + tally._sum.size, ))
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -11,20 +11,21 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.zeros((tally._sum.size + tally._sum.size, ))
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -11,17 +11,18 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.zeros((tally._sum.size + tally._sum.size, ))
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
for item in results:
|
||||
|
|
|
|||
|
|
@ -14,10 +14,10 @@ sp.read_results()
|
|||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
import sys
|
||||
|
||||
# import particle restart
|
||||
sys.path.append('../../src/utils')
|
||||
# import particle restart
|
||||
sys.path.insert(0, '../../src/utils')
|
||||
import particle_restart as pr
|
||||
|
||||
# read in particle restart file
|
||||
|
|
@ -14,8 +14,8 @@ else:
|
|||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
# write out properties
|
||||
|
||||
# write out properties
|
||||
outstr += 'current batch:\n'
|
||||
outstr += "{0:12.6E}\n".format(p.current_batch)
|
||||
outstr += 'current gen:\n'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
import sys
|
||||
|
||||
# import particle restart
|
||||
sys.path.append('../../src/utils')
|
||||
sys.path.insert(0, '../../src/utils')
|
||||
import particle_restart as pr
|
||||
|
||||
# read in particle restart file
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
import sys
|
||||
|
||||
# import statepoint
|
||||
from openmc.statepoint import StatePoint
|
||||
import openmc.statepoint as statepoint
|
||||
|
||||
# read in statepoint file
|
||||
if len(sys.argv) > 1:
|
||||
sp = StatePoint(sys.argv[1])
|
||||
sp = statepoint.StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
sp = statepoint.StatePoint('statepoint.10.binary')
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
|
|
@ -17,7 +17,7 @@ outstr = ''
|
|||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -3,21 +3,21 @@
|
|||
import sys
|
||||
|
||||
# import statepoint
|
||||
from openmc.statepoint import StatePoint
|
||||
import openmc.statepoint as statepoint
|
||||
|
||||
# read in statepoint file
|
||||
if len(sys.argv) > 1:
|
||||
sp = StatePoint(sys.argv[1])
|
||||
sp = statepoint.StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
sp = statepoint.StatePoint('statepoint.10.binary')
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -3,21 +3,21 @@
|
|||
import sys
|
||||
|
||||
# import statepoint
|
||||
from openmc.statepoint import StatePoint
|
||||
import openmc.statepoint as statepoint
|
||||
|
||||
# read in statepoint file
|
||||
if len(sys.argv) > 1:
|
||||
sp = StatePoint(sys.argv[1])
|
||||
sp = statepoint.StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
sp = statepoint.StatePoint('statepoint.10.binary')
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ outstr = ''
|
|||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -3,21 +3,21 @@
|
|||
import sys
|
||||
|
||||
# import statepoint
|
||||
from openmc.statepoint import StatePoint
|
||||
import openmc.statepoint as statepoint
|
||||
|
||||
# read in statepoint file
|
||||
if len(sys.argv) > 1:
|
||||
sp = StatePoint(sys.argv[1])
|
||||
sp = statepoint.StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
sp = statepoint.StatePoint('statepoint.10.binary')
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -3,21 +3,21 @@
|
|||
import sys
|
||||
|
||||
# import statepoint
|
||||
from openmc.statepoint import StatePoint
|
||||
import openmc.statepoint as statepoint
|
||||
|
||||
# read in statepoint file
|
||||
if len(sys.argv) > 1:
|
||||
sp = StatePoint(sys.argv[1])
|
||||
sp = statepoint.StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
sp = statepoint.StatePoint('statepoint.10.binary')
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -11,20 +11,21 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.zeros((tally._sum.size + tally._sum.size, ))
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
|
|
@ -11,24 +12,26 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results1 = sp.tallies[0].results
|
||||
shape1 = results1.shape
|
||||
size1 = (np.product(shape1))
|
||||
results1 = np.reshape(results1, size1)
|
||||
results2 = sp.tallies[1].results
|
||||
shape2 = results2.shape
|
||||
size2 = (np.product(shape2))
|
||||
results2 = np.reshape(results2, size2)
|
||||
tally1 = sp._tallies[1]
|
||||
results1 = np.zeros((tally1._sum.size + tally1._sum.size, ))
|
||||
results1[0::2] = tally1._sum.ravel()
|
||||
results1[1::2] = tally1._sum_sq.ravel()
|
||||
|
||||
tally2 = sp._tallies[2]
|
||||
results2 = np.zeros((tally2._sum.size + tally2._sum.size, ))
|
||||
results2[0::2] = tally2._sum.ravel()
|
||||
results2[1::2] = tally2._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tally 1:\n'
|
||||
|
|
|
|||
|
|
@ -11,24 +11,26 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results1 = sp.tallies[0].results
|
||||
shape1 = results1.shape
|
||||
size1 = (np.product(shape1))
|
||||
results1 = np.reshape(results1, size1)
|
||||
results2 = sp.tallies[1].results
|
||||
shape2 = results2.shape
|
||||
size2 = (np.product(shape2))
|
||||
results2 = np.reshape(results2, size2)
|
||||
tally1 = sp._tallies[1]
|
||||
results1 = np.zeros((tally1._sum.size + tally1._sum.size, ))
|
||||
results1[0::2] = tally1._sum.ravel()
|
||||
results1[1::2] = tally1._sum_sq.ravel()
|
||||
|
||||
tally2 = sp._tallies[2]
|
||||
results2 = np.zeros((tally2._sum.size + tally2._sum.size, ))
|
||||
results2[0::2] = tally2._sum.ravel()
|
||||
results2[1::2] = tally2._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tally 1:\n'
|
||||
|
|
|
|||
|
|
@ -11,24 +11,26 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results1 = sp.tallies[0].results
|
||||
shape1 = results1.shape
|
||||
size1 = (np.product(shape1))
|
||||
results1 = np.reshape(results1, size1)
|
||||
results2 = sp.tallies[1].results
|
||||
shape2 = results2.shape
|
||||
size2 = (np.product(shape2))
|
||||
results2 = np.reshape(results2, size2)
|
||||
tally1 = sp._tallies[1]
|
||||
results1 = np.zeros((tally1._sum.size + tally1._sum.size, ))
|
||||
results1[0::2] = tally1._sum.ravel()
|
||||
results1[1::2] = tally1._sum_sq.ravel()
|
||||
|
||||
tally2 = sp._tallies[2]
|
||||
results2 = np.zeros((tally2._sum.size + tally2._sum.size, ))
|
||||
results2[0::2] = tally2._sum.ravel()
|
||||
results2[1::2] = tally2._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tally 1:\n'
|
||||
|
|
|
|||
|
|
@ -11,24 +11,26 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results1 = sp.tallies[0].results
|
||||
shape1 = results1.shape
|
||||
size1 = (np.product(shape1))
|
||||
results1 = np.reshape(results1, size1)
|
||||
results2 = sp.tallies[1].results
|
||||
shape2 = results2.shape
|
||||
size2 = (np.product(shape2))
|
||||
results2 = np.reshape(results2, size2)
|
||||
tally1 = sp._tallies[1]
|
||||
results1 = np.zeros((tally1._sum.size + tally1._sum.size, ))
|
||||
results1[0::2] = tally1._sum.ravel()
|
||||
results1[1::2] = tally1._sum_sq.ravel()
|
||||
|
||||
tally2 = sp._tallies[2]
|
||||
results2 = np.zeros((tally2._sum.size + tally2._sum.size, ))
|
||||
results2[0::2] = tally2._sum.ravel()
|
||||
results2[1::2] = tally2._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tally 1:\n'
|
||||
|
|
|
|||
|
|
@ -11,20 +11,21 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.zeros((tally._sum.size + tally._sum.size, ))
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -11,24 +11,26 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results1 = sp.tallies[0].results
|
||||
shape1 = results1.shape
|
||||
size1 = (np.product(shape1))
|
||||
results1 = np.reshape(results1, size1)
|
||||
results2 = sp.tallies[1].results
|
||||
shape2 = results2.shape
|
||||
size2 = (np.product(shape2))
|
||||
results2 = np.reshape(results2, size2)
|
||||
tally1 = sp._tallies[1]
|
||||
results1 = np.zeros((tally1._sum.size + tally1._sum.size, ))
|
||||
results1[0::2] = tally1._sum.ravel()
|
||||
results1[1::2] = tally1._sum_sq.ravel()
|
||||
|
||||
tally2 = sp._tallies[2]
|
||||
results2 = np.zeros((tally2._sum.size + tally2._sum.size, ))
|
||||
results2[0::2] = tally2._sum.ravel()
|
||||
results2[1::2] = tally2._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tally 1:\n'
|
||||
|
|
|
|||
|
|
@ -11,20 +11,21 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.zeros((tally._sum.size + tally._sum.size, ))
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -11,20 +11,21 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.zeros((tally._sum.size + tally._sum.size, ))
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -11,20 +11,21 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.zeros((tally._sum.size + tally._sum.size, ))
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -11,20 +11,21 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.zeros((tally._sum.size + tally._sum.size, ))
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -11,24 +11,26 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results1 = sp.tallies[0].results
|
||||
shape1 = results1.shape
|
||||
size1 = (np.product(shape1))
|
||||
results1 = np.reshape(results1, size1)
|
||||
results2 = sp.tallies[1].results
|
||||
shape2 = results2.shape
|
||||
size2 = (np.product(shape2))
|
||||
results2 = np.reshape(results2, size2)
|
||||
tally1 = sp._tallies[1]
|
||||
results1 = np.zeros((tally1._sum.size + tally1._sum.size, ))
|
||||
results1[0::2] = tally1._sum.ravel()
|
||||
results1[1::2] = tally1._sum_sq.ravel()
|
||||
|
||||
tally2 = sp._tallies[2]
|
||||
results2 = np.zeros((tally2._sum.size + tally2._sum.size, ))
|
||||
results2[0::2] = tally2._sum.ravel()
|
||||
results2[1::2] = tally2._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tally 1:\n'
|
||||
|
|
|
|||
|
|
@ -11,24 +11,26 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results1 = sp.tallies[0].results
|
||||
shape1 = results1.shape
|
||||
size1 = (np.product(shape1))
|
||||
results1 = np.reshape(results1, size1)
|
||||
results2 = sp.tallies[1].results
|
||||
shape2 = results2.shape
|
||||
size2 = (np.product(shape2))
|
||||
results2 = np.reshape(results2, size2)
|
||||
tally1 = sp._tallies[1]
|
||||
results1 = np.zeros((tally1._sum.size + tally1._sum.size, ))
|
||||
results1[0::2] = tally1._sum.ravel()
|
||||
results1[1::2] = tally1._sum_sq.ravel()
|
||||
|
||||
tally2 = sp._tallies[2]
|
||||
results2 = np.zeros((tally2._sum.size + tally2._sum.size, ))
|
||||
results2[0::2] = tally2._sum.ravel()
|
||||
results2[1::2] = tally2._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tally 1:\n'
|
||||
|
|
|
|||
|
|
@ -11,20 +11,21 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.zeros((tally._sum.size + tally._sum.size, ))
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -11,20 +11,21 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.zeros((tally._sum.size + tally._sum.size, ))
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -11,24 +11,26 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results1 = sp.tallies[0].results
|
||||
shape1 = results1.shape
|
||||
size1 = (np.product(shape1))
|
||||
results1 = np.reshape(results1, size1)
|
||||
results2 = sp.tallies[1].results
|
||||
shape2 = results2.shape
|
||||
size2 = (np.product(shape2))
|
||||
results2 = np.reshape(results2, size2)
|
||||
tally1 = sp._tallies[1]
|
||||
results1 = np.zeros((tally1._sum.size + tally1._sum.size, ))
|
||||
results1[0::2] = tally1._sum.ravel()
|
||||
results1[1::2] = tally1._sum_sq.ravel()
|
||||
|
||||
tally2 = sp._tallies[2]
|
||||
results2 = np.zeros((tally2._sum.size + tally2._sum.size, ))
|
||||
results2[0::2] = tally2._sum.ravel()
|
||||
results2[1::2] = tally2._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tally 1:\n'
|
||||
|
|
|
|||
|
|
@ -11,24 +11,26 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results1 = sp.tallies[0].results
|
||||
shape1 = results1.shape
|
||||
size1 = (np.product(shape1))
|
||||
results1 = np.reshape(results1, size1)
|
||||
results2 = sp.tallies[1].results
|
||||
shape2 = results2.shape
|
||||
size2 = (np.product(shape2))
|
||||
results2 = np.reshape(results2, size2)
|
||||
tally1 = sp._tallies[1]
|
||||
results1 = np.zeros((tally1._sum.size + tally1._sum.size, ))
|
||||
results1[0::2] = tally1._sum.ravel()
|
||||
results1[1::2] = tally1._sum_sq.ravel()
|
||||
|
||||
tally2 = sp._tallies[2]
|
||||
results2 = np.zeros((tally2._sum.size + tally2._sum.size, ))
|
||||
results2[0::2] = tally2._sum.ravel()
|
||||
results2[1::2] = tally2._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tally 1:\n'
|
||||
|
|
|
|||
|
|
@ -14,17 +14,17 @@ else:
|
|||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results = sp.tallies[0].results
|
||||
shape = results.shape
|
||||
size = (np.product(shape))
|
||||
results = np.reshape(results, size)
|
||||
tally = sp._tallies[1]
|
||||
results = np.empty((tally._sum.size + tally._sum.size, ), dtype=np.float64)
|
||||
results[0::2] = tally._sum.ravel()
|
||||
results[1::2] = tally._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -14,21 +14,22 @@ else:
|
|||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results1 = sp.tallies[0].results
|
||||
shape1 = results1.shape
|
||||
size1 = (np.product(shape1))
|
||||
results1 = np.reshape(results1, size1)
|
||||
results2 = sp.tallies[1].results
|
||||
shape2 = results2.shape
|
||||
size2 = (np.product(shape2))
|
||||
results2 = np.reshape(results2, size2)
|
||||
tally1 = sp._tallies[1]
|
||||
results1 = np.empty((tally1._sum.size + tally1._sum.size, ), dtype=np.float64)
|
||||
results1[0::2] = tally1._sum.ravel()
|
||||
results1[1::2] = tally1._sum_sq.ravel()
|
||||
|
||||
tally2 = sp._tallies[2]
|
||||
results2 = np.empty((tally2._sum.size + tally2._sum.size, ), dtype=np.float64)
|
||||
results2[0::2] = tally2._sum.ravel()
|
||||
results2[1::2] = tally2._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tally 1:\n'
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,18 +10,19 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.08.binary')
|
||||
|
||||
sp.read_results()
|
||||
sp.read_source()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out xyz
|
||||
xyz = sp.source[0].xyz
|
||||
xyz = sp._source[0]._xyz
|
||||
for i in xyz:
|
||||
outstr += "{0:12.6E} ".format(i)
|
||||
outstr += "\n"
|
||||
|
|
|
|||
|
|
@ -10,18 +10,19 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.08.binary')
|
||||
|
||||
sp.read_results()
|
||||
sp.read_source()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out xyz
|
||||
xyz = sp.source[0].xyz
|
||||
xyz = sp._source[0]._xyz
|
||||
for i in xyz:
|
||||
outstr += "{0:12.6E} ".format(i)
|
||||
outstr += "\n"
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -11,31 +11,33 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results1 = sp.tallies[0].results
|
||||
shape1 = results1.shape
|
||||
size1 = (np.product(shape1))
|
||||
results1 = np.reshape(results1, size1)
|
||||
results2 = sp.tallies[1].results
|
||||
shape2 = results2.shape
|
||||
size2 = (np.product(shape2))
|
||||
results2 = np.reshape(results2, size2)
|
||||
tally10 = sp._tallies[10]
|
||||
results10 = np.zeros((tally10._sum.size + tally10._sum.size, ))
|
||||
results10[0::2] = tally10._sum.ravel()
|
||||
results10[1::2] = tally10._sum_sq.ravel()
|
||||
|
||||
tally5 = sp._tallies[5]
|
||||
results5 = np.zeros((tally5._sum.size + tally5._sum.size, ))
|
||||
results5[0::2] = tally5._sum.ravel()
|
||||
results5[1::2] = tally5._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tally 1:\n'
|
||||
for item in results1:
|
||||
for item in results10:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
outstr += 'tally 2:\n'
|
||||
for item in results2:
|
||||
for item in results5:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
|
||||
# write results to file
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.09.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -11,31 +11,33 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.07.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results1 = sp.tallies[0].results
|
||||
shape1 = results1.shape
|
||||
size1 = (np.product(shape1))
|
||||
results1 = np.reshape(results1, size1)
|
||||
results2 = sp.tallies[1].results
|
||||
shape2 = results2.shape
|
||||
size2 = (np.product(shape2))
|
||||
results2 = np.reshape(results2, size2)
|
||||
tally5 = sp._tallies[5]
|
||||
results5 = np.zeros((tally5._sum.size + tally5._sum.size, ))
|
||||
results5[0::2] = tally5._sum.ravel()
|
||||
results5[1::2] = tally5._sum_sq.ravel()
|
||||
|
||||
tally10 = sp._tallies[10]
|
||||
results10 = np.zeros((tally10._sum.size + tally10._sum.size, ))
|
||||
results10[0::2] = tally10._sum.ravel()
|
||||
results10[1::2] = tally10._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tally 1:\n'
|
||||
for item in results1:
|
||||
for item in results10:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
outstr += 'tally 2:\n'
|
||||
for item in results2:
|
||||
for item in results5:
|
||||
outstr += "{0:12.6E}\n".format(item)
|
||||
|
||||
# write results to file
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<settings>
|
||||
|
||||
<state_point batches="7" />
|
||||
<state_point batches="7 10" />
|
||||
|
||||
<eigenvalue>
|
||||
<batches>10</batches>
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -11,28 +11,31 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results1 = sp.tallies[0].results
|
||||
shape1 = results1.shape
|
||||
size1 = (np.product(shape1))
|
||||
results1 = np.reshape(results1, size1)
|
||||
results2 = sp.tallies[1].results
|
||||
shape2 = results2.shape
|
||||
size2 = (np.product(shape2))
|
||||
results2 = np.reshape(results2, size2)
|
||||
results3 = sp.tallies[2].results
|
||||
shape3 = results3.shape
|
||||
size3 = (np.product(shape3))
|
||||
results3 = np.reshape(results3, size3)
|
||||
tally1 = sp._tallies[1]
|
||||
results1 = np.zeros((tally1._sum.size + tally1._sum.size, ))
|
||||
results1[0::2] = tally1._sum.ravel()
|
||||
results1[1::2] = tally1._sum_sq.ravel()
|
||||
|
||||
tally2 = sp._tallies[2]
|
||||
results2 = np.zeros((tally2._sum.size + tally2._sum.size, ))
|
||||
results2[0::2] = tally2._sum.ravel()
|
||||
results2[1::2] = tally2._sum_sq.ravel()
|
||||
|
||||
tally3 = sp._tallies[3]
|
||||
results3 = np.zeros((tally3._sum.size + tally3._sum.size, ))
|
||||
results3[0::2] = tally3._sum.ravel()
|
||||
results3[1::2] = tally3._sum_sq.ravel()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tally 1:\n'
|
||||
|
|
|
|||
|
|
@ -11,19 +11,28 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# extract tally results and convert to vector
|
||||
results0 = sp.tallies[0].results
|
||||
results1 = sp.tallies[1].results
|
||||
results = np.concatenate((results0.flatten(), results1.flatten()))
|
||||
tally1 = sp._tallies[1]
|
||||
results1 = np.zeros((tally1._sum.size + tally1._sum.size, ))
|
||||
results1[0::2] = tally1._sum.ravel()
|
||||
results1[1::2] = tally1._sum_sq.ravel()
|
||||
|
||||
tally2 = sp._tallies[2]
|
||||
results2 = np.zeros((tally2._sum.size + tally2._sum.size, ))
|
||||
results2[0::2] = tally2._sum.ravel()
|
||||
results2[1::2] = tally2._sum_sq.ravel()
|
||||
|
||||
results = np.concatenate((results1.flatten(), results2.flatten()))
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write out tally results
|
||||
outstr += 'tallies:\n'
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
|
|
@ -10,14 +10,15 @@ if len(sys.argv) > 1:
|
|||
sp = StatePoint(sys.argv[1])
|
||||
else:
|
||||
sp = StatePoint('statepoint.10.binary')
|
||||
|
||||
sp.read_results()
|
||||
|
||||
# set up output string
|
||||
outstr = ''
|
||||
|
||||
|
||||
# write out k-combined
|
||||
outstr += 'k-combined:\n'
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp.k_combined[0], sp.k_combined[1])
|
||||
outstr += "{0:12.6E} {1:12.6E}\n".format(sp._k_combined[0], sp._k_combined[1])
|
||||
|
||||
# write results to file
|
||||
with open('results_test.dat','w') as fh:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue