[lammps-users] compute pressure

Dear,

In my system, using boundary conditions, I used “compute pressure” command to calculate the pressure of each component of x, y, z. Now I want to know the number of ghost atoms and the value of ri*fi, how do I find that? or the second term of Virial of all ghost atoms.

Dear,

In my system, using boundary conditions, I used “compute pressure” command to calculate the pressure of each component of x, y, z. Now I want to know the number of ghost atoms and the value of ri*fi, how do I find that? or the second term of Virial of all ghost atoms.

Three things:

  • that part of the documentation is not accurate and needs to be updated/corrected. The reference to ghost atoms is not correct. Those not only happen with periodic boundary conditions, but also whenever you use multiple MPI processes, as those are atoms needed from neighboring subdomains. Those will include periodic images if the neighboring subdomain is there because of periodic boundaries.

  • you cannot recover F dot r after the fact. this is computed either during the force computation based on the neighbor lists and individual pairs or immediately at the end of the pair style force computation. however, after the force computation, the forces on ghost atoms are summed to the forces of their original copies and it is no longer possible to compute the virial from F dot r after that.

  • the number of ghost atoms is a per processor number (same as the number of local atoms). it can be accessed from the library interface (and thus indirectly through the python module). please see https://docs.lammps.org/Library_properties.html#_CPPv422lammps_extract_settingPvPKc and https://docs.lammps.org/Python_module.html#lammps.lammps.extract_setting

axel.

Dear,

D925703A-0D9C-450E-A8D2-458EF44FCDD8.png

you obviously have two oil-water interfaces in your system so all globally computed properties must account for that.

axel.

D925703A-0D9C-450E-A8D2-458EF44FCDD8.png