# [lammps-users] Compute and output the energies of a specified group/region

Dear LAMMPS users,

I have a system that contains two groups of atoms - A and B (please see below). I would like to compute and output the energies (ebond, eangle edihed, evdwl and ecoul) of each group separately. I looked at the different compute options but could not find the right ones. Could anybody please tell me any command in LAMMPS that I can use?
Thank you!

Kind regards
Tan Vu Bui

#input file:

group A id <= 4500
group B id > 4500

# bond

bond_style harmonic
bond_coeff 1 350 1.53 # C:C
bond_coeff 2 350 1.09 # C:H
bond_coeff 3 350 1.37 # F:C

# angle

angle_style cosine/squared
angle_coeff 1 66.67 120
angle_coeff 2 56.25 109.471
angle_coeff 3 54.5 106.7

# dihedrals

dihedral_style harmonic
dihedral_coeff 1 1 1 3
dihedral_coeff 2 1 1 3
dihedral_coeff 3 0.5 -1 6

# pairwise

pair_style hybrid/overlay lj/cut/coul/cut 10 hbond/dreiding/lj 4 2.2 3.5 90
pair_coeff 1 1 lj/cut/coul/cut 0.0238 3.473
pair_coeff 2 2 lj/cut/coul/cut 0.0181 3.093
pair_coeff 3 3 lj/cut/coul/cut 0.0038 2.846

pair_coeff 4 4 lj/cut/coul/cut 0.0194 3.263

pair_coeff 1 2 hbond/dreiding/lj 3 i 9.5 2.75 4 2.2 3.5 90
pair_coeff 1 4 hbond/dreiding/lj 3 i 9.5 2.75 4 2.2 3.5 90

Dear LAMMPS users,

I have a system that contains two groups of atoms - A and B (please see below). I would like to compute and output the energies (ebond, eangle edihed, evdwl and ecoul) of each group separately. I looked at the different compute options but could not find the right ones. Could anybody please tell me any command in LAMMPS that I can use?

they don’t exist. those properties are accumulated globally.

the only way I know to access that information for parts of your system would be for first do a simulation and record a trajectory and then turn off the interactions that you don’t want to be reported in one way or another and compute only the parts you want. for that to would you may have to introduce additional interaction types for which the interactions are set to zero and set the charges to zero.

axel.

forgot to mention, you need to use the “rerun” command to post-process the trajectory.
https://docs.lammps.org/rerun.html