OpenMC/include/openmc/distribution_angle.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.4 KiB
C
Raw Permalink Normal View History

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"
#include "openmc/distribution.h"
#include "openmc/vector.h"
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]
//! \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]
double sample(double E, uint64_t* seed) const;
2018-07-09 23:02:27 -05: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:
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