From 4860bd5ed207bbe1584b0ca29d97022c902c8fff Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Wed, 6 Nov 2019 09:31:56 -0600 Subject: [PATCH] Updating name of Universer counter class. --- include/openmc/geometry_aux.h | 14 +++++++------- src/finalize.cpp | 2 +- src/geometry_aux.cpp | 18 +++++++++--------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/openmc/geometry_aux.h b/include/openmc/geometry_aux.h index 557d82193..14e119282 100644 --- a/include/openmc/geometry_aux.h +++ b/include/openmc/geometry_aux.h @@ -10,21 +10,21 @@ #include namespace openmc { - struct CellCountStorage { + struct UniverseCellCounter { private: - CellCountStorage() {} - CellCountStorage(CellCountStorage& c) {} - CellCountStorage(const CellCountStorage& c) {} + UniverseCellCounter() {} + UniverseCellCounter(UniverseCellCounter& c) {} + UniverseCellCounter(const UniverseCellCounter& c) {} - static CellCountStorage* instance_; + static UniverseCellCounter* instance_; std::map> counts; public: - static CellCountStorage* instance() { + static UniverseCellCounter* instance() { if (instance_ == nullptr) - instance_ = new CellCountStorage; + instance_ = new UniverseCellCounter; return instance_; } diff --git a/src/finalize.cpp b/src/finalize.cpp index f2cbc973c..3b8530b21 100644 --- a/src/finalize.cpp +++ b/src/finalize.cpp @@ -136,7 +136,7 @@ int openmc_finalize() int openmc_reset() { - CellCountStorage::instance()->clear(); + UniverseCellCounter::instance()->clear(); LevelCountStorage::instance()->clear(); for (auto& t : model::tallies) { diff --git a/src/geometry_aux.cpp b/src/geometry_aux.cpp index 662b6790d..42fb33284 100644 --- a/src/geometry_aux.cpp +++ b/src/geometry_aux.cpp @@ -60,18 +60,18 @@ void read_geometry_xml() model::root_universe = find_root_universe(); } -void CellCountStorage::clear() { +void UniverseCellCounter::clear() { if (instance_ != nullptr) { delete instance_; instance_ = nullptr; } } -void CellCountStorage::set_cell_count_for_univ(int32_t univ, int32_t cell, int count) { +void UniverseCellCounter::set_cell_count_for_univ(int32_t univ, int32_t cell, int count) { counts[univ][cell] = count; } - void CellCountStorage::increment_count_for_univ(int32_t univ, int32_t cell) { + void UniverseCellCounter::increment_count_for_univ(int32_t univ, int32_t cell) { if (has_count(univ,cell)) { counts[univ][cell] += 1; } else { @@ -79,15 +79,15 @@ void CellCountStorage::set_cell_count_for_univ(int32_t univ, int32_t cell, int c } } -bool CellCountStorage::has_count(int32_t univ, int32_t cell) { +bool UniverseCellCounter::has_count(int32_t univ, int32_t cell) { return counts.count(univ) && counts[univ].count(cell); } -bool CellCountStorage::has_count(int32_t univ) { +bool UniverseCellCounter::has_count(int32_t univ) { return counts.count(univ); } -void CellCountStorage::absorb_b_into_a(int32_t a, int32_t b) { +void UniverseCellCounter::absorb_b_into_a(int32_t a, int32_t b) { std::map b_map = counts[b]; for (auto it : b_map) { @@ -99,7 +99,7 @@ void CellCountStorage::absorb_b_into_a(int32_t a, int32_t b) { } } -auto CellCountStorage::get_count(int32_t univ) { +auto UniverseCellCounter::get_count(int32_t univ) { return counts[univ]; } @@ -142,7 +142,7 @@ int LevelCountStorage::get_count(int32_t univ) { return counts[univ]; } -CellCountStorage* CellCountStorage::instance_ = nullptr; +UniverseCellCounter* UniverseCellCounter::instance_ = nullptr; LevelCountStorage* LevelCountStorage::instance_ = nullptr; //============================================================================== @@ -480,7 +480,7 @@ prepare_distribcell() void count_cell_instances(int32_t univ_indx) { - CellCountStorage* counter = CellCountStorage::instance(); + UniverseCellCounter* counter = UniverseCellCounter::instance(); if (counter->has_count(univ_indx)) { std::map univ_counts = counter->get_count(univ_indx);