mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
Switch C++ RNG to Doxygen-style comments
This commit is contained in:
parent
f6d6b926b1
commit
4b6402104e
1 changed files with 32 additions and 14 deletions
|
|
@ -15,45 +15,57 @@ extern "C" const int STREAM_URR_PTABLE;
|
|||
extern "C" const int STREAM_VOLUME;
|
||||
|
||||
//==============================================================================
|
||||
// PRN generates a pseudo-random number using a linear congruential generator.
|
||||
//! Generate a pseudo-random number using a linear congruential generator.
|
||||
//! @return A random number between 0 and 1
|
||||
//==============================================================================
|
||||
|
||||
extern "C" double prn();
|
||||
|
||||
//==============================================================================
|
||||
// FUTURE_PRN generates a pseudo-random number which is 'n' times ahead from the
|
||||
// current seed.
|
||||
//! Generate a random number which is 'n' times ahead from the current seed.
|
||||
//!
|
||||
//! The result of this function will be the same as the result from calling
|
||||
//! `prn()` 'n' times.
|
||||
//! @param n The number of RNG seeds to skip ahead by
|
||||
//! @return A random number between 0 and 1
|
||||
//==============================================================================
|
||||
|
||||
extern "C" double future_prn(int64_t n);
|
||||
|
||||
//==============================================================================
|
||||
// SET_PARTICLE_SEED sets the seed to a unique value based on the ID of the
|
||||
// particle.
|
||||
//! Set the RNG seed to a unique value based on the ID of the particle.
|
||||
//! @param id The particle ID
|
||||
//==============================================================================
|
||||
|
||||
extern "C" void set_particle_seed(int64_t id);
|
||||
|
||||
//==============================================================================
|
||||
// ADVANCE_PRN_SEED advances the random number seed 'n' times from the current
|
||||
// seed.
|
||||
//! Advance the random number seed 'n' times from the current seed.
|
||||
//! @param n The number of RNG seeds to skip ahead by
|
||||
//==============================================================================
|
||||
|
||||
extern "C" void advance_prn_seed(int64_t n);
|
||||
|
||||
//==============================================================================
|
||||
// FUTURE_SEED advances the random number seed 'skip' times. This is usually
|
||||
// used to skip a fixed number of random numbers (the stride) so that a given
|
||||
// particle always has the same starting seed regardless of how many processors
|
||||
// are used.
|
||||
//! Advance a random number seed 'n' times.
|
||||
//!
|
||||
//! This is usually used to skip a fixed number of random numbers (the stride)
|
||||
//! so that a given particle always has the same starting seed regardless of
|
||||
//! how many processors are used.
|
||||
//! @param n The number of RNG seeds to skip ahead by
|
||||
//! @param seed The starting to seed to advance from
|
||||
//==============================================================================
|
||||
|
||||
uint64_t future_seed(uint64_t n, uint64_t seed);
|
||||
|
||||
//==============================================================================
|
||||
// PRN_SET_STREAM changes the random number stream. If random numbers are needed
|
||||
// in routines not used directly for tracking (e.g. physics), this allows the
|
||||
// numbers to be generated without affecting reproducibility of the physics.
|
||||
//! Switch the RNG to a different stream of random numbers.
|
||||
//!
|
||||
//! If random numbers are needed in routines not used directly for tracking
|
||||
//! (e.g. physics), this allows the numbers to be generated without affecting
|
||||
//! reproducibility of the physics.
|
||||
//! @param n The RNG stream to switch to. Use the constants such as
|
||||
//! `STREAM_TRACKING` and `STREAM_TALLIES` for this argument.
|
||||
//==============================================================================
|
||||
|
||||
extern "C" void prn_set_stream(int n);
|
||||
|
|
@ -62,6 +74,12 @@ extern "C" void prn_set_stream(int n);
|
|||
// API FUNCTIONS
|
||||
//==============================================================================
|
||||
|
||||
//==============================================================================
|
||||
//! Set OpenMC's master seed.
|
||||
//! @param new_seed The master seed. All other seeds will be derived from this
|
||||
//! one.
|
||||
//==============================================================================
|
||||
|
||||
extern "C" int openmc_set_seed(int64_t new_seed);
|
||||
|
||||
#endif // RANDOM_LCG_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue