Good day everyone, I have the following code which prints the flux at the
end of the simulation and I want to know how can I write a step function (I
think this is the function I need) in order to print the flux not at the
end but at every time value within my time interval in order to see the
progression of the flux.

Question 2: I know that meep time is different from the clock time because
meep units are different. I've looked for information about Meep's time
value but I haven't been able to find anything. If I want to run a
simulation for 10 clock-seconds, how should I do it?

Code:

Units are measured in microns [a=1uc]
(define-param odir "./out-")
(define-param silicon 3.4764)    ; index of waveguide
(define-param silica 1.4444)    ; index of waveguide
(define-param w 1)    ; width of waveguide
(define-param z 5)
(define-param r 60)    ; inner radius of ring
(define-param gap 0.2)    ; gap between ring and wg
(define-param pad 4)    ; padding between waveguide and edge of PML
(define-param dpml 2)    ; thickness of PML
(define-param fcen 0.17)     ; pulse center frequency
(define-param df 0.01)      ; pulse width (in frequency)
(define-param nfreq 1) ;number of frequencies at which to compute flux
(define-param tiempos 800)

(set-param! resolution 10)

(define sxy (* 2 (+ r w pad dpml))) ; cell size
(set! geometry-lattice (make lattice (size sxy sxy z)))
(set! pml-layers (list (make pml (thickness dpml))))
(set! geometry (list
    (make cylinder
        (center 0 0 0) (height 1.2) (radius (+ r w))
        (material Si3N4))
      (make cylinder
          (center 0 0 0) (height 1.2) (radius r) )
;          (material Si3N4))
    (make block
            (center 0 (+ r w gap (/ w 2)) 0) (size sxy w 1.2)
            (material Si3N4))

    (make block
            (center 0 0 -1.8) (size sxy sxy 1.8)
            (material SiO2))

    (make block
            (center 0 0 (+ -1.8 0.3) ) (size sxy sxy 0.3)
            (material SiO2))
))

(set! sources
    (list
        (make source
            (src (make continuous-src (frequency fcen)))
                (component Ez)
                 (center (+ dpml (* -0.5 sxy)) (+ r w gap (/ w 2)) -0.9)
(size 0 w 1.2))
    )
)

;#!
(define iniflux          ;transmitted flux
    (add-flux fcen df nfreq
            (make flux-region
                (center (+ 1 dpml (* -0.5 sxy)) (+ r w gap (/ w 2)) 0)
                (size 2.4 (* w 2)) )))
(define endflux        ;reflected flux
    (add-flux fcen df nfreq
        (make flux-region
            (center (- (* 0.5 sxy) dpml 1) (+ r w gap (/ w 2)) 0)
            (size 2.4 (* w 2))  )))
;!#

(use-output-directory (string-append odir (get-filename-prefix)))
(run-until tiempos
    (at-beginning output-epsilon)
;    (at-end (output-png Ez "-S3 -Zc dkbluered -a yarg -A $EPS"))
;    (at-every 10 (output-png Ez "-S3 -Zc dkbluered -a yarg -A $EPS"))
)

(display-fluxes iniflux endflux)

Thanks in advance!

-- 
El contenido de este mensaje y sus anexos son únicamente para el uso del 
destinatario y pueden contener información  clasificada o reservada. Si 
usted no es el destinatario intencional, absténgase de cualquier uso, 
difusión, distribución o copia de esta comunicación.
_______________________________________________
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to