mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Adding checks for minimum number of data points for quadratic/cubic interpolation
This commit is contained in:
parent
84276c54bf
commit
ac043cb67a
1 changed files with 4 additions and 0 deletions
|
|
@ -39,8 +39,12 @@ void EnergyFunctionFilter::from_xml(pugi::xml_node node)
|
|||
} else if (interpolation == "log-log") {
|
||||
interpolation_ = Interpolation::log_log;
|
||||
} else if (interpolation == "quadratic") {
|
||||
if (energy.size() < 3)
|
||||
fatal_error(fmt::format("Quadratic interpolation on EnergyFunctionFilter {} requires at least 3 data points.", id()));
|
||||
interpolation_ = Interpolation::quadratic;
|
||||
} else if (interpolation == "cubic") {
|
||||
if (energy.size() < 4)
|
||||
fatal_error(fmt::format("Cubic interpolation on EnergyFunctionFilter {} requires at least 4 data points.", id()));
|
||||
interpolation_ = Interpolation::cubic;
|
||||
} else {
|
||||
fatal_error(fmt::format(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue