Avoid interpolating from guard cells in BTD #5342
Merged
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.
BTD diagnostics sometimes show artifacts at the edge of the range of collected data. (See for instance the red curve below.)
My understanding is that this happens because the BTD collection planes use data from the guard cells outside of the simulation domain, when interpolating fields that are then used for the Lorentz back-transform. The guard cell data may not be physically correct (e.g. it may not have the right cancellation between
E
andB
), and could thus cause this artifact.This PR avoids this issue by prevents the collection planes to collect data when it is half a cell from the edge of the simulation domain.
See the example below, taken from #5337 (plot of the laser field, from the BTD diagnostic)
The BTD diagnostics values are identical with this PR, except for the problematic point appearing at the edge of the domain.