Menu

test ctl Log in to Edit

rjm
Attachments
dft_test.ctl (820 bytes)

This file contains a single dipole in vacuum, and 3 flux objects are created, one in each principal direction. After the simulation, the 3 flux objects are exported to disk and one can find 3 HDF5 files, each containing the appropriate E- and H-fields (real and imaginary parts) for each flux object, for just as many frequencies as are specified in the ctl file.

~~~~~~~
:::scheme
; Test file for export of DFTs

(define dpml 300)

(set! geometry-lattice (make lattice (size 4000 4000 4000 )))
(set-param! resolution 0.02)

(set! eps-averaging? true)

(define-param fmax 1/500 ) ; 500 nm
(define-param fmin 1/1000) ; 1000 nm
(define cfreq (* 0.5 (+ fmin fmax) ))
(define-param freqwidth (- fmax fmin))

(set! sources (list (make source
(src (make gaussian-src (frequency cfreq) (fwidth (* pi freqwidth))))
(component Ey) (center 0 0 0) (size 0 0 0))))

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

(define fx ; transmitted flux
(add-flux cfreq freqwidth 2

    (make flux-region
                 (center 1700 0 0) (size 0 3400 3400) )
  )

)

(define fy ; transmitted flux
(add-flux cfreq freqwidth 2

    (make flux-region
                 (center 0 1700 0) (size 3400 0 3400) )
  )

)

(define fz; transmitted flux
(add-flux cfreq freqwidth 2

    (make flux-region
                 (center 0 0 1700) (size 3400 3400 0) )
  )

)

(run-sources+ 10e3 )

(pretty-save-flux "pretty-fx" fx)
(pretty-save-flux "pretty-fy" fy)
(pretty-save-flux "pretty-fz" fz)

~~~~~~


Related

Wiki: Home

Discussion

Anonymous
Anonymous

Add attachments
Cancel