Driving water cavitation in a hydrogel cavity