Stress (quasi) rigid body

Dear LAMMPS developers,

I am working on a system in which I perform the shearing of molecules linked by angles and bonds. These allow me to deal with something very close to rigid bodies which, as far as I understood, cannot be employed for simulations under shear for a bad/difficult mapping of the velocities.

I am testing different methods for extracting the stress caused by pair interactions only:
-by using stress/atom and the reduce commands
-by using compute pressure
-by extracting forces and distances between pair of particles and by then computing the stress using the virial

I would prefer to use the latter method since it would allow me to obtain (via some lines of codes) the stress only caused by pair intermolecular interactions and not the contributions from both inter and intra pair interactions, which I would instead obtain with stress/atom or compute pressure.

For testing that this was indeed working, I compared the first two methods with the last one (counting all the interactions, inter and intra). However, there is no way I can recover similar outcomes, since also the signs are completely wrong. I also tried with another simpler system (just made of neutral individual particles) I worked on in the past and the problem persists.

Here are my questions, if possible:
-am I correct in saying that fix rigid and thus rigid bodies cannot be employed with shear?
-are there ways I did not think to with which I would be able to obtain the pair intermolecular stress only or to separate the contributions (of course I cannot use neigh_modify exclude otherwise I would not have (quasi) rigid bodies anymore)?
-do you have a clue on why I cannot recover the stress obtained with stress/atom or compute pressure?
-could I proceed in the same way for a system in which for example charges are explicit (not yukawa) and explicit counterions are included?

I attach my restart and the script I am using with the last stable version of LAMMPS. The command line to run it is in the header of the file.

Thank you for your help and patience.


y_.restart.1000000 (170.8 KB)
in.y_nosolv_shear_continue (5.1 KB)