Commit 26e5981
feat(adjoint): Adaptively sample fields along slab height and polygon edges
- Implement adaptive field sampling for PolySlab and Cylinder for shape
derivatives
- Replace fixed grid with Gauss-Legendre quadrature
- Sample fields along all surface boundaries (edges and faces)
- Handle edge cases: slabs outside simulation, faces at ±inf, 2D simulations
- Add analytical tests for gradient computation
- Remove `DerivativeSurfaceMesh` abstraction in favor of direct evaluation
- Convert `DerivativeInfo` from Pydantic model to dataclass for efficiency
- Implement interpolator sharing at `GeometryGroup` level
- Add Gauss-Legendre quadrature caching
- Optimize memory allocation with pre-allocated arrays
- Ensure dtype consistency throughout gradient pipeline1 parent 73dec98 commit 26e5981
File tree
10 files changed
+1898
-534
lines changed- tests/test_components
- tidy3d/components
- autograd
- geometry
10 files changed
+1898
-534
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
812 | 812 | | |
813 | 813 | | |
814 | 814 | | |
815 | | - | |
| 815 | + | |
816 | 816 | | |
817 | 817 | | |
818 | 818 | | |
| |||
912 | 912 | | |
913 | 913 | | |
914 | 914 | | |
915 | | - | |
| 915 | + | |
916 | 916 | | |
917 | 917 | | |
918 | 918 | | |
| |||
934 | 934 | | |
935 | 935 | | |
936 | 936 | | |
937 | | - | |
| 937 | + | |
938 | 938 | | |
939 | 939 | | |
940 | 940 | | |
| |||
1927 | 1927 | | |
1928 | 1928 | | |
1929 | 1929 | | |
1930 | | - | |
1931 | | - | |
1932 | | - | |
1933 | | - | |
1934 | | - | |
1935 | 1930 | | |
1936 | 1931 | | |
1937 | 1932 | | |
| |||
0 commit comments