diff --git a/include/openmc/dagmc.h b/include/openmc/dagmc.h index 5bf264b435..9930763474 100644 --- a/include/openmc/dagmc.h +++ b/include/openmc/dagmc.h @@ -155,7 +155,6 @@ private: std::shared_ptr uwuw_; //!< Pointer to the UWUW instance for this universe std::unique_ptr dmd_ptr; //! Pointer to DAGMC metadata object - bool uwuw_disabled; //!< Switch to disable UWUW materials bool adjust_geometry_ids_; //!< Indicates whether or not to automatically //!< generate new cell and surface IDs for the //!< universe diff --git a/src/dagmc.cpp b/src/dagmc.cpp index 8876690316..bb88f64889 100644 --- a/src/dagmc.cpp +++ b/src/dagmc.cpp @@ -416,10 +416,7 @@ void DAGUniverse::to_hdf5(hid_t universes_group) const bool DAGUniverse::uses_uwuw() const { - if (uwuw_disabled) - return false; - else - return !uwuw_->material_library.empty(); + return uwuw_ && !uwuw_->material_library.empty(); } std::string DAGUniverse::get_uwuw_materials_xml() const @@ -508,11 +505,10 @@ void DAGUniverse::legacy_assign_material( void DAGUniverse::read_uwuw_materials() { - // If no filename was provided, disable read UWUW materials - uwuw_disabled = (filename_ == ""); - - if (uwuw_disabled) + // If no filename was provided, don't read UWUW materials + if (filename_ == "") return; + uwuw_ = std::make_shared(filename_.c_str()); if (!uses_uwuw())