OpenMPCD
MaxwellBoltzmannDistribution.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * Defines the MaxwellBoltzmannDistribution class.
4  */
5 
6 #ifndef OPENMPCD_MAXWELLBOLTZMANNDISTRIBUTION_HPP
7 #define OPENMPCD_MAXWELLBOLTZMANNDISTRIBUTION_HPP
8 
9 #include <OpenMPCD/Types.hpp>
10 
11 namespace OpenMPCD
12 {
13  /**
14  * Represents a Maxwell-Boltzmann distribution.
15  */
17  {
18  private:
19  MaxwellBoltzmannDistribution(); ///< The constructor.
20 
21  public:
22  /**
23  * Generates a random number drawn from the Maxwell-Boltzmann distribution.
24  * The Maxwell-Boltzmann distribution is given by
25  * \f$ \left(v\right) = \left( \frac{m}{2\pi kT} \right)^{\frac{3}{2}}
26  * \cdot 4\pi v^2 \exp\left(- \frac{m v^2}{2 kT} \right) \f$
27  * @tparam RNG The type of the random number generator.
28  * @param[in] m The mass parameter.
29  * @param[in] kT The Boltzmann constant times the temperature.
30  * @param[in] rng The random number generator to use.
31  */
32  template<typename RNG> FP getRandomMaxwell(const FP m, const FP kT, RNG& rng);
33  };
34 }
35 
36 #endif
OpenMPCD::MaxwellBoltzmannDistribution
Represents a Maxwell-Boltzmann distribution.
Definition: MaxwellBoltzmannDistribution.hpp:16
OpenMPCD::RNG
boost::mt11213b RNG
The random number generator type.
Definition: Types.hpp:18
OpenMPCD::FP
double FP
Default floating point type.
Definition: Types.hpp:13
Types.hpp
OpenMPCD::MaxwellBoltzmannDistribution::getRandomMaxwell
FP getRandomMaxwell(const FP m, const FP kT, RNG &rng)
Generates a random number drawn from the Maxwell-Boltzmann distribution.