Computing optimal interfacial structure of ordered phases