Effect of inversion on the grain boundary potential of a polycrystalline semiconductor