Hi, I am a fresh user of meep. Please help me with this error. "init-fields is required before output-component" This is my attempt to create a plane wave for the following problem . To create a plane wave, I want to place a point source at -(infinity) in z. so size of source(0,0,0). There is a 1-D variation of periodicity along x axis for the geometry that I would be defining to reside at, say some -z axis. z is of finite thickness and y dimension of the geometry is infinite. I would like to compute field distribution at z=0 plane. This is a simple 1-D diffraction problem. To begin with, I tried to create a plane wave. The code is very much a replica from the previous discussions. My geometry and plane of observation is going to be fixed. Only the position of source is going to be varied for different angles of incidence. Because the geometry would be periodic in x-dir and propagation is along z-dir, I would like to vary the angle of incidence (or k-dir) only in the xz plane. This would mean there are Ex Ey and Ez components to electric field for kx and kz components of k. I do not understand why the above said error comes for this code. (set! geometry-lattice (make lattice (size 15 15 no-size))) (set! pml-layers (list (make pml (thickness 1)))) (set-param! resolution 10) (define ((pw-amp k) z) (exp (* 0+1.0i (vector3-dot k (vector3 0 0 1))))) (define-param fcen 0.8) ; pulse center frequency (define-param df 0.02) ; turn-on bandwidth (define-param kdir (vector3 1 0 1)) ; direction of k (length is irrelevant) (define k (vector3-scale (* 2 pi fcen) (unit-vector3 kdir))) ; k with correct length (set! sources (list (make source (src (make continuous-src (frequency fcen) (fwidth df))) (component Ex) (center 0 0 (- 0 infinity)) (size 0 0 0) (amp-func (pw-amp k))) (make source (src (make continuous-src (frequency fcen) (fwidth df))) (component Ey) (center 0 0 (- 0 infinity)) (size 0 0 0) (amp-func (pw-amp k))) (make source (src (make continuous-src (frequency fcen) (fwidth df))) (component Ez) (center 0 0 (- 0 infinity)) (size 0 0 0) (amp-func (pw-amp k))) )) (define-param T 20) ; run time (use-output-directory) (run-until T (at-end (output-efield-x))) Regards, Gayathri
_______________________________________________ meep-discuss mailing list [email protected] http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

