I'm trying to use Python-Meep package to conduct some FDTD simulations. First, I want to simulate a plane wave traveling through vacuum in 'z' direction. I have problems properly setting the source in three-dimensional case. In 2D case, I can make the source as a line which touches the borders of the computational matrix. In 3D it looks like it's impossible. Below are simple examples.
This tutorial demonstrates Meep's ability to compute classical forces via the Maxwell stress tensor (MST). Also demonstrated is the eigenmode source. The geometry consists of two identical, parallel, silicon waveguides with square cross section in vacuum. A schematic of the geometry is shown below.
2D case: In 2D case, the source is a line from (x,y)=(0 , .1e-6) to (x,y)=(15e-6 , .1e-6) (from border to border). Thanks to this, the plane wave is traveling unperturbed to the opposite end of the matrix (where it is reflected).
3D case: The source is a plane from (x,y,z)=(0 , 0 , .1e-6) to (x,y,z)=(15e-6 , 15e-6 , .1e-6). This should create a plane from border to border of the matrix. However, for unknown reason, the source does not touch the boundary (there is a small empty space) and whatever I do, I cannot force it to touch it. As a result, I cannot create a plane wave travelling in 'z' direction. Until now I tried: (a) explicitly giving no_pml argument (b) giving pml(0) argument, (c) changing sampling, (d) changing 'z' position of the source. With no luck. I will be grateful for any suggestions.
user1339330user1339330
1 Answer
Your inability to send a homogeneous plane wave with electric field polarised along the X axis indeed manifests at the simulation volume boundaries perpendicular to the Y axis, where the field amplitude drops to zero. This trouble does not occur on the two boundaries perpendicular to X.
This is however fully physical solution; by default, the boundaries behave as perfect electric/magnetic conductor; the electric field component parallel to PEC must be zero in its vicinity. (Good conductors screen the external electric field.)
If you need an exact plane wave, you will have to append another command after the initialisation of field, to define the boundary as periodic:
f.use_bloch(meep.X, 0)f.use_bloch(meep.Y, 0)
Note that the second parameters doe not have to be zero, enabling the definition of arbitrary inclined wave sources.
For a more advanced (and more convenient) example, see https://github.com/FilipDominec/python-meep-utils/blob/master/scatter.py
dominecfdominecf
Not the answer you're looking for? Browse other questions tagged pythonmeep or ask your own question.
I have an issue installing python meep under Windows 10 using cygwin. I installed meep using the following tutorial: Tutorial
I have python 3.5 installed on my machine, and actually I read that meep should already have been installed as python package on my machine, and that python should find it (using the usual import command), which is not the case.
So my questions are:
1) How can I be sure that I have the meep module installed on my machine?