mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Refactor get_energy_index to prevent repetition (#3686)
This commit is contained in:
parent
a2fd6cc57e
commit
3f06a42abb
6 changed files with 36 additions and 55 deletions
|
|
@ -9,6 +9,7 @@
|
|||
#include <cstdlib>
|
||||
|
||||
#include "openmc/position.h"
|
||||
#include "openmc/search.h"
|
||||
|
||||
namespace openmc {
|
||||
|
||||
|
|
@ -200,5 +201,15 @@ std::complex<double> faddeeva(std::complex<double> z);
|
|||
//! \return Derivative of Faddeeva function evaluated at z
|
||||
std::complex<double> w_derivative(std::complex<double> z, int order);
|
||||
|
||||
//! Helper function to get index and interpolation function on an incident
|
||||
//! energy grid
|
||||
//!
|
||||
//! \param energies energy grid
|
||||
//! \param E incident energy
|
||||
//! \param i grid index
|
||||
//! \param f interpolation factor
|
||||
void get_energy_index(
|
||||
const vector<double>& energies, double E, int& i, double& f);
|
||||
|
||||
} // namespace openmc
|
||||
#endif // OPENMC_MATH_FUNCTIONS_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue