Molecular dynamics study of photochromic molecules probed by the mask pattern transferred transient grating technique