How to obtain the virial term

Hi Eric and Axel
Thanks.Right,in theoretical,the3x3 matrix product 3x1vector will get 3x1vector and that an be substract by flux.I will try to do it in lammps. Thanks guys. I am sorry for failing to add the formula for you.
Best regards.