mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 04:55:40 -04:00
No need to call int(floor(...)) in Python 3
This commit is contained in:
parent
cba083103c
commit
59861c9507
2 changed files with 7 additions and 7 deletions
|
|
@ -604,12 +604,12 @@ class RectLattice(Lattice):
|
|||
element coordinate system
|
||||
|
||||
"""
|
||||
ix = int(floor((point[0] - self.lower_left[0])/self.pitch[0]))
|
||||
iy = int(floor((point[1] - self.lower_left[1])/self.pitch[1]))
|
||||
ix = floor((point[0] - self.lower_left[0])/self.pitch[0])
|
||||
iy = floor((point[1] - self.lower_left[1])/self.pitch[1])
|
||||
if self.ndim == 2:
|
||||
idx = (ix, iy)
|
||||
else:
|
||||
iz = int(floor((point[2] - self.lower_left[2])/self.pitch[2]))
|
||||
iz = floor((point[2] - self.lower_left[2])/self.pitch[2])
|
||||
idx = (ix, iy, iz)
|
||||
return idx, self.get_local_coordinates(point, idx)
|
||||
|
||||
|
|
@ -1016,10 +1016,10 @@ class HexLattice(Lattice):
|
|||
iz = 1
|
||||
else:
|
||||
z = point[2] - self.center[2]
|
||||
iz = int(floor(z/self.pitch[1] + 0.5*self.num_axial))
|
||||
iz = floor(z/self.pitch[1] + 0.5*self.num_axial)
|
||||
alpha = y - x/sqrt(3.)
|
||||
ix = int(floor(x/(sqrt(0.75) * self.pitch[0])))
|
||||
ia = int(floor(alpha/self.pitch[0]))
|
||||
ix = floor(x/(sqrt(0.75) * self.pitch[0]))
|
||||
ia = floor(alpha/self.pitch[0])
|
||||
|
||||
# Check four lattice elements to see which one is closest based on local
|
||||
# coordinates
|
||||
|
|
|
|||
|
|
@ -736,7 +736,7 @@ def _close_random_pack(domain, particles, contraction_rate):
|
|||
outer_pf = (4/3 * pi * (outer_diameter[0]/2)**3 * n_particles /
|
||||
domain.volume)
|
||||
|
||||
j = int(floor(-log10(outer_pf - inner_pf)))
|
||||
j = floor(-log10(outer_pf - inner_pf))
|
||||
outer_diameter[0] = (outer_diameter[0] - 0.5**j * contraction_rate *
|
||||
initial_outer_diameter / n_particles)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue