From 400f3e9334780ea527a7a9320a6830e41d1f5e64 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 23 Apr 2021 12:20:42 -0500 Subject: [PATCH] More updates from self review. Moving check for BCs into geometry_aux. --- src/geometry_aux.cpp | 15 +++++++++++++++ src/surface.cpp | 17 ----------------- tests/regression_tests/dagmc/universes/test.py | 2 +- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/geometry_aux.cpp b/src/geometry_aux.cpp index d45cdcb23a..80741b3e78 100644 --- a/src/geometry_aux.cpp +++ b/src/geometry_aux.cpp @@ -66,6 +66,21 @@ void read_geometry_xml() read_cells(root); read_lattices(root); + // Check to make sure a boundary condition was applied to at least one + // surface + bool boundary_exists = false; + for (const auto& surf : model::surfaces) { + if (surf->bc_) { + boundary_exists = true; + break; + } + } + + if (settings::run_mode != RunMode::PLOTTING && !boundary_exists) { + fatal_error("No boundary conditions were applied to any surfaces!"); + } + + // Allocate universes, universe cell arrays, and assign base universe model::root_universe = find_root_universe(); } diff --git a/src/surface.cpp b/src/surface.cpp index e0b88d24a5..8c1ed51d19 100644 --- a/src/surface.cpp +++ b/src/surface.cpp @@ -1133,23 +1133,6 @@ void read_surfaces(pugi::xml_node node) surf2.bc_ = surf1.bc_; } } - - // Check to make sure a boundary condition was applied to at least one - // surface - bool boundary_exists = false; - for (const auto& surf : model::surfaces) { - if (surf->bc_) { - boundary_exists = true; - break; - } - } - // if (settings::run_mode != RunMode::PLOTTING && !boundary_exists) { - // fatal_error("No boundary conditions were applied to any surfaces!"); - // } - - // if (model::surfaces.size() == 0) { - // fatal_error("No surfaces found in geometry.xml!"); - // } } void free_memory_surfaces() diff --git a/tests/regression_tests/dagmc/universes/test.py b/tests/regression_tests/dagmc/universes/test.py index d94f6fe011..cc407aa5ec 100644 --- a/tests/regression_tests/dagmc/universes/test.py +++ b/tests/regression_tests/dagmc/universes/test.py @@ -68,4 +68,4 @@ class DAGMCUniverseTest(PyAPITestHarness): def test_univ(): harness = DAGMCUniverseTest('statepoint.10.h5') - harness.main() \ No newline at end of file + harness.main()