structural relaxation

Total energy, geometry optimization, DFT+U, spin....

Moderator: bguster

Locked
mohua
Posts: 16
Joined: Mon Feb 22, 2010 3:40 pm

structural relaxation

Post by mohua » Tue Mar 16, 2010 10:08 pm

Hello,
I am trying to do a structural relaxation in two different sets
first, internal optimization with optcell 0 and ionmov 2
then full structural optimization with optcell 2 and ionmov 2

I am using version 6.0.2 and the code stops if I use getxred and getwfk.
So I have to manually start the second set. But I would like to use the relevant files from set1.

My question is what files do I need to do this and how do I include them in the second input file.

I really appreciate your help,
Mohua

david.waroquiers
Posts: 138
Joined: Sat Aug 15, 2009 12:45 am

Re: structural relaxation

Post by david.waroquiers » Wed Mar 17, 2010 11:03 am

Hello,

I think this should work, you can get the wavefunction and reduced coordinates from the previous dataset. Could you post your input and log files (at least the end of the log file, where the code stops). ?

David

mohua
Posts: 16
Joined: Mon Feb 22, 2010 3:40 pm

Re: structural relaxation

Post by mohua » Wed Mar 17, 2010 4:23 pm

Hi David,
I have included the input file and the last part of the log file. I have a question related to this problem. If I need to start the second set manually do I need the wfk function file only ( besides updated xreds) or some other files as well and how do I include them in the input file.
Thank you very much for your time
Mohua


Here is the input file

occopt 1
#tsmear 0.1

# Trying structural optimization first by optcell=0 followed by optcell=2

# parallelization variables

paral_kgb 1
npband 1
npfft 2
npkpt 4

wfoptalg 4
fft_opt_lob 2
fftalg 401
iprcch 0
istwfk 8*1

#Definition of the unit cell

chkprim 0 # allows the run to continue even if the unit cell
# is not primitive

acell 4.0 5.8 5.8 Angstrom



rprim 1.0 0.0 0.0
0.0 1.0 0.0
0.0 0.0 1.0

#angdeg 90 90 90

natom 10 #number of atoms per unit cell

ndtset 2

#Set 1 : Internal coordinate optimization

optcell1 0 # modify nuclear positions but no cell shape and dimension optimization
ionmov1 2
ntime1 150
dilatmx1 1.9
tolmxf1 5.0d-7


natfix 2
iatfix 3 4

# Set 2 : Lattice parameter relaxation (including re-optimization of internal cordinates)

getwfk2 1 # Start with wave functions from data set 1
getxred2 -1 # Start with reduced coordinates from dataset 1

ionmov2 2 #structural optimization by Broyden-Fletcher-Goldfarb-Shanno minimization
optcell2 2
ntime2 100
dilatmx2 1.9
tolmxf2 5.0d-7


#Definition of the atom types

ntypat 3
znucl 19 41 8
typat 2*1 2*2 6*3

#Position of the atoms in the unit cell


xred 0.0000000000E+00 0.0000000000E+00 1.4544481732E-02
0.0000000000E+00 5.0000000000E-01 5.1454448173E-01
5.0000000000E-01 0.0000000000E+00 5.0000000000E-01
5.0000000000E-01 5.0000000000E-01 0.0000000000E+00
0.0000000000E+00 0.0000000000E+00 5.3900600014E-01
0.0000000000E+00 5.0000000000E-01 3.9006000143E-02
5.0000000000E-01 2.4503629129E-01 2.8755788970E-01
5.0000000000E-01 7.4503629129E-01 7.8755788970E-01
5.0000000000E-01 2.5496370871E-01 7.8755788970E-01
5.0000000000E-01 7.5496370871E-01 2.8755788970E-01

# Definition of plane wave basis set

ecut 30.0 # Maximal kinetic energy cut-off, in Hartree
ecutsm 0.5


#Exchange-correlation functional

ixc 11 # GGA, Perdew-Burke-Ernzerhof GGA functional


#Definition of the k-point grid

kptopt 1 # Option for the automatic generation of k points, taking
# into account the symmetry

kptrlatt 4 0 0 0 3 0 0 0 3

#ngkpt 4 4 4 # KNbO3 is an insulator. So fewer k points are enough

#nshiftk 1

#shiftk 0.5 0.5 0.5

#Definition of the SCF procedure

