There is an inconsistency in the interface for the related functions get_eigenmode_coefficients and the constructor for the EigenModeSource class object involving the argument eig_vol.
get_eigenmode_coefficients contains an argument eig_vol of type meep.Volume:
eig_vol and (eig_lattice_center, eig_lattice_size) are doing the same thing. It would be good to remove this inconsistency in the interface which currently prevents using eig_vol to define an meep.adjoint.EigenmodeCoefficient objective function because it is not possible to create an adjoint source. The problem is that the keyword arguments passed to EigenmodeCoefficient are passed directly to EigenModeSource in the function place_adjoint_source:
There is an inconsistency in the interface for the related functions
get_eigenmode_coefficients
and the constructor for theEigenModeSource
class object involving the argumenteig_vol
.get_eigenmode_coefficients
contains an argumenteig_vol
of typemeep.Volume
:https://github.com/NanoComp/meep/blob/0dc44daf9fd4bfea17c209bcd25f110c08341080/python/simulation.py#L4133-L4143
The constructor for the
EigenModeSource
class object does not have aneig_vol
argument and instead useseig_lattice_size
andeig_lattice_center
:https://github.com/NanoComp/meep/blob/0dc44daf9fd4bfea17c209bcd25f110c08341080/python/source.py#L459-L475
These two arguments are used to create an
eig_vol
object in a separate functionadd_source
:https://github.com/NanoComp/meep/blob/0dc44daf9fd4bfea17c209bcd25f110c08341080/python/source.py#L646-L651
eig_vol
and (eig_lattice_center
,eig_lattice_size
) are doing the same thing. It would be good to remove this inconsistency in the interface which currently prevents usingeig_vol
to define anmeep.adjoint.EigenmodeCoefficient
objective function because it is not possible to create an adjoint source. The problem is that the keyword arguments passed toEigenmodeCoefficient
are passed directly toEigenModeSource
in the functionplace_adjoint_source
:https://github.com/NanoComp/meep/blob/0dc44daf9fd4bfea17c209bcd25f110c08341080/python/adjoint/objective.py#L262-L272