From aa24f27d4d514893c028dfaef319e08b445675fe Mon Sep 17 00:00:00 2001 From: "Labossiere-Hickman, Travis James" Date: Thu, 16 Jul 2026 15:47:49 -0600 Subject: [PATCH] Remove mesh labeling from MeshSurfaceFilter --- include/openmc/tallies/filter_meshsurface.h | 15 ------- src/tallies/filter_meshsurface.cpp | 48 +++------------------ 2 files changed, 5 insertions(+), 58 deletions(-) diff --git a/include/openmc/tallies/filter_meshsurface.h b/include/openmc/tallies/filter_meshsurface.h index 195995c69..fc6915200 100644 --- a/include/openmc/tallies/filter_meshsurface.h +++ b/include/openmc/tallies/filter_meshsurface.h @@ -22,21 +22,6 @@ public: // Accessors void set_mesh(int32_t mesh) override; - - enum class MeshDir { - OUT_LEFT, // x min - IN_LEFT, // x min - OUT_RIGHT, // x max - IN_RIGHT, // x max - OUT_BACK, // y min - IN_BACK, // y min - OUT_FRONT, // y max - IN_FRONT, // y max - OUT_BOTTOM, // z min - IN_BOTTOM, // z min - OUT_TOP, // z max - IN_TOP // z max - }; }; } // namespace openmc diff --git a/src/tallies/filter_meshsurface.cpp b/src/tallies/filter_meshsurface.cpp index b26cd198b..46626977b 100644 --- a/src/tallies/filter_meshsurface.cpp +++ b/src/tallies/filter_meshsurface.cpp @@ -28,52 +28,14 @@ std::string MeshSurfaceFilter::text_label(int bin) const auto& mesh = *model::meshes[mesh_]; int n_dim = mesh.n_dimension_; - // Get flattend mesh index and surface index. + // Get flattened mesh index and surface index. int i_mesh = bin / (4 * n_dim); - MeshDir surf_dir = static_cast(bin % (4 * n_dim)); + int surf_index = bin % (4 * n_dim); - // Get mesh index part of label. + // Get mesh index part of label, then append the surface part. + // The surface is labeled by the underlying mesh. std::string out = MeshFilter::text_label(i_mesh); - - // Get surface part of label. - switch (surf_dir) { - case MeshDir::OUT_LEFT: - out += " Outgoing, x-min"; - break; - case MeshDir::IN_LEFT: - out += " Incoming, x-min"; - break; - case MeshDir::OUT_RIGHT: - out += " Outgoing, x-max"; - break; - case MeshDir::IN_RIGHT: - out += " Incoming, x-max"; - break; - case MeshDir::OUT_BACK: - out += " Outgoing, y-min"; - break; - case MeshDir::IN_BACK: - out += " Incoming, y-min"; - break; - case MeshDir::OUT_FRONT: - out += " Outgoing, y-max"; - break; - case MeshDir::IN_FRONT: - out += " Incoming, y-max"; - break; - case MeshDir::OUT_BOTTOM: - out += " Outgoing, z-min"; - break; - case MeshDir::IN_BOTTOM: - out += " Incoming, z-min"; - break; - case MeshDir::OUT_TOP: - out += " Outgoing, z-max"; - break; - case MeshDir::IN_TOP: - out += " Incoming, z-max"; - break; - } + out += mesh.surface_bin_label(surf_index); return out; }