fdtd-openmp-memory-layout
Table of Contents
Memory layout (1D FDTD)
Memory layout determines which simulation values are stored together. The field constructor allocates $E_z$ and $H_y$ independently:
fields->ff_width = width; fields->ff_hy = Fdtd_AllocArray(width, sizeof(Fdtd_FloatType)); fields->ff_ez = Fdtd_AllocArray(width, sizeof(Fdtd_FloatType));
Each array contains one quantity across the grid. Material properties and update coefficients follow the same structure of arrays pattern. Fdtd_FloatType is currently double, and the allocation helper provides 64-byte alignment.
The kernels traverse fields and prepared coefficients directly. Material arrays are consulted when coefficients are calculated, rather than re-evaluated inside every step. This makes the update's memory traffic easier to identify and keeps unrelated material data out of its inner loops.
Source: fdtd_ez_fields.c.
fdtd-openmp-memory-layout.md · Last modified: by 127.0.0.1
