VASP固定基矢优化结构

对于二维材料,如何固定z方向晶胞参数不变(固定z轴),优化x、y晶胞参数呢?

网上方法原理接近,主要是修改constr_cell_relax.F文件,按发布时间顺序可分三种:

方案一:2018-3-19 chempeng 《VASP固定基矢优化结构》链接1链接2

INCAR中ISIF=3,修改/src/constr_cell_relax.F,

!-----------------------------------------------------------------------
!
! At present, VASP does not allow to relax the cellshape selectively
! i.e. for instance only cell relaxation in x direction.
! To be more precisse, this behaviour can not be achived via the INCAR
! or POSCAR file.
! However, it is possible to set selected components of the stress tensor
! to zero.
! The most conveninent position to do this is the routines 
! CONSTR_CELL_RELAX  (constraint cell relaxation).
! FCELL contains the forces on the basis vectors.
! These forces are used to modify the basis vectors according
! to the following equations:
!
!      A_OLD(1:3,1:3)=A(1:3,1:3) ! F90 style 
!      DO J=1,3
!      DO I=1,3
!      DO K=1,3
!        A(I,J)=A(I,J) + FCELL(I,K)*A_OLD(K,J)*STEP_SIZE
!      ENDDO
!      ENDDO
!      ENDDO
! where A holds the basis vectors (in cartesian coordinates).
!
!-----------------------------------------------------------------------

      SUBROUTINE CONSTR_CELL_RELAX(FCELL)
      USE prec
      REAL(q) FCELL(3,3)
      DO I=1,3
      ! fix z
        FCELL(3,I)=0
        FCELL(I,3)=0
      ! ! fix x
        ! FCELL(1,I)=0
        ! FCELL(I,1)=0
      ! ! fix y
        ! FCELL(2,I)=0
        ! FCELL(I,2)=0        
      ENDDO

!     just one simple example
!     relaxation in x directions only
!      SAVE=FCELL(1,1)
!      FCELL=0   ! F90 style: set the whole array to zero
!      FCELL(1,1)=SAVE
!     relaxation in z direction only
!      SAVE=FCELL(3,3)
!      FCELL=0   ! F90 style: set the whole array to zero
!      FCELL(3,3)=SAVE

      RETURN
      END SUBROUTINE

固定z轴,弛豫x、y轴。若以WSe2为例,POSCAR为,

Se2 W
1.0
        3.2899999619         0.0000000000         0.0000000000
       -1.6449999809         2.8492235454         0.0000000000
        0.0000000000         0.0000000000        12.9700002670
    W   Se
    2    4
Direct
     0.333333343         0.666666687         0.250000000
     0.666666627         0.333333313         0.750000000
     0.333333343         0.666666687         0.620999992
     0.666666627         0.333333313         0.379000008
     0.666666627         0.333333313         0.120999992
     0.333333343         0.666666687         0.879000008

CONTCAR为,

Se2 W                                   
   1.00000000000000     
     3.2988809157024286   -0.0000009118894020    0.0000000000000000
    -1.6494412476071403    2.8569140950044987    0.0000000000000000
     0.0000000000000000    0.0000000000000000   12.9700002669999996
   W    Se
     2     4
Direct
  0.3333332795709047  0.6666667206026287  0.2499999920982164
  0.6666666936724241  0.3333332807801080  0.7499999970341932
  0.3333333290727808  0.6666666860461303  0.6193498945590813
  0.6666666393043650  0.3333333132884654  0.3806501104445901
  0.6666666352755654  0.3333333096490192  0.1193498971153154
  0.3333333331039529  0.6666666896336484  0.8806501087486037
 
  0.00000000E+00  0.00000000E+00  0.00000000E+00
  0.00000000E+00  0.00000000E+00  0.00000000E+00
  0.00000000E+00  0.00000000E+00  0.00000000E+00
  0.00000000E+00  0.00000000E+00  0.00000000E+00
  0.00000000E+00  0.00000000E+00  0.00000000E+00
  0.00000000E+00  0.00000000E+00  0.00000000E+00

方案二:2018-5-20 Chengcheng-Xiao github-VASP_OPT_AXIS和2018-09-06 Mr.ZhengGang 《VASP固定晶胞方向不优化》。

