PyChemia icon indicating copy to clipboard operation
PyChemia copied to clipboard

updated relax.py to keep EDIFF provided by user and only use 1E-04 if not provided

Open uthpalaherath opened this issue 3 years ago • 7 comments

Hello Guillermo,

In some of my structural relaxation I wanted to keep a lower EDIFF value so I added this in relax.py to use the EDIFF provided by the user in the INCAR. If not provided it will use the default value of EDIFF=1E-04.

I simply changed:

     # How to change EDIFF
        if vj.input_variables["EDIFF"] > -0.01 * vj.input_variables["EDIFFG"]:
            vj.input_variables["EDIFF"] = round_small(
                -0.01 * vj.input_variables["EDIFFG"]
            )
        else:
                vj.input_variables["EDIFF"] = 1e-4

to

        # How to change EDIFF
        if vj.input_variables["EDIFF"] > -0.01 * vj.input_variables["EDIFFG"]:
            vj.input_variables["EDIFF"] = round_small(
                -0.01 * vj.input_variables["EDIFFG"]
            )
        else:
            if self.extra_vars["EDIFF"]:
                vj.input_variables["EDIFF"] = self.extra_vars["EDIFF"]
            else:
                vj.input_variables["EDIFF"] = 1e-4

If you think it's something that is useful please merge it and add it to pip.

Thank you,

Best, Uthpala

uthpalaherath avatar May 12 '21 14:05 uthpalaherath

UPDATE:

Added a boolean flag, "make_potcar" to convergence.py and relax.py so that users can have the option to automatically generate a POTCAR or use a currently existing one. The default is set to TRUE which is what PyChemia currently does.

-Uthpala

uthpalaherath avatar May 12 '21 21:05 uthpalaherath

UPDATE 2:

Added the flag "auto_ibrion" in relax.py to turn on adaptive IBRION update which was commented out. This first runs the relaxation with IBRION=2 and once the forces are lower it sets IBRION=1.

-Uthpala

uthpalaherath avatar May 12 '21 22:05 uthpalaherath

Update 3:

Fixed bug where make_potcar wasn't functioning in relax.py

-Uthpala

uthpalaherath avatar May 12 '21 23:05 uthpalaherath

Update 4:

Added option for using the FIRE algorithm for relaxation.

-Uthpala

uthpalaherath avatar May 17 '21 18:05 uthpalaherath

Coverage Status

Coverage decreased (-0.1%) to 37.001% when pulling 1fda687ba8085cbc663c786db2d991ce5fee8867 on uthpalaherath:master into 217e7e3d0f7dd755f7ae242fc4d865b23a3505b9 on MaterialsDiscovery:master.

coveralls avatar May 31 '21 03:05 coveralls

Coverage Status

Coverage decreased (-0.1%) to 37.001% when pulling 1fda687ba8085cbc663c786db2d991ce5fee8867 on uthpalaherath:master into 217e7e3d0f7dd755f7ae242fc4d865b23a3505b9 on MaterialsDiscovery:master.

coveralls avatar May 31 '21 03:05 coveralls

Coverage Status

Coverage increased (+0.04%) to 37.179% when pulling 712f5a2dbd7a0816f4999f34ed875275f186780c on uthpalaherath:master into 217e7e3d0f7dd755f7ae242fc4d865b23a3505b9 on MaterialsDiscovery:master.

coveralls avatar May 31 '21 03:05 coveralls