FYI, the posted control file works fine with meep 1.2.1 on my Debian Squeeze system.
meep --version Meep 1.2.1, Copyright (C) 2005-2012 Massachusetts Insitute of Technology. Using libctl 3.2.1 and Guile 1.8.7. Hope that this will provide some help. Simon On Sat, Sep 8, 2012 at 1:57 PM, huang bo <[email protected]> wrote: > the ctl file using the suggested implementations of > oblique angles ( > http://www.mail-archive.com/[email protected]/msg00697.html), > and can work with meep 1.1.1, but can't work under meep 1.2, the error > message is below: > > > $ meep 45-degree.ctl > ice-9/psyntax.scm:974:26: In procedure scan: > ice-9/psyntax.scm:974:26: Syntax error: > 45-degree.ctl:19:0: source expression failed to match any pattern in form > (define ((pw-amp k x0) x) (exp (* 0.0+1.0i (vector3-dot k (vector3+ x > x0))))) > > > the problem seem relate with the define of amp-func : > > (define ((pw-amp k x0) x) (exp (* 0+1i (vector3-dot k (vector3+ x x0))))) > > > the ctl file is below: > > ; This example creates an approximate TM planewave in vacuum > ; propagating at a 45-degree angle, by using a couple of current sources > ; with amplitude exp(ikx) corresponding to the desired planewave. > > (define-param s 11) ; the size of the computational cell, not including PML > (define-param dpml 1) ; thickness of PML layers > > (define sxy (+ s (* 2 dpml))) ; cell size, including PML > (set! geometry-lattice (make lattice (size sxy sxy no-size))) > > (set! pml-layers (list (make pml (thickness dpml)))) > (set-param! resolution 10) > > ; pw-amp is a function that returns the amplitude exp(ik(x+x0)) at a > ; given point x. (We need the x0 because current amplitude functions > ; in Meep are defined relative to the center of the current source, > ; whereas we want a fixed origin.) Actually, it is a function of k > ; and x0 that returns a function of x ... > (define ((pw-amp k x0) x) (exp (* 0+1i (vector3-dot k (vector3+ x x0))))) > > (define-param fcen 0.8) ; pulse center frequency > (define-param df 0.02) ; turn-on bandwidth > (define-param kdir (vector3 1 1)) ; direction of k (length is irrelevant) > (define k (vector3-scale (* 2 pi fcen) > (unit-vector3 kdir))) ; k with correct length > (define kxcos (vector3-x (unit-vector3 k))) ; direction cosine of k in x > (define kycos (vector3-y (unit-vector3 k))) ; direction cosine of k in x > > (set! sources > (list > > ; left > (make source > (src (make continuous-src (frequency fcen) (fwidth df))) > (component Hz) (center (* -0.5 s) (* -0.25 s)) (size 0 (/ s 2)) > (amp-func (pw-amp k (vector3 (* -0.5 s) (* -0.25 s))))) > > ; bottom > (make source > (src (make continuous-src (frequency fcen) (fwidth df))) > (component Hz) (center (* -0.25 s) (* -0.5 s)) (size (/ s 2) 0) > (amp-func (pw-amp k (vector3 (* -0.25 s) (* -0.5 s))))) > > )) > > (use-output-directory) > > (define-param T 100) ; run time > ;(run-until T (at-end output-efield-z)) > (run-until T > (at-end (output-png Ex "-Zc dkbluered")) > (at-end (output-png Ey "-Zc dkbluered"))) > > > > > _______________________________________________ > meep-discuss mailing list > [email protected] > http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss >
_______________________________________________ meep-discuss mailing list [email protected] http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

