From fdcc1ddb7ba2a0a86a1e7089069a6c41fd4eccfe Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Sat, 13 Mar 2021 00:05:41 -0600 Subject: [PATCH] Creating a new data member for auto-assigning material IDs. --- include/openmc/dagmc.h | 6 +++--- src/dagmc.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/openmc/dagmc.h b/include/openmc/dagmc.h index 69b3f1610..cf399c936 100644 --- a/include/openmc/dagmc.h +++ b/include/openmc/dagmc.h @@ -24,7 +24,7 @@ class DAGUniverse : public Universe { public: explicit DAGUniverse(pugi::xml_node node); - explicit DAGUniverse(const std::string& filename, bool auto_ids = false); + explicit DAGUniverse(const std::string& filename, bool auto_geom_ids = false); void initialize(); //!< Sets up the DAGMC instance and OpenMC internals @@ -35,8 +35,8 @@ public: std::shared_ptr dagmc_instance_; //! DAGMC Instance for this universe int32_t cell_idx_offset_; int32_t surf_idx_offset_; - bool adjust_ids_; - + bool adjust_geometry_ids_; + bool adjust_material_ids_; }; void load_dagmc_geometry(); diff --git a/src/dagmc.cpp b/src/dagmc.cpp index 02bd2338e..e6d0d56a2 100644 --- a/src/dagmc.cpp +++ b/src/dagmc.cpp @@ -222,15 +222,15 @@ DAGUniverse::DAGUniverse(pugi::xml_node node) { fatal_error("Must specify a file for the DAGMC universe"); } - adjust_ids_ = false; + adjust_geometry_ids_ = false; if (check_for_node(node, "auto_ids")) { - adjust_ids_ = get_node_value_bool(node, "auto_ids"); + adjust_geometry_ids_ = get_node_value_bool(node, "auto_ids"); } initialize(); } -DAGUniverse::DAGUniverse(const std::string& filename, bool auto_ids) -: filename_(filename), adjust_ids_(auto_ids) { +DAGUniverse::DAGUniverse(const std::string& filename, bool auto_geom_ids) +: filename_(filename), adjust_geometry_ids_(auto_geom_ids) { // determine the next universe id int32_t next_univ_id = 0; for (const auto& u : model::universes) { @@ -313,7 +313,7 @@ void DAGUniverse::initialize() { // set cell ids using global IDs DAGCell* c = new DAGCell(); c->dag_index_ = i + 1; - c->id_ = adjust_ids_ ? next_cell_id++ : dagmc_instance_->id_by_index(3, c->dag_index_); + c->id_ = adjust_geometry_ids_ ? next_cell_id++ : dagmc_instance_->id_by_index(3, c->dag_index_); c->dagmc_ptr_ = dagmc_instance_; c->universe_ = id_; // set to zero for now c->fill_ = C_NONE; // no fill, single universe @@ -404,7 +404,7 @@ void DAGUniverse::initialize() { // set cell ids using global IDs DAGSurface* s = new DAGSurface(); s->dag_index_ = i+1; - s->id_ = adjust_ids_ ? next_surf_id++ : dagmc_instance_->id_by_index(2, i+1); + s->id_ = adjust_geometry_ids_ ? next_surf_id++ : dagmc_instance_->id_by_index(2, i+1); s->dagmc_ptr_ = dagmc_instance_; // set BCs