  The finite element methods (FEM) are important techniques in engineering for
solving partial differential equations, but they depend heavily on element
shape quality for stability and good performance. In this paper, we introduce
the Adaptive Extended Stencil Finite Element Method (AES-FEM) as a means for
overcoming this dependence on element shape quality. Our method replaces the
traditional basis functions with a set of generalized Lagrange polynomial (GLP)
basis functions, which we construct using local weighted least-squares
approximations. The method preserves the theoretical framework of FEM, and
allows imposing essential boundary conditions and integrating the stiffness
matrix in the same way as the classical FEM. In addition, AES-FEM can use
higher-degree polynomial basis functions than the classical FEM, while
virtually preserving the sparsity pattern of the stiffness matrix. We describe
the formulation and implementation of AES-FEM, and analyze its consistency and
stability. We present numerical experiments in both 2D and 3D for the Poison
equation and a time-independent convection-diffusion equation. The numerical
results demonstrate that AES-FEM is more accurate than linear FEM, is also more
efficient than linear FEM in terms of error versus runtime, and enables much
better stability and faster convergence of iterative solvers than linear FEM
over poor-quality meshes
