Skip to content

Commit

Permalink
FEAT: check on dimensions before advecting
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronjridley committed Nov 14, 2024
1 parent 4b9176f commit 2a4bf5a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/advance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,20 @@ bool advance(Planets &planet,
if (didWork)
didWork = neutralsMag.set_bcs(mGrid, time, indices);

// advect in the 3rd dimension (vertical), but only if we have it:
if (gGrid.get_nAlts(false) > 1) {
neutrals.advect_vertical(gGrid, time);
if (didWork & input.get_check_for_nans())
didWork = neutrals.check_for_nonfinites("After Vertical Neutral Advection");
ions.advect_vertical(gGrid, time);
}

//neutrals.exchange_old(gGrid);
//advect(gGrid, time, neutrals);

// advect in the 1st and 2nd dimensions (horizontal), but only if
// we have those dimensions:
if (gGrid.get_HasXdim() || gGrid.get_HasYdim()) {
neutrals.exchange_old(gGrid);
advect(gGrid, time, neutrals);
}
if (didWork & input.get_check_for_nans())
didWork = neutrals.check_for_nonfinites("After Horizontal Advection");

Expand Down

0 comments on commit 2a4bf5a

Please sign in to comment.