We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa4c0bb commit b699a5eCopy full SHA for b699a5e
src/fill_grid.cpp
@@ -193,15 +193,13 @@ void Grid::fill_grid_bfield(Planets planet) {
193
// Now we modify the dipole's magnetic field to account for any imprecision.
194
// Take the bfield_mag and put it into the third component (b-hat = k-hat)
195
if (IsDipole) {
196
- bfield_vcgc[2] = bfield_mag_scgc;
+ bfield_vcgc[2] = bfield_mag_scgc % sign(magInvLat_scgc * -1.0);
197
bfield_vcgc[1].zeros();
198
bfield_vcgc[0].zeros();
199
200
bfield_unit_vcgc[0].zeros();
201
bfield_unit_vcgc[1].zeros();
202
- bfield_unit_vcgc[2].ones();
203
-
204
- bfield_unit_vcgc[2] % sign(magInvLat_scgc * -1.0);
+ bfield_unit_vcgc[2] = 1.0 * sign(magInvLat_scgc * -1.0);
205
206
// slight complication -
207
} else
0 commit comments