[DFTB-Plus-User] Atomic Forces at every step and Potential Energy

Oreoluwa Adesina oadesina at uwyo.edu
Mon Jun 6 17:22:53 CEST 2022


Hello Dr. Bálint,

We compiled and ran the DFTB+ version that you recommended I use. Unfortunately, I think we are doing something wrong because we still do not get the forces output at every time step. We have looked at all the output files, and they do not differ from calculations performed with the previously compiled version. Which output file should we expect to see the forces at every step printed to?

A colleague and I further tried to modify the DFTB+ source code ourselves, but were not successful in extracting the forces at the desired times. We are wondering if there are certain part(s) of the code that should be modified beyond what we tried.

Roughly, we tried finding what function prints the detailed output file at the very end of the run (specifically these were the functions named writeDetailedOut4 and writeDetailedOut5, more specifics in the examples below and the code snippet attached for examples 1 and 2) and instead have that run at every time step (examples 1 and 2), this did not work. We attempted calling the function directly and creating a helper function to set up some defaults and call the function (example 1). Neither of these solutions worked, and with our lack of knowledge of Fortran and the many lines of code in this program, we could not think of what else to do. Attached is a modified version of the “main loop” that was edited, for further clarification of what was worked on.

Specific Examples of Code Changes:
1. Dftbplus/Main.F90 - line 453: creating a subroutine everyDetailedOut4() that inside calls the subroutine writeDetailedOut4 and then calling this subroutine at line 193 inside of the 'main geometry loop' I am unsure if this was even the correct track but it was a start.
2. Dftbplus/Main.F90 - line 193, call writeDetailedOut4 in this loop every iteration to attempt to get the forces to keep printing every step, but this did not work either.
                3. Dftbplus/initprogram.F90 - line 811, setting this logical value to                             true, so every time the main geometry loop hits here, it should flag    as true and write detailed output.

If you have any other code suggestions, please let us know.
Do you have any suggestions on what to do? Or do you have an idea as to what we are doing wrong?

Thank you.


--
Oreoluwa Adesina.


From: DFTB-Plus-User <dftb-plus-user-bounces at mailman.zfn.uni-bremen.de> on behalf of Bálint Aradi <aradi at uni-bremen.de>
Date: Tuesday, February 8, 2022 at 7:09 AM
To: dftb-plus-user at mailman.zfn.uni-bremen.de <dftb-plus-user at mailman.zfn.uni-bremen.de>
Subject: Re: [DFTB-Plus-User] Atomic Forces at every step and Potential Energy
◆ This message was sent from a non-UWYO address. Please exercise caution when clicking links or opening attachments from external sources.


Dear Oreoluwa,

currently there is no option to print the forces during an MD, so you
would have to re-run single point simulations for those images of the
MD, for which the forces are interesting.

On the other hand, it is really trivial to implement the feature you ask
for. I've created a branch (mdForces) in my personal DFTB+ fork:

https://github.com/aradi/dftbplus/tree/mdForces

which contains a version of DFTB+, where the forces are written in
md.out at every step. Feel free to check it out, to compile the code and
to test it. Let me know how it runs, we may add that as an official
feature later, if it turns out to be useful.

Best regards,

Bálint



On 02.02.22 18:56, Oreoluwa Adesina wrote:
> Hello,
>
> I am trying to calculate the forces per atom per iteration and potential
> energy per atom per iteration during a molecular dynamics calculation in
> dftb+.
>
> I have tried modifying the writing options, having set CalculateForces
> to Yes under the Analysis block, but have not been able to export the
> atom-resolved forces/energies at every step, or save the detailed.out at
> every step.
>
> Is there a way to get the forces per atom per iteration and potential
> energy per atom per iteration for an MD calculation? I am currently
> using the VelocityVerlet driver.
>
> Thank you.
>
>>
> Kind regards,
>
> Oreoluwa Adesina.
>
> Graduate Student (https://de-sousa-oliveira.xyz/groupmembers/
> <https://de-sousa-oliveira.xyz/groupmembers/>)
>
>
> _______________________________________________
> DFTB-Plus-User mailing list
> DFTB-Plus-User at mailman.zfn.uni-bremen.de
> https://mailman.zfn.uni-bremen.de/cgi-bin/mailman/listinfo/dftb-plus-user


--
Dr. Bálint Aradi
Bremen Center for Computational Materials Science, University of Bremen
http://www.bccms.uni-bremen.de/cms/people/b-aradi/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.zfn.uni-bremen.de/pipermail/dftb-plus-user/attachments/20220606/35a90f4f/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DFTB+_example_code
Type: application/octet-stream
Size: 5216 bytes
Desc: DFTB+_example_code
URL: <http://mailman.zfn.uni-bremen.de/pipermail/dftb-plus-user/attachments/20220606/35a90f4f/attachment.obj>


More information about the DFTB-Plus-User mailing list