Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launching planewave sources with negative propagation wavevector using DiffractedPlanewave #2641

Open
oskooi opened this issue Sep 15, 2023 · 0 comments

Comments

@oskooi
Copy link
Collaborator

oskooi commented Sep 15, 2023

Based on the current setup of the DiffractedPlanewave and EigenModeSource objects, it is not possible to launch planewave sources (by passing a DiffractedPlanewave object as the eig_band property of an EigenModeSource) with a negative propagation constant $\beta$ (the wavevector component in the direction perpendicular to the source plane).

$\beta$ is always chosen to be positive on line 660 of fields::get_eigenmode:

meep/src/mpb.cpp

Lines 649 to 661 in b065eae

if (match_frequency) {
vec cen = eig_vol.center();
double nn = sqrt(real(get_eps(cen, frequency)) * real(get_mu(cen, frequency)));
double k2 = frequency * frequency * nn * nn - k2sum;
if (k2 < 0) {
master_printf("WARNING: diffraction order for g=(%d,%d,%d) is "
"evanescent!\n",
dp->get_g()[0], dp->get_g()[1], dp->get_g()[2]);
return NULL;
}
else if (k2 > 0)
k[dd - X] = sqrt(k2);
}

This missing property of DiffractedPlanewave sources is necessary for the adjoint solver (#2054).

(Note: for mode decomposition, obtaining the mode coefficient for the $-\beta$ mode is simply a matter of choosing the second of two elements of the third dimension of the alpha array returned by get_eigenmode_coefficient.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant