Skip to content

Commit

Permalink
dsl: Remove subdomain intersection
Browse files Browse the repository at this point in the history
  • Loading branch information
EdCaunt committed Apr 8, 2024
1 parent 0029cb6 commit af06ba9
Showing 1 changed file with 4 additions and 26 deletions.
30 changes: 4 additions & 26 deletions devito/types/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,13 +575,13 @@ def __subdomain_finalize__(self, grid=None, **kwargs):
name = 'i%d%s' % (self._counter, k.name)
try:
# Case ('middle', int, int)
side, thickness_left, thickness_right = v
side, ltkn, rtkn = v
if side != 'middle':
raise ValueError("Expected side 'middle', not `%s`" % side)
sub_dimensions.append(SubDimension.middle(name, k,
thickness_left,
thickness_right))
thickness = s-thickness_left-thickness_right
ltkn,
rtkn))
thickness = s-ltkn-rtkn
sdshape.append(thickness)
except ValueError:
side, thickness = v
Expand Down Expand Up @@ -632,28 +632,6 @@ def define(self, dimensions):
"""
raise NotImplementedError

def intersection(self, other):
"""
Return the intersection of two subdomains as a new subdomain.
"""
return SubDomain.intersect(self, other)

@classmethod
def intersect(cls, sds):
"""
Build a new SubDomain from the intersection of an iterable of subdomains.
"""
# TODO: Finish this so it actually carries out intersection
sds = set(sds) # Purge duplicates
if len(sds) == 1: # Only one unique SubDomain. No op.
return sds.pop()

if any(d.grid is not sds[0].grid for d in sds): # Sanity check
raise ValueError("Only SubDomains defined on a common Grid can be"
" intersected")

raise NotImplementedError

def _arg_values(self, **kwargs):
# TODO: This should probably be a check for "if self.grid:"
try:
Expand Down

0 comments on commit af06ba9

Please sign in to comment.