"Fossies" - the Fresh Open Source Software Archive

Member "meep-1.10.0/scheme/examples/refl-quartz.ctl" (6 Nov 2018, 1044 Bytes) of package /linux/privat/meep-1.10.0.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "refl-quartz.ctl": 1.5_vs_1.6.

    1 (set-param! resolution 400) ; pixels/um
    2 
    3 (define-param sz 10)
    4 (set! geometry-lattice (make lattice (size no-size no-size sz)))
    5 (set! dimensions 1)
    6 
    7 (define lambda-min 0.4)
    8 (define lambda-max 0.8)
    9 (define fmax (/ lambda-min))
   10 (define fmin (/ lambda-max))
   11 (define fcen (* 0.5 (+ fmax fmin)))
   12 (define df (- fmax fmin))
   13 
   14 (define dpml 1.0)
   15 (set! pml-layers (list (make pml (thickness dpml))))
   16 
   17 (set! k-point (vector3 0 0 0))
   18 
   19 (set! sources (list (make source (src (make gaussian-src (frequency fcen) (fwidth df))) (component Ex) (center 0 0 (+ (* -0.5 sz) dpml)))))
   20 
   21 (define-param empty? true)
   22 
   23 (if (not empty?)
   24     (set! geometry (list (make block (size infinity infinity (* 0.5 sz)) (center 0 0 (* 0.25 sz)) (material fused-quartz)))))
   25 
   26 (define nfreq 50)
   27 (define refl (add-flux fcen df nfreq (make flux-region (center 0 0 (* -0.25 sz)))))
   28 
   29 (if (not empty?) (load-minus-flux "refl-flux" refl))
   30 
   31 (run-sources+ (stop-when-fields-decayed 50 Ex (vector3 0 0 (+ (* -0.5 sz) dpml)) 1e-9))
   32 
   33 (if empty? (save-flux "refl-flux" refl))
   34 
   35 (display-fluxes refl)