Skip to content

Commit b934b7c

Browse files
committed
coments and warings
1 parent cf9f3d0 commit b934b7c

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

Src/Amr/AMReX_AmrLevel.H

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,15 @@ void AmrLevel::RK (int order, int state_type, Real time, Real dt, int iteration,
952952
}
953953
}
954954

955+
// Store coarse AMR level RK stage data into the FillPatcher on the next
956+
// finer level. The fine level will use this data during RK substeps to
957+
// fill its ghost cells at the coarse/fine boundary (via FillRKPatch →
958+
// FillPatcher::fillRK).
959+
//
960+
// A fresh FillPatcher is always constructed here — not built lazily like
961+
// FillPatcherFill does — because this function is the *only* place the
962+
// FillPatcher for the next finer level is created. It is destroyed later
963+
// in post_timestep/resetFillPatcher after the fine level catches up.
955964
template <std::size_t order>
956965
void AmrLevel::storeRKCoarseData (int state_type, Real time, Real dt,
957966
MultiFab const& S_old,

Src/F_Interfaces/Base/AMReX_rungekutta_fi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ extern "C"
5252
[=] (Array<MultiFab,3> const& rkk)
5353
{
5454
if (store) {
55-
std::array<MultiFab const*,3> rkp{{&rkk[0], &rkk[1], &rkk[2]}};
55+
std::array<MultiFab const*,3> rkp{{rkk.data(), &rkk[1], &rkk[2]}};
5656
store(ctx, old_state, rkp.data());
5757
}
5858
},
@@ -81,7 +81,7 @@ extern "C"
8181
[=] (Array<MultiFab,4> const& rkk)
8282
{
8383
if (store) {
84-
std::array<MultiFab const*,4> rkp{{&rkk[0], &rkk[1], &rkk[2], &rkk[3]}};
84+
std::array<MultiFab const*,4> rkp{{rkk.data(), &rkk[1], &rkk[2], &rkk[3]}};
8585
store(ctx, old_state, rkp.data());
8686
}
8787
},

Tests/FortranInterface/Advection_F_RK/Source/fillpatch_mod.F90

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ subroutine fillpatch_stage (lev, time, phi, rk_order, stage, iteration, ncycle)
9090
end if
9191
end subroutine fillpatch_stage
9292

93+
! Store coarse AMR level RK stage data into the FillPatcher on the next
94+
! finer level so that the fine level can fill its ghost cells at the
95+
! coarse/fine boundary during RK substeps (via fillpatch_stage -> fill_rk).
96+
!
97+
! build_fillpatcher (not ensure_fillpatcher) is called here because this is
98+
! the only place the FillPatcher for lev+1 is created. It is not built
99+
! anywhere during fine-level advance; we must build it now. The FillPatcher
100+
! is destroyed later by reset_fillpatcher after the fine level catches up.
93101
subroutine store_rk3_fillpatcher (lev, time, dt, s_old, rk, nghost)
94102
use amr_data_module, only : fillpatcher
95103
integer, intent(in) :: lev, nghost

0 commit comments

Comments
 (0)