I’m wondering why fixes that apply potential such as fix spring and fix wall don’t contribute to the virial. I know that it can be difficult to decide the per-atom contribution of external forces, but it doesn’t seem to me that the external virial contributes to total pressure at all. If there is a place for this contribution, can you point me to it?
I'm wondering why fixes that apply potential such as fix spring and fix wall
don't contribute to the virial.
because it hasn't been programmed.
I know that it can be difficult to decide
the per-atom contribution of external forces, but it doesn't seem to me that
the external virial contributes to total pressure at all. If there is a
place for this contribution, can you point me to it?
what do you mean by this? that you want to do the programming to
implement these contributions?
These all have the characteristic of applying a force to a local group of atoms to constrain there relative positions. Presumably these contributions are consistent with the relation: Pxx*V/Lx = -dU/dLx. It would not be hard to extend this to other fixes that calculate a force (although this would not make sense for something like fix langevin). The real obstacle is knowing exactly what is the correct formulation and providing a test of correctness. Note also that the formulation will depend on whether the user wants to take the derivative du/dLx with constant wall position or with wall position scaled with the box. Finally, most wall fixes provide the total force vector and the user can extract the virial contribution from that, user the formulation they like the best.