From 07f6c8302a5123325e743e6394b7b89207652946 Mon Sep 17 00:00:00 2001
From: Pauli Virtanen <pauli.t.virtanen@jyu.fi>
Date: Tue, 30 Aug 2022 14:35:10 +0300
Subject: [PATCH] tests: match parameters better

---
 tests/test_solver.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tests/test_solver.py b/tests/test_solver.py
index 972b62d..471e223 100644
--- a/tests/test_solver.py
+++ b/tests/test_solver.py
@@ -203,7 +203,11 @@ def test_selfcons_kupriyanov(request, T):
     Delta0 = BCS_Delta(T, Tc0)
     Delta00 = BCS_Delta(0.05, Tc0)
 
-    sol = example_sns_1d(0, L, nx=40, ny=1, Delta0=Delta0)
+    # L is the distance between terminals, but Lx the system size where
+    # the two outermost layers are terminals
+    nx = 40
+    Lp = (L / (nx - 2)) * nx
+    sol = example_sns_1d(0, L, nx=nx, ny=1, Delta0=Delta0)
     sol.Ly = 1
     phase_mask = (sol.mask == MASK_TERMINAL) & (sol.x[:, None] > 0)
 
@@ -236,8 +240,8 @@ def test_selfcons_kupriyanov(request, T):
 
     Imax = abs(Is_u).max()
 
-    assert curve_separation(phis, Is, phis_u, Is_u) < 0.05 * Imax
-    assert curve_separation(phis, Is, phis_k, Is_k) < 0.11 * Imax
+    assert curve_separation(phis, Is, phis_u, Is_u) < 0.025 * Imax
+    assert curve_separation(phis, Is, phis_k, Is_k) < 0.075 * Imax
 
 
 def curve_separation(x1, y1, x2, y2):
-- 
GitLab