Added function for imposing Dirichlet boundary conditions.