mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Apply suggestions from @paulromano
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
2fa63f3302
commit
53d3cd005f
2 changed files with 5 additions and 6 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue