From 6ad6d5aa25c88a58557ec8597138fb14da4a70a8 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Wed, 8 Apr 2015 14:35:23 -0500
Subject: [PATCH] Fix up curve-potential example

---
 examples/curve-pot.py | 8 ++++----
 examples/curve.py     | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/examples/curve-pot.py b/examples/curve-pot.py
index 310a1131..dbd8f611 100644
--- a/examples/curve-pot.py
+++ b/examples/curve-pot.py
@@ -170,13 +170,14 @@ def draw_pot_figure(aspect_ratio,
     evt, (vol_pot,) = p2p(queue, fp.points, native_curve.pos,
             [native_curve.speed*native_weights*density], **volpot_kwargs)
 
-    evt, (curve_pot,) = lpot(queue, native_curve.pos, ovsmp_curve.pos, centers,
-            [ovsmp_density], ovsmp_curve.speed, ovsmp_weights,
+    evt, (curve_pot,) = lpot(queue, native_curve.pos, ovsmp_curve.pos,
+            centers,
+            [ovsmp_density * ovsmp_curve.speed * ovsmp_weights],
             **lpot_kwargs)
 
     # }}}
 
-    if 0:
+    if 1:
         # {{{ plot on-surface potential in 2D
 
         pt.plot(curve_pot, label="pot")
@@ -245,7 +246,6 @@ def draw_pot_figure(aspect_ratio,
 
 
 if __name__ == "__main__":
-    1/0  # FIXME update to new conventions
     draw_pot_figure(aspect_ratio=1, nsrc=100, novsmp=100, helmholtz_k=0,
             what_operator="D", what_operator_lpot="D", force_center_side=1)
     pt.savefig("eigvals-ext-nsrc100-novsmp100.pdf")
diff --git a/examples/curve.py b/examples/curve.py
index e894a56b..1a7be77f 100644
--- a/examples/curve.py
+++ b/examples/curve.py
@@ -9,7 +9,7 @@ import scipy.fftpack
 
 class CurveGrid:
     def __init__(self, x, y):
-        self.pos = np.vstack([x,y]).T.copy()
+        self.pos = np.vstack([x,y]).copy()
         xp = self.xp = sp.fftpack.diff(x, period=1)
         yp = self.yp = sp.fftpack.diff(y, period=1)
         xpp = self.xpp = sp.fftpack.diff(xp, period=1)
@@ -17,7 +17,7 @@ class CurveGrid:
         self.mean_curvature = (xp*ypp-yp*xpp)/((xp**2+yp**2)**(3/2))
 
         speed = self.speed = np.sqrt(xp**2+yp**2)
-        self.normal = (np.vstack([yp, -xp])/speed).T.copy()
+        self.normal = (np.vstack([yp, -xp])/speed).copy()
 
     def __len__(self):
         return len(self.pos)
-- 
GitLab