Computer simulation of the atomic structure of defects in metals