将MS中的结构转化为POSCAR的三种方法与Python脚本!

方法1:VESTA软件.cif转POSCAR
(1) Materials Studio顶栏,File-Export,保存类型选.cif
将MS中的结构转化为POSCAR的三种方法与Python脚本!
将MS中的结构转化为POSCAR的三种方法与Python脚本!
(2) 用Vesta打开该cif文件
将MS中的结构转化为POSCAR的三种方法与Python脚本!
(3) 在Vesta中点File-Export Data, 保存类型选*.vasp, POSCAR。点OK后,*.vasp文件即为我们所需要的POSCAR.
将MS中的结构转化为POSCAR的三种方法与Python脚本!
将MS中的结构转化为POSCAR的三种方法与Python脚本!
 
方法2:VESTA软件.cell转POSCAR
(1) 在Materials Studio中激活结构,点击Files, Save files
将MS中的结构转化为POSCAR的三种方法与Python脚本!
将MS中的结构转化为POSCAR的三种方法与Python脚本!
(2) 右键单击新生成的文件夹,点Open Containing Folder
将MS中的结构转化为POSCAR的三种方法与Python脚本!
(3) 找到*.cell文件,用VESTA打开
将MS中的结构转化为POSCAR的三种方法与Python脚本!
将MS中的结构转化为POSCAR的三种方法与Python脚本!
(4) 在Vesta中点File-Export Data, 保存类型选*.vasp, POSCAR。点OK后,*.vasp文件即为我们所需要的POSCAR.
将MS中的结构转化为POSCAR的三种方法与Python脚本!
将MS中的结构转化为POSCAR的三种方法与Python脚本!
将MS中的结构转化为POSCAR的三种方法与Python脚本!
方法3:Python脚本
本脚本转载自计算材料学(ID:jisuancailiao)-杨霈(Yaust博士)
将此脚本放在上文得到的含有文件*.cell的目录下(*表示文件名),然后将脚本中第十九行cellname=‘’中引号里加上文件名。
现在给出一个例子,假如目录下的cell文件文件名为perfect_4_3_1.cell,那么,脚本第十九行就要改为cellname=’perfect_4_3_1.cell’。
下面给出Python脚本cell_into_POSCAR.py:
#!/usr/bin/env python
#——————————————————————————-
# File: cell_into_POSCAR.py
#
# Author: Pei Yang
#
# Organization:School of Physics, Beijing Institute of Technology
#              China Academy ofEngineering Physics
#
# Create Date: 2017-09-15 23:59:55
#
# Comment:
#  Put the *.cell file (for exampleperfect_4_3_1.cell from Materials Studio into
#  the document and execute this file, aPOSCAR file will be given.
#
#——————————————————————————-
cellname=’perfect_4_3_1.cell’
cell = open(cellname,’r’)
poscar = open(‘POSCAR’,’w’)
poscar.write(“POSCAR of “)
poscar.write(cellname)
poscar.write(” is written by cell_into_POSCAR.py(Pei Yang).”)
poscar.write(“n”)
poscar.write(“1.000000 n”)
cell.readline()
for i in range(3):
lattice_vector=cell.readline()
poscar.write(lattice_vector.strip())
poscar.write(“n”)
cell.readline()
cell.readline()
cell.readline()
n=1
atom=[]
while True:
atom.append(cell.readline().split())
ifatom[(n-1)][0]==”%ENDBLOCK”:
break
else:
n=n+1
poscar.write(‘%s  ‘%(atom[0][0]))
for i in range(1,n-1):
if atom[i][0]!=atom[i-1][0]:
poscar.write(‘%s  ‘%(atom[i][0]))
poscar.write(“n “)
atom_number=1
for i in range(1,n):
if atom[i][0]==atom[i-1][0]:
atom_number=atom_number+1
else:
poscar.write(‘%s  ‘%atom_number)
atom_number=1
poscar.write(“n “)
poscar.write(“Direct”)
poscar.write(“n “)
for i in range(n-1):
poscar.write(‘%s ‘%(atom[i][1]))
poscar.write(‘%s ‘%(atom[i][2]))
poscar.write(‘%s ‘%(atom[i][3]))
poscar.write(‘%s ‘%(atom[i][0]))
poscar.write(‘n ‘)
cell.close()
poscar.close()
【做计算 找华算】华算科技专业靠谱、正版商业软件版权、全职海归计算团队,10000+成功案例!
用户研究成果已发表在Nature子刊、Science子刊、AM系列、ACS系列、RSC系列、EES等国际顶级期刊。
电话同微信:13622320172
将MS中的结构转化为POSCAR的三种方法与Python脚本!

声明:如需转载请注明出处(华算科技旗下资讯学习网站-学术资讯),并附有原文链接,谢谢!
(0)
上一篇 2025年3月17日 下午3:27
下一篇 2025年3月17日 下午4:09

相关推荐