Dear Meep users,

I have written the following ctl file to create a number of random sources (in time, space and orientation) but am coming up against an error which, by a process of elimination, I have narrowed down to the set! sources paragraph.

;run vars
(define-param rtime 100)

;define source variables
(define src-vect (vector3 0 0 0))
(define src-coord (vector3 0 0 0))

;geometry
(define-param sx 10) ; x size
(define-param sy 5) ; y size
(define-param sz 10) ; z size
(set! geometry-lattice (make lattice (size sx sy sz)))
(define-param h 3.5)
(set! geometry
   (list
       (make block
           (center 0 0.75 0)
           (size infinity h infinity)
           (material (make dielectric (epsilon 15.6816))))))

;sources
(define-param lam 3.3)          ; wavelength = 3.3um
(define-param lam_max 5.3)      ; max wavelength = 5.3um
(define-param lam_min 1.3)      ; min wavelength = 1.3um
(define-param fcen (/ 1 lam))    ; pulse center at 3.3um
(define-param fmin (/ 1 lam_max))   ; min frequency
(define-param fmax (/ 1 lam_min))   ; max frequency
(define-param df (- fmax fmin))    ; spectral pulse width

(set! sources
   (list
        (map (lambda (x)
             (random:hollow-sphere! src-vect)
(set! src-coord (vector3 (- (* (random:uniform) 8) 4) (random:uniform) (- (* (random:uniform) 8) 4)))
             (make source
                   (src (make gaussian-src (frequency fcen) (fwidth df)))
                   (component Ex)
                   (center src-coord)
                   (amplitude (vector3-x src-vect))
                   (start-time (* (random:uniform) rtime)))
             (make source
                   (src (make gaussian-src (frequency fcen) (fwidth df)))
                   (component Ey)
                   (center src-coord)
                   (amplitude (vector3-y src-vect))
                   (start-time (* (random:uniform) rtime)))
                 (make source
                   (src (make gaussian-src (frequency fcen) (fwidth df)))
                   (component Ez)
                   (center src-coord)
                   (amplitude (vector3-z src-vect))
                   (start-time (* (random:uniform) rtime))))
                 (arith-sequence 1 1 10))))
(display sources)

;boundaries
(set! pml-layers (list (make pml (thickness 1.0))))
(set-param! resolution 20)
;flux calculations
(define-param nfreq 50)
(define emitted ; emitted flux
   (add-flux fcen df nfreq
       (make flux-region
           (center 0 -1.5 0) (size 9 0 9) (weight -1.0))))

;program run options
(use-output-directory)
(run-until rtime
   (at-beginning
       (in-volume (volume (center 0 0 0) (size 10 5 0)) output-epsilon)))
(display-fluxes emitted)

The error which Meep comes back with, after processing geometry and subpixel averaging, is as follows:

ERROR: In procedure cdr:
ERROR: Wrong type argument in position 1: #f

I suspect that I am defining the amplitudes wrongly, but I have not found how. Following the details given in the Meep/Reference page I have overlayed the 3 components Ex, Ey and Ez to form a randomly oriented current vector and used the scheme random:hollow-sphere! to ensure each source has an overall amplitude of 1.0. Perhaps I am misunderstanding the concept; I notice other users have explicitly used a complex value for the amplitude (http://osdir.com/ml/science.electromagnetism.meep.general/2006-08/msg00039.html). Any help that anyone could give would be gratefully received.

Regards,

Ian Buss

--
-----------------------
Research PhD Student
Photonics Group
Department of Electrical & Electronic Engineering
University of Bristol
Rm 2.11 Queen's Building
University Walk
Bristol
BS8 1TR

[EMAIL PROTECTED]
http://www.bris.ac.uk/eeng/oph/members/buss

begin:vcard
fn:Ian Buss
n:Buss;Ian
org:University of Bristol;Department of Electrical and Electronic Engineering
adr;dom:;;Rm 2.11 Queen's Building;Bristol;;BS8 1TR
email;internet:[EMAIL PROTECTED]
title:Research PhD Student
x-mozilla-html:FALSE
url:http://www.bris.ac.uk/eeng/oph
version:2.1
end:vcard

_______________________________________________
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