Hi  meep users,
I am trying to define a structure through "loop". However, when i run the 
simulation, some errors occurred, such as "ERROR: Wrong type (expecting pair): 
#<unspecified>". And I'd like to know the usage of "loop" in defining a 
structure. I attach my codes below and really appreciate any help or guidance 
from anyone.
Best wishes
Your sincerely, Jack


;loop usage
(define-param l 4) ;waveguide length
(define-param w 1) ;waveguide width
(define-param m 11) ;number of blocks
(define-param pad0 0.5) ;padding distance two neighboring blocks
(define-param pad 4) ;padding distance between waveguide and edge of PML
(define-param dpml 2) ;thickness of waveguide
(define-param n 3.4) ;refractive index of waveguide
(define sx (+ l (* 2 (+ pad dpml)))) ;cell size 
(define sy (+ (* m w) (* (- m 1) pad0) (* 2 (+ pad dpml)))) ;cell size
(set! geometry-lattice (make lattice (size sx sy no-size))) 
(set! geometry (list
                    (do 
                        ((x 1 (+ x 1))) ((> x 5.1)) ;x=1,2,3,4,5
                           (make block (center 0 (* (+ w pad0) (- 3 x))) (size 
l w infinity)
                                       (material (make dielectric (index n))))
                    );end do
               );end list
);end set
(set! sources (list
                 (make source
                     (src (make continuous-src (frequency 0.15)))
                     (component Ez)
                     (center 0 (- (* 0.5 sy) dpml))
                 );end make
              );end list
);end set
(set! pml-layers (list (make pml (thickness dpml))))
(set! resolution 10)
(run-until 200
           (at-beginning output-epsilon)
           (at-end output-efield-z)
);end run


_______________________________________________
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