Computer simulation of crystal structures