code: def compute_invar(self):
          
          self.i0 = self.vxx + self.vyy + self.vzz
          self.i1 = (self.vxx*self.vyy + self.vyy*self.vzz + self.vxx*self.vzz -
                     self.vxy**2 - self.vyz**2 - self.vxz**2)
          self.i2 = (self.vxx*(self.vyy*self.vzz - self.vyz**2) +
                     self.vxy*(self.vyz*self.vxz - self.vxy*self.vzz) +
                     self.vxz*(self.vxy*self.vyz - self.vxz*self.vyy))
          self.i = (-1.) * (self.i2 / 2.)**2
          self.i.data[1:, :] /= (self.i1.data[1:, :] / 3.)**3
docs: Compute the three invariants (I0, I1, I2) of the tensor, as well as
          the quantity I = -(I2/2)**2 / (I1/3)**3.