korintje / dftbplus_restarter

Scripts to easily prepare input files to restart DFTB+ MD simulations
Creative Commons Zero v1.0 Universal
3 stars 1 forks source link

Error in reading initial charges - coordinates #2

Closed mbusato0 closed 2 years ago

mbusato0 commented 2 years ago

From the input file obtained with the new version of the script, the one with the "restart-from-iter" option, the initial charges seem not to be correctly read by the program, even in the option ReadInitialCharges = Yes is specified. The output does not show the typical step 0 where old charges are read, which should appear as follows due to the zero difference in the energies:

*** Geometry step: 0

iSCC Total electronic Diff electronic SCC error 1 0.00000000E+00 0.00000000E+00 0.21845085E-05

Differently, the program tries to optimize the charges for the step 0 and fails in the optimization. Since the output says that the charges are correctly read from the charges.bin file, this should mean that the coordinates do not correspond to the last step of the previous run. This probably derives from some error in the production of the Geometry with the current format (the "explicit geometry specification", as indicated in the DFTB+ manual) instead of the GenFormat, which was employed in the previous version of the python script.

korintje commented 2 years ago

Does this issue occur only when you restart from a step excepting the last step? or always occur? If you change the current description from current format to GenFormat, does the charges are read correctly?

korintje commented 2 years ago

First, "Angstrom" option must be set in the "TypesAndCoordinates" key. This causes the error. Also, I noticed that "InitialCharges" and "AllAtomCharges" should be set when the "explicit geometry specification" is used.

mbusato0 commented 2 years ago

As you correctly said in the other conversation, the charges stored in the 4th column of the geo_end.xyz file are not suitable for restart purposes, otherwise the charge optimization will crash in step 0 as I could observe. Therefore the only option to restart from a given step which is different from the last one is to deactivate the ReadInitialCharges option and not to provide to the program any partial charge at all. In this way the program will optimize them in step 0, which is only a small lost of time.

The other issue remains: you say that it is mandatory to provide initial charges when the "explicit geometry specification" is used. Could you indicate where this is written in the manual? I can not figure out this section. Also, I tried restart with this kind of geometry and no initial charges, and it looks ok.

korintje commented 2 years ago

Your comment made me realize that I had misunderstood many things about the initial charges. (I had misunderstood that the initial charges have to be set because the file I used for testing was corrupted.)

I have fixed the new script and merged it into the main branch. The new script will deactivate ReadInitialCharges option when users give a step number with -f option. Thank you very much for your suggestions and checking.