Simulations pinpoint atomic-level defects in solar cell nanostructures