Skip to content

Commit

Permalink
Flip sign of amp based on group velocity direction
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwilliamson committed Sep 28, 2021
1 parent 27ec197 commit a5627e0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/mpb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,7 @@ void fields::add_eigenmode_source(component c0, const src_time &src, direction d
// magnetic current N = -nHat \times E */
/*--------------------------------------------------------------*/
if (global_eigenmode_data->group_velocity < 0)
master_printf("vg is negative!\n");
amp *= -1; // equivalent to flipping the direction of nhat.
if (is_D(c0)) c0 = direction_component(Ex, component_direction(c0));
if (is_B(c0)) c0 = direction_component(Hx, component_direction(c0));
Expand Down

0 comments on commit a5627e0

Please sign in to comment.