Dear meep users,

I have a question about dispersive media and resolution.
If I use the attached control-file, the results obtained for a resolution of 
100 seems to be ok, whereas for a resolution of 125 - nothing else is 
changed - fields diverge. And again for a resolution of 150 results seem to 
be ok again. Could someone please tell me what the problem is and/or 
cross-check my observations?

Besides, what is an appropriate run time for continous sources?

Thanks
André Siegel

The control-file is called via 
(for single processors "mpirun -np2 meep-mpi" should be changed to "meep")

#! /bin/bash
# change to res=125 and results diverge
# mat=0,1,2 stands for perfect-metal, silver and gold resp.
theta=0
res=100
lc=1
mat=0
mpirun -np 2 meep-mpi theta=$theta res=$res lc=$lc mat=$mat eps=0 
metal_FPP_periodic.ctl
mat=1
mpirun -np 2 meep-mpi theta=$theta res=$res lc=$lc mat=$mat eps=0 
metal_FPP_periodic.ctl
mat=2
mpirun -np 2 meep-mpi theta=$theta res=$res lc=$lc mat=$mat eps=0 
metal_FPP_periodic.ctl
mat=0
theta=41.5
mpirun -np 2 meep-mpi theta=$theta res=$res lc=$lc mat=$mat eps=0 
metal_FPP_periodic.ctl
mat=1
mpirun -np 2 meep-mpi theta=$theta res=$res lc=$lc mat=$mat eps=0 
metal_FPP_periodic.ctl
mat=2
mpirun -np 2 meep-mpi theta=$theta res=$res lc=$lc mat=$mat eps=0 
metal_FPP_periodic.ctl

---control-file starts---

(define-param wavel 0.55)                               ;i.e. 550nm
(define fcen (/ 1 wavel))                               ;centre-fequency
(define-param nfreq 1)                          ;number of frequencies at which 
to compute flux
(define-param pulse_width 4)
(define-param pulse_cutoff 12.0)
(define-param upper 1)                          ;refractive index of upper 
medium (air)
(define-param lower 1.57)                               ;refractive index of 
substrate (BK7 glass), here 
is the source located
(define fcen_src (* fcen lower))                        ;for the periodicity, 
the phase-matching 
(Floquet-theorem) has to be adopted to the wavelength inside the material
(define-param res 100)
(define-param lc 1)
(define-param widthX lc)                                ;unit cell dimensions
(define-param widthZ (* lc (sqrt 3)))
(define-param height_upper 0.3)                 ;upper dielectric
(define-param pml_upper (/ 20 res))             ; pml layer of 20 cells
(define-param height_ag 0.05)                   ;metal thickness
(define-param height_lower 0.1)                 ;lower dielectric (with source)
(define-param pml_lower (/ 20 res))             ; pml layer of 20 cells
(define-param theta 41.15)                              ;desired angle of 
incidence in deg (in material 
with the source))
(define alpha (deg->rad theta))                                 
(define base (* -0.5 (+ pml_upper height_upper 
                                height_ag 
                        height_lower pml_lower)))
(define-param eps 0)                                    ;whether or not to use 
eps-averaging

(if (= eps 0)
        (set! eps-averaging? false)
        (set! eps-averaging? true))

(set! force-complex-fields? true)
(set! ensure-periodicity true)
(define-param mat 0)                            ;0 = perfect metal
(cond 
        ((= mat 1)                                      ;1 = silver
                (define einf 3.51)
                (define w1 4.63e-3)
                (define dep1 2.6e6)
                (define g1 3.33e-2)
                (define w2 3.7)
                (define dep2 0.56)
                (define g2 0.26))
        ((= mat 2)                                      ;2 = gold
                (define einf 6.4)
                (define w1 0.3)
                (define dep1 540)
                (define g1 0.033)
                (define w2 2.35)
                (define dep2 1.72)
                (define g2 0.7))
        (else   (define einf 1)
                (define w1 0)
                (define dep1 0)
                (define g1 0)
                (define w2 0)
                (define dep2 0)
                (define g2 0)))

