cleanup of comments and adding some parameter descriptions for altered function prototypes

This commit is contained in:
John Tramm 2019-11-22 22:56:16 +00:00
parent d3e2d36fc8
commit 12ec9bacff
14 changed files with 66 additions and 10 deletions

View file

@ -34,6 +34,8 @@ public:
Discrete(const double* x, const double* p, int n);
//! Sample a value from the distribution
//! \param prn_seeds Array of pseudorandom number seeds
//! \param stream Pseudorandom stream index
//! \return Sampled value
double sample(uint64_t * prn_seeds, int stream) const;
@ -58,6 +60,8 @@ public:
Uniform(double a, double b) : a_{a}, b_{b} {};
//! Sample a value from the distribution
//! \param prn_seeds Array of pseudorandom number seeds
//! \param stream Pseudorandom stream index
//! \return Sampled value
double sample(uint64_t * prn_seeds, int stream) const;
private:
@ -75,6 +79,8 @@ public:
Maxwell(double theta) : theta_{theta} { };
//! Sample a value from the distribution
//! \param prn_seeds Array of pseudorandom number seeds
//! \param stream Pseudorandom stream index
//! \return Sampled value
double sample(uint64_t * prn_seeds, int stream) const;
private:
@ -91,6 +97,8 @@ public:
Watt(double a, double b) : a_{a}, b_{b} { };
//! Sample a value from the distribution
//! \param prn_seeds Array of pseudorandom number seeds
//! \param stream Pseudorandom stream index
//! \return Sampled value
double sample(uint64_t * prn_seeds, int stream) const;
private:
@ -108,6 +116,8 @@ public:
Normal(double mean_value, double std_dev) : mean_value_{mean_value}, std_dev_{std_dev} { };
//! Sample a value from the distribution
//! \param prn_seeds Array of pseudorandom number seeds
//! \param stream Pseudorandom stream index
//! \return Sampled value
double sample(uint64_t * prn_seeds, int stream) const;
private:
@ -126,6 +136,8 @@ 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_seeds Array of pseudorandom number seeds
//! \param stream Pseudorandom stream index
//! \return Sampled value
double sample(uint64_t * prn_seeds, int stream) const;
private:
@ -148,6 +160,8 @@ public:
const double* c=nullptr);
//! Sample a value from the distribution
//! \param prn_seeds Array of pseudorandom number seeds
//! \param stream Pseudorandom stream index
//! \return Sampled value
double sample(uint64_t * prn_seeds, int stream) const;
@ -178,6 +192,8 @@ public:
Equiprobable(const double* x, int n) : x_{x, x+n} { };
//! Sample a value from the distribution
//! \param prn_seeds Array of pseudorandom number seeds
//! \param stream Pseudorandom stream index
//! \return Sampled value
double sample(uint64_t * prn_seeds, int stream) const;
private:

View file

@ -23,6 +23,8 @@ public:
//! Sample an angle given an incident particle energy
//! \param[in] E Particle energy in [eV]
//! \param[inout] prn_seeds Array of pseudorandom number seeds
//! \param[in] stream Pseudorandom stream index
//! \return Cosine of the angle in the range [-1,1]
double sample(double E, uint64_t * prn_seeds, int stream) const;

View file

@ -23,6 +23,8 @@ public:
virtual ~UnitSphereDistribution() = default;
//! Sample a direction from the distribution
//! \param prn_seeds Array of pseudorandom number seeds
//! \param stream Pseudorandom stream index
//! \return Direction sampled
virtual Direction sample(uint64_t * prn_seeds, int stream) const = 0;
@ -39,6 +41,8 @@ public:
explicit PolarAzimuthal(pugi::xml_node node);
//! Sample a direction from the distribution
//! \param prn_seeds Array of pseudorandom number seeds
//! \param stream Pseudorandom stream index
//! \return Direction sampled
Direction sample(uint64_t * prn_seeds, int stream) const;
private:
@ -55,6 +59,8 @@ public:
Isotropic() { };
//! Sample a direction from the distribution
//! \param prn_seeds Array of pseudorandom number seeds
//! \param stream Pseudorandom stream index
//! \return Sampled direction
Direction sample(uint64_t * prn_seeds, int stream) const;
};
@ -69,6 +75,8 @@ public:
explicit Monodirectional(pugi::xml_node node) : UnitSphereDistribution{node} { };
//! Sample a direction from the distribution
//! \param prn_seeds Array of pseudorandom number seeds
//! \param stream Pseudorandom stream index
//! \return Sampled direction
Direction sample(uint64_t * prn_seeds, int stream) const;
};

View file

@ -29,6 +29,8 @@ public:
explicit CartesianIndependent(pugi::xml_node node);
//! Sample a position from the distribution
//! \param prn_seeds Array of pseudorandom number seeds
//! \param stream Pseudorandom stream index
//! \return Sampled position
Position sample(uint64_t * prn_seeds, int stream) const;
private:
@ -46,6 +48,8 @@ public:
explicit SphericalIndependent(pugi::xml_node node);
//! Sample a position from the distribution
//! \param prn_seeds Array of pseudorandom number seeds
//! \param stream Pseudorandom stream index
//! \return Sampled position
Position sample(uint64_t * prn_seeds, int stream) const;
private:
@ -64,6 +68,8 @@ public:
explicit SpatialBox(pugi::xml_node node, bool fission=false);
//! Sample a position from the distribution
//! \param prn_seeds Array of pseudorandom number seeds
//! \param stream Pseudorandom stream index
//! \return Sampled position
Position sample(uint64_t * prn_seeds, int stream) const;
@ -86,6 +92,8 @@ public:
explicit SpatialPoint(pugi::xml_node node);
//! Sample a position from the distribution
//! \param prn_seeds Array of pseudorandom number seeds
//! \param stream Pseudorandom stream index
//! \return Sampled position
Position sample(uint64_t * prn_seeds, int stream) const;
private:

