Removing old, commented alg.

This commit is contained in:
Patrick Shriwise 2021-08-12 12:56:03 -05:00
parent b94174cf96
commit 0e68bb9b9a

View file

@ -1302,78 +1302,6 @@ Cell::find_parent_cells(vector<ParentCell>& 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<ParentCell>& parent_cells) const {