src/constr_cell_relax.F
as follows, and recompile it.--- src/constr_cell_relax.F 2020-08-25 23:27:21.000000000 +0800
+++ ../vasp.6.1.2.ext/src/constr_cell_relax.F 2020-12-02 09:53:37.541195944 +0800
@@ -27,17 +27,47 @@
SUBROUTINE CONSTR_CELL_RELAX(FCELL)
USE prec
REAL(q) FCELL(3,3)+ INTEGER FIXCELL(3,3) ! added by Mu
+ LOGICAL FCEXIST !added by Mu
+ INTEGER I,J,IREADFIX ! added by Mu
+ SAVE FIXCELL,IREADFIX ! added by Mu, before DATA
+ DATA IREADFIX /0/ ! added by Mu, 0-read in ,1- not read in
+ DATA FIXCELL /3*1,3*1,3*1/
! 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
+! relaxation in z directions only
! SAVE=FCELL(3,3)
! FCELL=0 ! F90 style: set the whole array to zero
! FCELL(3,3)=SAVE
+! added by Mu
+ IF(IREADFIX==0) THEN
+ INQUIRE(file="FIXCELLCAR",exist=FCEXIST)
+ IF(FCEXIST) THEN
+ OPEN(unit=1983,file="FIXCELLCAR",status="old")
+ DO I=1,3
+ READ(1983,*) (FIXCELL(J,I),J=1,3)
+ END DO
+ CLOSE(1983)
+ WRITE(*,*) "The Matrix for Fixing Cell as Follows:"
+ DO I=1,3
+ WRITE(*,*) (FIXCELL(J,I),J=1,3)
+ END DO
+ WRITE(*,*) "End of Matrix for Fixing Cell."
+ IREADFIX=2
+ ELSE
+ IREADFIX=1
+ END IF
+ END IF
+ IF(IREADFIX==2) THEN
+ DO I=1,3
+ DO J=1,3
+ IF(FIXCELL(J,I) == 0) FCELL(J,I)=0.0
+ END DO
+ END DO
+ END IF
+!!!!!!!!!!! end , added by MU
+
RETURN
END SUBROUTINE END SUBROUTINE
FIXCELLCAR
to working directory to constrain the cell, such as1 1 0
1 1 0
0 0 0
to only allow relaxtion in xy plane.
neb.F
for VTST code as follows, and recompile it.--- ../vtstcode-180/neb.F 2012-07-13 06:18:54.000000000 +0800
+++ src/neb.F 2021-03-01 11:05:21.772776669 +0800
@@ -79,6 +79,12 @@
REAL(q) :: strainA(3,3),strainB(3,3)
REAL(q) :: strain_next(3,3),strain_prev(3,3)
REAL(q) :: displacement, dR+ INTEGER FIXCELL(3,3) ! added by Mu
+ LOGICAL FCEXIST !added by Mu
+ INTEGER IREADFIX ! added by Mu
+ SAVE FIXCELL,IREADFIX ! added by Mu, before DATA
+ DATA IREADFIX /0/ ! added by Mu, 0-read in ,1- not read in
+ DATA FIXCELL /3*1,3*1,3*1/
optflag = .TRUE.
IF (images==0) GOTO 9999@@ -231,9 +237,37 @@
! WRITE(iu6,*) "NEBCELL: stress dot A"
! WRITE(iu6,'(3F13.5)') stress
!ENDIF+ ! added by Mu
+ IF(IREADFIX==0) THEN
+ INQUIRE(file="FIXCELLCAR",exist=FCEXIST)
+ IF(FCEXIST) THEN
+ OPEN(unit=1983,file="FIXCELLCAR",status="old")
+ DO I=1,3
+ READ(1983,*) (FIXCELL(J,I),J=1,3)
+ END DO
+ CLOSE(1983)
+ WRITE(*,*) "The Matrix for Fixing Cell as Follows:"
+ DO I=1,3
+ WRITE(*,*) (FIXCELL(J,I),J=1,3)
+ END DO
+ WRITE(*,*) "End of Matrix for Fixing Cell."
+ IREADFIX=2
+ ELSE
+ IREADFIX=1
+ END IF
+ END IF
+ IF(IREADFIX==2) THEN
+ DO I=1,3
+ DO J=1,3
+ IF(FIXCELL(J,I) == 0) stress(J,I)=0._q
+ END DO
+ END DO
+ END IF
+ !!!!!!!!!!! end , added by MU
stress(2,1)=0._q
stress(3,1)=0._q
stress(3,2)=0._q+
! convert normailized stress back to stress tensor
CALL sdotB(stress,hinv) ! put everything in a big vector
FIXCELLCAR
to working directory.