From 8f8c130c2fee766186c99c414409b2957a16c0f6 Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Mon, 14 Nov 2022 12:39:41 -0800 Subject: [PATCH] use previous result as next guess --- meanas/fdfd/bloch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meanas/fdfd/bloch.py b/meanas/fdfd/bloch.py index 08a9654..994298c 100644 --- a/meanas/fdfd/bloch.py +++ b/meanas/fdfd/bloch.py @@ -452,7 +452,7 @@ def find_k( def get_f(k0_mag: float, band: int = 0) -> float: nonlocal n, v k0 = direction * k0_mag # type: ignore - n, v = eigsolve(band + 1, k0, G_matrix=G_matrix, epsilon=epsilon, mu=mu, callback=iter_callback) + n, v = eigsolve(band + 1, k0, G_matrix=G_matrix, epsilon=epsilon, mu=mu, y0=v, callback=iter_callback) f = numpy.sqrt(numpy.abs(numpy.real(n[band]))) if solve_callback: solve_callback(k0_mag, n, v, f)