10 unstable releases (3 breaking)

0.4.2 Feb 12, 2021
0.4.1 Feb 12, 2021
0.3.3 Dec 19, 2020
0.2.1 Dec 15, 2020
0.1.0 Dec 6, 2020

#416 in Simulation


Used in 4 crates

MIT license

52KB
1K SLoC

Velvet

Crates.io Crates.io Crates.io

Velvet is a classical atomistic simulation engine with a focus on user-friendliness and extensibility. This project is largely a learning exercise, but as development continues I hope to accomplish the following goals:

  • Extensibility via user-defined plugin modules
  • Optimized single CPU performace with multithreading and SIMD support
  • Implement a wide variety of interatomic potentials
  • Molecular dynamics, Monte Carlo, and energy minimization routines
  • Visualization tools to analyze simulation results
  • Support importing and exporting data in popular external formats

Getting Started

Prerequisites

To build Velvet you will need to have Rust's compiler and package manager installed on your machine. Instructions for most platforms can be found here.

  • rustc - Compiler for the Rust programming language
  • Cargo - Package manager for the Rust programming language

Velvet has optional support to write HDF5 formatted results. If this is your preferred format, you will need a local installation of libhdf5. The library can be installed with your package manager of choice or downloaded directly from source here.

Installation

If you're interested in contributing or modifying the code for personal use you can install a local copy with the following instructions. Users who don't need to modify the code can skip ahead to the usage section.

  1. Clone the repo.
$ git clone https://github.com/seatonullberg/velvet && cd velvet
  1. Build in release mode.
$ cargo build --release --workspace
  1. Check that all tests pass. Release mode is required to run the integration tests efficiently.
$ cargo test --release --workspace

Optional Features

Velvet supports a number of compile time options that can be opted into by using the --features flag when building with Cargo.

  • f64 - Sets the underlying storage type to a 64 bit floating point number. Default is 32 bit.
  • hdf5-output - Enables HDF5 formatted output. Requires a local installation of libhdf5.
  • quiet - Hides the simulation progress bar. Recommended when running benchmarks.
  • rayon - Enables multithreading with rayon parallel iterators.

Usage

Velvet is designed to be easy for developers to hack on and extend. With this goal in mind, Velvet forgoes support for static configuration files or input scripts, which can limit flexibility and complicate backend logic, in favor of defining simulations directly in code using the high-level velvet crate. While this may sound daunting to researchers who are more familiar with mainstream atomistic simulation software, the samples in the examples directory show that this can be a rather elegant solution.

Roadmap

Refer to the open issues, FEATURES.md, and CHANGELOG.md to see planned or proposed features (and bug fixes).

FAQ

  • Why is it called "Velvet"?

    • "Velvet" is a concatenation of Velocity Verlet which is a foundational algorithm in the field of molecular dynamics.

License

Distributed under the MIT License. See LICENSE for more information.

Acknowledgements

  • LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
  • Lumol - Universal extensible molecular simulation engine

lib.rs:

Core feature library for the Velvet simulation engine.

Internal unit system:

  • Distance - Angstrom (A)
  • Time - Femtosecond (fs)
  • Mass - Atomic mass unit (amu)
  • Temperature - Kelvin (K)
  • Quantity - Number of particles
  • Angle - Radians (rad)

Dependencies

~8–18MB
~241K SLoC