A numerical approach for determining Weight Functions in Fracture Mechanics