On 06/30/2017 11:33 AM, Steve wrote:
The problem with the gaussian-src is that it does not turn off when I
change sources. I thought it was supposed to simply go away when I
change source, but it doesn't. This leads me to think that I need to

The change-sources! routine does indeed turn off the previous source in order to initialize a new one. Here is a simple demonstration. This example involves a point source in vacuum placed at the center of a 2d computational cell surrounded by PML. There is an initial continuous-wave (CW) source which is abruptly turned off. The scalar electric field over the non-PML region is output which can be viewed in post processing using h5utils. Note that abruptly turning off a source will introduce high-frequency artifacts into the simulation.

Scheme/libctl control script:

(set-param! resolution 20)

(set! geometry-lattice (make lattice (size 10 10 no-size)))

(set! pml-layers (list (make pml (thickness 1))))

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

(set! sources (list (make source (src (make continuous-src (frequency 1.0))) (component Ez) (center 0 0 0))))

(define src-on? true)

(run-until 100
           (lambda ()
             (if (and (> (meep-round-time) 40) src-on?)
                 (begin (change-sources! '()) (set! src-on? false))))
(in-volume (volume (center 0 0 0) (size 9 9 0)) (at-every 2.3 output-efield-z)))

h5utils post processing for e.g., change-sources.ctl:

> h5topng -vRZc bluered change-sources-ez-000*.h5

_______________________________________________
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