From e6466e9867cdb5dbd810d6e48ffd1c73fa5042d5 Mon Sep 17 00:00:00 2001 From: Sterling Harper Date: Tue, 18 Dec 2018 15:06:22 -0500 Subject: [PATCH] Remove surface-based neighbor lists --- include/openmc/geometry_aux.h | 6 ------ include/openmc/surface.h | 3 --- src/geometry.F90 | 5 +---- src/geometry_aux.cpp | 27 --------------------------- src/input_xml.F90 | 10 +--------- 5 files changed, 2 insertions(+), 49 deletions(-) diff --git a/include/openmc/geometry_aux.h b/include/openmc/geometry_aux.h index da55c3d9b..e456f700c 100644 --- a/include/openmc/geometry_aux.h +++ b/include/openmc/geometry_aux.h @@ -32,12 +32,6 @@ extern "C" void assign_temperatures(); extern "C" int32_t find_root_universe(); -//!============================================================================= -//! Build a list of neighboring cells to each surface to speed up tracking. -//!============================================================================= - -extern "C" void neighbor_lists(); - //============================================================================== //! Populate all data structures needed for distribcells. //============================================================================== diff --git a/include/openmc/surface.h b/include/openmc/surface.h index d0ada79ea..3df791ba3 100644 --- a/include/openmc/surface.h +++ b/include/openmc/surface.h @@ -66,9 +66,6 @@ public: int bc_; //!< Boundary condition std::string name_; //!< User-defined name - std::vector neighbor_pos_; //!< List of cells on positive side - std::vector neighbor_neg_; //!< List of cells on negative side - explicit Surface(pugi::xml_node surf_node); Surface(); diff --git a/src/geometry.F90 b/src/geometry.F90 index 91ed6bbdc..83bf2325f 100644 --- a/src/geometry.F90 +++ b/src/geometry.F90 @@ -53,9 +53,6 @@ module geometry integer(C_INT), intent(out) :: next_level end subroutine distance_to_boundary - subroutine neighbor_lists() bind(C) - end subroutine neighbor_lists - #ifdef DAGMC function next_cell_c(current_cell, surface_crossed) & @@ -97,7 +94,7 @@ contains if (present(use_neighbor_lists)) then found = find_cell_c(p, logical(use_neighbor_lists, kind=C_BOOL)) else - found = find_cell_c(p, logical(.false., kind=C_BOOL)) + found = find_cell_c(p, .false._C_BOOL) end if end subroutine find_cell diff --git a/src/geometry_aux.cpp b/src/geometry_aux.cpp index c326744eb..eca9b6c13 100644 --- a/src/geometry_aux.cpp +++ b/src/geometry_aux.cpp @@ -155,33 +155,6 @@ find_root_universe() //============================================================================== -void -neighbor_lists() -{ - write_message("Building neighboring cells lists for each surface...", 6); - - for (int i = 0; i < model::cells.size(); i++) { - for (auto token : model::cells[i]->region_) { - // Skip operator tokens. - if (std::abs(token) >= OP_UNION) continue; - - // This token is a surface index. Add the cell to the surface's list. - if (token > 0) { - model::surfaces[std::abs(token)-1]->neighbor_pos_.push_back(i); - } else { - model::surfaces[std::abs(token)-1]->neighbor_neg_.push_back(i); - } - } - } - - for (Surface* surf : model::surfaces) { - surf->neighbor_pos_.shrink_to_fit(); - surf->neighbor_neg_.shrink_to_fit(); - } -} - -//============================================================================== - void prepare_distribcell() { diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 1da1bf9df..7bba72d15 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -9,7 +9,6 @@ module input_xml use dict_header, only: DictIntInt, DictCharInt, DictEntryCI use endf, only: reaction_name use error, only: fatal_error, warning, write_message, openmc_err_msg - use geometry, only: neighbor_lists use geometry_header #ifdef DAGMC use dagmc_header @@ -132,7 +131,7 @@ contains call read_materials_xml() call read_geometry_xml() - ! Set up neighbor lists, convert user IDs -> indices, assign temperatures + ! Convert user IDs -> indices, assign temperatures call finalize_geometry(nuc_temps, sab_temps) if (run_mode /= MODE_PLOTTING) then @@ -182,12 +181,6 @@ contains call adjust_indices() call count_cell_instances(root_universe) - ! After reading input and basic geometry setup is complete, build lists of - ! neighboring cells for efficient tracking - if (.not. dagmc) then - call neighbor_lists() - end if - ! Assign temperatures to cells that don't have temperatures already assigned call assign_temperatures() @@ -2297,7 +2290,6 @@ contains logical :: file_exists ! Does multipole library exist? character(7) :: readable ! Is multipole library readable? character(MAX_FILE_LEN) :: filename ! Path to multipole xs library - character(kind=C_CHAR), pointer :: string(:) integer(HID_T) :: file_id integer(HID_T) :: group_id