View file

@ -206,8 +206,8 @@ extern "C" double normal_variate(double mean, double std_dev, uint64_t * prn_see
//! @result The sampled outgoing energy
//==============================================================================
extern "C" double muir_spectrum(double e0, double m_rat, double kt, uint64_t * prn_seeds,
int stream);
extern "C" double muir_spectrum(double e0, double m_rat, double kt,
uint64_t * prn_seeds, int stream);
//==============================================================================
//! Doppler broadens the windowed multipole curvefit.

View file

@ -81,8 +81,8 @@ Direction sample_target_velocity(const Nuclide* nuc, double E, Direction u,
Direction sample_cxs_target_velocity(double awr, double E, Direction u, double kT,
uint64_t * prn_seeds, int stream);
void sample_fission_neutron(int i_nuclide, const Reaction* rx, double E_in, Particle::Bank* site,
uint64_t * prn_seeds, int stream);
void sample_fission_neutron(int i_nuclide, const Reaction* rx, double E_in,
Particle::Bank* site, uint64_t * prn_seeds, int stream);
//! handles all reactions with a single secondary neutron (other than fission),
//! i.e. level scattering, (n,np), (n,na), etc.

View file

@ -28,8 +28,9 @@ namespace model {
extern std::vector<Plot> plots; //!< Plot instance container
extern std::unordered_map<int, int> plot_map; //!< map of plot ids to index
extern uint64_t plotter_prn_seeds[N_STREAMS];
extern int plotter_stream;
extern uint64_t plotter_prn_seeds[N_STREAMS]; // Random number seeds used for plotter
extern int plotter_stream; // Stream index used by the plotter
} // namespace model
@ -288,7 +289,7 @@ void create_voxel(Plot pl);
//! Create a randomly generated RGB color
//! \return RGBColor with random value
RGBColor random_color(void);
RGBColor random_color();
} // namespace openmc

View file

@ -38,6 +38,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_seeds Array of pseudorandom seeds
//! \param[in] stream Pseudorandom stream index
void sample(double E_in, double& E_out, double& mu, uint64_t * prn_seeds,
int stream) const override;

View file

@ -24,6 +24,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_seeds Array of pseudorandom seeds
//! \param[in] stream Pseudorandom stream index
void sample(double E_in, double& E_out, double& mu, uint64_t * prn_seeds,
int stream) const override;
private:

View file

@ -31,6 +31,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_seeds Array of pseudorandom seeds
//! \param[in] stream Pseudorandom stream index
void sample(double E_in, double& E_out, double& mu, uint64_t * prn_seeds,
int stream) const override;
private:
@ -52,6 +54,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_seeds Array of pseudorandom seeds
//! \param[in] stream Pseudorandom stream index
void sample(double E_in, double& E_out, double& mu, uint64_t * prn_seeds,
int stream) const override;
private:
@ -74,6 +78,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_seeds Array of pseudorandom seeds
//! \param[in] stream Pseudorandom stream index
void sample(double E_in, double& E_out, double& mu, uint64_t * prn_seeds,
int stream) const override;
private:
@ -97,6 +103,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_seeds Array of pseudorandom seeds
//! \param[in] stream Pseudorandom stream index
void sample(double E_in, double& E_out, double& mu, uint64_t * prn_seeds,
int stream) const override;
private:
@ -121,6 +129,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_seeds Array of pseudorandom seeds
//! \param[in] stream Pseudorandom stream index
void sample(double E_in, double& E_out, double& mu, uint64_t * prn_seeds,
int stream) const override;
private:

View file

@ -29,6 +29,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_seeds Array of pseudorandom seeds
//! \param[in] stream Pseudorandom stream index
void sample(double E_in, double& E_out, double& mu, uint64_t * prn_seeds,
int stream) const override;

View file

@ -38,6 +38,8 @@ public:
explicit SourceDistribution(pugi::xml_node node);
//! Sample from the external source distribution
//! \param[inout] prn_seeds Array of pseudorandom seeds
//! \param[in] stream Pseudorandom stream index
//! \return Sampled site
Particle::Bank sample(uint64_t * prn_seed, int stream) const;
@ -60,6 +62,7 @@ extern "C" void initialize_source();
//! Sample a site from all external source distributions in proportion to their
//! source strength
//! \param[inout] prn_seeds Array of pseudorandom seeds
//! \return Sampled source site
Particle::Bank sample_external_source(uint64_t * prn_seeds);

View file

@ -102,6 +102,8 @@ 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_seeds Array of pseudorandom seeds
//! \param[in] stream Pseudorandom stream index
void calculate_xs(double E, double sqrtkT, int* i_temp, double* elastic,
double* inelastic, uint64_t * prn_seeds, int stream) const;

View file

@ -144,7 +144,7 @@ def calc_zn(n, rho, phi):
rho : float
Radial location in the unit disk
phi : float
Theta (radians) location in the unit disk
Theta (radians) location in the unit disk
Returns
-------
@ -195,8 +195,8 @@ def rotate_angle(uvw0, mu, phi, prn_seeds, stream ):
Original direction cosine
mu : float
Polar angle cosine to rotate
phi : iterable of float
Azimuthal angle; if NULL, one will be sampled uniformly
phi : float
Azimuthal angle; if None, one will be sampled uniformly
prn_seeds : iterable of int
PRNG seed array
stream : int