diff --git a/include/openmc/settings.h b/include/openmc/settings.h index cc3887f8f..2185a95c2 100644 --- a/include/openmc/settings.h +++ b/include/openmc/settings.h @@ -105,6 +105,7 @@ extern int trigger_batch_interval; //!< Batch interval for triggers extern "C" int verbosity; //!< How verbose to make output extern double weight_cutoff; //!< Weight cutoff for Russian roulette extern double weight_survive; //!< Survival weight after Russian roulette +extern std::unordered_set distribcells; //!< Manually set distribcells } // namespace settings //============================================================================== diff --git a/src/geometry_aux.cpp b/src/geometry_aux.cpp index 9d3062901..a4252b746 100644 --- a/src/geometry_aux.cpp +++ b/src/geometry_aux.cpp @@ -315,8 +315,10 @@ prepare_distribcell() { write_message("Preparing distributed cell instances...", 5); + // start with any cells manually specified via the C++ API + std::unordered_set distribcells = settings::distribcells; + // Find all cells listed in a DistribcellFilter or CellInstanceFilter - std::unordered_set distribcells; for (auto& filt : model::tally_filters) { auto* distrib_filt = dynamic_cast(filt.get()); auto* cell_inst_filt = dynamic_cast(filt.get()); diff --git a/src/settings.cpp b/src/settings.cpp index 2617da978..9aa3063c9 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -114,6 +114,7 @@ int trigger_batch_interval {1}; int verbosity {7}; double weight_cutoff {0.25}; double weight_survive {1.0}; +std::unordered_set distribcells; } // namespace settings