Dear Andreas,

Thanks for the interesting suggestion. Actually, computations of the
scattered field become time consuming in the 3d case, especially if we need
a high resolution. So, it's very important to reduce the size of computation
area. As I see, you suggest to reduce the PML thickness and to use the
interference of point sources for producing plane wave. In your case, the
PML thickness is one-fourth wavelength, and it is, of course, good. Frankly
speaking, now I am not completely understanding how it works, but may be
your idea deserves attention (I am going to check it). At the same time, I
see that you use PML in all directions (that in turn increases the size of
computation area) while Matt suggests to use PML only in one direction (in
the 2d case). 

Best wishes
Anatoliy

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Andreas Unger
Sent: Tuesday, December 18, 2007 10:50 PM
To: [email protected]
Subject: Re: [Meep-discuss] plane wave generation

Hi Matt and Anatoliy,

there is actually a third way of producing a nice oblique planewave:

because the field of the incident wave is known analytically it can be 
confined in a box inside the simulation area by interfering it away 
outside of this box. All that is needed are sources at all 4 sides 
switched on at the correct time and with the correct phase and amplitude.
The source divides the total area in an total field (TF) area inside and 
a scattered field (SF) area outside. When you place an object in the 
total field area only its scattered field reaches the SF area.
This reduces the load on the PML so that reflection on the imperfect PML 
does not matter so much and makes the scattered field of an object 
directly accessible.
I attached some sample code for a pulsed an a continuous source of a 
s-polarized wave in 2d for demonstration!

Best regards,
Andreas

matt wrote:
> 
> 
> Hi Anatoliy,
> 
> There are a few problems in the code you sent.
> 
> One fundamental issue is PML thickness.  If you want nice results, your 
> PML should be at least one wavelength thick.  In your code, the 
> frequency corresponds to a wavelength five times thicker than your PML. 
> This means waves are not properly matched by the pml layer, which will 
> cause undesirable reflections.  Your two options are to increase the 
> frequency, or increase the PML thickness.
> 
> Second, there are two ways to make nice continuous plane waves:
> 
> 1) Periodic boundary conditions in one direction, PML in the other 
> direction, and a source plane along one PML boundary.
> 
> 2) PML in all directions, and a source plane along a PML boundary in 
> each direction (if 2d, then two source planes along two PML boundaries, 
> if 3d, then three source planes along three PML boundaries).
> 
> 
> Prof. Johnson explains how to do the latter somewhere on the mailing 
> list.  To do the former, I modified your code as follows:
> 
> 
> (define-param sy 6) ; the size of the computational cell NOT including PML
inthe y direction
> (define-param sx 6) ; the size of the computational cell including PML
inthe x direction
> (define-param dpml 4) ; the thickness of PML layer
> (define-param svert (+ sy (* 2 dpml)))
> (define-param frec 1)
> (define-param res 25)
> (define-param theta (/ pi 4))
> 
> (define kx (* frec (sin theta)))
> (define (my-amp-func p)(exp (* 0+2i pi kx (vector3-x p))))
> 
> (set! k-point (vector3 kx 0 0))
> (set! geometry-lattice (make lattice (size sx svert no-size)))
> (set! sources (list
>              (make source
>               (src (make continuous-src (frequency frec)))
>               (component Hz)
>               (center 0 (/ sy -2))
>               (size sx 0)
>               (amp-func my-amp-func))))
> 
> (set! pml-layers (list (make pml (thickness dpml) (direction Y))))
> (set! resolution res)
> 
> (run-until 100
>              (at-end (output-png Ex "-Zc dkbluered"))
>              (at-end (output-png Ey "-Zc dkbluered")))
> 
> I changed some numbers, just to make it run faster.  The important thing 
> to note is that there is no PML in the X direction, and the boundary of 
> computatation is adjusted accordingly.  The source plane extends from 
> the left to the right of the cell.
> 
> Also, it may be more convenient for you to use output-png instead of 
> h5topng at the command line.
> 
> Best,
> Matt
> 
> 
> 
> 
> 
> 
> On Fri, 14 Dec 2007, Anatoliy Goncharenko wrote:
> 
>> Dear Meep users,
>>
>>
>>
>> Because the problem of scattering of the plane wave appears to be the
>> classical problem, I expect that many people deal with it. Earlier, there
>> was a broad discussion on signifying the plane wave source in Meep (see
the
>> subject oblique plane wave scattering) and some codes were developed.
>> However, I am not sure that everything is correct in these codes. For
>> checking, I have considered the plane wave in the empty 2d box following
the
>> way suggested earlier by Steven Johnson and Matt,
>>
>> http://ab-initio.mit.edu/pipermail/meep-discuss/2007-February/000704.html
>>
>> http://ab-initio.mit.edu/pipermail/meep-discuss/2007-February/000705.html
>>
>> (see my file below). Instead of the s-polarized wave, when the electric
>> field is normal to the scattering (xy) plane, i.e., when there is the
only
>> (Ez) component of the electric field, I have dealt with the p-polarized
>> wave, when the electric field is in the scattering plane. So, there are
two
>> components of the electric field, Ex and Ey, and correspondingly the only
>> (Hz) component of the magnetic field. For simplicity, I have considered
the
>> plane wave incident at an angle of 45 degrees. Thus, I have signified Hz
and
>> computed Ex and Ey. It is clear, that both components, Ex and Ey, must be
>> the same due to symmetry. It is easy to see, however, that it is not so:
the
>> field distribution is different for Ex and Ey. Who can tell me, where is
a
>> bug?
>>
>>
>>
>> Best regards,
>>
>> Anatoliy
>>
>>
>>
>> (define-param sy 10) ; the size of the computational cell including PML
in
>> the y direction
>>
>> (define-param sx 10) ; the size of the computational cell including PML
in
>> the x direction
>>
>> (define-param dpml 1) ; the thickness of PML layer
>>
>> (define-param frec 0.2)
>>
>> (define-param res 25)
>>
>> (define-param theta (/ pi 4))
>>
>> (define kx (* frec (sin theta)))
>>
>> (define (my-amp-func p)(exp (* 0+2i pi kx (vector3-x p))))
>>
>> (set! k-point (vector3 kx 0 0))
>>
>> (set! geometry-lattice (make lattice (size sx sy no-size)))
>>
>> (set! sources (list
>>
>>            (make source
>>
>>             (src (make continuous-src (frequency frec)))
>>
>>             (component Hz)
>>
>>             (center 0 -4)
>>
>>             (size 8 0)
>>
>>             (amp-func my-amp-func))))
>>
>> (set! pml-layers (list (make pml (thickness dpml))))
>>
>> (set! resolution res)
>>
>> (run-until 1000
>>
>>            (at-end output-efield-x)
>>
>>            (at-end output-efield-y))
>>
>>
>>
>>




_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Reply via email to