MEEP Documentation

MEEP documentation main page.

Creating a simulation using the MEEP C++ libraries

In order to run a simulation using the MEEP C++ interface, the following steps are necessary:
  1. initialize mpi(argc, argv); // do this even for non-MPI Meep
  2. create a meep::volume
  3. create a meep::structure using that volume
  4. create a meep::fields object
  5. add some kind of excitation.
  6. time step the code. Of course, you'll have to create measurements and output whatever data you are interested in as well.

Creating a meep::volume object

The meep::volume object contains the information about the spatial extents of the simulation domain. In addition to the object constructors, the following functions are provided, each of which returns a (*)meep::volume.
  1. meep::vol1d(double zsize, double a)
  2. meep::vol2d(double xsize, double ysize, double a)
  3. meep::vol3d(double xsize, double ysize, double zsize,double a).

Creating a structure object

The meep::structure object contains the structural information about the simulation universe. This means the dielectric values at a particular position, the polarizability information, etc. It contains the discretized information, so the meep::structure object needs to know things like what grid resolution to use, whether to use sub-pixel smoothing, etc.

Creating a fields object

The meep::fields is a gargantuan one that performes virtually all of the real simulation work inside MEEP. A copy constructor is provided, as well as meep::fields(meep::structure*, double m =0), which requires an initialized pointer to a structure, and has an optional argument m, which may be m as in mystery, as no documentation is provided. Based on the source code though, I guess it might have something to do with symmetry.

In practice, this means once you have generated the meep::structure object, generating the meep::fields object is trivial.

Running the Simulation

When running a simulation, one typically wants to do the following this:
  1. Specify absorbing boundary conditions, or periodic boundary conditions.
  2. Excite some energy (add a source)
  3. Time step
  4. Measure some physical quantities. All of these responsibilities belong to the meep::fields class.

Specifying boundary conditions

The default boundary condition in FDTD is perfectly reflecting wall. i.e. the fields outside the simulation domain are kept at zero. This is only rarely desirable. Usually one wants absorbing boundary conditions, which allow one to simulate a device where radiation can propagate outward, as though one were simulating a much large computational domain, or one wants periodic boundary condtions. Often one wants a combination of some or all of the above three possibilities.

Absorbing boundary conditions.

Meep supports perfectly matched layers (PML) as absorbing boundary conditions. The PML begins at the edge of the computational volume,and works inwards. Hence you should specify the computational cell to contain the pml thickness.

Exciting a source

To add a source, one generally creates a time signature, and uses this in one of the meep::fields member functions for creating a source, the latter specifying the spatial signature. It is possible to create a point source without specifying a meep::src_time object, using the member function detailed below. The meep::src_time class provides time signature information for sources. Gerally one uses one of the derived classes:

The following fields member functions can be used to add a source:

Time Stepping

The size of the time step is computed automatically.

Measurements

The following are measurements available within the meep libraries:

Generated on Sat Apr 5 00:25:01 2008 for MEEP by  doxygen 1.5.5