On a generalized finite difference method for solving the Dirichlet problem for a Poisson equation