Skip to content

Commit b699a5e

Browse files
committed
BUG: change sign of b-field in north
1 parent fa4c0bb commit b699a5e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/fill_grid.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,13 @@ void Grid::fill_grid_bfield(Planets planet) {
193193
// Now we modify the dipole's magnetic field to account for any imprecision.
194194
// Take the bfield_mag and put it into the third component (b-hat = k-hat)
195195
if (IsDipole) {
196-
bfield_vcgc[2] = bfield_mag_scgc;
196+
bfield_vcgc[2] = bfield_mag_scgc % sign(magInvLat_scgc * -1.0);
197197
bfield_vcgc[1].zeros();
198198
bfield_vcgc[0].zeros();
199199

200200
bfield_unit_vcgc[0].zeros();
201201
bfield_unit_vcgc[1].zeros();
202-
bfield_unit_vcgc[2].ones();
203-
204-
bfield_unit_vcgc[2] % sign(magInvLat_scgc * -1.0);
202+
bfield_unit_vcgc[2] = 1.0 * sign(magInvLat_scgc * -1.0);
205203

206204
// slight complication -
207205
} else

0 commit comments

Comments
 (0)