I'd like to have a 2D planewave of arbitrary incidence angle,
z-invariant, with PML in x and y directions (all around the
computation domain).
I can almost get this with two line sources, but the waves aren't
perfect (visually).
I think what you propose only works for normal incidence.
Best,
Matt
>
> PLANE WAVES:
> -----------
> You are working in 2D which means you want a line source in x-y in teh case
> of z-invariance. If you want a planewave propagating along z- then you should
> have no modulations on the x-y plane. If you want a 3D planewave that is
> obliquely incident to the x-y- plane that you are visualizing then we'd have
> the formulation that you've included below. Is this what you are trying to
> simulate? But all your reference points for the wavefronts are in 2D: (-0.5s,
> 0) and (0, -0.5s). This leads me to believe that you want a planewave with
> k-vector parallel to the x-y plane. that would make it a line source for your
> problem. For this I use the following amp-func:
>
> (define (line-source-dist pos)
> (abs (vector3* (vector3- pos line-source-center)
> line-source-unit-normal)
> )
> )
> (define (line-source-amp-func pos)
> (if (> (line-source-dist pos) 2)
> 0
> (* 0.5 (- 1 (line-source-dist pos)))
> )
> )
>
> My amplitude function defines a line source whose strength varies linearly
> down to zero with distance from the line along the unit normal over an
> interval of 2 length-scales. With this I get nice z-invariant planewaves.
>
>
> cheers!
> Manoj
>
>
> matt wrote:
>>
>>
>>
>> Hello,
>>
>> I noticed some strange behavior in output-png+h5 with meep-mpi 0.10.1
>>
>> The png output is incorrect has white patches blocking the fields. If I
>> run the h5topng -Zc dkbluered on the h5 ouput, the resuling png appears
>> correct without the white patches. Non-parallel meep does not exhibit this
>> behavior.
>>
>> I attached a sample png which illustrates what happens. Depending on the
>> number of processors I run, the white patches can change their layout. For
>> the attached image, I ran with four processors
>>
>> mpirun -np 4 meep-mpi silverrod1.ctl
>>
>> The code below will (hopefully) reproduce the error...
>>
>> As a side question, I never get perfect plane waves with this approach,
>> even if I make the pml thick and let the simulation run for many time
>> steps. Is there something else I should consider?
>>
>> Best,
>> Matt
>>
>>
>>
>>
>> (set! eps-averaging? false)
>> (define-param s 1600) ; the size of the computational cell, not including
>> PML
>> (define-param dpml 400) ; thickness of PML layers
>>
>> (define sxy (+ s (* 2 dpml))) ; cell size, including PML
>> (set! geometry-lattice (make lattice (size sxy sxy no-size)))
>>
>> (set! geometry '())
>>
>> (set! pml-layers (list (make pml (thickness dpml))))
>> (set-param! resolution (/ 1 10)) ;; pixels per distance unit
>>
>> (define ((pw-amp k x0) x)
>> (exp (* 0+1i (vector3-dot k (vector3+ x x0)))))
>>
>> (define-param lcen 213)
>> (define-param fcen (/ 1 lcen)) ; pulse center frequency
>> (define-param df (/ fcen 100)) ; 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) (size 0 s)
>> (amp-func (pw-amp k (vector3 (* -0.5 s) 0))))
>>
>> ; bottom
>> (make source
>> (src (make continuous-src (frequency fcen) (fwidth df)))
>> (component Hz) (center 0 (* -0.5 s)) (size s 0)
>> (amp-func (pw-amp k (vector3 0 (* -0.5 s)))))
>>
>> ))
>>
>> (define-param T 100000) ; run time
>> (run-until T (at-beginning output-epsilon)
>> (at-end (output-png+h5 Hz "-Zc dkbluered"))
>> (at-end output-tot-pwr))
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> 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