[ase-users] Vasp calculator SCF convergence
Andrew Rosen
rosen at u.northwestern.edu
Wed Apr 25 06:42:26 CEST 2018
Geng,
Actually, if you make the change in the commit I shared in the prior email
(#811), you *should* be able to just test for atoms.calc.scf_converged in
your Python script once you define an `Atoms` object, attach a `Vasp`
calculator, and run a VASP job.
Example:
```
from ase.calculators.vasp import Vasp
from ase.build import molecule
myatoms= molecule('H2O')
myatoms.center(vacuum=10)
calc = Vasp(nelm=1)
myatoms.set_calculator(calc)
E = myatoms.get_potential_energy()
if myatoms.calc.scf_converged == False:
raise ValueError('Oops! SCF did not converged! :(')
```
On Tue, Apr 24, 2018 at 11:11 PM Andrew Rosen <rosen at u.northwestern.edu>
wrote:
> Hi Geng,
>
> I definitely agree with you about this (and I also think that ASE should
> have an option to print a warning or raise an exception if the maximum
> number of ionic steps is reached). This will prevent jobs from "failing"
> silently. Please refer to the recent Issue #237 I just opened on the GitLab
> page (
> https://gitlab.com/ase/ase/issues/new?issue%5Bassignee_id%5D=&issue%5Bmilestone_id%5D=).
> If you view the changes I made to vasp.py here (
> https://gitlab.com/argon214/ase/commit/b35f97db0004e1b5c5e98215b02f3d632735d42c),
> you can have ASE print out a warning (or raise an exception) if after line
> 574 you add something like:
> ```
> if converged == False:
> print('WARNING: Convergence not met')
> ```
> Perhaps this somewhat hacky solution will hold you over until/if a change
> is made to the main repository.
>
> On Tue, Apr 24, 2018 at 10:31 PM GENG SUN via ase-users <
> ase-users at listserv.fysik.dtu.dk> wrote:
>
>> Hello everyone,
>>
>> I am wondering in the current Vasp calculator, is there a good way to
>> add an option, which can throw an Exception when SCF is not converged?
>> This option can be useful when I would like to generate a lot of
>> structures, and I want to make sure energies of all the structure are
>> correct. Otherwise, the OUTCAR is overwriten and the information of
>> convergence is lost.
>>
>> I check the code, and I found there is a self.read_convergece() after the
>> VASP calculations. While it seems that the code did nothing even the SCF is
>> not converged.
>>
>> It might be good to add some code there, but I am not sure whether it
>> will mess up other parts.
>>
>> So, does anyone know a better way to add this function?
>>
>> Thank you very much.
>>
>> Best Wishes,
>>
>> Geng
>>
>>
>> _______________________________________________
>> ase-users mailing list
>> ase-users at listserv.fysik.dtu.dk
>> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20180425/6cf17476/attachment.html>
More information about the ase-users
mailing list