Fundamentals of the finite element method