An average-of-configuration method for using Kohn-Sham density functional theory in modeling ligand-field theory.