Hi meep users,
I noticed a strange behaviour of meep for the following situation:
plane waves in a 3D block (k = (0 0 1), i.e. only kz component) are distorted
for certian resolution/dimension combinations.
For example: running the script below with lx= sqrt(3) a resolution of 50
yields distorted fields, whereas a resolution of 50.2 is fine. resolution 80
and 125 again are bad and 100 is fine, but why?
You can also vary lx, and let the resolution stay constant at 50. Then lx=1.5
is fine, but sqrt(3) is bad again.
Things seem to work if you round the distances between periodic boundaries,
such that multiplication of lx and the resolution yields a value close to an
integer (comment/uncomment the appropriate lines).
Can anyone reproduce these results?
I'm wondering about the origin of this behaviour.
Any help is appreciated.
Thanks,
A. Siegel
---ctl file ---
(define fcen 1.8)
(define df 0.4)
(define nfreq 100)
(define cf 5)
(define-param lc 1)
(define-param theta 0.0)
(define-param phi 0.0)
(define kx 0)
(define ky 0)
(set! k-point (vector3 kx ky 0))
(set! kx (* fcen (sin (deg->rad theta))))
(set! ky (* fcen (sin (deg->rad phi))))
(change-k-point! (vector3 kx ky 0))
(define-param periodic? true)
(define-param res 100)
; thickness of the PML layer, 16 cells
(define-param pml_cells 16)
(define dpml (* (/ 1 res) pml_cells))
; add the pml-layer in z direction
(define lx (sqrt 3))
(define ly 1)
;(define lx (/ (round (* lc (sqrt 3) res)) res))
;(define ly (/ (round (* lc res)) res))
(define lz (/ 3 fcen))
(if periodic?
(list (define lxpml lx) (define lypml ly))
(list (define lxpml (+ lx (* 2 dpml))) (define lypml (+ ly (* 2 dpml)))
(set!
ensure-periodicity true)))
(define lzpml (+ lz (* 2 dpml)))
(set! geometry-lattice (make lattice (size lxpml lypml lzpml)))
(set! geometry
(list
(make block (center 0 0 0) (material air) (size lx ly lz))))
(set! Courant 0.55)
(set! eps-averaging? true)
; set the excitation at the higher z-boundary, extend it over the whole plane
and set the polarization to Ey
(set! sources (list
(make source
(src (make gaussian-src (frequency fcen) (fwidth df) (cutoff
cf)))
(amp-func (lambda (p) (exp (* 0+2i pi kx (vector3-x p)))))
(component Ey)
(center 0 0 (/ lz 2))
(size lx ly 0))))
; pml-layers
(set! pml-layers (if periodic?
(list (make pml (thickness dpml) (direction Z) (strength 1)))
(list (make pml (thickness dpml) (direction Z) (strength 1))
(make pml (thickness dpml) (direction X) (strength 1))
(make pml (thickness dpml) (direction Y) (strength
1)))))
;set symmetry according to the direction of the normal vector on the mirror
plane
(set! symmetries (list (make mirror-sym (direction X))))
; (make mirror-sym (direction Y) (phase -1))))
(set! resolution res)
(set! filename-prefix (string-append "meep-discuss_" (if
periodic? "periodic" "isolated") "_res_" (number->string res)))
; complex fields yields time-averaged energy densities
(set! force-complex-fields? true)
(define (cond?) (and (>= (meep-time) (* 1.5 (/ cf df))) (< (meep-time) (+ (*
1.5 (/ cf df)) (/ 1 fcen)))))
(run-sources+ (stop-when-fields-decayed 2 Ey (vector3 0 0 0) 1e-4)
(to-appended "denergy_xm" (at-every 0.5 (in-volume (volume (center 0 0
0) (size 0 ly lz)) output-dpwr)))
(to-appended "denergy_y" (at-every 0.5 (in-volume (volume (center 0 0
0)
(size lx 0 lz)) output-dpwr)))
(to-appended "period_at_end_Ey_xm" (when-true cond? (at-every (/ 1 fcen
20)
(in-volume (volume (center 0 0 0) (size 0 ly lz)) output-efield-y))))
(to-appended "period_at_end_Ey_y" (when-true cond? (at-every (/ 1 fcen
20)
(in-volume (volume (center 0 0 0) (size lx 0 lz)) output-efield-y))))
)
---end ctl file---
---------
André Siegel
Ulm University
Inst. of Experimental Physics
89069 Ulm
Germany
Tel. +49(0)731 5023015
Fax. +49(0)731 5023036
E-Mail: [EMAIL PROTECTED]
URL: wwwex.physik.uni-ulm.de
---------
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss