mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
avoid double reading thermal scattering libraries
This commit is contained in:
parent
81b88cc018
commit
dc5f2746d3
1 changed files with 11 additions and 9 deletions
|
|
@ -119,20 +119,22 @@ ThermalScattering::ThermalScattering(
|
|||
if (!found) {
|
||||
// If no pairs found, check if the desired temperature falls within
|
||||
// bounds' tolerance
|
||||
if (std::abs(T - temps_available[0]) <=
|
||||
settings::temperature_tolerance) {
|
||||
if (std::abs(T - temps_available[0]) <= settings::temperature_tolerance){
|
||||
if (std::find(temps_to_read.begin(), temps_to_read.end(), std::round(temps_available[0])) ==
|
||||
temps_to_read.end()) {
|
||||
temps_to_read.push_back(std::round(temps_available[0]));
|
||||
break;
|
||||
}
|
||||
if (std::abs(T - temps_available[n - 1]) <=
|
||||
settings::temperature_tolerance) {
|
||||
}}
|
||||
else if (std::abs(T - temps_available[n - 1]) <= settings::temperature_tolerance){
|
||||
if (std::find(temps_to_read.begin(), temps_to_read.end(), std::round(temps_available[n - 1])) ==
|
||||
temps_to_read.end()){
|
||||
temps_to_read.push_back(std::round(temps_available[n - 1]));
|
||||
break;
|
||||
}
|
||||
fatal_error(
|
||||
}}
|
||||
else {
|
||||
fatal_error(
|
||||
fmt::format("Nuclear data library does not contain cross "
|
||||
"sections for {} at temperatures that bound {} K.",
|
||||
name_, std::round(T)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue