The partition of unity finite element method: Basic theory and applications