P-Adaptive And Automatic Hp-Adaptive Finite Element Methods For Elliptic Partial Differential Equations