From 531283dc5ef83815774731abbe87336a2c038250 Mon Sep 17 00:00:00 2001
From: Thomas Gibson <gibsonthomas1120@hotmail.com>
Date: Thu, 13 May 2021 14:16:54 -0500
Subject: [PATCH] Fix inside/outside products with metric terms in derivative
 operators

---
 grudge/op.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/grudge/op.py b/grudge/op.py
index ceaa919d..84b0392f 100644
--- a/grudge/op.py
+++ b/grudge/op.py
@@ -185,7 +185,7 @@ def _compute_local_gradient(dcoll, vec, xyz_axis):
     return DOFArray(
         actx,
         data=tuple(
-            actx.einsum("dej,dij,ej->ei",
+            actx.einsum("dei,dij,ej->ei",
                         inv_jac_t_i,
                         reference_derivative_matrices(actx, grp),
                         vec_i,
@@ -330,8 +330,7 @@ def _apply_stiffness_transpose_operator(dcoll, dd_out, dd_in, vec, xyz_axis):
     return DOFArray(
         actx,
         data=tuple(
-            actx.einsum("dej,dij,ej,ej->ei",
-                        inv_jac_t_i,
+            actx.einsum("dij,ej,ej,dej->ei",
                         reference_stiffness_transpose_matrix(
                             actx,
                             out_element_group=out_grp,
@@ -339,7 +338,8 @@ def _apply_stiffness_transpose_operator(dcoll, dd_out, dd_in, vec, xyz_axis):
                         ),
                         ae_i,
                         vec_i,
-                        arg_names=("inv_jac_t", "ref_stiffT_mat", "jac", "vec"),
+                        inv_jac_t_i,
+                        arg_names=("ref_stiffT_mat", "jac", "vec", "inv_jac_t"),
                         tagged=(HasElementwiseMatvecTag(),))
 
             for out_grp, in_grp, vec_i, ae_i, inv_jac_t_i in zip(out_discr.groups,
-- 
GitLab