Hi everyone:
    I am building up a 3d structure for 3d FDTD.
   The structure is one pair of dipole antenna made of
Au is on the Si substrate and drude model is included.
   The purpose is to calculate the surface resonant
mode between the antenna. So I used this structure and
referred to example: holey-wvg-cavity. I used its run
model and source. I expect to get the transmission
versus frequency.  
   I attached the error message and ctl file 
  
The below is error message

Initializing structure...
Working in 3D dimensions.
terminate called after throwing an instance of
'std::bad_alloc'
  what():  St9bad_alloc
     block, center = (0,0,-44)
          size (800,800,88)
          axes (1,0,0), (0,1,0), (0,0,1)
          dielectric constant epsilon = 2.3
     block, center = (0,28,10)
          size (4,40,20)
          axes (1,0,0), (0,1,0), (0,0,1)
          dielectric constant epsilon = 6.9
     block, center = (0,-28,10)
          size (4,40,20)
          axes (1,0,0), (0,1,0), (0,0,1)
          dielectric constant epsilon = 6.9

  I have no clue to modify my code since this result
is exactly what I wanted. 
   May someone give me any hint?
  Thanks everyone!    
  the below is my ctl file

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%




(define-param wx 4) ; dipole width in x
(define-param wy 40) ; dipole width in y
(define-param wz 20) ; dipole width in z
(define-param g 16) ; gap between dipole
(define-param e_au 6.9) ; epsilon of Gold
(define-param gama_au 1.4304) ; gamma of Gold
(define-param wp_au 1.7953) ; wr of Gold





(set! resolution 10)

(define-param padx 199) ; padding between wx and edge
of PML                
(define-param pady 176) ; padding between wy and edge
of PML                
(define-param padz 44) ; padding between wy and edge
of PML                
(define-param dpmlx 199) ; thickness of PML in x    
(define-param dpmly 176) ; thickness of PML in y
(define-param dpmlz 44) ; thickness of PML in z
(define-param fcen 0.6452) ; pulse center frequency   
                           
(define-param df 0.2008)  ; pulse width (in frequency)
(define-param nfreq 200) ; number of frequencies at
which to compute flux


(set! pml-layers (list (make pml (thickness dpmlx)
(direction X))))


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

(set! pml-layers (list (make pml (thickness dpmlz)
(direction Z))))

(define sx (+ wx (* 2 (+ padx dpmlx)))) ; cell size in
x
(define sy (+ g (* 2 (+ wy pady dpmly)))) ; cell size
in y
(define sz (* 2 (+ padz dpmlz))) ; cell size in z 
(define cx 0) ; pulse center in x
(define cy 0) ; pulse center in y
(define cz 0) ; pulse center in z


(set! geometry-lattice (make lattice (size sx sy sz)))




(define Au
      (make dielectric (epsilon e_au)
            (polarizations 
             (make polarizability
               (omega 1e-20) (gamma gama_au)
(delta-epsilon (* wp_au wp_au)))
             )))




(define Si (make dielectric (epsilon 2.3)))




(set! geometry
   (list
      (make block (material Si) (center 0 0 (/  sz
-4)) (size sx sy (/ sz 2 )))    
      (make block (material Au) (center 0 (/ (+ g wy)
2 ) (/ wz 2)) (size wx wy wz))
      (make block (material Au) (center 0 (/ (+ g wy)
-2 ) (/ wz 2)) (size wx wy wz))))
   

(define-param compute-mode? false)

(if compute-mode?
    (begin
      (set! sources (list
                     (make source
                       (src (make gaussian-src (frequency fcen)
(fwidth df)))
                       (component Ey) (center 0 0))))

      ;(set! symmetries
      ;     (list (make mirror-sym (direction Y)
(phase -1))  
      ;           (make mirror-sym (direction X) (phase
-1))))

      (run-sources+ 400
                    (at-beginning output-epsilon)
                    (after-sources (harminv Ey (vector3 0) fcen
df)))
      (run-until (/ 1 fcen) (at-every (/ 1 fcen 20)
output-efield-y))      
      )
    (begin
      (set! sources (list
                     (make source
                       (src (make gaussian-src (frequency fcen)
(fwidth df)))
                       (component Ey)
                       (center 0 0)
                       (size 0 0))))

      ;(set! symmetries (list (make mirror-sym
(direction Y) (phase -1))))
      
      (define trans ; transmitted flux
        (add-flux fcen df nfreq
                  (make flux-region
                    (center 0 0) (size 0 g))))
      
      (run-sources+ (stop-when-fields-decayed 
                     50 Ey
                     (vector3 (- (* 0.5 sx) dpmlx 5) (- (* 0.5 sy)
dpmly 5))
                     1e-3)
                    (at-beginning output-epsilon)
                    (during-sources
                     (in-volume (volume (center 0 0)
(size 0 g))
                     (to-appended "hz-slice" (at-every
0.4 output-efield-y)))))
      
      (display-fluxes trans) ; print out the flux
spectrum
      ))




      
____________________________________________________________________________________
設定安全圖章,保護您的 Yahoo!奇摩帳號不被駭客盜用!
http://tw.info.yahoo.com/seal/index.html

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

Reply via email to