Dear Steven and Meep users,

I wanna obtain a normalized transmission curves of a periodic geometry. 
Therefore, I have to do multiple simulations for each frequency. My question 
is how to write a loop to update the frequency and write the flux into a file. 
I wrote the loop according to the meep wiki, but it did not work. Would you 
like give me some comments? Thanks a lot.

 ... ...
(define-param   a       (/ unit 7.0e-007))
(define-param   b       (/ unit 8.0e-007))
(define-param   dx      (/ unit 0.1e-007))
(define-param   fcen    0)
(define trans   0)

(do ((fcen a (+ fcen dx))) ((> fcen b)) 
(set! sources
   (list
      (make source
         (src (make continuous-src (frequency fcen)))
         (component Ex)
         (center 0 0 (+ (/ sz -2) dpml pad)) (size sx sy 0)
         (amplitude amp)
      )))

(set! symmetries (list (make mirror-sym (direction Y) (phase 1)) ))

(Set! trans
   (add-flux fcen 0 1
      (make flux-region
         (center 0.1 0.2 (- (/ sz 2) dpml pad)) (size 0 0 0) (direction Z))
   ))
(run-until 100)
(print "flux:, "amp", "(first (get-fluxes trans))"\n")
)


Best,
Chen



_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to