Actually, setting resolution to 200 leads to a closer result (cf image link below). There is still a frequency shift of a bit inferior to 0.005 ...

But it also means that I am spatially sampling the smallest wavelength propagating in freespace by 200/(1.125) = 180 points !!!

I was expecting that 20 points/lambda would already give a very accurate spectrum...

Am I misunderstanding meep's "resolution"?

Thanks in advance for your comments.

Best,

Guillaume

PS: The 0° incidence doesn't actually make the use of Bloch conditions per se (setting a perfect magnetic conductor on vertical boundaries should lead to the same result). So I tried kx=0.8 (in units of 2*pi/a: corresponds to an incident angle of 53.13° for the central frequency), which leads to the same quite good reflexion and transmission coefficients for res=200 and a big f-shift for res=40.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Image:
http://imagepaste.nullnetwork.net/viewimage.php?id=1060
or
http://dl.free.fr/gR4BReoB8
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[email protected] a écrit :

Dear Meep Users and Developer,

I'm new to Meep and I'd like to thank the developer for this nice soft.

As a first exercice, I'm trying to retrieve the intensity transmission
and reflexion coefficients of a dielectric slab (Fabry-Perrot). I'm
dealing with this 1D problem in 2D.
The setup is the following:
- slab: thickness = 1 (meep units), permittivity=4
- substrate & superstrate: permittivity=1
- Bloch conditions (in what follows: normal incidence)
- E field perpendicular to your screen
- f=1, df=0.25

I represented on the attached (see url below) picture a more detailed
sketch of my meep setup corresponding to the .ctl file below. I also
represented R and T obtained using Meep as well as their analytical
counterparts. In this case, f=1 is resonant an should lead to T=1 &
R=0, but I am observing a shift in frequency in Meep results.

I'm sure I'm missing something. I unsuccessfully tried many things
found on the mailing
list archives, like:
- increasing the space between source & refl flux
- increasing sx size
- increasing the pml size
- increasing the resolution
- decreasing stop-when-fields-decayed in case some f get stuck in the slab
...

Thanks for your help.

Best,

Guillaume

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Image:
http://imagepaste.nullnetwork.net/viewimage.php?id=1057
or
http://dl.free.fr/hfLzFxAxc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
RUN in shell:
meep norm-run?=true slab.ctl   |  tee slab.out0
meep                slab.ctl   |  tee slab.out
grep flux1: slab.out           >  flux.dat
grep flux1: slab.out0          >  flux0.dat
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
FILE:
slab.ctl
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(set-param! resolution 40)
(define-param nfreq 200)
(set! eps-averaging? false)

(define-param a   1.)
(define-param fcen 1.)
(define-param df 0.25)
(define-param eps 4.)
(define-param eps_im 0.0)
(define-param L (* 1. a) )
(define-param sigma (/ (* 2. pi fcen 0.0) eps) )

(define-param RCyl (* 0.16 a ))
(define-param sx  (* 2. a) )
(define-param sy  (* 6. a))
(define-param dpml (/ 2. (+ fcen (/ df 2))))

(define-param kx1 (/ -0. a) )
(define-param theta (asin (/ kx1 fcen) ) )
(define-param theta_deg (* 180. (/ 1 pi) (asin (/ kx1 fcen))) )
(define-param norm-run? false)
;(display "theta_deg="  ) (display theta_deg )(newline)

(define sypml (+ sy (* 2. dpml))) ; cell size, including PML
(set! geometry-lattice (make lattice (size sx sypml no-size)))
(set! pml-layers (list (make pml (thickness dpml) (direction Y))))

(define kx (* 1 kx1))
(set! k-point (vector3 kx 0 0))
(set! ensure-periodicity true)
(define (my-amp-func p) (exp (* 0+2i pi kx (vector3-x p))))

(if (not norm-run?)
(set! geometry (list
        (make block (center 0 0) (size sx L infinity) (material (make
dielectric (epsilon eps))))))
)

(set! sources (list
               (make source
                 (src (make gaussian-src (frequency fcen) (fwidth df)))
                 (component Ez)
                 (center 0. (* 0.45 sy)) (size sx 0)
                 (amp-func my-amp-func))))

(define trans ; transmitted flux
        (add-flux fcen df nfreq
                  (make flux-region
                    (center 0 (* -0.4 sy)) (size sx 0) ) ) )
(define refl ; transmitted flux
        (add-flux fcen df nfreq
                  (make flux-region
                    (center 0 (* 0.4 sy)) (size sx 0) ) ) )

(if (not norm-run?) (load-minus-flux "refl-flux" refl))

(run-sources+ (stop-when-fields-decayed
               50 Ez
               (vector3 0 (* 0. a) )
               1e-10)
                      (at-beginning output-epsilon)
               (at-end output-efield-z)

)

(if norm-run? (save-flux "refl-flux" refl))

(display-fluxes trans refl)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to