You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems #1855 introduced a bug in the adjoint solver for the case of a 3D design region. (I discovered this while working on a unit test for #2054.) This can be demonstrated using the following test which involves a 3D unit cell of a cylindrical grating on a substrate with 2D periodicity. The MaterialGrid is actually 2D but the DesignRegion is 3D with extrusion in the z direction. The test involves an objective function based on the mode coefficient of a transmitted mode.
With the current master branch (commit: 6c975ac), this test crashes with a segmentation fault that is traced using gdb to the following lines introduced in #1855:
Calculating gradient...
*** Process received signal ***
Signal: Segmentation fault (11)
Signal code: (128)
Failing at address: (nil)
*** Process received signal ***
Signal: Segmentation fault (11)
Signal code: Address not mapped (1)
Failing at address: 0x101
A 2d example showing the segmentation fault was posted in #1855.
In addtion, in a test for the FourierFields adjoint solver that was also posted there, both finite-difference and adjoint gradients change obviously once this PR is used. These finite-difference and adjoint gradients become inconsistent after this change.
It seems #1855 introduced a bug in the adjoint solver for the case of a 3D design region. (I discovered this while working on a unit test for #2054.) This can be demonstrated using the following test which involves a 3D unit cell of a cylindrical grating on a substrate with 2D periodicity. The
MaterialGrid
is actually 2D but theDesignRegion
is 3D with extrusion in the z direction. The test involves an objective function based on the mode coefficient of a transmitted mode.With the current master branch (commit: 6c975ac), this test crashes with a segmentation fault that is traced using gdb to the following lines introduced in #1855:
meep/src/meepgeom.cpp
Lines 3023 to 3028 in 6c975ac
With the commit just prior to #1855 (75ced52), the test runs fine and the gradient is evaluated without any errors:
The text was updated successfully, but these errors were encountered: