@@ -54,13 +54,11 @@ std::pair<arma_cube, arma_cube> qp_to_r_theta(arma_cube q, arma_cube p)
54
54
return {r, theta};
55
55
}
56
56
57
- arma_vec baselat_spacing (precision_t extent,
57
+ arma_vec Grid:: baselat_spacing (precision_t extent,
58
58
precision_t origin,
59
59
precision_t upper_lim,
60
60
precision_t lower_lim,
61
- int16_t nLats,
62
- precision_t spacing_factor)
63
- {
61
+ precision_t spacing_factor){
64
62
std::string function = " Grid::baselat_spacing" ;
65
63
static int iFunction = -1 ;
66
64
report.enter (function, iFunction);
@@ -147,18 +145,15 @@ arma_vec baselat_spacing(precision_t extent,
147
145
// Field line filling only needs to be redone for the "down" edges, left is the same p,q
148
146
// and then for "lower", we just shift the p,q after
149
147
150
- void Grid::fill_field_lines (arma_vec baseLats ,
148
+ void Grid::fill_field_lines (arma_vec baseLatsLoc ,
151
149
precision_t min_altRe, precision_t Gamma,
152
150
Planets planet,
153
- bool isCorner=false )
154
- {
151
+ bool isCorner=false ){
155
152
156
153
std::string function = " Grid::fill_field_lines" ;
157
154
static int iFunction = -1 ;
158
155
report.enter (function, iFunction);
159
156
160
- // int64_t nLats = baseLats.n_elem;
161
-
162
157
precision_t q_Start, delqp;
163
158
arma_mat bAlts (nLats, nAlts), bLats (nLats, nAlts);
164
159
@@ -175,7 +170,7 @@ void Grid::fill_field_lines(arma_vec baseLats,
175
170
// using L=R/sin2(theta), where theta is from north pole
176
171
arma_vec Lshells (nLats);
177
172
for (int64_t iLat = 0 ; iLat < nLats; iLat++)
178
- Lshells (iLat) = (min_altRe) / pow (sin (cPI / 2 - baseLats (iLat)), 2.0 );
173
+ Lshells (iLat) = (min_altRe) / pow (sin (cPI / 2 - baseLatsLoc (iLat)), 2.0 );
179
174
180
175
report.print (3 , " lshells calculated!" );
181
176
@@ -203,7 +198,7 @@ void Grid::fill_field_lines(arma_vec baseLats,
203
198
204
199
for (int iLat = 0 ; iLat < nLats; iLat++)
205
200
{
206
- q_Start = -cos (cPI / 2 + baseLats (iLat)) / pow (min_altRe, 2.0 );
201
+ q_Start = -cos (cPI / 2 + baseLatsLoc (iLat)) / pow (min_altRe, 2.0 );
207
202
208
203
// calculate const stride in dipole coords, same as sami2/3 (huba & joyce 2000)
209
204
// Note this is not the:
@@ -583,7 +578,7 @@ bool Grid::init_dipole_grid(Quadtree quadtree_ion, Planets planet)
583
578
// latitude of field line base:
584
579
// todo: needs support for variable stretching. it's like, halfway there.
585
580
arma_vec baseLats = baselat_spacing (size_up_norm[1 ], lower_left_norm[1 ],
586
- max_lat, min_lat, nLats, 1.0 );
581
+ max_lat, min_lat, 1.0 );
587
582
588
583
// downward sides (latitude shifted by 1/2 step):
589
584
// TODO: This only works for linear latitude spacing, which is all that's supported right now.
0 commit comments