Dear Steven and other Meep users:
I did a little revision in Steven's code (Meep discussion in Feb,
2007) for oblique planewave source below. Basicly, just tried to
change the z-independent planewave source to other direction, such as
x-independent here. But the result looks a little strange. The source
at one side is obviously stronger than the other one. Any mistake in
my revision. Thanks!
PS, the revision is for 3D model. For simplicity here set sx=no-size.
Qin
; This example creates an approximate TM planewave in vacuum
; propagating at a 45-degree angle, by using a couple of current sources
; with amplitude exp(ikx) corresponding to the desired planewave.
(define-param s 11) ; the size of the computational cell, not including PML
(define-param dpml 1) ; thickness of PML layers
(define syz (+ s (* 2 dpml))) ; cell size, including PML
(set! geometry-lattice (make lattice (size no-size syz syz)))
(set! pml-layers (list (make pml (thickness dpml))))
(set-param! resolution 10)
; pw-amp is a function that returns the amplitude exp(ik(x+x0)) at a
; given point x. (We need the x0 because current amplitude functions
; in Meep are defined relative to the center of the current source,
; whereas we want a fixed origin.) Actually, it is a function of k
; and x0 that returns a function of x ...
(define ((pw-amp k x0) x)
(exp (* 0+1i (vector3-dot k (vector3+ x x0)))))
(define-param fcen 0.8) ; pulse center frequency
(define-param df 0.02) ; turn-on bandwidth
(define-param kdir (vector3 0 1 1)) ; direction of k (length is irrelevant)
(define k (vector3-scale (* 2 pi fcen)
(unit-vector3 kdir))) ; k with correct length
(set! sources
(list
(make source
(src (make continuous-src (frequency fcen) (fwidth df)))
(component Ez) (center 0 (* -0.5 s) 0) (size 0 0 s)
(amp-func (pw-amp k (vector3 0 (* -0.5 s) 0))))
(make source
(src (make continuous-src (frequency fcen) (fwidth df)))
(component Ez) (center 0 0 (* -0.5 s)) (size 0 s 0)
(amp-func (pw-amp k (vector3 0 0 (* -0.5 s)))))
))
(define-param T 200) ; run time
(run-until T (at-end output-efield-z))
--
Dr Qin Chen
University of Bath
UK
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss