Hi,
I still have problem with this. I want to wait a certain time for the
pulse to arrive
somewhere, and then wait for the decay of the field. I try this
(important part is the
definition of mystop):
(set! resolution 10)
(define-param sx 10)
(define-param sy 2)
(set! geometry-lattice (make lattice (size sx sy no-size)))
(set! pml-layers (list (make pml (direction X) (thickness 1.0))))
(define sourcepoint (vector3 (+ (/ sx -2) 1.0))) ; where sit the source
(define endpoint (vector3 (- (/ sx 2) 1.0))) ; where we want the pulse
; to arrive
(define-param fcen 0.15)
(define-param df 1.0)
(define-param nfreq 200)
(set! sources (list (make source
(src (make gaussian-src (frequency fcen) (fwidth df)))
(component Ey)
(center sourcepoint)
(size 0 sy))))
; compute the time of arrival
(define tt (+ (- (vector3-x endpoint) (vector3-x sourcepoint)) ; time
to travel
(/ 5 df))) ; peak time
(define (mystop)
(let ((decayed (stop-when-fields-decayed 20 Ey endpoint 1e-3)))
(if (> (meep-time) tt) decayed #f)))
(run-until (mystop)
(to-appended "ey" (at-every 0.5 output-efield-y)))
but it doesn't work. I got some error, for some unknow reason to me. My level
of Scheme is very low. Any idea what I do wrong ?
Best regards.
_______________________________________________
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss