From fd1a83b5b9c792279f262109fe13ee71b129c51d Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Mon, 22 May 2023 09:53:30 -0700 Subject: [PATCH] cleaner way to ravel --- meanas/fdfd/bloch.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/meanas/fdfd/bloch.py b/meanas/fdfd/bloch.py index 5d62145..8b99930 100644 --- a/meanas/fdfd/bloch.py +++ b/meanas/fdfd/bloch.py @@ -257,7 +257,9 @@ def maxwell_operator( # transform back to mn h_m = numpy.sum(h_xyz * m, axis=3) h_n = numpy.sum(h_xyz * n, axis=3) - return numpy.hstack((h_m.ravel(), h_n.ravel())) + + h = numpy.concatenate((h_m, h_n), axis=None, out=h) # ravel and merge + return h return operator @@ -412,7 +414,8 @@ def inverse_maxwell_operator_approx( h_m = numpy.sum(d_xyz * n, axis=3, keepdims=True) / +k_mag h_n = numpy.sum(d_xyz * m, axis=3, keepdims=True) / -k_mag - return numpy.hstack((h_m.ravel(), h_n.ravel())) + h = numpy.concatenate((h_m, h_n), axis=None, out=h) + return h return operator