fdtdx.SubpixelSmoothedProjection
Bases: SameShapeTypeParameterTransform
This function is adapted from the Meep repository: https://github.com/NanoComp/meep/blob/master/python/adjoint/filters.py
The details of this projection are described in the paper by Alec Hammond: https://arxiv.org/pdf/2503.20189
Project using subpixel smoothing, which allows for β→∞. This technique integrates out the discontinuity within the projection function, allowing the user to smoothly increase β from 0 to ∞ without losing the gradient. Effectively, a level set is created, and from this level set, first-order subpixel smoothing is applied to the interfaces (if any are present).
In order for this to work, the input array must already be smooth (e.g. by filtering).
While the original approach involves numerical quadrature, this approach performs a "trick" by assuming that the user is always infinitely projecting (β=∞). In this case, the expensive quadrature simplifies to an analytic fill-factor expression. When to use this fill factor requires some careful logic.
For one, we want to make sure that the user can indeed project at any level (not just infinity). So in these cases, we simply check if in interface is within the pixel. If not, we revert to the standard filter plus project technique.
If there is an interface, we want to make sure the derivative remains continuous both as the interface leaves the cell, and as it crosses the center. To ensure this, we need to account for the different possibilities.
Attributes: |
|
---|
Notes
The call method requires a beta parameter as a keyword argument passed to the parameter transformation