Calculate stress in a specified part not whole system?

Hello everyone,

I would like to calculate the stress of a specified part of my system because I want to remove the effects of fixed atoms on the stress. In Material Studio, the reported stress includes both fixed and unfixed atoms. I tried to follow the virial stress formulation according to the manual, but it did not work.

Could you please help me figure out how to calculate the stress in a specified part?

Thank you very much!