per-atom potential

Dear LAMMPS community

is the following syntax correct for computing per-atom potential and kinetic energy?

compute        ep all pe/atom
compute        ek all ke/atom

And for the dump command, is this the correct way to output the atom ID, type, coordinates, and per-atom energies?

dump 1 all custom 100 dump.lammpstrj id type x y z c_ep c_ek

Thank you very much for your time. I am trying to learn and I appreciate any guidance.

What is the correct syntax is explained in the manual. If your input is incorrect, LAMMPS will report an error.

It is also best practice to set up some minimal input (with just a few atoms) where you can manually compute the results to confirm that you get the expected output.

Other than that, you can refer to the multiple available LAMMPS tutorials to learn how to write LAMMPS inputs as they often explain elementary inputs line-by-line.

Also, typically the documentation has some examples of how to use the commands. For example see compute pe/atom command — LAMMPS documentation

Examples

compute 1 all pe/atom
compute 1 all pe/atom pair
compute 1 all pe/atom pair bond
1 Like