Just calling (restart-fields) and calling (set! k-point ...) is not enough to change the k-point, because you haven't told the fields object to re-initialize its boundary conditions. You need to either restart Meep entirely with (reset-meep) or, more efficiently, call (restart-fields) and (change-k-point! k-point ...).

On Jun 16, 2010, at 4:51 PM, Eric CASSAN wrote:

Dear Steven
   thanks again for the Meep software.

I try to use it to calculate dispersion diagrams. I do not understand where is the mistake I do. With the Bragg1.txt file, I find the dispersion diagram of a Bragg mirror (no problem: same result as with the MPB: see image file).

In the second file, I try to manage my-self the list of k points, and, in my opinion, I should obtain the same result. I prefer this second option, because I would like doing harminv at several locations. Regarding these questions, I have seen the archive mailing list and I have tried to use your answers.

I do not understand where is the problem. I have no error message, but I obtain the same frequency solution for all k points, just as though the Bloch periodic condition would not be taken into account properly.

Thank you for your help.

    With best regards,
                               Eric

===================================================
Eric CASSAN
Institut d'Electronique Fondamentale (UMR CNRS 8622)
Bâtiment 220 de l'Université Paris-Sud-11 (UPS11)
91405, Orsay, France
Phone : + 33 1 69 15 78 52 / 06 47 93 13 15
===================================================

<Bragg_diagram.jpg>
;;; Calculation of the dispersion diagram of a Bragg mirror using Meep

;;; Use of the run-k-points function



(define eps_core (* 2.65 2.65))
(define eps_clad (* 1.45 1.45))

(define core (make dielectric (epsilon eps_core)))
(define clad (make dielectric (epsilon eps_clad)))


(define periode 288.0) ;; période physique du BRAGG (en nm)

(define-param W (/ 500.0 periode))
(define lclad (/ 100.0 periode))
(define lcore (/ 188.0 periode))




(define-param sy 20.0)



(define-param dpml 1)

(set! geometry-lattice (make lattice (size 1 sy no-size)))

(set! default-material clad)


(set! geometry
      (list
(make block (center 0 0 0) (size lcore W no-size) (material core))
      )
)


(set-param! resolution 20)
(set! subpixel-tol 1e-6)



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

(define-param fcen 0.22)
(define-param df 0.44)

(set! sources (list
(make source (src (make gaussian-src (frequency fcen) (fwidth df))) (component Hz) (center -0.18247233 0.579152733)) (make source (src (make gaussian-src (frequency fcen) (fwidth df))) (component Hz) (center 0.3023 0.20033)) (make source (src (make gaussian-src (frequency fcen) (fwidth df))) (component Hz) (center 0.4123 -0.151284)) (make source (src (make gaussian-src (frequency fcen) (fwidth df))) (component Hz) (center 0.22123 0.251284)) (make source (src (make gaussian-src (frequency fcen) (fwidth df))) (component Hz) (center 0.3823 -0.91284))
             )
)

(define-param k-interp 20)
(run-k-points 300 (interpolate k-interp (list (vector3 0 0 0) (vector3 0.5 0 0))))


;;; Calculation of the dispersion diagram of a Bragg mirror using Meep



;;; I try to manage my-self the k points => no satisfying result



(define eps_core (* 2.65 2.65))
(define eps_clad (* 1.45 1.45))

(define core (make dielectric (epsilon eps_core)))
(define clad (make dielectric (epsilon eps_clad)))


(define periode 288.0) ;; période physique du BRAGG (en nm)

(define-param W (/ 500.0 periode))
(define lclad (/ 100.0 periode))
(define lcore (/ 188.0 periode))




(define-param sy 20.0)



(define-param dpml 1)

(set! geometry-lattice (make lattice (size 1 sy no-size)))

(set! default-material clad)


(set! geometry
      (list
(make block (center 0 0 0) (size lcore W no-size) (material core))
      )
)


(set-param! resolution 20)
;;(set! subpixel-tol 1e-6)



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

(define-param fcen 0.2)
(define-param df 0.5)

(set! sources (list
(make source (src (make gaussian-src (frequency fcen) (fwidth df))) (component Hz) (center -0.18247233 0.579152733)) (make source (src (make gaussian-src (frequency fcen) (fwidth df))) (component Hz) (center 0.3023 0.20033)) (make source (src (make gaussian-src (frequency fcen) (fwidth df))) (component Hz) (center 0.4123 -0.151284)) (make source (src (make gaussian-src (frequency fcen) (fwidth df))) (component Hz) (center 0.22123 0.251284)) (make source (src (make gaussian-src (frequency fcen) (fwidth df))) (component Hz) (center 0.3823 -0.91284))
             )
)

(define-param k-interp 10)
(define k-points (interpolate k-interp (list (vector3 0 0 0) (vector3 0.5 0 0))))

(map (lambda (k1)
       (set! k-point k1)
       (print "k-point=")
       (print k1 "\n")
       (print "\n")
       (run-until 300
(after-sources (harminv Hz (vector3 -0.18247233 0.579152733 0.0) fcen df))
       )
       (restart-fields)
    )
    k-points
)



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

Reply via email to