shankar1729 / jdftx

JDFTx: software for joint density functional theory
http://jdftx.org
82 stars 54 forks source link

Feature request: Forces based convergence #328

Open ColinBundschu opened 4 months ago

ColinBundschu commented 4 months ago

In addition to the standard convergence criteria, would it be possible to specify a threshold for the maximum allowable amount of force on a single atom during ionic relaxation?

shankar1729 commented 4 months ago

This was already added recently for BEAST-DB production calculations: add maxThreshold yes to ionic-minimize or lattice-minimize, which will switch the reported grad_K to grad_max. The value of knormThreshold then gets applied to max force instead of rms. (I haven't yet updated the web docs: I will do this with a new release that's overdue at this point.)

shankar1729 commented 4 months ago

Please confirm if the existing code works correctly for your use case and close this issue. The documentation is now updated on https://jdftx.org/CommandIonicMinimize.html (see flag maxThreshold).

ColinBundschu commented 1 week ago

Can you clarify the units on knormThreshold? Specifically is it in Lattice coords or some other units?

shankar1729 commented 1 week ago

Those are Cartesian forces in Hartree/bohr atomic units.

ColinBundschu commented 5 days ago

And for convergence is it logical AND with the energy difference between steps or logical OR?

shankar1729 commented 5 days ago

OR; it will stop when any of the convergence criteria are satisfied.

ColinBundschu commented 1 day ago

Is there any way to make it AND? I would like both the energy to be relatively constant and the forces to be small. Having one but not the other is undesirable.