Revised minor bugs found relating to polar/azi filters AND added support to openmc.mgxs for applying polar and azimuthal filters!

This commit is contained in:
Adam Nelson 2017-01-08 20:37:38 -05:00
parent 5afd4c369f
commit 39d9c25ae7
4 changed files with 812 additions and 212 deletions

View file

@ -1192,7 +1192,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
"version": "3.6.0"
}
},
"nbformat": 4,

View file

@ -1453,7 +1453,7 @@ class PolarFilter(RealFilter):
msg = 'Unable to add bin edge "{0}" to a "{1}" ' \
'since it is less than 0'.format(edge, type(self))
raise ValueError(msg)
elif edge > np.pi:
elif not np.isclose(edge, np.pi) and edge > np.pi:
msg = 'Unable to add bin edge "{0}" to a "{1}" ' \
'since it is greater than pi'.format(edge, type(self))
raise ValueError(msg)
@ -1552,11 +1552,11 @@ class AzimuthalFilter(RealFilter):
'since it is a non-integer or floating point ' \
'value'.format(edge, type(self))
raise ValueError(msg)
elif edge < -np.pi:
elif not np.isclose(edge, -np.pi) and edge < -np.pi:
msg = 'Unable to add bin edge "{0}" to a "{1}" ' \
'since it is less than -pi'.format(edge, type(self))
raise ValueError(msg)
elif edge > np.pi:
elif not np.isclose(edge, np.pi) and edge > np.pi:
msg = 'Unable to add bin edge "{0}" to a "{1}" ' \
'since it is greater than pi'.format(edge, type(self))
raise ValueError(msg)

File diff suppressed because it is too large Load diff

View file

@ -3228,7 +3228,7 @@ contains
end do
filt % bins(Nangle + 1) = PI
else
call fatal_error("Number of bins for mu filter must be&
call fatal_error("Number of bins for polar filter must be&
& greater than 1 on tally " &
// trim(to_str(t % id)) // ".")
end if
@ -3262,7 +3262,7 @@ contains
end do
filt % bins(Nangle + 1) = PI
else
call fatal_error("Number of bins for mu filter must be&
call fatal_error("Number of bins for azimuthal filter must be&
& greater than 1 on tally " &
// trim(to_str(t % id)) // ".")
end if