2018-07-09 23:02:27 -05:00
|
|
|
#ifndef OPENMC_ANGLE_ENERGY_H
|
|
|
|
|
#define OPENMC_ANGLE_ENERGY_H
|
|
|
|
|
|
2019-11-22 15:13:09 +00:00
|
|
|
#include <cstdint>
|
|
|
|
|
|
2018-07-09 23:02:27 -05:00
|
|
|
namespace openmc {
|
|
|
|
|
|
2018-08-08 07:00:48 -05:00
|
|
|
//==============================================================================
|
|
|
|
|
//! Abstract type that defines a correlated or uncorrelated angle-energy
|
|
|
|
|
//! distribution that is a function of incoming energy. Each derived type must
|
|
|
|
|
//! implement a sample() method that returns an outgoing energy and
|
|
|
|
|
//! scattering cosine given an incoming energy.
|
|
|
|
|
//==============================================================================
|
|
|
|
|
|
2018-07-09 23:02:27 -05:00
|
|
|
class AngleEnergy {
|
|
|
|
|
public:
|
2026-03-14 23:58:17 +02:00
|
|
|
//! Sample an outgoing energy and scattering cosine
|
|
|
|
|
//! \param[in] E_in Incoming energy in [eV]
|
|
|
|
|
//! \param[out] E_out Outgoing energy in [eV]
|
|
|
|
|
//! \param[out] mu Outgoing cosine with respect to current direction
|
|
|
|
|
//! \param[inout] seed Pseudorandom seed pointer
|
2019-12-04 16:35:01 +00:00
|
|
|
virtual void sample(
|
|
|
|
|
double E_in, double& E_out, double& mu, uint64_t* seed) const = 0;
|
2026-03-14 23:58:17 +02:00
|
|
|
|
|
|
|
|
//! Sample an outgoing energy and evaluate the angular PDF
|
|
|
|
|
//! \param[in] E_in Incoming energy in [eV]
|
|
|
|
|
//! \param[in] mu Scattering cosine with respect to current direction
|
|
|
|
|
//! \param[out] E_out Outgoing energy in [eV]
|
|
|
|
|
//! \param[inout] seed Pseudorandom seed pointer
|
|
|
|
|
//! \return Probability density for the scattering cosine
|
|
|
|
|
virtual double sample_energy_and_pdf(
|
|
|
|
|
double E_in, double mu, double& E_out, uint64_t* seed) const = 0;
|
2018-07-09 23:02:27 -05:00
|
|
|
virtual ~AngleEnergy() = default;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace openmc
|
|
|
|
|
|
|
|
|
|
#endif // OPENMC_ANGLE_ENERGY_H
|