The first is by Chris Mack, the guru of litho simulation. The second is by Kevin Berwick
The code you referenced probably doesn't do anymore than a simple Fourier propagation. Any reference on Fourier Optics such as Computational Fourier Optics by David George Voelz will have examples of how to code this.