Dump individual potential energies in LAMMPS

Dear LAMMPS users,

I would like to compute and write a file with the individual potential energy of each atom in my system.

I really don’t have much experience with LAMMPS. With other codes I have been using, this is usually a common quantity to output, so I was expecting something like dump […] x y z pe but it’s apparently not that simple.

I tried to play with the thermo and compute pe commads, but I all manage to do is compute an average in the log file.

I don’t know if this makes a difference, but I’m using EAM potentials.

So is there a way to write the individual potential energies to a file? (ideally the output trajectory, but any file will do). I would like to avoid computing them myself from the atomic positions and the EAM file, since I wouldn’t know where to start…

Thank you very much!

Best,
J. P.

Please have a look at the compute pe/atom command — LAMMPS documentation

Thanks for the reply @akohlmey.

I already tried using this command as well by setting compute 1 all pe/atom in my input file, but I don’t see it computed anywhere: the output trajectory file and the log file do not contain this information.

What am I missing? Do I need to pair this command to another to specify a new output file?

Thanks.

You can use a reference to the compute in a custom style dump. See 8.3.1. Output from LAMMPS (thermo, dumps, computes, fixes, variables) — LAMMPS documentation for an overview and some examples.

OK, I think I got it. For anyone who is as bad with LAMMPS as me:

compute pe all pe/atom
dump […] x y z c_pe

where c_pe references the above-defined quantity in the compute pe.

I hope I got this right.

Thank you very much for your help, @akohlmey