From 9cc11ed2ef456b51575f09148b34bf36b7fc2ca0 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Wed, 26 Aug 2020 12:39:27 -0500
Subject: [PATCH] Follow-up fixes for 687a28b in eager examples

---
 examples/wave/wave-eager-mpi.py          | 4 ++--
 examples/wave/wave-eager-var-velocity.py | 5 ++---
 examples/wave/wave-eager.py              | 5 ++---
 3 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/examples/wave/wave-eager-mpi.py b/examples/wave/wave-eager-mpi.py
index a2c9b14b..fc09cbd5 100644
--- a/examples/wave/wave-eager-mpi.py
+++ b/examples/wave/wave-eager-mpi.py
@@ -59,9 +59,9 @@ def wave_flux(discr, c, w_tpair):
             )
 
     # upwind
-    v_jump = np.dot(normal, v.int-v.ext)
+    v_jump = np.dot(normal, v.ext-v.int)
     flux_weak += flat_obj_array(
-            0.5*(u.int-u.ext),
+            0.5*(u.ext-u.int),
             0.5*normal*scalar(v_jump),
             )
 
diff --git a/examples/wave/wave-eager-var-velocity.py b/examples/wave/wave-eager-var-velocity.py
index 741d38ec..5164562c 100644
--- a/examples/wave/wave-eager-var-velocity.py
+++ b/examples/wave/wave-eager-var-velocity.py
@@ -60,10 +60,9 @@ def wave_flux(discr, c, w_tpair):
             )
 
     # upwind
-    v_jump = np.dot(normal, v.int-v.ext)
     flux_weak += flat_obj_array(
-            0.5*(u.int-u.ext),
-            0.5*normal*scalar(v_jump),
+            0.5*(u.ext-u.int),
+            0.5*normal*scalar(np.dot(normal, v.ext-v.int)),
             )
 
     # FIXME this flux is only correct for continuous c
diff --git a/examples/wave/wave-eager.py b/examples/wave/wave-eager.py
index a7b11fbe..21c6d73a 100644
--- a/examples/wave/wave-eager.py
+++ b/examples/wave/wave-eager.py
@@ -57,10 +57,9 @@ def wave_flux(discr, c, w_tpair):
             )
 
     # upwind
-    v_jump = np.dot(normal, v.int-v.ext)
     flux_weak += flat_obj_array(
-            0.5*(u.int-u.ext),
-            0.5*normal*scalar(v_jump),
+            0.5*(u.ext-u.int),
+            0.5*normal*scalar(np.dot(normal, v.ext-v.int)),
             )
 
     return discr.project(w_tpair.dd, "all_faces", c*flux_weak)
-- 
GitLab