How to compute and print different energy term based on atom group?

Dear LAMMPS user,

Based atom types I want group atoms and compute both bonded and non-bond energy within each group and non-bonded energy between different groups. Then as a function of time print them in to a file. Is there any command in lammps I can use? Thank you!

Yeneneh

The compute group/group command can calculate energy
between 2 groups or within a single group. You can specify
it many times for various groups. The output can be used
by fix ave/time and output to a file.

Steve