Atomic scale investigation of nanocrack evolution in single-crystal and bicrystal metals under compression and shear deformation