From 751e92f63b79e3c2027be4e31469337c3192e336 Mon Sep 17 00:00:00 2001 From: helen-brooks Date: Wed, 20 Apr 2022 15:48:39 +0100 Subject: [PATCH] Run clang-format --- include/openmc/dagmc.h | 17 ++++++++--------- src/dagmc.cpp | 27 +++++++++++++++------------ 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/include/openmc/dagmc.h b/include/openmc/dagmc.h index 2fa0919e5..f50133105 100644 --- a/include/openmc/dagmc.h +++ b/include/openmc/dagmc.h @@ -90,9 +90,8 @@ public: //! Alternative DAGMC universe constructor for external DAGMC explicit DAGUniverse(std::shared_ptr external_dagmc_ptr, - const std::string& filename, - bool auto_geom_ids = false, - bool auto_mat_ids = false); + const std::string& filename, bool auto_geom_ids = false, + bool auto_mat_ids = false); //! Initialize the DAGMC accel. data structures, indices, material //! assignments, etc. @@ -146,17 +145,17 @@ public: bool has_graveyard() const { return has_graveyard_; } private: - void set_id(); //!< Deduce the universe id from model::universes - void init_dagmc(); //!< Create and initialise DAGMC pointer - void init_metadata(); //!< Create and initialise dagmcMetaData pointer - void init_geometry(); //!< Create cells and surfaces from DAGMC entities + void set_id(); //!< Deduce the universe id from model::universes + void init_dagmc(); //!< Create and initialise DAGMC pointer + void init_metadata(); //!< Create and initialise dagmcMetaData pointer + void init_geometry(); //!< Create cells and surfaces from DAGMC entities std::string filename_; //!< Name of the DAGMC file used to create this universe std::shared_ptr - uwuw_; //!< Pointer to the UWUW instance for this universe + 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 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 2d0bab86e..2154db363 100644 --- a/src/dagmc.cpp +++ b/src/dagmc.cpp @@ -77,10 +77,9 @@ DAGUniverse::DAGUniverse( } DAGUniverse::DAGUniverse(std::shared_ptr external_dagmc_ptr, - const std::string& filename, - bool auto_geom_ids, bool auto_mat_ids) + const std::string& filename, bool auto_geom_ids, bool auto_mat_ids) : dagmc_instance_(external_dagmc_ptr), filename_(filename), - adjust_geometry_ids_(auto_geom_ids), adjust_material_ids_(auto_mat_ids) + adjust_geometry_ids_(auto_geom_ids), adjust_material_ids_(auto_mat_ids) { set_id(); init_metadata(); @@ -137,7 +136,8 @@ void DAGUniverse::init_dagmc() void DAGUniverse::init_metadata() { // parse model metadata - dmd_ptr = std::make_unique(dagmc_instance_.get(), false, false); + dmd_ptr = + std::make_unique(dagmc_instance_.get(), false, false); dmd_ptr->load_property_data(); std::vector keywords {"temp"}; @@ -206,7 +206,8 @@ void DAGUniverse::init_geometry() } else { if (uses_uwuw()) { // lookup material in uwuw if present - std::string uwuw_mat = dmd_ptr->volume_material_property_data_eh[vol_handle]; + std::string uwuw_mat = + dmd_ptr->volume_material_property_data_eh[vol_handle]; if (uwuw_->material_library.count(uwuw_mat) != 0) { // Note: material numbers are set by UWUW int mat_number = uwuw_->material_library.get_material(uwuw_mat) @@ -276,7 +277,8 @@ void DAGUniverse::init_geometry() : dagmc_instance_->id_by_index(2, i + 1); // set BCs - std::string bc_value = dmd_ptr->get_surface_property("boundary", surf_handle); + std::string bc_value = + dmd_ptr->get_surface_property("boundary", surf_handle); to_lower(bc_value); if (bc_value.empty() || bc_value == "transmit" || bc_value == "transmission") { @@ -320,10 +322,8 @@ void DAGUniverse::init_geometry() model::surfaces.emplace_back(std::move(s)); } // end surface loop - } - std::string DAGUniverse::dagmc_ids_for_dim(int dim) const { // generate a vector of ids @@ -417,8 +417,10 @@ 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(); + if (uwuw_disabled) + return false; + else + return !uwuw_->material_library.empty(); } std::string DAGUniverse::get_uwuw_materials_xml() const @@ -508,9 +510,10 @@ void DAGUniverse::legacy_assign_material( void DAGUniverse::read_uwuw_materials() { // If no filename was provided, disable read UWUW materials - uwuw_disabled = (filename_==""); + uwuw_disabled = (filename_ == ""); - if (uwuw_disabled) return; + if (uwuw_disabled) + return; uwuw_ = std::make_shared(filename_.c_str()); if (!uses_uwuw())