Topology and Geometry of Smectic Order on Compact Curved Substrates