mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Make sure MG materials get put in libraries
This commit is contained in:
parent
c2428608c1
commit
de666e3291
4 changed files with 17 additions and 13 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include "openmc/cross_sections.h"
|
||||
#include "openmc/error.h"
|
||||
#include "openmc/math_functions.h"
|
||||
|
||||
|
|
@ -109,6 +110,20 @@ void read_mg_cross_sections_header_c(hid_t file_id)
|
|||
for (int i = 0; i < energy_bins.size() - 1; ++i) {
|
||||
energy_bin_avg.push_back(0.5*(energy_bins[i] + energy_bins[i+1]));
|
||||
}
|
||||
|
||||
// Add entries into libraries for MG data
|
||||
auto names = group_names(file_id);
|
||||
if (names.empty()) {
|
||||
fatal_error("At least one MGXS data set must be present in mgxs "
|
||||
"library file!");
|
||||
}
|
||||
|
||||
for (auto& name : names) {
|
||||
Library lib {};
|
||||
lib.type_ = Library::Type::neutron;
|
||||
lib.materials_.push_back(name);
|
||||
libraries.push_back(lib);
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue