Merge pull request #867 from paulromano/mesh1d-bugfix

Make sure get_pandas_dataframe() works with 1D mesh filter
This commit is contained in:
Will Boyd 2017-04-26 11:12:30 -04:00 committed by GitHub
commit 762c99b009
3 changed files with 15 additions and 7 deletions

View file

@ -777,9 +777,12 @@ class MeshFilter(Filter):
# Find mesh dimensions - use 3D indices for simplicity
if len(self.mesh.dimension) == 3:
nx, ny, nz = self.mesh.dimension
else:
elif len(self.mesh.dimension) == 2:
nx, ny = self.mesh.dimension
nz = 1
else:
nx = self.mesh.dimension
ny = nz = 1
# Generate multi-index sub-column for x-axis
filter_bins = np.arange(1, nx + 1)

View file

@ -224,11 +224,12 @@ module nuclide_header
call sort(temps_available)
! If only one temperature is available, revert to nearest temperature
if (size(temps_available) == 1 .and. &
method == TEMPERATURE_INTERPOLATION .and. master) then
call warning("Cross sections for " // trim(this % name) // " are only &
&available at one temperature. Reverting to nearest temperature &
&method.")
if (size(temps_available) == 1 .and. method == TEMPERATURE_INTERPOLATION) then
if (master) then
call warning("Cross sections for " // trim(this % name) // " are only &
&available at one temperature. Reverting to nearest temperature &
&method.")
end if
method = TEMPERATURE_NEAREST
end if

View file

@ -481,7 +481,11 @@ contains
! Sample scattering angle
select type (dist => rxn % products(1) % distribution(1) % obj)
type is (UncorrelatedAngleEnergy)
mu_cm = dist % angle % sample(E)
if (allocated(dist % angle % energy)) then
mu_cm = dist % angle % sample(E)
else
mu_cm = TWO*prn() - ONE
end if
end select
! Determine direction cosines in CM