Event-driven molecular dynamics simulations for hard spheres

Related tags

Miscellaneous EDMD
Overview

Event-driven molecular dynamics code for hard spheres

This is an event-driven molecular dynamics (EDMD) code for hard spheres. It uses neighbor lists [1] and an efficient event calendar [2] for efficiency.

See http://arxiv.org/abs/2201.01100 for a complete description and benchmarking.

Code variants

Four simulation codes are included, in their respective subfolders. Three of these are variations of a microcanonical simulation code, simulating a constant number N particles in a cubic volume V with periodic boundary conditions at constant energy.

  • Cell contains a simulation code where collision checks are based on a cell list.
  • Multi contains a simualtion code where collision checks are based on a neighbor list, and is more typically more efficient than the Cell code at sufficiently high densities.
  • Single contains a simualtion code where collision checks are based on a neighbor list, and only a single event is scheduled per particle. This is typically more efficient than the Multi code. Additionally, a separate simulation code Grow is included in which the particles grow over time until a desired packing fraction is reached. This can be helpful for creating initial configurations.

Compilation details

Each code consists of a single code file plus a header file. A makefile is included for each code, as well as sample initial configurations. All simulation parameters are defined as global variables near the top of the main code file.

Simulation units and output

We simulate systems of N hard spheres in a constant volume V in three dimensions. Each particle i has a position \mathbf{r}_i, a diameter \sigma_i, a mass m_i, and a radius R_i. The simulation code operates in the following units:

  • Lengths are measured in units of the maximum particle size \sigma.
  • Mass is measured in units of a reference mass m, which is typically chosen to be the mass of a particle with diameter \sigma.
  • Time is measured in units of \tau = \sqrt{\beta m \sigma^2}. Here, \beta = 1/k_B T with k_B Boltzmann's constant. Note that the simulation assumes that no particles with a diameter greater than 1 \sigma exist in the simulation, and uses assumption in the creation of the cell list. Hence, all particles necessarily have a diameter \sigma_i \leq \sigma. By default, the simulation code sets the mass of all particles to be equal to m when loading an initial configuration, but mass is taken into account when determining the effect of collisions. Hence, other choices for the mass can readily be implemented by adapting the initialization functions.

The simulation code measures the pressure P during the simulation, and outputs it in the form of a reduced pressure P^* = \beta P \sigma^3. The average pressure in a given time interval [t_a, t_b] is measured via the virial expression P = \rho k_B T + \frac{1}{3V} \frac{\sum  \mathbf{\delta p}_i \cdot \mathbf{r}_{ij}}{t_b - t_a}, where \rho = N/V is the number density with V the system volume and N the number of particles, and the sum in the last term is taken over all collisions in the time interval [t_a, t_b]. For each collision, \mathbf{r}_{ij} is the center-to-center vector connecting the two colliding particles i and j, and \mathbf{\delta p}_i is the momentum change of particle i due to the collision.

Additionally, as a check on conservation of energy, the simulation measures the temperature of the system, using the equipartition theorem \sum_i \frac{1}{2}m v_i^2 = \frac{3N}{2} k_B T. The temperature is reported in units of m \sigma^2 / \tau^2 / k_B, and should be constant during the simulation (up to numerical accuracy). A thermostat function is included in the simulation codes, but is disabled by default. Since the total kinetic energy is a conserved quantity, the temperature remains constant even without a thermostat. Hence, all simulations reported in the main text are performed in the microcanonical ensemble (i.e. at constant total energy).

Snapshot file format

The configuration files from the simulation are written in a simple text-based format, which can contain multiple snapshots per file. For each frame, the format consists of N+2 lines (with N the number of particles), as follows:

  • One line containing just the number of particles
  • One line containing the box size, specifying the box length L_x, L_y, and L_z along the three axes, separated by whitespace.
  • One line per particle containing: a letter indicating particle type, three numbers indicating the real-space particle coordinates, and one number indicating the particle radius. The movie files that are created by the simulation code include multiple of these frames consecutively in a single text file. Note that although the code assumes periodic boundary conditions, coordinates of particles that leave the box during the simulation will be printed as being outside of the simulation box, to allow for analysis of long-time dynamics. Hence, any structural analysis or visualization should apply periodic boundary conditions explicitly.

The simulation codes can read in snapshots in this format as initial configurations. Periodic boundaries will be applied to the snapshot at the start of the simulation. Note that the simulation code assumes that all box lengths, positions, and radii are given in units of \sigma, which is the largest possible particle diameter. Hence, the radius of a particle in the initial configuration should never be given as a number larger than 0.5.

Adaptation to different configuration file formats can be done via modification of the loadparticles, write, and outputsnapshot functions.

Cppev is a C++ event driven library

Cppev is a C++ event driven library. Architecture Nonblock IO Support disk-file / pipe / fifo / socket. Support socket protocol-type tcp / udp, protoc

null 5 May 3, 2022
Sysmon event simulation utility which can be used to simulate the attacks to generate the Sysmon Event logs for testing the EDR detections and correlation rules by Blue teams.

