You could look at the pair style for TIP4P which handles this
for a 4th fictitious site. In general virial = sum (Fi dot ri), where
the ri = a set of atom coords all close to each other (e.g. not
far apart across a periodic boundary).

For a six-point model, the TIP4P code is a good example for how to reference the data to calculate the additional sites.

However, the mathematics will not apply, as the TIP4P model assumes that the dummy site is in the same plane as the three atoms it communicates with. This is not the case in a six-point model, as the additional sites do not necessarily lie in the same plane.

If this is in fact the case, you will need to consult the paper by Feenstra et al., which appeared in J Comp Chem, 20, 786 (1999), to get the equations that apply for your model. They are, if I recall correctly, substantially more complicated than the TIP4P equations.