Force inconsistencies in VASP 5/6, dependent on NSW

Problems running VASP: crashes, internal errors, "wrong" results.


Moderators: Global Moderator, Moderator

Post Reply
Message
Author
joe_gauthier
Newbie
Newbie
Posts: 2
Joined: Wed Aug 21, 2024 5:43 pm

Force inconsistencies in VASP 5/6, dependent on NSW

#1 Post by joe_gauthier » Thu Jul 17, 2025 12:29 am

Hi all, attached here are four VASP runs. Two in VASP 6.3.2, two in VASP 5.4.4. The behavior we are observing is briefly summarized as:
- when running MD, we observe very large forces that do not sum to zero (i.e. high force drift)
- taking the exact same INCAR but setting NSW=0 mitigates these large forces, and they sum to zero, but OUTCAR still reports significant force drift (though not the same as for NSW > 0)
- despite the inconsistency in forces, the total energies are nearly identical

Any advice would be appreciated, thanks!

You do not have the required permissions to view the files attached to this post.

christopher_sheldon1
Global Moderator
Global Moderator
Posts: 129
Joined: Mon Mar 25, 2024 1:36 pm

Re: Force inconsistencies in VASP 5/6, dependent on NSW

#2 Post by christopher_sheldon1 » Thu Jul 17, 2025 3:37 pm

Hi Joe,

Thank you for your question. It's not immediately clear why the force drift is not zero. I'm currently running your calculations to reproduce the issue and I'll get back to you when they have finished.

Best wishes,

Chris


joe_gauthier
Newbie
Newbie
Posts: 2
Joined: Wed Aug 21, 2024 5:43 pm

Re: Force inconsistencies in VASP 5/6, dependent on NSW

#3 Post by joe_gauthier » Fri Jul 18, 2025 12:43 pm

Thanks Chris! I appreciate your time and attention here.


christopher_sheldon1
Global Moderator
Global Moderator
Posts: 129
Joined: Mon Mar 25, 2024 1:36 pm

Re: Force inconsistencies in VASP 5/6, dependent on NSW

#4 Post by christopher_sheldon1 » Tue Jul 22, 2025 3:02 pm

Hi Joe,

I've got some answers to your questions.

- when running MD, we observe very large forces that do not sum to zero (i.e. high force drift)
The forces that are printed out in the OUTCAR file have the force drift removed when an MD calculation is not performed. When an MD calculation is performed, the force drift does not need to sum to zero; this can become a problem.

- taking the exact same INCAR but setting NSW=0 mitigates these large forces, and they sum to zero, but OUTCAR still reports significant force drift (though not the same as for NSW > 0)
In the "static" calculations, you have set NSW=0, which resets IBRION to -1 by default, so the calculations are not MD. As a result, the force drift is removed from the forces. The force drift printed beneath is what has been removed.

- despite the inconsistency in forces, the total energies are nearly identical
This is due to the temperature used in an MD simulation. The temperature changes the forces, while not changing the energies significantly themselves. Since the structures are the same, the energies are therefore similar.

I hope that this adds some clarity to what is happening. I have added a comment on the forces category page on the wiki.

The forces are very large, which I imagine is due to the dissociation of the CCl4 on your surface. Presumably, this occurred during your MD simulation. A final comment is that using EDIFFG = -0.01 would likely improve your results, so that the forces are converged. The difference in forces and force drift between versions I am still trying to work out. For the MD calculations, it is not surprising if they differ between simulations, but for the static, this is still unclear.

Best wishes,

Chris


joe_gauthier
Newbie
Newbie
Posts: 2
Joined: Wed Aug 21, 2024 5:43 pm

Re: Force inconsistencies in VASP 5/6, dependent on NSW

#5 Post by joe_gauthier » Tue Jul 22, 2025 6:35 pm

Hi Chris, thanks for following up on this. Two related questions:
1. Is there a way to post process the forces in MD to remove the drift? It seems that OUTCAR only reports the aggregate (total) drift, nothing per-atom.
2. We want to ensure the energy and force labels are consistent with each other, especially for training ML models. Is the presence of non-zero total drift a means to quantity this? Can we trust the consistency of these forces even with large force drifts being removed?

The structures being generated are pretty far from equilibrium so we expected high forces but need to make sure that the forces we get are reliable. Thanks again for your help.

Last edited by joe_gauthier on Tue Jul 22, 2025 6:39 pm, edited 1 time in total.

christopher_sheldon1
Global Moderator
Global Moderator
Posts: 129
Joined: Mon Mar 25, 2024 1:36 pm

Re: Force inconsistencies in VASP 5/6, dependent on NSW

#6 Post by christopher_sheldon1 » Mon Jul 28, 2025 11:59 am

Hi Joe,

Sorry for the slow response, I was waiting till a meeting on Friday for a few suggestions. One was to use RANDOM_SEED, which should be included but did not make any difference. A few other things that can be tried are different MDALGO algorithms. This can have a significant effect on the simulation.

1. Is there a way to post process the forces in MD to remove the drift? It seems that OUTCAR only reports the aggregate (total) drift, nothing per-atom.
There is no way to remove the drift from MD in post-processing.

2. We want to ensure the energy and force labels are consistent with each other, especially for training ML models. Is the presence of non-zero total drift a means to quantify this? Can we trust the consistency of these forces even with large force drifts being removed?
A small amount of drift is not generally a problem. In your case, there is a lot of drift, which will make the forces unreliable. When training MLFFs, it is important to read out best practices page, which will gives solutions common problems, e.g. for surface, you should not train on stresses by setting ML_WTSIF=1E-10.

I have found that the force drift decreases significantly using VASP 6.5.0 or 6.5.1, compared to 5.4.4 or 6.3.2 (or 6.4.3, which I am testing with), so using one of the newer versions is a possible fix. I am still investigating why this is the case.

Best wishes,

Chris


Post Reply