mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-29 06:35:48 -04:00
refactor seed and seed aray variable names
This commit is contained in:
parent
428bab4fd2
commit
0602ddd8a3
46 changed files with 336 additions and 336 deletions
|
|
@ -15,7 +15,7 @@ namespace openmc {
|
|||
class AngleEnergy {
|
||||
public:
|
||||
virtual void sample(double E_in, double& E_out, double& mu,
|
||||
uint64_t* prn_seed) const = 0;
|
||||
uint64_t* seed) const = 0;
|
||||
virtual ~AngleEnergy() = default;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ namespace openmc {
|
|||
class Distribution {
|
||||
public:
|
||||
virtual ~Distribution() = default;
|
||||
virtual double sample(uint64_t* prn_seed) const = 0;
|
||||
virtual double sample(uint64_t* seed) const = 0;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -34,9 +34,9 @@ public:
|
|||
Discrete(const double* x, const double* p, int n);
|
||||
|
||||
//! Sample a value from the distribution
|
||||
//! \param prn_seed Pseudorandom number seed pointer
|
||||
//! \param seed Pseudorandom number seed pointer
|
||||
//! \return Sampled value
|
||||
double sample(uint64_t* prn_seed) const;
|
||||
double sample(uint64_t* seed) const;
|
||||
|
||||
// Properties
|
||||
const std::vector<double>& x() const { return x_; }
|
||||
|
|
@ -59,9 +59,9 @@ public:
|
|||
Uniform(double a, double b) : a_{a}, b_{b} {};
|
||||
|
||||
//! Sample a value from the distribution
|
||||
//! \param prn_seed Pseudorandom number seed pointer
|
||||
//! \param seed Pseudorandom number seed pointer
|
||||
//! \return Sampled value
|
||||
double sample(uint64_t* prn_seed) const;
|
||||
double sample(uint64_t* seed) const;
|
||||
private:
|
||||
double a_; //!< Lower bound of distribution
|
||||
double b_; //!< Upper bound of distribution
|
||||
|
|
@ -77,9 +77,9 @@ public:
|
|||
Maxwell(double theta) : theta_{theta} { };
|
||||
|
||||
//! Sample a value from the distribution
|
||||
//! \param prn_seed Pseudorandom number seed pointer
|
||||
//! \param seed Pseudorandom number seed pointer
|
||||
//! \return Sampled value
|
||||
double sample(uint64_t* prn_seed) const;
|
||||
double sample(uint64_t* seed) const;
|
||||
private:
|
||||
double theta_; //!< Factor in exponential [eV]
|
||||
};
|
||||
|
|
@ -94,9 +94,9 @@ public:
|
|||
Watt(double a, double b) : a_{a}, b_{b} { };
|
||||
|
||||
//! Sample a value from the distribution
|
||||
//! \param prn_seed Pseudorandom number seed pointer
|
||||
//! \param seed Pseudorandom number seed pointer
|
||||
//! \return Sampled value
|
||||
double sample(uint64_t* prn_seed) const;
|
||||
double sample(uint64_t* seed) const;
|
||||
private:
|
||||
double a_; //!< Factor in exponential [eV]
|
||||
double b_; //!< Factor in square root [1/eV]
|
||||
|
|
@ -112,9 +112,9 @@ public:
|
|||
Normal(double mean_value, double std_dev) : mean_value_{mean_value}, std_dev_{std_dev} { };
|
||||
|
||||
//! Sample a value from the distribution
|
||||
//! \param prn_seed Pseudorandom number seed pointer
|
||||
//! \param seed Pseudorandom number seed pointer
|
||||
//! \return Sampled value
|
||||
double sample(uint64_t* prn_seed) const;
|
||||
double sample(uint64_t* seed) const;
|
||||
private:
|
||||
double mean_value_; //!< middle of distribution [eV]
|
||||
double std_dev_; //!< standard deviation [eV]
|
||||
|
|
@ -131,9 +131,9 @@ public:
|
|||
Muir(double e0, double m_rat, double kt) : e0_{e0}, m_rat_{m_rat}, kt_{kt} { };
|
||||
|
||||
//! Sample a value from the distribution
|
||||
//! \param prn_seed Pseudorandom number seed pointer
|
||||
//! \param seed Pseudorandom number seed pointer
|
||||
//! \return Sampled value
|
||||
double sample(uint64_t* prn_seed) const;
|
||||
double sample(uint64_t* seed) const;
|
||||
private:
|
||||
// example DT fusion m_rat = 5 (D = 2 + T = 3)
|
||||
// ion temp = 20000 eV
|
||||
|
|
@ -154,9 +154,9 @@ public:
|
|||
const double* c=nullptr);
|
||||
|
||||
//! Sample a value from the distribution
|
||||
//! \param prn_seed Pseudorandom number seed pointer
|
||||
//! \param seed Pseudorandom number seed pointer
|
||||
//! \return Sampled value
|
||||
double sample(uint64_t* prn_seed) const;
|
||||
double sample(uint64_t* seed) const;
|
||||
|
||||
// x property
|
||||
std::vector<double>& x() { return x_; }
|
||||
|
|
@ -185,9 +185,9 @@ public:
|
|||
Equiprobable(const double* x, int n) : x_{x, x+n} { };
|
||||
|
||||
//! Sample a value from the distribution
|
||||
//! \param prn_seed Pseudorandom number seed pointer
|
||||
//! \param seed Pseudorandom number seed pointer
|
||||
//! \return Sampled value
|
||||
double sample(uint64_t* prn_seed) const;
|
||||
double sample(uint64_t* seed) const;
|
||||
private:
|
||||
std::vector<double> x_; //! Possible outcomes
|
||||
};
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ public:
|
|||
|
||||
//! Sample an angle given an incident particle energy
|
||||
//! \param[in] E Particle energy in [eV]
|
||||
//! \param[inout] prn_seed pseudorandom number seed pointer
|
||||
//! \param[inout] seed pseudorandom number seed pointer
|
||||
//! \return Cosine of the angle in the range [-1,1]
|
||||
double sample(double E, uint64_t* prn_seed) const;
|
||||
double sample(double E, uint64_t* seed) const;
|
||||
|
||||
//! Determine whether angle distribution is empty
|
||||
//! \return Whether distribution is empty
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace openmc {
|
|||
|
||||
class EnergyDistribution {
|
||||
public:
|
||||
virtual double sample(double E, uint64_t* prn_seed) const = 0;
|
||||
virtual double sample(double E, uint64_t* seed) const = 0;
|
||||
virtual ~EnergyDistribution() = default;
|
||||
};
|
||||
|
||||
|
|
@ -36,9 +36,9 @@ public:
|
|||
|
||||
//! Sample energy distribution
|
||||
//! \param[in] E Incident particle energy in [eV]
|
||||
//! \param[inout] prn_seed Pseudorandom number seed pointer
|
||||
//! \param[inout] seed Pseudorandom number seed pointer
|
||||
//! \return Sampled energy in [eV]
|
||||
double sample(double E, uint64_t* prn_seed) const;
|
||||
double sample(double E, uint64_t* seed) const;
|
||||
private:
|
||||
int primary_flag_; //!< Indicator of whether the photon is a primary or
|
||||
//!< non-primary photon.
|
||||
|
|
@ -56,9 +56,9 @@ public:
|
|||
|
||||
//! Sample energy distribution
|
||||
//! \param[in] E Incident particle energy in [eV]
|
||||
//! \param[inout] prn_seed Pseudorandom number seed pointer
|
||||
//! \param[inout] seed Pseudorandom number seed pointer
|
||||
//! \return Sampled energy in [eV]
|
||||
double sample(double E, uint64_t* prn_seed) const;
|
||||
double sample(double E, uint64_t* seed) const;
|
||||
private:
|
||||
double threshold_; //!< Energy threshold in lab, (A + 1)/A * |Q|
|
||||
double mass_ratio_; //!< (A/(A+1))^2
|
||||
|
|
@ -76,9 +76,9 @@ public:
|
|||
|
||||
//! Sample energy distribution
|
||||
//! \param[in] E Incident particle energy in [eV]
|
||||
//! \param[inout] prn_seed Pseudorandom number seed pointer
|
||||
//! \param[inout] seed Pseudorandom number seed pointer
|
||||
//! \return Sampled energy in [eV]
|
||||
double sample(double E, uint64_t* prn_seed) const;
|
||||
double sample(double E, uint64_t* seed) const;
|
||||
private:
|
||||
//! Outgoing energy for a single incoming energy
|
||||
struct CTTable {
|
||||
|
|
@ -106,9 +106,9 @@ public:
|
|||
|
||||
//! Sample energy distribution
|
||||
//! \param[in] E Incident particle energy in [eV]
|
||||
//! \param[inout] prn_seed Pseudorandom number seed pointer
|
||||
//! \param[inout] seed Pseudorandom number seed pointer
|
||||
//! \return Sampled energy in [eV]
|
||||
double sample(double E, uint64_t* prn_seed) const;
|
||||
double sample(double E, uint64_t* seed) const;
|
||||
private:
|
||||
Tabulated1D theta_; //!< Incoming energy dependent parameter
|
||||
double u_; //!< Restriction energy
|
||||
|
|
@ -125,9 +125,9 @@ public:
|
|||
|
||||
//! Sample energy distribution
|
||||
//! \param[in] E Incident particle energy in [eV]
|
||||
//! \param[inout] prn_seed Pseudorandom number seed pointer
|
||||
//! \param[inout] seed Pseudorandom number seed pointer
|
||||
//! \return Sampled energy in [eV]
|
||||
double sample(double E, uint64_t* prn_seed) const;
|
||||
double sample(double E, uint64_t* seed) const;
|
||||
private:
|
||||
Tabulated1D theta_; //!< Incoming energy dependent parameter
|
||||
double u_; //!< Restriction energy
|
||||
|
|
@ -144,9 +144,9 @@ public:
|
|||
|
||||
//! Sample energy distribution
|
||||
//! \param[in] E Incident particle energy in [eV]
|
||||
//! \param[inout] prn_seed Pseudorandom number seed pointer
|
||||
//! \param[inout] seed Pseudorandom number seed pointer
|
||||
//! \return Sampled energy in [eV]
|
||||
double sample(double E, uint64_t* prn_seed) const;
|
||||
double sample(double E, uint64_t* seed) const;
|
||||
private:
|
||||
Tabulated1D a_; //!< Energy-dependent 'a' parameter
|
||||
Tabulated1D b_; //!< Energy-dependent 'b' parameter
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ public:
|
|||
virtual ~UnitSphereDistribution() = default;
|
||||
|
||||
//! Sample a direction from the distribution
|
||||
//! \param prn_seed Pseudorandom number seed pointer
|
||||
//! \param seed Pseudorandom number seed pointer
|
||||
//! \return Direction sampled
|
||||
virtual Direction sample(uint64_t* prn_seed) const = 0;
|
||||
virtual Direction sample(uint64_t* seed) const = 0;
|
||||
|
||||
Direction u_ref_ {0.0, 0.0, 1.0}; //!< reference direction
|
||||
};
|
||||
|
|
@ -40,9 +40,9 @@ public:
|
|||
explicit PolarAzimuthal(pugi::xml_node node);
|
||||
|
||||
//! Sample a direction from the distribution
|
||||
//! \param prn_seed Pseudorandom number seed pointer
|
||||
//! \param seed Pseudorandom number seed pointer
|
||||
//! \return Direction sampled
|
||||
Direction sample(uint64_t* prn_seed) const;
|
||||
Direction sample(uint64_t* seed) const;
|
||||
private:
|
||||
UPtrDist mu_; //!< Distribution of polar angle
|
||||
UPtrDist phi_; //!< Distribution of azimuthal angle
|
||||
|
|
@ -57,9 +57,9 @@ public:
|
|||
Isotropic() { };
|
||||
|
||||
//! Sample a direction from the distribution
|
||||
//! \param prn_seed Pseudorandom number seed pointer
|
||||
//! \param seed Pseudorandom number seed pointer
|
||||
//! \return Sampled direction
|
||||
Direction sample(uint64_t* prn_seed) const;
|
||||
Direction sample(uint64_t* seed) const;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -72,9 +72,9 @@ public:
|
|||
explicit Monodirectional(pugi::xml_node node) : UnitSphereDistribution{node} { };
|
||||
|
||||
//! Sample a direction from the distribution
|
||||
//! \param prn_seed Pseudorandom number seed pointer
|
||||
//! \param seed Pseudorandom number seed pointer
|
||||
//! \return Sampled direction
|
||||
Direction sample(uint64_t* prn_seed) const;
|
||||
Direction sample(uint64_t* seed) const;
|
||||
};
|
||||
|
||||
using UPtrAngle = std::unique_ptr<UnitSphereDistribution>;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public:
|
|||
virtual ~SpatialDistribution() = default;
|
||||
|
||||
//! Sample a position from the distribution
|
||||
virtual Position sample(uint64_t* prn_seed) const = 0;
|
||||
virtual Position sample(uint64_t* seed) const = 0;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -29,9 +29,9 @@ public:
|
|||
explicit CartesianIndependent(pugi::xml_node node);
|
||||
|
||||
//! Sample a position from the distribution
|
||||
//! \param prn_seed Pseudorandom number seed pointer
|
||||
//! \param seed Pseudorandom number seed pointer
|
||||
//! \return Sampled position
|
||||
Position sample(uint64_t* prn_seed) const;
|
||||
Position sample(uint64_t* seed) const;
|
||||
private:
|
||||
UPtrDist x_; //!< Distribution of x coordinates
|
||||
UPtrDist y_; //!< Distribution of y coordinates
|
||||
|
|
@ -47,9 +47,9 @@ public:
|
|||
explicit SphericalIndependent(pugi::xml_node node);
|
||||
|
||||
//! Sample a position from the distribution
|
||||
//! \param prn_seed Pseudorandom number seed pointer
|
||||
//! \param seed Pseudorandom number seed pointer
|
||||
//! \return Sampled position
|
||||
Position sample(uint64_t* prn_seed) const;
|
||||
Position sample(uint64_t* seed) const;
|
||||
private:
|
||||
UPtrDist r_; //!< Distribution of r coordinates
|
||||
UPtrDist theta_; //!< Distribution of theta coordinates
|
||||
|
|
@ -66,9 +66,9 @@ public:
|
|||
explicit SpatialBox(pugi::xml_node node, bool fission=false);
|
||||
|
||||
//! Sample a position from the distribution
|
||||
//! \param prn_seed Pseudorandom number seed pointer
|
||||
//! \param seed Pseudorandom number seed pointer
|
||||
//! \return Sampled position
|
||||
Position sample(uint64_t* prn_seed) const;
|
||||
Position sample(uint64_t* seed) const;
|
||||
|
||||
// Properties
|
||||
bool only_fissionable() const { return only_fissionable_; }
|
||||
|
|
@ -89,9 +89,9 @@ public:
|
|||
explicit SpatialPoint(pugi::xml_node node);
|
||||
|
||||
//! Sample a position from the distribution
|
||||
//! \param prn_seed Pseudorandom number seed pointer
|
||||
//! \param seed Pseudorandom number seed pointer
|
||||
//! \return Sampled position
|
||||
Position sample(uint64_t* prn_seed) const;
|
||||
Position sample(uint64_t* seed) const;
|
||||
private:
|
||||
Position r_; //!< Single position at which sites are generated
|
||||
};
|
||||
|
|
|
|||
|
|
@ -129,14 +129,14 @@ extern "C" void calc_zn_rad(int n, double rho, double zn_rad[]);
|
|||
//! \param mu The cosine of angle in lab or CM
|
||||
//! \param phi The azimuthal angle; will randomly chosen angle if a nullptr
|
||||
//! is passed
|
||||
//! \param prn_seed A pointer to the pseudorandom seed
|
||||
//! \param seed A pointer to the pseudorandom seed
|
||||
//==============================================================================
|
||||
|
||||
extern "C" void rotate_angle_c(double uvw[3], double mu, const double* phi,
|
||||
uint64_t* prn_seed);
|
||||
uint64_t* seed);
|
||||
|
||||
Direction rotate_angle(Direction u, double mu, const double* phi,
|
||||
uint64_t* prn_seed);
|
||||
uint64_t* seed);
|
||||
|
||||
//==============================================================================
|
||||
//! Samples an energy from the Maxwell fission distribution based on a direct
|
||||
|
|
@ -147,11 +147,11 @@ Direction rotate_angle(Direction u, double mu, const double* phi,
|
|||
//! rule C64 in the Monte Carlo Sampler LA-9721-MS.
|
||||
//!
|
||||
//! \param T The tabulated function of the incoming energy
|
||||
//! \param prn_seed A pointer to the pseudorandom seed
|
||||
//! \param seed A pointer to the pseudorandom seed
|
||||
//! \return The sampled outgoing energy
|
||||
//==============================================================================
|
||||
|
||||
extern "C" double maxwell_spectrum(double T, uint64_t* prn_seed);
|
||||
extern "C" double maxwell_spectrum(double T, uint64_t* seed);
|
||||
|
||||
//==============================================================================
|
||||
//! Samples an energy from a Watt energy-dependent fission distribution.
|
||||
|
|
@ -163,11 +163,11 @@ extern "C" double maxwell_spectrum(double T, uint64_t* prn_seed);
|
|||
//!
|
||||
//! \param a Watt parameter a
|
||||
//! \param b Watt parameter b
|
||||
//! \param prn_seed A pointer to the pseudorandom seed
|
||||
//! \param seed A pointer to the pseudorandom seed
|
||||
//! \return The sampled outgoing energy
|
||||
//==============================================================================
|
||||
|
||||
extern "C" double watt_spectrum(double a, double b, uint64_t* prn_seed);
|
||||
extern "C" double watt_spectrum(double a, double b, uint64_t* seed);
|
||||
|
||||
//==============================================================================
|
||||
//! Samples an energy from the Gaussian energy-dependent fission distribution.
|
||||
|
|
@ -180,11 +180,11 @@ extern "C" double watt_spectrum(double a, double b, uint64_t* prn_seed);
|
|||
//!
|
||||
//! @param mean mean of the Gaussian distribution
|
||||
//! @param std_dev standard deviation of the Gaussian distribution
|
||||
//! @param prn_seed A pointer to the pseudorandom seed
|
||||
//! @param seed A pointer to the pseudorandom seed
|
||||
//! @result The sampled outgoing energy
|
||||
//==============================================================================
|
||||
|
||||
extern "C" double normal_variate(double mean, double std_dev, uint64_t* prn_seed);
|
||||
extern "C" double normal_variate(double mean, double std_dev, uint64_t* seed);
|
||||
|
||||
//==============================================================================
|
||||
//! Samples an energy from the Muir (Gaussian) energy-dependent distribution.
|
||||
|
|
@ -196,12 +196,12 @@ extern "C" double normal_variate(double mean, double std_dev, uint64_t* prn_seed
|
|||
//! @param e0 peak neutron energy [eV]
|
||||
//! @param m_rat ratio of the fusion reactants to AMU
|
||||
//! @param kt the ion temperature of the reactants [eV]
|
||||
//! @param prn_seed A pointer to the pseudorandom seed
|
||||
//! @param seed A pointer to the pseudorandom seed
|
||||
//! @result The sampled outgoing energy
|
||||
//==============================================================================
|
||||
|
||||
extern "C" double muir_spectrum(double e0, double m_rat, double kt,
|
||||
uint64_t* prn_seed);
|
||||
uint64_t* seed);
|
||||
|
||||
//==============================================================================
|
||||
//! Doppler broadens the windowed multipole curvefit.
|
||||
|
|
|
|||
|
|
@ -154,9 +154,9 @@ class Mgxs {
|
|||
//! @param gin Incoming energy group.
|
||||
//! @param dg Sampled delayed group index.
|
||||
//! @param gout Sampled outgoing energy group.
|
||||
//! @param prn_seed Pseudorandom seed pointer
|
||||
//! @param seed Pseudorandom seed pointer
|
||||
void
|
||||
sample_fission_energy(int gin, int& dg, int& gout, uint64_t* prn_seed);
|
||||
sample_fission_energy(int gin, int& dg, int& gout, uint64_t* seed);
|
||||
|
||||
//! \brief Samples the outgoing energy and angle from a scatter event.
|
||||
//!
|
||||
|
|
@ -164,9 +164,9 @@ class Mgxs {
|
|||
//! @param gout Sampled outgoing energy group.
|
||||
//! @param mu Sampled cosine of the change-in-angle.
|
||||
//! @param wgt Weight of the particle to be adjusted.
|
||||
//! @param prn_seed Pseudorandom seed pointer.
|
||||
//! @param seed Pseudorandom seed pointer.
|
||||
void
|
||||
sample_scatter(int gin, int& gout, double& mu, double& wgt, uint64_t* prn_seed);
|
||||
sample_scatter(int gin, int& gout, double& mu, double& wgt, uint64_t* seed);
|
||||
|
||||
//! \brief Calculates cross section quantities needed for tracking.
|
||||
//!
|
||||
|
|
|
|||
|
|
@ -292,8 +292,8 @@ public:
|
|||
bool write_track_ {false};
|
||||
|
||||
// Current PRNG state
|
||||
uint64_t prn_seeds_[N_STREAMS]; // current seeds
|
||||
int stream_; // current RNG stream
|
||||
uint64_t seeds_[N_STREAMS]; // current seeds
|
||||
int stream_; // current RNG stream
|
||||
};
|
||||
|
||||
} // namespace openmc
|
||||
|
|
|
|||
|
|
@ -45,12 +45,12 @@ public:
|
|||
void calculate_xs(Particle& p) const;
|
||||
|
||||
void compton_scatter(double alpha, bool doppler, double* alpha_out,
|
||||
double* mu, int* i_shell, uint64_t* prn_seed) const;
|
||||
double* mu, int* i_shell, uint64_t* seed) const;
|
||||
|
||||
double rayleigh_scatter(double alpha, uint64_t* prn_seed) const;
|
||||
double rayleigh_scatter(double alpha, uint64_t* seed) const;
|
||||
|
||||
void pair_production(double alpha, double* E_electron, double* E_positron,
|
||||
double* mu_electron, double* mu_positron, uint64_t* prn_seed) const;
|
||||
double* mu_electron, double* mu_positron, uint64_t* seed) const;
|
||||
|
||||
void atomic_relaxation(const ElectronSubshell& shell, Particle& p) const;
|
||||
|
||||
|
|
@ -97,14 +97,14 @@ public:
|
|||
|
||||
private:
|
||||
void compton_doppler(double alpha, double mu, double* E_out, int* i_shell,
|
||||
uint64_t* prn_seed) const;
|
||||
uint64_t* seed) const;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
// Non-member functions
|
||||
//==============================================================================
|
||||
|
||||
std::pair<double, double> klein_nishina(double alpha, uint64_t* prn_seed);
|
||||
std::pair<double, double> klein_nishina(double alpha, uint64_t* seed);
|
||||
|
||||
void free_memory_photon();
|
||||
|
||||
|
|
|
|||
|
|
@ -72,17 +72,17 @@ void sab_scatter(int i_nuclide, int i_sab, Particle* p);
|
|||
//! dependence of cross sections in treating resonance elastic scattering such
|
||||
//! as the DBRC and a new, accelerated scheme are also implemented here.
|
||||
Direction sample_target_velocity(const Nuclide* nuc, double E, Direction u,
|
||||
Direction v_neut, double xs_eff, double kT, uint64_t* prn_seed);
|
||||
Direction v_neut, double xs_eff, double kT, uint64_t* seed);
|
||||
|
||||
//! samples a target velocity based on the free gas scattering formulation, used
|
||||
//! by most Monte Carlo codes, in which cross section is assumed to be constant
|
||||
//! in energy. Excellent documentation for this method can be found in
|
||||
//! FRA-TM-123.
|
||||
Direction sample_cxs_target_velocity(double awr, double E, Direction u, double kT,
|
||||
uint64_t* prn_seed);
|
||||
uint64_t* seed);
|
||||
|
||||
void sample_fission_neutron(int i_nuclide, const Reaction* rx, double E_in,
|
||||
Particle::Bank* site, uint64_t* prn_seed);
|
||||
Particle::Bank* site, uint64_t* seed);
|
||||
|
||||
//! handles all reactions with a single secondary neutron (other than fission),
|
||||
//! i.e. level scattering, (n,np), (n,na), etc.
|
||||
|
|
|
|||
|
|
@ -21,11 +21,11 @@ constexpr int64_t DEFAULT_SEED {1};
|
|||
|
||||
//==============================================================================
|
||||
//! Generate a pseudo-random number using a linear congruential generator.
|
||||
//! @param prn_seed Pseudorandom number seed pointer
|
||||
//! @param seed Pseudorandom number seed pointer
|
||||
//! @return A random number between 0 and 1
|
||||
//==============================================================================
|
||||
|
||||
double prn(uint64_t* prn_seed);
|
||||
double prn(uint64_t* seed);
|
||||
|
||||
//==============================================================================
|
||||
//! Generate a random number which is 'n' times ahead from the current seed.
|
||||
|
|
@ -34,11 +34,11 @@ double prn(uint64_t* prn_seed);
|
|||
//! `prn()` 'n' times, though without the side effect of altering the RNG
|
||||
//! state.
|
||||
//! @param n The number of RNG seeds to skip ahead by
|
||||
//! @param prn_seed Pseudorandom number seed
|
||||
//! @param seed Pseudorandom number seed
|
||||
//! @return A random number between 0 and 1
|
||||
//==============================================================================
|
||||
|
||||
double future_prn(int64_t n, uint64_t prn_seed);
|
||||
double future_prn(int64_t n, uint64_t seed);
|
||||
|
||||
//==============================================================================
|
||||
//! Set a RNG seed to a unique value based on a unique particle ID by striding
|
||||
|
|
@ -55,21 +55,21 @@ uint64_t init_seed(int64_t id, int offset);
|
|||
//! Set the RNG seeds to unique values based on the ID of the particle. This
|
||||
//! function initializes the seeds for all RNG streams of the particle via
|
||||
//! striding.
|
||||
//! @param prn_seeds Pseudorandom number seed array
|
||||
//! @param seeds Pseudorandom number seed array
|
||||
//! @param id The particle ID
|
||||
//==============================================================================
|
||||
|
||||
void init_particle_seeds(int64_t id, uint64_t* prn_seeds);
|
||||
void init_particle_seeds(int64_t id, uint64_t* seeds);
|
||||
|
||||
//==============================================================================
|
||||
//! Advance the random number seed 'n' times from the current seed. This
|
||||
//! differs from the future_prn() function in that this function does alter
|
||||
//! the RNG state.
|
||||
//! @param prn_seed Pseudorandom number seed pointer
|
||||
//! @param seed Pseudorandom number seed pointer
|
||||
//! @param n The number of RNG seeds to skip ahead by
|
||||
//==============================================================================
|
||||
|
||||
void advance_prn_seed(int64_t n, uint64_t* prn_seed);
|
||||
void advance_prn_seed(int64_t n, uint64_t* seed);
|
||||
|
||||
//==============================================================================
|
||||
//! Advance a random number seed 'n' times.
|
||||
|
|
@ -81,7 +81,7 @@ void advance_prn_seed(int64_t n, uint64_t* prn_seed);
|
|||
//! @param seed The starting to seed to advance from
|
||||
//==============================================================================
|
||||
|
||||
uint64_t future_seed(uint64_t n, uint64_t prn_seed);
|
||||
uint64_t future_seed(uint64_t n, uint64_t seed);
|
||||
|
||||
//==============================================================================
|
||||
// API FUNCTIONS
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ public:
|
|||
//! \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] prn_seed Pseudorandom seed pointer
|
||||
void sample(double E_in, double& E_out, double& mu, uint64_t* prn_seed) const;
|
||||
//! \param[inout] seed Pseudorandom seed pointer
|
||||
void sample(double E_in, double& E_out, double& mu, uint64_t* seed) const;
|
||||
|
||||
Particle::Type particle_; //!< Particle type
|
||||
EmissionMode emission_mode_; //!< Emission mode
|
||||
|
|
|
|||
|
|
@ -65,9 +65,9 @@ class ScattData {
|
|||
//! @param gout Sampled outgoing energy group.
|
||||
//! @param mu Sampled cosine of the change-in-angle.
|
||||
//! @param wgt Weight of the particle to be adjusted.
|
||||
//! @param prn_seed Pseudorandom number seed pointer
|
||||
//! @param seed Pseudorandom number seed pointer
|
||||
virtual void
|
||||
sample(int gin, int& gout, double& mu, double& wgt, uint64_t* prn_seed) = 0;
|
||||
sample(int gin, int& gout, double& mu, double& wgt, uint64_t* seed) = 0;
|
||||
|
||||
//! \brief Initializes the ScattData object from a given scatter and
|
||||
//! multiplicity matrix.
|
||||
|
|
@ -110,9 +110,9 @@ class ScattData {
|
|||
//! @param gin Incoming energy group.
|
||||
//! @param gout Sampled outgoing energy group.
|
||||
//! @param i_gout Sampled outgoing energy group index.
|
||||
//! @param prn_seed Pseudorandom number seed pointer
|
||||
//! @param seed Pseudorandom number seed pointer
|
||||
void
|
||||
sample_energy(int gin, int& gout, int& i_gout, uint64_t* prn_seed);
|
||||
sample_energy(int gin, int& gout, int& i_gout, uint64_t* seed);
|
||||
|
||||
//! \brief Provides a cross section value given certain parameters
|
||||
//!
|
||||
|
|
@ -163,7 +163,7 @@ class ScattDataLegendre: public ScattData {
|
|||
calc_f(int gin, int gout, double mu);
|
||||
|
||||
void
|
||||
sample(int gin, int& gout, double& mu, double& wgt, uint64_t* prn_seed);
|
||||
sample(int gin, int& gout, double& mu, double& wgt, uint64_t* seed);
|
||||
|
||||
size_t
|
||||
get_order() {return dist[0][0].size() - 1;};
|
||||
|
|
@ -199,7 +199,7 @@ class ScattDataHistogram: public ScattData {
|
|||
calc_f(int gin, int gout, double mu);
|
||||
|
||||
void
|
||||
sample(int gin, int& gout, double& mu, double& wgt, uint64_t* prn_seed);
|
||||
sample(int gin, int& gout, double& mu, double& wgt, uint64_t* seed);
|
||||
|
||||
size_t
|
||||
get_order() {return dist[0][0].size();};
|
||||
|
|
@ -240,7 +240,7 @@ class ScattDataTabular: public ScattData {
|
|||
calc_f(int gin, int gout, double mu);
|
||||
|
||||
void
|
||||
sample(int gin, int& gout, double& mu, double& wgt, uint64_t* prn_seed);
|
||||
sample(int gin, int& gout, double& mu, double& wgt, uint64_t* seed);
|
||||
|
||||
size_t
|
||||
get_order() {return dist[0][0].size();};
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ public:
|
|||
//! \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] prn_seed Pseudorandom seed pointer
|
||||
//! \param[inout] seed Pseudorandom seed pointer
|
||||
void sample(double E_in, double& E_out, double& mu,
|
||||
uint64_t* prn_seed) const override;
|
||||
uint64_t* seed) const override;
|
||||
|
||||
// energy property
|
||||
std::vector<double>& energy() { return energy_; }
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ public:
|
|||
//! \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] prn_seed Pseudorandom seed pointer
|
||||
//! \param[inout] seed Pseudorandom seed pointer
|
||||
void sample(double E_in, double& E_out, double& mu,
|
||||
uint64_t* prn_seed) const override;
|
||||
uint64_t* seed) const override;
|
||||
private:
|
||||
//! Outgoing energy/angle at a single incoming energy
|
||||
struct KMTable {
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ public:
|
|||
//! \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] prn_seed Pseudorandom seed pointer
|
||||
//! \param[inout] seed Pseudorandom seed pointer
|
||||
void sample(double E_in, double& E_out, double& mu,
|
||||
uint64_t* prn_seed) const override;
|
||||
uint64_t* seed) const override;
|
||||
private:
|
||||
int n_bodies_; //!< Number of particles distributed
|
||||
double mass_ratio_; //!< Total mass of particles [neutron mass]
|
||||
|
|
|
|||
|
|
@ -31,9 +31,9 @@ public:
|
|||
//! \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] prn_seed Pseudorandom seed pointer
|
||||
//! \param[inout] seed Pseudorandom seed pointer
|
||||
void sample(double E_in, double& E_out, double& mu,
|
||||
uint64_t* prn_seed) const override;
|
||||
uint64_t* seed) const override;
|
||||
private:
|
||||
const CoherentElasticXS& xs_; //!< Coherent elastic scattering cross section
|
||||
};
|
||||
|
|
@ -53,9 +53,9 @@ public:
|
|||
//! \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] prn_seed Pseudorandom number seed pointer
|
||||
//! \param[inout] seed Pseudorandom number seed pointer
|
||||
void sample(double E_in, double& E_out, double& mu,
|
||||
uint64_t* prn_seed) const override;
|
||||
uint64_t* seed) const override;
|
||||
private:
|
||||
double debye_waller_;
|
||||
};
|
||||
|
|
@ -76,9 +76,9 @@ public:
|
|||
//! \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] prn_seed Pseudorandom number seed pointer
|
||||
//! \param[inout] seed Pseudorandom number seed pointer
|
||||
void sample(double E_in, double& E_out, double& mu,
|
||||
uint64_t* prn_seed) const override;
|
||||
uint64_t* seed) const override;
|
||||
private:
|
||||
const std::vector<double>& energy_; //!< Energies at which cosines are tabulated
|
||||
xt::xtensor<double, 2> mu_out_; //!< Cosines for each incident energy
|
||||
|
|
@ -100,9 +100,9 @@ public:
|
|||
//! \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] prn_seed Pseudorandom number seed pointer
|
||||
//! \param[inout] seed Pseudorandom number seed pointer
|
||||
void sample(double E_in, double& E_out, double& mu,
|
||||
uint64_t* prn_seed) const override;
|
||||
uint64_t* seed) const override;
|
||||
private:
|
||||
const std::vector<double>& energy_; //!< Incident energies
|
||||
xt::xtensor<double, 2> energy_out_; //!< Outgoing energies for each incident energy
|
||||
|
|
@ -125,9 +125,9 @@ public:
|
|||
//! \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] prn_seed Pseudorandom number seed pointer
|
||||
//! \param[inout] seed Pseudorandom number seed pointer
|
||||
void sample(double E_in, double& E_out, double& mu,
|
||||
uint64_t* prn_seed) const override;
|
||||
uint64_t* seed) const override;
|
||||
private:
|
||||
//! Secondary energy/angle distribution
|
||||
struct DistEnergySab {
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ public:
|
|||
//! \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] prn_seed Pseudorandom seed pointer
|
||||
//! \param[inout] seed Pseudorandom seed pointer
|
||||
void sample(double E_in, double& E_out, double& mu,
|
||||
uint64_t* prn_seed) const override;
|
||||
uint64_t* seed) const override;
|
||||
|
||||
// Accessors
|
||||
AngleDistribution& angle() { return angle_; }
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ public:
|
|||
explicit SourceDistribution(pugi::xml_node node);
|
||||
|
||||
//! Sample from the external source distribution
|
||||
//! \param[inout] prn_seed Pseudorandom seed pointer
|
||||
//! \param[inout] seed Pseudorandom seed pointer
|
||||
//! \return Sampled site
|
||||
Particle::Bank sample(uint64_t* prn_seed) const;
|
||||
Particle::Bank sample(uint64_t* seed) const;
|
||||
|
||||
// Properties
|
||||
double strength() const { return strength_; }
|
||||
|
|
@ -61,9 +61,9 @@ extern "C" void initialize_source();
|
|||
|
||||
//! Sample a site from all external source distributions in proportion to their
|
||||
//! source strength
|
||||
//! \param[inout] prn_seed Pseudorandom seed pointer
|
||||
//! \param[inout] seed Pseudorandom seed pointer
|
||||
//! \return Sampled source site
|
||||
Particle::Bank sample_external_source(uint64_t* prn_seed);
|
||||
Particle::Bank sample_external_source(uint64_t* seed);
|
||||
|
||||
//! Fill source bank at end of generation for fixed source simulations
|
||||
void fill_source_bank_fixedsource();
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ public:
|
|||
virtual Direction reflect(Position r, Direction u) const;
|
||||
|
||||
virtual Direction diffuse_reflect(Position r, Direction u,
|
||||
uint64_t* prn_seed) const;
|
||||
uint64_t* seed) const;
|
||||
|
||||
//! Evaluate the equation describing the surface.
|
||||
//!
|
||||
|
|
|
|||
|
|
@ -64,9 +64,9 @@ public:
|
|||
//! \param[in] E_in Incident neutron energy in [eV]
|
||||
//! \param[out] E_out Outgoing neutron energy in [eV]
|
||||
//! \param[out] mu Outgoing scattering angle cosine
|
||||
//! \param[inout] prn_seed Pseudorandom seed pointer
|
||||
//! \param[inout] seed Pseudorandom seed pointer
|
||||
void sample(const NuclideMicroXS& micro_xs, double E_in,
|
||||
double* E_out, double* mu, uint64_t* prn_seed);
|
||||
double* E_out, double* mu, uint64_t* seed);
|
||||
private:
|
||||
struct Reaction {
|
||||
// Default constructor
|
||||
|
|
@ -101,9 +101,9 @@ public:
|
|||
//! \param[out] i_temp corresponding temperature index
|
||||
//! \param[out] elastic Thermal elastic scattering cross section
|
||||
//! \param[out] inelastic Thermal inelastic scattering cross section
|
||||
//! \param[inout] prn_seed Pseudorandom seed pointer
|
||||
//! \param[inout] seed Pseudorandom seed pointer
|
||||
void calculate_xs(double E, double sqrtkT, int* i_temp, double* elastic,
|
||||
double* inelastic, uint64_t* prn_seed) const;
|
||||
double* inelastic, uint64_t* seed) const;
|
||||
|
||||
//! Determine whether table applies to a particular nuclide
|
||||
//!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue