diff --git a/pystencils/field.py b/pystencils/field.py index 128ba9df135958a37fbe20179318d646c9b7d89f..2c25dce4462feefd37dd26b930f1191978a75777 100644 --- a/pystencils/field.py +++ b/pystencils/field.py @@ -646,6 +646,12 @@ class Field(AbstractField): """ return Field.Access(self.field, self.offsets, idx_tuple, dtype=self.dtype) + def _eval_subs(self, old, new): + return Field.Access(self.field, + tuple(sp.sympify(a).subs(old, new) for a in self.offsets), + tuple(sp.sympify(a).subs(old, new) for a in self.index), + dtype=self.dtype) + @property def is_absolute_access(self) -> bool: """Indicates if a field access is relative to the loop counters (this is the default) or absolute"""