From 754f6fa44ab7c1bbb55cdaacc54aff642f1446f5 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 8 Nov 2024 15:18:15 -0600 Subject: [PATCH] Reset values of lattice offset tables when allocated (#3188) --- include/openmc/lattice.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/openmc/lattice.h b/include/openmc/lattice.h index 429d81ddda..fb374ab75c 100644 --- a/include/openmc/lattice.h +++ b/include/openmc/lattice.h @@ -71,7 +71,8 @@ public: //! Allocate offset table for distribcell. void allocate_offset_table(int n_maps) { - offsets_.resize(n_maps * universes_.size(), C_NONE); + offsets_.resize(n_maps * universes_.size()); + std::fill(offsets_.begin(), offsets_.end(), C_NONE); } //! Populate the distribcell offset tables.