mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
Apply suggestions from code review
Co-authored-by: Patrick Shriwise <pshriwise@gmail.com>
This commit is contained in:
parent
c5affa805e
commit
6d787d5fb0
3 changed files with 4 additions and 7 deletions
|
|
@ -1322,7 +1322,7 @@ class CylindricalMesh(StructuredMesh):
|
|||
pts_cartesian[:, 1] = r * np.sin(phi)
|
||||
|
||||
# offset with origin
|
||||
if self.origin != [0.0, 0.0, 0.0]:
|
||||
if any(self.origin != (0.0, 0.0, 0.0)):
|
||||
pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.origin[0]
|
||||
pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.origin[1]
|
||||
pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.origin[2]
|
||||
|
|
@ -1375,7 +1375,7 @@ class SphericalMesh(StructuredMesh):
|
|||
self._r_grid = None
|
||||
self._theta_grid = [0, pi]
|
||||
self._phi_grid = [0, 2*pi]
|
||||
self._origin = [0., 0., 0.]
|
||||
self._origin = (0., 0., 0.)
|
||||
|
||||
@property
|
||||
def dimension(self):
|
||||
|
|
@ -1577,7 +1577,7 @@ class SphericalMesh(StructuredMesh):
|
|||
pts_cartesian[:, 2] = r * np.cos(phi)
|
||||
|
||||
# offset with origin
|
||||
if self.origin != [0.0, 0.0, 0.0]:
|
||||
if any(self.origin != (0.0, 0.0, 0.0)):
|
||||
pts_cartesian[:, 0] = pts_cartesian[:, 0] + self.origin[0]
|
||||
pts_cartesian[:, 1] = pts_cartesian[:, 1] + self.origin[1]
|
||||
pts_cartesian[:, 2] = pts_cartesian[:, 2] + self.origin[2]
|
||||
|
|
|
|||
|
|
@ -1213,9 +1213,7 @@ StructuredMesh::MeshIndex SphericalMesh::get_indices(
|
|||
|
||||
mapped_r[0] = r.norm();
|
||||
|
||||
mapped_r[0] += origin_[0];
|
||||
mapped_r[1] += origin_[1];
|
||||
mapped_r[2] += origin_[2];
|
||||
mapped_r -= origin_;
|
||||
|
||||
if (mapped_r[0] < FP_PRECISION) {
|
||||
mapped_r[1] = 0.0;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ def test_activation(run_in_tmpdir, model, reaction_rate_mode, reaction_rate_opts
|
|||
# Determine (n.gamma) reaction rate using initial run
|
||||
sp = model.run()
|
||||
with openmc.StatePoint(sp) as sp:
|
||||
print(sp.tallies)
|
||||
tally = sp.get_tally(name='activation tally')
|
||||
capture_rate = tally.mean.flat[0]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue