Modeling of thin-film solar cells: Nonuniform field