mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Merge pull request #1807 from gridley/fix_min_max_temperature
Fix calculation of neutron data min and max temperatures
This commit is contained in:
commit
e9c91fce69
1 changed files with 6 additions and 7 deletions
|
|
@ -32,8 +32,8 @@ namespace openmc {
|
|||
namespace data {
|
||||
std::array<double, 2> energy_min {0.0, 0.0};
|
||||
std::array<double, 2> energy_max {INFTY, INFTY};
|
||||
double temperature_min {0.0};
|
||||
double temperature_max {INFTY};
|
||||
double temperature_min {INFTY};
|
||||
double temperature_max {0.0};
|
||||
std::unordered_map<std::string, int> nuclide_map;
|
||||
std::vector<std::unique_ptr<Nuclide>> nuclides;
|
||||
} // namespace data
|
||||
|
|
@ -169,11 +169,10 @@ Nuclide::Nuclide(hid_t group, const std::vector<double>& temperature)
|
|||
// Sort temperatures to read
|
||||
std::sort(temps_to_read.begin(), temps_to_read.end());
|
||||
|
||||
double T_min_read = *std::min_element(temps_to_read.cbegin(), temps_to_read.cend());
|
||||
double T_max_read = *std::max_element(temps_to_read.cbegin(), temps_to_read.cend());
|
||||
|
||||
data::temperature_min = std::max(data::temperature_min, T_min_read);
|
||||
data::temperature_max = std::min(data::temperature_max, T_max_read);
|
||||
data::temperature_min =
|
||||
std::min(data::temperature_min, static_cast<double>(temps_to_read.front()));
|
||||
data::temperature_max =
|
||||
std::max(data::temperature_max, static_cast<double>(temps_to_read.back()));
|
||||
|
||||
hid_t energy_group = open_group(group, "energy");
|
||||
for (const auto& T : temps_to_read) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue