Skip to content

Commit

Permalink
Added some descriptions in Si LAMMPS tutorial.
Browse files Browse the repository at this point in the history
  • Loading branch information
ttadano committed Oct 30, 2017
1 parent 88e40a5 commit da0c502
Showing 1 changed file with 61 additions and 2 deletions.
63 changes: 61 additions & 2 deletions docs/source/tutorial_pages/02_silicon_lammps.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,67 @@

.. _label_tutorial_02:

.. raw:: html

<style> .red {color:red} </style>

.. role:: red

Silicon with LAMMPS
-------------------

In this page, we show how to use ALAMODE together with the LAMMPS.
As a simple example, we calculate phonon dispersion curves of Si using the Stillinger-Weber potential implemented in LAMMPS.
Here, we demonstrate how to use ALAMODE together with LAMMPS.
All input files can be found in the **example/Si_LAMMPS** directory.
Before starting the tutorial, please build the LAMMPS code (e.g. ``lmp_serial``).

As a simple example, we calculate phonon dispersion curves of Si using the Stillinger-Weber (SW) potential implemented in LAMMPS.
First, you need to make two input files for LAMMPS: :red:`in.sw` and :red:`Si222.lammps` (file name is arbitrary, though).
:red:`in.sw` is the main input file for LAMMPS, in which the type of the empirical force field is defined as follows:

.. literalinclude:: ../../example/Si_LAMMPS/in.sw

In the file :red:`Si222.lammps`, the lattice vectors and atomic positions of a relaxed supercell structure are defined as follows:

.. literalinclude:: ../../example/Si_LAMMPS/Si222.lammps
:lines: 1-30

Next, please generate a set of structure files for displaced configurations using
the python script::

$ python displace.py --LAMMPS=Si222.lammps --mag=0.01 --prefix harm si222.pattern_HARMONIC
$ python displace.py --LAMMPS=Si222.lammps --mag=0.04 --prefix cubic si222.pattern_ANHARM3

The pattern files can be generated by the **alm** code as decribed :ref:`here <tutorial_Si_step1>`.
The above commands create ``harm1.lammps`` and ``cubic[01-20].lammps`` structure files.
Then, run the following script and calculate atomic forces for the generated structures.
This should finish in a few seconds.

::

!#/bin/bash

cp harm1.lammps tmp.lammps
lmp_serial < in.sw > log.lammps
cp DISP DISP.harm1
cp FORCE FORCE.harm1

for ((i=1;i<=20;i++))
do
num=`echo $i | awk '{printf("%02d",$1)}'`
cp cubic${num}.lammps tmp.lammps
lmp_serial < in.sw > log.lammps
cp DISP DISP.cubic${num}
cp FORCE FORCE.cubic${num}
done

After the force calculations are finished, displacement and force data sets
can be generated as follows::

$ python extract.py --LAMMPS=Si222.lammps --get=disp DISP.harm1 > disp.dat
$ python extract.py --LAMMPS=Si222.lammps --get=force FORCE.harm1 > force.dat

$ python extract.py --LAMMPS=Si222.lammps --get=disp DISP.cubic* > disp3.dat
$ python extract.py --LAMMPS=Si222.lammps --get=force FORCE.cubic* > force3.dat

Then, using these files and following exactly the same procedure as the last tutorial section,
you can calculate phonons and thermal conductivity of Si using the SW potential.

0 comments on commit da0c502

Please sign in to comment.