Dear MEEP experts,
- I`m a freshman in using MEEP simulator, I had followed the tutorial
and the MEEP-DISCUSS mailing list but didn`t found the root cause to my
errors:
ERROR: In procedure *:
ERROR: Wrong type: #<primitive-generic />
- The code (ctl file) that I`m trying to write its purpose is to
simulates the power emitted from a point source that located in dielectric
material (W).
- The simulation environment is a cube with configurable size (sx,sy,sz).
- The dielectric material is Tungsten (W). The definition of this
material is done through the complex epsilon model.
- The bottom half of the simulation environment cube (-sz/2<z<0) is all
Tungsten. Upper half is a vacuum.
- I`m using LINUX-UBUNTU package software.
Enclosed in here the code:
;--------------------------------------------------------------------------------------------
; Author: Sagiv Kleiman
; Company: SolariPhy
; Date : 16-Sep-2012
; Purpose: to check the emissivity of lossy dielectric.
;--------------------------------------------------------------------------------------------
; Initializing MEEP to remove leftovers from previous simulations
(reset-meep)
;--------------------------------------------------------------------------------------------
; In this file, the basic unit <a> stands for 100nm (1e-7m)
; Parameters definition:
; sx, sy, sz - simulation environment size
; res - resolution
;--------------------------------------------------------------------------------------------
(define-param sx 10)
(define-param sy 10)
(define-param sz 10)
(define-param h -0.3) ; depth of the source from the origin
(define-param fcen 0.15) ; pulse center frequency
(define-param df 0.1) ; pulse width (in frequency)
(define-param nfreq 100)
(define-param res 10)
(define-param dielectric? true) ; if true, dielectric is W - else,
dielectric is vacuum
;--------------------------------------------------------------------------------------------
; Setting computational cell size
; Defining the complex epsilon of Tungsten
;--------------------------------------------------------------------------------------------
(define W
(make dielectric (epsilon 1)
(polarizations
(make polarizability
(omega 1e-20) (gamma 0.005162) (sigma 2.3421e+39)
)
(make polarizability
(omega 0.080978) (gamma 0.042747) (sigma 9.3624)
)
(make polarizability
(omega 0.15462) (gamma 0.10332) (sigma 7.8945)
)
(make polarizability
(omega 0.28875) (gamma 0.26874) (sigma 9.6272)
)
(make polarizability
(omega 0.60475) (gamma 0.47071) (sigma 8.0514)
)
)
)
)
(set! geometry-lattice (make lattice (size sx sy sz)))
(set! geometry
(if dielectric?
(list
(make block
(center 0 0 0)
(size sx sy sz)
(material (make dielectric (epsilon 1)
)
)
)
(make block
(center 0 0 (/ sz -4))
(size sx sy (/ sz 2))
(material W)
)
)
(list
(make block
(center 0 0 0)
(size sx sy sz)
(material (make dielectric (epsilon 1)
)
)
)
)
)
)
;--------------------------------------------------------------------------------------------
; Setting resolution
(set! resolution res)
;--------------------------------------------------------------------------------------------
; Adding a gaussian point source with band width ω1<ω<ω2 to the simulation.
; ω in units of 2πc/a.
; f in units of c/a
;--------------------------------------------------------------------------------------------
(set! sources
(list
(make source
(src (make gaussian-src (frequency fcen) (fwidth df)))
(component Ez)
(center 0 0 h)
(size 0 0 0)
)
)
)
;--------------------------------------------------------------------------------------------
; Set boundary conditions
(set! pml-layers (list (make pml (thickness 1.0))))
(set! print-ok? false)
;--------------------------------------------------------------------------------------------
; Set flux planes and calculate power exiting from simulation environment
;
;-------------------------------------------------------------------------------------------
; Define external plane for calculating flux
(define ext_top
(add-flux fcen df nfreq
(make flux-region
(center 0 0 (/ sz 100))
(size (/ sx 2) (/ sy 2) no-size)
(direction Z)
)
)
)
;--------------------------------------------------------------------------------------------
; Define internal box for calculating flux
; Min box size is 2*dx
; dx=1/res
;--------------------------------------------------------------------------------------------
(define box_size (* 2 / 1 res))
(define int_top
(add-flux fcen df nfreq
(make flux-region
(center 0 0 (+ h / box_size 2))
(size box_size box_size no-size)
(direction Z)
)
)
)
(define int_bot
(add-flux fcen df nfreq
(make flux-region
(center 0 0 (+ h / box_size -2))
(size box_size box_size no-size)
(weight -1.0)
(direction Z)
)
)
)
(define int_N
(add-flux fcen df nfreq
(make flux-region
(center 0 (/ box_size 2) h)
(size box_size no-size box_size)
(direction Y)
)
)
)
(define int_S
(add-flux fcen df nfreq
(make flux-region
(center 0 (/ box_size -2) h)
(size box_size no-size box_size)
(weight -1.0)
(direction Y)
)
)
)
(define int_E
(add-flux fcen df nfreq
(make flux-region
(center (/ box_size 2) 0 h)
(size no-size box_size box_size)
(direction X)
)
)
)
(define int_W
(add-flux fcen df nfreq
(make flux-region
(center (/ box_size -2) 0 h)
(size no-size box_size box_size)
(weight -1.0)
(direction X)
)
)
)
;--------------------------------------------------------------------------------------------
; Run simulation
;--------------------------------------------------------------------------------------------
(set! print-ok? true)
; Extract test configuration set up
(print
"************************************************************************\n"
"sx=" sx ",sy=" sy ",sz=" sz "\n"
"fcen=" fcen ",resolution=" res "\n"
"h=" h "\n"
"nfreq=" nfreq ",box-size=" box_size "\n"
"************************************************************************\n")
(print "Ext-T,Int-T,Int-B,Int-N,Int-S,Int-E,Int-W" "\n")
;--------------------------------------------------------------------------------------------
; Extract simulation result
(if (not dielectric?) (load-minus-flux "W-flux" ext_top int_top int_bot
int_N int_S int_E int_W))
(run-sources+ 500 (at-beginning output-epsilon))
(if dielectric? (save-flux "W-flux" ext_top int_top int_bot int_N int_S
int_E int_W))
(display-fluxes ext_top)
(quit)
;----------------------------------------------------------------------------------------------------------
Prompt help will be blessed.
Best Regards,
Sagiv Kleiman.
emissivity_of_lossy_dielectric.ctl
Description: Binary data
_______________________________________________ meep-discuss mailing list [email protected] http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

