Shape Optimization Problems with Internal Constraint