Molecular Dynamics  v0.4
Project for the Practical hosted by the Scientific Computing Chair
Functions
MaxwellBoltzmannDistribution.h File Reference
#include <random>
#include <array>
Include dependency graph for MaxwellBoltzmannDistribution.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::array< double, 3 > maxwellBoltzmannDistributedVelocity (double averageVelocity, size_t dimensions)
 

Function Documentation

◆ maxwellBoltzmannDistributedVelocity()

std::array<double, 3> maxwellBoltzmannDistributedVelocity ( double  averageVelocity,
size_t  dimensions 
)
inline

Generate a random velocity vector according to the Maxwell-Boltzmann distribution, with a given average velocity.

Parameters
averageVelocityThe average velocity of the brownian motion for the system.
dimensionsNumber of dimensions for which the velocity vector shall be generated. Set this to 2 or 3.
Returns
Array containing the generated velocity vector.
Here is the caller graph for this function: