2018-08-08 07:00:48 -05:00
|
|
|
//! \file distribution_angle.h
|
|
|
|
|
//! Angle distribution dependent on incident particle energy
|
|
|
|
|
|
2018-07-09 17:04:48 -05:00
|
|
|
#ifndef OPENMC_DISTRIBUTION_ANGLE_H
|
|
|
|
|
#define OPENMC_DISTRIBUTION_ANGLE_H
|
|
|
|
|
|
|
|
|
|
#include "hdf5.h"
|
|
|
|
|
|
2018-08-20 14:40:32 -05:00
|
|
|
#include "openmc/distribution.h"
|
2021-04-22 16:46:23 -04:00
|
|
|
#include "openmc/vector.h"
|
2018-08-20 14:40:32 -05:00
|
|
|
|
2018-07-09 17:04:48 -05:00
|
|
|
namespace openmc {
|
|
|
|
|
|
2018-08-08 07:00:48 -05:00
|
|
|
//==============================================================================
|
|
|
|
|
//! Angle distribution that depends on incident particle energy
|
|
|
|
|
//==============================================================================
|
|
|
|
|
|
2018-07-09 17:04:48 -05:00
|
|
|
class AngleDistribution {
|
|
|
|
|
public:
|
2018-07-09 23:02:27 -05:00
|
|
|
AngleDistribution() = default;
|
2018-07-09 17:04:48 -05:00
|
|
|
explicit AngleDistribution(hid_t group);
|
2018-08-08 07:00:48 -05:00
|
|
|
|
|
|
|
|
//! Sample an angle given an incident particle energy
|
|
|
|
|
//! \param[in] E Particle energy in [eV]
|
2019-12-05 19:50:31 +00:00
|
|
|
//! \param[inout] seed pseudorandom number seed pointer
|
2018-08-08 07:00:48 -05:00
|
|
|
//! \return Cosine of the angle in the range [-1,1]
|
2019-12-05 19:50:31 +00:00
|
|
|
double sample(double E, uint64_t* seed) const;
|
2018-07-09 23:02:27 -05:00
|
|
|
|
2026-03-14 23:58:17 +02:00
|
|
|
//! Evaluate the angular PDF at a given energy and cosine
|
|
|
|
|
//! \param[in] E Particle energy in [eV]
|
|
|
|
|
//! \param[in] mu Cosine of the scattering angle
|
|
|
|
|
//! \return Probability density for the scattering cosine
|
|
|
|
|
double evaluate(double E, double mu) const;
|
|
|
|
|
|
2018-08-08 07:00:48 -05:00
|
|
|
//! Determine whether angle distribution is empty
|
|
|
|
|
//! \return Whether distribution is empty
|
2018-07-09 23:02:27 -05:00
|
|
|
bool empty() const { return energy_.empty(); }
|
2018-08-08 07:00:48 -05:00
|
|
|
|
2018-07-09 17:04:48 -05:00
|
|
|
private:
|
2021-04-22 16:46:23 -04:00
|
|
|
vector<double> energy_;
|
|
|
|
|
vector<unique_ptr<Tabular>> distribution_;
|
2018-07-09 17:04:48 -05:00
|
|
|
};
|
|
|
|
|
|
2018-08-08 07:00:48 -05:00
|
|
|
} // namespace openmc
|
2018-07-09 17:04:48 -05:00
|
|
|
|
|
|
|
|
#endif // OPENMC_DISTRIBUTION_ANGLE_H
|