[ase-users] Vasp calculator SCF convergence
GENG SUN
gengsun at ucla.edu
Fri Apr 27 23:52:34 CEST 2018
Hello Andrew,
Thank you for your suggestions.
I checked your code. It works smoothly.
And it might also require modifying self.read_convergence in "def
restart_load(self):"
In the meantime, I added a "scf_must_convergence" option in the Vasp
calculator, So we can capture this exception in the upper script. So we
can attach a new calculator when the SCF fails. It works in my script now.
self.converged, self.scf_converged, self.nsw_converged =
self.read_convergence()
if self.scf_must_converge and not self.scf_converged:
raise ScfNotConvergence("VASP SCF not converged")
self.set_results(atoms)
Best,
Geng
-------------------------------------------------------------------------
Geng Sun
Chemical and Biomolecular Engineering Department
University of California, Los Angeles CA, 90095
E-mail: gengsun at ucla.edu
Phone: +1(310)308-6689
---------------------------------------------------------------------------
On Tue, Apr 24, 2018 at 9:42 PM, Andrew Rosen <rosen at u.northwestern.edu>
wrote:
> 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/20180427/baabe178/attachment.html>
More information about the ase-users
mailing list