Code Monkey home page Code Monkey logo

self-avoiding-walk-polymer's Introduction

self-avoiding-walk-polymer

Introduction

This project implements a self-avoiding walk for a three-dimensional polymer. The code include two part: create model and equilibrium (using LAMMPS).

Getting Started

To get started with this project, follow these few steps:

  1. Clone the repository: Clone this repository to your local machine using the following command:
git clone https://github.com/lp65082001/self-avoiding-walk-polymer.git
  1. Build environment Build the environment with docker:
docker build -f ./Dockerfile -t saw:v1 .

Run container (gpu version):

sudo docker run -i -t  --gpus all -v /in this folder/:/root/ --name=saw_cuda saw:v1

Add environment parameter to pass mpi under root:

export OMPI_ALLOW_RUN_AS_ROOT=1
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
  1. Install LAMMPS Compile LAMMPS with gpu (option)
wget https://lammps.sandia.gov/tars/lammps-stable.tar.gz

unzip LAMMPS:

tar-xzvf lammps*.tar.gz

compile with gpu:

cd lammps                # change to the LAMMPS distribution directory
mkdir build; cd build    # create and use a build directory
cmake -D BUILD_MPI=yes -D LAMMPS_MACHINE=mpi -D PKG_GPU=on -D GPU_API=cuda -D GPU_ARCH=sm_86 -D PKG_OPT=yes -D PKG_PERI=yes -D PKG_KSPACE=yes -D PKG_MC=yes -D PKG_MOLECULE=yes -D PKG_RIGID=yes -D PKG_MPIIO=yes -D PKG_VORONOI=yes -D DOWNLOAD_PLUMED=yes -D PKG_USER-PLUMED=yes -D PKG_USER-OMP=yes ../cmake

cmake install:

cmake --build .          # compilation (or type "make")
  1. How to use ? Using config.json:
{
    "average_MW": 2800, # average molecular weight, unit: g/mol
    "monomer_M": 28, # monomer molecular weight, unit: g/mol
    "chains": 10, # number of chain
    "bond_k": 18, # Bond spring, unit: kcal/mol/angstrom
    "bond_l": 2.5, # Bond length, unit: angstrom
    "angle_k": 2.06, # angle spring, unit: kcal/mol/radian
    "angle_l": 168, # angle, # unit: theta
    "epsilon": 0.25, # unit: kcal/mol
    "sigma": 4.28, # unit angstrom
    "num_sample": 1, # number of sample
    "mode": "single_heter", # mode
    "device": "cpu", # device
    "model_init_save_path":"./model/" # save dir
}
  1. Implement method of Self-avoiding walk

Features

  • Create polymer model by using self avoiding walk
  • Automate to using LAMMPS
  • Automate create sample with random parameter

self-avoiding-walk-polymer's People

Contributors

lp65082001 avatar

Stargazers

Yen-Lin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.