Apply suggestions from @paulromano

Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Patrick Shriwise 2022-09-17 09:46:33 -05:00 committed by GitHub
parent 2fa63f3302
commit 53d3cd005f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 6 deletions

View file

@ -1,4 +1,3 @@
#ifndef OPENMC_INTERPOLATE_H
#define OPENMC_INTERPOLATE_H
@ -18,20 +17,20 @@ inline double interpolate_lin_lin(
inline double interpolate_lin_log(
double x0, double x1, double y0, double y1, double x)
{
return y0 + log(x / x0) / log(x1 / x0) * (y1 - y0);
return y0 + std::log(x / x0) / std::log(x1 / x0) * (y1 - y0);
}
inline double interpolate_log_lin(
double x0, double x1, double y0, double y1, double x)
{
return y0 * exp((x - x0) / (x1 - x0) * log(y1 / y0));
return y0 * std::exp((x - x0) / (x1 - x0) * std::log(y1 / y0));
}
inline double interpolate_log_log(
double x0, double x1, double y0, double y1, double x)
{
double f = log(x / x0) / log(x1 / x0);
return y0 * exp(f * log(y1 / y0));
double f = std::log(x / x0) / std::log(x1 / x0);
return y0 * std::exp(f * std::log(y1 / y0));
}
inline double interpolate_lagrangian(const std::vector<double>& xs,

View file

@ -42,7 +42,7 @@ def model():
filt3 = openmc.EnergyFunctionFilter(x, y)
filt3.interpolation = 'log-log'
filt4 = openmc.EnergyFunctionFilter(x , y)
filt4 = openmc.EnergyFunctionFilter(x, y)
filt4.interpolation = 'linear-log'
filt5 = openmc.EnergyFunctionFilter(x, y)