This paper concerns theory and implementation of p and h-p adaptive ve
rsions of finite element method The different procedures of adaptivity
and the optimal mesh concept are discussed end a methodology to obtai
n optimal or quasi optimal meshes with hierarchical elements is presen
ted The error estimator used and the algorithm implemented are also pr
esented. The efficiency is demonstrated in two classical 2D examples.
In this examples, we have analysed both cases the regular solution and
non regular one, and the meshes obtained during the adaptive processe
s are compared.