Geometrically induced phase transitions in two-dimensional dumbbell-shaped domains