mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-21 06:25:30 -04:00
Set upper and lower interpolation bounds for MGXS data. (#3803)
This commit is contained in:
parent
a35927aad3
commit
c6ef84d1d5
1 changed files with 8 additions and 0 deletions
|
|
@ -14,6 +14,7 @@
|
|||
#include "openmc/error.h"
|
||||
#include "openmc/math_functions.h"
|
||||
#include "openmc/mgxs_interface.h"
|
||||
#include "openmc/nuclide.h"
|
||||
#include "openmc/random_lcg.h"
|
||||
#include "openmc/settings.h"
|
||||
#include "openmc/string_utils.h"
|
||||
|
|
@ -85,6 +86,13 @@ void Mgxs::metadata_from_hdf5(hid_t xs_id, const vector<double>& temperature,
|
|||
delete[] dset_names;
|
||||
std::sort(temps_available.begin(), temps_available.end());
|
||||
|
||||
// Set the global upper and lower interpolation bounds to avoid errors
|
||||
// involving C-API functions.
|
||||
data::temperature_min =
|
||||
std::min(data::temperature_min, temps_available.front());
|
||||
data::temperature_max =
|
||||
std::max(data::temperature_max, temps_available.back());
|
||||
|
||||
// If only one temperature is available, lets just use nearest temperature
|
||||
// interpolation
|
||||
if ((num_temps == 1) &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue