首页 > 其他 > 详细

Find T_min and F_max in selective dynamics of POSCAR

时间:2021-07-09 00:54:17      阅读:19      评论:0      收藏:0      [点我收藏+]

#! /share/apps/anaconda3/bin/python
# to find maximal "F" and minimum "T"in VASP‘s POSCAR Selective Dynamics
# Attention:only suitable for all "T" (T T T) and all "F" (F F F)

with open(POSCAR)as pos:
    lines = pos.readlines()
    poss = []   #total file,saved as list
    atoms = []  #to calculate total atoms
    coor = []   #to save atom coordinate
    total = 0   #total atoms
    F_max = 0 
    T_min = 1
    for i in lines:
      poss.append(i.rstrip())
    tem=poss[6]
    atoms=tem.split()
    for k in atoms:
       total = total + int(k)
    for j in poss[9:(9+total)]:
      coor=j.split()
      z=coor[2]
      z=float(z.rstrip())
      tf=coor[3]
      if tf==T:
        if z < T_min:
          T_min = z
      if tf==F:
        if z > F_max:
          F_max = z
    printT_min is, T_min
    printF_max is, F_max 

 

Find T_min and F_max in selective dynamics of POSCAR

原文:https://www.cnblogs.com/bangbro/p/14988148.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!