Thermodynamics of inversion-domain boundaries in aluminum nitride: Interplay between interface energy and electric dipole potential energy