From 0e68bb9b9a0f8a8dc443ce81c3d00ce6efad05a8 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Thu, 12 Aug 2021 12:56:03 -0500 Subject: [PATCH] Removing old, commented alg. --- src/cell.cpp | 72 ---------------------------------------------------- 1 file changed, 72 deletions(-) diff --git a/src/cell.cpp b/src/cell.cpp index 56dea76553..d9ab4cfea7 100644 --- a/src/cell.cpp +++ b/src/cell.cpp @@ -1302,78 +1302,6 @@ Cell::find_parent_cells(vector& parent_cells, int32_t instance) cons } // end while std::reverse(parent_cells.begin(), parent_cells.end()); - - // while (univ_idx != model::root_universe) { - // // find the cell (or lattice) that contains this universe - // int32_t old_idx = univ_idx; - // for (const auto& cell : model::cells) { - - // if (cell->type_ == Fill::UNIVERSE) { - // // if this cell is filled with the universe we're looking for, - // // add it to the parent cells and update the universe index - // if (cell->fill_ == univ_idx) { - // parent_cells.push_back({model::cell_map[cell->id_], -1}); - // univ_idx = cell->universe_; - // break; - // } - // } else if (cell->type_ == Fill::LATTICE) { - // // if any of the lattice cells contain the universe we're looking - // // for, add it to the set of parent cells - // const auto& lattice = model::lattices[cell->fill_]; - // for(auto lit = lattice->begin(); lit != lattice->end(); ++lit) { - // if (lattice->universes_[lit.indx_] == univ_idx) { - // parent_cells.push_back({model::cell_map[cell->id_], lit.indx_}); - // univ_idx = cell->universe_; - // break; - // } - // } - // } - // } - // if (old_idx == univ_idx) { - // fatal_error(fmt::format("Failed to find a cell filled with universe {}", openmc::model::universes[univ_idx]->id_)); - // } - // } - - // // reverse the set of parent cells so the order goes highest to - // // lowest level in the geometry - // std::reverse(parent_cells.begin(), parent_cells.end()); - - // // check the instance for this set of parent cells and - // // return the current parent cells if it matches - // if (this->compute_instance(parent_cells) == instance) return; - - // // TO-DO: Check the cell instance here and repeat process if needed - // for (auto it = parent_cells.begin(); it != parent_cells.end() - 1; it++) { - // // check for another cell containing this universe - // auto& cell = model::cells[it->cell_index]; - // auto& univ = model::universes[cell->universe_]; - - // // get the child cell's universe to look for - // int32_t fill_idx = model::cells[(it+1)->cell_index]->fill_; - // Fill fill_type = model::cells[(it+1)->cell_index]->type_; - - // for (auto& cell_indx : univ->cells_) { - // auto& univ_cell = model::cells[cell_indx]; - // // if we get a matching cell fill, try this out instead - // if (univ_cell->fill_ != fill_idx || univ_cell->type_ != fill_type) continue; - - // if (univ_cell->type_ == Fill::UNIVERSE) { - // *it = {cell_indx, -1}; - // if (this->compute_instance(parent_cells) == instance) return; - // } else if (univ_cell->type_ == Fill::LATTICE) { - // const auto& lattice = model::lattices[univ_cell->fill_]; - // int lat_univ = lattice->universes_[it->lattice_index]; - // for (auto lit = lattice->begin(); lit != lattice->end(); ++lit) { - // if (lat_univ == lattice->universes_[lit.indx_]) { - // *it = {cell_indx, lit.indx_}; - // if (this->compute_instance(parent_cells) == instance) return; - // } - // } - // } - // } - // } - - // fatal_error(fmt::format("Could not compute the parent cells of cell {} (instance {})", id_, instance)); } int32_t Cell::compute_instance(const vector& parent_cells) const {