Site Tools


fdtd-cuda-snapshots

Table of Contents

Snapshots (2D FDTD)

A snapshot captures the field arrays at a chosen simulation step. The simulation API can schedule captures and retain them for later inspection:

fdtd::TMz::Simulation sim(256, 256);
sim.add_snapshot(100);
sim.add_snapshot(200);
sim.run(200);
 
const auto &captures = sim.snapshots();

This minimal example illustrates scheduling; a source or initial field is needed to produce a nonzero wave. snapshot() instead captures the current state immediately. A handler passed to run() can consume scheduled fields without retaining every snapshot.

The driver offers the same idea through --snapshot-every N, writing $E_z$ to binary snapshot files. Captured electric and magnetic fields retain their half-step time offset. Frequent snapshots add transfer and storage costs; CUDA's asynchronous path can overlap copies with later work.

fdtd-cuda-snapshots.md · Last modified: by 127.0.0.1