(set! geometry-lattice (make lattice (size widthX (* -2 base) widthZ)))
(set! geometry (list
        (make block 
                (center 0 (+ base (/ (+ height_upper pml_upper) 2) 0))
                (material (make dielectric (epsilon (* upper upper))))
                (size widthX (+ height_upper pml_upper) widthZ))
        (make block 
                (center 0 (+ base pml_upper height_upper (/ height_ag 2)) 0)
                (if (= mat 0)
                        (material (make perfect-metal))                 
;perfect metal
                        (material (make dielectric (epsilon einf)               
;Drude-Lorentz dispersive 
material
                                (polarizations
                                        (make polarizability
                                                (omega w1) (gamma g1) 
(delta-epsilon dep1))
                                        (make polarizability
                                                (omega w2) (gamma g2) 
(delta-epsilon dep2))))))
                (size widthX height_ag widthZ))
        (make cone
                (center 0 (+ base pml_upper height_upper (/ height_ag 2)) 0)
                (material (make dielectric (epsilon 1)))        
                (radius (/ lc 2)) (height height_ag) (axis 0 1 0) (radius2 (/ 
lc 2.1)))
        (make cone
                (center (/ widthX 2) (+ base pml_upper height_upper (/ 
height_ag 2)) (/ 
widthZ 2))
                (material (make dielectric (epsilon 1)))        
                (radius (/ lc 2)) (height height_ag) (axis 0 1 0) (radius2 (/ 
lc 2.1)))
        (make cone
                (center (/ widthX -2) (+ base pml_upper height_upper (/ 
height_ag 2)) (/ 
widthZ 2))
                (material (make dielectric (epsilon 1)))        
                (radius (/ lc 2)) (height height_ag) (axis 0 1 0) (radius2 (/ 
lc 2.1)))
        (make cone
                (center (/ widthX 2) (+ base pml_upper height_upper (/ 
height_ag 2)) (/ 
widthZ -2))
                (material (make dielectric (epsilon 1)))        
                (radius (/ lc 2)) (height height_ag) (axis 0 1 0) (radius2 (/ 
lc 2.1)))
        (make cone
                (center (/ widthX -2) (+ base pml_upper height_upper (/ 
height_ag 2)) (/ 
widthZ -2))
                (material (make dielectric (epsilon 1)))        
                (radius (/ lc 2)) (height height_ag) (axis 0 1 0) (radius2 (/ 
lc 2.1)))
        (make block
                (center 0 (+ base pml_upper height_upper height_ag (/ (+ 
height_lower 
pml_lower) 2)))
                        (material (make dielectric (epsilon (* lower lower))))
                (size widthX (+ height_lower pml_lower) widthZ))))

(set-param! resolution res)
(set! filename-prefix (string-append (number->string lc) "_" (number->string 
res) "_" (number->string pml_upper) "_" (number->string mat) "-" 
(number->string eps) "_fpp_" (number->string theta)))

(set! pml-layers (list 
        (make pml (thickness pml_upper) (strength 2.0) (direction Y) (side Low))
        (make pml (thickness pml_lower) (strength 0.75) (direction Y) (side 
High)
)))

(define kx 0)
(set! k-point (vector3 kx 0 0))
(set! kx (* fcen_src (sin alpha)))                              ;apply the 
Floquet-theorem on the 
boundaries
(change-k-point! (vector3 kx 0 0))

(set! sources
(list
  (make source
   (src (make continuous-src                            ;monochromatic plane 
wave
        (wavelength wavel)))
   (amp-func (lambda (p) (exp (* 0+2i pi kx (vector3-x p)))))
   (component Hz)
   (center 0 (+ base pml_upper height_upper height_ag height_lower) 0)
   (size widthX 0 widthZ))))

(set! symmetries (list (make mirror-sym (direction Z) (phase 1))))      
;exploit 
symmetry perpendicularly to the plane of incidence

(run-until 40                                                   ;what is an 
appropriate run time? for increasing run time 
fields tend to diverge?
        (at-beginning output-epsilon)
        (at-end output-hpwr)
        (at-end output-dpwr)
        (at-end output-sfield-y)
)

---control-file finished---


---------
André Siegel
Ulm University
Inst. of Experimental Physics
Albert-Einstein-Allee 11
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
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to