From b518f2409ef66ff15ef4d71e6a84f9fb79f135fa Mon Sep 17 00:00:00 2001 From: Thomas Gibson <gibsonthomas1120@hotmail.com> Date: Tue, 11 May 2021 21:45:05 -0500 Subject: [PATCH] Handle ndarrays in op.norm --- grudge/op.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/grudge/op.py b/grudge/op.py index 7f953014..56c6f171 100644 --- a/grudge/op.py +++ b/grudge/op.py @@ -797,6 +797,9 @@ def norm(dcoll, vec, p, dd=None): if dd is None: dd = "vol" + if isinstance(vec, np.ndarray): + return sum(norm(dcoll, vec_i, p, dd=dd) for vec_i in vec) + actx = vec.array_context dd = dof_desc.as_dofdesc(dd) vec = project(dcoll, "vol", dd, vec) -- GitLab