OpenKIM is an interatomic potential repository and an online framework for making molecular simulations reliable, reproducible, and portable.
以上说明来自网址:OpenKIM
前提
已安装LAMMPS
安装
查看安装方法
在LAMMPS的文件夹/home/peachrl/LAMMPS/lammps-3Mar20/lib/kim中,阅读README,得知将通过cmake进行安装。
安装cmake
在CMake下载安装包。
- 将安装包解压,进入cmake-3.18.0-rc2文件夹。
终端输入
./bootstrap
- 若出现
Could NOT find OpenSSL
问题,根据提示安装OpenSSL :apt-get install libssl-dev
- 若出现
make -j4
sudo make -j4 install
- 查看安装情况
cmake --version
安装kim-api
- 进入LAMMPS中/home/peachrl/LAMMPS/lammps-3Mar20/lib/kim文件夹。
- 下载kim-api-2.1.3。(有不同版本,具体见Obtaining KIM Models)
- 解压到当前文件夹。
$ cd kim-api-2.1.3
$ mkdir build && cd build
$ cmake .. -DCMAKE_INSTALL_PREFIX=${PWD}/../../installed-kim-api-2.1.3
- 若出现
No CMAKE_Fortran_COMPILER could be found.
,安装gfortran:$ sudo apt install gfortran
- 若出现
$ make -j4
$ make -j4 install
$ printf "${PWD}/installed-kim-api-2.1.3" > ./kim-prefix.txt
现在可以删除压缩包和安装包了
$ cd ../../ $ rm -rf kim-api-2.1.3 $ rm -rf kim-api-2.1.3.txz
build LAMMPS with the KIM package installed
进入/home/peachrl/LAMMPS/lammps-3Mar20/src文件夹,重新make ubuntu(之前make过的):
$ make yes-kim $ sudo make ubuntu -j4
移动和改个名:
$ mv lmp_ubuntu /home/peachrl/LAMMPS/bin/lmp4RMSPm.kim
添加path
export PATH=/home/peachrl/LAMMPS/lammps-3Mar20/lib/kim/installed-kim-api-2.1.3/bin:$PATH
使用
==测试算例:LAMMPS自带的算例/home/peachrl/LAMMPS/lammps-3Mar20/examples/reax/CHO,将其改为使用OpenKIM。==
安装所需的KIM Model
在OpenKIM网站上找到需要的势:Sim_LAMMPS_ReaxFF_ChenowethVanDuinGoddard_2008_CHO__SM_584143153761_001
$ source kim-api-activate
$ kim-api-collections-management install user Sim_LAMMPS_ReaxFF_ChenowethVanDuinGoddard_2008_CHO__SM_584143153761_001
改写in文件
# KIM potential for CHO system
# .....
kim_init Sim_LAMMPS_ReaxFF_ChenowethVanDuinGoddard_2008_CHO__SM_584143153761_001 real
read_data data.CHO
kim_interactions H C O
neighbor 2 bin
neigh_modify every 10 delay 0 check no
fix 1 all nve
fix 3 all temp/berendsen 500.0 500.0 100.0
timestep 0.25
#dump 1 all atom 30 dump.reax.cho
run 3000