FDTD and FDFD
The two full-wave solvers in Maxwell, how each one works, what each supports, and how to choose between them.
Maxwell has two full-wave solvers that share the same Scene and return the same Result. FDTD is the primary runtime and supports every feature in the package. FDFD is a limited, experimental single-frequency solver. This page explains the difference so you can pick one.
FDTD: time stepping#
The finite-difference time-domain method updates E and H in turn on the Yee grid, one time step after another. A source signal drives the grid, and monitors accumulate a DFT of the fields at the frequencies you request.
- One pulsed run gives the response at many frequencies.
- Memory scales with the number of cells; work scales with cells times time steps.
- Nonlinear, time-modulated and switching behaviour is natural, because the fields evolve in time.
- The run length depends on how long the fields take to decay. High-Q resonators need many steps.
Simulation.fdtd(scene, frequencies=[...]) runs it. The kernels are native CUDA, optionally captured into a CUDA graph (cuda_graph=True, the default), and the adjoint gradient is native CUDA too.
FDFD: one sparse solve per frequency#
The finite-difference frequency-domain method writes Maxwell's equations at one angular frequency as a sparse linear system and solves it directly for the steady-state field.
- One solve per frequency, with no time stepping and no run-length question.
- It suits single-frequency, strongly resonant problems where FDTD would need a very long run.
- Cost depends on the linear solver: iterative solvers need a good preconditioner, and direct solvers need a lot of memory.
Simulation.fdfd(scene, frequency=..., solver=GMRES(...)) runs it. The GMRES settings object chooses the method (solver_type is one of "cg", "gmres", "direct", "bicgstab", "tfqmr", "idr", "sqmr"; default "gmres"), the preconditioner (default "jacobi"), tolerance, restart length and working precision. solver_type="direct" uses NVIDIA cuDSS and needs the direct install extra.
Warning
FDFD is limited and experimental. It runs on CUDA only and supports linear isotropic or diagonal-electric media (including dispersive and conductive ones), none and PML boundaries, uniform grids, and basic adjoint gradients. Nonuniform grids, magnetic, nonlinear and full-tensor media, in-domain PEC, symmetry, RF port excitation, and most of the FDTD source, monitor and adjoint coverage are not implemented. Unsupported combinations raise an error.
Which one to use#
| Situation | Use |
|---|---|
| Broadband response, S-parameters over a band, transient behaviour | FDTD |
| Nonuniform grids, PEC objects inside the domain, symmetry | FDTD |
| Anisotropic, magnetic, nonlinear, modulated or 2D materials | FDTD |
| Ports, circuits, thin wires, SAR, far field, batch and multi-GPU runs | FDTD |
| One frequency, linear isotropic media, a resonance that rings for a long time | FDFD is worth trying |
When in doubt, use FDTD. You can cross-check an FDFD answer by running the same scene through FDTD with a CW or narrow pulse source.
Other solvers#
Simulation.electrostatic(...) solves the Laplace or Poisson equation for static potentials and fields, and Simulation.capacitance(...) extracts the capacitance matrix between conductors. They use their own boundary settings and return a Result with method="electrostatic" or "capacitance". See the Electrostatics API.