The following is a simple diagram of the class hierarchy representing the MD simulation core. Classes which represent a backend are filled.
A short description of the basic functionality of each class template.
This class implements the common basis of a hard- or soft-sphere simulation. It contains the size of the system (number of particles), the mixture type (monodisperse or bidisperse) and the density and rectangular box length. It holds the performance accumulators for measuring the average times of individual functions or GPU kernels comprising the MD algorithm.
The function state, which is used upon restoring the system state from a trajectory sample and checks for matching particle number, wraps coordinates to periodic boundary conditions and optionally rescales the density or box size to a new value.
This class implements the common functionality of the GPU backends. It holds the CUDA streams and events used for ordering and profiling CUDA kernel launches. It contains common reduction kernels to compute the potential energy sum, virial equation sum, center of mass velocity and squared velocity sum. It contains a particle sorting kernel for sorting integers in GPU memory by their respective tags.
Notable functions include the lattice to generate an fcc lattice in GPU memory, random_permute to randomly assign particle types in a binary mixture, init_tags to initialise particle numbers, rescale_velocities to scale velocities to a desired temperature, boltzmann to assign Maxwell-Boltzmann distributed velocities, and update_forces to wrap the mdstep GPU kernel.