Skip to content
Snippets Groups Projects
Commit 29aff964 authored by Joseph Weston's avatar Joseph Weston
Browse files

add short circuit to the interpolation loop when current is 0

parent f7d119ee
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -1931,6 +1931,10 @@ def interpolate_current(syst, current, relwidth=None, abswidth=None, n=9):
# Zero volume: nothing to do.
continue
if np.isclose(current[i], 0):
# Current is 0, skip costly interpolation
continue
field_slice = [slice(*slices[i, d]) for d in range(dim)]
# Coordinates of the grid points that are within range of the current
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment