Skip to content

Commit 407b160

Browse files
committed
compiler: Adjust dimension search in interpolation/injection
1 parent 5b48591 commit 407b160

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

devito/operations/interpolators.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,13 @@ def _rdim(self, subdomain=None):
248248

249249
def _augment_implicit_dims(self, implicit_dims, extras=None):
250250
if extras is not None:
251-
# If variables are defined on a SubDomain of the Grid, then temprarily add
252-
# their dimensions to self._gdims for the purpose of checking if extra
253-
# dimensions have been included.
251+
# If variables are defined on a SubDomain of the Grid, then omit the
252+
# dimensions of that SubDomain from any extra dimensions found
254253
edims = []
255254
for v in extras:
256255
try:
257-
egrid = v.grid
258-
if egrid is not None and egrid.is_SubDomain:
259-
edims = [d for d in egrid.dims if d.root in self._gdims]
256+
if v.grid.is_SubDomain:
257+
edims.extend([d for d in v.grid.dims if d.root in self._gdims])
260258
except AttributeError:
261259
pass
262260

0 commit comments

Comments
 (0)