Eastsheng's Wiki

Phonon package安装与使用

2023-04-22 18:11:28

[toc]

1. 安装phonon

1
2
3
4
5
6
cd lammps/src
make ps # 查看是否安装phonon
make yes-USER-PHONON # 安装phonon
# or make yes-PHONON # 安装phonon
make clean
make mpi -j8 # 重新编译lammps

2. 运行Graphene例子

1
2
3
4
5
6
7
cd lammps/examples/USER/phonon/4-Graphene # LAMMPS 2020
# or
cd lammps/examples/PACKAGES/phonon/4-Graphene #LAMMPS 2023
# RUN LAMMPS
mpirun -np 8 lmp_mpi -i in.graphene
# auxiliary analysing code "phana" to obtain "pdisp.dat"
phana Graphene.bin.6000000 < in.disp

3. 安装Phana

  • phana
1
git clone https://github.com/lingtikong/phana
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
.SUFFIXES : .o .cpp
# compiler and flags
CC = g++ -Wno-unused-result -fopenmp
LINK = $(CC) -static
CFLAGS = -O3 $(DEBUG) $(UFLAG)

OFLAGS = -O3 $(DEBUG)
INC = $(LPKINC) $(TCINC) $(SPGINC) $(FFTINC)
LIB = $(LPKLIB) $(TCLIB) $(SPGLIB) $(FFTLIB)

# cLapack library needed
LPKINC = -I/opt/clapack/3.2.1/include
LPKLIB = -L/opt/clapack/3.2.1/lib -lclapack -lblas -lf2c -lm

# Tricubic library needed
TCINC = -I/opt/tricubic/1.0/include
TCLIB = -L/opt/tricubic/1.0/lib -ltricubic

# spglib, used to get the irreducible q-points
# if SFLAG is not set, spglib won't be used.
#SFLAG = -DUseSPG
#SPGINC = -I/opt/spglib/1.16.5/include
#SPGLIB = -L/opt/spglib/1.16.5/lib -lsymspg

# FFTW 3, used to deduce the force constants in real space
# if FFLAG is not set, fftw won't be used.
#FFLAG = -DFFTW3
#FFTINC = -I/opt/fftw/3.3.7/include
#FFTLIB = -L/opt/fftw/3.3.7/lib -lfftw3

# Debug flags
# DEBUG = -g -DDEBUG
UFLAG = $(SFLAG) $(FFLAG)

...
...
1
2
3
4
5
6
7
8
9
cd /opt/
mkdir spglib
cd spglib
wget https://zh.osdn.net/projects/sfnet_spglib/downloads/spglib/spglib-1.9/spglib-1.9.7.tar.gz
tar -zxvf spglib-1.9.7.tar.gz
cd spglib-1.9.7
./configure --prefix=/opt/spglib/1.9.7
make
sudo make install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
cd /opt/
mkdir clapack
cd clapack
wget www.netlib.org/clapack/clapack.tgz
tar xvf clapack.tgz
mv CLAPACK-3.2.1 3.2.1
cd 3.2.1
mv make.inc.example make.inc
make f2clib # get `./F2CLIBS/libf2c.a`
make blaslib # get `./blas_LINUX.a`
make # get `./tmglib_LINUX.a` and `./lapack_LINUX.a`
# 忽略TESTING报错
mkdir lib
cp ./F2CLIBS/libf2c.a ./lib
cp ./blas_LINUX.a ./lib
cp ./tmglib_LINUX.a ./lib
cp ./lapack_LINUX.a ./lib
1
2
3
4
5
6
7
8
cd /opt
mkdir tricubic
cd tricubic
git clone https://github.com/nbigaouette/libtricubic.git
cd ./libtricubic/tricubic-1.0
./configure --prefix=/opt/tricubic/1.0
make
sudo make install
1
2
3
4
5
6
7
8
cd /opt
mkdir fftw
cd fftw
wget http://www.fftw.org/fftw-3.3.10.tar.gz
cd fftw-3.3.10
./configure --prefix=/opt/fftw/3.3.10
make
make install
  • 编译phana
1
2
3
cd phana
# 检查 Makefile 库路径
sudo make

4. generate pdisp.eps

1
gnuplot plot.pdisp
  • pdisp