From 8e5f424ae121699f8e6bdc1c89eaddde54955f93 Mon Sep 17 00:00:00 2001 From: shriwise Date: Wed, 16 May 2018 13:40:03 -0500 Subject: [PATCH] Resolving some duplicate code from the rebase. --- src/cad.cpp | 2 +- src/cad_header.F90 | 1 - src/cell.cpp | 4 ---- src/input_xml.F90 | 16 +++------------- 4 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/cad.cpp b/src/cad.cpp index 8ca5c26cb4..790a88f765 100644 --- a/src/cad.cpp +++ b/src/cad.cpp @@ -24,7 +24,7 @@ void load_cad_geometry_c() c.id = DAGMC->id_by_index(3, i); c.dagmc_ptr = DAGMC; c.universe = 0; // set to zero for now - openmc::cells_c.push_back(c); + openmc::cells_c.push_back(&c); openmc::cell_dict[c.id] = i; } diff --git a/src/cad_header.F90 b/src/cad_header.F90 index 3c53254c91..403e0782bc 100644 --- a/src/cad_header.F90 +++ b/src/cad_header.F90 @@ -1,7 +1,6 @@ module cad_header use, intrinsic :: ISO_C_BINDING - use hdf5 implicit none diff --git a/src/cell.cpp b/src/cell.cpp index 35c69f371c..fba9c8934b 100644 --- a/src/cell.cpp +++ b/src/cell.cpp @@ -22,10 +22,6 @@ extern "C" {int32_t n_cells {0};} namespace openmc { -std::vector cells_c; - -std::map cell_dict; - //============================================================================== // Global variables //============================================================================== diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 95af050edb..911ec99fa0 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -422,7 +422,7 @@ contains ! ========================================================================== ! SETUP UNIVERSES - + ! Allocate universes, universe cell arrays, and assign base universe allocate(universes(n_universes)) do i = 1, n_universes @@ -433,20 +433,10 @@ contains n_cells_in_univ = cells_in_univ_dict % get(u % id) allocate(u % cells(n_cells_in_univ)) u % cells(:) = 0 - - ! Check whether universe is a fill universe - if (find(fill_univ_ids, u % id) == -1) then - if (root_universe > 0) then - call fatal_error("Two or more universes are not used as fill & - &universes, so it is not possible to distinguish which one & - &is the root universe.") - else - root_universe = i - end if - end if end associate end do - + root_universe = find_root_universe() + 1 + do i = 1, n_cells ! Get index in universes array j = universe_dict % get(cells(i) % universe())