Statistical mechanical theory of the facet edge of a crystal