Hello,

In short, I also don't know. However, note that:
* The "source" is really the source term of your Maxwell Equations, i.e.
there is no guarantee that a specific field distribution follows from a
specific source distribution (other than said equations) - shape your source
and geometry so that you get what you need.
* Make sure your source profile fits into your simulation box, otherwise you
will get edge effects.
* You might be more successful in obtaining answers to your questions if you
direct them to the mailing list instead of writing to me only.

Good luck,
  Georg



On Fri, Jan 28, 2011 at 5:41 AM, Geethaka Devendra <gcdeven...@gmail.com>wrote:

> Hi Georg,
>
> In addition to the earlier email, my idea is to launch a source which has
> the fundamental mode shape. My waveguide is a single mode waveguide, thus
> want the shape of the source to be like the fundamental mode. This interacts
> with a grating stucture,,,,so thats the reason I want the shape to be like a
> gaussian distribution. Hope my details will help you to help me.
>
> Thanks
> Geeth
>
>

Hi Georg,
>
> Thanks alot for your tips, I tried to implement the source in the following
> way (code is attached), but it does not seem to be having the gaussian
> spatial profile, I wanted. Could you see what I have done wrong here and let
> me know?  I didnt understand in your part of code, what "((my-amp sigma k)
> x)" this actually does, I think I am missing something here.
>
> Thanks alot
> Regards
> Geeth
>
> My code:
>
>
> ; Gaussian shape source
>
> (define wlen 1.55)
> (define fcen (/ 1 wlen))
> (define df 0.5)
>
> (define dpml 1.0)
>
> (define sy 30)
> (define sx 30)
>
> (set! geometry-lattice (make lattice (size sx sy no-size)))
>
>
> ;(define (( my-amp sigma k) x)
>
> ;    (exp    (- (* 0+2i pi (vector3-dot k x)) (/ (vector3-dot x x) (* 2
> sigma sigma)))))
>
> (define (my-amp p)
>     (exp (- (sqr (vector3-y p)))))
>
>
> (set! sources (list
>     (make source
>         (src (make gaussian-src (frequency fcen) (fwidth df)))
>         (component Ez)
>         (center 0 0)
>         (size 0 3 0 )
>
> ;        (amp-func (my-amp 1 (vector3 0 5 0)))
>         (amp-func my-amp)
>         (amplitude 100))))
>
>
> (set! pml-layers (list (make pml (thickness dpml))))
> (set! resolution 10)
>
> (use-output-directory)
>
> (run-until 50
> ;    (at-beginning output-epsilon)
>         (to-appended "ez" (at-every 0.1 output-efield-z)))
>


> On Thu, Jan 27, 2011 at 1:18 AM, Georg Wachter <georgwach...@gmail.com>wrote:
>
>> Hello,
>>
>> I use the following code snippet to generate a Gaussian (spatial) + sin**2
>> (time) source, also taken from this list and adapted. It's pretty
>> self-explanatory, maybe you find it useful. It generates a (focus of a)
>> gaussian beam of width 1 in +y direction.
>>
>> Regards,
>>   Georg
>>
>>
>> ; %%%%%%%%%%%% source %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>>   (define-param phasephi 0.500)
>> ; spatial dependence - gaussian
>> (define ((my-amp sigma k) x)
>>   (exp (- (* 0+2i pi (vector3-dot k x))
>>   (/ (vector3-dot x x) (* 2 sigma sigma)))))
>> ; time dependence
>> (define (laser_2 t)
>>   (define tau 1.9486509 )  ; 6.5 fs
>>   (define frequency 1.25)  ; 800 nm
>>   (define phase (* 2 pi (+ 0.50 0.25 phasephi) )) ; cosine+=0.
>>   (if (< t (* 2 tau) )
>>       (* (sin (+ (* 2 pi frequency (- t tau) ) phase)) 1.  (expt (sin (/
>> (* pi t) (* 2 tau)) ) 2) )
>>       0.
>>   )
>> )
>>
>> (set! sources (list
>>       ; "laser"
>>                 (make source
>>                   (src (make custom-src (src-func laser_2)) )
>>                   (component Ex) (center 0 0 )
>>           (size 06 00 05.5) (amplitude 1.)               ; size (and box)
>> should be > width!
>>           (amp-func (my-amp 1. (vector3 0 1 0)))  ; set width here
>>                 )
>>      ;  the second source is for aesthetic reasons, to cancel the "beam"
>> in -y direction
>>                 (make source
>>                   (src (make custom-src (src-func laser_2)) )
>>                   (component Hz) (center 0 0)
>>               (size 06 00 05.5) (amplitude -1.)
>>               (amp-func (my-amp 1.  (vector3 0 1 0)))
>>                 )
>>               )
>>
>> )
>>
>>
>>
>>
>> On Wed, Jan 26, 2011 at 2:58 PM, Geethaka Devendra 
>> <gcdeven...@gmail.com>wrote:
>>
>>> Hi Prof Steven and Meep users,
>>>
>>> Can someone please give me an example how to use the amp-func of the
>>> source to generate a gaussian source, which has a gaussian spatial profile.
>>> I read some of the earlier posts about using the amp-func, but didn't really
>>> understand the concept with k-vector and width. Can someone please explain
>>> me this and possibly show me an example, I think this feature of the source
>>> is really handy, but not knowing how to use is most frustrating.
>>>
>>> Thanks alot
>>> Geeth
>>>
>>> _______________________________________________
>>> meep-discuss mailing list
>>> meep-discuss@ab-initio.mit.edu
>>> http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss
>>>
>>
>>
>
_______________________________________________
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