ezpzbz / aiida-catmat

Collection of AiiDA WorkChains Developed in CATMAT project
MIT License
3 stars 1 forks source link

[Feature] Avoid setting LREAL to Auto/True at first place #36

Closed ezpzbz closed 4 years ago

ezpzbz commented 4 years ago

We have error handler that if VASP throws warning about cell is small and it's better to use LREAL = False, our handler will change it. However, it's better to look into VASP source code to check on which circumstances, it complains about it. Then, we can have a decider/corrector function to check it in advance before submitting the calculation. It would save a computational time by avoiding unnecessary calculations.

ezpzbz commented 4 years ago

In VASP the thresholds for setting up default value for LREAL tag are:

These can be simply checked in advance to avoid setting it to False . The best place to do it is in setup_protocol calcfunction. It is done now as:

# Check for LREAL
    nions = 0
    comp = structure.get_composition()
    for nion in comp.values():
        nions += nion
    if nions <= 8:
        lreal = {'LREAL': False}
    else:
        lreal = {'LREAL': 'Auto'}
ezpzbz commented 4 years ago

There is one another concern about LREAL flag. Normally, we want to have it set to False for the last static calculation (if it exists within the protocol). The previous implementation and even above approach treats all stages similarly. Therefore, even if we set it to False in protocol yaml file, it will be changed back to Auto when the stage INCAR is being updated. On top of my head, the best solution to overcome this issue can be checking for IBRION = -1 when we get the stage INCAR and make sure in that case, the LREAL is set to False.

ezpzbz commented 4 years ago

That's also done. Now, after updating the stage INCAR we explicitly check for the IBRION tag and if it is -1, we set the LREAL to False.