diemac 4.0d0 #suitable for wide gap insulators
nstep 150 # Maximal number of SCF cycles
toldff 1.0d-8 # Will stop when, twice in a row, the difference
# between two consecutive evaluations of total energy
# differ by less than toldfe (in Hartree)




Here the end portion of the log file after which it hangs

-0000 ================================================================================
-P-0000
-P-0000 - hdr_check: checking restart file header for consistency -
-P-0000
-P-0000
-P-0000 current calculation restart file
-P-0000 ------------------- ------------
-P-0000
-P-0000 calculation expects a wf_planewave | input file contains a wf_planewave
-P-0000 . ABINIT code version 6.0.2 | ABINIT code version 6.0.2
-P-0000 . date 20100316 bantot 336 natom 10 | date 20100316 bantot 336 natom 10
-P-0000 nkpt 8 nsym 8 ngfft 72, 108, 108 | nkpt 8 nsym 8 ngfft 72, 108, 108
-P-0000 ntypat 3 ecut_eff 108.3000000 | ntypat 3 ecut_eff 108.3000000
-P-0000 usepaw 0 | usepaw 0
-P-0000 usewvl 0 | usewvl 0
-P-0000 rprimd: | rprimd:
-P-0000 7.5589045 0.0000000 0.0000000 | 7.5589045 0.0000000 0.0000000
-P-0000 0.0000000 10.9604116 0.0000000 | 0.0000000 10.9604116 0.0000000
-P-0000 0.0000000 0.0000000 10.9604116 | 0.0000000 0.0000000 10.9604116
-P-0000 nband: | nband:
-P-0000 42 42 42 42 42 42 42 42 | 42 42 42 42 42 42 42 42
-P-0000 symafm: | symafm:
-P-0000 1 1 1 1 1 1 1 1 | 1 1 1 1 1 1 1 1
-P-0000 symrel: | symrel:
-P-0000 1 0 0 0 1 0 0 0 1 | 1 0 0 0 1 0 0 0 1
-P-0000 1 0 0 0 1 0 0 0 1 | 1 0 0 0 1 0 0 0 1
-P-0000 -1 0 0 0 -1 0 0 0 1 | -1 0 0 0 -1 0 0 0 1
-P-0000 -1 0 0 0 -1 0 0 0 1 | -1 0 0 0 -1 0 0 0 1
-P-0000 -1 0 0 0 1 0 0 0 1 | -1 0 0 0 1 0 0 0 1
-P-0000 -1 0 0 0 1 0 0 0 1 | -1 0 0 0 1 0 0 0 1
-P-0000 1 0 0 0 -1 0 0 0 1 | 1 0 0 0 -1 0 0 0 1
-P-0000 1 0 0 0 -1 0 0 0 1 | 1 0 0 0 -1 0 0 0 1
-P-0000 typat: | typat:
-P-0000 1 1 2 2 3 3 3 3 3 3 | 1 1 2 2 3 3 3 3 3 3
-P-0000 so_psp : | so_psp :
-P-0000 1 1 1 | 1 1 1
-P-0000 istwfk: | istwfk:
-P-0000 1 1 1 1 1 1 1 1 | 1 1 1 1 1 1 1 1
-P-0000 kpt: | kpt:
-P-0000 0.1250000 0.1666667 0.1666667 | 0.1250000 0.1666667 0.1666667
-P-0000 0.3750000 0.1666667 0.1666667 | 0.3750000 0.1666667 0.1666667
-P-0000 0.1250000 0.5000000 0.1666667 | 0.1250000 0.5000000 0.1666667
-P-0000 0.3750000 0.5000000 0.1666667 | 0.3750000 0.5000000 0.1666667
-P-0000 0.1250000 0.1666667 0.5000000 | 0.1250000 0.1666667 0.5000000
-P-0000 wtk: | wtk:
-P-0000 0.222 0.222 0.111 0.111 0.111 | 0.222 0.222 0.111 0.111 0.111
-P-0000 occ: | occ:
-P-0000 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 | 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0
-P-0000 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 | 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0
-P-0000 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 | 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0
-P-0000 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 | 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0 2.0
-P-0000 2.0 2.0 2.0 2.0 0.0 0.0 2.0 2.0 2.0 | 2.0 2.0 2.0 2.0 0.0 0.0 2.0 2.0 2.0
-P-0000 tnons: | tnons:
-P-0000 0.0000000 0.0000000 0.0000000 | 0.0000000 0.0000000 0.0000000
-P-0000 0.0000000 0.5000000 0.5000000 | 0.0000000 0.5000000 0.5000000
-P-0000 0.0000000 0.0000000 0.0000000 | 0.0000000 0.0000000 0.0000000
-P-0000 0.0000000 0.5000000 0.5000000 | 0.0000000 0.5000000 0.5000000
-P-0000 0.0000000 0.0000000 0.0000000 | 0.0000000 0.0000000 0.0000000
-P-0000 0.0000000 0.5000000 0.5000000 | 0.0000000 0.5000000 0.5000000
-P-0000 0.0000000 0.0000000 0.0000000 | 0.0000000 0.0000000 0.0000000
-P-0000 0.0000000 0.5000000 0.5000000 | 0.0000000 0.5000000 0.5000000
-P-0000 znucl: | znucl:
-P-0000 19.00 41.00 8.00 | 19.00 41.00 8.00
-P-0000 pseudopotential atom type 1: | pseudopotential atom type 1:
-P-0000 pspso 0 pspxc 11 | pspso 0 pspxc 11
-P-0000 pspdat 50213 pspcod 6 zion 9.0 | pspdat 50213 pspcod 6 zion 9.0
-P-0000 pseudopotential atom type 2: | pseudopotential atom type 2:
-P-0000 pspso 0 pspxc 11 | pspso 0 pspxc 11
-P-0000 pspdat 60118 pspcod 6 zion 13.0 | pspdat 60118 pspcod 6 zion 13.0
-P-0000 pseudopotential atom type 3: | pseudopotential atom type 3:
-P-0000 pspso 0 pspxc 11 | pspso 0 pspxc 11
-P-0000 pspdat 51224 pspcod 6 zion 6.0 | pspdat 51224 pspcod 6 zion 6.0
-P-0000 xred: | xred:
-P-0000 0.0000000 -0.0000000 0.0145408 | 0.0000000 -0.0000000 0.0145408
-P-0000 0.0000000 0.5000000 0.5145408 | 0.0000000 0.5000000 0.5145408
-P-0000 0.5000000 -0.0000000 0.5000000 | 0.5000000 -0.0000000 0.5000000
-P-0000 0.5000000 0.5000000 -0.0000000 | 0.5000000 0.5000000 -0.0000000
-P-0000 0.0000000 -0.0000000 0.5389716 | 0.0000000 -0.0000000 0.5389716
-P-0000 0.0000000 0.5000000 0.0389716 | 0.0000000 0.5000000 0.0389716
-P-0000 0.5000000 0.2450780 0.2875749 | 0.5000000 0.2450780 0.2875749
-P-0000 0.5000000 0.7450780 0.7875749 | 0.5000000 0.7450780 0.7875749
-P-0000 0.5000000 0.2549220 0.7875749 | 0.5000000 0.2549220 0.7875749
-P-0000 0.5000000 0.7549220 0.2875749 | 0.5000000 0.7549220 0.2875749
-P-0000 hdr_check: Wavefunction file is OK for direct restart of calculation
-P-0000 ================================================================================
-P-0000
-P-0000 Subroutine Unknown:0:BUG
-P-0000 Reading option of rwwf. One should have npw=npw1
-P-0000 However, npw=24441, and npw1=24462.
-P-0000
-P-0000 leave_new : decision taken to exit ...

