specify default no smoothing for MaterialGrid
constructor
#1903
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#1780 added support for subpixel smoothing of the adjoint gradient and also set smoothing as the default for the
MaterialGrid
. (#1886 fixed a bug to permit no smoothing viado_averaging=False
of theMaterialGrid
.) Since subpixel smoothing of the adjoint gradients is currently an experimental feature which can, under certain circumstances, significantly slow down the runtime performance of theget_gradient
function of the adjoint-solver module (compared to no smoothing), it is probably better to use a default of no smoothing for theMaterialGrid
. The default setting can be changed once this feature is more mature and the performance is better tested (via e.g. #1855).(Since forward simulations that do not involve computing the adjoint gradient do benefit from the improved accuracy of subpixel smoothing of the
MaterialGrid
without a noticeable degradation in runtime performance, it could be useful to have a separate flag for subpixel smoothing in the adjoint solver. This way, thedo_averaging
property of theMaterialGrid
can still beTrue
by default and overwritten toFalse
by the adjoint solver.)