Dear lammps-users,

I want to compute *evdwl* **and** *ecoul* of **the specified group** by lammps. However, so far I haven’t found a command to calculate this from the manual.

Only the relevant command was found (“compute pair” and “compute group//group”. But The “Compute pair” command manual describes “The group specified for this command is ignored”. whereas The “Compute group/group” command computes only the interaction energy, “EPair”.

I would like to ask if you have any suggestions to realize the evdwl and Ecoul calculation of the specified group

Thank you very much.

Best regards.

da Zhang

what you are describing is ill-defined. do you mean all interactions of all atoms in a group with *only* the other atoms in the *same* group or with *all* atoms or all *other* atoms.

energy is a pairwise contribution (for pairwise additive potentials) not an individual contribution.

that said, you could probably compute any of the options listed through using compute pe/tally and then using compute reduce sum.

however, that will compute the sum of evdwl and ecoul since that is how the data is accumulated.

to get something else, you would either have to record a trajectory and then modify the force field to include only the desired interactions and then use the rerun command, or you would need to program your own custom version of compute pe/tally (e.g. compute ecoul/tally and compute evdwl/tally) and then use that.

please also note, that if you are using long-range electrostatics (coul/long) then this tally and the resulting sums are incomplete, since the long-range contribution from the kspace style is missing. in that case it would be advisable to go through the route of using rerun and then a cutoff coulomb with a sufficiently large cutoff. that will get much more consistent energies and no errors on the forces, since the trajectory with pre-recorded with long-range coulomb.

axel.

Axel

Thank you very much for your patient answer, it was very helpful to me.