OUTCAR verbosity tags for long relaxations: Suppress bandstructure info for each ionic step while keeping the forces and

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


Moderators: Global Moderator, Moderator

Locked
Message
Author
LassiL
Newbie
Newbie
Posts: 3
Joined: Wed Oct 11, 2023 9:45 am

OUTCAR verbosity tags for long relaxations: Suppress bandstructure info for each ionic step while keeping the forces and

#1 Post by LassiL » Fri Oct 13, 2023 12:07 pm

Hello,

I've been running relaxations of various spin-polarized Cr-Fe (and other binary Cr-X) SQS structures. However, I have run to an issue that, unless I use NWRITE=0, the full band structure (for both spin channels) is written for each relaxation step in the OUTCAR. This, with a lot of k-points, a lot of bands and for a long relaxations, results in "massive" OUTCAR files, and these "massive" OUTCAR files stack up if one runs hundreds to thousands of these simulations.

I wonder if it is, or would be, possible to suppress the band structure from being written in the OUTCAR file for every relaxation step (e.g., print the same as NWRITE=2, but write the band structure only for first and last ionic step, or not at all)? This could also be implemented as a separate tag from NWRITE to control whether the eigenvalues are written in the OUTCAR.

I have tried using NWRITE=0, but this removes the basis vectors, ion positions and forces on ions from the OUTCAR for the relaxation steps, which is information that I would like to see in the OUTCAR when running relaxation runs (instead of the band structure).

Here are attached my input files and the OUTCAR file using NWRITE=0 (70K lines). With NWRITE=1 or 2 the OUTCARS are ~1 million lines due to the band structure being written for each relaxation step.

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

martin.schlipf
Global Moderator
Global Moderator
Posts: 542
Joined: Fri Nov 08, 2019 7:18 am

Re: OUTCAR verbosity tags for long relaxations: Suppress bandstructure info for each ionic step while keeping the forces

#2 Post by martin.schlipf » Mon Oct 16, 2023 12:05 pm

Here are a couple of thoughts. If you want you can modify the code yourself to behave like you want. In electron.F (write_eigenval) and in force.F (force_and_stress) this output is generated and there is already some logic in place to toggle the output, so you can just set that to FALSE and TRUE, respectively.

If you want the best solution currently available, then setting NWRITE = 0 is your best option. The forces, stresses, and positions should still be written to the XML and HDF5 file, so you should still be able to read them using py4vasp or a script working with the corresponding output files.

Perhaps we can add a new flag to suppress the eigenvalue output independently of the forces and stresses for a future release of VASP.

Martin Schlipf
VASP developer


LassiL
Newbie
Newbie
Posts: 3
Joined: Wed Oct 11, 2023 9:45 am

Re: OUTCAR verbosity tags for long relaxations: Suppress bandstructure info for each ionic step while keeping the forces

#3 Post by LassiL » Mon Oct 16, 2023 3:30 pm

Hi Martin, thanks for the reply. I get the VASP license through MedeA, and I don't think I have access to the source, otherwise I'd modify it myself, as this should be straightforward.

I know that the forces, ion positions and cell vectors are written in the h5 and xml files, even for NWRITE=0. However, I like to visualize the relaxation using ASE: ase.visualize.view(ase.io.read("OUTCAR", index=':')), which displays the changes in energy, forces, atom positions, cell vectors, and **magnetic moments** in an interactive GUI for the relaxation steps. Naturally, this does not work if the information is not written in the OUTCAR file when using NWRITE=0.

Similarly, I could visualize the vasprun.xml by reading it into ase atoms with ase.visualize.view(ase.io.read("vasprun.xml", index=':')), HOWEVER, the vasprun.xml does not contain information on the **magnetic moments**, apart from the initial values (correct me if I am mistaken). Thus I need to parse the magnetic moments separately from the OUTCAR or the h5 file.

Carrying around two big files, the vasprun.xml and vaspout.h5 files, which contain almost identical information is also waste of disk space. Thus, I would ideally only have, the human and ASE readable, OUTCAR file (without the eigenvalues for each ionic step) and the vaspout.h5 file for parsing with py4vasp. Finally, the py4vasp conversion of the vaspout.h5 into ase atoms only contains the structural information and don't suit my purpose.

I would be happy if the eigenvalues could be suppressed independently from the OUTCAR file in a future VASP release :)

Best,
Lassi

martin.schlipf
Global Moderator
Global Moderator
Posts: 542
Joined: Fri Nov 08, 2019 7:18 am

Re: OUTCAR verbosity tags for long relaxations: Suppress bandstructure info for each ionic step while keeping the forces

#4 Post by martin.schlipf » Tue Oct 17, 2023 9:30 am

Thank you for clarifying a bit more clearly what you would like to do. There is probably some way to patch things together already because these quantities are all available via py4vasp. Assuming you have the vaspout.h5 calculation in the current folder, you could

Code: Select all

import py4vasp
calculation = py4vasp.Calculation.from_path(".")
trajectory = calculation.structure[:].read()
moments = calculation.magnetism[:].read()
This will give you the positions and magnetic moments for all steps along the trajectory. Then you can use these to construct an ase Atoms object and visualize it.

Martin Schlipf
VASP developer


Locked