Use Au-Si MEAM Potential in LAMMPS
Use Au-Si MEAM Potential in LAMMPS
Yanming Wang, Seunghwa Ryu and Wei Cai
Created June, 2012, Last modified July, 2014
This tutorial explains how to use Au-Si MEAM potential in LAMMPS on a cluster like mc2. It starts with the installation of LAMMPS on mc2, then talks about the compiling of the Au-Si MEAM potential. This tutorial also includes a test case to make sure the result from LAMMPS with this MEAM potential is consistent with that from MD++.
Installing LAMMPS on mc2
LAMMPS is a classical molecular dynamics code for large-scale atomic/molecular massively parallel simulation. On mc2, you can get LAMMPS from our SVN server using the following commands.
mkdir -p ~/Codes/LAMMPS.svn cd ~/Codes/LAMMPS.svn svn co https://micro.stanford.edu/svn/LAMMPS .
Typing the following SVN command from within the "LAMMPS.svn" directory, you can update your LAMMPS package.
svn update
Compiling MEAM potential in LAMMPS
The compilation of MEAM potential has been changed starting from LAMMPS svn revision 24. For detailed instruction, please refer to How to compile LAMMPS.
Please notice the following content is only for the older version LAMMPS.
Preparing for parallel run
First, you need to download the fftw.tar.gz and upload this archive file to your account on mc2. In your home directory, make a new folder named usr, then type the following command to unzip the fftw library in your usr folder.
cd ~/usr tar zxvf fftw.tar.gz
ALso add the following lines at the end of your ~/.bash_profile file to clarify the compiler.
module load intel/intel-11 module load mvapich/1.2rc1-intel-11-dell-gen2
Preparing for compiling MEAM potential
Au-Si MEAM potential is a potential developed by Dr. Seunghwa Ryu and Prof. Wei Cai[1][2]for gold-silicon binary system. To compile this potential in LAMMPS, you need to open the Makefile file under the LAMMPS.svn directory, finding the following line
cd lib/meam; make -f Makefile.$(libFC.$(SYS)) F90FLAGS="-O -D_EROSE_FUNCTION=1"
and replace it with
cd lib/meam; make -f Makefile.$(libFC.$(SYS)) F90FLAGS="-O -D_EROSE_FUNCTION=3"
Next, in the ~/.bash_profile file, add the following line to specify the system you are using.
export TARGET=mc2
Finally, go to LAMMPS.svn directory and type
make
This will make lmp_mc2 in LAMMPS.svn/src/ directory.
Test cases
MD++ test cases
Assuming you've got the latest MD++ package (e.g., revision 452 or later) from the svn server, you can download MD++ test case that contains one input tclscripts and two configuration cn files, and unzip it under the MD++ home directory using the command
cd ~/Codes/MD++.svn/ tar -xvf Md++_meam_test_r452.tar
The compilation of MEAM on cluster (for example mc2) can be done with the following command,
make meam-lammps build=R SYS=mc2
Run the below command within the MD++ home folder to start the test cases.
Test case 1:
bin/meam-lammps_mc2 scripts/work/si_au/si_au_compare.tcl AuSiTestCase1
Test case 2:
bin/meam-lammps_mc2 scripts/work/si_au/si_au_compare.tcl AuSiTestCase2
The two runs will create two folders named as AuSiTestCase1 and AuSiTestCase2 in the Codes/MD++.svn/runsfolder. In inside each folder, you can find one energy.txt file that stores the total potential energy value and one force.txt file that lists the forces act on each atom. You can download this Matlab code Energy and force check to test if your results are correct. When you unzip the tar file, you will have a folder named TEST that contains one Matlab script data_compare.m and several standard test case results for comparison. You need to put your force.txt and force.txt in the same folder, then the Matlab code will tell you if you pass the tests.
LAMMPS test cases
Assuming you've followed the previous instruction and compiled the LAMMPS executable successfully, you can start the test cases by downloading LAMMPS test case and unzipping it within the LAMMPS home folder.
cd ~/Codes/LAMMPS.svn/ tar -xvf Lammps_meam_test_r24.tar
For mc2 test cases, you need to enter the folder created for each test case and submit your simulation request via a PBS script by typing
Test case 1:
cd ~/Codes/LAMMPS.svn/runs/AuSiTestCase1/ qsub golammps.pbs
Test case 2:
cd ~/Codes/LAMMPS.svn/runs/AuSiTestCase2/ qsub golammps.pbs
If you prefer to work on WCR, you can avoid touching the PBS scripts. Instead you can type
Test case 1:
cd ~/Codes/LAMMPS.svn/runs/AuSiTestCase1/ ../../src/lmp_wcr -in in.md
Test case 2:
cd ~/Codes/LAMMPS.svn/runs/AuSiTestCase2/ ../../src/lmp_wcr -in in.md
When the simulation is finished, in the same folder, it will create a log.md file contains potential energy value and a dump.md file contains force information. To check these results with the provided Matlab code, you need to copy these two files into the TEST folder generated by unzipping Energy and force check. The Matlab code will tell you if you pass the tests via the messages displayed on screen.
Test case:Comparsion with MD++
(for LAMMPS before revision 24 and MD++ before revision 452)
This section illustrates how to compare the simulation result from LAMMPS using the MEAM potential with that from MD++. A successful test will show MD++ and LAMMPS report the same potential energy and forces from a given atoms' configuration.
MD++ test case
Supposing you've known how to run MD++ code from our manuals and downloaded the MD++ package from our SVN server, you can do the following test case.
Downlaod md++_meam_testcase.tar.gz, which contains a input tcl script, three configuration cn files and a help text file.
Unzip this gz file under the certain folder using the command
mkdir -p ~/Codes/MD++.svn/scripts/work/si_au cd ~/Codes/MD++.svn/scripts/work/si_au tar zxvf md++_meam_testcase.tar.gz
Compile the MEAM potential typing the below command and make sure that in src/Makefile file -D_EROSE_FUNCTION=3 is specified under meam-lammps.
make meam-lammps build=R SYS=mc2
Run the simulation within the MD++ home folder. for example,
bin/meam-lammps_mc2 scripts/work/si_au/si_au_compare.tcl AuSiTestCase1
This will read the atoms' configuration from AuSiTestCase1.cn, visualize the atoms and calculate the potential and forces of the system. Meanwhile, it provides one .lammps file for LAMMPS and one .cfg file for Atomeye. The potential energy in this case should be -18874.6969309944. You can compare this value with the number from LAMMPS later.
LAMMPS test case
Download lammps_meam_testcase.tar.gz and unzip it by the command
mkdir ~/Codes/LAMMPS.svn/runs/AuSi_meam_test cd ~/Codes/LAMMPS.svn/runs/AuSi_meam_test tar zxvf lammps_meam_testcase.tar.gz
In this archive file, the in.md is the input script forLAMMPS. The golammps.pbs can submit your simulation request onto the server. Run this LAMMPS test case, you should type
qsub golammps.pbs
When the simulation is finished, in the same folder, you can check the potential information in the lammps.out file and the forces information in the dump.mdfile. Specifically, if you read the configuration from AuSiTestCase1.lammpsdata, you would expect the potential and forces results are exactly the same as those come from MD++ simulation, like the potential should be -1.88746969e+04.
Seunghwa's Instructions on How to Use MEAM Au-Si Potential
Adriano: please past the content here.
- ↑ Seunghwa Ryu and Wei Cai, "Molecular Dynamics Simulations of Gold-Catalyzed Growth of Silicon Bulk Crystals and Nanowires", Journal of Materials Research, 26, 2199 (2011).
- ↑ Seunghwa Ryu and Wei Cai, "A Gold-Silicon Potential Fitted to the Binary Phase Diagram", Journal of Physics Condensed Matter, 22, 055401 (2010).