david.waroquiers
Posts: 138
Joined: Sat Aug 15, 2009 12:45 am

Re: structural relaxation

Post by david.waroquiers » Wed Mar 17, 2010 10:30 pm

Hello,

The problem arises for the dataset 2 when abinit tries to read the wavefunction of the previous dataset. I see you are using the band/fft parallelism option (paral_kgb 1) with 8 processors (npfft*npband*npkpt). Did you compile abinit with the right configure options (enable-mpi-io, enable-mpi-io-test and maybe some other things ...) ? If so, maybe you have a problem with the MPI-IO stuff, some openmpi and mpich versions are buggy for these MPI-IO routines and this is not related to the abinit code.

On the other side, you have 8 k-points in your system and the parallelisation over k-points is completely automatic and does not need any MPI-IO options for the compilation of abinit. So maybe the easiest way to overcome your problem would be to remove the variables in your "# parallelisation variables" section of your input file :

# parallelization variables

paral_kgb 1
npband 1
npfft 2
npkpt 4

wfoptalg 4
fft_opt_lob 2
fftalg 401
iprcch 0
istwfk 8*1

The parallelisation over k-points is the most efficient one so start with this one if you can (of course if you have only 1 k-point, you have to use another parallelisation).

Besides, I had a look at your input file. You should remove the dilatmx1 1.9 as the optcell variable is set to 0 in this dataset (and 1.9 is a HUGE number for the possible variation of the cell parameters). When you are using dilatmx > 1, the effective ecut for the wavefunctions is ecut*dilatmx^3 so you are doing your calculation with an effective ecut of about 140 Hartrees ! For an optimization of the cell (your second dataset) with optcell > 0, the cell parameters can change so the lattice in real space can change as well and that's why you have to set a "possible" change of the cell thanks to the dilatmx variable (remember : try to decrease the value of dilatmx as much as possible). Another point : you can decrease the tolerance for your SCF cycles. For a structural relaxation, the tolrff variable might be more adequate. Just set it to 0.01 and your SCF cycles will stop when the forces are converged within 1 %.

