Use Au-Si MEAM Potential in LAMMPS: Difference between revisions

From Micro and Nano Mechanics Group
Jump to navigation Jump to search
No edit summary
 
(25 intermediate revisions by 2 users not shown)
Line 3: Line 3:
Use Au-Si MEAM Potential in LAMMPS </STRONG></font></P>
Use Au-Si MEAM Potential in LAMMPS </STRONG></font></P>
<DIV>
<DIV>
<P ALIGN="CENTER"><STRONG>Yanming wang, Seunghwa Ryu and Wei Cai</STRONG></P>
<P ALIGN="CENTER"><STRONG>Yanming Wang, Seunghwa Ryu and Wei Cai</STRONG></P>
</DIV>
</DIV>
<P ALIGN="CENTER">[[June]], [[2012]]</P>
<P ALIGN="CENTER"> Created June, 2012, Last modified July, 2014</P>
<P>
<P>


Line 15: Line 15:
[http://lammps.sandia.gov/ 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.
[http://lammps.sandia.gov/ 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 Codes
mkdir -p ~/Codes/LAMMPS.svn
cd Codes
cd ~/Codes/LAMMPS.svn
svn co https://micro.stanford.edu/svn/LAMMPS .
mkdir LAMMPS.svn
cd 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.
Typing the following SVN command from within the "LAMMPS.svn" directory, you can update your LAMMPS package.
svn update
svn update



== Compiling MEAM potential in LAMMPS==
== 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 [http://micro.stanford.edu/wiki/How_to_compile_LAMMPS How to compile LAMMPS].

Please notice the following content is only for the older version LAMMPS.


=== Preparing for parallel run ===
=== Preparing for parallel run ===

First, you need to download the [[media:fftw.tar.gz |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.
First, you need to download the [[media:fftw.tar.gz |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/
cd ~/usr
tar -zxvf fftw.tar.gz
tar zxvf fftw.tar.gz


ALso add the following lines at the end of your '''~/.bash_profile''' file to clarify the compiler.
ALso add the following lines at the end of your '''~/.bash_profile''' file to clarify the compiler.
Line 60: Line 64:
This will make lmp_mc2 in LAMMPS.svn/src/ directory.
This will make lmp_mc2 in LAMMPS.svn/src/ directory.


==Test cases==
<references/>

===MD++ test cases===
Assuming you've got the latest MD++ package (e.g., revision 452 or later) from the '''svn''' server, you can download [[Media:Md++_meam_test_r452.tar |MD++ test case]] that contains one input '''tcl''' script 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/runs'''folder. 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 [[Media:Matlab_meam_check.tar |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 [[Media:Lammps_meam_test_r24.tar |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 [[Media:Matlab_meam_check.tar |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 [http://micro.stanford.edu/wiki/MD%2B%2B_Manuals our manuals] and downloaded the MD++ package from our SVN server, you can do the following test case.

Download [[media:md++_meam_testcase.tar.gz |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

EPOT = -18874.6969309944

You can compare this value with the number from LAMMPS later.

Run the second test case,

bin/meam-lammps_mc2 scripts/work/si_au/si_au_compare.tcl AuSiTestCase2

You should get this potential energy

EPOT=-19301.21011320015

You can compare this value with the number from LAMMPS later.

===LAMMPS test case===

Download [[Media:lammps_meam_testcase.tar.gz |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 for[http://lammps.sandia.gov/doc/Manual.html LAMMPS]. 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.md'''file. 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.


==Instructions on How to Use MEAM Au-Si Potential==

First download the potential from the following link:

https://docs.google.com/open?id=0B1TUP8O860rBVnBITjdIby1mbDQ

which is this file meamRyu_LAMMPS_overwrite.tar

Then make a new lammps directory because it overwrites a few
MEAM Fortran files.

copy "meamRyu_LAMMPS_overwrite.tar" to LAMMPS/directory

and unzip the file.

Them compile meam file with

make meam-lammps build=R SYS=intel

For validation, do following test.

cd runs/meamRyu/ and run the .in file for two different configurations

for
testcase 1, -1.88746969e+04 for PotEng from lammps.out file

for
testcase 2, -1.93012101e+04 for PotEng from lammps.out file

If you get those two values, you got the JPCM09 potential correctly.

Latest revision as of 05:09, 8 September 2015

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 tcl script 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.

Download 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

EPOT = -18874.6969309944

You can compare this value with the number from LAMMPS later.

Run the second test case,

bin/meam-lammps_mc2 scripts/work/si_au/si_au_compare.tcl AuSiTestCase2

You should get this potential energy

 EPOT=-19301.21011320015

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.


Instructions on How to Use MEAM Au-Si Potential

First download the potential from the following link:

https://docs.google.com/open?id=0B1TUP8O860rBVnBITjdIby1mbDQ

which is this file meamRyu_LAMMPS_overwrite.tar

Then make a new lammps directory because it overwrites a few MEAM Fortran files.

copy "meamRyu_LAMMPS_overwrite.tar" to LAMMPS/directory

and unzip the file.

Them compile meam file with

make meam-lammps build=R SYS=intel

For validation, do following test.

cd runs/meamRyu/ and run the .in file for two different configurations

for

testcase 1, -1.88746969e+04 for PotEng from lammps.out file

for

testcase 2, -1.93012101e+04 for PotEng from lammps.out file

If you get those two values, you got the JPCM09 potential correctly.