  We describe the implementation of a topological constraint in finite element
simulations of phase field models which ensures path-connectedness of preimages
of intervals in the phase field variable. Two main applications of our method
are presented. First, a discrete steepest decent of a phase field version of a
bending energy with spontaneous curvature and additional surface area penalty
is shown, which leads to disconnected surfaces without our topological
constraint but connected surfaces with the constraint. The second application
is the segmentation of an image into a connected component and its exterior.
Numerically, our constraint is treated using a suitable geodesic distance
function which is computed using Dijkstra's algorithm.
