Skip to content
Snippets Groups Projects
Commit 2370a108 authored by patavirt's avatar patavirt
Browse files

tests: test Omega derivative

parent 54dbee1c
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ import usadelndsoc.solver
usadelndsoc.logger.setLevel(logging.DEBUG)
def basic_setup(terminals=False, nx=25, ny=5):
def basic_setup(terminals=False, nx=15, ny=5):
Delta = np.zeros((4, 4))
Delta[:2, 2:] = np.eye(2)
Delta[2:, :2] = np.eye(2)
......@@ -38,3 +38,20 @@ def test_solve_dos():
g = res.G[:, 10, 2, 0, 0]
g_an = -1j * E / np.sqrt(1 - E**2)
assert_allclose(g, g_an, rtol=1e-4)
def test_result_S():
s = basic_setup()
s.Omega[:, :, 0, 3] = 0.5j
s.Omega[:, :, 3, 0] = 0.5j
res = s.solve_many(omega=0.5 + 0.8j)
S = res.S
vol = s.Lx * s.Ly / (s.shape[0] * s.shape[1])
St = S.transpose(0, 1, 3, 2)
assert_allclose(St[:, :, :2, :2], vol * res.G)
assert_allclose(St[:, :, :2, 2:], vol * res.F)
assert_allclose(St[:, :, 2:, :2], vol * res.Fc)
assert_allclose(St[:, :, 2:, 2:], vol * res.Gc)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment