# 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: ```c 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 [[fdtd-openmp-yee-grid|Yee grid]] determines the sample positions; the [[fdtd-openmp-cfl-stability-condition|CFL condition]] limits a stable time step. Source: [fdtd_ez_kernels.c](https://github.com/yanevskiv/fdtd-openmp/blob/main/src/fdtd/Ez/fdtd_ez_kernels.c).