Skip to content

Commit afa51b2

Browse files
committed
dsl: Add kwarg to disable postprocess substitutions
1 parent f3ba2e9 commit afa51b2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

devito/finite_differences/derivative.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,11 @@ def _subs(self, old, new, **hints):
288288
# e.g `f.dx.subs(f: 1) = 1.dx = 0`
289289
# returning zero
290290
return sympy.S.Zero
291+
elif not hints.pop('postprocess', True):
292+
# This allows a redundant substitution to be applied to an entire
293+
# expression without un-consumed substitutions being added to the
294+
# postprocessing substitution dict `self._ppsubs`.
295+
return self
291296

292297
# In case `x0` was passed as a substitution instead of `(x0=`
293298
if str(old) == 'x0':

0 commit comments

Comments
 (0)