Table of Contents

FDTD (1D FDTD)

FDTD (finite-difference time-domain) replaces the derivatives in Maxwell's equations with differences between nearby field samples. In FDTD OpenMP, the magnetic update reads the electric field on either side of its staggered position:

for (size_t k = 0; k < width - 1; k++) {
    Hy[k] = Ch1[k] * Hy[k] 
          + Ch2[k] * (Ez[k + 1] - Ez[k]);
}

Hy[k] is the magnetic sample between Ez[k] and Ez[k + 1]. Their difference approximates the spatial derivative, and the precomputed coefficients include material properties and the grid steps.

The next loop updates $E_z$ from differences in the new $H_y$. Repeating these two local phases propagates waves across the grid. The Yee grid determines the sample positions; the CFL condition limits a stable time step.

Source: fdtd_ez_kernels.c.