Have fun

David

mohua
Posts: 16
Joined: Mon Feb 22, 2010 3:40 pm

Re: structural relaxation

Post by mohua » Thu Mar 18, 2010 7:24 pm

David,
Thank you very much for your help. I have one more question. I removed dilatmx for optcell 0 and here what I get. The code stops with the following error message about effective ecuts not matching in the two data sets. Could you please help me with this.
Thanks for your time,
Mohua

-P-0000 - hdr_check: checking restart file header for consistency -
-P-0000
-P-0000
-P-0000 current calculation restart file
-P-0000 ------------------- ------------
-P-0000
-P-0000 calculation expects a wf_planewave | input file contains a wf_planewave
-P-0000 . ABINIT code version 6.0.2 | ABINIT code version 6.0.2
-P-0000 . date 20100318 bantot 336 natom 10 | date 20100318 bantot 336 natom 10
-P-0000 nkpt 8 nsym 8 ngfft 72, 108, 108 | nkpt 8 nsym 8 ngfft 40, 60, 60
-P-0000 ntypat 3 ecut_eff 108.3000000 | ntypat 3 ecut_eff 30.0000000
-P-0000 usepaw 0 | usepaw 0
-P-0000 usewvl 0 | usewvl 0
-P-0000 rprimd: | rprimd:
-P-0000 7.5589045 0.0000000 0.0000000 | 7.5589045 0.0000000 0.0000000
-P-0000 0.0000000 10.9604116 0.0000000 | 0.0000000 10.9604116 0.0000000
-P-0000 0.0000000 0.0000000 10.9604116 | 0.0000000 0.0000000 10.9604116
-P-0000
-P-0000 hdr_check: WARNING -
-P-0000 input ecut_eff= 108.300000 /= disk file ecut_eff= 30.000000.






hdr_check: WARNING -
-P-0000 Restart of self-consistent calculation need translated wavefunctions.
-P-0000 Indeed, critical differences between current calculation and
-P-0000 restart file have been detected in:
-P-0000 * the plane-wave cutoff
-P-0000 ================================================================================
-P-0000 leave_test : synchronization done...





marcs
Posts: 12
Joined: Mon Mar 01, 2010 9:07 am

Re: structural relaxation

Post by marcs » Fri Mar 19, 2010 3:50 pm

Hello Mohua,

I am having the same problem. In my PAW calculation optcell 2 & dilatmx does not work in parallel. It seems to be a BUG, which according to Marc Torrent is already added to the list of bugs.
I had to split the two runs with:

ndtset1 jdtset 1
paral_kgb 1

and after this run, edit the input file and set:

ndtset1 jdtset 2
paral_kgb 0

In this case, you have to use
getwfk2 1
getxred2 1
instead of negative values.

Best wishes,
Marc

mohua
Posts: 16
Joined: Mon Feb 22, 2010 3:40 pm

Re: structural relaxation

Post by mohua » Sat Mar 20, 2010 8:01 pm

Hi Marc,

Thank you very much for your help. I have one more question related to this. I am doing structural optimization of a super cell with 79 atoms. For this run, given the limited memory, I need to do kpt and band fft parallelization. It won't run sequentially. In that case how do I do optcell 2 with dilatmax run?
Thanks a lot,
Regards
Mohua

marcs
Posts: 12
Joined: Mon Mar 01, 2010 9:07 am

Re: structural relaxation

Post by marcs » Mon Mar 22, 2010 4:12 pm

