Codes for simulations of gravitational lensing