Detects connections (during refinement) between locationsInsideMesh and locationsOutsideMesh and writes a sampledSet for postprocessing.