Computer simulation of mesocrystals