Skip to content

Commit abea957

Browse files
committed
STY: Astyle, yo
1 parent 43a3c67 commit abea957

13 files changed

+114
-72
lines changed

src/advance.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,10 @@ bool advance(Planets &planet,
213213

214214
if (time.check_time_gate(input.get_dt_write_restarts())) {
215215
report.print(3, "Writing restart files");
216-
neutrals.restart_file(input.get_restartout_dir(), gGrid.get_gridtype(), DoWrite);
217-
neutralsMag.restart_file(input.get_restartout_dir(), mGrid.get_gridtype(), DoWrite);
216+
neutrals.restart_file(input.get_restartout_dir(), gGrid.get_gridtype(),
217+
DoWrite);
218+
neutralsMag.restart_file(input.get_restartout_dir(), mGrid.get_gridtype(),
219+
DoWrite);
218220
ions.restart_file(input.get_restartout_dir(), gGrid.get_gridtype(), DoWrite);
219221
ionsMag.restart_file(input.get_restartout_dir(), mGrid.get_gridtype(), DoWrite);
220222
time.restart_file(input.get_restartout_dir(), DoWrite);

src/aurora.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,18 @@ void calc_aurora(Grid grid,
178178

179179
for (int64_t iBin = 0; iBin < nBins; iBin++) {
180180
lnE = log(auroral_energies(iBin));
181+
181182
// loop through Pij values to get vector of Ci values. This is
182183
// directly from Fang et al., [2010]:
183184
for (int i = 0; i < 8; i++) {
184185
precision_t tot = 0;
186+
185187
for (int j = 0; j < 4; j++)
186188
tot = tot + Pij.at(i, j) * pow(lnE, j);
189+
187190
Ci[i] = exp(tot);
188191
}
192+
189193
CiArray.push_back(Ci);
190194
}
191195

@@ -257,6 +261,7 @@ void calc_aurora(Grid grid,
257261
arma_vec temp;
258262

259263
ionization1d.zeros();
264+
260265
for (int iBin = 0; iBin < nBins; iBin++) {
261266
Ci = CiArray[iBin];
262267
temp = calculate_fang_v2(auroral_energies(iBin),
@@ -269,7 +274,7 @@ void calc_aurora(Grid grid,
269274
}
270275

271276
// /cm3 -> /m3
272-
ionization1d = ionization1d * pcm3topm3 /100.0;
277+
ionization1d = ionization1d * pcm3topm3 / 100.0;
273278

274279
// Step 5: Distribute ionization among neutrals:
275280
// Need to figure out which species get what percentage of the

src/calc_neutral_derived.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,8 @@ void Neutrals::calc_chapman(Grid grid) {
585585
species[iSpecies].density_scgc.slice(iAlt) %
586586
species[iSpecies].scale_height_scgc.slice(iAlt);
587587

588-
species[iSpecies].rho_alt_int_scgc.slice(iAlt) = integral3d.slice(iAlt) * species[iSpecies].mass;
588+
species[iSpecies].rho_alt_int_scgc.slice(iAlt) = integral3d.slice(
589+
iAlt) * species[iSpecies].mass;
589590

590591
for (iAlt = nAlts - 2; iAlt >= 0; iAlt--) {
591592
// dr is used here instead of dalt, since we only want the radial integration, while

src/grid_spacing.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ void Grid::calc_i_grid_spacing() {
201201
di_edge.row(iX) =
202202
i_center_scgc.row(iX) - i_center_scgc.row(iX - 1);
203203
}
204+
204205
// Bottom (one sided):
205206
iX = 0;
206207
di_center_scgc.row(iX) =
@@ -226,6 +227,7 @@ void Grid::calc_i_grid_spacing() {
226227
// edge is in-line with the j center
227228
di_edge_m = di_edge_m % abs(cos(j_center_scgc));
228229
}
230+
229231
// Need a similar thing for the dipole grid here!
230232
if (iGridShape_ == iDipole_) {
231233
// do something here!
@@ -313,6 +315,7 @@ void Grid::calc_j_grid_spacing() {
313315
dj_center_m_scgc = dj_center_scgc % radius_scgc;
314316
dj_edge_m = dj_edge % radius_scgc;
315317
}
318+
316319
// Need to do something for the dipole grid?
317320

318321
// For a stretched grid, calculate some useful quantities:

src/init_geo_grid.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -172,34 +172,38 @@ bool Grid::init_geo_grid(Quadtree quadtree,
172172

173173
if (iGridShape_ == iCubesphere_) {
174174
report.print(0, "Creating Cubesphere Grid");
175+
175176
if (!Is0D & !Is1Dz)
176177
create_cubesphere_connection(quadtree);
178+
177179
IsCubeSphereGrid = true;
178180
} else {
179181
report.print(0, "Creating Spherical Grid");
182+
180183
if (!Is0D & !Is1Dz)
181184
create_sphere_connection(quadtree);
185+
182186
IsCubeSphereGrid = false;
183187
}
184188

185189
//if (input.get_do_restart() & iGridShape_ != iCubesphere_) {
186190
// report.print(1, "Restarting! Reading grid files!");
187191
// DidWork = read_restart(input.get_restartin_dir());
188192
//} else {
189-
if (iGridShape_ == iCubesphere_) {
190-
//if (input.get_do_restart())
191-
// report.print(0, "Not restarting the grid - it is too complicated!");
193+
if (iGridShape_ == iCubesphere_) {
194+
//if (input.get_do_restart())
195+
// report.print(0, "Not restarting the grid - it is too complicated!");
192196

193-
create_cubesphere_grid(quadtree);
194-
} else
195-
create_sphere_grid(quadtree);
197+
create_cubesphere_grid(quadtree);
198+
} else
199+
create_sphere_grid(quadtree);
196200

197-
//MPI_Barrier(aether_comm);
198-
create_altitudes(planet);
201+
//MPI_Barrier(aether_comm);
202+
create_altitudes(planet);
199203

200-
init_connection();
204+
init_connection();
201205

202-
//DidWork = write_restart(input.get_restartout_dir());
206+
//DidWork = write_restart(input.get_restartout_dir());
203207
//}
204208

205209
// Calculate the radius (for spherical or non-spherical)

src/init_mag_grid.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,10 @@ void Grid::fill_field_lines(arma_vec baseLatsLoc,
368368
// save the q for the "down" case:
369369
for (int64_t iLon = 0; iLon < nLons; iLon ++) {
370370
magQ_Down(iLon, iLat, iAlt) = qp2;
371+
371372
if (iLat < nLats)
372373
k_edge_scgc(iLon, iLat, iAlt) = qp2;
374+
373375
k_corner_scgc(iLon, iLat, iAlt) = qp2;
374376
}
375377
} else {
@@ -757,11 +759,11 @@ bool Grid::init_dipole_grid(Quadtree quadtree_ion, Planets planet) {
757759
// This is only down for the "down" edges, where the base latitudes are different.
758760
fill_field_lines(baseLats_down, min_alt_re, Gamma, planet, true);
759761

760-
// The baseLats are the Invariant Latitudes of the grid, so we can just fill in all of the
762+
// The baseLats are the Invariant Latitudes of the grid, so we can just fill in all of the
761763
// points with these values
762764
for (iAlt = 0; iAlt < nAlts; iAlt++)
763765
for (iLat = 0; iLat < nLats; iLat++)
764-
for (iLon = 0; iLon < nLons; iLon++)
766+
for (iLon = 0; iLon < nLons; iLon++)
765767
magInvLat_scgc(iLon, iLat, iAlt) = baseLats(iLat);
766768

767769
report.print(4, "Field-aligned Edges");

src/ions.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ Ions::Ions(Grid grid, Planets planet) {
165165

166166
if (input.get_do_restart()) {
167167
report.print(1, "Restarting! Reading ion files!");
168-
bool DidWork = restart_file(input.get_restartin_dir(), grid.get_gridtype(), DoRead);
168+
bool DidWork = restart_file(input.get_restartin_dir(), grid.get_gridtype(),
169+
DoRead);
169170

170171
if (!DidWork)
171172
std::cout << "Reading Restart for Ions Failed!!!\n";
@@ -527,7 +528,8 @@ bool Ions::restart_file(std::string dir, std::string cGridtype, bool DoRead) {
527528

528529
OutputContainer RestartContainer;
529530
RestartContainer.set_directory(dir);
530-
RestartContainer.set_filename("ions_" + cMember + "_" + cGrid + "_" + cGridtype);
531+
RestartContainer.set_filename("ions_" + cMember + "_" + cGrid + "_" +
532+
cGridtype);
531533

532534
try {
533535
if (DoRead)

src/neutrals.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,8 @@ int Neutrals::get_species_id(std::string name) {
422422
// Read/Write restart files for the neutrals
423423
//----------------------------------------------------------------------
424424

425-
bool Neutrals::restart_file(std::string dir, std::string cGridtype, bool DoRead) {
425+
bool Neutrals::restart_file(std::string dir, std::string cGridtype,
426+
bool DoRead) {
426427

427428
std::string filename;
428429
bool DidWork = true;
@@ -431,7 +432,8 @@ bool Neutrals::restart_file(std::string dir, std::string cGridtype, bool DoRead)
431432

432433
OutputContainer RestartContainer;
433434
RestartContainer.set_directory(dir);
434-
RestartContainer.set_filename("neutrals_" + cMember + "_" + cGrid + "_" + cGridtype);
435+
RestartContainer.set_filename("neutrals_" + cMember + "_" + cGrid + "_" +
436+
cGridtype);
435437

436438
try {
437439
if (DoRead)

src/neutrals_ics.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,13 @@ bool Neutrals::initial_conditions(Grid grid,
178178
species[iSpecies].density_scgc.slice(0).
179179
fill(species[iSpecies].lower_bc_density);
180180
}
181+
181182
report.print(2, "Calculating scale height");
182183
calc_scale_height(grid);
183184
report.print(2, "setting lower BCs");
184185
set_lower_bcs(grid, time, indices);
185186
report.print(2, "Filling with hydrostatic");
187+
186188
for (int iSpecies = 0; iSpecies < nSpecies; iSpecies++)
187189
fill_with_hydrostatic(iSpecies, nGCs, nAlts, grid);
188190
} // type = planet

src/quadtree.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@ int64_t iProcQuery = -1;
1818
Quadtree::Quadtree(std::string shape) {
1919
if (shape == "cubesphere")
2020
nRootNodes = 6;
21+
2122
if (shape == "sphere")
2223
nRootNodes = 1;
24+
2325
if (shape == "dipole")
2426
nRootNodes = 1;
27+
2528
if (shape == "dipole2")
2629
nRootNodes = 2;
30+
2731
if (shape == "dipole6")
2832
nRootNodes = 6;
2933
}
@@ -82,7 +86,7 @@ void Quadtree::build(std::string gridtype) {
8286
ups = Dipole6::UPS;
8387
IsSphere = true;
8488
}
85-
89+
8690
arma_vec o(3), r(3), u(3);
8791

8892
// This captures the limits of the sphere, independent of what the

0 commit comments

Comments
 (0)