From 327bca1b6ce3a0eb5012da6fccddb88e2efb0ea9 Mon Sep 17 00:00:00 2001 From: Miriam Date: Fri, 28 Aug 2020 17:42:15 +0000 Subject: [PATCH 1/2] Changed name "decay rate" to "decay-rate" to avoid seg faults I added decay-rate to get_xsdata since it was missing. However, set_decay_rate_mgxs sets it as "decay rate". That space in the name seems to cause some errors, akin to seg faults. By replacing that name with "decay-rate", create_mg_mode could run smoothly. --- openmc/mgxs/library.py | 5 +++++ openmc/mgxs_library.py | 4 ++-- openmc/plotter.py | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/openmc/mgxs/library.py b/openmc/mgxs/library.py index d9518e78d..671b0b8f0 100644 --- a/openmc/mgxs/library.py +++ b/openmc/mgxs/library.py @@ -1094,6 +1094,11 @@ class Library: xsdata.set_beta_mgxs(mymgxs, xs_type=xs_type, nuclide=[nuclide], subdomain=subdomain) + if 'decay-rate' in self.mgxs_types: + mymgxs = self.get_mgxs(domain, 'decay-rate') + xsdata.set_decay_rate_mgxs(mymgxs, xs_types=xs_type, nuclide=[nuclide], + subdomain=subdomain) + # If multiplicity matrix is available, prefer that if 'multiplicity matrix' in self.mgxs_types: mymgxs = self.get_mgxs(domain, 'multiplicity matrix') diff --git a/openmc/mgxs_library.py b/openmc/mgxs_library.py index c2a4a9db7..e3c830c23 100644 --- a/openmc/mgxs_library.py +++ b/openmc/mgxs_library.py @@ -2044,7 +2044,7 @@ class XSdata: xs_grp.create_dataset("beta", data=self._beta[i]) if self._decay_rate[i] is not None: - xs_grp.create_dataset("decay rate", + xs_grp.create_dataset("decay-rate", data=self._decay_rate[i]) if self._scatter_matrix[i] is None: @@ -2210,7 +2210,7 @@ class XSdata: xs_types = ['total', 'absorption', 'fission', 'kappa-fission', 'chi', 'chi-prompt', 'chi-delayed', 'nu-fission', 'prompt-nu-fission', 'delayed-nu-fission', 'beta', - 'decay rate', 'inverse-velocity'] + 'decay-rate', 'inverse-velocity'] temperature_group = group[temp] diff --git a/openmc/plotter.py b/openmc/plotter.py index 5da0e81e5..dfa6a13ba 100644 --- a/openmc/plotter.py +++ b/openmc/plotter.py @@ -16,7 +16,7 @@ PLOT_TYPES = ['total', 'scatter', 'elastic', 'inelastic', 'fission', PLOT_TYPES_MGXS = ['total', 'absorption', 'scatter', 'fission', 'kappa-fission', 'nu-fission', 'prompt-nu-fission', 'deleyed-nu-fission', 'chi', 'chi-prompt', 'chi-delayed', - 'inverse-velocity', 'beta', 'decay rate', 'unity'] + 'inverse-velocity', 'beta', 'decay-rate', 'unity'] # Create a dictionary which can be used to convert PLOT_TYPES_MGXS to the # openmc.XSdata attribute name needed to access the data _PLOT_MGXS_ATTR = {line: line.replace(' ', '_').replace('-', '_') From 1c818a0d490fb252fec25d87443a29d028314444 Mon Sep 17 00:00:00 2001 From: Miriam Date: Fri, 28 Aug 2020 19:52:52 +0000 Subject: [PATCH 2/2] Forgot a file! This src file had an instance of "decay rate". Changed to "decay-rate" --- src/xsdata.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xsdata.cpp b/src/xsdata.cpp index c39d779ec..d4698e2a0 100644 --- a/src/xsdata.cpp +++ b/src/xsdata.cpp @@ -93,7 +93,7 @@ XsData::from_hdf5(hid_t xsdata_grp, bool fissionable, AngleDistributionType scat fission_from_hdf5(xsdata_grp, n_ang, is_isotropic); } // Get the non-fission-specific data - read_nd_vector(xsdata_grp, "decay rate", decay_rate); + read_nd_vector(xsdata_grp, "decay-rate", decay_rate); read_nd_vector(xsdata_grp, "absorption", absorption, true); read_nd_vector(xsdata_grp, "inverse-velocity", inverse_velocity);