Issue with MD of H₂O in hexagonal unit cell (NaN values and errors)

Queries about input and output files, running specific calculations, etc.


Moderators: Global Moderator, Moderator

Post Reply
Message
Author
pablog._lustemberg1
Newbie
Newbie
Posts: 6
Joined: Sun Nov 17, 2019 9:20 pm
License Nr.: 5-1288

Issue with MD of H₂O in hexagonal unit cell (NaN values and errors)

#1 Post by pablog._lustemberg1 » Thu Jan 02, 2025 12:01 pm

Dear VASP team and forum members,

I am replicating the molecular dynamics (MD) example for an H₂O molecule provided in the tutorial Molecules Part 3 (tutorials/latest/molecules/part3/#molecules-e11). The calculation runs successfully with the default cubic unit cell provided in the tutorial.

However, when I modify the POSCAR to use a hexagonal unit cell, the MD simulation fails, and I encounter NaN values in the output. Here is a snapshot of the error:

2025-01-02 125440.png

Details of the hexagonal unit cell:
POSCAR:
H2Ogas
1.00000000000000
11.6354420844246391 0.0000000000000000 0.0000000000000000
5.8177210422123204 10.0765884293742989 0.0000000000000000
0.0000000000000000 0.0000000000000000 34.7501493397576482
O H
1 2
Selective dynamics
Direct
0.8047070044179956 0.4273817929715165 0.6367215208717263 T T T
0.8645383469782193 0.3939102533072592 0.6148022162202189 T T T
0.8154557206465911 0.4995143503966095 0.6467228606440487 T T T

INCAR:
PREC = Normal ! standard precision
ENCUT = 520
ISMEAR = 0
SIGMA = 0.1

ALGO = All

IBRION = 0 ! standard molecular dynamics (MD)
NSW = 500 ! 500 steps
POTIM = 0.5 ! timestep 0.5 fs
ISYM = 0 ! no imposed symmetry for MD

SMASS = -3
TEBEG = 673 ! temperature at beginning
TEEND = 673 ! temperature at end

LMAXMIX = 6 ! PAW flag
ADDGRID = .TRUE. ! PAW flag
LASPH = .TRUE. ! PAW flag

##LREAL = Auto

##LSCALAPACK = .TRUE.

##NBANDS = 112
NPAR = 8

POTCAR:
TITEL = PAW_PBE O 08Apr2002
TITEL = PAW_PBE H 15Jun2001

KPOINTS:
Automatic mesh
0
Gamma
1 1 1
0. 0. 0.

Are there specific considerations or adjustments required for running MD with a hexagonal unit cell? Could this issue be related to periodic boundary conditions or the setup of the simulation?

Thank you for your time and any advice on resolving this issue!

Best regards,

Pablo

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

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

Re: Issue with MD of H₂O in hexagonal unit cell (NaN values and errors)

#2 Post by christopher_sheldon1 » Wed Jan 08, 2025 11:00 am

Thank you Pablo,

Do you have the POSCAR, POTCAR, KPOINTS, INCAR, and OUTCAR files? This will help us investigate.

Best wishes,

Chris


pablog._lustemberg1
Newbie
Newbie
Posts: 6
Joined: Sun Nov 17, 2019 9:20 pm
License Nr.: 5-1288

Re: Issue with MD of H₂O in hexagonal unit cell (NaN values and errors)

#3 Post by pablog._lustemberg1 » Wed Jan 08, 2025 11:50 am

Dear Chris,

Thank you for your email. I have attached a Files.zip containing all the requested input files (POSCAR, POTCAR, KPOINTS, INCAR) as well as the OSZICAR and OUTCAR files.

Files.zip

Please let me know if you need any additional information or files.

Best wishes,
Pablo

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

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

Re: Issue with MD of H₂O in hexagonal unit cell (NaN values and errors)

#4 Post by christopher_sheldon1 » Wed Jan 08, 2025 12:31 pm

Thank you, I will try to repeat your calculation.

Best wishes,

Chris


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

Re: Issue with MD of H₂O in hexagonal unit cell (NaN values and errors)

#5 Post by christopher_sheldon1 » Wed Jan 08, 2025 2:21 pm

Hi Pablo,

The issue is in your POSCAR files. I link the other thread here for convenience (https://vasp.at/forum/viewtopic.php?t=19928). I presume that it is the same issue but am checking for the other currently to make sure.

After the coordinates in POSCAR, the velocities are given. In your POSCAR files, these are "NaN NaN NaN" for each ion. These are read in so when the first ionic step is completed, these "NaN"s are the velocities used to calculate the next MD step, resulting in "NaN" appearing. Since they are strings, this causes the calculation to crash. I presume that whatever software you use to generate these structures inputs NaN as default if velocities are not provided. The solution is to remove these from the end of your POSCAR file, then the calculations run without issue.

Best wishes,

Chris


pablog._lustemberg1
Newbie
Newbie
Posts: 6
Joined: Sun Nov 17, 2019 9:20 pm
License Nr.: 5-1288

Re: Issue with MD of H₂O in hexagonal unit cell (NaN values and errors)

#6 Post by pablog._lustemberg1 » Wed Jan 08, 2025 2:39 pm

Hi Chris,

Thank you for identifying the issue and linking the relevant thread. I can’t believe it was such a simple oversight, but I completely understand your explanation now! The presence of "NaN NaN NaN" as default velocities makes sense as the source of the problem, and I appreciate you pointing this out.

I’ll make the necessary adjustments by removing those lines from the POSCAR files and will rerun the calculations. Thank you again for your help and for catching this!

Best wishes,
Pablo


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

Re: Issue with MD of H₂O in hexagonal unit cell (NaN values and errors)

#7 Post by christopher_sheldon1 » Wed Jan 08, 2025 2:46 pm

Hi Pablo,

You're welcome. It's often these simple mistakes that are the hardest to notice. I have had hidden characters that have stopped the entire calculation before.

If that's everything, I'll close the thread now.

Best wishes,

Chris


Post Reply