From 64e2df362a505c933b5eb1b8ce9e30657a6a186a Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 1 Oct 2018 10:33:58 -0500 Subject: [PATCH] Adding changes requested in PR. --- CMakeLists.txt | 2 +- include/openmc/cell.h | 4 ++-- include/openmc/dagmc.h | 7 ++++--- include/openmc/surface.h | 3 +-- openmc/summary.py | 2 +- src/dagmc.cpp | 6 ++++-- src/summary.cpp | 2 +- tests/regression_tests/dagmc/__init__.py | 1 - 8 files changed, 14 insertions(+), 13 deletions(-) delete mode 100644 tests/regression_tests/dagmc/__init__.py diff --git a/CMakeLists.txt b/CMakeLists.txt index a34542e6a1..53615696d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -488,7 +488,7 @@ endif() # target_link_libraries treats any arguments starting with - but not -l as # linker flags. Thus, we can pass both linker flags and libraries together. target_link_libraries(libopenmc ${ldflags} ${HDF5_LIBRARIES} pugixml - faddeeva xtensor ${DAGMC_LIBRARIES}) + faddeeva xtensor) if(dagmc) target_compile_definitions(libopenmc PRIVATE DAGMC) diff --git a/include/openmc/cell.h b/include/openmc/cell.h index 88996226c1..5a889023b6 100644 --- a/include/openmc/cell.h +++ b/include/openmc/cell.h @@ -133,11 +133,11 @@ public: //! known to be on. This index takes precedence over surface sense //! calculations. virtual bool - contains(Position p, Direction u, int32_t on_surface) const = 0; + contains(Position r, Direction u, int32_t on_surface) const = 0; //! Find the oncoming boundary of this cell. virtual std::pair - distance(Position p, Direction u, int32_t on_surface) const = 0; + distance(Position r, Direction u, int32_t on_surface) const = 0; //! Write all information needed to reconstruct the cell to an HDF5 group. //! @param group_id An HDF5 group id. diff --git a/include/openmc/dagmc.h b/include/openmc/dagmc.h index 8dd60516f0..7b148b7ee6 100644 --- a/include/openmc/dagmc.h +++ b/include/openmc/dagmc.h @@ -1,8 +1,8 @@ #ifdef DAGMC -#ifndef OPEN_DAGMC_H -#define OPEN_DAGMC_H +#ifndef OPENMC_DAGMC_H +#define OPENMC_DAGMC_H #include "DagMC.hpp" #include "openmc/cell.h" @@ -16,6 +16,7 @@ extern "C" void load_dagmc_geometry(); extern "C" void free_memory_dagmc(); } -#endif // DAGMC_H + +#endif // OPENMC_DAGMC_H #endif diff --git a/include/openmc/surface.h b/include/openmc/surface.h index 1eb505e453..23c3b61ec2 100644 --- a/include/openmc/surface.h +++ b/include/openmc/surface.h @@ -134,8 +134,7 @@ public: moab::DagMC* dagmc_ptr_; DAGSurface(); double evaluate(Position r) const; - double distance(Position r, Direction u, - bool coincident) const; + double distance(Position r, Direction u, bool coincident) const; Direction normal(Position r) const; //! Get the bounding box of this surface. BoundingBox bounding_box() const; diff --git a/openmc/summary.py b/openmc/summary.py index fcda49a120..c5343a5538 100644 --- a/openmc/summary.py +++ b/openmc/summary.py @@ -98,7 +98,7 @@ class Summary(object): def _read_geometry(self): - if "cad" in self._f['geometry'].attrs.keys(): + if "dagmc" in self._f['geometry'].attrs.keys(): return else: # Read in and initialize the Materials and Geometry diff --git a/src/dagmc.cpp b/src/dagmc.cpp index fa9ca30955..72ad425499 100644 --- a/src/dagmc.cpp +++ b/src/dagmc.cpp @@ -6,6 +6,7 @@ #include "openmc/string_functions.h" #include +#include #include namespace openmc { @@ -78,8 +79,9 @@ void load_dagmc_geometry() c->material_.push_back(std::stoi(mat_value)); } } else { - std::cout << c->id_ << std::endl; - fatal_error("A volume without a material was found."); + std::stringstream err_msg; + err_msg << "Volume " << c->id_ << " has no material assignment."; + fatal_error(err_msg.str()); } } diff --git a/src/summary.cpp b/src/summary.cpp index eaedd21dd7..d2f083657c 100644 --- a/src/summary.cpp +++ b/src/summary.cpp @@ -13,7 +13,7 @@ write_geometry(hid_t file_id) { #ifdef DAGMC if (settings::dagmc) { - write_attribute(geom_group, "cad", 1); + write_attribute(geom_group, "dagmc", 1); return; } #endif diff --git a/tests/regression_tests/dagmc/__init__.py b/tests/regression_tests/dagmc/__init__.py deleted file mode 100644 index 5871ed8eef..0000000000 --- a/tests/regression_tests/dagmc/__init__.py +++ /dev/null @@ -1 +0,0 @@ -import pytest