From 642e9cb449f4003a1cea6776930d1653da66bf9c Mon Sep 17 00:00:00 2001 From: Matthew Smith <mjsmith6@illinois.edu> Date: Thu, 17 Dec 2020 18:31:56 -0600 Subject: [PATCH] allow calls to project() with the same source and target --- grudge/eager.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/grudge/eager.py b/grudge/eager.py index 3bacbc2b..92378f99 100644 --- a/grudge/eager.py +++ b/grudge/eager.py @@ -83,6 +83,9 @@ class EagerDGDiscretization(DGDiscretizationWithBoundaries): :arg tgt: a :class:`~grudge.sym.DOFDesc`, or a value convertible to one :arg vec: a :class:`~meshmode.dof_array.DOFArray` """ + if src == tgt: + return vec + if isinstance(vec, np.ndarray): return obj_array_vectorize( lambda el: self.project(src, tgt, el), vec) -- GitLab