How can FDTD be divergence free when approximating co-located points of $E$ and $H$ on the Yee cell? I am using this source as a means to produce a 3D FDTD code which can handle anisotropic material. Because tensors are used, all components of the $E$ and $H$ fields must be used when calculating the next time step of the electric field.
And because of this, approximations must be used to calculate each component of $E$ and $H$.
For instance when solving for $E_z|^{n}_{i,j,k+1/2}$ - then the following components are also needed.
$$E_x|^{n}_{i,j,k+1/2}$$
$$E_y|^{n}_{i,j,k+1/2}$$
$$H_x|^{n}_{i,j,k+1/2}$$
$$H_y|^{n}_{i,j,k+1/2}$$
$$H_z|^{n}_{i,j,k+1/2}$$
However none of the above co-located components are available on the Yee cell, and must be approximated
But according to this source (at time 5:40 going forward), colocated points then violate the divergence free condition. I'm then confused as how to approach coding this problem up, or why the authors of the first source would want to approximate at co-located points.
 A: I am not exactly sure why you think the collocated points violate the divergence free condition. As far as I can guess, you might think that the electric fields (magnetic fields) are diverging from (converging to) a collocated point. You can connect cells in the neighborhood, however, that the electric fields (magnetic fields) are converging to (diverging from) the collocated point so that they cancel out to satisfy the divergenceless condition.
A: I am confused by the same problem: why Yee cell naturally leads to divergence free condition for $E$ and $B$. I think I got the answer (could be wrong). Assume at the begining of the simulation, $\nabla \cdot E = 0$ and $\nabla \cdot B = 0$ are satisfied. At each step, the $c \nabla \times B$ is added to the $E$. When you compute $\nabla \times B$, the $4$ value of $B$ on edges are used to update the $E$ at the center of the face. Each $B$ value on a edge is used twice for two faces and the contributions are opposite. Therefore, when you compute the divergence of the cell, the changes in the flux ($E ~ \cdot $ face area) is always zero. Thus, the divergence free is kept in this algorithm.
