diff --git a/devito/finite_differences/differentiable.py b/devito/finite_differences/differentiable.py index 23152053b8..a10c3932d8 100644 --- a/devito/finite_differences/differentiable.py +++ b/devito/finite_differences/differentiable.py @@ -109,7 +109,8 @@ def _fd(self): fd_args = [] for f in self._args_diff: try: - if f.space_order <= self.space_order and f.time_order <= self.time_order: + if f.space_order <= self.space_order and \ + (not f.is_TimeDependent or f.time_order <= self.time_order): fd_args.append(f) except AttributeError: pass diff --git a/devito/ir/clusters/cluster.py b/devito/ir/clusters/cluster.py index 887793e8e7..69ee00c6c5 100644 --- a/devito/ir/clusters/cluster.py +++ b/devito/ir/clusters/cluster.py @@ -483,7 +483,7 @@ def dtype(self): If two Clusters perform calculations with different precision, the data type with highest precision is returned. """ - dtypes = {i.dtype for i in self} + dtypes = {i.dtype for i in self} - {None} return infer_dtype(dtypes) diff --git a/tests/test_lower_exprs.py b/tests/test_lower_exprs.py index 4903dbf9a3..0d0b56ca82 100644 --- a/tests/test_lower_exprs.py +++ b/tests/test_lower_exprs.py @@ -65,9 +65,10 @@ def test_symbolic_constant_times_add(self): dt = grid.time_dim.spacing u = TimeFunction(name="u", grid=grid, space_order=4, time_order=2) - f = Function(name='f', grid=grid) + f = Function(name='f', grid=grid, space_order=4) eq = Eq(u.forward, u.laplace + dt**0.2*u.biharmonic(1/f)) + leq = collect_derivatives.func([eq])[0] assert len(eq.rhs.args) == 3