# Yee Lattice

In order to discretize Maxwell's equations with second-order accuracy for homogeneous regions where there no discontinuous material boundaries, FDTD methods *store different field components for different grid locations*. This discretization is known as a **Yee lattice**.

The form of the Yee lattice in 3d is shown in the illustration above for a single cubic grid voxel (). The basic idea is that the three components of **E** are stored for the *edges* of the cube in the corresponding directions, while the components of **H** are stored for the *faces* of the cube.

More precisely, let a coordinate in the grid correspond to:

,

where denotes the unit vector in the *k*-th coordinate direction. Then, the ^{th} component of or (or ) is stored for the locations

.

The ^{th} component of , on the other hand, is stored for the locations

.

In two dimensions, the idea is similar except that we set . The 2d Yee lattice for the *P*-polarization (**E** in the *xy* plane and **H** in the *z* direction) is shown in the figure below.

The consequence of the Yee lattice is that, whenever you need to compare or combine different field components, e.g. to find the energy density or the flux , then the components need to be **interpolated** to some common point in order to remain second-order accurate. Meep automatically does this interpolation for you wherever necessary — in particular, whenever you compute energy density or flux, or whenever you output a field to a file, it is stored for the locations : the centers of each grid voxel.