SysmonSimulator SysmonSimulator is an Open source Windows event simulation utility created in C language, that can be used to simulate most of the att

Scarred Monk 458 May 9, 2022
This plugin enables the use of Live++ by Molecular Matter inside of Cryengine.

Live++ // CRYENGINE This plugin enables the use of Live++ by Molecular Matter inside of Cryengine. Live++ allows for easy hot-reloading and on the fly

Philipp Gehring 5 Dec 4, 2019
Pandex is a light but FAST programming language written in C . Pandex goal is that be hard & it's good for eductional goals

The Pandex programming language version 1.0.0.3 Pandex versions release type The Pandex version has four numbers. the first number holds 1 ( or 0 in s

null 9 Jan 4, 2022
HESS (Hyper Exponential Space Sorting) is a polynomial black-box optimization algorithm, that work very well with any NP-Complete, or NP-Hard problem

The original HESS (Hyper Exponential Space Sorting) is a polynomial black-box optimization algorithm, that work very well with any NP-Complete, or NP-Hard problem, at 2021 thanks to suggestions of Daniel Mattes, work like a complete algorithm.

SAT-X 3 Jan 18, 2022
Custom DLLs for a really hard Half-Life Mod

Half Life 1 SDK LICENSE Half Life 1 SDK Copyright© Valve Corp. THIS DOCUMENT DESCRIBES A CONTRACT BETWEEN YOU AND VALVE CORPORATION (“Valve”). PLEASE

Jay 3 Jan 12, 2022
OpenScan is an open-source document scanner app that enables users to scan hard copies of documents or notes and convert it into a PDF file. No ads. No data collection. We respect your privacy.

OpenScan An open source app that enables users to scan hardcopies of documents or notes and convert it to a PDF file. No ads. No data collection. We r

Ethereal Developers Inc 1.1k May 13, 2022
DLBFoam: Dynamic load balancing for fast reactive simulations

DLBFoam: Dynamic load balancing for fast reactive simulations DLBFoam v1.1 - What's new? DLBFoam v1.1 introduces a fully analytical chemistry Jacobian

Aalto-CFD 38 Apr 19, 2022
Open-source node system framework, to change your algorithmic code into useful tools to create much more complicated simulations!

Open-source node system framework, to change your algorithmic code into useful tools to create much more complicated simulations!

Zenus Technology 516 May 13, 2022
C++11 provides chainable and iterable object for uniform die casts. Useful for statistics or table top RPG simulations.

12/1/2018 Due to feedback about compile-time limitations, the api has been changed since release. The api now supports user-defined literals which mak

null 12 Sep 5, 2021
VID-Fusion: Robust Visual-Inertial-Dynamics Odometry for Accurate External Force Estimation

VID-Fusion VID-Fusion: Robust Visual-Inertial-Dynamics Odometry for Accurate External Force Estimation Authors: Ziming Ding , Tiankai Yang, Kunyi Zhan

ZJU FAST Lab 69 May 6, 2022
OpenFOAM is a free, open source computational fluid dynamics (CFD) software package

acousticStreamingFoam About OpenFOAM OpenFOAM is a free, open source computational fluid dynamics (CFD) software package released by the OpenFOAM Foun

Bruno 1 Nov 2, 2021
Simple, differentiable rigid body dynamics

Quark Quark is intended to be a simple differentiable rigid body dynamics library. For the time being it is starting out as a ground-up rewrite of RBD

Pedro Morais 4 Nov 23, 2021
Artificial Intelligence for Kinematics, Dynamics, and Optimization

AIKIDO - AI for KIDO ⚠️ Warning: AIKIDO is under heavy development. These instructions are primarily for reference by the developers. AIKIDO is a C++

Personal Robotics Laboratory 177 May 2, 2022
A C++ library for kinematics and dynamics of articulated rigid body systems.

gear Geometric Engine for Articulated Rigid-body simulation GEAR is a C++ library for kinematics and dynamics of articulated rigid body systems. It us

null 58 Jan 27, 2022
Improved version of real-time physics engine that couples FEM-based deformables and rigid body dynamics

Enhanced version of coupled FEM and constrained rigid body simulation Description This little playground aimed to test our Conjugate Gradients based M

Andrey Voroshilov 25 Apr 11, 2022
A CUDA-accelerated cloth simulation engine based on Extended Position Based Dynamics (XPBD).

Velvet Velvet is a CUDA-accelerated cloth simulation engine based on Extended Position Based Dynamics (XPBD). Why another cloth simulator? There are a

Vital Chen 5 May 7, 2022
🗺️ OMAPS.APP — Offline OpenStreetMap maps for iOS and Android. A community-driven fork of MAPS.ME.

OMaps is an open source cross-platform offline maps application, built on top of crowd-sourced OpenStreetMap data. It was publicly released for iOS and Android.

OMaps 3.3k May 16, 2022
Gauss Stylization - Interactive tool for normal driven stylization

Interactive tool for normal driven stylization. A set of preferred normals can be chosen arbitrarily from the Gauss sphere, including semi-discrete sets to model preference for cylinder- or cone-like shapes.

Ugo Finnendahl 17 Mar 9, 2022