[Pw_forum] force convergence in vc-relax

Paolo Giannozzi paolo.giannozzi at uniud.it
Mon Apr 13 21:48:22 CEST 2015


$ grep -n 'bfgs converged in' */*.f90 */*/*.f90

Modules/bfgs_module.f90:912:             & FMT = '(/,5X,"bfgs converged in ",I3," scf cycles and ", &


Around line 912 of Modules/bfgs_module.f90, you find

      IF ( conv_bfgs ) THEN
         !
         WRITE( UNIT = stdout, &
              & FMT = '(/,5X,"bfgs converged in ",I3," scf cycles and ", &
              &         I3," bfgs steps")' ) scf_iter, bfgs_iter


You search for "conv_bfgs" and you find

      !
      ! ... convergence is checked here
      !
      energy_error = ABS( energy_p - energy )
      grad_error = MAXVAL( ABS( MATMUL( TRANSPOSE(hinv_block), grad(1:n-9)) ) )
      conv_bfgs = energy_error < energy_thr
      conv_bfgs = conv_bfgs .AND. ( grad_error < grad_thr )


"grad_error" is the largest component of the gradient (i.e. forces; the last 9 values are stresses). You should  figure out the relation between forces as printed in the output and "grad_error", via variables "grad" (presumably the forces) and "hinv_block" (a transformation matrix from cartesian to crystal coordinates, I guess).


Anyway: 10^{-9} is an exceedingly small threshold for forces.


Paolo

________________________________
From: pw_forum-bounces at pwscf.org <pw_forum-bounces at pwscf.org> on behalf of Tianli Feng <tianli.feng2011 at gmail.com>
Sent: Monday, April 13, 2015 18:19
To: PWSCF Forum
Subject: Re: [Pw_forum] force convergence in vc-relax

Hi Florian, I have not got the issue resolved yet.

Hi Paolo, How can we find the explanation in that code? Many thanks.

Best wishes,
Tianli
------------
Tianli Feng
Mechanical Engineering, Purdue University
---The truth is not what you see, but what it is.

On Mon, Apr 13, 2015 at 4:10 AM, Paolo Giannozzi <paolo.giannozzi at uniud.it<mailto:paolo.giannozzi at uniud.it>> wrote:
On Mon, 2015-04-13 at 00:16 -0700, Florian Altvater wrote:

> did this issue ever get resolved/answered? I would also be very
> interested in a solution/explanation of the behavior.

The explanation is available in the part of code that perform the
convergence check on forces

P.
> I also get relaxations where individual forces are higher than the
> threshold, without the line stating that "SCF correction compared to
> forces is large", in case that would be a reason here. Also happens in
> regular "relax" calculations.
>
> Thanks so much,
> Florian
>
> --
> Florian Brown-Altvater
> PhD Candidate
> Neaton group
> UC Berkeley/LBNL
>
> Am 08.04.2015 um 12:07 schrieb Tianli Feng:
>
> > Dear All,
> >
> >
> > I would really appreciate if anyone can help to explain a output in
> > relaxing a structure. I used vc-relax to relax a lattice
> > with forc_conv_thr set as 1.0D-9. After 44 steps, the results
> > converge as following:
> >
> >
> >      Forces acting on atoms (Ry/au):
> >
> >
> >      atom    1 type  1   force =     0.00000638    0.00000000
> >  0.00000092
> >      atom    2 type  1   force =     0.00000602    0.00000000
> >  0.00000671
> >      atom    3 type  1   force =    -0.00000074    0.00000000
> >  0.00000243
> >      atom    4 type  1   force =     0.00000358    0.00000000
> > -0.00000082
> >      atom    5 type  2   force =    -0.00000821    0.00000000
> > -0.00000732
> >      atom    6 type  2   force =    -0.00000635    0.00000000
> > -0.00000202
> >      atom    7 type  2   force =     0.00000337    0.00000000
> > -0.00000058
> >      atom    8 type  2   force =    -0.00000406    0.00000000
> >  0.00000068
> >
> >
> >      Total force =     0.000018     Total SCF correction =
> > 0.000002
> >      SCF correction compared to forces is large: reduce conv_thr to
> > get better values
> >
> >
> >      bfgs converged in  44 scf cycles and  43 bfgs steps
> >      (criteria: energy <  1.0E-04, force <  1.0E-09, cell <
> >  5.0E-01)
> >
> >
> > The last line says the relaxation converges with force <1.0E-9, but
> > I saw the forces acting on each atom are not smaller than 1e-9. Does
> > anyone has experience on relaxing a lattice and know what is
> > happening? Many thanks!!
> >
> >
> > Sincerely,
> > Best wishes,
> > Tianli
> > ------------
> > Tianli Feng
> > Mechanical Engineering, Purdue University
> > ---The truth is not what you see, but what it is.
> >
> >
> > _______________________________________________
> > Pw_forum mailing list
> > Pw_forum at pwscf.org<mailto:Pw_forum at pwscf.org>
> > http://pwscf.org/mailman/listinfo/pw_forum
>
> _______________________________________________
> Pw_forum mailing list
> Pw_forum at pwscf.org<mailto:Pw_forum at pwscf.org>
> http://pwscf.org/mailman/listinfo/pw_forum

--
 Paolo Giannozzi, Dept. Chemistry&Physics&Environment,
 Univ. Udine, via delle Scienze 208, 33100 Udine, Italy
 Phone +39-0432-558216<tel:%2B39-0432-558216>, fax +39-0432-558222<tel:%2B39-0432-558222>

_______________________________________________
Pw_forum mailing list
Pw_forum at pwscf.org<mailto:Pw_forum at pwscf.org>
http://pwscf.org/mailman/listinfo/pw_forum

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/users/attachments/20150413/a104c36d/attachment.html>


More information about the users mailing list