Re: [Meep-discuss] Gaussian Beam source

2020-11-10 Thread Ardavan Oskooi
For a 2d cell, you need to set force_all_components=True in the 
Simulation constructor.


Note, however, that the GaussianBeamSource is only strictly valid in 3d. 
As described in the manual 
: 



"In 3d, we use a"complex point-source" method 
to define a source that 
generates an exact Gaussian-beam solution. In 2d, we currently use the 
simple approximation of taking a cross-section of the 3d beam. In both 
cases, the beam is most accurate near the source's center frequency."


See: https://github.com/NanoComp/meep/issues/1308.

On 11/10/20 04:42, Ian Sage wrote:
If I set beam_E0=mp.Vector3(1,0,0) or beam_E0=mp.Vector3(0,0,1) it 
works fine, but if E0 is set to any other direction such as 
beam_E0=mp.Vector3(1,0,1) or beam_E0=mp.Vector3(1j,0,1) then I end up 
with fields of zero. Normalizing |E0| to 1 doesn't help.


Is there any way to generate a circular polarized Gaussian beam in 2d? 
(it's possible with a simulated QWP, of course)



___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Re: [Meep-discuss] Gaussian Beam source

2020-11-10 Thread Ian Sage


On 09/11/2020 03:54, Ardavan Oskooi wrote:

sources = [mp.GaussianBeamSource(src=mp.ContinuousSource(fcen),
 center=mp.Vector3(),
 size=mp.Vector3(s,s,0),
 beam_x0=beam_x0,
 beam_kdir=beam_kdir,
 beam_w0=beam_w0,
 beam_E0=mp.Vector3(1,1j,0))] 



Many thanks for your help, Ardavan. This works like a charm in 3d. I'd 
like to use 2d for efficiency, and so far my efforts fail. In 2d I have 
a source definition like:


beam_x0 = mp.Vector3(0,0,0)  # beam center
rot_angle = math.radians(0)  # CCW rotation angle about z axis (0: +y axis)
beam_kdir = mp.Vector3(0,1,0).rotate(mp.Vector3(0,0,1),rot_angle) # beam 
propagation direction

beam_w0 = 0.8  # beam waist radius
fcen = 1
df=0.1

sources = [mp.GaussianBeamSource(src=mp.ContinuousSource(frequency=fcen, 
fwidth=df),

 center=mp.Vector3(0,0,0),
 size=mp.Vector3(s,0,0),
 beam_x0=beam_x0,
 beam_kdir=beam_kdir,
 beam_w0=beam_w0,
 beam_E0=mp.Vector3(1,0,0)]

If I set beam_E0=mp.Vector3(1,0,0) or beam_E0=mp.Vector3(0,0,1) it works 
fine, but if E0 is set to any other direction such as 
beam_E0=mp.Vector3(1,0,1) or beam_E0=mp.Vector3(1j,0,1) then I end up 
with fields of zero. Normalizing |E0| to 1 doesn't help.


Is there any way to generate a circular polarized Gaussian beam in 2d? 
(it's possible with a simulated QWP, of course)


Many thanks,

Ian


___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Re: [Meep-discuss] Gaussian Beam source

2020-11-08 Thread Ardavan Oskooi
Actually, a simpler way to set up a circularly polarized source is to 
use a single GaussianBeamSource object with complex elements for the 
beam_E0 parameter:


sources = [mp.GaussianBeamSource(src=mp.ContinuousSource(fcen),
 center=mp.Vector3(),
 size=mp.Vector3(s,s,0),
 beam_x0=beam_x0,
 beam_kdir=beam_kdir,
 beam_w0=beam_w0,
 beam_E0=mp.Vector3(1,1j,0))]

This is equivalent to the previous example involving two 
GaussianBeamSource objects with one of the objects containing 
beam_E0=mp.Vector3(0,1,0) and amplitude=1j.


On 11/8/20 19:09, Ardavan Oskooi wrote:


The following script launches a circularly polarized Gaussian beam 
source propagating along the +z direction in 3d. It is based on 
combining two overlapping GaussianBeamSource objects with orthogonal 
transverse polarization (Ex and Ey) that are 90° out of phase. Note 
that for this to work it is necessary to set force_complex_fields=True 
in the Simulation constructor (otherwise only the real part of the 
source is used by default). A 2d cross section of the beam profile is 
output at the end of the run.





___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss