mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Reverse shape for openmc_tally_results (makes sense for C/C++)
This commit is contained in:
parent
ab41674527
commit
6b6dbb73c5
2 changed files with 8 additions and 3 deletions
|
|
@ -298,7 +298,7 @@ class Tally(_FortranObjectWithID):
|
|||
data = POINTER(c_double)()
|
||||
shape = (c_int*3)()
|
||||
_dll.openmc_tally_results(self._index, data, shape)
|
||||
return as_array(data, tuple(shape[::-1]))
|
||||
return as_array(data, tuple(shape))
|
||||
|
||||
@property
|
||||
def scores(self):
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ module tally_header
|
|||
|
||||
! Normalization for statistics
|
||||
integer(C_INT32_T), public, bind(C) :: n_realizations = 0 ! # of independent realizations
|
||||
real(8), public :: total_weight ! total starting particle weight in realization
|
||||
real(C_DOUBLE), public, bind(C) :: total_weight ! total starting particle weight in realization
|
||||
|
||||
contains
|
||||
|
||||
|
|
@ -688,7 +688,12 @@ contains
|
|||
associate (t => tallies(index) % obj)
|
||||
if (allocated(t % results)) then
|
||||
ptr = C_LOC(t % results(1,1,1))
|
||||
shape_(:) = shape(t % results)
|
||||
|
||||
! Note that shape is reversed since it is assumed to be used from
|
||||
! C/C++ code
|
||||
shape_(1) = size(t % results, 3)
|
||||
shape_(2) = size(t % results, 2)
|
||||
shape_(3) = size(t % results, 1)
|
||||
err = 0
|
||||
else
|
||||
err = E_ALLOCATE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue