title: Setting source in Python-Meep for FDTD simulation
body: <p>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. </p>
  
  <p>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).</p>
  
  <pre><code>import meep_mpi as meep
  
  x, y, voxelsize = 15e-6, 15e-6, 50e-9
  vol = meep.vol2d(x, y, 1/voxelsize)
  
  
  class Model(meep.Callback):
  def __init__(self):
      meep.Callback.__init__(self)
  
  def double_vec(self, r):
      return 1
  
  model = Model()
  meep.set_EPS_Callback(model.__disown__())
  struct = meep.structure(vol, meep.EPS)
  
  f = meep.fields(struct)
  f.add_volume_source(meep.Ex,
                  meep.continuous_src_time(473.755e12/3e8),    # 632.8nm
                  meep.volume(meep.vec(0e-6, .1e-6), meep.vec(15e-6, .1e-6)))
  
  while f.time()/3e8 &lt; 30e-15:
      f.step()
  
  meep.del_EPS_Callback()
  
  output = meep.prepareHDF5File("Ex1.h5")
  f.output_hdf5(meep.Ex, vol.surroundings(), output)
  del(output)
  </code></pre>
  
  <p>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 <code>no_pml</code> argument (b) giving <code>pml(0)</code> argument, (c) changing sampling, (d) changing 'z' position of the source. With no luck. I will be grateful for any suggestions.</p>
  
  <pre><code>import meep_mpi as meep
  
  x, y, z, voxelsize = 15e-6, 15e-6, 15e-6, 50e-9
  vol = meep.vol3d(x, y, z, 1/voxelsize)
  
  
  class Model(meep.Callback):
  def __init__(self):
      meep.Callback.__init__(self)
  
  def double_vec(self, r):
      return 1
  
  model = Model()
  meep.set_EPS_Callback(model.__disown__())
  struct = meep.structure(vol, meep.EPS)
  
  f = meep.fields(struct)
  f.add_volume_source(meep.Ex,
                  meep.continuous_src_time(473.755e12/3e8),    # 632.8nm
                  meep.volume(meep.vec(0, 0, .1e-6), meep.vec(15e-6, 15e-6, .1e-6)))
  
  while f.time()/3e8 &lt; 30e-15:
  f.step()
  
  meep.del_EPS_Callback()
  
  output = meep.prepareHDF5File("Ex1.h5")
  f.output_hdf5(meep.Ex, vol.surroundings(), output)
  del(output)
  </code></pre>