Skip to content

Commit

Permalink
Update sdc_iteration on all levels
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpkatz committed Jul 9, 2023
1 parent f5ff8b8 commit e317c70
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion Source/driver/Castro_advance_ctu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@ Castro::subcycle_advance_ctu(const Real time, const Real dt, int amr_iteration,

sub_iteration = 0;

int max_level_to_advance = level;

if (parent->subcyclingMode() == "None" && level == 0) {
max_level_to_advance = parent->finestLevel();
}

// Subcycle until we've reached the target time.
// Compare against a slightly smaller number to
// avoid roundoff concerns.
Expand Down Expand Up @@ -371,7 +377,10 @@ Castro::subcycle_advance_ctu(const Real time, const Real dt, int amr_iteration,
for (int n = 0; n < num_sub_iters; ++n) {

if (time_integration_method == SimplifiedSpectralDeferredCorrections) {
sdc_iteration = n;
for (int lev = level; lev <= max_level_to_advance; ++lev) {
getLevel(lev).sdc_iteration = n;
}

amrex::Print() << "Beginning SDC iteration " << n + 1 << " of " << num_sub_iters << "." << std::endl << std::endl;
}

Expand Down
4 changes: 2 additions & 2 deletions Source/hydro/Castro_ctu_hydro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1331,12 +1331,12 @@ Castro::construct_ctu_hydro_source(Real time, Real dt)
}

// Store the fluxes from this advance. For simplified SDC integration we
// only need to do this on the last iteration if we're subcycling.
// only need to do this on the last iteration.

bool add_fluxes = true;

if (time_integration_method == SimplifiedSpectralDeferredCorrections &&
sdc_iteration != sdc_iters - 1 && parent->subcyclingMode() != "None") {
sdc_iteration != sdc_iters - 1) {
add_fluxes = false;
}

Expand Down

0 comments on commit e317c70

Please sign in to comment.