Angular Distributions

AngleDistribution

class AngleDistribution

Holds all of the angular distributions at all provided energies for a single reaction.

Public Functions

AngleDistribution()
AngleDistribution(const ACE &ace, int locb)
Parameters
  • aceACE file to take data from.

  • locb – Index in the XSS array to start reading angular distribution.

AngleDistribution(const std::vector<double> &energy_grid, const std::vector<std::shared_ptr<AngleLaw>> &laws)
Parameters
  • energy_grid – Incoming energies which has angle laws.

  • laws – Angle laws for each incoming energy.

~AngleDistribution() = default
double sample_angle(double E_in, const std::function<double()> &rng) const

Samples a scattering cosine for the given energy.

Parameters
  • E_in – Incident energy before scatter, in MeV.

  • rng – Random number generator function.

double pdf(double E_in, double mu) const

Evaluates the PDF for having a scattering cosine of mu at incoming energy E_in.

Parameters
  • E_in – Incoming energy.

  • mu – Scattering cosine.

inline std::size_t size() const

Returns the number of energies/angular distributions stored.

inline const std::vector<double> &energy() const

Reference to the vector of energy values (in MeV) which have an angular distribution.

inline double energy(std::size_t i) const

Gets the ith energy point (in MeV) which has an angular distribution.

Parameters

i – Index in the energy grid.

inline const AngleLaw &law(std::size_t i) const

Gets a pointer to the angular distribution for the ith energy point.

Parameters

i – Index in the energy grid.

AngleLaw

class AngleLaw : public std::enable_shared_from_this<AngleLaw>

Interface to represent an angular distribution for a single energy.

Subclassed by pndl::AngleTable, pndl::EquiprobableAngleBins, pndl::Isotropic, pndl::Legendre

Public Functions

virtual ~AngleLaw() = default
virtual double sample_mu(const std::function<double()> &rng) const = 0

Samples a scattering cosine from the distribution.

Parameters
  • xi – Random variable from the interval [0,1).

  • rng – Random number generator function.

virtual double pdf(double mu) const = 0

Returns the PDF for the desired scattering cosine.

Parameters

mu – Scatter cosnine at which to evaluate the PDF.

EquiprobableAngleBins

class EquiprobableAngleBins : public pndl::AngleLaw

Angular distribution represented as equiprobable cosine bins.

Public Functions

EquiprobableAngleBins(const ACE &ace, std::size_t i)
Parameters
  • aceACE file to take data from.

  • i – Starting index of distribution in the XSS array.

EquiprobableAngleBins(const std::vector<double> &bounds)
Parameters

bounds – Vector of 33 bin bounds.

~EquiprobableAngleBins() = default
virtual double sample_mu(const std::function<double()> &rng) const final override

Samples a scattering cosine from the distribution.

Parameters
  • xi – Random variable from the interval [0,1).

  • rng – Random number generator function.

virtual double pdf(double mu) const final override

Returns the PDF for the desired scattering cosine.

Parameters

mu – Scatter cosnine at which to evaluate the PDF.

inline std::size_t size() const

Returns the number of bin boundaries (number of bins + 1);.

inline const std::vector<double> &bin_bounds() const

Returns the vector with the bin boundaries.

AngleTable

class AngleTable : public pndl::AngleLaw

Angular distribution which is provided as tabulated PDF and CDF.

Public Functions

AngleTable(const ACE &ace, std::size_t i)
Parameters
  • aceACE file to take data from.

  • i – Starting index of distribution in the XSS array.

AngleTable(const std::vector<double> &cosines, const std::vector<double> &pdf, const std::vector<double> &cdf, Interpolation interp)
Parameters
  • cosines – Conines of scattering angle which are tabulated.

  • pdf – The Probability Density Function for the provided values.

  • cdf – The Cumulative Density Function for the provided values.

  • interp – Interpolation rule for the data. May be either Histogram or LinLin.

AngleTable(const Legendre &legendre)
Parameters

legendreLegendre distribution which will be linearized to create an AngleTable.

AngleTable(const PCTable &table)
Parameters

tablePCTable contianing the PDF and CDF for the cosine distribution.

~AngleTable() = default
virtual double sample_mu(const std::function<double()> &rng) const final override

Samples a scattering cosine from the distribution.

Parameters
  • xi – Random variable from the interval [0,1).

  • rng – Random number generator function.

inline virtual double pdf(double mu) const final override

Returns the PDF for the desired scattering cosine.

Parameters

mu – Scatter cosnine at which to evaluate the PDF.

inline std::size_t size() const

Returns the number of points in the tabulated data.

inline const std::vector<double> &cosines() const

Returns the vector of the cosine points.

inline const std::vector<double> &pdf() const

Returns the vector of the PDF values.

inline const std::vector<double> &cdf() const

Returns the vector of the CDF values.

inline Interpolation interpolation() const

Returns the type of interpolation used on the table (Histogram or LinLin).

Legendre

class Legendre : public pndl::AngleLaw

Angular distribution represented by a series of Legendre polynomials.

Public Functions

Legendre()

Constructs an isotropic distribution with a 0th order Legendre series.

Legendre(const std::vector<double> &a)

Constructs a Legendre series from coefficients, starting with the 1st order moment.

Parameters

a – Vector containing the Legendre moments, from the 1st order up. These coefficients will be multiplied by (2l + 1)/2.

virtual double sample_mu(const std::function<double()> &rng) const final override

Samples a scattering cosine from the distribution.

Parameters
  • xi – Random variable from the interval [0,1).

  • rng – Random number generator function.

virtual double pdf(double mu) const final override

Returns the PDF for the desired scattering cosine.

Parameters

mu – Scatter cosnine at which to evaluate the PDF.

void set_moment(std::size_t l, double a)

Sets the coefficient for the Legendre moment l.

Parameters
  • lLegendre order to set.

  • a – Coefficient to be used for Legendre order l. Will be multiplied by (2l + 1)/2.

inline const std::vector<double> &coefficients() const

Returns a reference to the vector of all Legendre coefficients.

Isotropic

class Isotropic : public pndl::AngleLaw

Isotropic angular distribution.

Public Functions

inline Isotropic()
~Isotropic() = default
virtual double sample_mu(const std::function<double()> &rng) const final override

Samples a scattering cosine from the distribution.

Parameters
  • xi – Random variable from the interval [0,1).

  • rng – Random number generator function.

virtual double pdf(double mu) const final override

Returns the PDF for the desired scattering cosine.

Parameters

mu – Scatter cosnine at which to evaluate the PDF.