From bcd0ce442087d8254aee0a425acb38b8d481d126 Mon Sep 17 00:00:00 2001 From: Baptiste Mouginot Date: Wed, 11 Dec 2024 21:32:21 +0100 Subject: [PATCH] back to origin --- src/dagmc/dagmcmetadata.cpp | 24 ++++++++++++------------ src/dagmc/dagmcmetadata.hpp | 2 ++ src/dagmc/util.hpp | 5 ----- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/dagmc/dagmcmetadata.cpp b/src/dagmc/dagmcmetadata.cpp index 5a9f118b15..0c86a27ae9 100644 --- a/src/dagmc/dagmcmetadata.cpp +++ b/src/dagmc/dagmcmetadata.cpp @@ -210,10 +210,8 @@ void dagmcMetaData::parse_material_data() { // set the material value volume_material_property_data_eh[eh] = grp_name; logger.message("Group name -- " + grp_name); - bool is_graveyard = dagmc_util::to_lower(grp_name) == - dagmc_util::to_lower(graveyard_mat_str()); - bool is_vacuum = dagmc_util::to_lower(grp_name) == - dagmc_util::to_lower(vacuum_mat_str()); + bool is_graveyard = to_lower(grp_name) == to_lower(graveyard_mat_str()); + bool is_vacuum = to_lower(grp_name) == to_lower(vacuum_mat_str()); // not graveyard or vacuum or implicit compliment if (!is_graveyard && !is_vacuum && !DAG->is_implicit_complement(eh)) { @@ -347,6 +345,11 @@ void dagmcMetaData::parse_tally_volume_data() { } } +std::string dagmcMetaData::to_lower(std::string input) { + dagmc_util::lowercase_str(input); + return input; +} + // parse the boundary data void dagmcMetaData::parse_boundary_data() { auto boundary_assignments = get_property_assignments("boundary", 2, ":"); @@ -376,18 +379,15 @@ void dagmcMetaData::parse_boundary_data() { // 2d entities have been tagged with the boundary condition property // ie. both surfaces and its member triangles - std::string bc_string = dagmc_util::to_lower(boundary_assignment[0]); + std::string bc_string = to_lower(boundary_assignment[0]); - if (bc_string.find(dagmc_util::to_lower(reflecting_str())) != - std::string::npos) + if (bc_string.find(to_lower(reflecting_str())) != std::string::npos) surface_boundary_data_eh[eh] = reflecting_str(); - if (bc_string.find(dagmc_util::to_lower(white_str())) != - std::string::npos) + if (bc_string.find(to_lower(white_str())) != std::string::npos) surface_boundary_data_eh[eh] = white_str(); - if (bc_string.find(dagmc_util::to_lower(periodic_str())) != - std::string::npos) + if (bc_string.find(to_lower(periodic_str())) != std::string::npos) surface_boundary_data_eh[eh] = periodic_str(); - if (bc_string.find(dagmc_util::to_lower(vacuum_str())) != std::string::npos) + if (bc_string.find(to_lower(vacuum_str())) != std::string::npos) surface_boundary_data_eh[eh] = vacuum_str(); } } diff --git a/src/dagmc/dagmcmetadata.hpp b/src/dagmc/dagmcmetadata.hpp index 405c060afa..d3a940f3f1 100644 --- a/src/dagmc/dagmcmetadata.hpp +++ b/src/dagmc/dagmcmetadata.hpp @@ -250,6 +250,8 @@ class dagmcMetaData { */ std::set set_remove_rich(std::set properties_set); + std::string to_lower(const std::string input); + // public member variables public: /** diff --git a/src/dagmc/util.hpp b/src/dagmc/util.hpp index 639f7c542e..9a8b64c0e1 100644 --- a/src/dagmc/util.hpp +++ b/src/dagmc/util.hpp @@ -10,10 +10,5 @@ inline void lowercase_str(std::string& input) { [](unsigned char c) { return std::tolower(c); }); } -inline std::string to_lower(std::string input) { - lowercase_str(input); - return input; -} - } // namespace dagmc_util #endif \ No newline at end of file