[lammps-users] Pressure tensor elements via molecular formalism of the virial theorem

Dear All,

I am trying to calculate the pressure tensor values using the molecular formalism which as far as I understood ( I may be wrong) is not the default computation for the pressure tensor in LAMMPS (Thompson et all, 2009). I have read the documentation multiple times but I couldn’t find a way to use molecules and not atoms to get the pressure values. Is there a way to do it?

I could create chunk of atoms for the same molecule and then computer its center of mass, com velocity and forces but I do not find a way to ask LAMMPS to calculate the pressure using those variables.

Will combining stress/atom and compute reduce do the trick? Is there something I am missing?

Thanks and best wishes,

Davide

Dear All,

I am trying to calculate the pressure tensor values using the molecular formalism which as far as I understood ( I may be wrong) is not the default computation for the pressure tensor in LAMMPS (Thompson et all, 2009). I have read the documentation multiple times but I couldn’t find a way to use molecules and not atoms to get the pressure values. Is there a way to do it?

There most certainly is no option to do this in LAMMPS directly. If there was one, it would be documented.
There is not much of a concept of a “molecule” during execution of LAMMPS, anyway. Molecule IDs can be assigned arbitrarily and are just a label without having any meaning for the structure. The force computation just “sees” pairs of atoms via the neighbor list(s), bonds, angles, dihedrals, impropers from their respective lists and processes them.

I could create chunk of atoms for the same molecule and then computer its center of mass, com velocity and forces but I do not find a way to ask LAMMPS to calculate the pressure using those variables.

there is none. the per-atom stress tensor is accumulated during calls to various ev_tally*() and v_tally() functions, depending on the force styles in use. The compute stress/atom merely makes that data available and collects it from the various accumulators.

Will combining stress/atom and compute reduce do the trick? Is there something I am missing?

There is a compute reduce/chunk command. Whether that computes what you want is something that you have to decide. It will perform the computation as documented in the manual.

Axel.