Partial differential equations in domains with self-contact