Don't perform dx_prop wavenumber correction in waveguide_mode_2d

It's technically a correction for discretization in the third direction
This commit is contained in:
Jan Petykiewicz 2019-08-26 00:17:52 -07:00
parent 0503e9d6ef
commit 054ac994d5

View File

@ -12,7 +12,6 @@ def solve_waveguide_mode_2d(mode_number: int,
dxes: dx_lists_t, dxes: dx_lists_t,
epsilon: vfield_t, epsilon: vfield_t,
mu: vfield_t = None, mu: vfield_t = None,
dx_prop: float = 0,
) -> Dict[str, complex or field_t]: ) -> Dict[str, complex or field_t]:
""" """
Given a 2d region, attempts to solve for the eigenmode with the specified mode number. Given a 2d region, attempts to solve for the eigenmode with the specified mode number.
@ -22,8 +21,6 @@ def solve_waveguide_mode_2d(mode_number: int,
:param dxes: Grid parameters [dx_e, dx_h] as described in meanas.types :param dxes: Grid parameters [dx_e, dx_h] as described in meanas.types
:param epsilon: Dielectric constant :param epsilon: Dielectric constant
:param mu: Magnetic permeability (default 1 everywhere) :param mu: Magnetic permeability (default 1 everywhere)
:param dx_prop: The cell width in the the propagation direction, used to apply a
correction to the wavenumber. Default 0 (i.e. continuous propagation direction)
:return: {'E': List[numpy.ndarray], 'H': List[numpy.ndarray], 'wavenumber': complex} :return: {'E': List[numpy.ndarray], 'H': List[numpy.ndarray], 'wavenumber': complex}
""" """
@ -49,12 +46,6 @@ def solve_waveguide_mode_2d(mode_number: int,
e, h = waveguide.normalized_fields(v, wavenumber, omega, dxes, epsilon, mu) e, h = waveguide.normalized_fields(v, wavenumber, omega, dxes, epsilon, mu)
'''
Perform correction on wavenumber to account for numerical dispersion.
'''
if dx_prop != 0:
wavenumber = 2 / dx_prop * numpy.sin(wavenumber * dx_prop / 2)
shape = [d.size for d in dxes[0]] shape = [d.size for d in dxes[0]]
fields = { fields = {
'wavenumber': wavenumber, 'wavenumber': wavenumber,
@ -110,7 +101,6 @@ def solve_waveguide_mode(mode_number: int,
'dxes': [[dx[i][slices[i]] for i in order[:2]] for dx in dxes], 'dxes': [[dx[i][slices[i]] for i in order[:2]] for dx in dxes],
'epsilon': vec([epsilon[i][slices].transpose(order) for i in order]), 'epsilon': vec([epsilon[i][slices].transpose(order) for i in order]),
'mu': vec([mu[i][slices].transpose(order) for i in order]), 'mu': vec([mu[i][slices].transpose(order) for i in order]),
'dx_prop': dx_prop,
} }
fields_2d = solve_waveguide_mode_2d(mode_number, omega=omega, **args_2d) fields_2d = solve_waveguide_mode_2d(mode_number, omega=omega, **args_2d)