From 65c4c180becff7f08251e7657f6543942bba9899 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Sat, 16 Jan 2021 10:59:41 -0600 Subject: [PATCH 1/4] Updating calls for the new PyNE MaterialLibrary class. --- src/dagmc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dagmc.cpp b/src/dagmc.cpp index 5c614e610fc..e45ef07cc6d 100644 --- a/src/dagmc.cpp +++ b/src/dagmc.cpp @@ -66,7 +66,7 @@ bool get_uwuw_materials_xml(std::string& s) { ss << "\n"; const auto& mat_lib = uwuw.material_library; // write materials - for (auto mat : mat_lib) { ss << mat.second.openmc("atom"); } + for (auto mat : mat_lib) { ss << mat.second->openmc("atom"); } // write footer ss << ""; s = ss.str(); @@ -239,7 +239,7 @@ void load_dagmc_geometry() std::string uwuw_mat = DMD.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[uwuw_mat].metadata["mat_number"].asInt(); + int mat_number = uwuw.material_library.get_material(uwuw_mat).metadata["mat_number"].asInt(); c->material_.push_back(mat_number); } else { fatal_error(fmt::format("Material with value {} not found in the " From 2d8d9741cfbafd8142b9bd5571d75857cca82318 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Sat, 16 Jan 2021 11:36:22 -0600 Subject: [PATCH 2/4] Updating material IDs in the UWUW dagmc files. --- tests/regression_tests/dagmc/refl/dagmc.h5m | Bin 1250249 -> 1251162 bytes tests/regression_tests/dagmc/uwuw/dagmc.h5m | Bin 1244336 -> 1245249 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/regression_tests/dagmc/refl/dagmc.h5m b/tests/regression_tests/dagmc/refl/dagmc.h5m index ac788d2debfb797d46e0b269ae09e90b9a2c29c8..26b21168470f532328b66ed5a0a9214307a3c479 100644 GIT binary patch delta 1679 zcma)4Yfuwc6yDvu2_bPqLa02VBTBJ_1Vt!CNt6+-)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&Gu&18Q@)R>-P0 zWe~!ufpub#wI5Zv*wm<+OHp(@r><$v1aMXA%Y<^Qh0W65r({u^Zd+zoov`^VlV-KF?F$mOm|E zE9&!X#Qu|sY@o`jr?wZ}=gJl3o^n-%mMy31&ve3&a%P4az1Fh_>5X^@hA2JpV89@e!fyV$d@EHUQUJM9> zkinZl#2{vnF!(U|GWapfGYuKhkQnmjB$@(E)1-_>WpME0SK8B>Di9}h>Ohm~IVu7n zV2b?s1sbZHTN4Az+&>=#5ck70C$7s*2QVfpU;w$+kh{BfE=I_%Ni>*btWYvcj736+ zXUH95Y~kFTBgWLwVIg@#jD>p5*#m&gG*5t?fW=jv=Kh?hBF=|pu zFbFa9Y&@=;4-d%IrJt7U|HW?X`E2;X&d`FKwA&B)i3bA?Mx`AI3yycrl&@D7PA=nb zd0RU^6aM3eW+^%PNsw)?IcVExlJ>-vEQzt_d;jONtu~>yauL2X!+O`uH`!MYSA2kn zO;{6$%a7vn3ELYz&`irhtTsJdX^)7l2s6;{)LHN81^xE5v6X@Jl3mt)9cA0-<-2U- zYmQTTUZ#CzM|ln%K4N?A1VZggbIUf-@5kAmIH6?wirn%{dgV>qODDL_9_A`brdQcilSyMvlG2X3!0j} zzl`?pgKNDPyIkjPFR*UwJ<{9N<*2L1-|Msfw#Ms;J=RcDDZ&?rTYJnfX^*UV8~=R7 zTU&euUuEpRZuS{;2!>Bxz@sv{Tg?)a!)Lho2V6PP-D&oH=>TI-714^2?gqWM(jkm3 zZl4zcr+?R2j;ml@!z|!?vSs!kw=R;C diff --git a/tests/regression_tests/dagmc/uwuw/dagmc.h5m b/tests/regression_tests/dagmc/uwuw/dagmc.h5m index 4fbba3bb62a554216fb3c51dd477bc9d34077115..52570f64ac56a0dcd1a18a6c5c862fc2d22b9cf2 100644 GIT binary patch delta 1697 zcma)+dr%Ws6o<2$ClDT9ClJajDhf&si3nIrB|$Wb9jn!jwggEe45ji21Zz+vwnem~ z3ET z5ioDLd~Q}DA>I_kGO5~+wmMQH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gft7np+kI12R*ofe%K#}?f8sMtD5qfozZNX^(U`c#A9Q8=2c7- z#3!VzFCyt9s(c0Jj3w8lrHV3A#TyV`7PfB}uiv;%yfHn4=JOf8Jv~L7A|e=q&0KE^ zVn>Q1fU=D1W7(87nH>yM1#Hq4DrA%SLWDENXI++`UB=YyNNA|Av)bt z4+~L#MM;FE9}z{x15{c&7U!1xBYOgEH==d$uFt)VBjJxGlsSq0}Ma_ zGyomI05Ab802>eh2m}NHf&m;r2p|-|1%#Pq3@9@Z%aaN4kr^}xvCiV`SyV{>7EHzo zc_*wgh226EV9xw3>izeg;S^!|yofZ9A{a{YMq!BUeZlyul(iL5IEXRU3yW?xvh)dEXoZ&b@sQN(DuHR;^_zF@|X=Z z+eMt0j@QnXj9)*6PFB!fBRAV<;^qYmF^S!<3o zk?&fYGSyKI%PW$j@2TS*V>B%{l#CEq615S>Np)7!i>`=smY21>3G(28KFWm_Saivf z_T8@Ng0UEFc)5yKLsk#8Xk3E1F_xPfPnOg-Z+ETQG#2GX3(3m*mKs;wH)Emhuxzq? zrTKt6a*))lG-bP@{^?j@@oZ-vYT=S1s44Vu(J|SNaL%xsD`-A^^uo>9kSntMRk^1Z z`U|7}x;!UZ=1gTB9^d(M1^WYC>s7G+|I!(bKtz8?ofdv)YIK`i#$`-yQ)$4%)M)T) zau={Mj1Bye?)F8SABGV@;Ay*t_JiCjs{?>0qO+aoocGV-dKkK5i* zw0^H2AchCd|nSFH;;U` p$viaeX5O)9)*p{|CN>UDgiG2Boym>E58X7K{nC7P)tZkl{0q;yV4?s3 From 6059d074c3d1e88cf16c386efb3d6797ea82c41b Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Sat, 16 Jan 2021 12:32:07 -0600 Subject: [PATCH 3/4] Using lower-case matching for material names. --- src/dagmc.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/dagmc.cpp b/src/dagmc.cpp index e45ef07cc6d..362f9a6e483 100644 --- a/src/dagmc.cpp +++ b/src/dagmc.cpp @@ -101,12 +101,15 @@ bool write_uwuw_materials_xml() { return found_uwuw_mats; } -void legacy_assign_material(const std::string& mat_string, DAGCell* c) +void legacy_assign_material(std::string mat_string, DAGCell* c) { bool mat_found_by_name = false; // attempt to find a material with a matching name + to_lower(mat_string); for (const auto& m : model::materials) { - if (mat_string == m->name_) { + std::string m_name = m->name(); + to_lower(m_name); + if (mat_string == m_name) { // assign the material with that name if (!mat_found_by_name) { mat_found_by_name = true; From 1baf921d2f955d95fd59ed4d4dbd49e329879f12 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Sat, 16 Jan 2021 12:34:10 -0600 Subject: [PATCH 4/4] Including a check for the DAGMC version. --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e99b6151e3..e983a6566c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,10 @@ endif() #=============================================================================== if(dagmc) find_package(DAGMC REQUIRED PATH_SUFFIXES lib/cmake) + if (${DAGMC_VERSION} VERSION_LESS 3.2.0) + message(FATAL_ERROR "Discovered DAGMC Version: ${DAGMC_VERSION}. \ + Please update DAGMC to version 3.2.0 or greater.") + endif() endif() #=============================================================================== @@ -329,7 +333,7 @@ endif() # Avoid vs error lnk1149 :output filename matches input filename if(NOT MSVC) set_target_properties(libopenmc PROPERTIES - OUTPUT_NAME openmc) + OUTPUT_NAME openmc) endif() target_include_directories(libopenmc