The immersed boundary method: a finite element approach