From 1ab3b063c5a5b32249b1a1f6327f0b72d822650f Mon Sep 17 00:00:00 2001 From: Marco Passoni Date: Wed, 9 Oct 2024 14:37:36 +0200 Subject: [PATCH 1/2] Moved conv_fun in Mode.plot_component after xy component splitting. --- femwell/maxwell/waveguide.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/femwell/maxwell/waveguide.py b/femwell/maxwell/waveguide.py index 3403f6be..d35a1b95 100644 --- a/femwell/maxwell/waveguide.py +++ b/femwell/maxwell/waveguide.py @@ -329,8 +329,9 @@ def plot_component( if component == "x" or component == "y": plot_basis = mfield_t_basis.with_element(ElementVector(ElementDG(ElementTriP1()))) - mfield_xy = plot_basis.project(mfield_t_basis.interpolate(conv_func(mfield_t))) + mfield_xy = plot_basis.project(mfield_t_basis.interpolate(mfield_t)) (mfield_x, mfield_x_basis), (mfield_y, mfield_y_basis) = plot_basis.split(mfield_xy) + mfield_x, mfield_y = conv_func(mfield_x), conv_func(mfield_y) if component == "x": mfield_x_basis.plot(mfield_x, ax=ax, shading="gouraud") else: From f52ff33cd8aabb8a19444fd0064e052569f7a95a Mon Sep 17 00:00:00 2001 From: Marco Passoni Date: Thu, 10 Oct 2024 13:16:32 +0200 Subject: [PATCH 2/2] Moved conv_func in Mode.plot_component between interpolation and projection for xy components. --- femwell/maxwell/waveguide.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/femwell/maxwell/waveguide.py b/femwell/maxwell/waveguide.py index d35a1b95..4ffaebc5 100644 --- a/femwell/maxwell/waveguide.py +++ b/femwell/maxwell/waveguide.py @@ -329,9 +329,8 @@ def plot_component( if component == "x" or component == "y": plot_basis = mfield_t_basis.with_element(ElementVector(ElementDG(ElementTriP1()))) - mfield_xy = plot_basis.project(mfield_t_basis.interpolate(mfield_t)) + mfield_xy = plot_basis.project(conv_func(mfield_t_basis.interpolate(mfield_t))) (mfield_x, mfield_x_basis), (mfield_y, mfield_y_basis) = plot_basis.split(mfield_xy) - mfield_x, mfield_y = conv_func(mfield_x), conv_func(mfield_y) if component == "x": mfield_x_basis.plot(mfield_x, ax=ax, shading="gouraud") else: