As a MEEP-user of one month, I post for the first time. 

(I sent this posting a few days ago, but it was not posted probably because I 
attached a gif movie file that came out of the run. This time I send it again 
without the attachement.)

In the ctl file below, I attemp to generate a plane wave pulse propagating 
along x. The electric field is polarized along z. 
Here, I have two problems.

(1) The plane wave propagates along both +x and -x directions. Is there a way 
to generate a plane wave propagating along only +x direction?
(2) The second problem is about the symmetry and boundary conditions. If I 
remove the symmetry statement from the ctl file below, I can generate the 
perfect plane wave pulse. But with the symmetry statement below, I always have 
residuary field after the source pulse propagated out. I attached a gif file 
(z=0 cross section) that was made with this run.

I would appreciate your advice.

Seong Kyu Kim

; Lattice and Boundaries ------------------------------------------------------
(define-param sx 1.0) ; the length of x of the lattice, not including PML
(define-param sy 1.0) ; the length of y of the lattice, not including PML
(define-param sz 1.0) ; the length of z of the lattice, not including PML
(define-param dpml 0.1) ; thickness of PML layers
(set! geometry-lattice (make lattice (size (+ sx (* 2 dpml)) sy sz)))
(set-param! resolution 100)
(set! pml-layers (list (make pml (thickness dpml) (direction X))))
(set! k-point (vector3 0 0 0))
; -----------------------------------------------------------------------------
; Source - plane wave ---------------------------------------------------------
; 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 2.0); pulse center frequency
(define-param df 1.0) ; frequency bandwidth
(define-param kdir (vector3 1 0 0 ) ) ; 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 gaussian-src (frequency fcen) (fwidth df)))
         (component Ez) (center (* -0.3 sx) 0 0) (size 0 sy sz)
          (amp-func (pw-amp k (vector3 (* -0.3 sx) 0 0))))  ))
; ------------------------------------------------------------------------------
; symmetries -------------------------------------------------------------------
(set! symmetries (list (make mirror-sym (direction Y)) 
                       (make mirror-sym (direction Z) (phase -1))))
; ----------------------------------------------------------------------------
; Run and outputs -------------------------------------------------------------
(set! filename-prefix false)
(set! output-single-precision? true)
(define-param T 10) ; run time
(run-until T (at-beginning output-epsilon) 
             (to-appended "ez" (at-every 0.1 output-efield-z)))
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to