Skip to content

ericbruckner/polysim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

polysim

A Python library for building and running simple dissipative particle dynamics (DPD) simulations using HOOMD-blue.

Built using python3.6.9

Software prerequisites:

Description

This library is used to automate DPD simulations of linear polymers using HOOMD-blue. It is intended to be used with Google Colab Notebooks to teach basic concepts of polymer physics to undergraduate students. The library is designed to perform three main functions:

  • Build a linear polymer of N monomers and run a DPD simulation in HOOMD-blue
  • Take monomer coordinates from the HOOMD-blue simulation and calculate the radius of gyration
  • Render the 3-dimensional conformation of the polymer chain

Examples

The function simulate_polymer_dpd is used to set-up and run a DPD simulation of a linear polymer in HOOMD-blue. The function returns the monomer coordinates and save a trajectory file. Users must enter the number of monomers ($N$) and the conservative force repulsive interaction strength ($\alpha$). Default parameters such as the conservative force constant $\gamma$ (gamma), the diameter of DPD bead (sigma), the MD timestep (dt), the number of timesteps (steps), the energy of the system (kT), the trajectory filename, (trajectory_filename), and the number of frames to save in the trajectory file ((traj_frames)

from polysim.main import simulate_polymer_dpd

## Enter number of monomers
N = 10;

## Enter alpha, the repulsive force constant in the DPD conservative force
alpha = 0.1;

## Enter the number of timesteps
steps = 1e5

## Run simulation: Save the XYZ coordinates of the monomers
coordinates  = simulate_polymer_dpd(N, alpha, steps = steps);

## View monomer XYZ coordiantes
print(coordinates)

Once the polymer has been simulated, you can visualize the conformation using the render_polymer function. This function takes the monomer coordinates output (i.e. coordinates variable) from the simulate_polymer_dpd and renders a 3D visualization of the polymer using fresnel.

from polysim.main import render_polymer

render_polymer(coordinates)

About

A library to run simple dissipative particle dynamics (DPD) simulations of linear polymers using HOOMD-blue

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages