Skip to content

Commit

Permalink
misc: Reduce duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
EdCaunt committed Apr 30, 2024
1 parent 9f66134 commit a8ab0a1
Showing 1 changed file with 15 additions and 22 deletions.
37 changes: 15 additions & 22 deletions devito/types/dense.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,34 +231,27 @@ def shape_domain(self):

@cached_property
def shape_with_halo(self):
"""
Shape of the domain+outhalo region. The outhalo is the region
surrounding the domain that may be read by an Operator.
Notes
-----
In an MPI context, this is the *local* with_halo region shape.
Further, note that the outhalo of inner ranks is typically empty, while
the outhalo of boundary ranks contains a number of elements depending
on the rank position in the decomposed grid (corner, side, ...).
"""
return tuple(j + i + k for i, (j, k) in zip(self.shape, self._size_outhalo))

@cached_property
def _shape_with_outhalo(self):
"""
Shape of the domain+outhalo region. The outhalo is the region
surrounding the domain that may be read by an Operator.
Notes
-----
In an MPI context, this is the *local* with_halo region shape.
Further, note that the outhalo of inner ranks is typically empty, while
the outhalo of boundary ranks contains a number of elements depending
on the rank position in the decomposed grid (corner, side, ...).
"""
return tuple(j + i + k for i, (j, k) in zip(self.shape, self._size_outhalo))

_shape_with_halo_docstring = """\
Shape of the domain+outhalo region. The outhalo is the region
surrounding the domain that may be read by an Operator.
Notes
-----
In an MPI context, this is the *local* with_halo region shape.
Further, note that the outhalo of inner ranks is typically empty, while
the outhalo of boundary ranks contains a number of elements depending
on the rank position in the decomposed grid (corner, side, ...).
"""

shape_with_halo.__doc__ = _shape_with_halo_docstring
_shape_with_outhalo.__doc__ = _shape_with_halo_docstring

@cached_property
def _shape_with_inhalo(self):
"""
Expand Down

0 comments on commit a8ab0a1

Please sign in to comment.