Skip to content

Launching planewave sources with negative propagation wavevector using DiffractedPlanewave #2641

@oskooi

Description

@oskooi

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.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions