Detailed first-principles studies on surface energy and work function of hexagonal metals