Skip to content

Commit 9d68304

Browse files
committed
FEAT: clean a bit and add grid matching
1 parent 33dd65c commit 9d68304

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/main/main.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,40 +37,34 @@ int main() {
3737
// cubesphere (6 root)
3838
Quadtree quadtree(input.get_grid_shape("neuGrid"));
3939
Quadtree quadtree_ion(input.get_grid_shape("ionGrid"));
40-
4140
if (!quadtree.is_ok())
4241
throw std::string("quadtree initialization failed!");
4342

4443
// Initialize MPI and parallel aspects of the code:
4544
didWork = init_parallel(quadtree, quadtree_ion);
46-
4745
if (!didWork)
4846
throw std::string("init_parallel failed!");
4947

5048
// Everything should be set for the inputs now, so write a restart file:
5149
didWork = input.write_restart();
52-
5350
if (!didWork)
5451
throw std::string("input.write_restart failed!");
5552

5653
// Initialize the EUV system:
5754
Euv euv;
58-
5955
if (!euv.is_ok())
6056
throw std::string("EUV initialization failed!");
6157

6258
// Initialize the planet:
6359
Planets planet;
6460
MPI_Barrier(aether_comm);
65-
6661
if (!planet.is_ok())
6762
throw std::string("planet initialization failed!");
6863

6964
// Initialize the indices, read the files, and perturb:
7065
Indices indices;
7166
didWork = read_and_store_indices(indices);
7267
MPI_Barrier(aether_comm);
73-
7468
if (!didWork)
7569
throw std::string("read_and_store_indices failed!");
7670

@@ -82,7 +76,6 @@ int main() {
8276
Grid gGrid("neuGrid");
8377
didWork = gGrid.init_geo_grid(quadtree, planet);
8478
MPI_Barrier(aether_comm);
85-
8679
if (!didWork)
8780
throw std::string("init_geo_grid failed!");
8881

@@ -101,13 +94,15 @@ int main() {
10194
didWork = mGrid.init_dipole_grid(quadtree_ion, planet);
10295
if (!didWork)
10396
throw std::string("init_dipole_grid failed!");
104-
}
105-
else {
97+
} else {
10698
std::cout << "Making Spherical Magnetic Grid\n";
10799
mGrid.set_IsDipole(false);
108100
didWork = mGrid.init_geo_grid(quadtree, planet);
109101
mGrid.set_IsGeoGrid(false);
110102
}
103+
104+
didWork = grid_match(gGrid, mGrid, quadtree, quadtree_ion);
105+
111106
// Initialize Neutrals on geographic grid:
112107
Neutrals neutrals(gGrid, planet, time, indices);
113108
// Initialize Neutrals on magnetic grid:

0 commit comments

Comments
 (0)