Skip to content

CUDA C++ code implementing GPU-accelerated Lattice Spring Model (CuLSM) simulations.

License

Notifications You must be signed in to change notification settings

chiang-yuan/culsm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CuLSM

Cuda-accelerated lattice spring model (CuLSM) is the CUDA C++ code implementing GPU parallelization on particle and spring lists. The code is associated with the paper "ImageMech: From Image to Particle Spring Network for Mechanical Characterization" published in Frontiers in Materials.

If you happen to use this code in your work, please cite:

Chiang Y, Chiu T-W and Chang S-W (2022) ImageMech: From Image to Particle Spring Network for Mechanical Characterization. Front. Mater. 8:803875. doi: 10.3389/fmats.2021.803875

Instead of spatial decomposition as used in LAMMPS, CuLSM applies parallization to atom and bond lists and therefore secures remarkable speedup for large-scale lattice spring model simulations.

speedup

Prerequisites

  • GPU compute capabtility > 6.x for 64-bit floating point operation
  • CUDA Toolkit >= 10.1 recommended

Build

To buld culsm on your device, GPU architecture must be specified at the time of compilation. In build/Makefile, make sure the NVFLAGS fit your device.

NVFLAGS = 	-O3 -I$(CUDIR)/include -m64 -arch=compute_75 -code=sm_75 -Xptxas -v -rdc=true

The GPU architecture (e.g. Kepler, Turing, etc.) may be found here, and the cooresponding CUDA naming scheme can be found in Nvidia GPU Feature List.

To compile the code, enter build directory and simply execute make in the terminal.

cd build
make

Usage

./culsm < [input] > [output] &

Example command script

# read lammps data file
read_data       <file>

# set particle mass by type
mass            <type> <mass>

# set spring type and coefficients
bond            <type> <bond type> <coeff 1> <coeff 2> ... <coeff n>

# displace certain type of particles every timestep
fix             <type> <disp x> <disp y> <disp z>

# save particle trajectory every N timesteps to file
dump            <file name> <timesteps>

# output thermodynamic observables every N timesteps
thermo          <timesteps>

# verlocity Verlet integration for N timesteps of dt seconds
run             <dt> <timesteps>

About

CUDA C++ code implementing GPU-accelerated Lattice Spring Model (CuLSM) simulations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published