From 41a7f5453edd76643bc0dcbe13b6d7f60667ab7d Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Tue, 27 Apr 2021 09:06:46 -0500 Subject: [PATCH] Apply suggestions from @paulromano Co-authored-by: Paul Romano --- openmc/filter.py | 2 +- src/tallies/filter_mesh.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openmc/filter.py b/openmc/filter.py index 403c74313..94522891b 100644 --- a/openmc/filter.py +++ b/openmc/filter.py @@ -730,7 +730,7 @@ class MeshFilter(Filter): def __init__(self, mesh, filter_id=None, translation=None): self.mesh = mesh self.id = filter_id - self._translation = translation + self.translation = translation def __hash__(self): string = type(self).__name__ + '\n' diff --git a/src/tallies/filter_mesh.cpp b/src/tallies/filter_mesh.cpp index 4b63be3c9..ca513a07f 100644 --- a/src/tallies/filter_mesh.cpp +++ b/src/tallies/filter_mesh.cpp @@ -173,7 +173,7 @@ openmc_mesh_filter_get_translation(int32_t index, double translation[3]) } // Get translation from the mesh filter and set value - auto mesh_filter = static_cast(filter.get()); + auto mesh_filter = dynamic_cast(filter.get()); const auto& t = mesh_filter->translation(); for (int i = 0; i < 3; i++) { translation[i] = t[i]; } @@ -202,4 +202,4 @@ openmc_mesh_filter_set_translation(int32_t index, double translation[3]) return 0; } -} // namespace openmc \ No newline at end of file +} // namespace openmc