Hi Mohua,

to reduce the needed memory, you can add
mkmem 0

In PAW case you can also add
pawstgylm 0

Best wishes,
Marc

maxim
Posts: 78
Joined: Wed May 19, 2010 1:17 pm
Location: Institute of Silicate Chemistry of Russian Academy of Sciences, Saint-Petersburg, Russia

Re: structural relaxation

Post by maxim » Mon Sep 10, 2012 12:56 pm

mohua wrote:For a structural relaxation, the tolrff variable might be more adequate. Just set it to 0.01 and your SCF cycles will stop when the forces are converged within 1 %.

For my case of KNO3 geom. optim. I used tolrff 0.01 and it gave me just the accuracy comparable to toldfe 10 ^ -5, while for geom. optim. 10 ^ -12 is usually recommended. This difference in toldfe was crucial: lattitse paramters for toldfe 10 ^ -5 and 10 ^ -12 differ. So I do not recommend to use this value of tolrff (maybe toldfe 10 ^ -12 or tolvrs 10^-22).

Regards, Maxim
M.Yu. Arsent'ev
Institute of Silicate Chemistry of RAS
tikhonov_p-a@mail.ru

maryamsajedi
Posts: 11
Joined: Thu Sep 20, 2012 4:07 pm

structural relaxation

Post by maryamsajedi » Sat Sep 22, 2012 9:26 am

Dear all,
I`m trying to do a structural relaxation but the code stops with the following error message about k-point:

berryphase_new : BUG -
For k-point # 3,
the determinant of the overlap matrix is found to be 0.
Action : contact ABINIT group.

and in the log file this warning was shown:

WARNING - These should obey zval-nelect_occ=charge to better than 0.10E-10
Action : check input file for occ,wtk, and charge.
Note that wtk is NOT automatically normalized when occopt=2,
but IS automatically normalized otherwise.

I have attached the input file.Could you tell me what am I doing wrong in this calculation?
Thanks for your time,
Maryam
si_relaxedion.in
(3.11 KiB) Downloaded 379 times

firstime
Posts: 20
Joined: Mon Apr 15, 2013 10:53 am

stuctural optimization of tetragonal structure

Post by firstime » Wed Feb 12, 2014 11:30 am

Dear Abinit users,
I am trying to do a full structural relaxation, but it seems that there is a problem in my input file. the values of acell of the relaxed structure are far away from the experimental values and the same for the atomic possitions .
here is my input file:

#common declarations
natom 18
znucl 55 48 1
typat 1 1 1 1 1 1 2 2 3 3 3 3 3 3 3 3 3 3
ntypat 3
acell 8.43596 8.43596 12.6131 angstrom

xred 0.6825 0.1825 0
0.1825 0.3175 0
0.3175 0.8175 0
0.8175 0.6825 0
0 0 0.75
0 0 0.25
0 0.5 0.25
0 0.5 0.75
0.12318 0.62318 0.16510
0.37682 0.12318 0.16510
0.62318 0.87682 0.16510
0.87682 0.37682 0.16510
0.12318 0.62318 0.83490
0.37682 0.12318 0.83490
0.62318 0.87682 0.83490
0.87682 0.37682 0.83490
0 0 0
0 0 0.5

#angdeg 90 90 90
diemac 4 # le constant macroscopique dielectrique pour les
#isolants à large gap diemac varie de 2 à 4.
ecut 30
spgroup 140
brvltt -1
#prtcif 1
# structural optimization
#-------------------------------------------------------------
optcell 2
ionmov 3
dilatmx 1.0
ecutsm 0.5
tolmxf 1.0d-5
getwfk -1
ntime 100
natfix 6
natfixx 6
natfixy 2
natfixz 6
iatfix 5 6 7 8 17 18
iatfixx 5 6 7 8 17 18
iatfixy 5 6 7 8 17 18
iatfixz 5 6 7 8 17 18

ixc 11 # Integer for eXchange-Correlation choice,
#GGA, Perdew-Burke-Ernzerhof GGA functional
nband 23 #nombre de bandes,?

#Definition of the k-point grid
kptopt 1 # Option for the automatic generation of k
ngkpt 3 3 3
nshiftk 1
shiftk 0.5 0.5 0.5 # and shiftk 0.5 0.5 0.5 .

nstep 100
toldfe 1.0d-8
iscf 7

any help will be appreciate.
D.S

Locked