Skip to content

Commit

Permalink
Merge pull request #32 from bendudson/fieldtrace-logical-or
Browse files Browse the repository at this point in the history
Use np.logical_or for element-wise or in fieldtrace
  • Loading branch information
bendudson committed Jul 16, 2020
2 parents 1c2dcd3 + 1011a8f commit caeb136
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions freegs/fieldtracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ def eqDomain(self, R, Z, evolving):

eps = 1e-2

evolving[(R < self._eq.Rmin + eps) or
(R > self._eq.Rmax - eps) or
(Z < self._eq.Zmin + eps) or
(Z > self._eq.Zmax - eps)] = 0.0
evolving[np.logical_or(np.logical_or((R < self._eq.Rmin + eps),
(R > self._eq.Rmax - eps)),
np.logical_or((Z < self._eq.Zmin + eps),
(Z > self._eq.Zmax - eps)))] = 0.0
return evolving

def wallDomain(self, R, Z, evolving):
Expand Down

0 comments on commit caeb136

Please sign in to comment.