On Sun, 30 Apr 2006, X. Y. AO wrote:
How to define a source to generate a beam (e.g. tilted Gaussian beam in
free space) in meep?
Just provide an amplitude function (amp-func property) that gives the
field amplitude as a function of space to make a Gaussian envelope. To
tilt the beam, add an exp(ikx) phase. e.g. do:
(define ((my-amp sigma k) x)
(exp (- (* 0+2i pi (vector3-dot k x))
(/ (vector3-dot x x) (* 2 sigma sigma)))))
and then create a source with (amp-func (my-amp s k)) where you pass it
the desired width s and k-vector k.
(Note that the syntax (define ((foo x) y) ...) defines a function (foo x)
that returns a function of y.)
Cordially,
Steven G. Johnson
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss