Skip to content

Commit 2054173

Browse files
committed
Remove in1d() to make bodies more efficient
1 parent a315c0e commit 2054173

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fipy/matrices/sparseMatrix.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,9 @@ def globalVectorAndIDs(self, vector, id1, id2, overlapping=False):
281281
@property
282282
def bodies(self):
283283
if self._bodies is None:
284-
self._bodies = numerix.in1d(self.mesh._globalOverlappingCellIDs,
285-
self.mesh._globalNonOverlappingCellIDs)
284+
self._bodies = numerix.zeros(self.mesh._localOverlappingCellIDs.shape,
285+
dtype=bool)
286+
self._bodies[self.mesh._localNonOverlappingCellIDs] = True
286287
return self._bodies
287288

288289
@property

0 commit comments

Comments
 (0)