Theoretical development of a virial relationship for spatially defined fragments of molecular systems