INCAR中ISIF=3,修改/src/constr_cell_relax.F,

      SUBROUTINE CONSTR_CELL_RELAX(FCELL)
      USE PREC
      REAL(Q) FCELL(3,3), SAVE(3)
      LOGICAL FILFLG
      INTEGER ICELL(3)

      INQUIRE(FILE='OPTCELL',EXIST=FILFLG)
      IF (FILFLG) THEN
        OPEN(67,FILE='OPTCELL',FORM='FORMATTED',STATUS='OLD')
          READ(67,"(3I1)") (ICELL(I),I=1,3)
        CLOSE(67)
        DO I=1,3
          SAVE(I)=FCELL(I,I)
        ENDDO
        FCELL=0.0d0
        DO I=1,3
          IF (ICELL(I)==1) FCELL(I,I)=SAVE(I)
        ENDDO
      ENDIF

!     just one simple example
!     relaxation in x directions only
!      SAVE=FCELL(1,1)
!      FCELL=0   ! F90 style: set the whole array to zero
!      FCELL(1,1)=SAVE

      RETURN
      END SUBROUTINE

计算目录中增加OPTCELL,

110 #1表示优化,0表示不优化;三个数字依次对应于xyz方向。比如 110 表示z轴不优化;001 表示x和y轴都不优化。

CONTCAR为,

Se2 W                                   
   1.00000000000000     
     3.2988809154146170    0.0000000000000000    0.0000000000000000
    -1.6494404576571737    2.8569136389682201    0.0000000000000000
     0.0000000000000000    0.0000000000000000   12.9700002669999996
   W    Se
     2     4
Direct
  0.3333332763757423  0.6666667206116557  0.2499999920871069
  0.6666666968682680  0.3333332807560439  0.7499999970274550
  0.3333333274478362  0.6666666860442724  0.6193498945625138
  0.6666666409113122  0.3333333132431017  0.3806501104629225
  0.6666666368917313  0.3333333096672763  0.1193498970910784
  0.3333333315051024  0.6666666896776502  0.8806501087689232
 
  0.00000000E+00  0.00000000E+00  0.00000000E+00
  0.00000000E+00  0.00000000E+00  0.00000000E+00
  0.00000000E+00  0.00000000E+00  0.00000000E+00
  0.00000000E+00  0.00000000E+00  0.00000000E+00
  0.00000000E+00  0.00000000E+00  0.00000000E+00
  0.00000000E+00  0.00000000E+00  0.00000000E+00

注意:Chengcheng-Xiao github-VASP_OPT_AXIS还可以对xx xy xz yx yy yz zx zy zz进行细致固定或弛豫。

方案三:2019-5-5 Jincheng Liu 《VASP固定基矢优化结构方法》链接1链接2(已发邮件申请转载部分内容,暂时未收到回复;此处代码不列出,请直接点击原始链接。)以及Yong He《VASP计算能带和态密度》。

INCAR中ISIF=3,修改/src/constr_cell_relax.F和增加OPTCELL。

CONTCAR为,

Se2 W                                   
   1.00000000000000     
     3.2988809156770467   -0.0000009123103790    0.0000000000000000
    -1.6494412475791849    2.8569140951081820    0.0000000000000000
     0.0000000000000000    0.0000000000000000   12.9700002669999996
   W    Se
     2     4
Direct
  0.3333332795922008  0.6666667206713092  0.2499999920944698
  0.6666666936429270  0.3333332808269298  0.7499999970276957
  0.3333333290707461  0.6666666860010831  0.6193498945606164
  0.6666666392590765  0.3333333132864525  0.3806501104582833
  0.6666666352395026  0.3333333095723708  0.1193498971142689
  0.3333333331955395  0.6666666896418546  0.8806501087446658
 
  0.00000000E+00  0.00000000E+00  0.00000000E+00
  0.00000000E+00  0.00000000E+00  0.00000000E+00
  0.00000000E+00  0.00000000E+00  0.00000000E+00
  0.00000000E+00  0.00000000E+00  0.00000000E+00
  0.00000000E+00  0.00000000E+00  0.00000000E+00
  0.00000000E+00  0.00000000E+00  0.00000000E+00

上述资料打包下载