Skip to content

Command-line tool for making charged, patchy Particles

License

Notifications You must be signed in to change notification settings

mlund/cppm-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust RustClippy Crate DOI

CPPM generator

Overview

This is a single command-line tool that generates spherical Charged Patchy Particle Models (CPPM) which mimic bio-colloidal particles, e.g. globular proteins. The figure below shows examples of interacting CPPMs taken from https://doi.org/10.1063/1.4928077:

cppm-generator generates CPPMs by placing neutral, positive, and negative particles on the surface of a sphere, and minimise the (free) energy using Metropolis-Hastings Monte Carlo sampling.

Installing

$ cargo install cppm-generator

Usage

The default parameters produce an isotropic, charged particle similar to P00 from Table 1 in this publication. It is also possible to impose a target molecular dipole moment using the --dipole option.

$ cppm-generator --help

USAGE:
    cppm-generator [OPTIONS] --file <FILE>

OPTIONS:
    -b, --bjerrum-length <BJERRUM_LENGTH>    Bjerrum length (Å) [default: 7.0]
    -h, --help                               Print help information
    -m, --minus <NUM_MINUS>                  Number of negative (-1e) particles [default: 37]
    -N <NUM_TOTAL>                           Total number of particles [default: 643]
    -o, --file <FILE>                        Output structure (.xyz or .pqr)
    -p, --plus <NUM_PLUS>                    Number of positive (+1e) particles [default: 29]
    -r, --radius <RADIUS>                    Sphere radius (Å) [default: 20.0]
    -s, --steps <STEPS>                      Number of Monte Carlo iterations [default: 10000]
    -u, --dipole <TARGET_DIPOLE_MOMENT>      Target dipole moment (Debye)
    -V, --version                            Print version information

Details and status

  • Random walk on a sphere using spherical coordinates
  • Particle-particle interactions using a Coulomb/softcore potential
  • Arbitrary mixing of neutral and charged particles
  • Output to .xyz and .pqr files
  • Command line interface
  • Dipole moment analysis
  • External electric field to induce arbitrary patches
  • Constrain to target dipole moment w. harmonic potential
  • Written in Rust
  • Use uon for dimensional analysis
  • IO error handling
  • Unittests
  • Logging support

Motivation

Besides some scientific use, this project is mainly a first dive into the Rust programming language.