thirdorder安装教程
产生用于三阶力常数计算的文件
软件下载地址
官网:http://www.shengbte.org/downloads
安装编译
1 解压进入文件夹
tar -jxvf thirdorder-v1.1.1-8526f47.tar.bz2
cd thirdorder
2 修改setup.py 加入spglib的库路径
修改后如下
注:如果include文件夹里没有spglib文件夹,手动建一个并把spglib.h拷贝进去就行。
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import numpy
from distutils.core import setup
from distutils.extension import Extension
# Add the location of the "spglib/spglib.h" to this list if necessary.
# Example: INCLUDE_DIRS=["/home/user/local/include"]
INCLUDE_DIRS = ["/home/wh/software/spglib-master/usr/local/include"]
# Add the location of the spglib shared library to this list if necessary.
# Example: LIBRARY_DIRS=["/home/user/local/lib"]
LIBRARY_DIRS = ["/home/wh/software/spglib-master/usr/local/lib"]
# Set USE_CYTHON to True if you want include the cythonization in your build
# process.
USE_CYTHON = False
ext = ".pyx" if USE_CYTHON else ".c"
extensions = [
Extension(
"thirdorder_core", ["thirdorder_core" + ext],
include_dirs=[numpy.get_include()] + INCLUDE_DIRS,
library_dirs=LIBRARY_DIRS,
runtime_library_dirs=LIBRARY_DIRS,
libraries=["symspg"])
]
if USE_CYTHON:
from Cython.Build import cythonize
extensions = cythonize(extensions)
setup(name="thirdorder", ext_modules=extensions)
修改完成后编译安装
python setup.py install
运行命令
以VASP程序的POSCAR为例
1 拷贝源代码中的 thirdorder_common.py 和 thirdorder_vasp.py 两个文件到POSCAR目录下
2 运行命令
thirdorder_vasp.py sow|reap na nb nc cutoff[nm/-integer]
#example
thirdorder_vasp.py sow|reap 6 6 6 0.5 #0.5nm的截断半径
thirdorder_vasp.py sow|reap 6 6 6 -3 #第三最近邻截断