change normalization of eigenmode sources to yield unit input power#507
change normalization of eigenmode sources to yield unit input power#507HomerReid wants to merge 1 commit intoNanoComp:masterfrom
Conversation
|
I think the mode normalization should not depend upon the time profile. You need to know the whole time-profile Fourier transform anyway to use this, so you might as well include the time-profile normalization there too. In particular, the source current looks like mode(x)*p(t), where p(t) is the time profile. My suggestion is:
|
Fixes #470. Renormalize the amplitude of eigenmode sources to yield unit power flux.
The power flux depends on the frequency width of the source. I added a
widthparameter tofields::get_eigenmodewith a default value of 0. (Ifwidth==0the amplitude renormalization is skipped.) This requires updating calling conventions in a couple of other places:(1) Within
add_eigenmode_source,the frequency width can in principle be fetched from the existingsrcinput parameter, so the calling convention doesn't need to change. However, the frequency width is a private data field ingaussian_src_timeandcontinuous_src_time,and there were no getter functions. I added a virtual getter routineget_width()to the parentsrc_timeclass, which returns 0 by default and is overridden bygaussian_src_timeandcontinuous_src_time.(2) I updated the
_get_eigenmodepython routine to accept a new optionalwidth=0.0argument. (Again, passingwidth=0.0toget_eigenmodeyields behavior unchanged from before this PR.) If a user callsget_eigenmodedirectly from python and wants the amplitude renormalizationthe user must specify a nonzero value forwidth`.(3) No modification is needed for
get_eigenmode_coefficients.The overall normalization of the eigenmodes cancels out of this calculation anyway, so it suffices to passwidth=0.0yielding behavior equivalent to before.